Data synchronization method, apparatus and system

By establishing different data models on the main site and adopting a whiteboard announcement mode, the problem of data synchronization between sub-sites in a multi-site system was solved, realizing information synchronization and independence between heterogeneous sites and reducing the time cost of repeated publishing.

CN116032945BActive Publication Date: 2025-12-19BEIJING AEROSPACE CLOUD ROAD CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211644573.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-20
Publication Date
2025-12-19
Estimated Expiration
2042-12-20

AI Technical Summary

Technical Problem

Existing multi-site systems cannot achieve information synchronization between multiple sub-sites, resulting in a lack of effective solutions for data synchronization.

Method used

Different data models are established on the main site, and the data is bound to the sub-sites based on their subscription information. A whiteboard announcement mode is used to achieve data synchronization across heterogeneous sites, ensuring that information is synchronized from the main site to the subscribed sub-sites without duplication or omission.

Benefits of technology

It enables independent and synchronized data between multiple heterogeneous sites, reduces the time cost of repeatedly publishing information, and ensures that information is promptly synchronized from the main site to other subscribed subsites.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116032945B_ABST
    Figure CN116032945B_ABST
Patent Text Reader

Abstract

The application provides a data synchronization method, device and system. The method comprises the following steps: determining a data model subscribed by each sub-site based on subscription information of a plurality of sub-sites; receiving data change information of at least one sub-site, and determining that the data model subscribed by the at least one sub-site is a target data model; updating the target data model based on the data change information of the at least one sub-site; and synchronizing update information of the target data model to a target sub-site that subscribes to the target data model. The application solves the defect of data synchronization among multiple sites, and realizes independent data among a plurality of heterogeneous sites and efficient data synchronization among different sub-sites.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of communication technology, and in particular to a data synchronization method, device and system. BACKGROUND

[0002] With the popularization of communication technology, data synchronization between multi-site systems has been widely used. However, the existing multi-site system can only realize one-way uploading of synchronization data from a single sub-site to the center system and receiving the data of the center system when synchronizing information, and cannot realize information synchronization between multiple sub-sites. SUMMARY

[0003] The present application provides a data synchronization method, device and system to solve the defect that there is no effective solution for data synchronization between multiple sites in the prior art, and to realize data independence and data synchronization between multiple heterogeneous sites.

[0004] The present application provides a data synchronization method, comprising:

[0005] Based on the subscription information of the multiple sub-sites, determine the data model subscribed by each sub-site;

[0006] In the case of receiving data change information of at least one sub-site in the multiple sub-sites, determine the target data model corresponding to the at least one sub-site;

[0007] Based on the data change information of the at least one sub-site, update the target data model;

[0008] Synchronize the update information of the target data model to the target sub-site that subscribes to the target data model.

[0009] According to the data synchronization method provided by the present application, the subscription information includes sub-site source, first information number and second information number, and the determination of the data model subscribed by each sub-site based on the subscription information of the multiple sub-sites comprises:

[0010] Based on the first information number and the second information number, determine the correspondence between the data subscribed by each sub-site and the data model;

[0011] Based on the sub-site source and the correspondence, determine the data model subscribed by each sub-site.

[0012] According to the data synchronization method provided by the present application, the update of the target data model based on the data change information comprises:

[0013] Classify the data change information of at least one sub-site, and classify the data change information of the same target data model into a class;

[0014] updating the target data model corresponding to the data change information with the latest time.

[0015] According to the data synchronization method provided by the application, the data change information comprises: performing data addition operation, data modification operation or data deletion operation on target data in the target data model subscribed.

[0016] According to the data synchronization method provided by the application, the step of synchronizing the update information of the target data model to the target sub-site subscribing the target data model comprises:

[0017] determining the communication mode of the target sub-site based on the subscription information of the target sub-site;

[0018] sending the update information of the target data model to the target sub-site based on the communication mode of the target sub-site.

[0019] The application further provides a data synchronization device, comprising:

[0020] The subscription module is configured to determine the data model subscribed by each sub-site based on the subscription information of the plurality of sub-sites.

[0021] The receiving module is configured to determine the target data model corresponding to at least one sub-site in the plurality of sub-sites when receiving the data change information of the at least one sub-site.

[0022] The announcement module is configured to update the target data model based on the data change information of the at least one sub-site.

[0023] The synchronization module is configured to synchronize the update information of the target data model to the target sub-site subscribing the target data model.

