消息通信Topic

大约 4 分钟

消息通信Topic

什么是Topic

Topic作为所有设备发布和订阅之间最重要的传输中介,所有具有MQTT通信能力的设备(网关设备或者子设备),都能通过对应的Topic实现消息的发送和接收

Topic格式

Topic由多个段组成,各个段的说明如图所示:

已有的Topic段:

固定部分产品id设备id。可为网关id,也可为子设备id固定部分模块响应/动作/gateway(按需)
sys{product_id}{device_id}thingheart:心跳up:上报
ntp:校时set:写值
properties:属性response:响应
service:服务geteway:网关
event:事件
status:状态

Topic列表

此处是平台内置的Topic列表

分类功能topic发布者订阅者说明
系统基本功能心跳sys/{product_id}/{device_id}/thing/heart网关/设备平台device_id为网关id
心跳回复sys/{product_id}/{device_id}/thing/heart/response平台网关/设备device_id为网关id
时间校准sys/{product_id}/{device_id}/thing/ntp网关/设备平台device_id为网关id
时间校准回复sys/{product_id}/{device_id}/thing/ntp/response平台网关/设备device_id为网关id
设备属性属性上报sys/{product_id}/{device_id}/thing/properties/up网关/设备平台device_id网关id或子设备id
属性上报回复sys/{product_id}/{device_id}/thing/properties/up/response平台网关/设备device_id网关id或子设备id
批量属性上报sys/{product_id}/{device_id}/thing/properties/gateway/up网关/设备平台device_id为网关id
批量属性上报回复sys/{product_id}/{device_id}/thing/properties/gateway/up/response平台网关/设备device_id为网关id
属性查询全量sys/{product_id}/{device_id}/thing/properties/gateway/get/all平台网关/设备device_id为网关id
属性写值sys/{product_id}/{device_id}/thing/properties/set平台网关/设备device_id为子设备id
属性写值回复sys/{product_id}/{device_id}/thing/properties/set/response网关/设备平台device_id为子设备id
属性查询sys/{product_id}/{device_id}/thing/properties/get平台网关/设备device_id为子设备id
属性查询回复sys/{product_id}/{device_id}/thing/properties/get/response网关/设备平台device_id为子设备id
事件事件上报sys/{product_id}/{device_id}/thing/event/up网关/设备平台device_id为子设备id
服务服务下发sys/{product_id}/{device_id}/thing/service/set平台网关/设备device_id为子设备id
服务下发回复sys/{product_id}/{device_id}/thing/service/set/response网关/设备平台device_id为子设备id
在线状态在线状态查询全量sys/{product_id}/{device_id}/thing/status/gateway/get/all平台网关/设备device_id为网关id
在线状态上报sys/{product_id}/{device_id}/thing/status/gateway/up网关/设备平台device_id为网关id