A method for hierarchical assembly and group synchronization of data between smart terminals and business systems

By employing a hierarchical synchronization and assembly approach, the slow speed and stability issues of data synchronization between smart terminals and business systems have been resolved. This approach achieves lightweight and real-time data synchronization, ensuring that smart terminals can still be used normally even when the network is abnormal.

CN119603311BActive Publication Date: 2025-10-31NEWCAPEC ELECTRONICS CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411684164.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-10-31
Estimated Expiration
2044-11-22

AI Technical Summary

Technical Problem

In existing technologies, data synchronization between smart terminals and business systems suffers from problems such as slow speed, untimely processing, high code coupling, high server load, and inability to synchronize in a timely manner when the external network environment is abnormal, resulting in the smart terminal becoming unusable.

Method used

By adopting a hierarchical data synchronization and assembly method, when the business system changes the data in the SQL database, the target smart terminal is identified, and the target first-level synchronization and assembly service is used to perform hierarchical data synchronization and assembly, sending data change notifications to lower-level devices level by level, and using kvDB for data storage and assembly to ensure the real-time performance and stability of the data.

Benefits of technology

It achieves lightweight business system resources, reduces server pressure, improves the real-time performance and stability of data synchronization, ensures that smart terminals can still be used offline when the network is abnormal, and has low code coupling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119603311B_ABST
    Figure CN119603311B_ABST
Patent Text Reader

Abstract

This invention provides a method for hierarchical data synchronization and assembly between smart terminals and business systems. When data in the SQL database of the business system changes, the system determines the target smart terminal based on the data change event. It then determines a target first-level synchronization assembly service based on the network topology of the target smart terminal and sends a data change notification to this service. Upon receiving the notification, the target first-level synchronization assembly service retrieves the changed data from the business system's SQL database, assembles the data according to its own assembly strategy, and stores it in its own kvDB database. It then determines the next-level devices to be synchronized based on the network topology of the target smart terminal and sends data change notifications to these devices. Each device receiving the notification determines whether it is the target smart terminal; if not, it determines the next-level device to be synchronized and sends a data change notification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data synchronization technology, and more specifically, to a method for hierarchical data synchronization and hierarchical assembly between smart terminals and business systems. Background Technology

[0002] In the process of information technology integration in schools and small and medium-sized enterprises, there are various business data synchronization and assembly tasks involving smart terminals such as consumption, water and electricity, water control, access control, and door locks. Currently, most smart terminals adopt a common single-level data synchronization and assembly mode, where the business system directly synchronizes business data with the smart terminal. This mode suffers from problems such as slow data synchronization speed, untimely synchronization, large assembly volume, high code coupling, and high server pressure. Furthermore, when the external network environment experiences abnormal interruptions, untimely data synchronization can render the smart terminal unusable.

[0003] Most existing device data synchronization methods focus on synchronization between devices. For example, patent CN110798444B proposes an IoT-based data synchronization method and device. This method determines the target device based on the data synchronization request of the device to be synchronized, acquires the target device's data information, constructs a synchronization dataset, and updates the device to be synchronized using the synchronization dataset, thereby achieving data synchronization between the target and target devices. Another example is a cloud-edge data synchronization method proposed in CN116233148A, which establishes a communication connection between the target edge node and the target edge device based on the data to be synchronized, thereby achieving data synchronization and improving data transmission efficiency during cloud-edge data synchronization. However, neither of these methods provides a solution for data synchronization between business systems and smart terminals.

[0004] In order to solve the above problems, people have been seeking an ideal technological solution. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of existing technologies by providing a method for hierarchical data synchronization and assembly between smart terminals and business systems.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0007] A first aspect is a method for hierarchical data synchronization and hierarchical assembly between a smart terminal and a business system, the method comprising:

[0008] When data in the SQL database changes, the business system determines the target smart terminal based on the data change event; it then determines the target first-level synchronous assembly service based on the network topology of the target smart terminal and sends a data change notification to the target first-level synchronous assembly service.

