Data synchronization method and device, electronic equipment, storage medium and program product

By deploying transmission messages in a distributed system, the bottom-up automatic data reporting is achieved, which solves the problem of differences in data types and reporting forms in data management and business processing of group organizations, and realizes unified data management and deep processing.

CN119967010APending Publication Date: 2025-05-09BOE TECHNOLOGY GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510210992.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

There are differences in data types and reporting forms in group-type organizational structures in data management and business processing, making it difficult for the group to effectively manage and integrate data from subordinate organizations.

Method used

Provide a data synchronization method, by deploying transmission messages in a distributed system, determining the target transmission messages in response to data changes of the target child nodes, and transmitting the change data to the root node step by step according to hierarchical relationships.

Benefits of technology

It realizes automatic data reporting from the bottom up, which facilitates the root node to integrate data and in-depth processing, unify the reported data types, and facilitates the group's data management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119967010A_ABST
    Figure CN119967010A_ABST
Patent Text Reader

Abstract

The invention provides a data synchronization method which can be applied to the technical field of data processing. The method can be applied to a distributed system, the distributed system comprises a root node and at least one child node with a hierarchical relationship, and at least one transmission message is deployed in the distributed system; the method comprises the following steps: determining a target transmission message in at least one transmission message according to change data of a target child node in at least one child node in response to the change of the data of the target child node; and transmitting the change data of the target child node to the root node step by step by using the target transmission message according to the hierarchical relationship. The invention further provides a data synchronization device, electronic equipment, a storage medium and a program product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and more specifically, to a data synchronization method, device, electronic device, storage medium and program product. Background Art

[0002] For group-type organizations, subordinate organizations need to deploy systems separately and determine the data types and reporting logic to be reported to achieve data transmission functions. When the group needs to call the data of subordinate organizations, it needs to send a reporting request to the subordinate organizations. Subordinate organizations report data according to their own reporting logic and reporting types, resulting in different data types and reporting forms reported by different subordinate organizations, which is not conducive to the group's data management. Summary of the invention

[0003] In view of this, the present disclosure provides a data synchronization method, device, electronic device, storage medium and program product.

[0004] One aspect of the present disclosure provides a data synchronization method, which is applied to a distributed system, wherein the distributed system includes a root node and at least one child node having a hierarchical relationship, and the distributed system is deployed with at least one transmission message; the method includes:

[0005] In response to a change in data of a target child node in at least one child node, determining a target transmission message in at least one transmission message according to the changed data of the target child node; and

[0006] According to the hierarchical relationship, the target transmission message is used to transmit the changed data of the target child node to the root node step by step.

[0007] According to an embodiment of the present disclosure, at least one transmission message each has a data type;

[0008] Determining a target transmission message in at least one transmission message according to the change data of the target child node includes:

[0009] Determine a target data type in at least one data type according to the changed data of the target child node;

[0010] A transmission message corresponding to the target data type in the at least one transmission message is determined as a target transmission message.

[0011] According to an embodiment of the present disclosure, the above method further includes:

[0012] Determine the storage space occupied by the changed data of the target child node;

[0013] In response to the target data type and storage space satisfying the preset transmission condition, the changed data of the target child node is transmitted to the root node level by level using the target transmission message according to the hierarchical relationship;

[0014] In response to the target data type and storage space not satisfying a preset transmission condition, the transmission of the changed data of the target subnode to the parent node of the target subnode is stopped.

[0015] According to an embodiment of the present disclosure, at least one transmission message includes a common transmission message and a supplementary transmission message for a target child node, the common transmission message represents a transmission message shared by a root node and at least one child node in a distributed system, the supplementary transmission message represents a transmission message generated for data characteristics of the target child node, and the common transmission message includes at least one of the following: a spatial data message, a topological data message, a timing data message, and an event data message.

[0016] According to an embodiment of the present disclosure, according to the hierarchical relationship, using the target transmission message to transmit the changed data of the target child node to the root node step by step includes:

[0017] Perform the following operations step by step until the data is transmitted to the root node:

[0018] The target subnode is used as the current transmission subnode, and the target transmission message is used to transmit the change data of the current transmission subnode to the upper node of the current transmission subnode;

[0019] In response to the change data of the current transmission subnode satisfying the preset processing conditions, the change data of the current transmission subnode is processed using the processing method corresponding to the parent node of the current subnode, and the parent node of the current transmission subnode is determined to be the next transmission subnode, wherein the preset processing conditions are determined based on the parent node of the current transmission subnode.

[0020] According to an embodiment of the present disclosure, the above method further includes:

