当前位置:网站首页>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 .
边栏推荐
- Several stacks of technology sharing: product managers' Online Official answers to several stacks of knowledge
- 【IEEE】自然语言处理与信息检索国际会议(ECNLPIR 2022)
- splice()方法的使用介绍
- Multithreaded applications - improve efficiency
- Remote desktop copy paste exception
- Process and multithreading
- Differences among cookies, session, localstorage and sessionstorage
- Common third-party UI frameworks
- Web project deployment
- 126. word Solitaire II BFS
猜你喜欢
Shape change loader loads jsjs special effect code
Apple's legendary design team disbanded after jobs refused to obey cook
Process and multithreading
“一次编写,运行各端”,高通重磅发布 AI 软件栈!
程序员大部分时间不是写代码,而是。。。
Fais ce que tu veux.
Fashionable pop-up mode login registration window
[data analysis data source] coordinates of provinces, cities and administrative regions across the country (including boundary coordinate points and central coordinate points)
Petit guide de construction rapide du bras mécanique (II): application du bras mécanique
[graduation season · attacking technology Er] three turns around the tree, what branch can we rely on?
随机推荐
Déplacer Tencent sur le cloud a guéri leur anxiété technologique
Quick completion guide for mechanical arm (zero): main contents and analysis methods of the guide
"Adobe international certification" Adobe Photoshop adjusts cropping, rotation and canvas size
Remote desktop copy paste exception
[JS reverse sharing] community information of a website
[latest in the whole network] how to start the opentsdb source code in the local ide run
Cook a delicious cli
Besides technology, programmers also need to master a skill - self marketing ability
Quick completion guide for manipulator (III): mechanical structure of manipulator
@RequestBody注解
What are the means of network promotion?
JMeter interface test tool foundation - sampler (II)
Why use a firewall? What is the function of firewall?
[IEEE] International Conference on naturallanguageprocessing and information retrieval (ecnlpir 2022)
JMeter interface test tool foundation - use badboy to record JMeter script
js中对象合并的4种方式,对象合并的4种方法
Lightweight deployment of firefoxsend temporary file sharing service using Tencent cloud
Web project deployment
"Write once, run at all ends", Qualcomm released AI software stack!
Four methods of object merging and four methods of object merging in JS