[0009] After receiving the data change notification, the target first-level synchronization assembly service pulls the changed data from the SQL database of the business system, assembles the data according to the assembly strategy of this level and stores it in its own kvDB database. Based on the network topology of the target smart terminal, it determines the next-level devices to be synchronized and sends the data change notification to the next-level devices to be synchronized.

[0010] After receiving a data change notification, each level of the device to be synchronized determines whether it is the target smart terminal. If not, it pulls the changed data from the kvDB database of the upper-level synchronization device, assembles the data according to the assembly strategy of this level, and stores it in its own kvDB database. Based on the network topology of the target smart terminal, it determines the lower-level devices to be synchronized and sends data change notifications to the lower-level devices to be synchronized. The current steps are repeated until each level of synchronization determines that it is the target smart terminal and pulls the changed data from the kvDB database of the upper-level synchronization level assembly service for data synchronization.

[0011] Furthermore, the data change notification includes the target smart terminal's identity information, terminal type, network topology, and the service type of the changed data;

[0012] The assembly strategy at this level is to assemble the retrieved change data based on a standard data assembly format associated with the terminal type of the target smart terminal and the service type of the change data.

[0013] Furthermore, after receiving a change notification, each level of the device to be synchronized or the target level of the synchronization assembly service searches for a standard data assembly format associated with the terminal type of the target smart terminal and the service type of the changed data in the pre-stored standard data assembly format library to execute the assembly strategy of this level; and determines the next level of the device to be synchronized based on the network topology of the target smart terminal.

[0014] The second aspect provides a data hierarchical synchronization and hierarchical assembly processing system between smart terminals and business systems, including a first-level synchronization assembly service and a second-level synchronization assembly service.

[0015] The first-level synchronization assembly service includes a first-level synchronization service, a first-level assembly service, and a first-level kvDB. After receiving a data change notification from the business system, the first-level synchronization service pulls the changed data from the SQL database in the business system, calls the first-level assembly service to assemble the first-level data according to the assembly strategy of this level and stores it in the first-level kvDB database, determines the target second-level synchronization assembly service according to the network topology of the target smart terminal, and sends a second-level data change notification to the target second-level synchronization assembly service.

[0016] The secondary synchronization assembly service includes a secondary synchronization service, a secondary assembly service, and a secondary key-value database (kvDB). Upon receiving a secondary data change notification from the primary synchronization service, the secondary synchronization service retrieves the changed data from the kvDB database of the primary synchronization assembly service based on the notification.

[0017] The secondary assembly service is invoked to assemble secondary data according to the current assembly strategy and store it in the secondary kvDB database. The target smart terminal to be synchronized is determined according to the network topology of the target smart terminal. A tertiary data change notification is sent to the target smart terminal so that the target smart terminal can pull the changed data from the kvDB database of the secondary synchronization assembly service for data synchronization according to the tertiary data change notification.

[0018] The third aspect provides a data synchronization system, including a business system, a first type of intelligent terminal, a second type of intelligent terminal, and the processing system described in the second aspect, wherein the business system and the primary synchronization assembly service of the processing system perform data synchronization based on RPC communication.

[0019] The first type of smart terminal directly synchronizes data with the business system through the primary synchronization assembly service of the processing system.

[0020] The second type of smart terminal synchronizes data with the business system sequentially through the secondary synchronization assembly service of the processing system and the primary synchronization assembly service of the processing system.

[0021] This invention has outstanding substantive features and significant progress compared to the prior art. Specifically,

[0022] (1) Lightweight business system operating environment resources, less investment in server resources for customers: hierarchical data synchronization and hierarchical assembly distribute the computational pressure of data synchronization and data assembly to multiple different data synchronization and assembly service nodes or smart gateway nodes, reducing the operating pressure of business system servers, requiring fewer resources for system operation, and thus requiring fewer server resources for customers to purchase.

[0023] (2) High real-time stability: When a local data synchronization assembly node is abnormal, it does not affect the data processing of other data synchronization service nodes, thus improving stability; when the platform data changes, it notifies the terminal to synchronize and obtain the latest data in real time, thus providing good real-time performance.