[0021] Generate a registration request according to the registration information for the child node to be registered input by the user in the node registration interface, wherein the registration information includes an authorization token determined by the first target parent node, and the first target parent node is the parent node of the child node to be registered;

[0022] Transmitting a registration request to the first target parent node using an authentication message;

[0023] In response to the first target parent node completing authentication of the authorization token, a connection is established between the child node to be registered and the first target parent node, and registration data of the child node to be registered is transmitted to the first target parent node using a registration message.

[0024] According to an embodiment of the present disclosure, the above method further includes:

[0025] Generate a node clearing request according to the clearing information input by the user in the node clearing interface of the target child node, and transmit the node clearing request to the second target parent node using a clearing message, wherein the clearing information includes the node information of the target child node and the node information of the second target parent node, and the second target parent node is the parent node of the target child node;

[0026] The second target parent node disconnects the target child node in response to the node clearing request and clears the data of the target child node.

[0027] According to an embodiment of the present disclosure, the above method further includes:

[0028] In response to the second target parent node clearing data of the target child node, generating change data for the second target parent node;

[0029] According to the hierarchical relationship, the changed data of the second target parent node is transmitted to the root node level by level using a transmission message corresponding to the data type of the changed data of the second target parent node.

[0030] Another aspect of the present disclosure provides a data synchronization device, which is applied to a distributed system, wherein the distributed system includes a root node and at least one child node having a hierarchical relationship, and the distributed system is deployed with at least one transmission message; the device includes:

[0031] A first determining module, configured to determine a target transmission message in at least one transmission message according to the changed data of the target subnode in response to a change in data of the target subnode in at least one subnode; and

[0032] The first transmission module is used to transmit the changed data of the target child node to the root node step by step according to the hierarchical relationship using the target transmission message.

[0033] Another aspect of the present disclosure provides an electronic device, comprising:

[0034] one or more processors;

[0035] a memory for storing one or more programs,

[0036] When the one or more programs are executed by the one or more processors, the one or more processors implement the above method.

[0037] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.

[0038] Another aspect of the present disclosure provides a computer program product, the computer program product comprising computer executable instructions, and the instructions are used to implement the above method when executed.

[0039] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0041] Figure 1 is a diagram of a distributed system architecture according to an embodiment of the present disclosure;

[0042] Figure 2 is a flow chart of a data synchronization method according to an embodiment of the present disclosure;

[0043] Figure 3 is a schematic diagram of a data synchronization method according to an embodiment of the present disclosure;

[0044] Figure 4 is a schematic diagram of stage-by-stage transmission according to an embodiment of the present disclosure;

[0045] Figure 5 is a flowchart of registering a subnode according to an embodiment of the present disclosure;

[0046] Figure 6 is a schematic diagram of clearing a target subnode according to an embodiment of the present disclosure;

[0047] Figure 7 is a block diagram of a data synchronization device according to an embodiment of the present disclosure; and

[0048] Figure 8 is a block diagram of an electronic device suitable for implementing the method described above according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0049] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0050] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0051] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0052] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0053] In the embodiments of the present disclosure, the collection, updating, analysis, processing, use, transmission, provision, disclosure, storage, etc. of the data involved (for example, including but not limited to user personal information) are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information and network security.

[0054] In the embodiments of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.

[0055] The following problems exist in group-type organizations in the related technology: the business data generated by subordinate organizations are generally stored in the business services of subordinate organizations. When the data of some subordinate organizations is needed, the superior organization needs to initiate a reporting request. Subordinate organizations need to implement the data transmission function by themselves, that is, each subordinate organization needs to determine which data to transmit and implement the corresponding transmission logic. The processing method of group-type organizations is generally a flat structure, and it is difficult to divide the data management and business processing of the tree structure of subordinate organizations under subordinate organizations. Business processing is generally handled by subordinate organizations themselves, and it is difficult to support the necessary direct intervention of the headquarters in processing and execution, and the headquarters has no effective direct control means. It is difficult for the headquarters to detect general data (such as fire incidents) in the first time, and it is difficult to handle it in time. When adjusting the structure of a group-type organization, it is usually necessary to make relatively large changes and upgrades, which is a large workload.

[0056] Based on this, an embodiment of the present disclosure provides a data synchronization method, which is applied to a distributed system, wherein the distributed system includes a root node and at least one child node with a hierarchical relationship, and the distributed system is deployed with at least one transmission message; the method includes: in response to a change in the data of a target child node in at least one child node, determining a target transmission message in at least one transmission message according to the change data of the target child node; and according to the hierarchical relationship, using the target transmission message to transmit the change data of the target child node to the root node step by step. By deploying at least one transmission message, when the data of the current child node changes, the transmission message can be used to transmit the change data to the upper node step by step, realizing automatic reporting of data from the bottom up, so that the root node can perform data integration and deep processing; at the same time, all child nodes use a unified transmission message, which can make the reported data type the same, which is convenient for the group to manage data.

