当前位置:网站首页>08. Tencent cloud IOT device side learning - device shadow and attributes
08. Tencent cloud IOT device side learning - device shadow and attributes
2022-06-24 11:02:00 【fancyxu】
The main purpose of this series is to record the learning notes of Tencent cloud Internet of things device , And on the device side SDK Make a supplementary explanation .
brief introduction
Device shadow and attributes are used for server and device communication , It mainly realizes the reliable transmission of the application layer ( Can be based on QoS0)、 Solve the problem of message storage and distribution when messages are offline .
The difference in QoS1 Full message store for , The device shadow is through get Method , Property is through get status To get the difference between states , This reduces message delivery and device status updates .
IoT Explorer The internal test phase attribute is also implemented through the device shadow message , Subsequently, it is abstracted into the attributes of the data template , Make it easier to understand .
Development considerations
Device shadow and attributes are the basic functions of Tencent cloud IOT platform , In the actual development process, we generally need to pay attention to the following points :
1. Offline message acquisition : Offline messages for many devices do not always take effect , For example, real-time control messages ( Such as shutdown command ), If the device fails to reply , adopt get status You can still get , If the response , It may cause equipment failure ( Such as shutdown , It may cause the power on receiver to shut down immediately , To form a dead cycle ), At this point, you need to make filtering options in the received message . Development process , The subscription receiving method is often taken over , The subsequent iterations will enter sdk.
2. Message level setting : Due to the existence of the application layer confirmation mechanism , Therefore, the general uplink message adopts QoS0 To reduce the number of servers PUBACK reply ; But when subscribing , Should use QoS1 To ensure that the server supports sending messages QoS1 The retransmission mechanism , At the same time open packet id The filter , To achieve a better success rate of message distribution .
3. Message type settings : There is the concept of read-only attribute in the attribute ( This means that the value only depends on the equipment report ), Setting to read-only can avoid invalid property modification , This leads to the avoidance of readable properties in control messages , A device side parsing exception is thrown .
边栏推荐
- Niuke-top101-bm29
- Disaster recovery series (II) -- enterprises' one-stop disaster recovery construction with the help of cloud platform?
- js数组求和的5种方法
- SwiftUI Swift 内功之 Swift 中的属性观察者 didSet 与 willSet
- 09. Tencent cloud IOT device side learning -- RRPC and behavior
- P5.js paper crane animation background JS special effect
- [IEEE publication] International Conference on natural language processing and information retrieval in 2022 (ecnlpir 2022)
- 突然想到老家的木屋
- How to convert an array to an object, and how to convert an object to an array
- Tencent's open source project "Yinglong" has become a top-level project of Apache: the former long-term service wechat payment can hold a million billion level of data stream processing
猜你喜欢

程序员大部分时间不是写代码,而是。。。

喜歡就去行動

Process and multithreading

初识string+简单用法(一)

Hbuilder makes hero skin lottery games

喜欢就去行动

"Write once, run at all ends", Qualcomm released AI software stack!
![[IEEE publication] International Conference on natural language processing and information retrieval in 2022 (ecnlpir 2022)](/img/d6/8c20944ce354c9619a61a73f2c72b1.png)
[IEEE publication] International Conference on natural language processing and information retrieval in 2022 (ecnlpir 2022)

Stack Title: exclusive time of function

Today's sleep quality record 76 points
随机推荐
Spark submission parameter -- use of files
What is the knowledge map? What does it do
Suddenly I thought of the wooden house in my hometown
Centripetalnet: more reasonable corner matching, improved cornernet | CVPR 2020 in many aspects
Any 与 TypeVar,让 IDE 的自动补全更好用
What is a compressed file? What are the advantages of different methods of compressing files?
System design: key features of distributed systems
“一个优秀程序员可抵五个普通程序员!”
Introduction to the use of splice() method
腾讯开源项目「应龙」成Apache顶级项目:前身长期服务微信支付,能hold住百万亿级数据流处理...
23. opencv - image mosaic project
计组_cpu的结构和工作流程
09. Tencent cloud IOT device side learning -- RRPC and behavior
What is the function of the graphics card driver? Do you want to update the graphics card driver
Process and multithreading
Can text pictures be converted to word? How to extract text from pictures
"Write once, run at all ends", Qualcomm released AI software stack!
Why use a firewall? What is the function of firewall?
The latest entry date of SQL Sever test questions
Self service troubleshooting guide for redis connection login problems