[0024] (3) High cohesion and low coupling in technical implementation code: Data assembly can be classified and distributed according to business. During technical implementation, different assembly implementations do not affect each other, and the code coupling is low.

[0025] (4) Smart terminals can be used offline: Data synchronization enables smart terminals to be used offline, and smart terminals can be used offline when the customer's network is occasionally abnormal. Attached Figure Description

[0026] Figure 1 This is a flowchart illustrating the processing method described in Embodiment 1 of the present invention.

[0027] Figure 2 This is a schematic diagram of the processing system described in Embodiment 2 of the present invention. Detailed Implementation

[0028] The technical solution of the present invention will be further described in detail below through specific embodiments.

[0029] Example 1

[0030] This embodiment provides a method for hierarchical data synchronization and assembly between smart terminals and business systems, such as... Figure 1 As shown, the method includes:

[0031] When data in the SQL database changes, the business system identifies the target smart terminal based on the data change event. Then, based on the network topology of the target smart terminal, it determines the target primary synchronization and assembly service to be synchronized and sends a primary data change notification to the target primary synchronization and assembly service to initiate the hierarchical data synchronization and assembly process. Specifically, it supports various SQL databases, such as SQL Server, DM, and other relational databases.

[0032] Preferably, the data change event includes the business type of the changed data and the identity information of the target smart terminal; specifically, the business type of the changed data includes device data, parameter data, authorization data, user data, and business data; after the target smart terminal is determined based on the data change event, the network topology associated with the identity information of the target smart terminal is searched in the business system; wherein, the network topology relationship of the smart terminal is stored in the business system when the smart terminal accesses the business system; specifically, the network topology relationship of the smart terminal is planned and designed according to parameters such as the communication type and data volume of the smart terminal, and the network topology relationship of the smart terminal is associated and stored with the identity information of the smart terminal.

[0033] Specifically, if the communication type of the smart terminal is MQTT, then the smart gateway or front-end service that uses MQTT communication with the smart terminal type is selected as its superior synchronization device.

[0034] When the communication type of the smart terminal is LoRa communication, select the smart gateway or front-end service that uses LoRa communication with the smart terminal as its upper-level synchronization device.

[0035] When the communication type of the smart terminal is Sub-1G communication, select the smart gateway or front-end service that uses Sub-1G communication with the smart terminal as its superior synchronization device.

[0036] The data change notification includes the target smart terminal's identity information, terminal type, network topology, and the service type of the changed data.

[0037] After receiving a data change notification, the target primary synchronization assembly service pulls the changed data from the SQL database of the business system, assembles the data according to the assembly strategy of this level and stores it in its own kvDB database. Based on the network topology of the target smart terminal, it determines the secondary devices to be synchronized and sends data change notifications to the secondary devices to be synchronized.

[0038] In practical implementation, the local assembly strategy involves assembling the retrieved changed data based on a standard data assembly format associated with the target smart terminal's terminal type and the service type of the changed data. Upon receiving the change notification, the target primary synchronization assembly service searches the pre-stored standard data assembly format library for the standard data assembly format associated with the target smart terminal's terminal type and the service type of the changed data to execute the local assembly strategy; and determines the secondary devices to be synchronized based on the target smart terminal's network topology.

[0039] After receiving the data change notification, the secondary synchronization device determines whether it is the target smart terminal. If not, it pulls the changed data from the kvDB database of the primary synchronization device, assembles the data according to the assembly strategy of this level, and stores it in its own kvDB database. Based on the network topology of the target smart terminal, it determines the tertiary synchronization device and sends the data change notification to the tertiary synchronization device.

[0040] After receiving the data change notification, the third-level synchronization device determines whether it is the target smart terminal. If not, it pulls the changed data from the kvDB database of the second-level synchronization device, assembles the data according to the assembly strategy of this level, and stores it in its own kvDB database. Based on the network topology of the target smart terminal, it determines the fourth-level synchronization device and sends the data change notification to the fourth-level synchronization device.

[0041] Repeat the current step until the device to be synchronized determines that it is the target smart terminal. At that time, it will pull the changed data from the kvDB database of the upper-level synchronization level assembly service for data synchronization, and will no longer perform data assembly.

