Data synchronization method and device of child-mother system, storage medium and electronic equipment

By controlling the data synchronization value and request frequency in the parent-child system, the problems of poor stability, low certainty and low controllability of remote data synchronization are solved, and the uniqueness and integrity of data are guaranteed, which improves the synchronization process Stability and efficiency.

CN119052261APending Publication Date: 2024-11-29KYLAND TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410991977.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

The existing remote data synchronization methods have insufficient data uniqueness control, poor network problem handling, insufficient data integrity guarantee, imperfect exception handling, and frequent synchronization requests, resulting in poor stability, low certainty and low controllability.

Method used

Through the subsystem calling the parent system's synchronization data request interface, sending synchronization requests and updating the synchronization value of each data, ensuring data uniqueness and integrity, and returning synchronization results after receiving data to update synchronization values, controlling the frequency of synchronization requests, Handle network problems and exceptions.

Benefits of technology

It improves the stability, certainty and controllability of data synchronization, ensures data uniqueness and integrity, reduces the risk of synchronization failure, and optimizes system performance and resource utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119052261A_ABST
    Figure CN119052261A_ABST
Patent Text Reader

Abstract

The invention relates to a data synchronization method and device for a child-mother system, a storage medium and electronic equipment. The method comprises the steps that a control subsystem calls a synchronous data request interface of a mother system and sends a first synchronous data request to the mother system, and the first synchronous data request is used for requesting to synchronize all data in the mother system; the control mother system sends all the data to the subsystem according to the first data synchronization request, and updates the synchronization value of each piece of data of all the data; after receiving all the data, the control subsystem stores all the data and calls a synchronous data confirmation interface of the mother system to return a synchronous result of each piece of data of all the data to the mother system; and the control mother system updates the synchronization value of each piece of data according to the synchronization result of each piece of data. The technical problem that an existing remote data synchronization method is poor in stability, low in certainty and low in controllability is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information technology, and in particular to a method, device, storage medium and electronic device for synchronizing data between a parent and a child system. Background Art

[0002] At present, methods for implementing remote data synchronization already exist. Usually, the child service can send synchronization requests to the parent service by using HTTP communication or interface. However, there are some defects and problems in the prior art: First, insufficient control of the uniqueness of data synchronization: In the prior art, the uniqueness of data may not be effectively ensured, resulting in data duplication or missing. Second, network problems during synchronization: The prior art may not be able to effectively handle network problems, such as network delays, disconnections or timeouts, resulting in data synchronization failure or incompleteness. Third, the integrity of data synchronization: The prior art may not be able to fully ensure the integrity of data synchronization. Even if the synchronization request is successfully sent, the data may be lost or damaged during the transmission process. Fourth, imperfect exception handling: In the prior art, there may be a lack of effective handling mechanisms for abnormal situations. For example, when synchronization fails, there may be a lack of timely error prompts or recovery mechanisms. Fifth, the frequency of synchronization requests: The prior art may not be able to effectively control the frequency of synchronization requests, resulting in excessive synchronization requests, increasing the system burden or consuming network bandwidth. Summary of the invention

[0003] The present application provides a data synchronization method, device, storage medium and electronic device for a parent-child system to solve the technical problems of poor stability, low certainty and low controllability of existing remote data synchronization methods.

[0004] In a first aspect, the present application provides a data synchronization method for a child-parent system, comprising: controlling the subsystem to call the synchronization data request interface of the parent system, and sending a first synchronization data request to the above-mentioned parent system, wherein the above-mentioned first synchronization data request is used to request synchronization of all data in the above-mentioned parent system; controlling the parent system to send all the above-mentioned data to the above-mentioned subsystem according to the above-mentioned first synchronization data request, and updating the synchronization value of each of the above-mentioned data; controlling the above-mentioned subsystem to save all the above-mentioned data after receiving all the above-mentioned data, and calling the synchronization data confirmation interface of the above-mentioned parent system to return the synchronization result of each of the above-mentioned data to the above-mentioned parent system; controlling the above-mentioned parent system to update the synchronization value of each of the above-mentioned data according to the synchronization result of each of the above-mentioned data.

[0005] In the second aspect, the present application provides a data synchronization device for a child-parent system, including: a first processing module, used to control the subsystem to call the synchronization data request interface of the parent system, and send a first synchronization data request to the above-mentioned parent system, wherein the above-mentioned first synchronization data request is used to request synchronization of all data in the above-mentioned parent system; a second processing module, used to control the parent system to send all the above-mentioned data to the above-mentioned subsystem according to the above-mentioned first synchronization data request, and update the synchronization value of each of the above-mentioned data; a third processing module, used to control the above-mentioned subsystem to save all the above-mentioned data after receiving all the above-mentioned data, and call the synchronization data confirmation interface of the above-mentioned parent system to return the synchronization result of each of the above-mentioned data to the above-mentioned parent system; a fourth processing module, used to control the above-mentioned parent system to update the synchronization value of each of the above-mentioned data according to the synchronization result of each of the above-mentioned data.

