跳到主要内容

Topic Definitions

Topic Overview

To facilitate the cloud platform in distinguishing different processing strategies for device attributes, device reported model attributes are divided into osd and state categories, each reported using different topics.

  • osd: Attributes reported at a fixed frequency by the device, corresponding to pushmode = 0.
  • state: Event-based reported model attributes by the device, corresponding to pushmode = 1.

Note: In the table below, {gateway_sn} represents the SN of the gateway device, and {device_sn} represents the SN of the device to which the model attribute belongs.

Topic NameSender -> ReceiverMessageDescription
thing/product/{device_sn}/osdDevice > Cloud Platformosd message structAttributes pushed by the device to the cloud platform at a fixed frequency (properties). See model content for specific range.
thing/product/{device_sn}/stateDevice > Cloud Platformstate message structAttributes pushed by the device to the cloud platform on demand (properties). See model content for specific range.
thing/product/{gateway_sn}/servicesCloud Platform -> Deviceservices message structServices sent by the cloud platform to the device (see model content for specific service identifier).
thing/product/{gateway_sn}/services_replyDevice > Cloud Platformservices_reply message structDevice's response and processing result to the service
thing/product/{gateway_sn}/eventsDevice > Cloud Platformevents message structEvents sent by the device to the cloud platform that need attention and processing. For example, SD card full, UAV unlocking no-fly zone, etc. (see model content for event range).
thing/product/{gateway_sn}/events_replyCloud Platform -> Deviceevents_reply message structCloud platform's response and processing result to the device event
thing/product/{gateway_sn}/requestsDevice > Cloud Platformrequests message structRequests sent by the device to the cloud platform to obtain some information, such as temporary upload credentials
thing/product/{gateway_sn}/requests_replyCloud Platform -> Devicerequests_reply message structCloud platform's response to the device's request
sys/product/{gateway_sn}/statusDevice > Cloud Platformstatus message structDevice online/offline, update topology
sys/product/{gateway_sn}/status_replyCloud Platform -> Devicestatus_reply message structPlatform response
thing/product/{gateway_sn}/property/setCloud Platform -> Deviceproperty set message structDevice attribute setting. Whether the device attribute can be modified is judged in the device attribute chapter by the "accessMode" identifier, accessMode = rw indicates it can be read and written.
thing/product/{gateway_sn}/property/set_replyDevice > Cloud Platformproperty set_reply message structResponse to device attribute setting
thing/product/{gateway_sn}/drc/upDevice > Cloud PlatformDRC message structDRC protocol upstream
thing/product/{gateway_sn}/drc/downCloud Platform -> DeviceDRC message structDRC protocol downstream

Public Field Descriptions

ColumnNameTypeDescription
tidTransaction UUIDtextTransaction UUID representing a simple message communication, such as:
1. Data reporting request + data reporting response
2. Handshake authentication request + response + ack
3. Alarm event one-way notification, etc., solving the problem of multi-concurrency and message matching of transactions
bidBusiness UUIDtextBusiness UUID: Some functions cannot be completed in one communication and include all interactions over a period of time.
A business usually consists of multiple atomic transactions and lasts for a long time;
For example, on-demand/download/playback; solving the problem of multi-concurrency and repeated requests of the business, facilitating state machine management of all modules.
timestampMillisecond TimestampintMessage sending time
gatewayGateway Device Serial NumbertextSerial number of the gateway device sending the message
dataMessage ContentobjectMessage content

osd Structure Example

topic: thing/product/{device_sn}/osd

