You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
3 years ago
|
# 边缘网关即时采集
|
||
|
>本文档描写IOT边缘网关即时采集的设计思想及方案概要,不涉及具体实现方案和技术实现方案。
|
||
|
##功能
|
||
|
实现边缘设备即时采集,平台点击下发按钮后进行即时的采集指令下发,并将返回数据或错误显示在平台上。
|
||
|
##通讯流程
|
||
|
1. 平台即时采集指令下发(kafka)
|
||
|
2. edge server 处理封装mqtt消息格式并推送
|
||
|
1. edge 处理能力驱动及时采集
|
||
|
1. kafka上报数据,边缘网关回传数据信息到平台
|
||
|
##环境配置
|
||
|
测试环境:windows
|
||
|
> "db.conn": "postgres://postgres:postgres@10.8.30.156:5432/iota20211206?sslmode=disable"
|
||
|
> "msg.mqtt.center": "10.8.30.157:31883"
|
||
|
> "kafka.brokers":"10.8.30.190:9092"
|
||
|
|
||
|
##通讯设计
|
||
|
|
||
|
- 平台->edge server
|
||
|
>func NewSyncService(conf *util.Properties, consumerTopic string, consumer kafka.ReceiverFunc)
|
||
|
>
|
||
|
>SyncService.go
|
||
|
|
||
|
|
||
|
- edge server-> edge
|
||
|
>func (m *Manager) onConsumer(data []byte)
|
||
|
>
|
||
|
> manager.go
|
||
|
|
||
|
|
||
|
- edge —>平台
|
||
|
>func (s *SyncController) onConsumer(value string) (msg *mqtt.MqttMsg, err error)
|
||
|
>
|
||
|
>controller.go
|