[0057] Figure 1 It is a diagram of a distributed system architecture according to an embodiment of the present disclosure.

[0058] It should be noted that Figure 1 What is shown is merely an example of a distributed system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0059] like Figure 1 As shown, the distributed system 100 of this embodiment includes a root node and five sub-nodes with a hierarchical structure. Among them, the root node at the first level is the cloud headquarters platform 110, and the cloud headquarters platform 110 includes two sub-nodes, namely, the business park 111 and the virtual park 112; the business park 111 includes two sub-nodes, namely, the business park 111_1 and the business park 111_2, and the virtual park 112 includes a sub-node, namely, the business park 112_1.

[0060] It should be noted that the distributed system 100 does not need to be created in advance from top to bottom, that is, it does not need a dedicated upper node to be created uniformly, and the distributed system 100 of the embodiment of the present disclosure can be created from bottom to top. Specifically, for example, for the cloud headquarters platform 110, when a new business park 111 needs to be created, the business park 111 only needs to send a registration request to the cloud headquarters platform 110. After the cloud headquarters platform 110 is authenticated, a connection between the cloud headquarters platform 110 and the business park 111 is established to form one of the sub-nodes of the cloud headquarters platform 110. Similarly, for the business park 111, when a new business park 111-1 needs to be created, the business park 111-1 only needs to send a registration request to the business park 111. After the business park 111 is authenticated, a connection between the business park 111 and the business park 111_1 is established to form one of the sub-nodes of the business park 111.

[0061] For the above-mentioned distributed system 100, when the data of one of the byte nodes, such as the business park 111-1, changes, it is necessary to determine the transmission message corresponding to the data type based on the changed data of the business park 111-1. For example, if the changed data type is spatial data, then the transmission message is determined to be a spatial data message, and the spatial data message is used to transmit the changed data to the business park 111, so that the business park 111 can update the data for the business park 111-1 in time. After the business park 111 has updated the data, the data of the business park 111 has also changed. At this time, the business park 111 needs to report the changed data to its superior node, the cloud headquarters platform 110, so that the cloud headquarters platform 110 can update the data in time. Since the cloud headquarters platform 110 is the root node, data synchronization is completed at this time.

[0062] It should be understood that Figure 1 The number of service parks and virtual parks in the example is only for illustration. Any number of service parks and virtual parks may be provided according to the implementation requirements. In addition, the distributed system may also include a topology park.

[0063] Figure 2 is a flowchart of a data synchronization method according to an embodiment of the present disclosure.

[0064] The data synchronization method of the embodiment of the present disclosure may be applied to a distributed system, which may include a root node and at least one child node having a hierarchical relationship, and the distributed system may be deployed with at least one transmission message. The data synchronization method may include: Figure 2 Operations S210 to S220 are shown.

[0065] In operation S210, in response to a change in data of a target child node among at least one child node, a target transmission message among at least one transmission message is determined according to the changed data of the target child node.

[0066] The data change may include any data change, such as data deletion, data addition, data update, etc. It may also include adding a subordinate node or reducing a subordinate node of a target child node.

[0067] The transmission message can be a predefined data synchronization message, and different data types can correspond to different transmission messages. Therefore, determining the target transmission message in at least one transmission message according to the change data of the target sub-node can include determining the target transmission message in at least one transmission message according to the data type of the change data.

[0068] In operation S220, the changed data of the target child node is transmitted to the root node level by level using the target transmission message according to the hierarchical relationship.

[0069] Using the target transmission message to transmit the changed data of the target child node to the root node step by step may include: using the target transmission message to transmit the changed data of the target child node to the superior node of the target child node, and then the superior node of the target child node uses the target transmission message to transmit it to the superior node, and so on, step by step, until it is transmitted to the root node.

[0070] By deploying at least one transmission message, when the data of the target child node changes, the transmission message can be used to transmit the changed data to the upper node step by step, realizing the automatic reporting of data from bottom to top, so that the root node can perform data integration and in-depth processing. In addition, by uniformly configuring shared transmission messages, the transmission data can be regularized, which is convenient for the group to perform subsequent use such as data processing, standardize integration and processing, and help generate data scale value; at the same time, it can also reduce the intrusion on the child node side, without the need for the child node to write transmission logic, and reduce manpower expenditure.