[0006] As an optional example, the above-mentioned device also includes: a fifth processing module, which is used to control the above-mentioned subsystem to call the synchronization data request interface of the above-mentioned parent system and the synchronization data confirmation interface of the above-mentioned parent system through HTTP communication or API interface.

[0007] As an optional example, the second processing module includes: a first processing unit, used to determine each piece of all the above data as current data, and control the parent system to perform the following operations on the above current data: sending the above current data to the above subsystem; increasing the current synchronization value of the above current data by one, wherein the initial value of the above current synchronization value is zero.

[0008] As an optional example, the third processing module includes: a second processing unit, used to determine each piece of all the data as current data, and control the subsystem to perform the following operations on the current data: if the current data is not received, determine that the synchronization result of the current data is a synchronization failure; if the current data is received, save the current data; if the current data fails to be saved, determine that the synchronization result of the current data is a synchronization failure; if the current data is successfully saved, determine that the synchronization result of the current data is a synchronization success; call the synchronization data confirmation interface of the parent system to return the synchronization result of the current data to the parent system.

[0009] As an optional example, the fourth processing module includes: a third processing unit, used to determine each piece of all the above data as current data, and control the parent system to perform the following operations on the current data: when the synchronization result of the current data is successful synchronization, update the synchronization value of the current data to the target value.

[0010] As an optional example, the above-mentioned device also includes: a sixth processing module, which is used to control the above-mentioned subsystem to save all the above-mentioned data after receiving the above-mentioned all the above-mentioned data, and call the synchronization data confirmation interface of the above-mentioned parent system to return the synchronization result of each of the above-mentioned data to the above-mentioned parent system. When the synchronization result of the above-mentioned target data is a synchronization failure, control the above-mentioned subsystem to call the synchronization data request interface of the above-mentioned parent system to send a second synchronization data request to the above-mentioned parent system, wherein the above-mentioned target data is any one or more of the above-mentioned data, and the above-mentioned second synchronization data request is used to request synchronization of the above-mentioned target data in the above-mentioned parent system; a seventh processing module, which is used to control the above-mentioned parent system to send the above-mentioned target data to the above-mentioned subsystem according to the above-mentioned second synchronization data request, and update the synchronization value of the above-mentioned target data; an eighth processing module, which is used to control the above-mentioned subsystem to save the above-mentioned target data after receiving the above-mentioned target data, and call the synchronization data confirmation interface of the above-mentioned parent system to return the synchronization result of the above-mentioned target data to the above-mentioned parent system; a ninth processing module, which is used to control the above-mentioned parent system to update the synchronization value of the above-mentioned target data according to the synchronization result of the above-mentioned target data.

[0011] As an optional example, the seventh processing module includes: a fourth processing unit, used to control the parent system to obtain the target identifier of the target data from the second synchronization request data after receiving the second synchronization request data; a search unit, used to search for the target data in all data of the parent system according to the target identifier; and a sending unit, used to send the target data to the subsystem.

[0012] In a third aspect, the present application provides a storage medium storing a computer program, wherein the computer program executes the above-mentioned data synchronization method of the parent-child system when executed by a processor.

[0013] In a fourth aspect, the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned parent-child system data synchronization method through the computer program.

[0014] In an embodiment of the present application, a method is adopted in which a subsystem is controlled to call a synchronization data request interface of a parent system to send a first synchronization data request to the parent system, wherein the first synchronization data request is used to request synchronization of all data in the parent system; the parent system is controlled to send all the data to the subsystem according to the first synchronization data request, and update the synchronization value of each piece of data of the subsystem; the subsystem is controlled to save all the data after receiving the data, and call a synchronization data confirmation interface of the parent system to return the synchronization result of each piece of data of the subsystem to the parent system; the parent system is controlled to update the synchronization value of each piece of data according to the synchronization result of each piece of data. In the above method, the synchronization value of each piece of data is increased during data synchronization between the subsystem and the parent system, and the synchronization value of each piece of data in the system is updated each time the parent system sends data to the subsystem. The synchronization value can count and control the number of synchronization requests, thereby achieving the purpose of improving the efficiency and controllability of data synchronization. After receiving and saving the data sent by the parent system, the subsystem will return the synchronization result of each data, thereby achieving the purpose of improving the stability and certainty of data synchronization, and further solving the technical problems of poor stability, low certainty and low controllability of existing remote data synchronization methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0017] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0018] Figure 1 is a flow chart of an optional method for synchronizing data between a parent and child system according to an embodiment of the present application;

[0019] Figure 2 is a specific implementation flow chart of an optional method for synchronizing parent-child systems according to an embodiment of the present application;

[0020] Figure 3is a schematic structural diagram of an optional data synchronization device for a parent-child system according to an embodiment of the present application;

[0021] Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0023] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0024] According to a first aspect of an embodiment of the present application, a method for synchronizing data between a parent and a child system is provided. Optionally, as follows: Figure 1 As shown, the above method includes:

[0025] S102, the control subsystem calls the synchronization data request interface of the parent system and sends a first synchronization data request to the parent system, wherein the first synchronization data request is used to request synchronization of all data in the parent system;

[0026] S104, controlling the parent system to send all data to the subsystem according to the first synchronization data request, and updating the synchronization value of each piece of data of all data;

[0027] S106, after receiving all the data, the control subsystem saves all the data and calls the synchronization data confirmation interface of the parent system to return the synchronization result of each piece of data of all the data to the parent system;

[0028] S108, controlling the parent system to update the synchronization value of each piece of data according to the synchronization result of each piece of data.

[0029] Optionally, in this embodiment, the parent service: a server-side application running an HTTP server, provides two interfaces: a synchronization data request interface and a synchronization data confirmation interface. The child service: a client application, which calls the interface provided by the parent service through HTTP communication or API interface to implement data synchronization function. Each piece of data has a unique ID to ensure the uniqueness of the data. Each piece of data has an int attribute: a synchronization value. The synchronization value indicates the number of synchronization times of the data, which is used to count and judge the synchronization status. A positive synchronization value indicates that the data has not been successfully synchronized, and the synchronization times are accumulated; a synchronization value of -1 indicates that the data has been successfully synchronized. The parent system provides two interfaces, namely, a synchronization data request interface and a synchronization data confirmation interface. The synchronization data request interface sends the synchronization data set required by the child service according to the request parameters, and adds 1 to the synchronization value of the corresponding data item (if the synchronization value is -1, it will not be sent, nor will it be added 1). The synchronization data confirmation interface: according to the unique ID of the synchronization data set sent in the request parameters, the synchronization value of the corresponding data item is marked as -1, indicating that it has been successfully synchronized.

[0030] Optionally, in this embodiment, the subsystem will first call a synchronization data request interface provided by the parent system. At this time, the subsystem will generate a first synchronization data request and send this request to the parent system. The first synchronization data request is a request containing specific content, which clearly indicates that all data (or part of the data) in the parent system need to be synchronized, and notifies the parent system that the subsystem needs to obtain and synchronize all data in the current parent system. After receiving the first synchronization data request, the parent system will send all data to the subsystem according to this request. At the same time, the parent system will also update the synchronization value of each piece of data to record the cumulative number of synchronizations of each piece of data. After receiving all the data sent by the parent system, the subsystem will save these data to its own database or storage system. Subsequently, the subsystem will call a synchronization data confirmation interface of the parent system and return the synchronization result of each piece of data to the parent system. This synchronization result may include information such as the receiving status and storage status of the data. After receiving the synchronization results returned by the subsystem, the parent system will update the synchronization value of each piece of data according to these results. These synchronization values ​​can be used to mark whether data has been successfully synchronized to the subsystem or not, ensuring data consistency between the parent system and the subsystem. They can also effectively handle network problems and abnormal situations, detect and handle synchronization failures in a timely manner, reduce the risk of synchronization failures, and ensure smooth data synchronization.

[0031] Optionally, in this embodiment, the data consistency between the subsystem and the parent system is ensured, and data loss or duplication is avoided through the synchronization request and confirmation mechanism. By updating the synchronization value, the parent system can accurately track the synchronization status of each piece of data, which is convenient for subsequent maintenance and management. After the subsystem receives all the data and confirms the save, the integrity of the data is ensured, thereby avoiding system problems caused by the loss of some data.

[0032] Optionally, in this embodiment, during the data synchronization between the subsystem and the parent system, the synchronization value of each piece of data is increased, and each time the parent system sends data to the subsystem, the synchronization value of each piece of data in the system is updated. The synchronization value can count and control the number of synchronization requests, thereby achieving the purpose of improving the efficiency and controllability of data synchronization. And the subsystem will return the synchronization result of each piece of data after receiving and saving the data sent by the parent system, thereby achieving the purpose of improving the stability and certainty of data synchronization, thereby solving the technical problems of poor stability, low certainty and low controllability of the existing remote data synchronization method.

[0033] As an optional example, the above method further includes:

[0034] The control subsystem calls the synchronization data request interface and the synchronization data confirmation interface of the parent system through HTTP communication or API interface.

[0035] Optionally, in this embodiment, the parent service can be a backend service running on a cloud server, providing two RESTful API (Representational State Transfer Application Programming Interface, which is an API design method based on the REST architectural style. REST is a lightweight, stateless communication protocol, commonly used for Web services) interfaces: a synchronous data request interface and a synchronous data confirmation interface. The child service can be a front-end application running locally, which calls the interface provided by the parent service through AJAX (Asynchronous JavaScript and XML, which is a technology for creating dynamic and interactive web applications. It allows web pages to communicate asynchronously with the server without reloading the entire page) requests to implement data synchronization functions.

[0036] Optionally, in this embodiment, the parent service can be a server-side application running an HTTP server, providing two interfaces: a synchronization data request interface and a synchronization data confirmation interface. The child service is a client application that calls the interface provided by the parent service through HTTP communication to implement data synchronization.

