A cloud computing-based intelligent gateway MQTT communication method

By integrating the MQTT protocol stack into the smart gateway and implementing multiple security mechanisms, the problems of low data transmission efficiency, insufficient security, and poor scalability when IoT devices are connected to the cloud computing platform are solved, and efficient and secure data transmission and management are achieved.

CN119966989BActive Publication Date: 2025-09-30SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510066612.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-09-30
Estimated Expiration
2045-01-16

AI Technical Summary

Technical Problem

When IoT devices are connected to cloud computing platforms, existing smart gateways have low data transmission efficiency, insufficient security, and poor scalability.

Method used

A cloud computing-based intelligent gateway MQTT communication method is designed, which integrates the MQTT protocol stack, supports three message publishing service quality levels, realizes dynamic device registration and status monitoring, adopts multiple security mechanisms such as TLS/SSL encryption, key and certificate authentication, role-based access control, and supports modular architecture and message routing.

Benefits of technology

It improves the data transmission efficiency between IoT devices and cloud computing platforms, ensures data security and integrity, provides reliable security protection, and supports access from multiple devices and protocols.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119966989B_ABST
    Figure CN119966989B_ABST
Patent Text Reader

Abstract

The present invention particularly relates to an MQTT communication method for an intelligent gateway based on cloud computing. The MQTT communication method for an intelligent gateway based on cloud computing includes designing an intelligent gateway and integrating an MQTT protocol stack into the intelligent gateway. The intelligent gateway is connected to a cloud computing platform and an Internet of Things device via a network. The cloud computing platform parses and processes the connection information, generating a corresponding MQTT topic and message queue. The intelligent gateway packages the data to be sent into an MQTT message and sends it to a designated MQTT topic. After receiving the MQTT message, the cloud computing platform distributes the data to the corresponding message queue based on the subject and content of the message. The Internet of Things device subscribes to the corresponding MQTT topic and obtains data from the message queue. The MQTT communication method for an intelligent gateway based on cloud computing enables rapid processing and analysis of massive amounts of data, thereby further improving the performance and efficiency of the intelligent gateway. At the same time, the cloud computing platform also ensures the security and integrity of the data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing and communication technology, and in particular to an intelligent gateway MQTT communication method based on cloud computing. Background Art

[0002] With the rapid advancement of technology and the deepening of digital transformation, the Internet of Things (IoT) is developing at an unprecedented pace and gradually penetrating every corner of our lives. The core of the IoT lies in connecting various devices, sensors, and systems through the internet, forming a vast, highly interconnected network. Within this system, the transmission, exchange, and processing of information are crucial, and intelligent gateways are essential nodes in this process.

[0003] Smart gateways, as the essential bridge connecting IoT devices and cloud computing platforms, play a crucial role. They not only aggregate data from various devices and sensors for preliminary processing and integration, but also securely and reliably transmit this data to the cloud computing platform for further analysis and application. Furthermore, they receive commands from the cloud computing platform and convert them into control signals that devices can understand, enabling remote monitoring and control of the equipment.

[0004] However, with the surge in the number of IoT devices and the increasing complexity of networks, the performance requirements for intelligent gateways are also becoming increasingly stringent. An efficient, secure, and reliable intelligent gateway can not only improve the operational efficiency of the entire IoT system, but also ensure data security and system stability. Therefore, how to design and implement such an intelligent gateway has become a pressing issue in the IoT field.

[0005] In order to solve the problems of low data transmission efficiency, insufficient security and poor scalability when IoT devices are connected to cloud computing platforms, the present invention proposes an MQTT communication method for an intelligent gateway based on cloud computing. Summary of the Invention

[0006] In order to overcome the shortcomings of the prior art, the present invention provides a simple and efficient MQTT communication method for an intelligent gateway based on cloud computing.

[0007] The present invention is achieved through the following technical solutions:

[0008] A cloud computing-based intelligent gateway MQTT communication method includes the following steps:

[0009] Step S1: Design an intelligent gateway and integrate the MQTT protocol stack into the intelligent gateway to implement MQTT message encoding, decoding, and transmission control functions; the MQTT protocol stack supports three message publishing quality of service (QoS) levels, including QoS 0 (at most once), QoS 1 (at least once), and QoS 2 (exactly once);

[0010] Step S2: The smart gateway connects to the IoT device through the MQTT protocol and implements dynamic registration, deregistration, and status monitoring of the IoT device. The smart gateway maintains a device connection list to record the connection status, IP address, and port number of each device, so as to quickly locate and troubleshoot the device.

[0011] The smart gateway connects to the cloud computing platform through the network and sends its own device information, status information and MQTT connection parameters to the cloud computing platform;

[0012] After receiving the information sent by the intelligent gateway, the cloud computing platform parses and processes it and generates the corresponding MQTT topic and message queue;

[0013] Step S3: The smart gateway packages the data to be sent into an MQTT message and sends it to the specified MQTT topic;

[0014] After receiving the MQTT message, the cloud computing platform distributes the data to the corresponding message queue according to the subject and content of the message;

[0015] IoT devices or systems that need to receive data subscribe to the corresponding MQTT topic and obtain data from the message queue.

[0016] In step S2, after the smart gateway is started, it establishes a connection with the MQTT proxy server located on the cloud computing platform through the TCP / IP protocol and sends a CONNECT message. The CONNECT message information includes the client ID, user name and password, requesting to establish a session;

[0017] After verifying the received CONNECT message, the MQTT proxy server sends a CONNACK message to confirm that the connection is successful.

[0018] The intelligent gateway sends a SUBSCRIBE message, specifying the topic to be subscribed and the QoS level;

[0019] After receiving the SUBSCRIBE message, the MQTT proxy server records the subscription relationship and sends a SUBACK message for confirmation.

[0020] In step S2, the smart gateway supports device authentication and access control functions, and only authenticated devices can access the system;

[0021] Supports a two-way authentication mechanism. When a device connects to the smart gateway, it provides a valid certificate or key for identity authentication. The smart gateway verifies the validity of the device's certificate or key, implementing device-side authentication to ensure that only legitimate devices can access the system.

[0022] When the smart gateway connects to the cloud server, it uses SSL / TLS certificates for authentication and cloud authentication to ensure that the communication between the smart gateway and the cloud server is secure.

[0023] The smart gateway uses a role-based access control (RBAC) policy to perform access control based on user roles and permissions.

[0024] In step S2, when the smart gateway connects to the IoT device, it supports a key authentication mechanism to authenticate the device using the key provided by the device; at the same time, it supports a certificate authentication mechanism to authenticate the device using a public key infrastructure (PKI);

[0025] When the smart gateway monitors the status of connected IoT devices, it uses the heartbeat mechanism to determine whether the device is active.

[0026] In step S3, when the cloud computing platform needs to send a control instruction to the IoT device, the intelligent gateway forwards the instruction to the target device;

[0027] When an IoT device generates data or needs to send a control command, the smart gateway encapsulates the data into a PUBLISH message and publishes it to the specified MQTT topic;

[0028] The MQTT proxy server distributes the received PUBLISH message to other devices or cloud computing platforms that have subscribed to the corresponding MQTT topic based on the subscription relationship.

[0029] In step S3, the intelligent gateway supports local routing and cloud routing of messages, and uses a rule engine or configuration file to configure the routing;

[0030] The smart gateway supports local and cloud forwarding of MQTT messages. It can not only forward received messages to locally connected devices or applications, but also forward received messages to remote devices or applications through the cloud service platform.

[0031] At the same time, the intelligent gateway supports synchronous and asynchronous forwarding of messages.

[0032] In step S3, TLS / SSL encryption technology is used to encrypt and protect the transmission of MQTT messages, and a custom encryption suite and encryption algorithm are configured to ensure the confidentiality and integrity of data during transmission.