{
"tid": "65717bf1-aee7-4abb-8ea3-9b1908548d74",
"bid": "cf5ad2e6-2f32-4b59-980e-d5c9ee412805",
"timestamp": 1667220873846,
"data": {
"job_number": 492,
"acc_time": 1859010,
"activation_time": 0,
"maintain_status": {
"maintain_status_array": [
{
"state": 0,
"last_maintain_type": 17,
"last_maintain_time": 0,
"last_maintain_work_sorties": 0
}
]
},
"electric_supply_voltage": 231,
"working_voltage": 25440,
"working_current": 1120,
"backup_battery": {
"voltage": 26631,
"temperature": 27.9,
"switch": 1
},
"drone_battery_maintenance_info": {
"maintenance_state": 0,
"maintenance_time_left": 0
}
},
"gateway": "dock_sn"
}
{
"bid": "d6cfcea4-c6ca-439b-948f-b17d88fc308f",
"data": {
"flighttask_prepare_capacity": 1,
"flighttask_step_code": 255,
"media_file_detail": {
"remain_upload": 0
},
"wireless_link": {
"4g_freq_band": 2.4,
"4g_gnd_quality": 0,
"4g_link_state": 0,
"4g_quality": 0,
"4g_uav_quality": 0,
"dongle_number": 0,
"link_workmode": 0,
"sdr_freq_band": 2.4,
"sdr_link_state": 0,
"sdr_quality": 0
}
},
"tid": "e4c15182-776b-4c13-9973-3fc76848ca15",
"timestamp": 1667220881576,
"gateway": "dock_sn"
}
{
"tid": "43d2e632-1558-4c4e-83d2-eeb51b7a377a",
"bid": "7578f2ac-1f12-4d47-9ab6-5de146ed7b8a",
"timestamp": 1667220916697,
"data": {
"network_state": {
"type": 2,
"quality": 0,
"rate": 5.0970001220703125
},
"drone_charge_state": {
"state": 0,
"capacity_percent": 100
},
"drone_in_dock": 1,
"rainfall": 0,
"wind_speed": 0,
"environment_temperature": 24,
"temperature": 24.9,
"humidity": 62,
"latitude": 22.907809968,
"longitude": 113.703482143,
"height": 34.174125671386719,
"alternate_land_point": {
"latitude": 22.907898319908661,
"longitude": 113.70347329676635,
"safe_land_height": 0,
"is_configured": 1
},
"first_power_on": 1631945855969,
"position_state": {
"is_calibration": 1,
"is_fixed": 2,
"quality": 5,
"gps_number": 6,
"rtk_number": 25
},
"storage": {
"total": 82045336,
"used": 51772
},
"mode_code": 1,
"cover_state": 0,
"supplement_light_state": 0,
"emergency_stop_state": 0,
"air_conditioner_mode": 0,
"battery_store_mode": 1,
"alarm_state": 0,
"putter_state": 0,
"sub_device": {
"device_sn": "1581F5BKD225D00BP891",
"device_model_key": "0-67-0",
"device_online_status": 0,
"device_paired": 1
}
},
"gateway": "dock_sn"
}

state Structure Example

topic: thing/product/{device_sn}/state

{
"tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
"bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
"timestamp": 1598411295123,
"gateway":"sn",
"data":{},
}

services Structure Example

topic: thing/product/{gateway_sn}/services

{
"tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
"bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
"timestamp": 1598411295123,
"gateway":"sn",
"method": "some_method",
"data": {}
}

services_reply Structure Example

Mandatory Fields in Data

ColumnNameTypeconstraintDescription
resultDevice response result codeintNon-zero indicates error
outputDevice message contentstructMessage content of the device's response to the server command
{
"tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
"bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
"timestamp": 1598411295123,
"gateway":"sn",
"method": "some_method",
"data": {
"result": 0,
"output": {}
}
}

events Structure Example

topic: thing/product/{gateway_sn}/events

ColumnNameTypeconstraintDescription
need_replyWhether a reply is needed from the serverintAfter receiving the events event report from the device, the server determines whether to give a reply based on need_reply; 0 means no reply needed, 1 means reply needed
{
"tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
"bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
"timestamp": 1598411295123,
"need_reply": 0,
"gateway":"sn",
"method": "some_method",
"data": {}
}

events_reply Structure Example

topic: thing/product/{gateway_sn}/events_reply

Mandatory Fields in Data

