Data synchronization method, device and system
By judging the online status of the client and the data update table, the data synchronization process is optimized, the problem of low data synchronization efficiency in the existing technology is solved, and faster and more efficient data synchronization is achieved.
Patent Information
- Application Number
- CN202411222017.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-11-12
AI Technical Summary
In distributed systems, the prior art is less efficient for data synchronization between multiple clients, especially when the client frequently compares the central database and local database to determine the data to be updated, resulting in low efficiency, resulting in data The synchronization efficiency is reduced.
By determining whether the target client is a newly launched client, if so, feedback will be given to the full update data; if so, feedback will be given to the target data update task based on the data update table, and the data update task to be declared based on the status information sent by the client. To improve the efficiency of data synchronization.
It realizes faster and more efficient data synchronization, reduces resource waste, improves data synchronization efficiency between servers and clients, and ensures data consistency.
Smart Images

Figure CN118945177A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data synchronization method, device and system. Background Art
[0002] In a distributed system, data can be accessed and modified on multiple devices or clients. In order to ensure that each user accesses consistent data, data synchronization is required between the client and the server to achieve data consistency among multiple clients.
[0003] At present, in order to achieve data unification of multiple clients, the modified data is usually uploaded to the server after the client modifies the data. The server stores the received updated data in the central database. When the client logs in to the server online, the data in the central database is compared with the client's local data to confirm the client's data to be updated, and the data to be updated is pushed to the client.
[0004] However, if you want to ensure that the client can obtain the latest data in time when it is online, the server must frequently confirm the client's data to be updated. Each time the client's data to be updated is confirmed, the central database must be compared with the data in the client's local database. The efficiency of confirming the data to be updated is low, which in turn leads to low efficiency of data synchronization. Summary of the invention
[0005] In view of the above problems, the present invention proposes a data synchronization method, device and system, the main purpose of which is to improve the efficiency of data synchronization between a server and a client.
[0006] In order to achieve the above object, the present invention mainly provides the following technical solutions:
[0007] In a first aspect, the present invention provides a data synchronization method, applied to a server, the method comprising:
[0008] According to the data synchronization request of the target client, determining whether the target client is a newly online client;
[0009] If yes, then feeding back full update data to the target client, the full update data being a data set of updated data stored in each client;
[0010] If not, feeding back the target data update task to the target client according to the data update table, wherein the data update table is used to maintain the newly added data update tasks of each client;
[0011] Receiving status information of the target data update task having been completed, sent by the target client;
[0012] The data update task to be cancelled in the data update table is determined according to the status information.
[0013] In a second aspect, the present invention provides a data synchronization method, applied to a client, the method comprising:
[0014] Sending data synchronization requests to the server within a preset period;
[0015] Receiving the data to be synchronized fed back by the server, wherein the data to be synchronized includes full update data or target data update tasks;
[0016] Synchronize the data to be synchronized into the local database;
[0017] When the data to be synchronized is the target data update task, status information indicating that the target data update task has been completed is sent to the server.
[0018] In a third aspect, the present invention provides a data synchronization device, applied to a server, the device comprising:
[0019] A judging unit, configured to judge whether the target client is a new online client according to a data synchronization request of the target client;
[0020] A first feedback unit, configured to feed back full update data to the target client if the determination unit determines that the target client is a newly online client, wherein the full update data is a data set of updated data of each client stored;
[0021] A second feedback unit is configured to feedback a target data update task to the target client according to a data update table if the determination unit determines that the target client is not a newly-connected client, wherein the data update table is used to maintain newly-added data update tasks for each client;
[0022] A receiving unit, configured to receive status information of the target data update task having been completed, sent by the target client;
[0023] A determination unit is used to determine the data update task to be cancelled in the data update table according to the status information received by the receiving unit.
[0024] In a fourth aspect, the present invention provides a data synchronization device, applied to a client, the device comprising:
[0025] A first sending unit, used to send a data synchronization request to a server within a preset period;
[0026] A receiving unit, configured to receive the data to be synchronized fed back by the server, wherein the data to be synchronized includes full update data or target data update tasks;
[0027] A synchronization unit, used for synchronizing the data to be synchronized received by the receiving unit into a local database;
[0028] The second sending unit is used to send status information of completing the target data update task to the server when the data to be synchronized is the target data update task.
[0029] In a fifth aspect, the present invention provides a data synchronization system, the system comprising a server and a client;
[0030] The server is used to send update data to the client according to the data synchronization request sent by the client, and maintain the data update task in the data update table. The server is used to execute the data synchronization method of the first aspect above;
[0031] The client is used to send a data synchronization request to the server and synchronize the received update data to a local database. The client is used to execute the data synchronization method of the second aspect.
[0032] On the other hand, the present invention also provides a computing device, comprising: at least one processor, and a memory, wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor, so that the processor can execute a data synchronization method as described in the first aspect and the second aspect.
[0033] On the other hand, the present invention also provides a readable storage medium, which is used to store a computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute a data synchronization method as described in the first aspect and the second aspect.
[0034] By means of the above technical scheme, the present invention provides a data synchronization method. As long as the target client is online and logs in to the server, the server will receive a data synchronization request sent by the target client. Since the client can successfully send a data synchronization request only when it is online, the server can determine that the target client is online according to the received data synchronization request, and judge whether it is a newly online client. If the target client is a newly online client, it means that it has not been online and logged in to the server for a long period of time. During this period of time when it is not online, it is likely that other clients have modified and updated a lot of data. At this time, the data set updated by each client within the current time, that is, the full amount of updated data, will be fed back to the target client to achieve more accurate and comprehensive data synchronization and avoid omissions. The target client not only sends a data synchronization request to the server when it is online for the first time, but also sends a data synchronization request every once in a while during the online period to achieve data synchronization as timely as possible. Therefore, after the server receives the data synchronization request sent by the target client, there is still a situation where the target client itself is already online. At this time, the data that needs to be updated for the target client will be found from the data update table in the server and fed back to the target client. Among them, the data update table is used to maintain the data update tasks newly added by each client, and each data update task is used to synchronize and update data for each online client, and the data update task fed back to the target client is regarded as the target data update task. Since the target client is online, the server will continuously receive the data synchronization request sent by the target client, so the latest data needs to be fed back to the target client each time, and the number of feedback data that the target client needs to receive each time during the online period is small. If all the data in the central database are used for comparison to determine the updated data each time, it will be too wasteful of time and resources. The data update table in this scheme can more quickly determine the target data update task that needs to be fed back to the target client for updating. Furthermore, after the target client completes the target data update task, it will also send the completion status to the server in the form of status information. The server can determine whether the current online client has fully synchronized this target data update task based on the received status information and other status information received from other clients. If it has been fully synchronized, there is no need to keep the target data update task. Deleting it can further release the space of the data update table, which is more conducive to quickly determining the next target data update task. Since the server can determine the updated data more quickly, the client can also receive the data to be synchronized fed back by the server more quickly after issuing a data synchronization request, and synchronize the data to be synchronized to the database, thereby achieving more efficient data synchronization. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] By reading the detailed description below with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0036] Figure 1 A flow chart of a data synchronization method applied to a server proposed in an embodiment of the present invention is schematically shown;
[0037] Figure 2 A flowchart of another data synchronization method applied to a server proposed in an embodiment of the present invention is schematically shown;
[0038] Figure 3 A flowchart of a new data update task applied to a server proposed in an embodiment of the present invention is schematically shown;
[0039] Figure 4 A flow chart of a data synchronization method applied to a client proposed in an embodiment of the present invention is schematically shown;
[0040] Figure 5 A flowchart of a new data update task applied to a client proposed in an embodiment of the present invention is schematically shown;
[0041] Figure 6 A flowchart of interaction between a server and a client in a data synchronization system proposed in an embodiment of the present invention is schematically shown;
[0042] Figure 7 The structure diagram of a data synchronization device applied to a server proposed in an embodiment of the present invention is schematically shown;
[0043] Figure 8 A schematic diagram of the structure of another data synchronization device applied to a server proposed in an embodiment of the present invention is shown;
[0044] Fig. 9 The structure diagram of a data synchronization device applied to a client proposed in an embodiment of the present invention is schematically shown;
[0045] Fig.10 A schematic diagram of the structure of another data synchronization device applied to a client proposed in an embodiment of the present invention is shown schematically. DETAILED DESCRIPTION
[0046] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0047] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in the present invention should have the common meanings understood by those skilled in the art to which the present invention belongs.
[0048] Usually, in order to achieve data synchronization between various clients, it is necessary to implement it through a central server. The central server often compares the data difference between the client's local data and the central database after detecting that the client is online, to determine whether there is data to be synchronized for the client, and sends it to the client. This method makes it necessary to frequently compare the data in the central database and the local database if you want to push it to the client in time after the data is updated. There are many data, and the efficiency of obtaining the data to be synchronized by comparison is low. Based on this, the inventor of this case wants to use as few data resources as possible when determining the data to be synchronized. Then, after receiving the updated data uploaded by each client, it is not necessary to store it directly in the central database, but to establish a data update table in advance, and store the updated data in the data update table. The purpose is to facilitate real-time data update for the client. However, only the clients that have been online need to perform real-time updates. It is more comprehensive for the newly online clients to determine and obtain the data to be synchronized from the central database. Therefore, it is thought that when obtaining the online status of the client, it is first determined whether it is a newly online client. The newly online client uses the central database to determine the data to be synchronized, and the online client pushes the data in the data update table to it as the data to be synchronized. Furthermore, in order to ensure higher efficiency when using the data update table to determine the data to be synchronized, the synchronized data of all online clients is also cancelled to save data update table space.
[0049] Based on this, the inventor of this case proposed a data synchronization method, which is applied to the server side. The server can determine different data push methods according to whether the client is a new client, and also judge whether the data update task needs to be cancelled according to the completion of the data update task in the data update table by the client, so as to reduce unnecessary space occupation in the data update table, improve the efficiency of determining the data to be synchronized, and further improve the data synchronization efficiency. A data synchronization method of an embodiment of the present invention, the specific steps of which are as follows: Figure 1 As shown, including:
[0050] 101. According to the data synchronization request of the target client, determine whether the target client is a newly online client.
[0051] In this step, the newly online client is a target client that reconnects to the server after being offline for a period of time, wherein the specific offline time can be three minutes or five minutes, etc., which is set according to the actual situation. When the target client is back online, it will send a data synchronization request to the server to obtain the updated data generated during the offline period. Since it is desired to synchronize updated data to the client as timely as possible, during the period when the client is online, the client will also send a data synchronization request to the server at intervals of a preset time. Therefore, when receiving the data synchronization request sent by the target client, the online status of the target client is not unique, and it is necessary to determine whether the target client is a newly online client or an online client.
[0052] When the server receives the data synchronization request sent by the target client, it can determine the online status of the target client. At this time, it can determine whether the target client is a newly online client based on the target client's last online status. It can be determined based on whether the target client's last online status recorded by the server was offline. If the target client's last online status recorded was offline, it means that the target client's current login is a reconnection to the server after being offline; it can also be determined based on the last online time. If the target client's last online time recorded by the server is far away from the current time, it is determined that the target client is a newly online client, otherwise it is an online client. The specific time from the last online time to the current time can be three minutes or five minutes, etc., which is set according to the actual situation.
[0053] The data synchronization request of the target client may include not only a request for obtaining the data to be synchronized, but also an identifier of the target client, so that the server can record the online status of the target client according to the identifier of the target client.
[0054] 102. If the target client is a newly launched client, the full update data is fed back to the target client.
[0055] When the server determines that the target client is a newly online client, since there may be a lot of updated data in the server during the offline period of the target client, in order to ensure that the data to be synchronized fed back to the target client according to the data synchronization request is more comprehensive, the data to be synchronized fed back to the target client is the full updated data as of the current time, and the full updated data is the data set of the updated data of each client stored in the server. Among them, the data set of the updated data of the client is relative to the data update table described in step 103 below. The data update table stores data that has not been fully updated by the online client. When the data in the data update table has been updated by all online clients, it is stored in the full updated data, and the full updated data is located in the central database of the server.
[0056] The full update data may include not only the update data, but also the update time of each update data, so that when the target client receives the full update data, it can determine the data that needs to be synchronized according to the update time of each update data; since the full update data stores all the latest data, the full update data may not include the update time, but only include the update data. After the target client receives the full update data, it compares it with the local database. If the data identifier is the same but the data value is different, the data value in the full update data shall prevail and it shall be updated to the local database.
[0057] 103. If the target client is not a newly online client, the target data update task is fed back to the target client according to the data update table.
[0058] When each client performs a query based on the currently synchronized local database, it is found that one or more data need to be modified. At this time, not only the modification must be completed in the local database, but the modified content must also be synchronized to the server to unify the data of all clients. On the server side, considering that the target client has synchronized all updated data during the offline period to the local database when it first connects to the network or reconnects to the server after being disconnected, then while the target client is continuously online, if other clients modify some of the current data, it will be stored in the data update table, which is a data table established in advance and is used to maintain the data update tasks added during the online period of each client. Therefore, when the target client is already online, the server can determine the target data update tasks added by other clients during the online period of the target client from the data update table, and feed it back to the target client.
[0059] When the server determines the target data update task to be fed back to the target client from the data update table, it can be based on the completion of the data update task by each client recorded in the data update table, or it can match each data update task in the data update table with the data in the local database. If the match is consistent, no update is required. If the match is inconsistent, the inconsistent data update task is used as the target data update task and fed back to the target client.
[0060] 104. Receive status information of the completed target data update task sent by the target client.
[0061] In this embodiment, the server records the status of each client completing the data update task in the data update table. After the target data update task is fed back to the target client, the target client performs data synchronization, and after the synchronization is completed, the status information of the completed target data update task is sent to the server. After receiving the completed status information sent by the target client, the server stores the completed status information in the corresponding data update task column in the data update table. That is, the task column of each data update task records which clients have completed the data update task, so that when the server receives the data synchronization request sent by the online client, it can determine the unfinished data update task of the target client according to the client completion status of each data update task recorded in the data update table. If the completed clients of all data update tasks in the data update table include the target client, it means that there is no data to be synchronized of the target client in the data update table. At this time, the server feeds back a response to the target client that there is no data to be synchronized.
[0062] 105. Determine the data update tasks to be written off in the data update table based on the status information.
[0063] In order to quickly search and determine the data update task to be fed back to the client in the data update table each time a data synchronization request is received from the client, it is necessary to keep as little data as possible in the data update table to facilitate search, take up less space and improve server operation efficiency.
[0064] Therefore, after each time receiving the status information of the completed target data update task sent by the target client, the completion status of other clients of the target data update task is also obtained, and all current online clients are obtained to determine whether all completed clients corresponding to the target data update task include all current online clients. If included, it proves that all online clients at this time no longer need to synchronize the target data update task, and there is no need to continue to store the target data update task in the data update table. It can be determined as a data update task to be cancelled in the data update table and updated to the full update data.
[0065] In addition to the above method of determining the data update task to be cancelled, after storing the status information of the target client in the data update table, it is also possible not to immediately determine whether the data update task is a data update task to be cancelled based on the status information received this time, but to continuously access the data update table within a preset period to detect whether the synchronized clients corresponding to each data update task include all online clients, such as once every two minutes or every three minutes, and the preset period between specific detections is not limited here. If the synchronized clients corresponding to a data update task include all online clients, it is determined as a data update task to be cancelled in the data update table and updated to the full update data.
[0066] Based on the above Figure 1 It can be seen from the implementation method that by judging whether the target client is a newly online client, two different data feedback methods can be selected. If the target client is a newly online client, the full amount of updated data will be fed back to it to achieve more comprehensive and accurate data synchronization; if the target client is an online client, the target data update task to be fed back to the target client can be determined based on a small number of data update tasks in the data update table to improve the efficiency of determining the data to be synchronized. The data update tasks to be cancelled in the data update table are also determined based on the completion of the target data update tasks received by the target client, so as to cancel the data update tasks that have been synchronized by all online clients, retain the necessary data update tasks in the data update table, save the space occupied by data in the data update table, improve the server operation efficiency, facilitate the search for target data update tasks, and further improve the efficiency of data synchronization.
[0067] Furthermore, according to the above Figure 1 In the embodiment of the present invention shown in FIG. 1 , a more specific data synchronization process performed by the server side will be described in more detail in the embodiment of the present invention. The specific steps are as follows: Figure 2 As shown, including:
[0068] 201. Determine whether the target client is a newly online client based on whether the previous status of the target client is offline.
[0069] In this step, after the server receives the data synchronization request sent by the target client, it first determines that the target client is online according to the data synchronization request, determines it as online, and stores the online status of the target client in the client status table. The client status table stores the historical online status of all clients, which can only include each online time of each client, specifically accurate to seconds, and can also include each client's offline time, also accurate to seconds. Among them, since this scheme determines whether the client is online according to the received data synchronization request, if it is necessary to record whether the client is offline in the client status table, it is determined according to whether the data synchronization request sent by the client has not been received for a long time. The reason is that if the client is continuously online, it will continue to send data synchronization requests to the server within a preset period to obtain the data to be synchronized, and if the data synchronization request is not received after a long period of time exceeding the preset period, it proves that the client has been disconnected from the server, and the server can modify its online status to offline in the client status table and record the offline time. Among them, how long it takes to determine it as offline when no data synchronization request is received can be set according to the actual situation, which can be three minutes or five minutes, and is not limited here.
[0070] In order to accurately determine the client offline time, the server in this solution monitors the time of the most recent online status update of each online client in the client status table in real time, that is, the latest online time. If the time between the latest online time and the current time exceeds the preset time, it means that the client has been disconnected from the server and has not been able to reconnect, that is, it cannot send a data synchronization request, and the server cannot determine whether the client is online during this period, so it is considered offline and its offline status is updated in the client status table.
[0071] In this embodiment, a method of storing online and offline states in a client status table is adopted. Whether the target client is continuously online or reconnected after being offline can be determined by the online status stored in the client status table. Specifically, it can be determined by detecting whether the previous state of the target client in the client status table is offline. If the previous state is offline, the target client is determined to be a newly online client. If the previous state is online, the target client is continuously online, and the target client is determined to be an online client. Among them, when the previous state of the target client is offline, it can also be determined whether it is a newly online client based on the offline duration. If the offline duration is short and does not exceed the preset offline duration, such as not exceeding 30 seconds, 50 seconds, etc., it is considered that the target client is temporarily offline. At this time, it has been reconnected and it is determined to be an online client. In this step, since a preset time period has been set for monitoring whether each client is offline, comprehensive consideration can be given. If the preset time period set for monitoring offline is short, the preset offline time period after the target client is offline can be set longer; if the preset time period set for detecting offline is long, the preset offline time period after the target client is offline can be set shorter.
[0072] For example, assuming that the client is continuously online, it sends a data synchronization request every 1 minute. If it is determined to be offline only after no data synchronization request is received for 5 minutes, then as long as the previous status is detected as offline when the data synchronization request of the target client is received again, it will be determined as a newly online client; if it is determined to be offline only after no data synchronization request is received for 2 minutes, then when the data synchronization request of the target client is received again, it will be detected that the previous status is offline, and then it is determined whether the offline time is more than 3 minutes from now. If the offline time is more than 3 minutes, it is considered that the target client is offline for a long time, not a short offline, and it is determined to be a newly online client. The specific times mentioned above are all examples, and the actual time is determined according to the actual situation, and is not specifically limited here.
[0073] It should be noted that, if the previous status information of the target client is not found in the client status table, it is determined that the target client is accessing the server for the first time and is also a new online client.
[0074] 202. If the target client is a newly online client, the full update data is fed back to the target client.
[0075] The full update data in this step includes not only the update data but also the update time of each update data, so that after the target client receives the full update data, it can determine the data to be synchronized according to the update time of each update data.
[0076] 203. If the target client is not a newly online client, the target data update task is fed back to the target client according to the data update table.
[0077] Since each client will send the status information of the completed synchronization to the server after completing the synchronization of its own data update task, based on this, the server queries the data update table whether there is an unfinished data update task for the target client according to the synchronized client status corresponding to each data update task in the data update table. Specifically, by querying the synchronized clients corresponding to each data update task in the data update table, it is determined whether the synchronized clients include the target client. If included, it means that this data update task has been synchronized by the target client. If not included, this data update task is an unfinished data update task for the target client. When there is an unfinished data update task for the target client in the data update table, the unfinished data update task is determined as the target data update task, and the target data update task is fed back to the target client.
[0078] The data update table stores at least one data update task, and each data update task may include the location of the data in the full update data. For example, if the full update data is multiple queryable data tables, the location of the data may be "the data table is table A, and the data entry ID is 101". It may also include the modified parameters and the specific values after the modification, and must also include the synchronized clients. Table 1 is a simple example of a data update table:
[0079] Table 1. Data update table
[0080] Data Sheet Entry ID Modified columns New data value Synchronized Clients Table A 101 "Walking parameters" 100 Client 1, Client 2 Table A 102 "Traction" 200 Client 2 Table B 1 "Crossarm height" 50 Client 1
[0081] 204. Determine the data update task to be cancelled in the data update table according to the received status information that the target client has completed the target data update task.
[0082] After receiving the status information of the completed target data update task sent by the target client, the status information and the corresponding target client identifier are added to the synchronized clients of the target data update task. Each data update task has a corresponding synchronized client, and the synchronized clients are reflected by the identification information of each client.
[0083] The online clients in the client status table are obtained, and matched with the synchronized clients of the target data update task, and it is determined whether the synchronized clients of the target data update task already include all the currently online clients. If yes, the target data update task is determined as the data update task to be cancelled. It should be noted that this step takes the target data update task in this embodiment as an example, and other data update tasks in the data update table are also determined in this way to determine whether they are data update tasks to be cancelled.
[0084] If the target data update task is determined to be a data update task to be cancelled, the data update task to be cancelled is stored in the full update data to facilitate feedback of the data to be synchronized for the newly launched client. After the storage is completed, the data update task to be cancelled is cancelled from the data update table.
[0085] Based on the above Figure 2 It can be seen from the implementation method that, according to whether the last status of the target client recorded in the client status table is offline, it can be accurately determined whether the target client is a client that reconnects after being offline for a period of time. If so, the target client is a newly online client, otherwise it is an online client. According to this judgment result, the required data to be synchronized can be accurately fed back to it. When the target client is an online client, it is also possible to accurately determine whether there is a target data update task in the data update table based on the synchronized clients corresponding to each data update task recorded in the data update table, thereby improving the efficiency of determining the target data update task.
[0086] Furthermore, according to the above Figure 1 , Figure 2 In the embodiment of the present invention shown in FIG. 1 , the operation process performed by the server when the client wants to add a new data update task will be described in more detail in the embodiment of the present invention. The specific steps are as follows: Figure 3 As shown, including:
[0087] 301. Receive a data modification request from a target client.
[0088] When the target client intends to modify the data in the synchronized local database, it not only needs to make changes in the local database, but also needs to synchronize the modified data to the server so that the server can synchronize the data to other clients. In order to avoid users of two clients modifying a piece of data at the same time, resulting in server recognition failure, when the target client wants to modify a piece of data, it must first send a data modification request to the server. The data modification request may include the identification information of the data to be modified and the modified data value. After receiving the data modification request, the server determines whether it can be modified.
[0089] 302. Determine whether the data modification request is approved according to the data update table.
[0090] The data to be modified is determined according to the received data modification request. According to the identifier of the data to be modified, such as the position or unique identifier in the full update data, it is searched whether the data to be modified exists in the data update table, that is, it is searched whether the data update task in the data update table is repeated with the data to be modified. If so, it means that other clients have submitted modification requests for the data to be modified, and the target client is not allowed to modify the data to be modified at this time. After all current online clients have synchronized this data update task, this data update task must be cancelled from the data update table before the target client is allowed to modify the data to be modified. If the data to be modified does not exist in the data update table, the target client is allowed to modify the data to be modified at this time.
[0091] 303. If it fails, a prompt indicating that it cannot be modified is fed back to the target client.
[0092] When the server determines that the target client cannot modify the data to be modified, it will give the target client a prompt that the data cannot be modified. At the same time, the server can monitor the data update tasks in the data update table in real time. When the synchronized clients of the data update task recorded in the data update table include all online clients, the data update task will be cancelled. When the server detects that the data update task has been cancelled, it can send a prompt to the target client that the data can be modified. Alternatively, the target client can send a data modification request to the server at regular intervals until the server determines that the data can be modified and gives it feedback to the target client.
[0093] 304. If approved, a prompt indicating that the modification is possible is fed back to the target client, and the data is updated based on the data modification request.
[0094] When the server determines that the target client can modify the data to be modified, it determines the data to be modified as a new data update task and stores it in the data update table. At the same time, the target client makes modifications in the local database, and the server adds the target client's completion status information for the new data update task to the data update table.
[0095] Based on the above Figure 3It can be seen from the implementation method that when the target client wants to modify the data in the database, it must first go through the server to determine whether other clients have made modifications to the data at the moment and it has not been synchronized by all online clients. When it has not been synchronized by all online clients, the data update task will exist until all online clients complete the synchronization. As long as this data update task exists in the data update table, the target client cannot modify it, which can avoid two values appearing in the same data, and further avoid data conflicts when the server confirms the data to be synchronized to other clients.
[0096] Furthermore, Figure 1 Corresponding to the embodiment of the present invention shown in FIG. 1 , the data synchronization method executed by the client is described in more detail in the embodiment of the present invention. The specific steps are as follows: Figure 4 As shown, including:
[0097] 401. Send a data synchronization request to the server within a preset period.
[0098] In order for the client to be able to promptly obtain the data update tasks added by other clients in the server during the online period, except when the client is newly online after being offline, as long as the client is online, it will send a data synchronization request to the server once every preset period to obtain the new data update tasks generated from the time when the last data synchronization request was sent to the current time. Among them, if the client is a newly online client, the data synchronization request sent is the first time to send a data synchronization request to the server within the preset period. In addition to including a request to obtain the data to be synchronized, the data synchronization request sent by the client to the server can also include the client's identification, so that the server can record its online status according to the client's identification, and feedback the data to be synchronized according to the client's identification.
[0099] 402. Receive the data to be synchronized fed back by the server.
[0100] After receiving the data synchronization request sent by the client, the server will feedback the data to be synchronized to the client according to the data synchronization request, where the data to be synchronized is the full update data or the target data update task.
[0101] When the server determines that the client is a newly online client based on the data synchronization request, the client will receive the full update data fed back by the server; when the server determines that the client is an online client based on the data synchronization request, the client will receive the target data update task fed back by the server.
[0102] 403. Synchronize the data to be synchronized to the local database.
[0103] After receiving the full update data fed back by the server, if the full update data only includes various data, each data item will be compared with the data in the local database, and the inconsistent local data will be modified to the data value in the full update data to complete data synchronization; if the full update data also includes the update time of each data item, the newly added update data during the offline period will be determined based on the last time the client logged in to the server, and synchronized to the local database.
[0104] When the client is an online client, the received data to be synchronized is a target data update task, and it is directly synchronized to the local database to complete the replacement of the old data value.
[0105] 404. When the data to be synchronized is a target data update task, status information of the completed target data update task is sent to the server.
[0106] After the target data update task is synchronized to the local database, the status information of the completed target data update task is sent to the server so that the server can count which online clients have synchronized each data update task in the statistical data update table.
[0107] Based on the above Figure 4 It can be seen from the implementation method that once the client logs in to the server, it sends a data synchronization request to the server every preset period to obtain the data to be synchronized in time. When it is newly online, it can receive the complete data to be synchronized to complete data synchronization more comprehensively and accurately. When it is continuously online, it can only receive the target data update tasks that need to be synchronized, and there is no need to determine whether it needs to be synchronized again, which improves the efficiency of completing data synchronization on the client side. The completion status is also fed back to the server so that the server can maintain the data update table, so that the server can continue to feedback the data to be synchronized to the client more quickly, thereby making the client more efficient in completing data synchronization.
[0108] Furthermore, according to the above Figure 4 In the embodiment of the present invention shown in FIG. 1 , when a client wants to add a new data update task, the specific steps are the same as those described above. Figure 3 The contents of the embodiments shown correspond to those of Figure 5 As shown, including:
[0109] 501. Send a data modification request to the server.
[0110] When the client wants to modify some data based on the data in the local database that has been synchronized, it needs to first ask the server whether it can make the modification, so as to avoid registering two values of the same data in the data update table, and the server cannot determine which data to feed back to other clients. The client asks the server whether it can make the modification by sending a data modification request to the server.
[0111] Among them, in order to prevent the data modification request sent for the first time from being rejected by the server, when sending the data modification request to the server, it can be set to send the data modification request to the server at regular intervals, so that when the repeated data update tasks in the data update table are cancelled, the client can timely pass the data modification request to modify the data, and when the data modification request is passed, an instruction to stop sending the data modification request is issued. It can also be pre-set to send only one data modification request, if the data modification request is allowed by the server, then execute the data modification step, if the data modification request is rejected by the server, then after receiving the rejection prompt, send the data modification request to the server again after a preset time, until the data modification request is allowed. It can also be that the client sends a data modification request from beginning to end, if the data modification request is rejected by the server, the server monitors in real time when the data update task in the data update table is cancelled, and when the server monitors that the data update task has been cancelled, it sends a prompt to the client that it can be modified.
[0112] 502. Obtain a notification from the server on whether the data can be modified according to the data modification request.
[0113] The data modification request sent by the client may only include the data identifier of the data to be modified, so that the server can query the data update table based on this identifier whether there is the same data identifier. If so, the client will receive a prompt that it cannot be modified. If not, the client will receive a prompt that it can be modified. At this time, the client sends the modified data value to the server based on the prompt, so that the server can add the identifier and data value of the data to be modified to the data update table. The data modification request can also include the modified data value. When the server queries that the data to be modified does not exist in the data update table, the data to be modified and its modified data value can be directly added to the data update table.
[0114] When the data modification request also includes the modified data value, the server can compare the modified data value in the data modification request with the data value of the data in the data update table after determining that the data to be modified already exists in the data update table. If the two data values are consistent, the server can provide feedback to the client that the same modification has already occurred and there is no need to modify it again. After receiving the prompt, the client cancels the data modification request and waits for the next time to actively send a data synchronization request to the server to complete the synchronization of the data according to the data synchronization request.
[0115] 503. If the modification is not allowed, the data modification request is sent to the server again after a preset period of time.
[0116] In this step, the method of sending a data modification request once in advance as described in step 501 is adopted. Only when the data modification request is rejected, the data modification request is sent to the server again after a preset time period.
[0117] 504. If the data can be modified, synchronize the data to be modified to the local database, and send the completion status information to the server.
[0118] If the server confirms that there is no data to be modified in the data update table, the received identifier of the data to be modified and the modified data value can be directly added to the data update table. At the same time, the client performs the same data modification in the local database, completes the data synchronization with the server, and sends the completion status information to the server after the modification is completed.
[0119] Based on the above Figure 5 It can be seen from the implementation method that the client in the present invention cannot modify the data at any time. Only when the server determines that there is no data update task that duplicates the data to be modified in the data update table, can it receive a prompt that the data can be modified and perform the data modification, thereby avoiding the situation where two data values exist at the same time for the same data and the server cannot determine which data to feed back to the client, thereby further improving the efficiency of data synchronization.
[0120] Combined with the above Figures 1 to 5 The server and client described in the embodiment of the present invention also provide a data synchronization system, which at least comprises Figures 1 to 3 The client shown and Figure 4 , Figure 5 The client in this system can be a user device such as a mobile phone or a computer. The operations and interaction processes performed by the server and the client in this data synchronization system are as follows: Figure 6 As shown, including:
[0121] 601. The client logs in to the server and sends a data synchronization request to the server every preset period.
[0122] 602. The server sends data to be synchronized to the client.
[0123] After receiving the data synchronization request, the server determines that the client is online, records the online status in the client status table, and determines whether the client is a new online client or an online client based on whether the previous status of the client in the client status table was offline. If it is a new online client, the full update data is fed back to the client as the data to be synchronized; if it is an online client, the target data update task in the data update table is fed back to the client as the data to be synchronized. The target data update task is the unfinished data update task of the client.
[0124] 603. The client synchronizes the received data to be synchronized into the local database.
[0125] 604. The client sends the status information of the completed synchronization to the server.
[0126] 605. The server adds the completed status information sent by the client to the synchronized client of the corresponding target data update task in the data update table.
[0127] 606. The server determines whether the corresponding data update task is a data update task to be cancelled based on the completed status information of the client, and if so, cancels it.
[0128] 607. The client sends a data modification request to the server.
[0129] 608. The server determines whether the data to be modified can be modified according to the identifier of the data to be modified carried in the data modification request, and feeds back the result to the client.
[0130] If the result is that the data can be modified, the data to be modified will be added to the data update table while a prompt indicating that the data can be modified is fed back to the client.
[0131] 609. The client receives a prompt indicating whether the data to be modified can be modified.
[0132] 610. If the data can be modified, the client synchronizes the data to be modified to the local database; if the data cannot be modified, the client sends a data modification request to the server again after a preset time.
[0133] 611. After the client completes synchronizing the data to be modified to the local database, it sends a synchronization completion status message to the server.
[0134] 612. The server adds the received synchronization completion status information to the data update table.
[0135] Based on the above Figure 6 It can be seen from the implementation method that in this solution, the client only needs to send a small number of requests to the server, which can better maintain network stability when the network is not good. The server can determine the data to be synchronized for the online client in real time more quickly based on the small amount of updated data in the data update table. In addition, the data update table can also avoid data conflicts caused by modifying the same data at the same time, and improve the accuracy of the server's feedback of the data to be synchronized to the client.
[0136] Furthermore, as a response to the above Figure 1-3 The implementation of the method embodiment shown in the figure, the embodiment of the present invention provides a data synchronization device, which is applied to the server and is used to interact with the client to complete the data synchronization between the client and the server. The embodiment of the device corresponds to the aforementioned method embodiment. For the convenience of reading, this embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the device in this embodiment can correspond to all the contents of the aforementioned method embodiment.
[0137] Specific as Figure 7 As shown, the device comprises:
[0138] A determination unit 71, configured to determine whether the target client is a new online client according to a data synchronization request of the target client;
[0139] The first feedback unit 72 is configured to feed back full update data to the target client if the determination unit 71 determines that the target client is a new client, where the full update data is a data set of updated data of each client stored;
[0140] The second feedback unit 73 is used to feedback the target data update task to the target client according to the data update table if the determination unit 71 determines that the target client is not a new online client. The data update table is used to maintain the newly added data update tasks of each client.
[0141] The receiving unit 74 is used to receive the status information of the completed target data update task sent by the target client;
[0142] The determining unit 75 is used to determine the data update task to be cancelled in the data update table according to the status information received by the receiving unit 74 .
[0143] Further, such as Figure 8 As shown, the judging unit 71 includes:
[0144] Receiving module 711, used for receiving a data synchronization request from a target client;
[0145] The storage module 712 is used to determine that the target client is in an online state according to the data synchronization request received by the receiving module 711, and store the online state in the client state table;
[0146] A detection module 713 is used to detect whether the last status of the target client in the client status table is offline;
[0147] The determination module 714 is used to determine that the target client is a newly online client if the detection module 713 detects that the previous status of the target client in the client status table is offline;
[0148] The determination module 714 is further configured to determine that the target client is an online client if the detection module 713 detects that the previous status of the target client in the client status table is not offline.
[0149] Further, such as Figure 8 As shown, the judging unit 71 further includes:
[0150] Monitoring module 715, used to monitor the latest online time of each online client in the client status table;
[0151] The modification module 716 is used to modify the status of the corresponding online client to offline if the monitoring module 715 detects that the time between the latest online time and the current time exceeds a preset time.
[0152] Further, such as Figure 8 As shown, the second feedback unit 73 includes:
[0153] Query module 731, used to query the synchronized clients corresponding to each data update task in the data update table;
[0154] The judgment module 732 is used to judge whether the synchronized clients corresponding to each data update task queried by the query module 731 include the target client;
[0155] A first determining module 733, configured to determine the data updating task not including the target client obtained by the determining module 732 as an unfinished data updating task;
[0156] A second determining module 734, configured to determine the unfinished data updating task determined by the first determining module 733 as a target data updating task;
[0157] The feedback module 735 is used to feed back the target data update task determined by the second determination module 734 to the target client.
[0158] Further, such as Figure 8 As shown, the device further includes a modification unit 76, which specifically includes:
[0159] Receiving module 761, used for receiving a data modification request from a target client;
[0160] A determination module 762, configured to determine whether the data modification request received by the receiving module 761 is passed according to the data update table;
[0161] The feedback module 763 is used to feedback a prompt indicating that the data modification request cannot be modified to the target client if the determination module 762 determines that the data modification request is not approved;
[0162] The modification module 764 is used to feed back a prompt that the modification is allowed to the target client if the determination module 762 determines that the data modification request is passed, and update the data based on the data modification request.
[0163] Further, such as Figure 8 As shown, the determination module 762 includes:
[0164] The first determining submodule 7621 is used to determine the data to be modified according to the data modification request;
[0165] A searching submodule 7622 is used to search whether the data to be modified determined by the first determining submodule 7621 exists in the data updating task of the data updating table;
[0166] The second determining submodule 7623 is used to determine that the data modification request is not approved if the searching submodule 7622 finds that there is data to be modified in the data update table;
[0167] The second determining submodule 7623 is further used to determine that the data modification request is approved if the searching submodule 7622 finds that the data to be modified does not exist in the data update table.
[0168] Further, such as Figure 8 As shown, the modification module 764 includes:
[0169] A determination submodule 7641 is used to determine the data to be modified according to the data modification request;
[0170] The storage submodule 7642 is used to determine the data to be modified determined by the determination submodule 7641 as a newly added data update task, and store it in the data update table;
[0171] The adding submodule 7643 is used to add the completion status information of the target client for the newly added data update task to the data update table.
[0172] Further, such as Figure 8 As shown, the determining unit 75 includes:
[0173] An adding module 751 is used to add the status information and the identification information of the target client to the synchronized clients of the target data update task;
[0174] An acquisition module 752 is used to acquire online clients in a client status table;
[0175] A judging module 753 is used to judge whether the synchronized clients added by the adding module 751 include all the online clients acquired by the acquiring module 752;
[0176] The determination module 754 is used to determine the data update task as a data update task to be cancelled if the determination module 753 determines that the synchronized clients include all online clients.
[0177] Further, such as Figure 8 As shown, the determining unit 75 further includes:
[0178] The storage module 755 is used to store the data update task to be cancelled in the full update data;
[0179] The cancellation module 756 is used to cancel the data update tasks to be cancelled.
[0180] Furthermore, as a response to the above Figure 4 , Figure 5 The implementation of the method embodiment shown in the figure, the embodiment of the present invention provides a data synchronization device, which is applied to the client and is used to interact with the server to complete the data synchronization between the client and the server. The embodiment of the device corresponds to the aforementioned method embodiment. For the convenience of reading, this embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the device in this embodiment can correspond to all the contents of the aforementioned method embodiment. Specifically, Fig. 9 As shown, the device comprises:
[0181] A first sending unit 91 is used to send a data synchronization request to a server within a preset period;
[0182] A receiving unit 92 is used to receive the data to be synchronized fed back by the server, where the data to be synchronized includes full update data or target data update tasks;
[0183] A synchronization unit 93, configured to synchronize the data to be synchronized received by the receiving unit 92 to a local database;
[0184] The second sending unit 94 is used to send status information of the completed target data update task to the server when the data to be synchronized is a target data update task.
[0185] Further, such as Fig.10As shown, the device further includes a modification unit 95, which specifically includes:
[0186] A sending module 951 is used to send a data modification request to a server;
[0187] An acquisition module 952 is used to acquire a notification sent by the server indicating whether the data can be modified according to the data modification request sent by the sending module 951;
[0188] The sending module 951 is also used to, if the obtaining module 952 obtains a notification that the modification is not allowed, execute the data modification request to the server again after a preset time period;
[0189] The synchronization module 953 is used to synchronize the data to be modified to the local database and send the completion status information to the server if the acquisition module 952 obtains a notification that the data can be modified.
[0190] Furthermore, an embodiment of the present invention also provides a computing device, the computing device comprising: at least one processor, and a memory, wherein the memory stores instructions executable by the processor, the instructions are executed by the processor, so that the processor can perform the above-mentioned Figure 1-5 The data synchronization method described in .
[0191] Furthermore, an embodiment of the present invention further provides a readable storage medium, wherein the readable storage medium is used to store a computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the above Figure 1-5 The data synchronization method described in .
[0192] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0193] It is understandable that the related features in the above methods and devices can be referenced to each other. In addition, the "first", "second" and the like in the above embodiments are used to distinguish the embodiments, but do not represent the advantages and disadvantages of the embodiments.
[0194] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0195] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific languages is for disclosing the best mode of the present invention.
[0196] In addition, the memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0197] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0198] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0199] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0200] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0201] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0202] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0203] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0204] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0205] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0206] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A data synchronization method, characterized in that: Applied to a server, the method comprises: According to the data synchronization request of the target client, determining whether the target client is a newly online client; If yes, then feeding back full update data to the target client, the full update data being a data set of updated data stored in each client; If not, feeding back the target data update task to the target client according to the data update table, wherein the data update table is used to maintain the newly added data update tasks of each client; Receiving status information of the target data update task having been completed, sent by the target client; The data update task to be cancelled in the data update table is determined according to the status information.
2. The method according to claim 1, characterized in that: Feedback of the target data update task to the target client according to the data update table includes: Query the synchronized clients corresponding to each data update task in the data update table; Determining whether the synchronized clients include the target client; Determine the data update task that does not include the target client as an unfinished data update task; determine the unfinished data update task as the target data update task; Feedback the target data update task to the target client.
3. The method according to claim 1, characterized in that The method further comprises: Receive a data modification request from a target client; Determine whether the data modification request is approved according to the data update table; If not, a prompt indicating that the modification is not allowed is fed back to the target client; If approved, a prompt indicating that the modification is possible is fed back to the target client, and the data is updated based on the data modification request.
4. A data synchronization method, characterized in that: Applied to a client, the method comprises: Sending data synchronization requests to the server within a preset period; Receiving the data to be synchronized fed back by the server, wherein the data to be synchronized includes full update data or target data update tasks; Synchronize the data to be synchronized into the local database; When the data to be synchronized is the target data update task, status information indicating that the target data update task has been completed is sent to the server.
5. The method according to claim 4, characterized in that The method further comprises: Sending a data modification request to the server; Obtaining, according to the data modification request, a notification sent by the server indicating whether the data can be modified; If the modification is not possible, the data modification request is sent to the server again after a preset time period; If it can be modified, the data to be modified is synchronized to the local database, and completion status information is sent to the server.
6. A data synchronization device, characterized in that: Applied to a server, the device comprises: A judging unit, configured to judge whether the target client is a new online client according to a data synchronization request of the target client; A first feedback unit, configured to feed back full update data to the target client if the determination unit determines that the target client is a newly online client, wherein the full update data is a data set of updated data of each client stored; A second feedback unit is configured to feedback a target data update task to the target client according to a data update table if the determination unit determines that the target client is not a newly-connected client, wherein the data update table is used to maintain newly-added data update tasks for each client; A receiving unit, configured to receive status information of the target data update task having been completed, sent by the target client; A determination unit is used to determine the data update task to be cancelled in the data update table according to the status information received by the receiving unit.
7. A data synchronization device, characterized in that: Applied to a client, the device comprises: A first sending unit, used to send a data synchronization request to a server within a preset period; A receiving unit, configured to receive the data to be synchronized fed back by the server, wherein the data to be synchronized includes full update data or target data update tasks; A synchronization unit, used for synchronizing the data to be synchronized received by the receiving unit into a local database; The second sending unit is used to send status information of completing the target data update task to the server when the data to be synchronized is the target data update task.
8. A data synchronization system, characterized in that: The system includes a server and a client; The server is used to send update data to the client according to the data synchronization request sent by the client, and maintain the data update task in the data update table, and the server is used to execute the data synchronization method of claims 1-3 above; The client is used to send a data synchronization request to the server and synchronize the received updated data to the local database. The client is used to execute the data synchronization method of claims 4-5 above.
9. A computing device, characterized in that The computing device includes: at least one processor, and a memory, wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor, so that the processor can execute a data synchronization method as described in any one of claims 1-5.
10. A readable storage medium, characterized in that: The readable storage medium is used to store a computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute a data synchronization method as described in any one of claims 1 to 5.