[0033] The cloud computing-based intelligent gateway MQTT communication device includes an intelligent gateway, a cloud computing platform and an Internet of Things device;

[0034] The intelligent gateway integrates an MQTT protocol stack to implement MQTT message encoding, decoding, and transmission control functions; the MQTT protocol stack supports three message publishing quality of service (QoS) levels, including QoS 0 (at most once), QoS 1 (at least once), and QoS 2 (exactly once);

[0035] The smart gateway connects the cloud computing platform and IoT devices through the network, is responsible for device authentication and access control, packages the data to be sent into MQTT messages, and sends them to the specified MQTT topic;

[0036] The cloud computing platform is responsible for receiving the connection information of the smart gateway, parsing and processing it, generating the corresponding MQTT topic and message queue, and distributing the MQTT message sent by the smart gateway to the corresponding message queue according to the topic and content of the message;

[0037] The IoT device or system is responsible for subscribing to the corresponding MQTT topic and obtaining data from the message queue.

[0038] A cloud computing-based intelligent gateway MQTT communication device, characterized in that it includes a memory and a processor; the memory is used to store a computer program, and the processor is used to implement the above-mentioned method steps when executing the computer program.

[0039] A readable storage medium, characterized in that: a computer program is stored on the readable storage medium, and the computer program implements the above method steps when executed by a processor.

[0040] The beneficial effects of the present invention are as follows: the cloud computing-based intelligent gateway MQTT communication method utilizes the powerful computing and storage capabilities of the cloud computing platform to achieve rapid processing and analysis of massive data, thereby further improving the performance and efficiency of the intelligent gateway; at the same time, the cloud computing platform can also provide safer and more reliable data storage and transmission services, ensuring the security and integrity of the data. The details are as follows:

[0041] 1) By optimizing the design of the smart gateway and the implementation of the MQTT protocol stack, the efficiency of data transmission between IoT devices and cloud computing platforms can be significantly improved. The efficiency and lightweight nature of the MQTT protocol enable devices to achieve fast and stable data transmission even with limited network resources.

[0042] 2) The use of multiple security mechanisms, such as TLS / SSL encrypted transmission, key and certificate authentication, access control, etc., can ensure data security and user privacy during MQTT communication.

[0043] 3) It can effectively prevent data leakage, tampering and illegal access, and provide reliable security protection for IoT applications.

[0044] 4) The intelligent gateway design adopts a modular and scalable architecture that can support the access of multiple devices and protocols. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0046] Attachment Figure 1 This is a schematic diagram of the MQTT communication method of the intelligent gateway based on cloud computing in the present invention. DETAILED DESCRIPTION

[0047] In order to enable those skilled in the art to better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present invention.

[0048] Among numerous communication technologies, MQTT (Message Queuing Telemetry Transport) has become one of the most popular protocols in the IoT, thanks to its lightweight, efficient, and reliable nature. The MQTT protocol supports a publish / subscribe model, enabling two-way communication between devices and between devices and platforms, making it ideal for use in IoT environments.

[0049] The cloud computing-based intelligent gateway MQTT communication method includes the following steps:

[0050] Step S1: Design an intelligent gateway and integrate the MQTT protocol stack into the intelligent gateway to implement MQTT message encoding, decoding, and transmission control functions; the MQTT protocol stack supports three message publishing quality of service (QoS) levels, including QoS 0 (at most once), QoS 1 (at least once), and QoS 2 (exactly once);

[0051] S1.1. Design and implementation of intelligent gateway

[0052] As a bridge between IoT devices and cloud computing platforms, the smart gateway needs to have strong data processing and network communication capabilities. This smart gateway uses a high-performance processor and memory and supports the MQTT communication protocol to meet the needs of different IoT devices. The main implementation contents are as follows:

[0053] (1) Hardware architecture includes:

[0054] a. High-Performance Processor Selection: Select a high-performance ARM Cortex-A series processor. Specific models, such as the ARM Cortex-A72 or ARM Cortex-A76, can be selected based on power consumption and performance requirements. These processors ensure processing speed and computational efficiency while also offering good energy efficiency. For scenarios requiring higher computing power, consider an x86 architecture processor, such as Intel's Core i series or AMD's Ryzen series.

[0055] b. Memory configuration: Based on the expected number of concurrent connections and data processing volume, configure sufficient LPDDR4X or LPDDR5 high-speed memory to support simultaneous processing of multiple MQTT connections and message transmissions; use a memory management unit (MMU) and memory protection unit (MPU) to improve the security and efficiency of memory access.

[0056] C. Network Interface Configuration: Integrated Gigabit Ethernet port supports high-speed wired connections; Wi-Fi 6 / 6E or higher wireless modules support faster wireless data transmission and lower latency; 4G / 5G modules ensure stable network connections when wired networks are unavailable. Consider adding support for short-range wireless communication protocols such as Bluetooth 5.x and Zigbee 3.0 to accommodate the access of more types of IoT devices.

[0057] d. Hardware scalability: Design more flexible hardware expansion interfaces, such as PCIe and USB 3.x, to facilitate the addition of more network interfaces, storage modules, sensors, etc. in the future.

[0058] (2) Software architecture includes:

[0059] a. Modular design: Functions are divided into finer-grained modules. For example, the MQTT protocol stack module can be further divided into submodules such as connection establishment, message sending, message receiving, and QoS control. Each module runs in an independent thread to ensure module independence and scalability. Using a modular design, different functions are divided into independent modules, such as the MQTT protocol stack module, device connection management module, message routing and forwarding module, and security assurance module.

[0060] b. Embedded operating system selection: Choose an embedded operating system with stronger real-time performance and lower resource consumption, such as RT-Thread, VxWorks, or Zephyr. Customize and optimize the operating system based on the characteristics of the smart gateway to improve system stability and responsiveness.

[0061] c. Inter-module communication mechanism: Adopt efficient inter-module communication mechanisms such as shared memory, message queues, and semaphores to reduce communication overhead and latency; design clear inter-module communication interfaces and protocols to ensure inter-module collaboration.

[0062] (3) System optimization:

[0063] a. Network stack optimization: Based on the characteristics of the MQTT protocol, the operating system's network stack is deeply optimized, including the TCP / IP protocol stack and network interrupt handling, to reduce data packet processing time and resource usage.

[0064] b. Memory management optimization: Adopt more advanced memory management technologies, such as memory defragmentation and memory compression, to further reduce memory fragmentation and memory leaks.

[0065] c. Code structure optimization: Use compiler optimization options and code analysis tools to deeply optimize the code, reduce unnecessary function calls and loops, and improve program execution efficiency.

[0066] d. Intelligent load balancing: Design an intelligent load balancing algorithm to dynamically adjust the resource allocation of different network interfaces based on factors such as the device's connection status and data traffic, ensuring efficient and stable data transmission.

[0067] e. Support data encryption transmission and storage to ensure data confidentiality and integrity.

[0068] S1.2. MQTT protocol stack implementation

[0069] Integrate the MQTT protocol stack into the smart gateway. The specific implementation steps are as follows:

[0070] (1) Protocol stack integration:

[0071] a. Evaluate multiple MQTT protocol stack libraries, such as Eclipse Paho and Mosquitto. Select the MQTT protocol stack library that meets the hardware and software platform requirements of the smart gateway.

[0072] b. Adapt and modify the MQTT protocol stack. Perform necessary adaptations based on the smart gateway's hardware specifications (e.g., CPU, memory, storage, etc.) and software environment (e.g., operating system, programming language, etc.). Modify the MQTT protocol stack's default configuration, such as port numbers and connection timeouts, to meet the specific needs of the smart gateway.