[0042] Furthermore, after each level of the device to be synchronized determines the next level of the device to be synchronized based on the network topology of the target smart terminal, it sends out data change notifications and retrieves changed data according to the communication type between each level of the synchronization device and the next level of the device to be synchronized.

[0043] It is important to note that each level of data assembly is a process of data standardization. Simply put, for the same type of data, different types of smart terminals have their own data formats. Therefore, it is necessary to design corresponding standard data assembly formats for each type of business of each type of smart terminal so as to assemble the pulled data into the corresponding format of the target smart terminal.

[0044] Specifically, if each device to be synchronized receives a data change notification and determines that it is the target smart terminal, it will directly pull the changed data from the kvDB database of the upper-level synchronization level assembly service for data synchronization, without having to assemble the data again.

[0045] In the above technical solution, data is assembled according to business categories and in steps. During technical implementation, different assembly implementations do not affect each other, resulting in low code coupling.

[0046] It is important to note that compared to SQL databases, KVDB is a concise and efficient key-value pair storage repository that supports ordered key-value storage and simple full-text search, offering advantages such as high performance and low memory consumption. This invention utilizes KVDB for the storage and retrieval of assembled data, which can significantly improve data synchronization speed and ensure real-time data synchronization.

[0047] In this embodiment, the hierarchical synchronization and assembly of data distributes the computational pressure of data synchronization and assembly to multiple different data synchronization and assembly service nodes or smart gateway nodes, thereby reducing the operating pressure on the business system server, reducing the resources required for system operation, and thus reducing the server resources that customers need to purchase.

[0048] When a local data synchronization assembly node malfunctions, it does not affect the data processing of other data synchronization service nodes, thus improving stability; when platform data changes, it notifies the terminal in real time to synchronize and obtain the latest data, ensuring good real-time performance.

[0049] Furthermore, because the data is synchronized in a timely manner, meaning the data on the smart terminal is real-time, it does not affect the use of the device even when the customer's network is occasionally abnormal, and it has the ability to be used offline.

[0050] It should be noted that there are often multiple data changes, so the target first-level synchronization assembly service and each level of the device to be synchronized store the data change notifications in the message queue in the order they are received, and process the data change notifications based on the message queue mechanism.

[0051] Example 2

[0052] This embodiment provides a processing system for hierarchical data synchronization and assembly between smart terminals and business systems, such as... Figure 2 As shown, it includes a first-level synchronous assembly service and a second-level synchronous assembly service;

[0053] This includes first-level synchronous assembly service and second-level synchronous assembly service;

[0054] The first-level synchronization assembly service includes a first-level synchronization service, a first-level assembly service, and a first-level kvDB. After receiving a data change notification from the business system, the first-level synchronization service pulls the changed data from the SQL database in the business system, calls the first-level assembly service to assemble the first-level data according to the assembly strategy of this level and stores it in the first-level kvDB database, determines the target second-level synchronization assembly service according to the network topology of the target smart terminal, and sends a second-level data change notification to the target second-level synchronization assembly service.

[0055] The secondary synchronization assembly service includes a secondary synchronization service, a secondary assembly service, and a secondary kvDB. After receiving a secondary data change notification from the primary synchronization service, the secondary synchronization service retrieves the changed data from the kvDB database of the primary synchronization assembly service according to the secondary data change notification. It then calls the secondary assembly service to assemble the secondary data according to its own assembly strategy and stores it in the secondary kvDB database. Based on the network topology of the target smart terminal, it determines the target smart terminal to be synchronized and sends a tertiary data change notification to the target smart terminal, so that the target smart terminal can retrieve the changed data from the kvDB database of the secondary synchronization assembly service for data synchronization according to the tertiary data change notification.

[0056] Furthermore, the data change notification includes the target smart terminal's identity information, terminal type, network topology, and the service type of the changed data;

[0057] The assembly strategy at this level is to assemble the retrieved change data based on a standard data assembly format associated with the terminal type of the target smart terminal and the service type of the change data.