[0024] The application further provides a data synchronization system, comprising: a master site and a plurality of sub-sites.

[0025] The master site is configured to execute any one of the data synchronization methods.

[0026] The sub-sites are configured to send subscription information and data change information to the master site, and receive the update information of the target data model sent by the master site.

[0027] The application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement any one of the data synchronization methods.

[0028] The application further provides a non-transitory computer-readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the data synchronization method.

[0029] The application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the data synchronization method.

[0030] The data synchronization method, device and system provided by the application establish the corresponding synchronization relationship between the data to be updated and the users of the sub-sites by the way that the sub-sites subscribe to different data models of the main site, realize that the information published by the users in any sub-site can be synchronized to other sub-sites subscribing to the information through the main site in time, and make the users not need to publish the information repeatedly in each sub-site, thereby reducing the time cost. BRIEF DESCRIPTION OF DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the application or prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative effort.

[0032] Figure 1 is a flowchart of the data synchronization method provided by the application;

[0033] Figure 2 is a structural schematic diagram of the data synchronization device provided by the application;

[0034] Figure 3 is a structural schematic diagram of the data synchronization system provided by the application;

[0035] Figure 4 is a structural schematic diagram of the electronic device provided by the application. DETAILED DESCRIPTION

[0036] In order to make the objects, technical solutions and advantages of the application clearer, the technical solutions in the application will be described clearly and completely in combination with the drawings in the application. Obviously, the described embodiments are some embodiments of the application, but not all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative effort belong to the protection scope of the application.

[0037] The data synchronization method of the application will be described below in combination with Figure 1 The data synchronization method of the application will be described below in combination with Figure 1 The method of the embodiment of the application at least comprises the following steps:

[0038] Step 101, determining a data model subscribed by each sub-site based on subscription information of the plurality of sub-sites;

[0039] Step 102, in a case where data change information of at least one sub-site in the plurality of sub-sites is received, determining a target data model corresponding to the at least one sub-site;

[0040] Step 103, updating the target data model based on the data change information of the at least one sub-site;

[0041] Step 104, synchronizing update information of the target data model to a target sub-site subscribing to the target data model.

[0042] For step 101, it should be noted that the plurality of sub-sites in the embodiment of the application are heterogeneous sites. According to the existing method, if A site updates part of information, the A site needs to notify the master station in the form of a message queue, and then the master station broadcasts the update information to all sub-sites. At this time, if B site does not subscribe to the information updated by A site, the master station will still push the information to B site when broadcasting, which causes inaccurate arrival of data synchronization and waste of resources.

[0043] The method of the application discards the update mode of the message queue in the existing method, and establishes different data models for different fields or different functions in the master site, and then binds the data models to the master station through the sub-site sending a subscription message. The data model can be defined arbitrarily to adapt to the heterogeneous system.

[0044] Specifically, the master site can collect the information set provided by the sub-site through the collection interface or perform unified data modeling by calling other external data sets in the early stage, and publish the initial full data of the data model subscribed by each sub-site to other sub-sites in the whiteboard announcement mode.

[0045] For steps 102 and 103, it should be noted that the data change information is a self-defined data model pushed by the sub-site to the master station after modifying the initial full data, and the target data model is the self-defined data model with modification.

[0046] Specifically, the modification of the sub-site can be based on actual production conditions. For example, the sub-site is a supplier system, and due to the increase or decrease of suppliers, the number of suppliers of the master station needs to be updated. At this time, other sub-sites such as production manufacturer systems or sales systems that subscribe to supplier information will be synchronized according to the update information published by the master station.

[0047] For step 104, it needs to be explained that the target sub-site is one or more sub-sites which subscribe to the target data model, and through the subscription of the sub-site and the model, it is ensured that the information published by the user in multiple sites is not repeated and not missed in the main site, and is accurately published to the sub-sites which subscribe to the information.

[0048] The data synchronization method of the embodiment of the application establishes a whiteboard bulletin board in the main site, and realizes the heterogeneous multi-site data synchronization method through the whiteboard bulletin method, which can not only realize the synchronization of information update of any site to other sites, but also realize the independence of data of each heterogeneous subsystem.

[0049] It can be understood that the data model subscribed by each sub-site is determined based on the subscription information of the multiple sub-sites, including:

[0050] The subscription information of the multiple sub-sites is received, and the subscription information includes the sub-site source, the first information number and the second information number;

