更新文档

This commit is contained in:
谷成伟 2024-07-03 09:22:02 +08:00
parent 73e310a2ae
commit 83d37d44d0

View File

@ -6,19 +6,90 @@
如果系统配置更新将生成配置更新文件: `/das/conf/collector.json.update`
!> 此处为配置文件的内容说明。
配置文件内容如下:
```json
{
//版本号
"version": 101,
//配置创建时间(毫秒值)
"createTime": 1235235623433,
//节点ID
"nodeId": "nx10928234",
//链路列表
"links" : [
{
//链路ID
"linkId": "1235123",
//链路名称
"linkName": "1#风机",
//协议号
"protocol": 1,
//协议参数
"params": {},
"devices": ["11234131","1234123"]
}
],
//物模型信息
"equipments": [
{
//设备ID
"id": "11234131",
//属性列表
"attrs":[
{
//属性名
"name": "Ia",
//属性类型
"type": "yc",
//属性参数
"params": {
}
},
{
"name": "Ib",
"type": "yc",
"params": {
}
}
],
//服务列表
"services": [
{
//服务名
"name": "start",
//服务类型
"type": "yk",
//服务参数
"params": {
}
}
]
}
]
}
```
## 采集程序与系统交互通道
采集程序与系统间采用Websocket方式通讯 访问本地断开端口: 7790 。
采集程序与系统间采用Websocket方式通讯 访问系统服务器端口: 7790
报文格式为`json`
报文格式为`json`, 字符集: `utf-8`
### 通道建立
采集程序建立连接时需要带上自身节点ID连接URL如下所示:
`ws://127.0.0.1:7790/gate/{nodeId}`
## 通讯报文
### 节点上线请求
?> 方向: `采集` -> `系统`
?> 方向: `采集程序` -> `系统`
```json
{
@ -30,21 +101,3 @@
"action" : "online"
}
```
### 节点上线响应
?> 方向: `系统` -> `采集`
```json
{
//节点ID
"nodeId" : "nx10928234",
//消息ID
"messageId": "123512351235123",
//命令
"action" : "online",
//名称执行结果
"result" : true,
//出错时的消息。
"error" : ""
}