[0071] For the group-type park organizational structure, the present invention defines a method and a standard data synchronization protocol for multi-level organizational data synchronization services between group-type headquarters and branches. The branch business end needs to implement this protocol. Relying on the synchronization mechanism, there is no need to implement data synchronization logic separately, which reduces the difficulty of development and data acquisition, thereby achieving multi-regional group project on-site data seamlessly reporting to the group cloud, facilitating data integration and deep processing on the cloud.

[0072] According to an embodiment of the present disclosure, at least one transmission message each has a data type; determining a target transmission message in at least one transmission message based on the change data of the target child node includes: determining a target data type in at least one data type based on the change data of the target child node; determining a transmission message in at least one transmission message corresponding to the target data type as the target transmission message.

[0073] Data types may include spatial data types, topological data types, time series data types, temporal data types, custom data types, and the like.

[0074] At least one transmission message may include a common transmission message and a supplementary transmission message for a target child node, the common transmission message represents a transmission message shared by a root node and at least one child node in a distributed system, the supplementary transmission message represents a transmission message generated based on data characteristics of the target child node, and the common transmission message includes at least one of the following: a spatial data message, a topological data message, a timing data message, and an event data message.

[0075] At least one transmission message each has a corresponding data type, for example, a spatial data message corresponds to spatial data, a topological data message corresponds to spatial data, a time series data message corresponds to time series data, and an event data message corresponds to event data.

[0076] Determining the target transmission message in at least one transmission message according to the changed data of the target child node may include determining the target transmission message according to the data type of the changed data. For example, if the changed data is space data, the target message is a space data message.

[0077] It should be noted that each child node can define a custom data type and a supplementary transmission message corresponding to the custom data type according to its own data characteristics. When the changed data is a custom data type, the supplementary transmission message corresponding to the custom data type is determined as the target transmission message.

[0078] According to an embodiment of the present disclosure, at least one transmission message each has a message field, and different transmission messages have different fields.

[0079] The fields of the spatial data message may include: organization ID, project ID, message type, spatial data, plot name, region name, metadata, etc. It should be noted that the above mainly describes the minimum set of spatial data of the regional project itself, supports nested structure, and supports metadata extension.

[0080] The fields of the topology data message may include: organization ID, project ID, message type, topology data, department ID, department's parent department ID, user ID, user's department ID, device ID, device's parent department ID, device metadata, etc. It should be noted that the above mainly describes the minimum set of department organization, personnel, and equipment data of the regional project itself, supports nested structure, and supports metadata extension.

[0081] The fields of a time series data message may include: organization ID, project ID, message type, device ID, real-time value, and data occurrence time.

[0082] The fields of the event data message may include: organization ID, project ID, message type, device ID, real-time value, and data occurrence time.

[0083] The fields of the supplementary transmission message may include: organization ID, project ID, message type, and project data feature description.

[0084] It should be noted that when the content of the protocol changes, it can be reported using the MOTT (Message Queue Telemetry Transmission) protocol.

[0085] According to an embodiment of the present disclosure, the above method also includes: determining the storage space occupied by the changed data of the target child node; in response to the target data type and storage space satisfying the preset transmission conditions, transmitting the changed data of the target child node step by step to the root node according to the hierarchical relationship using the target transmission message; in response to the target data type and storage space not satisfying the preset transmission conditions, stopping the transmission of the changed data of the target child node to the parent node of the target child node.

[0086] The preset transmission condition may include that the data type is a preset type and the storage space is less than a preset threshold.

[0087] For example, the preset transmission condition may be that the data type is a time type, a time type, and the storage space is less than 10G. In this case, for example, if the target data type is a time type, and the storage space of the changed data is 8G, it indicates that the preset transmission condition is met; for another example, if the target data type is a video type, and the storage space of the changed data is 12G, it indicates that the preset transmission condition is not met.

[0088] It should be noted that the present disclosure does not limit the preset transmission conditions, which can be configured according to actual needs.

[0089] Figure 3 is a schematic diagram of a data synchronization method according to an embodiment of the present disclosure.

[0090] like Figure 3 As shown, when the data of the target child node 310 in at least one child node changes, the change data 320 is generated, and then the data type and storage space of the change data 320 are determined to obtain the target data type 330 and storage space 340; then based on the preset transmission condition, it is determined whether the target data type 330 and storage space 340 meet the preset transmission condition. If they meet, the target transmission message 350 is determined according to the target data type 330, and then according to the hierarchical relationship, the change data 320 is transmitted to the root node 360 ​​step by step using the target transmission message, and then the operation S370 is executed to end the transmission. If not, the operation S370 is directly executed to end the transmission.

