Mimicry security data exchange method based on MQTT
By constructing a large-scale adjudication method for redundant clusters and mimicry security of MQTT proxy, the problem that MQTT proxy does not provide cluster processing in the Internet of Things field is solved, and high availability and security of data transmission are achieved.
Patent Information
- Application Number
- CN202411723671.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-11-28
AI Technical Summary
In the field of IoT, MQTT proxy itself does not provide a mechanism for cluster processing, which causes data center failure or vulnerability attacks to fail, and a large number of devices cannot be controlled.
By constructing a redundant cluster of MQTT proxy, using MQTT subscription/distribution capabilities, one data is broadcast to multiple MQTT proxy, and the data of the same topic is merged using a mimicry-safe large-digit adjudication method.
High availability and security of data transmission are achieved, even if a single MQTT proxy fails, data can still reach subscribers and solve the problem of data duplication and tampering.
Smart Images

Figure CN119766488A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a network security technology, and in particular to a data exchange method in the field of Internet of Things. Background Art
[0002] With the application of technologies such as the Internet of Things, cloud computing, big data, and artificial intelligence (AI), intelligent fusion terminals are often used to achieve interconnection between different systems and platforms, integrating multiple communication technologies and computing capabilities to process and exchange data and information from different sources, and provide unified services and user experience in multiple industries such as manufacturing, medical care, transportation, education, and retail. In order to achieve information interaction between the central cloud and terminal sensors, intelligent fusion terminals are deployed at the edge of the Internet to provide uplink and downlink communications. The uplink is responsible for the intelligent fusion terminal to transmit monitoring data to the upper-level master station, and the downlink is responsible for the information interaction between the intelligent fusion terminal and the lower-level terminal equipment control instructions. Intelligent fusion terminal (see Figure 1 ) interacts internally through the message mechanism provided by MQTT (Message Queuing Telemetry Transport), adopts centralized data management, avoids the establishment of private databases for each application, ensures data security, and improves data usage efficiency.
[0003] MQTT is a lightweight message transmission protocol based on the publish / subscribe model. It is suitable for devices with limited connection bandwidth, unstable network or limited resources. It is widely used in the fields of Internet of Things (IoT), remote monitoring, real-time messaging and mobile application systems.
[0004] MQTT adopts a client-server model, in which the client is responsible for sending and receiving messages, and the server is responsible for routing and delivering messages. The client can be a publisher (Producer) or a subscriber (Subscriber), or both functions. The publisher sends messages to a specific topic (Topic); the subscriber subscribes to the topic of interest, and only clients that have subscribed to a specific topic can receive messages from the topic. The MQTT agent is responsible for receiving messages from the publisher and forwarding them to subscribers who have subscribed to the corresponding topic. A topic is a string used to classify messages. The client publishes and subscribes to messages by specifying a topic. A topic can be subscribed to by multiple clients, and a client can also subscribe to multiple topics. MQTT defines three quality levels Qos (Quality of Service) to ensure different reliability requirements for message delivery.
[0005] The data center in the intelligent fusion terminal realizes the purpose of data aggregation, collects data from various sensors, and transmits it to the central cloud through the Internet for further processing. However, the MQTT agent used in the data center does not provide a cluster processing mechanism. When a failure or vulnerability attack occurs in the data center, the intelligent fusion terminal will fail and a large number of devices will be uncontrollable. Therefore, a simple and effective method is needed to implement cluster processing of the MQTT agent.
[0006] The common mimic security framework consists of distribution components, adjudication components, management components and execution bodies, see Figure 2 . In order to protect the data and its processing process, a cluster is built for the application's executors. When a single executor fails or fails, the management component starts the cleaning process and restores the failed executor. The distribution component implements the distribution of external input requests to the executor for calculation and processing, and the arbitration component determines whether an abnormality occurs based on the output difference of the executor. The MQTT agent is different from an ordinary executor. It does not process data directly, but delivers data to designated users. Therefore, a safe way is to add multiple data transmission paths. Even if a single transmission path is destroyed, the entire system will not fail. However, this also brings a problem: when a piece of data is transmitted on multiple paths, how to merge it into one piece of data before delivering it to the user, rather than multiple copies of the same data. Summary of the invention
[0007] In view of the problem that the mimetic security framework adds multiple data transmission paths for security but also brings difficulties in merging during data transmission, a mimetic security data exchange method based on MQTT is proposed. Based on the original mimetic security defense architecture, the present invention utilizes the MQTT subscription and distribution data capability, redundantly deploys multiple MQTT agents in parallel, and effectively protects the intelligent fusion terminal applications at the edge of the Internet.
[0008] The technical solution of the present invention is:
[0009] A method for pseudo-safe data exchange based on MQTT, which utilizes the subscription / distribution capabilities of the MQTT agent to construct an MQTT agent redundant cluster, broadcasts one data to multiple MQTT agents through a distribution component, and merges the same topic data using a pseudo-safe large number arbitration method; the method is based on the pseudo-safe data exchange framework of the MQTT agent, and the composition structure includes a publisher, a distribution component, an MQTT agent cluster, an arbitration component, a subscriber, and a negative feedback component; the method comprises the following steps:
[0010] Step 1: The client publisher connects to the distribution component. The publisher sends a CONNECT message to the distribution component agent, which contains connection parameters.
[0011] Step 2: The distribution component responds to the connection. After receiving the CONNECT message, the distribution component verifies the connection parameters of the client. If the verification is successful, the distribution component sends a CONNACK message to confirm that the connection is successful.
[0012] Step 3: The publisher publishes a message. The publisher sends a PUBLISH message to the distribution component, specifying the topic and payload.
[0013] Step 4: The distribution component receives the publish message. After receiving the PUBLISH message, the distribution component verifies the publish request. If the verification passes, the distribution component modifies the topic, adds path information, constructs multiple messages respectively, and forwards them to the MQTT agents on multiple paths respectively;
[0014] Step 5: The adjudication component subscribes to topic data on all MQTT agent paths, receives data through matching rules, compares the consistency of topic payloads from different paths, processes them into consistent payload data, and publishes the processed data to the final subscriber.
[0015] Furthermore, the specific composition of the MQTT proxy-based mimic security data exchange framework is as follows:
[0016] Publisher: MQTT client application, which publishes data to the distribution component in the form of (topic / device ID, payload data) according to the data type and device ID;
[0017] Distribution component: The distribution component is a modified MQTT proxy service that can publish topic payload data and subscribe to payload data. It subscribes to the data provided by the publisher. After the data is received, the topic path is marked, and then one-to-three forwarding processing is performed to forward the data to multiple MQTT proxies.
[0018] MQTT proxy cluster: redundant parallel MQTT proxies are used. The MQTT proxies receive topic data published by the distribution components. The topic data are marked with path branches, providing subsequent adjudication components for data merging and processing.
[0019] Adjudication component: The adjudication component is also a modified MQTT proxy service that can publish topic payload data and subscribe to payload data. It subscribes to the path data of the same topic of multiple MQTT proxies, uses the MQTT topic matching rule path, and then eliminates the minority according to the consistency adjudication method, providing a data, which is forwarded to the final subscriber as (topic / device 1, payload data). If an abnormality is found, the negative feedback component is notified to clean and replace the MQTT proxy executor with the abnormality.
[0020] Subscriber: MQTT client application, receiving various data from the underlying sensor terminals and forming a variety of advanced applications;
[0021] Negative feedback component: Receives notifications from the adjudication component. The negative feedback component can intervene in the execution of the program to stop the MQTT agent, restore the binary image, restart, and provide scheduling services.
[0022] Preferably, the connection parameters in step 1 may be client ID, user name, and password.
[0023] Preferably, a docker container is deployed on a cloud-native operating system such as Debian or Ubuntu as a deployment environment for the MQTT proxy executor to build the system.
[0024] Furthermore, the distribution component is transformed through the mosquitto proxy and plug-ins. It supports plug-ins to expand its functions and is programmed in C language. When the proxy receives the topic data, the Mosquitto library function mosquitto_publish is called; the arbitration component is transformed through the mosquitto proxy and plug-ins. The competitive hierarchical arbitration algorithm is used internally to wait for the same topic load within the time window. When multiple topic load data are received, the comparison is started. The load data of the same topic but different paths are compared. When the loads are consistent, this load is selected and returned to the client. When there are inconsistent loads, the dockerAPI library function is called to schedule the mosquitto proxy to implement cleaning and recovery.
[0025] The negative feedback management component is implemented based on the native API of the docker client. It can stop, delete, and create new containers for running mosquitto containers, restart containers, and replace failed containers in time to achieve dynamic recovery of system data uplink and download.
[0026] The MQTT agent executive component builds a container based on the mosquitto broker and is deployed on a cloud-native operating system. The container can be stopped / started through the docker command line.
[0027] The beneficial effects of the present invention are:
[0028] 1) Secure Data Center
[0029] The present invention expands the security protection method in edge-side smart devices and uses an MQTT proxy cluster to prevent the failure of a single data center from causing the failure of smart converged terminal devices.
[0030] 2) Mimic security architecture based on data exchange
[0031] Based on the original mimetic security defense architecture and according to the characteristics of the MQTT protocol, the present invention realizes a new mimetic security architecture for the purpose of data exchange.
[0032] 3)MQTT high availability
[0033] Redundant MQTT brokers can provide failover and high availability. When one broker fails, the other brokers can take over its tasks and subscriptions and initiate an automatic recovery process.
[0034] Through these improvements, the present invention enhances the security protection capability of data exchange and improves the security of intelligent fusion terminal equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 This is a schematic diagram of the deployment of general intelligent converged terminal applications;
[0036] Figure 2 This is a schematic diagram of a typical mimic security framework;
[0037] Figure 3 Schematic diagram of the method for exchanging virtual secure data according to the present invention;
[0038] Figure 4 It is a schematic diagram of the distribution component of the present invention;
[0039] Figure 5 It is a schematic diagram of the arbitration component of the present invention. DETAILED DESCRIPTION
[0040] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0041] In view of the above problems, the present invention proposes a pseudo-secure data exchange method based on MQTT proxy cluster series connection. The solution is to use the subscription / distribution capabilities of the MQTT proxy to construct a redundant MQTT proxy cluster, and broadcast a data to multiple MQTT proxies through the distribution component. In this way, even if a single proxy fails, the data can still reach the subscriber. In order to solve the problem of data duplication, a pseudo-secure large number arbitration method is adopted to merge the data of the same topic. Even if the data is tampered with, it will not affect the result. For details, see Figure 3 :
[0042] To further illustrate this method of pseudo-secure data exchange, the following describes the components of the MQTT proxy cluster:
[0043] 1) Publisher
[0044] The MQTT client application publishes data to the distribution component, such as the data collection application, in the form of (topic / device ID, payload data) according to the data type and device ID.
[0045] 2) Distribution components
[0046] The distribution component is a modified MQTT proxy service that can publish topic payload data and subscribe to payload data. It subscribes to the data provided by the publisher, and after receiving the data, the topic path is marked, and then a one-to-three forwarding process is performed to forward the data to multiple MQTT proxies.
[0047] 3)MQTT broker cluster
[0048] Redundant parallel MQTT agents (similar to the redundant executors of the mimicking system) are used to receive the topic data published by the distribution components respectively. The topic data are marked with path branches respectively, providing subsequent arbitration components for data merging processing.
[0049] 4) Adjudication Component
[0050] The arbitration component is also a modified MQTT proxy service that can publish topic payload data and subscribe to payload data. It subscribes to the path data of the same topic of multiple MQTT proxies, using the MQTT topic matching rule path, for example: topic / device 1 / +, matching the data of three paths such as topic / device 1 / 1, topic / device 1 / 2, and topic / device 1 / 3, and then eliminates the minority according to the consistency arbitration method, providing a data, and forwarding it to the final subscriber as (topic / device 1, payload data). If an abnormality is found, the negative feedback component is notified to clean and replace the MQTT proxy execution body where the abnormality occurs.
[0051] 5) Subscribers
[0052] The MQTT client application receives various types of data from the underlying sensor terminals and forms a variety of advanced applications, such as analysis applications, remote meter reading applications, etc.
[0053] 6) Negative feedback components
[0054] After receiving notifications from the adjudication component, the negative feedback component can perform operation intervention on the execution program, stop the MQTT agent, restore the binary image, restart, and provide scheduling services.
[0055] The above is the composition structure of the mimetic security data exchange framework based on MQTT agent. The following introduces the workflow of the system.
[0056] Step 1: The client publisher connects to the distribution component. The publisher sends a CONNECT message to the distribution component agent, which contains connection parameters such as client ID, user name, and password.
[0057] Step 2: The distribution component responds to the connection. After receiving the CONNECT message, the distribution component verifies the client's connection parameters (such as user name and password). If the verification is successful, the distribution component sends a CONNACK message to confirm that the connection is successful.
[0058] Step 3: The publisher publishes a message. The publisher sends a PUBLISH message to the distribution component, specifying the topic and payload. For example, the topic is sensor / temperature, the payload is 25.5, and the QoS level is 1.
[0059] Step 4: The distribution component receives the publish message. After receiving the PUBLISH message, the distribution component verifies the publish request. If the verification passes, the distribution component modifies the topic, adds path information, and constructs three messages with topics of sensor / temperature / 1, sensor / temperature / 2, and sensor / temperature / 3, with a payload of 25.5 and a QoS level of 1, and forwards them to the MQTT brokers on the three paths respectively.
[0060] Step 5: The adjudication component subscribes to the topic data on all MQTT proxy paths, receives data through matching rules, compares the consistency of the topic payloads from different paths, processes them into consistent payload data, and publishes the processed data to the final subscriber. For example: the topic payloads are (sensor / temperature / 1,25.5), (sensor / temperature / 2,25.5), (sensor / temperature / 3,25.6), the payloads are 25.5, 25.5, 25.6, and the consistent one is 25.5, then (sensor / temperature / 1,25.5) is sent.
[0061] DETAILED DESCRIPTION OF THE EMBODIMENTS The system is constructed by deploying a docker container on a cloud-native operating system such as Debian or Ubuntu as a deployment environment for an MQTT proxy executor.
[0062] 1) The distribution component is transformed through the mosquitto agent and plug-in, such as Figure 4 As shown, it supports plug-ins to extend its functionality, using C language programming to call the Mosquitto library function mosquitto_publish when the agent receives topic data. The following is a code sample showing how to forward messages to the target MQTT agent when the agent receives topic messages.
[0063]
[0064]
[0065] 2) The arbitration component is transformed through the mosquitto agent and plug-in, and a competitive hierarchical arbitration algorithm is used internally to wait for the same topic payload within the time window. When receiving multiple topic payload data, it starts to compare the payload data of the same topic but different paths. When the payloads are consistent, this payload is selected and returned to the client. When there are inconsistent payloads, the docker API library function is called to schedule the mosquitto agent to implement cleaning and recovery. Figure 5 It is composed of adjudication components.
[0066] 3) The negative feedback management component is implemented based on the native API of the docker client. It can stop, delete and create new containers for running mosquitto containers, restart containers, and replace failed containers in time to achieve dynamic recovery of system data uplink and download.
[0067] 4) The MQTT agent executive component builds a container based on the mosquitto broker and is deployed on a cloud-native operating system. The container can be stopped / started through the docker command line.
[0068] The above-mentioned embodiment only expresses one implementation mode of the present invention, and its description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.
Claims
1. A method for exchanging virtual secure data based on MQTT, characterized in that: The method utilizes the subscription / distribution capabilities of the MQTT agent to construct an MQTT agent redundant cluster, broadcasts a piece of data to multiple MQTT agents through a distribution component, and merges the same topic data using a mimetic secure large number arbitration method; the method is based on the mimetic secure data exchange framework of the MQTT agent, and the composition structure includes a publisher, a distribution component, an MQTT agent cluster, an arbitration component, a subscriber, and a negative feedback component; the method includes the following steps: Step 1: The client publisher connects to the distribution component. The publisher sends a CONNECT message to the distribution component agent, which contains connection parameters. Step 2: The distribution component responds to the connection. After receiving the CONNECT message, the distribution component verifies the connection parameters of the client. If the verification is successful, the distribution component sends a CONNACK message to confirm that the connection is successful. Step 3: The publisher publishes a message. The publisher sends a PUBLISH message to the distribution component, specifying the topic and payload. Step 4: The distribution component receives the publish message. After receiving the PUBLISH message, the distribution component verifies the publish request. If the verification passes, the distribution component modifies the topic, adds path information, constructs multiple messages respectively, and forwards them to the MQTT agents on multiple paths respectively; Step 5: The adjudication component subscribes to topic data on all MQTT agent paths, receives data through matching rules, compares the consistency of topic payloads from different paths, processes them into consistent payload data, and publishes the processed data to the final subscriber.
2. The MQTT-based mimetic secure data exchange method according to claim 1, characterized in that: The specific composition of the MQTT proxy-based mimic security data exchange framework is as follows: Publisher: MQTT client application, which publishes data to the distribution component in the form of (topic / device ID, payload data) according to the data type and device ID; Distribution component: The distribution component is a modified MQTT proxy service that can both publish topic payload data and subscribe to payload data; It subscribes to the data provided by the publisher. After receiving the data, it marks the topic path and then performs a one-to-three forwarding process to forward the data to multiple MQTT brokers. MQTT proxy cluster: redundant parallel MQTT proxies are used. The MQTT proxies receive topic data published by the distribution components. The topic data are marked with path branches, providing subsequent adjudication components for data merging and processing. Adjudication component: The adjudication component is also a modified MQTT proxy service that can both publish topic payload data and subscribe to payload data; It subscribes to the path data of the same topic of multiple MQTT brokers, uses the MQTT topic matching rule path, and then eliminates the minority according to the consistency decision method, and provides a data, which is forwarded to the final subscriber as (topic / device 1, payload data); If an abnormality is found, the negative feedback component is notified to clean and replace the MQTT proxy execution body where the abnormality occurs; Subscriber: MQTT client application, receiving various data from the underlying sensor terminals and forming a variety of advanced applications; Negative feedback component: Receives notifications from the adjudication component. The negative feedback component can intervene in the execution of the program to stop the MQTT agent, restore the binary image, restart, and provide scheduling services.
3. The MQTT-based mimetic secure data exchange method according to claim 1, characterized in that: The connection parameters in step 1 can be client ID, user name, and password.
4. The MQTT-based mimetic secure data exchange method according to claim 1, characterized in that: This system is built by deploying docker containers on Debian and Ubuntu cloud-native operating systems as the deployment environment of the MQTT proxy executor.
5. The MQTT-based mimetic secure data exchange method according to claim 1, characterized in that: The distribution component is transformed through the mosquitto proxy and plug-ins. It supports plug-ins to expand its functions and is programmed in C language. When the proxy receives the topic data, the Mosquitto library function mosquitto_publish is called; the arbitration component is transformed through the mosquitto proxy and plug-ins. The internal competitive hierarchical arbitration algorithm is implemented. It waits for the same topic load within the time window. When receiving multiple topic load data, it starts to compare the load data of the same topic but different paths. When the load is consistent, this load is selected and returned to the client. When there is an inconsistent load, the docker API library function is called to schedule the mosquitto proxy to implement cleaning and recovery; The negative feedback management component is implemented based on the native API of the docker client. It can stop, delete, and create new containers for running mosquitto containers, restart containers, and replace failed containers in time to achieve dynamic recovery of system data uplink and download. The MQTT agent executive component builds a container based on the mosquitto broker and is deployed on a cloud-native operating system. The container can be stopped / started through the docker command line.
Citation Information
Patent Citations
Real-time data distribution system with distributed network architecture and working method thereof
CN101848236A
Digital twin virtual-real network information real-time interaction method
CN113608887A
Micro-service-based mimicry application architecture system and scheduling method thereof
CN115794297A
Message interaction method, system and device based on MQTT and medium
CN115865881A
Advanced persistent threat detection by an information technology and security operations application
US11902306B1