[0051] Based on the first information number and the second information number, the corresponding relationship between the data subscribed by each sub-site and the data model is determined;

[0052] Based on the sub-site source and the corresponding relationship, the data model subscribed by each sub-site is determined.

[0053] It needs to be explained that each heterogeneous sub-site selects the data model to be synchronized through the subscription information, and completes the synchronization service registration to realize the model subscription. The sub-site source is the source information of subscribing to a data model, including the sub-site IP or identifier, the first information number is the unique information number of the data model subscribed by the sub-site in the main site, i.e. the central system, and the second information number is the unique information number of the data model subscribed by the sub-site in the sub-site. The corresponding relationship between the first information number and the second information number is confirmed, so that in the case that the serial numbers of the data model subscribed by the sub-site in the main site and the sub-site are different or the names are different, the target data model subscribed by each sub-site can be determined through the corresponding relationship.

[0054] In addition, it needs to be explained that one sub-site can subscribe to multiple data models. Taking the procurement system as an example, the product information model, the inventory information model, the supplier information model, the price information model and the like are established in the main site. For the manufacturer sub-site, it needs to subscribe to all the above data models. In addition, each sub-site can also subscribe to a specific item or several items of data in a data model according to the application scenario, for example, a certain manufacturer sub-site can subscribe to the A series product information in the product information model, and it only obtains the synchronized A series product update information when the A series product is updated.

[0055] It can be understood that the target data model is updated based on the data change information, including:

[0056] Classify the data change information of at least one sub-site, and classify the data change information of the same target data model into a category;

[0057] Update the corresponding target data model based on the data change information received at the latest time in each category.

[0058] It should be noted that since the master station receives data change information from each sub-site, if the data change information is not processed, multiple change information for the same target data model may appear, causing the master station to be unable to identify which data change information should be used for updating. Therefore, in the embodiments of the present application, the received data change information within a period of time is first classified, and the latest data change information of each category, i.e., the same target data model, is determined, based on which the updating is performed, so as to ensure that the master station always maintains the latest announcement state.

[0059] It can be understood that the data change information includes: performing data addition operation, data modification operation or data deletion operation on the target data in the subscribed target data model. (insert, update, delete).

[0060] Specifically, the data change information is a data update operation, for example: adding a number of rows of data to a table, modifying data in the table, and deleting a number of rows of data in the table.

[0061] The addition includes: a. inserting a tuple; b. inserting the result of a subquery;

[0062] The modification includes: a. modifying the value of a tuple; b. modifying the values of multiple tuples; c. modifying statement with subquery

[0063] The deletion includes: a. deletion statement; b. deletion statement with subquery.

[0064] It can be understood that synchronizing the update information of the target data model to the target sub-site subscribing to the target data model includes:

[0065] Based on the subscription information of the target sub-site, determine the communication mode of the target sub-site;

[0066] Based on the communication mode of the target sub-site, send the update information of the target data model to the target sub-site.

[0067] It should be noted that the subscription information also stores the communication mode of each sub-site, for example, microservices, application programming interface (API), uniform resource locator (URL), DCOM protocol, etc. can be used. Through the record of the communication mode, it can be ensured that each sub-site can communicate smoothly through its own communication protocol.

[0068] In addition, it should be noted that in the embodiment of the application, the main site is a message providing end or a server end, and the sub-site is a message consuming end or a client end.

[0069] The data synchronization device provided by the application will be described below. The data synchronization device described below can be referred to in correspondence with the data synchronization method described above. As shown in the figure, Figure 2 The data synchronization device comprises:

[0070] The subscription module 201 is configured to determine the data model subscribed by each sub-site based on the subscription information of the plurality of sub-sites.

[0071] The receiving module 202 is configured to determine the target data model corresponding to at least one sub-site in the case of receiving the data change information of the at least one sub-site.

[0072] The announcement module 203 is configured to update the target data model based on the data change information of the at least one sub-site.

[0073] The synchronization module 204 is configured to synchronize the update information of the target data model to the target sub-site subscribing to the target data model.

[0074] The data synchronization device of the embodiment of the application can realize the synchronization of the information published by the user in any main site to other sub-sites, so that the user does not need to repeatedly publish information in each sub-site, thereby reducing the time cost, and the information published by the user in multiple sites can be displayed without repetition or omission on the main platform. At the same time, the main site is centrally managed, the access and unloading of the sub-site can be limited, and the charging model can be extended to the paid model.