[0091] By judging the data type and storage space according to the preset transmission conditions, when the changed data meets the preset transmission conditions, it is necessary to transmit it step by step; when the changed data does not meet the preset transmission conditions, it is not necessary to transmit it step by step, thereby realizing dynamic data upload and reducing the storage burden of the upper platform.

[0092] According to an embodiment of the present disclosure, according to the hierarchical relationship, the change data of the target subnode is transmitted step by step to the root node using the target transmission message, including: performing the following operations step by step until it is transmitted to the root node: taking the target subnode as the current transmission subnode, and transmitting the change data of the current transmission subnode to the parent node of the current transmission subnode using the target transmission message; in response to the change data of the current transmission subnode satisfying a preset processing condition, processing the change data of the current transmission subnode using a processing method corresponding to the parent node of the current subnode, and determining that the parent node of the current transmission subnode is the next transmission subnode, and determining that the processed change data is the change data of the next transmission subnode.

[0093] The preset processing condition is determined by the parent node of the current transmission subnode. The preset processing condition may include, for example, a preset processing data type. For example, the preset processing condition is that the change data is an alarm event type. At this time, when the change data is an alarm event type, the parent node of the current transmission subnode needs to process the alarm event and then transmit the processed data to the parent node.

[0094] Figure 4 It is a schematic diagram of step-by-step transmission according to an embodiment of the present disclosure.

[0095] like Figure 4 As shown, the distributed system of this embodiment includes a root node 410, and the root node 410 includes two subordinate nodes, namely, a subnode 411 and a subnode 412. The subnode 411 includes two subordinate nodes, namely, a subnode 411_1 and a subnode 411_2, and the subnode 412 includes a subordinate node, namely, a subnode 412_1. For example, the data of the subnode 411_2 changes, that is, the subnode 411_2 is the current transmission subnode. At this time, the target transmission message is used to transmit the changed data to the upper node of the subnode 411_2, namely, the subnode 411, and then the subnode 411 analyzes the type of the changed data. If it meets the preset processing conditions, the changed data is processed to obtain the processed changed data; then the subnode 411 is used as the current transmission subnode, and the processed changed data is transmitted to the root node 410 as the changed data of the subnode 411, and the data synchronization is completed.

[0096] Figure 5 is a flowchart of registering a subnode according to an embodiment of the present disclosure.

[0097] like Figure 5 As shown, this embodiment includes operations S510 to S540.

[0098] In operation S510, a registration request is generated according to the registration information for the child node to be registered input by the user in the node registration interface.

[0099] The registration information includes an authorization token determined by a first target parent node, and the first target parent node is an upper-level node of the child node to be registered.

[0100] It should be noted that when a new child node needs to be registered, the parent node of the child node to be registered is aware of it. Specifically, whether a new node needs to be registered is determined by the parent node of the child node to be registered. Figure 4 If the child node 412 in the needs to add a child node, the child node 412 must know that it will add a child node. At this time, the child node 412 can allocate an authorization token to the child node to be added to facilitate authentication when registering the child node.

[0101] In operation S520, a registration request is transmitted to the first target parent node using an authentication message.

[0102] The authentication message is a message used for data authentication, and is used to transmit a registration request in the child node registration node.

[0103] In operation S530, in response to the first target parent node completing authentication of the authorization token, a connection is established between the child node to be registered and the first target parent node.

[0104] After the first target parent node receives the registration request, it authenticates the authorization in the registration request. If it passes, a connection is established between the node to be registered and the first target parent node.

[0105] In operation S540, the registration data of the child node to be registered is transmitted to the first target parent node using a registration message.

[0106] The registration message is used for child recognition, that is, for transmitting the data of the child node to be registered to the first target parent node. For example, when the child node to be registered is a new project in the parent project (the first target parent node), the registration message can have the following fields: project description, project ID, parent project ID, and message type.

[0107] After the connection is established, the child node to be registered needs to transmit its own data, ie, registration data, to the first target parent node.

[0108] The child node registers with the parent node. After authentication is completed, a communication link with the parent node is established and the relevant data of the child node is reported. After the parent node receives the new registration data, it repeats the same link to its parent node, and so on until the root node. This is similar to the implementation of a family genealogy. The root node, such as the ancestral park, defines the authorization rules. The father authorizes. When a new member joins, it is entered into the system by the father.

[0109] According to an embodiment of the present disclosure, the above method also includes: generating a node clearing request based on the clearing information input by the user in the node clearing interface of the target child node, and transmitting the node clearing request to the second target parent node using a clearing message, wherein the clearing information includes the node information of the target child node and the node information of the second target parent node, and the second target parent node is the parent node of the target child node; the second target parent node disconnects the connection with the target child node in response to the node clearing request, and clears the data of the target child node.