[0058] The first-level assembly service or the second-level assembly service searches for a standard data assembly format in a pre-stored standard data assembly format library that is associated with the terminal type and the service type of the changed data of the target smart terminal in order to execute the assembly strategy of this level.

[0059] Example 3

[0060] This embodiment provides a data synchronization system, including a business system, a smart terminal, and the processing system described in Embodiment 2. The smart terminal includes a first type of smart terminal and a second type of smart terminal.

[0061] The business system and the primary synchronization assembly service of the processing system synchronize data based on RPC communication.

[0062] The first type of smart terminal directly synchronizes data with the business system through the primary synchronization assembly service of the processing system; preferably, the primary synchronization assembly service of the processing system and the first type of smart terminal synchronize data based on WebSocket.

[0063] The second type of smart terminal synchronizes data with the business system sequentially through the secondary synchronization assembly service of the processing system and the primary synchronization assembly service of the processing system. Preferably, the primary synchronization assembly service and the secondary synchronization assembly service of the processing system synchronize data using Socket, RPC, and MQTT methods; the secondary synchronization assembly service of the processing system synchronizes data with the second type of smart terminal using SUB-1G, LoRa, and MQTT communication methods.

[0064] In practice, the change data includes device data, parameter data, authorization data, user data, and business data; the smart terminals include consumer terminals, access control terminals, door lock terminals, water and electricity terminals, and water control terminals; the secondary synchronous assembly service includes smart gateways and front-end servers.

[0065] Typically, consumer terminals must communicate in real time, so they use WebSocket for direct communication. This method only supports two-level synchronous assembly services, meaning that consumer terminals are classified as first-class smart terminals. However, access control terminals, door lock terminals, water and electricity terminals, and water control terminals need to use smart gateways or front-end services for communication, supporting three-level synchronous assembly services. Therefore, access control terminals, door lock terminals, water and electricity terminals, and water control terminals are classified as second-class smart terminals.

[0066] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them; although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications can still be made to the specific implementation of the present invention or equivalent substitutions can be made to some technical features without departing from the spirit of the technical solutions of the present invention, and all such modifications and substitutions should be covered within the scope of the technical solutions claimed in the present invention.

Claims

1. A method for hierarchical data synchronization and assembly between a smart terminal and a business system, characterized in that, The method includes: When data in the SQL database changes, the business system determines the target smart terminal based on the data change event; it then determines the target first-level synchronous assembly service based on the network topology of the target smart terminal and sends a data change notification to the target first-level synchronous assembly service. After receiving the data change notification, the target first-level synchronization assembly service pulls the changed data from the SQL database of the business system, assembles the data according to the assembly strategy of this level and stores it in its own kvDB database. Based on the network topology of the target smart terminal, it determines the next-level devices to be synchronized and sends the data change notification to the next-level devices to be synchronized. After receiving a data change notification, each level of the device to be synchronized determines whether it is the target smart terminal. If not, it pulls the changed data from the kvDB database of the upper-level synchronization device, assembles the data according to the assembly strategy of this level, and stores it in its own kvDB database. Based on the network topology of the target smart terminal, it determines the lower-level devices to be synchronized and sends data change notifications to the lower-level devices to be synchronized. The current steps are repeated until each level of synchronization determines that it is the target smart terminal and pulls the changed data from the kvDB database of the upper-level synchronization level assembly service for data synchronization.

2. The method for hierarchical data synchronization and hierarchical assembly between a smart terminal and a business system according to claim 1, characterized in that, The data change notification includes the target smart terminal's identity information, terminal type, network topology, and the service type of the changed data. The assembly strategy at this level is to assemble the retrieved change data based on a standard data assembly format associated with the terminal type of the target smart terminal and the service type of the change data.

3. The method for hierarchical data synchronization and hierarchical assembly between a smart terminal and a business system according to claim 2, characterized in that, After receiving a change notification, each level of the device to be synchronized or the target level of the synchronization assembly service searches for the standard data assembly format associated with the terminal type of the target smart terminal and the service type of the changed data in the pre-stored standard data assembly format library to execute the assembly strategy of this level. And determine the lower-level devices to be synchronized based on the network topology of the target smart terminal.