[0075] It can be understood that the determination of the data model subscribed by each sub-site based on the subscription information of the plurality of sub-sites comprises:

[0076] Receiving the subscription information of the plurality of sub-sites, the subscription information comprising the sub-site source, the first information number and the second information number;

[0077] Determining the corresponding relationship between the data subscribed by each sub-site and the data model based on the first information number and the second information number;

[0078] Based on the sub-site source and the correspondence, a data model subscribed by each sub-site is determined.

[0079] It can be understood that, based on the data change information, the target data model is updated, including:

[0080] The data change information of at least one sub-site is classified, and the data change information of the same target data model is classified into a category;

[0081] Based on the data change information with the latest receiving time in each category, the corresponding target data model is updated.

[0082] It can be understood that the data change information includes: performing data addition operation, data modification operation or data deletion operation on the target data in the subscribed target data model.

[0083] It can be understood that the update information of the target data model is synchronized to the target sub-site subscribing to the target data model, including:

[0084] Based on the subscription information of the target sub-site, the communication mode of the target sub-site is determined;

[0085] Based on the communication mode of the target sub-site, the update information of the target data model is sent to the target sub-site.

[0086] The data synchronization system provided by the application is described below, as shown in Figure 3 The data synchronization system of the embodiment of the application comprises: a master site and a plurality of sub-sites;

[0087] The master site is used to execute a data synchronization method;

[0088] The sub-site is used to send subscription information and data change information to the master site, and receive the update information of the target data model sent by the master site.

[0089] It should be noted that, the master site is the center system in Figure 3 , the center system comprises a data modeling module, a whiteboard announcement module, a collection interface module and a synchronization data module, the collection and establishment of each data model are realized through the data modeling module, all data models are broadcasted according to the subscribers through the whiteboard announcement module, then the data change information of each sub-system is collected in real time through the collection interface, and the target data model to be updated is filtered out according to the synchronization data module and pushed.

[0090] For the data synchronization system, the synchronization of the master site and the plurality of sub-sites includes two cases:

[0091] Case one: first access

[0092] The model full data of the substation is synchronized to the central system through the central system acquisition interface of the main station, i.e., the central system.

[0093] Case two: addition, update or deletion

[0094] (1) The substation pushes the self-defined data model to the central system acquisition interface.

[0095] (2) The central system synchronizes the data model information collected to form a data full set, and records the unique number of the data model in the central system and the internal unique number of the source system in the whiteboard announcement system.

[0096] (3) The whiteboard announcement system collects and identifies and counts the subscribers according to the model, sequentially calls the data model of the subscriber micro service, and the substation subscribing to the data model synchronizes the data according to the unique number of the central system, and after successful synchronization, the identification is completed, the count is reduced by 1, and when the count is 0, the whiteboard announcement is cleared.

[0097] Therefore, the data synchronization system provided by the embodiment of the application realizes heterogeneous multi-station data synchronization through the whiteboard announcement mode, which not only realizes the synchronization of information update of any station to other stations, but also realizes the data independence of each heterogeneous subsystem. The system can define model data sets arbitrarily to adapt to heterogeneous systems. At the same time, the centralized management can limit the access and unloading of the substation, and can be extended to a paid model to realize a charging model.

[0098] Figure 4 An example of an entity structure diagram of an electronic device is shown in Figure 4 The electronic device can include a processor 410, a communications interface 420, a memory 430 and a communications bus 440, wherein the processor 410, the communications interface 420 and the memory 430 communicate with each other through the communications bus 440. The processor 410 can call the logical instructions in the memory 430 to execute the data synchronization method, which includes:

[0099] Based on the subscription information of the plurality of sub-stations, determine the data model subscribed by each sub-station;

[0100] In the case where the data change information of at least one of the plurality of sub-stations is received, determine the target data model corresponding to the at least one sub-station;

[0101] Based on the data change information of the at least one sub-station, update the target data model;

[0102] Synchronize the update information of the target data model to the target sub-station subscribing to the target data model.

[0103] Moreover, the logic instructions in the memory 430 described above can be implemented in the form of software functional units and sold or used as independent products, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts that make contributions to the prior art or parts of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, and includes several instructions for making a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the embodiments of the method of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0104] In another aspect, the present application also provides a computer program product, the computer program product comprising a computer program, the computer program being stored in a non-transitory computer readable storage medium, and the computer program being executable by a processor to cause a computer to execute the data synchronization method provided by the above-mentioned methods, the method comprising:

[0105] determining, based on subscription information of a plurality of sub-sites, a data model subscribed by each sub-site;

[0106] in a case where data change information of at least one sub-site of the plurality of sub-sites is received, determining a target data model corresponding to the at least one sub-site;

[0107] updating the target data model based on the data change information of the at least one sub-site;

[0108] synchronizing the update information of the target data model to a target sub-site subscribing to the target data model.

[0109] In another aspect, the present application also provides a computer program product, the computer program product comprising a computer program, the computer program being stored in a non-transitory computer readable storage medium, and the computer program being executable by a processor to cause a computer to execute the data synchronization method provided by the above-mentioned methods, the method comprising:

[0110] determining, based on subscription information of a plurality of sub-sites, a data model subscribed by each sub-site;

[0111] in a case where data change information of at least one sub-site of the plurality of sub-sites is received, determining a target data model corresponding to the at least one sub-site;

[0112] updating the target data model based on the data change information of the at least one sub-site;

[0113] Synchronize the update information of the target data model to the target sub-site subscribing to the target data model.

[0114] The device embodiments described above are merely illustrative, wherein the units illustrated as separate components can or can not be physically separated, and the components illustrated as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment scheme according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0115] Through the description of the above embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software and the necessary general hardware platform, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods of the various embodiments or some parts of the embodiments.

[0116] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A data synchronization method, characterized by, The method comprises the following steps: determining a data model subscribed by each sub-site based on subscription information of a plurality of sub-sites; determining a target data model corresponding to at least one sub-site among the plurality of sub-sites in a case where data change information of the at least one sub-site is received; updating the target data model based on the data change information of the at least one sub-site; synchronizing update information of the target data model to a target sub-site that subscribes to the target data model; the subscription information comprises a sub-site source, a first information number, and a second information number, the first information number is an information unique number of a data model subscribed by a sub-site in a main site, and the second information number is an information unique number of the data model subscribed by the sub-site in the sub-site; the step of determining a data model subscribed by each sub-site based on subscription information of a plurality of sub-sites comprises: determining a correspondence between data subscribed by each sub-site and the data model based on the first information number and the second information number; determining a data model subscribed by the each sub-site based on the sub-site source and the correspondence.

2. The data synchronization method of claim 1, wherein, the step of updating the target data model based on the data change information comprises: classifying the data change information of the at least one sub-site according to the target data model corresponding to each of the at least one sub-site, and classifying data change information corresponding to a same target data model into a same class; updating the target data model corresponding to each class based on data change information with a latest time in the class.

3. The data synchronization method according to claim 2, wherein the data change information comprises a data addition operation, a data modification operation, or a data deletion operation performed on the data subscribed by the sub-site.

4. The data synchronization method of claim 2, wherein, the step of synchronizing update information of the target data model to a target sub-site that subscribes to the target data model comprises: determining a communication mode of the target sub-site based on subscription information of the target sub-site; sending the update information of the target data model to the target sub-site based on the communication mode of the target sub-site.

5. A data synchronization apparatus, characterized by comprising: The method comprises the following steps: a subscription module is configured to determine a data model subscribed by each sub-site based on subscription information of a plurality of sub-sites; a receiving module is configured to determine a target data model corresponding to at least one sub-site among the plurality of sub-sites in a case where data change information of the at least one sub-site is received; an announcement module is configured to update the target data model based on the data change information of the at least one sub-site; a synchronization module is configured to synchronize update information of the target data model to a target sub-site that subscribes to the target data model; the subscription information comprises a sub-site source, a first information number, and a second information number, the first information number is an information unique number of a data model subscribed by a sub-site in a main site, and the second information number is an information unique number of the data model subscribed by the sub-site in the sub-site; the subscription module is specifically configured to: determine a correspondence between data subscribed by each sub-site and the data model based on the first information number and the second information number; determine a data model subscribed by each sub-site based on the sub-site source and the correspondence.

6. A data synchronization system, characterized by The application relates to a data synchronization method and device. The application relates to a data synchronization method and device. The application relates to a data synchronization method and device. The application relates to a data synchronization method and device.

7. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The application relates to a data synchronization method and device.

8. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The application relates to a data synchronization method and device.

9. A computer program product comprising a computer program, characterized in that, ​

Citation Information

Patent Citations

  • Data synchronous updating method and system and computer device

    CN109857747A