[0110] The clear message is used to leave the upper node, and the clear message may include the following fields: project ID, parent project ID, message type. After receiving the clear message, the second target parent node disconnects from the child node to be cleared and deletes the data of the byte to be cleared.

[0111] It should be noted that after the target child node is disconnected from the second target parent node, the target child node can be Figure 5 The node registration method shown is re-associated to other child nodes.

[0112] According to an embodiment of the present disclosure, the above method also includes: in response to the second target parent node clearing the data of the target child node, generating change data for the second target parent node; according to the hierarchical relationship, transmitting the change data of the second target parent node to the root node step by step using a transmission message corresponding to the data type of the change data of the second target parent node.

[0113] After the second target parent node clears the data of the target child node, if the data representing the second target parent node changes, you need to follow Figure 2 The method shown transmits the changed data to the higher-level nodes until it reaches the root node.

[0114] Figure 6 is a schematic diagram of clearing a target subnode according to an embodiment of the present disclosure.

[0115] like Figure 6As shown, the parent node of the target child node 610 is the target parent node 620, and the parent node of the target parent node 620 is the target grandparent node 630. For the target child node 610, the user 611 enters the clearing information 612 in the node clearing interface, and then the background of the target child node 610 generates a node clearing request 613 according to the clearing information 612, and transmits it to the target parent node 620. The target parent node 620 responds to the transmission request and executes operation S621 to disconnect from the target child node 610 according to the node clearing request 613; then executes operation S622 to clear the data of the target child node 610; then executes operation S623 to generate change data; then executes operation S624 to determine the target transmission message according to the change data, and transmits the change data to the target grandparent node 630 using the target transmission message. In response to the transmission request, the target grandparent node 630 executes operation S631 to clear the data of the target child node 610.

[0116] Through self-registration and node clearing of the child nodes to be registered, when upgrading or updating the architecture of the distributed system, no major changes are required. You only need to first establish a new real park or virtual park, then cancel the association between the current park and the parent, and then associate it with the newly created park. This implements a mechanism for dynamic association and dynamic cancellation of parent authorization, self-finding of the parent, and corresponding protocol messages.

[0117] The data synchronization method provided by the embodiment of the present disclosure can also realize a kind of direct control method of the headquarters to enhance the fault tolerance of the business. It can realize higher-level processing of headquarters-level data, such as higher alarm priority, etc. For the adjustment of the organizational structure of the group-type park, the sub-park can first perform the separation action and then configure the new parent level.

[0118] According to an embodiment of the present disclosure, the target subnode may include at least one subordinate node; the method may further include: generating a data reporting request based on data reporting information input by a user in a data reporting interface of the target subnode, wherein the data reporting information includes node information to be reported and data information to be reported; transmitting the data reporting request to the subordinate nodes step by step using a data reporting message for the data reporting request until it is transmitted to the node to be reported; the node to be reported generates reporting data based on the data to be reported, and transmits the reporting data to the superior nodes step by step using a transmission message corresponding to the data type of the reporting data until it is transmitted to the target subnode.

[0119] When data of a certain child node is needed, the node at the current level only needs to send the report request to its corresponding child node, and the child node will then look for its child node, searching downward step by step.

[0120] The data synchronization method provided by the embodiment of the present disclosure does not need to create a tree structure from top to bottom in advance, but realizes data transmission from bottom to top through node self-registration, thereby constructing a data tree structure.

[0121] Figure 7 is a block diagram of a data synchronization device according to an embodiment of the present disclosure.

[0122] like Figure 7 As shown, the data synchronization device 700 of this embodiment is applied to a distributed system, the distributed system includes a root node and at least one child node with a hierarchical relationship, and the distributed system is deployed with at least one transmission message. The data synchronization device 700 includes a first determination module 710 and a first transmission module 720.

[0123] The first determining module 710 is configured to determine a target transmission message in at least one transmission message according to the changed data of the target subnode in response to a change in data of the target subnode in at least one subnode.

[0124] The first transmission module 720 is used to transmit the changed data of the target child node to the root node step by step according to the hierarchical relationship using the target transmission message.

[0125] According to an embodiment of the present disclosure, at least one transmission message each has a data type.

[0126] According to an embodiment of the present disclosure, the first determination module includes: a first determination submodule and a second determination submodule.

[0127] The first determination submodule is used to determine a target data type in at least one data type according to the changed data of the target subnode.

