省网健康评分API是基于配网终端扣分标准的综合评分系统,用于对终端设备进行全局静态健康评分。 该API通过评估设备的服役年限、在线率、遥控失败次数、晨操失败次数、异常SOE信号数量以及多种设备告警信号, 计算出一个综合的健康分数,以反映设备的整体健康状况。
此API与基于SOE事件的动态评分接口(例如:https://ccs.hostcache.com/devicehealth/v1.1/)不同,
它侧重于设备的长期运行状态和静态配置,而非短期事件的影响。
https://ccs.hostcache.com/calc/v1.1/
支持 HTTP GET 或 HTTP POST 请求。
请注意,本接口不支持 JSON POST 请求,仅支持传统的 application/x-www-form-urlencoded 格式的 POST 请求。
以下是调用省网健康评分API时可以使用的请求参数:
| 参数名 | 类型 | 是否必选 | 说明 |
|---|---|---|---|
service_years |
Integer | 是 | 设备的服役年限。 |
online_rate |
Float/Integer | 是 | 设备的在线率,通常为百分比值(例如:99.5)。 |
remote_control_failures |
Integer | 否 | 遥控失败的次数。如果未提供,则默认为0。 |
morning_check_failures |
Integer | 否 | 晨操失败的次数。如果未提供,则默认为0。 |
abnormal_soe_signals |
Integer | 否 | 异常SOE信号的数量。如果未提供,则默认为0。 |
device_alarms |
String | 否 |
设备告警信号列表。多个告警信号之间请使用英文逗号 (,) 分隔。
支持的告警信号包括但不限于:
device_alarms=电源模块失电信号,PT断线
|
GET https://ccs.hostcache.com/calc/v1.1/?service_years=5&online_rate=99.8&remote_control_failures=2&device_alarms=电源模块失电信号,PT断线
POST https://ccs.hostcache.com/calc/v1.1/
Content-Type: application/x-www-form-urlencoded
service_years=5&online_rate=99.8&remote_control_failures=2&device_alarms=电源模块失电信号,PT断线
API返回结果为JSON格式。
当请求参数不符合要求时,API将返回以下错误信息:
service_years 或 online_rate:
{ "success": 0, "error": "service_years and online_rate are needed" }
错误说明:请求中未提供必需的 service_years 或 online_rate 参数。
成功请求将返回一个JSON对象,其中包含最终得分、各项扣分详情以及开关系数。
{
"final_score": "60.00",
"soe_signal_deduction": 0,
"service_years_deduction": 10,
"remote_control_deduction": 0,
"morning_check_deduction": 0,
"switch_coefficient": 1,
"online_rate_deduction": 30,
"total_deduction": 40
}
字段说明:
final_score: 最终健康评分。soe_signal_deduction: 异常SOE信号扣分。service_years_deduction: 服役年限扣分。remote_control_deduction: 遥控失败扣分。morning_check_deduction: 晨操失败扣分。switch_coefficient: 开关系数,用于调整最终评分。online_rate_deduction: 在线率扣分。total_deduction: 总扣分。本API的Web客户端(终端设备评分计算器)地址为: https://smartdocs.be/manual/calc。 您可以通过该页面直观地了解评分计算的各项参数和结果。