map/docs/datacollect/README.md

104 lines
2.2 KiB
Markdown
Raw Normal View History

2024-07-02 16:17:40 +08:00
# 数据采集
2024-07-02 15:58:34 +08:00
2024-07-02 16:17:40 +08:00
## 采集配置说明
2024-07-02 15:58:34 +08:00
采集程序配置存放在: `/das/conf/collector.json`
如果系统配置更新将生成配置更新文件: `/das/conf/collector.json.update`
2024-07-03 09:22:02 +08:00
配置文件内容如下:
```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": {
}
}
]
}
]
}
```
2024-07-02 16:17:40 +08:00
## 采集程序与系统交互通道
2024-07-02 15:58:34 +08:00
2024-07-03 09:22:02 +08:00
采集程序与系统间采用Websocket方式通讯 访问系统服务器端口: 7790
报文格式为`json`, 字符集: `utf-8`
### 通道建立
采集程序建立连接时需要带上自身节点ID连接URL如下所示:
2024-07-02 15:59:43 +08:00
2024-07-03 09:22:02 +08:00
`ws://127.0.0.1:7790/gate/{nodeId}`
2024-07-02 16:45:40 +08:00
## 通讯报文
### 节点上线请求
2024-07-03 09:22:02 +08:00
?> 方向: `采集程序` -> `系统`
2024-07-02 16:45:40 +08:00
```json
{
//节点ID
"nodeId" : "nx10928234",
//消息ID
"messageId": "123512351235123",
//命令
"action" : "online"
}
```