[0073] (2) Message processing:

[0074] a. Message parsing: Implements the MQTT message decoding function and parses received MQTT messages according to the MQTT protocol format. The parsing process includes parsing the MQTT fixed header, variable header, and message body to obtain information such as message type, topic, and QoS level.

[0075] b. Message encoding: Implements MQTT message encoding, encoding the data to be sent according to the MQTT protocol format. The encoding process includes setting the various fields of the MQTT fixed header (such as the message type, QoS level, reserved bits, etc.), constructing the variable header (such as the topic name), and appending the message body (i.e., the actual data content).

[0076] c. Message sending: Implements the MQTT message sending function, sending the encoded message to the target device or cloud through the corresponding network interface (such as TCP / IP). Establishes a TCP connection based on the target address and port number, and sends the MQTT message through this connection.

[0077] (3) QoS support:

[0078] a. QoS level definition: The MQTT protocol defines three QoS levels: QoS 0 (at most once), QoS 1 (at least once), and QoS 2 (exactly once).

[0079] b.Message transmission mechanism under QoS level:

[0080] For QoS 0 messages, the message is sent directly without waiting for any confirmation;

[0081] For QoS1 messages: After sending the message, wait for the receiver's PUBACK message to confirm. If no confirmation is received within the specified time, resend the message;

[0082] For QoS2 messages: After sending the message, wait for the receiver's PUBREC message, send a PUBREL message to release the message, and wait for the receiver's PUBCOMP message to confirm. If the PUBCOMP message is not received within the specified time, resend the PUBREL message.

[0083] Step S2: The smart gateway connects to the IoT device through the MQTT protocol and implements dynamic registration, deregistration, and status monitoring of the IoT device. The smart gateway maintains a device connection list to record the connection status, IP address, and port number of each device, so as to quickly locate and troubleshoot the device.

[0084] The smart gateway connects to the cloud computing platform through the network and sends its own device information, status information and MQTT connection parameters to the cloud computing platform;

[0085] After receiving the information sent by the intelligent gateway, the cloud computing platform parses and processes it and generates the corresponding MQTT topic and message queue;

[0086] Step S3: The smart gateway packages the data to be sent into an MQTT message and sends it to the specified MQTT topic;

[0087] After receiving the MQTT message, the cloud computing platform distributes the data to the corresponding message queue according to the subject and content of the message;

[0088] IoT devices or systems that need to receive data subscribe to the corresponding MQTT topic and obtain data from the message queue.

[0089] In step S2, after the smart gateway is started, it establishes a connection with the MQTT proxy server located on the cloud computing platform through the TCP / IP protocol and sends a CONNECT message. The CONNECT message information includes the client ID, user name and password, requesting to establish a session;

[0090] After verifying the received CONNECT message, the MQTT proxy server sends a CONNACK message to confirm that the connection is successful.

[0091] The intelligent gateway sends a SUBSCRIBE message, specifying the topic to be subscribed and the QoS level;

[0092] After receiving the SUBSCRIBE message, the MQTT proxy server records the subscription relationship and sends a SUBACK message for confirmation.

[0093] In step S2, the smart gateway supports device authentication and access control functions, and only authenticated devices can access the system;

[0094] Supports a two-way authentication mechanism. When a device connects to the smart gateway, it provides a valid certificate or key for identity authentication. The smart gateway verifies the validity of the device's certificate or key, implementing device-side authentication to ensure that only legitimate devices can access the system.

[0095] When the smart gateway connects to the cloud server, it uses SSL / TLS certificates for authentication and cloud authentication to ensure that the communication between the smart gateway and the cloud server is secure.

[0096] Only devices and the cloud that have been verified by both parties can communicate with each other, effectively preventing the risk of man-in-the-middle attacks and data leakage.

[0097] The smart gateway uses a role-based access control (RBAC) policy to perform access control based on user roles and permissions.

