# 策略-需量管理与防逆流 ## 上报防逆流过需策略 * **Topic:** * 用户自定义MQTT: `v1/wudun/${PRODUCT_KEY}/${DEVICE}/``streaming_overdemand/list``/post` * 平台默认MQTT: `v1/user/${TENANT}/${DEVICE}/``streaming_overdemand/list``/post` * **权限:**上报 * **Payload主结构**
参数类型是否必填描述范围样例
midUUIDtrue消息ID-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrtrue消息类型streaming_overdemand_liststreaming_overdemand_list
datadatatrue消息内容-Payload - data
device_uidstrtrue(二级)设备UID-iYRkfVpi77
timestampinttrue消息时间戳(单位:毫秒)(0, ∞)1696837112000
* **Payload - data: \StreamingOverDemand**
参数类型是否必填描述范围样例
idinttrue过需逆流策略ID1
device_typeinttrue设备类型

2-储能设备

3-光伏

4-充电桩

2
devicesanytrue设备列表-[]emsDevice/[]photovoltaic/[]pail
elemetereleMetertrue电表-eleMeter
ele_meter_idinttrue电表id1
streaming_conditioninttrue防逆流执行条件-5000
streaming_statusinttrue

防逆流状态

1-启用

2-禁用

1
over_demand_condition[]inttrue每月防过需执行条件(1-12月)-[5000,6000,5000,5000,6000,5000,5000,6000,5000,5000,6000,5000]
over_demand_statusinttrue防逆流状态

1-启用

2-禁用

1
dynamic_demandinttrue动态需量6000
dynamic_demand_percentageinttrue动态需量追峰比例90
current_over_demand_conditioninttrue当前月份的过需条件2000
updated_bystrtrue更新人user: 1-admin
created_atstrtrue创建时间2024-06-06T08:59:20.21309056Z
updated_atstrtrue更新时间2024-06-06T08:59:20.21309056Z
* **Payload - emsDevice**
参数类型是否必填描述范围样例
uidstrtrue设备UID-DGHDJSJKD-1
namestrtrue设备名称-ems设备
site_namestrtrue站点名称-ems站点
locationstrtrue详细地理位置-wudun
longitudefloattrue经度--
latitudefloattrue纬度-
levelinttrueEMS等级[1, 2]1
typestrtrue设备类型-ems
running_statusinttrue

运行状态

1-运行

2-离线

3-故障

[1,2,3]1
hoststrtrue地址-192.168.0.1
portstrtrue端口[0,65525]2171
licensestrtrue激活码-2YIZedmOtl4pcqo1EA4zhM5gofDI
* **Payload - eleMeter**
参数类型是否必填描述样例
uidstrtrue电表UID-QmqEhterhgrzS66grew-1
station_namestrtrue站点名称-站点1
portinttrue端口[0,65535]1
namestrtrue设备名称-东区变压器
elec_device_typeeleDeviceTypetrue电表类型对象--
rateinttrue倍率(0, ∞)100
running_statusinttrue

运行状态

1-在线

2-离线