[0037] Optionally, in this embodiment, the remote data synchronization function can be implemented through simple HTTP communication or interface calling, thereby improving the efficiency and reliability of data synchronization.

[0038] As an optional example, controlling the parent system to send all data to the subsystem according to the first synchronization data request and updating the synchronization value of each piece of data of all data includes:

[0039] Determine each piece of data as current data, and control the parent system to perform the following operations on the current data:

[0040] Send current data to the subsystem;

[0041] The current synchronization value of the current data is increased by one, wherein the initial value of the current synchronization value is zero.

[0042] Optionally, in this embodiment, after the parent service receives the first synchronization request from the child service, it sends the synchronization data set to the child service according to the request parameters, and updates the synchronization value of the corresponding data item. The initial value of the synchronization value of each data item is zero. If the current synchronization value of the current data is 0, it indicates that the data has not been synchronized. The current data is sent to the subsystem, and the current synchronization value is updated to 1, indicating that the data has been synchronized once. If the current synchronization value of the current data is 1, it indicates that the data has been synchronized once. The current data is sent to the subsystem, and the current synchronization value is updated to 2, indicating that the data has been synchronized twice.

[0043] Optionally, in this embodiment, the frequency and processing mechanism of synchronization requests can be controlled according to the current synchronization value of each piece of data, so as to avoid excessive synchronization requests, reduce the system burden and network bandwidth consumption, and thus optimize the system performance and resource utilization efficiency. In the process of data synchronization between the subsystem and the parent system, the synchronization value of each piece of data is increased to ensure the uniqueness and integrity of data synchronization, avoid the problem of data duplication or missing, and thus improve the reliability of data synchronization.

[0044] As an optional example, after receiving all the data, the control subsystem saves all the data and calls the synchronization data confirmation interface of the parent system to return the synchronization result of each piece of data of all the data to the parent system, including:

[0045] Each piece of all data is determined as current data, and the control subsystem performs the following operations on the current data:

[0046] In the case where the current data is not received, determining that the synchronization result of the current data is a synchronization failure;

[0047] When receiving the current data, save the current data;

[0048] In the case where the current data fails to be saved, determining that the synchronization result of the current data is a synchronization failure;

[0049] When the current data is saved successfully, the synchronization result of the current data is determined to be a successful synchronization;

[0050] The synchronization data confirmation interface of the parent system is called to return the synchronization result of the current data to the parent system.

[0051] Optionally, in this embodiment, after the parent system sends the synchronization data to the subsystem according to the synchronization request, the subsystem receives all the data. If a certain data is not successfully received, the synchronization result of this data is confirmed as a synchronization failure, and an exception message pops up to prompt the user. If a certain data is successfully received and saved, the synchronization result of this data is confirmed as a synchronization success. If a certain data is successfully received but not successfully saved, the synchronization result of this data is confirmed as a synchronization failure, and an exception message pops up to prompt the user. The synchronization result of each piece of data sent by the parent system is returned to the parent system. Through the synchronization result, errors and anomalies can be discovered in time, which improves the user's visibility of the data synchronization process. Network problems and abnormal situations can be effectively handled according to the synchronization results, synchronization failures can be discovered and handled in time, reducing the risk of synchronization failures and ensuring the smooth progress of data synchronization.

[0052] As an optional example, controlling the parent system to update the synchronization value of each piece of data according to the synchronization result of each piece of data includes:

[0053] Determine each piece of data as current data, and control the parent system to perform the following operations on the current data:

[0054] When the synchronization result of the current data is successful, the synchronization value of the current data is updated to the target value.

[0055] Optionally, in this embodiment, after the parent system receives the synchronization result of each piece of data returned by the subsystem, the synchronization value of each piece of data is updated according to the synchronization result of each piece of data. Specifically, if the synchronization result of a piece of data is synchronization success, the synchronization value of the data is updated to -1, indicating that the data has been successfully synchronized and does not need to be synchronized again. If the synchronization result of a piece of data is synchronization failure, the synchronization value of the data is increased by one on the original basis, indicating that the data has not been successfully synchronized, and it is necessary to confirm whether it is necessary to synchronize again according to the updated synchronization value, so as to avoid excessive synchronization requests and reduce the system burden and network bandwidth consumption.

[0056] As an optional example, after the control subsystem receives all the data, saves all the data, and calls the synchronization data confirmation interface of the parent system to return the synchronization result of each piece of data of all the data to the parent system, the above method further includes:

[0057] When the synchronization result of the target data is a synchronization failure, the control subsystem calls the synchronization data request interface of the parent system and sends a second synchronization data request to the parent system, wherein the target data is any one or more data among all the data, and the second synchronization data request is used to request synchronization of the target data in the parent system;

[0058] Controlling the parent system to send the target data to the subsystem according to the second synchronization data request, and updating the synchronization value of the target data;

[0059] After receiving the target data, the control subsystem saves the target data and calls the synchronization data confirmation interface of the parent system to return the synchronization result of the target data to the parent system;

[0060] The control parent system updates the synchronization value of the target data according to the synchronization result of the target data.