[0098] Fine-grained management of user permissions, including the creation, modification, and deletion of user roles, as well as the allocation and revocation of permissions, ensures that only authorized users can access system resources, reducing security risks.

[0099] Each user is assigned one or more roles, each of which has a specific set of permissions. Users can only access resources and perform actions permitted by their roles.

[0100] Real-time monitoring and recording of system access behavior is carried out to promptly identify and respond to potential security threats. At the same time, regular security audits are conducted on the system to assess system security and take appropriate improvement measures.

[0101] In step S2, when the smart gateway connects to the IoT device, it supports a key authentication mechanism and authenticates the device through the key provided by the device; at the same time, it supports a certificate authentication mechanism and uses a public key infrastructure (PKI) to authenticate the device; and it designs and implements support for multiple authentication methods to meet the security requirements in different application scenarios.

[0102] When the smart gateway monitors the status of connected IoT devices, it uses the heartbeat mechanism to determine whether the device is active.

[0103] S2.1 Heartbeat Mechanism

[0104] Period Setting: Set a reasonable heartbeat period for the device (e.g., send a heartbeat every 5 minutes). Heartbeat Message: A heartbeat message contains information such as the device's unique identifier, online status, and connection status. Heartbeat Response: After receiving a heartbeat message, the smart gateway or cloud returns a confirmation response to ensure the device is active. Timeout Processing: If a device fails to send a heartbeat message after exceeding the set time threshold, it is marked as offline or faulty.

[0105] S2.2. Device status query interface design

[0106] Provides an MQTT topic that allows users or applications to query device status information. Query parameters include the device ID and time range, allowing users or applications to obtain the status history of a specific device. Response content returns information such as the device's online status, connection status, and heartbeat time.

[0107] S2.3. Equipment scalability

[0108] Design and implement a dynamic device addition and removal mechanism, allowing users or applications to add or remove devices as needed. Support batch addition and removal of devices to improve device management efficiency. Provide a device information management interface to facilitate users or applications to query and modify device configuration information.

[0109] In step S3, when the cloud computing platform needs to send a control instruction to the IoT device, the intelligent gateway forwards the instruction to the target device;

[0110] When an IoT device generates data or needs to send a control command, the smart gateway encapsulates the data into a PUBLISH message and publishes it to the specified MQTT topic;

[0111] The MQTT proxy server distributes the received PUBLISH message to other devices or cloud computing platforms that have subscribed to the corresponding MQTT topic based on the subscription relationship.

[0112] In step S3, the creation, modification, deletion, and query functions of MQTT topics are designed and implemented. The intelligent gateway supports the definition and management of multi-level, multi-topic structures, making it easy for users or applications to define and manage topics based on their needs. It also provides topic subscription and publishing interfaces, making it easy for devices or applications to subscribe to and publish MQTT messages.

[0113] Design and implement message routing algorithms based on MQTT message topics and QoS levels, routing messages to the appropriate devices and applications. Supports both local and cloud-based message routing to meet the data interaction needs of diverse application scenarios. For complex routing scenarios, flexible configuration is available using a rules engine or configuration files.

[0114] In step S3, the intelligent gateway supports local routing and cloud routing of messages, and uses a rule engine or configuration file to configure the routing;

[0115] The smart gateway supports local and cloud forwarding of MQTT messages. It can not only forward received messages to locally connected devices or applications, but also forward received messages to remote devices or applications through the cloud service platform.

[0116] At the same time, the intelligent gateway supports synchronous and asynchronous forwarding of messages to meet the real-time and efficiency requirements in different application scenarios.

[0117] In step S3, TLS / SSL encryption technology is used to encrypt and protect the transmission of MQTT messages. The encryption suite and encryption algorithm (such as AES, RSA, etc.) are customized and configured. The appropriate encryption strength is selected according to actual needs to achieve optimal security and performance and ensure the confidentiality and integrity of data during transmission;