[1,2]1
* **Payload示例** {% code lineNumbers="true" %} ```json { "trace_id": "577f5df0-65d6-432d-8aac-0116e9530152", "mid": "ee2e8f09-b280-4e4d-bcb9-1529b703cfed", "type": "streaming_overdemand_list", "data": [{ "id": 4, "device_type": 2, "ele_meter_id": 10, "ele_meter": { "id": 10, "proto_type": 1, "proto_id": 1, "slave_id": 1, "host": "192.168.77.94", "port": 1, "com_addr": "", "com_no": 0, "baud_rate": 0, "data_bits": 0, "stop_bits": 0, "parity": "", "uid": "", "station_name": "测试站点", "name": "test", "ele_device_type_id": 1, "ele_device_type": { "id": 1, "name": "Acrel-ADW300" }, "running_status": 2, "direction": 1, "pt": 1, "ct": 1, "purpose": 1, "meter_ids": null, "associate_meters": null }, "devices": [ { "uid": "", "name": "设备208", "site_name": "测试站点", "location": "", "longitude": 0, "latitude": 0, "statistics_port": 1504, "cooling_method": 1, "level": 1, "charges": null, "pcs_reboot": 0, "bms_reboot": 0, "license": "00000011", "type": "Linux", "running_status": 1, "id": 3, "proto_type": 1, "proto_id": 0, "slave_id": 1, "host": "192.168.77.208", "port": 1502, "com_addr": "", "com_no": 0, "baud_rate": 0, "data_bits": 0, "stop_bits": 0, "parity": "", "created_at": "2024-04-24T02:11:01.16135116Z", "updated_at": "2024-06-07T07:32:32.1991944Z" }, { "uid": "", "name": "设备210", "site_name": "测试站点", "location": "", "longitude": 0, "latitude": 0, "statistics_port": 1504, "cooling_method": 1, "level": 1, "charges": null, "pcs_reboot": 1, "bms_reboot": 0, "license": "", "type": "", "running_status": 1, "id": 4, "proto_type": 1, "proto_id": 0, "slave_id": 1, "host": "192.168.77.210", "port": 1502, "com_addr": "", "com_no": 0, "baud_rate": 0, "data_bits": 0, "stop_bits": 0, "parity": "", "created_at": "2024-05-08T02:03:48.4397178Z", "updated_at": "2024-06-07T07:32:32.2174462Z" } ], "over_demand_status": 1, "over_demand_condition": [ 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000 ], "current_over_demand_condition": 2000, "dynamic_demand_status": 1, "dynamic_demand": 0, "dynamic_demand_percentage": 60, "streaming_status": 1, "streaming_condition": 2000, "created_at": "2024-06-06T08:59:20.21309056Z", "updated_at": "2024-06-06T08:59:20.21309056Z", "updated_by": "user: 1-admin" }], "device_uid": "${DEVICE_UID}", "timestamp": 1695265371000 } ``` {% endcode %} ## 平台请求同步防逆流过需策略 * **Topic:** * 用户自定义MQTT:`v1/wudun/${PRODUCT_KEY}/${DEVICE}/``streaming_overdemand/sync``/command` * 平台默认MQTT: `v1/user/${TENANT}/${DEVICE}/``streaming_overdemand/sync``/command` * **权限:**发布 * **Payload主结构**
参数类型是否必填描述范围样例
midUUIDtrue消息ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
replyUUIDtrue所回复消息的mid-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrtrue消息类型streaming_overdemand_syncstreaming_overdemand_sync
codeinttrue响应代码-见响应代码
msgstrfalse失败原因-参数错误
device_uidstrtrue(二级)设备UID-iYRkfVpi77
timestampinttrue消息时间戳(单位:毫秒)(0, ∞)1696837112000
* **响应代码**
错误码描述说明
200下发成功
400参数有误
* **Payload示例** ```json { "trace_id": "577f5df0-65d6-432d-8aac-0116e9530152", "mid": "4c5b3c27-cea8-4ea1-a936-41fd3596e0e9", "type": "streaming_overdemand_sync", "code": 200, "msg": "", "device_uid": "iYRkfVpi77", "timestamp": 1695265671000 } ``` ### 同步防逆流过需电策略响应 * **Topic:** * 用户自定义MQTT:`v1/wudun/${PRODUCT_KEY}/${DEVICE}/``streaming_overdemand/sync``/result` * 平台默认MQTT: `v1/user/${TENANT}/${DEVICE}/``streaming_overdemand/sync``/result` * **权限:**订阅 * **Payload主结构**
参数类型是否必填描述范围样例
midUUIDtrue消息ID-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrtrue消息类型streaming_overdemand_syncstreaming_overdemand_sync
datadatatrue消息内容-Payload - data
device_uidstrtrue(二级)设备UID-iYRkfVpi77
timestampinttrue消息时间戳(单位:毫秒)(0, ∞)1696837112000
* **Payload - data**
参数类型是否必填描述范围样例
idinttrue过需逆流策略ID1
device_typeinttrue设备类型

2-储能设备

3-光伏

4-充电桩

2
devicesanytrue设备列表-[]emsDevice/[]photovoltaic/[]pail
elemetereleMetertrue电表-eleMeter
ele_meter_idinttrue电表id1
streaming_conditioninttrue防逆流执行条件-5000
streaming_statusinttrue

防逆流状态

1-启用

2-禁用

1
over_demand_condition[]inttrue每月防过需执行条件(1-12月)-[5000,6000,5000,5000,6000,5000,5000,6000,5000,5000,6000,5000]
over_demand_statusinttrue防逆流状态

1-启用

2-禁用

1
dynamic_demandinttrue动态需量6000
dynamic_demand_percentageinttrue动态需量追峰比例90
current_over_demand_conditioninttrue当前月份的过需条件2000
updated_bystrtrue更新人user: 1-admin
created_atstrtrue创建时间2024-06-06T08:59:20.21309056Z
updated_atstrtrue更新时间2024-06-06T08:59:20.21309056Z
* **Payload - emsDevice**
参数类型是否必填描述范围样例
uidstrtrue设备UID-DGHDJSJKD-1
namestrtrue设备名称-ems设备
site_namestrtrue站点名称-ems站点
locationstrtrue详细地理位置-wudun
longitudefloattrue经度-
latitudefloattrue纬度
levelinttrueEMS等级[1, 2]1
typestrtrue设备类型-ems
running_statusinttrue

