Data communication method based on MQTT and Websocket
A data communication and data technology, applied in the field of data transmission, can solve the problem of time-consuming and high cost of broker locating message queues, achieve real-time communication of server resources and bandwidth, reduce the number of topics, and solve stability problems
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0037] A data communication method based on MQTT and Websocket, comprising the following steps:
[0038] S1. The intelligent terminal device publishes an MQTT message with topic information.
[0039] The MQTT message follows the following data transmission protocol (a customization of the payload part of the MQTT message), such as Figure 4 , 5 As shown, including SOF, Length, Data, CRC16 and EOF; where SOF and EOF are used as the frame header and frame end respectively, Length is used to set the length of Data, CRC16 is used to verify the integrity of the data frame; the Data part also includes msg , time, index, value and other custom fields, where the msg field is used to indicate the data type, the time field is used to indicate the release time, the index field is used to indicate the device number, the value field is used to indicate the data value, and the custom field is used to indicate the data value. To support users to expand according to the scenarios used.
[...
Embodiment 2
[0051] In order to further solve the stability problem of data transmission in high concurrency scenarios, the server in the second embodiment adopts a Kafka proxy cluster, which is usually composed of more than two background servers. On this basis, the second embodiment further proposes a A data communication method based on MQTT, Kafka and Websocket, the main difference from Embodiment 1 is that it has carried out the following improvements to step S4:
[0052] The background server uses the partition mechanism of Kafka to receive the corresponding MQTT messages, and writes them to the disk in a sequential manner. Since Kafka is also based on the publish / subscribe model, it can directly create Kafka based on the topic of the received MQTT message. The message queue and the MQTT message are stored in it. The messages in each Kafka message queue are processed by the service corresponding to the topic. According to the topic to which the data type subscribed by the client b...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com