[0061] Optionally, in this embodiment, during the data synchronization between the subsystem and the parent system, if some data is not synchronized successfully, after the user resolves the local client exception or waits for a period of time, the synchronization request is resent to the parent system, and the parent system is once again requested to synchronize all data that has not been successfully synchronized. The parent system confirms the data set that needs to be synchronized again according to the synchronization request, returns it to the subsystem and updates the synchronization value of each data, waits for the synchronization result of each data returned by the subsystem after receiving and saving the data set, and updates the synchronization value of each data according to the synchronization result of each data. After multiple data synchronizations, all data of the parent system can be synchronized to the subsystem. During each data synchronization process, only the data that has not been successfully synchronized needs to be synchronized, which ensures the uniqueness and integrity of data synchronization, avoids the problem of data duplication or missing, and improves the reliability of data synchronization.

[0062] As an optional example, controlling the parent system to send the target data to the subsystem according to the second synchronization data request and updating the synchronization value of the target data includes:

[0063] After receiving the second synchronization request data, the control parent system acquires the target identifier of the target data from the second synchronization request data;

[0064] Find the target data in all the data of the parent system according to the target identifier;

[0065] Sends target data to the subsystem.

[0066] Optionally, in this embodiment, when the parent system sends a data set corresponding to the synchronization request according to the synchronization request, it searches all the data in the parent system according to the ID of each data in the data set and returns it to the subsystem.

[0067] In conjunction with an example, the present application relates to a data synchronization method for a parent-child system. The specific implementation process is as follows: Figure 2 As shown:

[0068] Step 1: The subsystem calls the synchronization data request interface of the parent system through HTTP communication or API interface, and sends a data synchronization request to the parent system;

[0069] Step 2: The parent system determines the data set to be synchronized according to the data parameters in the data synchronization request, sends the data set to the subsystem, and increases the synchronization value of each data in the data set by 1;

[0070] Step 3: The subsystem receives and saves the data set, and returns the synchronization result of each data item;

[0071] Step 4: The parent system receives the synchronization result of each piece of data. If the synchronization result of a piece of data is a synchronization failure, the synchronization value of the data is increased by 1. If the synchronization result is a synchronization success, the synchronization value of the data is updated to -1.

[0072] Step 5: If there is data with synchronization result of failed synchronization, the subsystem calls the synchronization data request interface of the parent system again through HTTP communication or API interface, sends a data synchronization request to the parent system, and synchronizes the data with synchronization result of failed synchronization until all data are synchronized successfully.

[0073] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0074] According to another aspect of the embodiment of the present application, a data synchronization device for a parent-child system is also provided. Figure 3 As shown, including:

[0075] The first processing module 302 is used to control the subsystem to call the synchronization data request interface of the parent system and send a first synchronization data request to the parent system, wherein the first synchronization data request is used to request synchronization of all data in the parent system;

[0076] The second processing module 304 is used to control the parent system to send all data to the subsystem according to the first synchronization data request, and update the synchronization value of each piece of data of all data;

[0077] The third processing module 306 is used to control the subsystem to save all the data after receiving all the data, and call the synchronization data confirmation interface of the parent system to return the synchronization result of each piece of data of all the data to the parent system;

[0078] The fourth processing module 308 is used to control the parent system to update the synchronization value of each piece of data according to the synchronization result of each piece of data.

[0079] Optionally, in this embodiment, the parent service: a server-side application running an HTTP server, provides two interfaces: a synchronization data request interface and a synchronization data confirmation interface. The child service: a client application, which calls the interface provided by the parent service through HTTP communication or API interface to implement data synchronization function. Each piece of data has a unique ID to ensure the uniqueness of the data. Each piece of data has an int attribute: a synchronization value. The synchronization value indicates the number of synchronization times of the data, which is used to count and judge the synchronization status. A positive synchronization value indicates that the data has not been successfully synchronized, and the synchronization times are accumulated; a synchronization value of -1 indicates that the data has been successfully synchronized. The parent system provides two interfaces, namely, a synchronization data request interface and a synchronization data confirmation interface. The synchronization data request interface sends the synchronization data set required by the child service according to the request parameters, and adds 1 to the synchronization value of the corresponding data item (if the synchronization value is -1, it will not be sent, nor will it be added 1). The synchronization data confirmation interface: according to the unique ID of the synchronization data set sent in the request parameters, the synchronization value of the corresponding data item is marked as -1, indicating that it has been successfully synchronized.