[0118] Choose widely verified and recognized cipher suites and algorithms, such as TLS 1.2 or higher, and high-strength encryption algorithms like AES-256. These algorithms provide sufficient security to protect data from unauthorized access and tampering.

[0119] The cloud computing-based intelligent gateway MQTT communication device includes an intelligent gateway, a cloud computing platform and an Internet of Things device;

[0120] The intelligent gateway integrates an MQTT protocol stack to implement MQTT message encoding, decoding, and transmission control functions; the MQTT protocol stack supports three message publishing quality of service (QoS) levels, including QoS 0 (at most once), QoS 1 (at least once), and QoS 2 (exactly once);

[0121] The smart gateway connects the cloud computing platform and IoT devices through the network, is responsible for device authentication and access control, packages the data to be sent into MQTT messages, and sends them to the specified MQTT topic;

[0122] The cloud computing platform is responsible for receiving the connection information of the smart gateway, parsing and processing it, generating the corresponding MQTT topic and message queue, and distributing the MQTT message sent by the smart gateway to the corresponding message queue according to the topic and content of the message;

[0123] The IoT device or system is responsible for subscribing to the corresponding MQTT topic and obtaining data from the message queue.

[0124] The cloud computing-based intelligent gateway MQTT communication device includes a memory and a processor; the memory is used to store a computer program, and the processor is used to implement the above method steps when executing the computer program.

[0125] The readable storage medium stores a computer program, which implements the above method steps when executed by a processor.

[0126] Compared with the existing technology, this cloud computing-based intelligent gateway MQTT communication method has the following characteristics:

[0127] 1) By optimizing the design of the smart gateway and the implementation of the MQTT protocol stack, the efficiency of data transmission between IoT devices and cloud computing platforms can be significantly improved. The efficiency and lightweight nature of the MQTT protocol enable devices to achieve fast and stable data transmission even with limited network resources.

[0128] 2) The use of multiple security mechanisms, such as TLS / SSL encrypted transmission, key and certificate authentication, access control, etc., can ensure data security and user privacy during MQTT communication.

[0129] 3) It can effectively prevent data leakage, tampering and illegal access, and provide reliable security protection for IoT applications.

[0130] 4) The intelligent gateway design adopts a modular and scalable architecture that can support the access of multiple devices and protocols.

[0131] The embodiment described above is only one specific implementation of the present invention. Common changes and substitutions made by those skilled in the art within the scope of the technical solution of the present invention should be included in the protection scope of the present invention.

Claims

1. A cloud computing-based intelligent gateway MQTT communication method, characterized by: The following steps are involved: Step S1: Design an intelligent gateway and integrate an MQTT protocol stack into the intelligent gateway to implement encoding, decoding, and transmission control functions of MQTT messages; the MQTT protocol stack supports three message publishing service quality (QoS) levels, including QoS 0, QoS 1, and QoS 2; Step S2: The smart gateway connects to the IoT device through the MQTT protocol and implements dynamic registration, deregistration, and status monitoring of the IoT device; The smart gateway maintains a device connection list to record the connection status, IP address and port number of each device, so as to facilitate the rapid location and troubleshooting of the device. The smart gateway connects to the cloud computing platform through the network and sends its own device information, status information and MQTT connection parameters to the cloud computing platform; After receiving the information sent by the intelligent gateway, the cloud computing platform parses and processes it and generates the corresponding MQTT topic and message queue; Step S3: The smart gateway packages the data to be sent into an MQTT message and sends it to the specified MQTT topic; After receiving the MQTT message, the cloud computing platform distributes the data to the corresponding message queue according to the subject and content of the message; IoT devices or systems that need to receive data subscribe to the corresponding MQTT topic and obtain data from the message queue.