[0128] The second determining submodule is used to determine a transmission message corresponding to a target data type in at least one transmission message as a target transmission message.

[0129] According to an embodiment of the present disclosure, the above-mentioned device further includes: a second determining module, a second transmitting module and a stopping module.

[0130] The second determining module is used to determine the storage space occupied by the changed data of the target child node.

[0131] The second transmission module is used to transmit the changed data of the target sub-node to the root node step by step according to the hierarchical relationship using the target transmission message in response to the target data type and storage space satisfying the preset transmission conditions.

[0132] The stop module is used to stop transmitting the changed data of the target subnode to the upper node of the target subnode in response to the target data type and storage space not satisfying the preset transmission condition.

[0133] According to an embodiment of the present disclosure, at least one transmission message includes a common transmission message and a supplementary transmission message for a target child node, the common transmission message represents a transmission message shared by a root node and at least one child node in a distributed system, the supplementary transmission message represents a transmission message generated for data characteristics of the target child node, and the common transmission message includes at least one of the following: a spatial data message, a topological data message, a timing data message, and an event data message.

[0134] According to an embodiment of the present disclosure, the first transmission module includes: a transmission submodule and a processing submodule.

[0135] The transmission submodule is used to use the target subnode as the current transmission subnode and transmit the change data of the current transmission subnode to the upper node of the current transmission subnode by using the target transmission message.

[0136] A processing submodule is used to process the change data of the current transmission subnode in response to the change data of the current transmission subnode satisfying a preset processing condition, using a processing method corresponding to the parent node of the current subnode, and determining the parent node of the current transmission subnode as the next transmission subnode, wherein the preset processing condition is determined based on the parent node of the current transmission subnode.

[0137] According to an embodiment of the present disclosure, the above-mentioned device also includes: a first generating module, a third transmitting module and a connection establishing module.

[0138] A first generating module, configured to generate a registration request according to registration information for the child node to be registered input by the user in the node registration interface, wherein the registration information includes an authorization token determined by a first target parent node, and the first target parent node is an upper-level node of the child node to be registered;

[0139] The third transmission module is used to transmit the registration request to the first target parent node using the authentication message.

[0140] The connection establishment module is used to establish a connection between the child node to be registered and the first target parent node in response to the first target parent node completing the authentication of the authorization token, and transmit the registration data of the child node to be registered to the first target parent node using a registration message.

[0141] According to an embodiment of the present disclosure, the above-mentioned device further includes: a second generating module and a disconnecting module.

[0142] The second generation module is used to generate a node clearing request according to the clearing information input by the user in the node clearing interface of the target child node, and transmit the node clearing request to the second target parent node using a clearing message, wherein the clearing information includes the node information of the target child node and the node information of the second target parent node, and the second target parent node is the parent node of the target child node.

[0143] The disconnection module is used for the second target parent node to disconnect from the target child node in response to the node clearing request, and to clear the data of the target child node.

[0144] According to an embodiment of the present disclosure, the above-mentioned device also includes: a third generation module and a fourth transmission module.

[0145] The third generating module is used for generating change data for the second target parent node in response to the second target parent node clearing the data of the target child node.

[0146] The fourth transmission module is used to transmit the changed data of the second target parent node to the root node step by step according to the hierarchical relationship using a transmission message corresponding to the data type of the changed data of the second target parent node.

[0147] According to the modules and submodules of the embodiments of the present disclosure, any multiple or at least part of the functions of any multiple thereof can be implemented in one module. According to the modules and submodules of the embodiments of the present disclosure, any one or more thereof can be split into multiple modules for implementation. According to the modules and submodules of the embodiments of the present disclosure, any one or more thereof can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware of any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, according to the modules and submodules of the embodiments of the present disclosure, one or more thereof can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.

[0148] For example, any multiple of the first determination module 710 and the first transmission module 720 can be combined in one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the first determination module 710 and the first transmission module 720 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the first determination module 710 and the first transmission module 720 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.

[0149] It should be noted that the data synchronization device part in the embodiment of the present disclosure corresponds to the data synchronization method part in the embodiment of the present disclosure. The description of the data synchronization device specifically refers to the data synchronization method part, which will not be repeated here.

[0150] Figure 8 is a block diagram of an electronic device suitable for implementing the method described above according to an embodiment of the present disclosure. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0151] like Figure 8 As shown, the electronic device 800 according to an embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0152] In RAM 803, various programs and data required for the operation of electronic device 800 are stored. Processor 801, ROM 802 and RAM 803 are connected to each other via bus 804. Processor 801 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 802 and / or RAM 803. It should be noted that the program can also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0153] According to an embodiment of the present disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The electronic device 800 may further include one or more of the following components connected to the input / output (I / O) interface 805: an input portion 806 including a keyboard, a mouse, etc.; an output portion 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 808 including a hard disk, etc.; and a communication portion 809 including a network interface card such as a LAN card, a modem, etc. The communication portion 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output (I / O) interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage portion 808 as needed.