[0080] Optionally, in this embodiment, the subsystem will first call a synchronization data request interface provided by the parent system. At this time, the subsystem will generate a first synchronization data request and send this request to the parent system. The first synchronization data request is a request containing specific content, which clearly indicates that all data (or part of the data) in the parent system need to be synchronized, and notifies the parent system that the subsystem needs to obtain and synchronize all data in the current parent system. After receiving the first synchronization data request, the parent system will send all data to the subsystem according to this request. At the same time, the parent system will also update the synchronization value of each piece of data to record the cumulative number of synchronizations of each piece of data. After receiving all the data sent by the parent system, the subsystem will save these data to its own database or storage system. Subsequently, the subsystem will call a synchronization data confirmation interface of the parent system and return the synchronization result of each piece of data to the parent system. This synchronization result may include information such as the receiving status and storage status of the data. After receiving the synchronization results returned by the subsystem, the parent system will update the synchronization value of each piece of data according to these results. These synchronization values ​​can be used to mark whether data has been successfully synchronized to the subsystem or not, ensuring data consistency between the parent system and the subsystem. They can also effectively handle network problems and abnormal situations, detect and handle synchronization failures in a timely manner, reduce the risk of synchronization failures, and ensure smooth data synchronization.

[0081] Optionally, in this embodiment, the data consistency between the subsystem and the parent system is ensured, and data loss or duplication is avoided through the synchronization request and confirmation mechanism. By updating the synchronization value, the parent system can accurately track the synchronization status of each piece of data, which is convenient for subsequent maintenance and management. After the subsystem receives all the data and confirms the save, the integrity of the data is ensured, thereby avoiding system problems caused by the loss of some data.

[0082] Optionally, in this embodiment, during the data synchronization between the subsystem and the parent system, the synchronization value of each piece of data is increased, and each time the parent system sends data to the subsystem, the synchronization value of each piece of data in the system is updated. The synchronization value can count and control the number of synchronization requests, thereby achieving the purpose of improving the efficiency and controllability of data synchronization. And the subsystem will return the synchronization result of each piece of data after receiving and saving the data sent by the parent system, thereby achieving the purpose of improving the stability and certainty of data synchronization, thereby solving the technical problems of poor stability, low certainty and low controllability of the existing remote data synchronization method.

[0083] As an optional example, the above device further includes:

[0084] The fifth processing module is used to control the subsystem to call the synchronization data request interface and the synchronization data confirmation interface of the parent system through HTTP communication or API interface.

[0085] Optionally, in this embodiment, the parent service can be a backend service running on a cloud server, providing two RESTful API (Representational State Transfer Application Programming Interface, which is an API design method based on the REST architectural style. REST is a lightweight, stateless communication protocol, commonly used for Web services) interfaces: a synchronous data request interface and a synchronous data confirmation interface. The child service can be a front-end application running locally, which calls the interface provided by the parent service through AJAX (Asynchronous JavaScript and XML, a technology for creating dynamic and interactive web applications. It allows web pages to communicate asynchronously with the server without reloading the entire page) requests to implement data synchronization functions.

[0086] Optionally, in this embodiment, the parent service can be a server-side application running an HTTP server, providing two interfaces: a synchronization data request interface and a synchronization data confirmation interface. The child service is a client application that calls the interface provided by the parent service through HTTP communication to implement data synchronization.

[0087] Optionally, in this embodiment, the remote data synchronization function can be implemented through simple HTTP communication or interface calling, thereby improving the efficiency and reliability of data synchronization.

[0088] As an optional example, the second processing module includes:

[0089] The first processing unit is used to determine each piece of data of all data as current data, and control the parent system to perform the following operations on the current data:

[0090] Send current data to the subsystem;

[0091] The current synchronization value of the current data is increased by one, wherein the initial value of the current synchronization value is zero.

[0092] Optionally, in this embodiment, after the parent service receives the first synchronization request from the child service, it sends the synchronization data set to the child service according to the request parameters, and updates the synchronization value of the corresponding data item. The initial value of the synchronization value of each data item is zero. If the current synchronization value of the current data is 0, it indicates that the data has not been synchronized. The current data is sent to the subsystem, and the current synchronization value is updated to 1, indicating that the data has been synchronized once. If the current synchronization value of the current data is 1, it indicates that the data has been synchronized once. The current data is sent to the subsystem, and the current synchronization value is updated to 2, indicating that the data has been synchronized twice.

[0093] Optionally, in this embodiment, the frequency and processing mechanism of synchronization requests can be controlled according to the current synchronization value of each piece of data, so as to avoid excessive synchronization requests, reduce the system burden and network bandwidth consumption, and thus optimize the system performance and resource utilization efficiency. In the process of data synchronization between the subsystem and the parent system, the synchronization value of each piece of data is increased to ensure the uniqueness and integrity of data synchronization, avoid the problem of data duplication or missing, and thus improve the reliability of data synchronization.

[0094] As an optional example, the third processing module includes:

[0095] The second processing unit is used to determine each piece of data of all data as current data, and the control subsystem performs the following operations on the current data:

[0096] In the case where the current data is not received, determining that the synchronization result of the current data is a synchronization failure;

[0097] When receiving the current data, save the current data;

[0098] In the case where the current data fails to be saved, determining that the synchronization result of the current data is a synchronization failure;

[0099] When the current data is saved successfully, the synchronization result of the current data is determined to be a successful synchronization;

[0100] The synchronization data confirmation interface of the parent system is called to return the synchronization result of the current data to the parent system.

