Configuration synchronization method, device and system of Internet of Things terminal equipment

By deploying device configuration document services on remote servers and building MQTT connections, the problem of remote configuration management of IoT terminal devices in offline state is solved, and the flexibility of bidirectional configuration synchronization and large-scale data storage is realized, and the dependence between the device and the configuration end is decoupled.

CN119892850APending Publication Date: 2025-04-25BEIJING INHAND NETWORKS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311392905.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-25
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The prior art cannot effectively realize remote configuration management of IoT terminal devices in offline states, and traditional methods cannot meet the needs of bidirectional configuration synchronization and large-scale data storage.

Method used

By deploying device configuration document services on a remote server, building an MQTT connection between the remote server and the terminal device, users can modify configurations on the remote server and synchronize configurations through MQTT messages. At the same time, streaming is supported to solve the problem of data size limitations.

Benefits of technology

It realizes decoupling between the IoT terminal devices and the configuration end, supports offline remote configuration management and bidirectional configuration synchronization, cancels the size limit of Device Shadow, and improves the flexibility of data storage and transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119892850A_ABST
    Figure CN119892850A_ABST
Patent Text Reader

Abstract

The invention discloses a configuration synchronization method, device and system for Internet of Things terminal equipment. The method comprises the following steps: deploying an equipment configuration document service on a remote server; constructing MQTT connection between the remote server and the terminal equipment; a user establishes a configuration modification session for operating the terminal equipment on the remote server, and generates a configuration modification request; the remote server updates a device configuration document according to the configuration modification request, and publishes the device configuration document in the form of an MQTT message; after the terminal device obtains the MQTT message, configuration updating is carried out, and an updating result is returned to the remote server; and after receiving the updating result, the remote server updates the updating result to the device position document.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a configuration synchronization method, device and system for an Internet of Things terminal device. Background Art

[0002] With the rapid development of the industrial Internet of Things industry, a major notable feature of various industrial devices or terminals contained in the existing industrial automation system is "fragmentation". That is, in the current industrial Internet of Things, due to the wide variety of existing devices or terminals, the data transmission protocols used are also different. The MQTT protocol is a message queue transmission protocol that adopts a subscription and publishing mechanism. Subscribers only receive the data they have subscribed to, and do not receive the subscribed data. This not only ensures the exchange of necessary data, but also avoids the storage and processing caused by invalid data. Therefore, it is widely used in the industrial Internet of Things.

[0003] When implementing IoT applications, we often encounter the problem of synchronizing the local configuration of the device with the cloud platform. In IoT, the configuration is often stored on a remote server, and the device communicates with the remote server through MQTT, pulling the configuration stored on the remote server when needed.

[0004] The traditional solution is to provide a command issuing function on the remote server, allowing users to issue configuration CLI commands to the device through the remote server, and the device runs the CLI command to modify its own operation configuration. However, this method often requires that the device and the remote server have an online MQTT connection. Only when the MQTT connection is online can the configuration command be issued to the device. In actual scenarios, it is often necessary to perform remote configuration operations on the device on the remote server when the device is offline. It is required to be able to read the latest configuration content synchronized with the device and update these configuration contents. After the updated configuration is restored, the changed configuration items need to be sent to the device side for configuration synchronization after the MQTT connection between the device and the remote server is restored. At the same time, configuration changes are not only sent to the remote server. Users can remotely modify the configuration of the device on the remote server, or they can be in the same place as the device and directly make configuration changes to the device. When performing configuration operations on the device locally, the latest device configuration must be synchronized to the remote server, so that subsequent users can continue to view the latest configuration of the device on the remote server and modify the latest configuration again.

[0005] Traditional solutions cannot meet the requirements of offline remote configuration and two-way configuration synchronization. Some cloud service providers that support IoT platforms, such as AWS, provide solutions such as Device Shadow, which maintains a device shadow on a remote server. Both the device side and the platform interact with the device shadow. The device shadow maintains the device configuration version and determines what configuration changes need to be made to the device.