[0154] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.

[0155] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0156] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer 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 portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.

[0157] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 802 and / or the RAM 803 described above and / or one or more memories other than the ROM 802 and the RAM 803 .

[0158] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains a program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the data synchronization method provided by the embodiment of the present disclosure.

[0159] When the computer program is executed by the processor 801, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0160] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 809, and / or installed from a removable medium 811. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0161] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).

[0162] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0163] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A data synchronization method, applied to a distributed system, wherein the distributed system includes a root node and at least one child node having a hierarchical relationship, and the distributed system is deployed with at least one transmission message; the method includes: In response to a change in data of a target child node in the at least one child node, determining a target transmission message in the at least one transmission message according to the changed data of the target child node; as well as According to the hierarchical relationship, the target transmission message is used to transmit the changed data of the target child node to the root node step by step.

2. The method according to claim 1, wherein: Each of the at least one transmission message has a data type; The determining, according to the change data of the target subnode, a target transmission message in at least one transmission message comprises: Determine a target data type in at least one data type according to the changed data of the target child node; Determine a transmission message corresponding to the target data type among the at least one transmission message as the target transmission message.

3. The method according to claim 2, further comprising: Determine the storage space occupied by the changed data of the target child node; In response to the target data type and the storage space satisfying a preset transmission condition, the changed data of the target child node is transmitted to the root node level by level using the target transmission message according to the hierarchical relationship; In response to the target data type and the storage space not satisfying a preset transmission condition, stopping the transmission of the changed data of the target subnode to the parent node of the target subnode.

4. The method according to claim 1, wherein: The at least one transmission message includes a common transmission message and a supplementary transmission message for the target child node, the common transmission message represents a transmission message shared by the root node and at least one child node in the distributed system, the supplementary transmission message represents a transmission message generated for the data characteristics of the target child node, and the common transmission message includes at least one of the following: a spatial data message, a topological data message, a timing data message, and an event data message.

5. The method according to claim 1, wherein: The step of transmitting the changed data of the target child node to the root node step by step by using the target transmission message according to the hierarchical relationship includes: The following operations are performed step by step until the data is transmitted to the root node: Taking the target subnode as the current transmission subnode, and using the target transmission message to transmit the change data of the current transmission subnode to the upper node of the current transmission subnode; In response to the change data of the current transmission subnode satisfying a preset processing condition, the change data of the current transmission subnode is processed using a processing method corresponding to the parent node of the current subnode, and the parent node of the current transmission subnode is determined to be the next transmission subnode, wherein the preset processing condition is determined based on the parent node of the current transmission subnode.

6. The method according to claim 1, further comprising: Generate a registration request according to the registration information for the child node to be registered input by the user in the node registration interface, wherein the registration information includes an authorization token determined by a first target parent node, and the first target parent node is the parent node of the child node to be registered; Transmitting the registration request to the first target parent node using an authentication message; In response to the first target parent node completing authentication of the authorization token, a connection is established between the child node to be registered and the first target parent node, and registration data of the child node to be registered is transmitted to the first target parent node using a registration message.

7. The method according to claim 1, further comprising: Generate a node clearing request according to the clearing information input by the user in the node clearing interface of the target child node, and transmit the node clearing request to the second target parent node by using a clearing message, wherein the clearing information includes the node information of the target child node and the node information of the second target parent node, and the second target parent node is the parent node of the target child node; In response to the node clearing request, the second target parent node disconnects from the target child node and clears the data of the target child node.

8. The method according to claim 7, further comprising: In response to the second target parent node clearing the data of the target child node, generating change data for the second target parent node; According to the hierarchical relationship, the changed data of the second target parent node is transmitted to the root node level by level using a transmission message corresponding to the data type of the changed data of the second target parent node.

9. A data synchronization device, applied to a distributed system, the distributed system comprising a root node and at least one child node having a hierarchical relationship, the distributed system being deployed with at least one transmission message; the device comprising: A first determining module, configured to determine, in response to a change in data of a target subnode in the at least one subnode, a target transmission message in the at least one transmission message according to the changed data of the target subnode; as well as The first transmission module is used to transmit the changed data of the target child node to the root node step by step according to the hierarchical relationship using the target transmission message.

10. An electronic device, comprising: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.

11. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 8.

12. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 8.