[0101] Optionally, in this embodiment, after the parent system sends the synchronization data to the subsystem according to the synchronization request, the subsystem receives all the data. If a certain data is not successfully received, the synchronization result of this data is confirmed as a synchronization failure, and an exception message pops up to prompt the user. If a certain data is successfully received and saved, the synchronization result of this data is confirmed as a synchronization success. If a certain data is successfully received but not successfully saved, the synchronization result of this data is confirmed as a synchronization failure, and an exception message pops up to prompt the user. The synchronization result of each piece of data sent by the parent system is returned to the parent system. Through the synchronization result, errors and anomalies can be discovered in time, which improves the user's visibility of the data synchronization process. Network problems and abnormal situations can be effectively handled according to the synchronization results, synchronization failures can be discovered and handled in time, reducing the risk of synchronization failures and ensuring the smooth progress of data synchronization.

[0102] As an optional example, the fourth processing module includes:

[0103] The third processing unit is used to determine each piece of data of all data as current data, and control the parent system to perform the following operations on the current data:

[0104] When the synchronization result of the current data is successful, the synchronization value of the current data is updated to the target value.

[0105] Optionally, in this embodiment, after the parent system receives the synchronization result of each piece of data returned by the subsystem, the synchronization value of each piece of data is updated according to the synchronization result of each piece of data. Specifically, if the synchronization result of a piece of data is synchronization success, the synchronization value of the data is updated to -1, indicating that the data has been successfully synchronized and does not need to be synchronized again. If the synchronization result of a piece of data is synchronization failure, the synchronization value of the data is increased by one on the original basis, indicating that the data has not been successfully synchronized, and it is necessary to confirm whether it is necessary to synchronize again according to the updated synchronization value, so as to avoid excessive synchronization requests and reduce the system burden and network bandwidth consumption.

[0106] As an optional example, the above device further includes:

[0107] The sixth processing module is used for, after the control subsystem receives all the data, saving all the data, and calling the synchronization data confirmation interface of the parent system to return the synchronization result of each piece of data of all the data to the parent system, and in the case where the synchronization result of the target data is a synchronization failure, the control subsystem calls the synchronization data request interface of the parent system to send a second synchronization data request to the parent system, wherein the target data is any one or more pieces of data among all the data, and the second synchronization data request is used to request synchronization of the target data in the parent system;

[0108] a seventh processing module, configured to control the parent system to send the target data to the subsystem according to the second synchronization data request, and to update the synchronization value of the target data;

[0109] An eighth processing module, configured to control the subsystem to save the target data after receiving the target data, and to call the synchronization data confirmation interface of the parent system to return the synchronization result of the target data to the parent system;

[0110] The ninth processing module is used to control the parent system to update the synchronization value of the target data according to the synchronization result of the target data.

[0111] Optionally, in this embodiment, during the data synchronization between the subsystem and the parent system, if some data is not synchronized successfully, after the user resolves the local client exception or waits for a period of time, the synchronization request is resent to the parent system, and the parent system is once again requested to synchronize all data that has not been successfully synchronized. The parent system confirms the data set that needs to be synchronized again according to the synchronization request, returns it to the subsystem and updates the synchronization value of each data, waits for the synchronization result of each data returned by the subsystem after receiving and saving the data set, and updates the synchronization value of each data according to the synchronization result of each data. After multiple data synchronizations, all data of the parent system can be synchronized to the subsystem. During each data synchronization process, only the data that has not been successfully synchronized needs to be synchronized, which ensures the uniqueness and integrity of data synchronization, avoids the problem of data duplication or missing, and improves the reliability of data synchronization.

[0112] As an optional example, the seventh processing module includes:

[0113] a fourth processing unit, configured to control the parent system to obtain a target identifier of the target data from the second synchronization request data after receiving the second synchronization request data;

[0114] A search unit, used for searching target data in all data of the parent system according to the target identifier;

[0115] The sending unit is used to send target data to the subsystem.

[0116] Optionally, in this embodiment, when the parent system sends a data set corresponding to the synchronization request according to the synchronization request, it searches all the data in the parent system according to the ID of each data in the data set and returns it to the subsystem.

[0117] For other examples of this embodiment, please refer to the above examples and will not be repeated here.

[0118] Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present application, such as Figure 4As shown, it includes a processor 402, a communication interface 404, a memory 406 and a communication bus 408, wherein the processor 402, the communication interface 404 and the memory 406 communicate with each other through the communication bus 408, wherein,

[0119] Memory 406, used to store computer programs;

[0120] The processor 402 is used to implement the following steps when executing the computer program stored in the memory 406:

[0121] The control subsystem calls the synchronization data request interface of the parent system and sends a first synchronization data request to the parent system, wherein the first synchronization data request is used to request synchronization of all data in the parent system;

[0122] Controlling the parent system to send all data to the subsystem according to the first synchronization data request, and updating the synchronization value of each piece of data of all data;

[0123] After receiving all the data, the control subsystem saves all the data and calls the synchronization data confirmation interface of the parent system to return the synchronization result of each piece of data to the parent system;