[0006] In the Device Shadow solution, each device shadow is limited to 8KB, which includes the device's status information, metadata, and client token. If you need to store a large amount of status information, you need to consider splitting the data or using other storage services, which complicates the storage of data.

[0007] In some cases, we need to support configuration synchronization in a private deployment environment. Using AWS IoTDevice Shadow cannot support private deployment and private network environments well.

[0008] Therefore, there is a need in the prior art for a method that can effectively realize remote configuration and control of an IoT terminal, thereby achieving decoupling of the IoT terminal device from the configuration terminal. Summary of the invention

[0009] The present invention provides a configuration synchronization method for an Internet of Things terminal device, which solves the current synchronization problem of terminal device configuration in the Internet of Things.

[0010] To achieve the above technical objectives, the present invention provides a configuration synchronization method for an Internet of Things terminal device, the method comprising:

[0011] S101, deploying a device configuration document service on a remote server;

[0012] S102, establishing an MQTT connection between the remote server and the terminal device;

[0013] S103, the user establishes a configuration modification session for operating the terminal device on the remote server and generates a configuration modification request;

[0014] S104, the remote server updates the device configuration document according to the configuration modification request and publishes it in an MQTT message;

[0015] S105, after receiving the MQTT message, the terminal device updates the configuration and returns the update result to the remote server;

[0016] S106, after receiving the update result, the remote server updates the update result to the device location document.

[0017] In one embodiment, the device configuration document service is used to respond to a user's request to perform a configuration operation on an IoT terminal device.

[0018] In one embodiment, a terminal device in the Internet of Things subscribes to a corresponding Topic in a message queue.

[0019] In one embodiment, when a user opens a configuration interface on a remote server, a session for the user's current configuration operation is established, and the session records all configuration operations of the user that have not been sent to the device.

[0020] In one embodiment, each time a request to establish a session is received, a new session snapshot is created and a session ID is returned, and multiple sessions are independent of each other.

[0021] In one embodiment, when the remote server receives a request to submit a configuration, it queries the configuration content of the corresponding session, compares it with the backed-up initial version, obtains the content modified by the user, and obtains the modified complete configuration by merging.

[0022] In one embodiment, when the terminal device does not establish an MQTT connection with the remote server, the remote server's configuration editing results will still be saved in the device configuration document; when the device's MQTT connection is established, it actively requests to obtain the platform configuration by subscribing to the corresponding topic; after receiving the request, the remote server sends the configuration content of the device configuration document to the device via MQTT.

[0023] In one embodiment, when the terminal device configuration document exceeds the maximum file reception limit reported by the device, the remote server will insert a piece of data into the temporary stream data storage table, create a temporary stream record for the current stream, and return a data stream ID. At the same time, it will split the device configuration document content, create stream data blocks, and then transmit messages to the device through streaming.

[0024] The invention of the present invention is:

[0025] 1. Self-implemented device configuration document service, by maintaining a device configuration in the cloud, allowing applications to interact with device status, and remote configuration management without the need to communicate directly with the device, thus achieving decoupling of the configuration end and the device end.

[0026] 2. Supports interaction with the device configuration document in streaming mode, and removes the size limit of Device Shadow. When the message exceeds the limit, there is no need to consider splitting the data or using other storage services, and you can directly use streaming mode to interact with the device configuration document.

[0027] 3. For devices with smaller memory capacity, you can customize the limit size and obtain configuration information in batches, making the interaction between the device and the device configuration document more flexible.

[0028] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0030] Figure 1 It is a flow chart of the remote calling method of the Internet of Things terminal of the present invention. DETAILED DESCRIPTION

[0031] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings.

[0032] like Figure 1 As shown, the configuration synchronization method of the Internet of Things terminal device of this embodiment includes:

[0033] S101, deploying a device configuration document service (Config shadow) on a remote server. This service is used to respond to a user's request for configuration operation on an IoT terminal device. In this embodiment, the device configuration document service can receive the user's configuration operation request through an HTTP interface provided by a web server.

[0034] S102, building an MQTT connection between the remote server and the terminal device. The terminal device in the Internet of Things subscribes to the corresponding Topic in the message queue.