ColumnNameTypeconstraintDescription
resultServer response result codeintNon-zero indicates error
{
"tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
"bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
"timestamp": 1598411295123,
"gateway":"sn",
"method": "some_method",
"data": {
"result": 0
}
}

requests Structure Example

topic: thing/product/{gateway_sn}/requests

{
"tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
"bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
"timestamp": 1598411295123,
"gateway":"sn",
"method": "some_method",
"data": {}
}

requests_reply Structure Example

topic: thing/product/{gateway_sn}/requests_reply

Mandatory Fields in Data

ColumnNameTypeconstraintDescription
resultServer response result codeintNon-zero indicates error
outputService message contentstructMessage content of the server's response to the device
{
"tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
"bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
"timestamp": 1598411295123,
"gateway":"sn",
"method": "some_method",
"data": {
"result": 0,
"output":{}
}
}

status Structure Example

topic: sys/product/{gateway_sn}/status

## Gateway Device and Sub-Device Online
{
"tid": "tid001",
"bid": "bid001",
"method": "update_topo",
"timestamp": 1234567890123,
"data": {
"type": 98,
"sub_type": 0,
"device_secret": "secret",
"nonce": "nonce",
"version": 1,
"sub_devices": [
{
"sn": "drone001",
"type": 116,
"sub_type": 0,
"index": "A",
"device_secret": "secret",
"nonce": "nonce",
"version": 1
}
]
}
}

## Sub-Device Offline
{
"tid": "tid001",
"bid": "bid001",
"method": "update_topo",
"timestamp": 1234567890123,
"data": {
"type": 98,
"sub_type": 0,
"device_secret": "secret",
"nonce": "nonce",
"version": 1,
"sub_devices": []
}
}

status_reply Structure Example

topic: sys/product/{gateway_sn}/status_reply

Mandatory Fields in Data

ColumnNameTypeconstraintDescription
resultResult codeintNon-zero indicates error
{
"tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
"bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
"timestamp": 1598411295123,
"method": "update_topo",
"data": {
"result": 0
}
}

property set Structure Example

topic: thing/product/{gateway_sn}/property/set

ColumnNameTypeconstraintDescription
some_propertyProperty key to be modifiedstringRefer to Device Management - Device Attribute Settings
Whether the device attribute can be modified is determined in the device attribute chapter by the "accessMode" identifier, accessMode = rw indicates it can be read and written.
some_valueProperty value to be modifiedstring/int/floatRefer to the corresponding device attribute
{
"tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
"bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
"timestamp": 1598411295123,
"data": {
"some_property": some_value
}
}

property set_reply Structure Example

topic: thing/product/{gateway_sn}/property/set_reply

Mandatory Fields in Data

ColumnNameTypeconstraintDescription
some_propertyProperty key to be modifiedstringRefer to Device Management - Device Attribute Settings
Whether the device attribute can be modified is determined in the device attribute chapter by the "accessMode" identifier, accessMode = rw indicates it can be read and written.
resultResult of the corresponding property settingint0: Success, 1: Failure, 2: Timeout, refer to error code explanations for other values
{
"tid":"6a7bfe89-c386-4043-b600-b518e10096cc",
"bid":"42a19f36-5117-4520-bd13-fd61d818d52e",
"timestamp": 1598411295123,
"data": {
"some_property": {
"result": 0 // 0: Success, 1: Failure, 2: Timeout, refer to error code explanations for other values
}
}
}

drc up Structure Example

topic: thing/product/{gateway_sn}/drc/up

Mandatory Fields in Data

ColumnNameTypeconstraintDescription
resultServer response result codeintNon-zero indicates error
outputService message contentstructMessage content of the server's response to the device
{
"method": "drone_control",
"data": {
"result": 0,
"output": {
"seq": 1
}
}
}

drc down Structure Example

topic: thing/product/{gateway_sn}/drc/down

{
"method": "drone_control",
"data": {
"seq": 1,
"x": 2.34,
"y": -2.45,
"h": 2.76,
"w": 2.86
}
}