[0124] The control mother system updates the synchronization value of each piece of data according to the synchronization result of each piece of data.

[0125] Optionally, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The communication interface is used for communication between the above electronic device and other devices.

[0126] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0127] As an example, the memory 406 may include, but is not limited to, the first processing module 302, the second processing module 304, the third processing module 306, and the fourth processing module 308 in the data synchronization device of the parent-child system. In addition, other module units in the data synchronization device of the parent-child system may also be included but are not limited to, which will not be repeated in this example.

[0128] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0129] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0130] It can be understood by those skilled in the art that Figure 4 The structure shown is for illustration only. The device for implementing the above-mentioned data synchronization method of the parent-child system may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 4 The structure of the electronic device is not limited. For example, the electronic device may also include Figure 4 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 4 Different configurations shown.

[0131] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.

[0132] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program executes the steps in the above-mentioned data synchronization method of the parent-child system when executed by a processor.

[0133] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0134] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0135] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0136] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0137] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0138] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0139] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0140] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A data synchronization method for a parent-child system, characterized in that: include: The control subsystem calls the synchronization data request interface of the parent system and sends a first synchronization data request to the parent system, wherein the first synchronization data request is used to request synchronization of all data in the parent system; Controlling the parent system to send all the data to the subsystem according to the first synchronization data request, and updating the synchronization value of each piece of data of all the data; Controlling the subsystem to save all the data after receiving the data, and calling the synchronization data confirmation interface of the parent system to return the synchronization result of each piece of the data to the parent system; The parent system is controlled to update the synchronization value of each piece of data according to the synchronization result of each piece of data.

2. The method according to claim 1, characterized in that The method further comprises: The subsystem is controlled to call the synchronization data request interface of the parent system and the synchronization data confirmation interface of the parent system through HTTP communication or API interface.

3. The method according to claim 1, characterized in that The controlling parent system sends all the data to the subsystem according to the first synchronization data request, and updates the synchronization value of each piece of data of all the data, including: Determine each piece of data of all the data as current data, and control the parent system to perform the following operations on the current data: sending the current data to the subsystem; The current synchronization value of the current data is increased by one, wherein the initial value of the current synchronization value is zero.

4. The method according to claim 1, characterized in that: After receiving all the data, the controlling subsystem saves all the data, and calls the synchronization data confirmation interface of the parent system to return the synchronization result of each piece of data of all the data to the parent system, including: Determine each piece of data of all the data as current data, and control the subsystem to perform the following operations on the current data: In the case where the current data is not received, determining that a synchronization result of the current data is a synchronization failure; When receiving the current data, saving the current data; In the case where the current data fails to be saved, determining that the synchronization result of the current data is a synchronization failure; In the case where the current data is saved successfully, determining that the synchronization result of the current data is a successful synchronization; The synchronization data confirmation interface of the parent system is called to return the synchronization result of the current data to the parent system.

5. The method according to claim 1, characterized in that: The controlling the parent system to update the synchronization value of each piece of data according to the synchronization result of each piece of data comprises: Determine each piece of data of all the data as current data, and control the parent system to perform the following operations on the current data: When the synchronization result of the current data is successful, the synchronization value of the current data is updated to the target value.

6. The method according to claim 1, characterized in that After controlling the subsystem to save all the data after receiving all the data, and calling the synchronization data confirmation interface of the parent system to return the synchronization result of each piece of data of all the data to the parent system, the method further includes: When the synchronization result of the target data is a synchronization failure, controlling the subsystem to call the synchronization data request interface of the parent system to send a second synchronization data request to the parent system, wherein the target data is any one or more pieces of data among all the data, and the second synchronization data request is used to request synchronization of the target data in the parent system; Controlling the parent system to send the target data to the subsystem according to the second synchronization data request, and updating the synchronization value of the target data; Controlling the subsystem to save the target data after receiving the target data, and calling the synchronization data confirmation interface of the parent system to return the synchronization result of the target data to the parent system; The parent system is controlled to update the synchronization value of the target data according to the synchronization result of the target data.

7. The method according to claim 6, characterized in that The controlling the parent system to send the target data to the subsystem according to the second synchronization data request and updating the synchronization value of the target data includes: controlling the parent system to obtain a target identifier of the target data from the second synchronization request data after receiving the second synchronization request data; Searching for the target data in all data of the parent system according to the target identifier; The target data is sent to the subsystem.

8. A data synchronization device for a parent-child system, characterized in that: include: A first processing module, configured to control the subsystem to call the synchronization data request interface of the parent system, and send a first synchronization data request to the parent system, wherein the first synchronization data request is used to request synchronization of all data in the parent system; A second processing module, used for controlling the parent system to send all the data to the subsystem according to the first synchronization data request, and updating the synchronization value of each piece of data of all the data; A third processing module is used to control the subsystem to save all the data after receiving the data, and call the synchronization data confirmation interface of the parent system to return the synchronization result of each piece of the data to the parent system; The fourth processing module is used to control the parent system to update the synchronization value of each piece of data according to the synchronization result of each piece of data.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.