2. The cloud computing-based intelligent gateway MQTT communication method according to claim 1, characterized in that: In step S2, after the smart gateway is started, it establishes a connection with the MQTT proxy server located on the cloud computing platform through the TCP / IP protocol and sends a CONNECT message. The CONNECT message information includes the client ID, user name and password, requesting to establish a session; After verifying the received CONNECT message, the MQTT proxy server sends a CONNACK message to confirm that the connection is successful. The intelligent gateway sends a SUBSCRIBE message, specifying the topic to be subscribed and the QoS level; After receiving the SUBSCRIBE message, the MQTT proxy server records the subscription relationship and sends a SUBACK message for confirmation.

3. The cloud computing-based intelligent gateway MQTT communication method according to claim 1, characterized in that: In step S2, the smart gateway supports device authentication and access control functions, and only authenticated devices can access the system; Supports a two-way authentication mechanism. When a device connects to the smart gateway, it provides a certificate or key for identity authentication. The smart gateway verifies the validity of the device's certificate or key, implementing device-side authentication to ensure that only legitimate devices can access the system. When the smart gateway connects to the cloud server, it uses SSL / TLS certificates for authentication and cloud authentication to ensure that the communication between the smart gateway and the cloud server is secure; The smart gateway uses a role-based access control (RBAC) policy to perform access control based on user roles and permissions.

4. The cloud computing-based intelligent gateway MQTT communication method according to claim 3, characterized in that: In step S2, when the smart gateway connects to the IoT device, it supports a key authentication mechanism to authenticate the device using the key provided by the device; at the same time, it supports a certificate authentication mechanism to authenticate the device using a public key infrastructure; When the smart gateway monitors the status of connected IoT devices, it uses the heartbeat mechanism to determine whether the device is active.

5. The cloud computing-based intelligent gateway MQTT communication method according to claim 1, characterized in that: In step S3, when the cloud computing platform needs to send a control instruction to the IoT device, the intelligent gateway forwards the instruction to the target device; When an IoT device generates data or needs to send a control command, the smart gateway encapsulates the data into a PUBLISH message and publishes it to the specified MQTT topic; The MQTT proxy server distributes the received PUBLISH message to other devices or cloud computing platforms that have subscribed to the corresponding MQTT topic based on the subscription relationship.

6. The cloud computing-based intelligent gateway MQTT communication method according to claim 1, characterized in that: In step S3, the intelligent gateway supports local routing and cloud routing of messages, and uses a rule engine or configuration file to configure the routing; The smart gateway supports local and cloud forwarding of MQTT messages. It can not only forward received messages to locally connected devices or applications, but also forward received messages to remote devices or applications through the cloud service platform. At the same time, the intelligent gateway supports synchronous and asynchronous forwarding of messages.

7. The cloud computing-based intelligent gateway MQTT communication method according to claim 1, characterized in that: In step S3, TLS / SSL encryption technology is used to encrypt and protect the transmission of MQTT messages, and a custom encryption suite and encryption algorithm are configured to ensure the confidentiality and integrity of data during transmission.

8. A cloud computing-based intelligent gateway MQTT communication device, characterized by: Including smart gateways, cloud computing platforms and IoT devices; The intelligent gateway is integrated with an MQTT protocol stack to implement the encoding, decoding and transmission control functions of MQTT messages; the MQTT protocol stack supports three message publishing service quality QoS levels, including QoS 0, QoS1 and QoS2; The smart gateway connects the cloud computing platform and IoT devices through the network, is responsible for device authentication and access control, packages the data to be sent into MQTT messages, and sends them to the specified MQTT topic; The cloud computing platform is responsible for receiving the connection information of the smart gateway, parsing and processing it, generating the corresponding MQTT topic and message queue, and distributing the MQTT message sent by the smart gateway to the corresponding message queue according to the topic and content of the message; The IoT device or system is responsible for subscribing to the corresponding MQTT topic and obtaining data from the message queue.

9. A cloud computing-based intelligent gateway MQTT communication device, characterized by: The method comprises a memory and a processor; the memory is used to store a computer program, and the processor is used to implement the method according to any one of claims 1 to 7 when executing the computer program.

10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.