运行状态

1-运行

2-离线

3-故障

[1,2,3]1
hoststrtrue地址-192.168.0.1
portstrtrue端口[0,65525]2171
licensestrtrue激活码-2YIZedmOtl4pcqo1EA4zhM5gofDI
* **Payload - eleMeter**
参数类型是否必填描述样例
uidstrtrue电表UID-QmqEhterhgrzS66grew-1
station_namestrtrue站点名称-站点1
portinttrue端口[0,65535]1
namestrtrue设备名称-东区变压器
elec_device_typeeleDeviceTypetrue电表类型对象--
rateinttrue倍率(0, ∞)100
running_statusinttrue

运行状态

1-在线

2-离线

[1,2]1
* **Payload示例** {% code lineNumbers="true" %} ```json { "trace_id": "577f5df0-65d6-432d-8aac-0116e9530152", "mid": "ee2e8f09-b280-4e4d-bcb9-1529b703cfed", "reply": "ee2e8f09-b280-4e4d-bcb9-1529b703cfed", "type": "streaming_overdemand_sync", "data": [{ "id": 4, "ele_meter_id": 10, "ele_meter": { "id": 10, "proto_type": 1, "proto_id": 1, "slave_id": 1, "host": "192.168.77.94", "port": 1, "com_addr": "", "com_no": 0, "baud_rate": 0, "data_bits": 0, "stop_bits": 0, "parity": "", "uid": "", "station_name": "测试站点", "name": "test", "ele_device_type_id": 1, "ele_device_type": { "id": 1, "name": "Acrel-ADW300" }, "running_status": 2, "direction": 1, "pt": 1, "ct": 1, "purpose": 1, "meter_ids": null, "associate_meters": null }, "devices": [ { "uid": "", "name": "设备208", "site_name": "测试站点", "location": "", "longitude": 0, "latitude": 0, "statistics_port": 1504, "cooling_method": 1, "level": 1, "charges": null, "pcs_reboot": 0, "bms_reboot": 0, "license": "00000011", "type": "Linux", "running_status": 1, "id": 3, "proto_type": 1, "proto_id": 0, "slave_id": 1, "host": "192.168.77.208", "port": 1502, "com_addr": "", "com_no": 0, "baud_rate": 0, "data_bits": 0, "stop_bits": 0, "parity": "", "created_at": "2024-04-24T02:11:01.16135116Z", "updated_at": "2024-06-07T07:32:32.1991944Z" }, { "uid": "", "name": "设备210", "site_name": "测试站点", "location": "", "longitude": 0, "latitude": 0, "statistics_port": 1504, "cooling_method": 1, "level": 1, "charges": null, "pcs_reboot": 1, "bms_reboot": 0, "license": "", "type": "", "running_status": 1, "id": 4, "proto_type": 1, "proto_id": 0, "slave_id": 1, "host": "192.168.77.210", "port": 1502, "com_addr": "", "com_no": 0, "baud_rate": 0, "data_bits": 0, "stop_bits": 0, "parity": "", "created_at": "2024-05-08T02:03:48.4397178Z", "updated_at": "2024-06-07T07:32:32.2174462Z" } ], "over_demand_status": 1, "over_demand_condition": [ 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000 ], "current_over_demand_condition": 2000, "dynamic_demand_status": 1, "dynamic_demand": 0, "dynamic_demand_percentage": 60, "streaming_status": 1, "streaming_condition": 2000, "created_at": "2024-06-06T08:59:20.21309056Z", "updated_at": "2024-06-06T08:59:20.21309056Z", "updated_by": "user: 1-admin" }], "device_uid": "${DEVICE_UID}", "timestamp": 1695265371000 } ``` {% endcode %} ## 下发创建防逆流过需电策略指令 * **Topic:** * 用户自定义MQTT:`v1/wudun/${PRODUCT_KEY}/${DEVICE}/``streaming_overdemand/create``/command` * 平台默认MQTT: `v1/user/${TENANT}/${DEVICE}/``streaming_overdemand/create``/command` * **权限:**订阅 * **Payload主结构**
参数类型是否必填描述范围样例
midUUIDtrue消息ID-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrtrue消息类型streaming_overdemand_createstreaming_overdemand_create
datadatatrue消息内容-Payload - data
device_uidstrtrue(二级)设备UID-iYRkfVpi77
timestampinttrue消息时间戳(单位:毫秒)(0, ∞)1696837112000
* **Payload - Data/StreamingOverDemand** *
参数类型是否必填描述范围样例
ele_meter_idinttrue电表设备ID-1
streaming_statusinttrue防逆流状态 1-启用 2-禁用1
streaming_conditioninttrue防逆流执行条件-1000
over_demand_statusinttrue防过需状态 1-启用 2-禁用2
over_demand_condition[]inttrue防过需执行条件分为12个月份,每个月份一个值
[
              2000,
              2000,
              2000,
              2000,
              2000,
              2000,
              2000,
              2000,
              2000,
              2000,
              2000,
              2000
            ],
    
