From d36b8a04ab249236b9beeb62e861beb9fbeb53f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=B7=E6=88=90=E4=BC=9F?= Date: Wed, 3 Jul 2024 13:17:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=A1=A3=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/datacollect/README.md | 66 +++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 8 deletions(-) diff --git a/docs/datacollect/README.md b/docs/datacollect/README.md index d91e354b..99ff6f36 100644 --- a/docs/datacollect/README.md +++ b/docs/datacollect/README.md @@ -94,19 +94,69 @@ `ws://127.0.0.1:7790/gate/{nodeId}` +PS: 同一节点只允许建立一条连接。 + ## 通讯报文 -### 节点上线请求 - -?> 方向: `采集程序` -> `系统` +### 报文格式 ```json { - //节点ID - "nodeId" : "nx10928234", - //消息ID - "messageId": "123512351235123", //命令 - "action" : "online" + "cmd": "heartbeat", + //命令ID + "cmdId": "123123", + //发送时间(毫秒) + "time": 123123123123, + //数据体 + "data": {} } ``` + +### 节点心跳报文 + +?> 方向: `采集程序` -> `系统` + +**命令:** `heartbeat` + +**数据体:** +```json +{ + //心跳生存时间(毫秒) + "ttl": 30000, + //终端状态, 0 - 离线, 1 - 在线 + "status": 0, + //通讯链路监控信息 + "links": [ + { + //通讯链路IRN + "linkId": 3444, + //通讯链路状态 + "online": true + }, + { + "linkId": 123, + "online": false + } + ] +} +``` +### 实时数据上报 + +?> 方向: `采集程序` -> `系统` + +**命令:** `realdata` + +**数据体:** +```json +{ + //key为设备ID + "1123451235": { + //key为属性名 + "Ia": 123.1, + "Ib": 122.1, + "Ic": 123.1, + "Switch01": 1 + } +} +``` \ No newline at end of file