4. A method for hierarchical data synchronization and hierarchical assembly between a smart terminal and a business system according to any one of claims 1 to 3, characterized in that, After determining the lower-level devices to be synchronized based on the network topology of the target smart terminal, data change notifications are sent and changed data is retrieved according to the communication type between each level of synchronization device and the lower-level devices to be synchronized.

5. A method for hierarchical data synchronization and hierarchical assembly between a smart terminal and a business system according to any one of claims 1 to 3, characterized in that: The target level synchronization assembly service and each level of the device to be synchronized store data change notifications in a message queue according to the order of receipt, and process the data change notifications based on the message queue mechanism.

6. A data hierarchical synchronization and hierarchical assembly processing system between a smart terminal and a business system, comprising a primary synchronization and assembly service and a secondary synchronization and assembly service; The first-level synchronization assembly service includes a first-level synchronization service, a first-level assembly service, and a first-level kvDB. After receiving a data change notification from the business system, the first-level synchronization service pulls the changed data from the SQL database in the business system, calls the first-level assembly service to assemble the first-level data according to the assembly strategy of this level and stores it in the first-level kvDB database, determines the target second-level synchronization assembly service according to the network topology of the target smart terminal, and sends a second-level data change notification to the target second-level synchronization assembly service. The secondary synchronization assembly service includes secondary synchronization service, secondary assembly service, and secondary kvDB; After receiving the secondary data change notification from the primary synchronization service, the secondary synchronization service retrieves the changed data from the kvDB database of the primary synchronization assembly service according to the secondary data change notification. It then calls the secondary assembly service to assemble the secondary data according to its own assembly strategy and stores it in the secondary kvDB database. Based on the network topology of the target smart terminal, it determines the target smart terminal to be synchronized and sends a tertiary data change notification to the target smart terminal so that the target smart terminal can retrieve the changed data from the kvDB database of the secondary synchronization assembly service for data synchronization according to the tertiary data change notification.

7. The data hierarchical synchronization and hierarchical assembly processing system between a smart terminal and a business system according to claim 6, characterized in that: The data change notification includes the target smart terminal's identity information, terminal type, network topology, and the service type of the changed data. The assembly strategy at this level is to assemble the retrieved change data based on a standard data assembly format associated with the terminal type of the target smart terminal and the service type of the change data.

8. A data hierarchical synchronization and hierarchical assembly processing system between a smart terminal and a business system according to claim 6 or 7, characterized in that: The first-level assembly service or the second-level assembly service searches for a standard data assembly format in a pre-stored standard data assembly format library that is associated with the terminal type and the service type of the changed data of the target smart terminal in order to execute the assembly strategy of this level.

9. A data synchronization system, characterized in that: It includes a business system, a first type of smart terminal, a second type of smart terminal, and a processing system as described in any one of claims 6-8, wherein the business system and the primary synchronization assembly service of the processing system perform data synchronization based on RPC communication. The first type of smart terminal directly synchronizes data with the business system through the primary synchronization assembly service of the processing system. The second type of smart terminal synchronizes data with the business system sequentially through the secondary synchronization assembly service of the processing system and the primary synchronization assembly service of the processing system.

10. The data hierarchical synchronization and hierarchical assembly processing system between a smart terminal and a business system according to claim 9, characterized in that: The changed data includes device data, parameter data, authorization data, user data, and business data; the smart terminals include consumer terminals, access control terminals, door lock terminals, water and electricity terminals, and water control terminals; the secondary synchronous assembly service includes a smart gateway and a front-end server; The communication method between the first type of smart terminal and the first-level synchronous assembly service is WebSocket; The communication methods between the secondary synchronous assembly service and the primary synchronous assembly service include Socket, MQTT, and RPC. The communication methods between the secondary synchronous assembly service and the smart terminal include Sub-1G, LoRa, and MQTT.

Citation Information

Patent Citations

  • Cloud edge data synchronization method, system and device and computer storage medium

    CN116233148A

  • Cross-level distributed duty system public service platform

    CN115858674A

  • Data aggregation synchronization method in distributed scene and storage medium

    CN116821245A