[0035] S103, the user establishes a configuration modification session for operating the terminal device on the remote server and generates a configuration modification request. It includes: the remote server defines the http request POST: / config / init? deviceId=xxx, where deviceId represents the device ID that is expected to obtain the configuration. When the user opens the configuration interface on the remote server, a session of the user's current operation configuration will be established, and the session records all the configuration operations of the user that have not been sent to the device. Each time a request to establish a session is received, a new session snapshot will be created and a session id will be returned. Multiple sessions are independent of each other and do not affect each other. When the user opens the remote server configuration interface and enters a page under a certain menu, the configuration contents of the current session are queried by calling the http interface GET: / config defined by the remote server. After the user updates the configuration, the configuration of the current session is modified by calling the http interface PUT: / config defined by the remote server and stored in the database. After the user completes the operation and saves on the configuration interface, the http connection PUT: / config / commit is called to submit the configuration of the current session.

[0036] S104, the remote server updates the device configuration document according to the configuration modification request and publishes it as an MQTT message. It includes: when the remote server receives the request to submit the configuration, it queries the configuration content of the corresponding session, compares it with the initial version of the backup, obtains the content modified by the user, and obtains the modified complete configuration by merging. Then it updates the device configuration document. The updated device configuration document is published as an MQTT message, and the configuration session of the user is cleared.

[0037] S105, after the terminal device obtains the MQTT message, it updates the configuration and returns the update result to the remote server. It includes: the terminal device needs to subscribe to topic: / config / update / delta. When the device receives the MQTT message sent by the remote server, it updates the configuration locally and responds to the result to topic: / config / update via MQTT. After receiving the / config / update message, the remote server updates the result to the device configuration document of the corresponding device again and notifies the device via MQTT message.

[0038] If the device does not establish an MQTT connection with the remote server, the configuration edits made by the remote server will still be saved in the device configuration document. When the device's MQTT connection is established, it actively requests the platform's configuration by subscribing to topic: / config / get. After receiving the request, the remote server sends the configuration content of the device configuration document to the device via MQTT.

[0039] S106, after receiving the update result, the remote server updates the update result to the device location document. That is, after receiving the / config / update message, the remote server updates the result to the device configuration document of the corresponding device again and notifies the device via an MQTT message.

[0040] In this embodiment, during the interaction between the device and the device configuration document, if the device configuration document exceeds the maximum file receiving limit reported by the device (if the device has not reported, the default is 120KB), the remote server will insert data in the table config.streams (a table used to store temporary stream data), create a temporary stream record for the current stream, return a streamId, and at the same time divide the configuration content according to the maxPayloadLimit, create a stream data block, save it in the table config.stream.blocks, and then transmit it to the device through streaming transmission.

[0041] The present invention may be a system, method and / or computer program product at any possible level of integrated technical detail. The computer program product may include a computer-readable storage medium (or multiple media) having computer-readable program instructions thereon for causing a processor to perform various aspects of the present invention.

[0042] A computer readable storage medium may be a tangible device that can retain and store instructions used by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of computer readable storage media includes the following: a portable computer floppy disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device such as a punch card or a raised structure in a groove on which instructions are recorded, and any suitable combination of the above. A computer readable storage medium, as used herein, should not be interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted by a wire.

[0043] The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a corresponding computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network may include copper transmission cables, optical transmission fibers, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in a computer-readable storage medium within the corresponding computing / processing device.

[0044] The computer-readable program instructions for performing the operation of the present invention may be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, configuration data for integrated circuits, or source code or object code written in any combination of one or more programming languages ​​and process programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer, partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer may be connected to the user's computer by any type of network including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., by using the Internet of an Internet service provider). In certain embodiments, the electronic circuit including, for example, a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA) may execute the computer-readable program instructions by utilizing the state information of the computer-readable program instructions to personalize the electronic circuit, thereby performing aspects of the present invention.

[0045] Various aspects of the present invention are described herein with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It is understood that each block of the flowchart illustration and / or block diagram, and the combination of blocks in the flowchart illustration and / or block diagram, can be implemented by computer-readable program instructions.