dynamic_demand_statusinttrue动态需量控制状态 1-启用 2-禁用1
dynamic_demand_percentageinttrue动态需量追峰比例百分比90
* **Payload示例** {% code lineNumbers="true" %} ```json { "trace_id": "577f5df0-65d6-432d-8aac-0116e9530152", "mid": "ee2e8f09-b280-4e4d-bcb9-1529b703cfed", "reply": "ee2e8f09-b280-4e4d-bcb9-1529b703cfed", "type": "streaming_overdemand_create", "data": [ { "over_demand_status": 1, "streaming_status": 1, "dynamic_demand_status": 1, "over_demand_condition": [ 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000 ], "ele_meter_id": 9, "dynamic_demand_percentage": 80, "streaming_condition": 1000 }], "device_uid": "${DEVICE_UID}", "timestamp": 1695265371000 } ``` {% endcode %} ### 创建防过需防逆流策略响应 * **Topic:** * 用户自定义MQTT:`v1/wudun/${PRODUCT_KEY}/${DEVICE}/``streaming_overdemand/create``/result` * 平台默认MQTT: `v1/user/${TENANT}/${DEVICE}/``streaming_overdemand/create``/result` * **权限:**订阅 * **Payload主结构**
参数类型是否必填描述范围样例
midUUIDtrue消息ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
replyUUIDtrue所回复消息的mid-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrtrue消息类型streaming_overdemand_createstreaming_overdemand_create
codeinttrue响应代码-见响应代码
datadatatrueData见Data
msgstrfalse失败原因-参数错误
device_uidstrtrue(二级)设备UID-iYRkfVpi77
timestampinttrue消息时间戳(单位:毫秒)(0, ∞)1696837112000
* **Data** * | 参数 | 类型 | 说明 | | -- | --- | --------- | | id | int | 防过需逆流策略id | * **响应代码**
错误码描述说明
200下发成功
400参数有误
* **Payload示例** ```json { "trace_id": "577f5df0-65d6-432d-8aac-0116e9530152", "mid": "4c5b3c27-cea8-4ea1-a936-41fd3596e0e9", "type": "streaming_overdemand_create", "reply": "3e681859-6917-4b9a-9afd-3f162cd185bd", "code": 200, "data": { "id": 1 }, "msg": "", "device_uid": "iYRkfVpi77", "timestamp": 1695265671000 } ``` ## 下发更新防逆流过需电策略指令 * **Topic:** * 用户自定义MQTT:`v1/wudun/${PRODUCT_KEY}/${DEVICE}/``streaming_overdemand/update``/command` * 平台默认MQTT: `v1/user/${TENANT}/${DEVICE}/``streaming_overdemand/update``/command` * **权限:**订阅 * **Payload主结构**
参数类型是否必填描述范围样例
midUUIDtrue消息ID-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrtrue消息类型streaming_overdemand_updatestreaming_overdemand_update
datadatatrue消息内容-Payload - data
device_uidstrtrue(二级)设备UID-iYRkfVpi77
timestampinttrue消息时间戳(单位:毫秒)(0, ∞)1696837112000
* **Payload - Data: \StreamingOverDemandUpdateCommand(其他字段见StreamingOverDemand)** | 参数 | 类型 | 是否必填 | 描述 | 样例 | | -- | --- | ---- | ---------- | -- | | id | int | 是 | 防过需防逆流策略ID | 1 | * **Payload示例** {% code lineNumbers="true" %} ```json { "trace_id": "577f5df0-65d6-432d-8aac-0116e9530152", "mid": "ee2e8f09-b280-4e4d-bcb9-1529b703cfed", "reply": "ee2e8f09-b280-4e4d-bcb9-1529b703cfed", "type": "streaming_overdemand_update", "data": [ { "id": 1, "over_demand_status": 1, "streaming_status": 1, "dynamic_demand_status": 1, "over_demand_condition": [ 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000 ], "ele_meter_id": 9, "dynamic_demand_percentage": 80, "streaming_condition": 1000 }], "device_uid": "${DEVICE_UID}", "timestamp": 1695265371000 } ``` {% endcode %} ### 更新防过需防逆流策略响应 * **Topic:** * 用户自定义MQTT:`v1/wudun/${PRODUCT_KEY}/${DEVICE}/``streaming_overdemand/update``/result` * 平台默认MQTT: `v1/user/${TENANT}/${DEVICE}/``streaming_overdemand/update``/result` * **权限:**订阅 * **Payload主结构**
参数类型是否必填描述范围样例
midUUIDtrue消息ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
replyUUIDtrue所回复消息的mid-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrtrue消息类型streaming_overdemand_updatestreaming_overdemand_update
codeinttrue响应代码-见响应代码
msgstrfalse失败原因-参数错误
device_uidstrtrue(二级)设备UID-iYRkfVpi77
timestampinttrue消息时间戳(单位:毫秒)(0, ∞)1696837112000
* **响应代码**
错误码描述说明
200下发成功
400参数有误
* **Payload示例** ```json { "trace_id": "577f5df0-65d6-432d-8aac-0116e9530152", "mid": "4c5b3c27-cea8-4ea1-a936-41fd3596e0e9", "type": "streaming_overdemand_update", "reply": "3e681859-6917-4b9a-9afd-3f162cd185bd", "code": 200, "msg": "", "device_uid": "iYRkfVpi77", "timestamp": 1695265671000 } ``` ## 下发删除防逆流过需电策略指令 * **Topic:** * 用户自定义MQTT:`v1/wudun/${PRODUCT_KEY}/${DEVICE}/``streaming_overdemand/delete``/command` * 平台默认MQTT: `v1/user/${TENANT}/${DEVICE}/``streaming_overdemand/delete``/command` * **权限:**订阅 * **Payload主结构**
参数类型是否必填描述范围样例
midUUIDtrue消息ID-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrtrue消息类型streaming_overdemand_deletestreaming_overdemand_delete
datadatatrue消息内容-Payload - data
device_uidstrtrue(二级)设备UID-iYRkfVpi77
timestampinttrue消息时间戳(单位:毫秒)(0, ∞)1696837112000
* **Payload - Data/StreamingOverDemandDeleteCommand** | 参数 | 类型 | 是否必填 | 描述 | 样例 | | -- | --- | ---- | ---------- | -- | | id | int | 是 | 防过需防逆流策略ID | 1 | * **Payload示例** {% code lineNumbers="true" %} ```json { "trace_id": "577f5df0-65d6-432d-8aac-0116e9530152", "mid": "ee2e8f09-b280-4e4d-bcb9-1529b703cfed", "reply": "ee2e8f09-b280-4e4d-bcb9-1529b703cfed", "type": "streaming_overdemand_delete", "data": [{ "id": 1, }], "device_uid": "${DEVICE_UID}", "timestamp": 1695265371000 } ``` {% endcode %} ### 删除防过需防逆流策略响应 * **Topic:** * 用户自定义MQTT:`v1/wudun/${PRODUCT_KEY}/${DEVICE}/``streaming_overdemand/delete``/result` * 平台默认MQTT: `v1/user/${TENANT}/${DEVICE}/``streaming_overdemand/delete``/result` * **权限:**订阅 * **Payload主结构**
参数类型是否必填描述范围样例
midUUIDtrue消息ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
replyUUIDtrue所回复消息的mid-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrtrue消息类型streaming_overdemand_deletestreaming_overdemand_delete
codeinttrue响应代码-见响应代码
msgstrfalse失败原因-参数错误
device_uidstrtrue(二级)设备UID-iYRkfVpi77
timestampinttrue消息时间戳(单位:毫秒)(0, ∞)1696837112000
* **响应代码**
错误码描述说明
200下发成功
400参数有误
* **Payload示例** ```json { "trace_id": "577f5df0-65d6-432d-8aac-0116e9530152", "mid": "4c5b3c27-cea8-4ea1-a936-41fd3596e0e9", "type": "streaming_overdemand_delete", "reply": "3e681859-6917-4b9a-9afd-3f162cd185bd", "code": 200, "msg": "", "device_uid": "iYRkfVpi77", "timestamp": 1695265671000 } ```