[0046] These computer-readable program instructions may be provided to a processor of a computer or other programmable data processing device to produce a machine so that the instructions executed by the processor of the computer or other programmable data processing device create instructions for implementing the flowcharts and / or block diagrams. Figure 1These computer-readable program instructions may also be stored in a computer-readable storage medium capable of booting a computer, a programmable data processing device and / or other device that operates in a specific manner, so that the computer-readable storage medium having the instructions stored therein includes a manufactured product that includes instructions that implement aspects of the functions / actions specified in the flowchart and / or block diagram blocks.

[0047] Computer readable program instructions may also be loaded into a computer, other programmable data processing device, or other device to cause a series of operating steps to be performed on the computer, other programmable devices or other devices for producing a computer-implemented process, so that the instructions executed on the computer, other programmable device or other device implement the functions / actions specified in the flowchart and / or block diagram blocks.

[0048] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the system, method and computer program product according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, segment or portion of an instruction, which includes one or more executable instructions for implementing a specified logical function. In some optional implementations, the functions indicated in the block may occur outside the order indicated in the figure. For example, in fact, two blocks shown in succession can be completed as a step, and depending on the functions involved, they can be executed concurrently, substantially concurrently, in a partially or fully time-overlapping manner, or sometimes these blocks can be executed in reverse order. It will also be noted that each block of the block diagram and / or flowchart illustration, as well as the combination of blocks in the block diagram and / or flowchart illustration, can be implemented by a dedicated hardware-based system that performs a specified function or action or performs a combination of dedicated hardware and computer instructions.

[0049] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses (devices) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0050] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0051] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0052] The above description is only a specific implementation case of the present invention, and the protection scope of the present invention is not limited thereto. Any modification or replacement of the present invention by any technician familiar with the present technology within the technical specifications described in the present invention should be within the protection scope of the present invention.

Claims

1. A configuration synchronization method for an Internet of Things terminal device, characterized in that: The method comprises: S101, deploying a device configuration document service on a remote server; S102, establishing an MQTT connection between the remote server and the terminal device; S103, the user establishes a configuration modification session for operating the terminal device on the remote server and generates a configuration modification request; S104, the remote server updates the device configuration document according to the configuration modification request and publishes it in an MQTT message; S105, after receiving the MQTT message, the terminal device updates the configuration and returns the update result to the remote server; S106, after receiving the update result, the remote server updates the update result to the device location document.

2. The method according to claim 1, characterized in that When the terminal device configuration document exceeds the maximum file reception limit reported by the device, the remote server will insert a piece of data into the temporary flow data storage table, create a temporary flow record for the current flow, and return a data flow ID. At the same time, it will split the device configuration document content, create a flow data block, and then transmit the message to the device through streaming.

3. The method according to claim 1, characterized in that When the terminal device does not establish an MQTT connection with the remote server, the remote server's configuration editing results will still be saved in the device configuration document; when the device's MQTT connection is established, it actively requests to obtain the platform configuration through the subscribed corresponding topic; after receiving the request, the remote server sends the configuration content of the device configuration document to the device via MQTT.

4. The method according to claim 1, characterized in that The device configuration document service is used to respond to user requests for configuration operations on IoT terminal devices.

5. The method according to claim 1, characterized in that The terminal devices in the Internet of Things subscribe to the corresponding Topic in the message queue.

6. The method according to claim 1, characterized in that When a user opens the configuration interface on the remote server, a session for the user's current configuration operation will be established. The session records all the user's configuration operations that have not been sent to the device.

7. The method according to claim 1, characterized in that Each time a request to establish a session is received, a new session snapshot is created and a session id is returned. Multiple sessions are independent of each other.

8. The method according to claim 1, characterized in that When the remote server receives the request to submit the configuration, it queries the configuration content of the corresponding session, compares it with the initial version of the backup, obtains the content modified by the user, and obtains the modified complete configuration through merging.

9. A computing device comprising: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the data transmission method according to any one of claims 1 to 8 are implemented.

10. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the steps of the data transmission method according to any one of claims 1 to 8.