A data processing method, device, electronic equipment and storage medium
By dividing the dataset into shared and non-shared datasets and performing privacy-preserving intersection comparisons when preset conditions are met, the problem of long data synchronization time is solved, and efficient and timely data updates and synchronization are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING QIYI CENTURY SCI & TECH CO LTD
- Filing Date
- 2023-01-20
- Publication Date
- 2026-04-21
AI Technical Summary
During data synchronization, existing technologies often involve large datasets on both sides, resulting in time-consuming privacy-preserving intersection processes that are difficult to update in a timely manner.
The dataset is divided into jointly owned datasets and non-jointly owned datasets. Comparisons are performed using a privacy-preserving intersection method, and data updates are only performed when preset conditions are met, prioritizing the processing of certain data.
It significantly improves data processing efficiency, enables timely updates and accurate synchronization of datasets, and meets the system requirements for real-time intersection.
Smart Images

Figure CN115982192B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a data processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] Nowadays, in order to ensure the synchronization of data between business partners, it is necessary to update the data stored on one side in a timely manner and also update the data of the other side in a timely manner when the dataset of one side changes. Since the data change time of one side is uncontrollable, it is also difficult to align the data change times of both sides. In this process, it is necessary to achieve real-time updates of data of both sides based on privacy intersection method, so as to ensure data privacy while ensuring the synchronization of data between the two sides.
[0003] Generally, the changed data is referred to as the data to be compared. In the privacy intersection process, each piece of data to be compared needs to be processed separately using the keys of both parties. Only after processing using both parties' keys can the data be compared. This is essentially a privacy intersection process, where each changed piece of data is compared with the data stored on the other end. In existing technologies, both parties store their data in a single dataset, which is typically quite large. Therefore, when one party's dataset changes, all the changed data needs to be compared separately with all the data in the other party's dataset, resulting in significant time consumption. This leads to a lengthy privacy intersection process, preventing either party from updating its data in a timely manner. Summary of the Invention
[0004] The purpose of this invention is to provide a data processing method, apparatus, electronic device, and storage medium to improve data processing efficiency and achieve timely updates to datasets. The specific technical solution is as follows:
[0005] According to a first aspect of the present invention, a data processing method is provided, applied to one end of data synchronization where the dataset has changed, and the dataset stored on this end includes jointly held datasets and non-jointly held datasets, the method comprising:
[0006] A change in local data has been detected;
[0007] Based on the changes, determine whether the changed data meets the preset conditions;
[0008] If the conditions are met, update the data in the jointly held dataset and / or non-jointly held dataset on this end.
[0009] In one possible implementation, the change is an add operation;
[0010] When the change is changed to an add operation, determining whether the changed data meets preset conditions includes:
[0011] Determine whether the added first data meets a first preset condition, wherein the first preset condition is that the first data exists in the non-co-owned dataset on this end; or, the first data does not exist in the co-owned dataset and non-co-owned dataset on this end.
[0012] When the first preset condition is met, the step of updating the data in the jointly held dataset and / or non-jointly held dataset on this end includes:
[0013] Send a comparison request for the first data to the peer; the comparison request is used to instruct the peer to compare the first data with each data in the dataset stored by the peer, and obtain result information;
[0014] In response to the result information sent by the other end, update the data in the jointly held dataset and / or non-jointly held dataset on this end.
[0015] In one possible implementation, the result information is that the first data is data jointly held by both ends;
[0016] If the first data exists in the non-co-owned dataset on this end, updating the data in the co-owned dataset and / or non-co-owned dataset on this end includes:
[0017] Add the first data to the shared dataset on this end, and delete the first data from the non-shared dataset on this end to obtain the updated dataset;
[0018] If the first data does not exist in the shared dataset and non-shared dataset on this end, updating the data in the shared dataset and / or non-shared dataset on this end includes:
[0019] Add the first data to the shared dataset on this end to obtain the updated dataset;
[0020] The result information indicates that the first data is not data jointly held by both ends;
[0021] If the first data does not exist in the shared dataset and non-shared dataset on this end, updating the data in the shared dataset and / or non-shared dataset on this end includes:
[0022] Add the first data to the non-co-owned dataset on this end to obtain the updated dataset.
[0023] In one possible implementation, the change is a deletion operation;
[0024] When the change is changed to a deletion operation, determining whether the changed data meets preset conditions includes:
[0025] Determine whether the deleted second data meets a second preset condition, wherein the second preset condition is that the second data exists in a jointly held dataset on this end; or, the second data exists in a non-jointly held dataset on this end;
[0026] When the second preset condition is met, the step of updating the data in the jointly held dataset and / or non-jointly held dataset on this end includes:
[0027] If the second data exists in the shared dataset on this end, then delete the second data directly from the shared dataset on this end to obtain the updated dataset;
[0028] If the second data exists in the non-co-owned dataset on this end, then the second data is directly deleted from the non-co-owned dataset on this end to obtain the updated dataset.
[0029] In one possible implementation, prior to the step of updating the data in the jointly held dataset and / or non-jointly held dataset on the local end when the second preset condition is met, the method further includes:
[0030] Send a comparison request for the second data to the peer;
[0031] After receiving the result information sent by the other end, the step of updating the data in the jointly held dataset and / or non-jointly held dataset of this end is then executed.
[0032] According to a second aspect of the present invention, a data processing method is provided, applied to one end of two data synchronization endpoints that receives a comparison request, and the dataset stored on this end includes jointly held datasets and non-jointly held datasets, the method comprising:
[0033] Receive a comparison request and identify the change operation and change data indicated in the comparison request;
[0034] The changed data is compared with the dataset already stored on this end to obtain the result information;
[0035] When the result information indicates that the data is jointly held by both ends, update the data in the jointly held dataset and / or non-jointly held dataset on this end;
[0036] The result information is fed back to the end that sent the comparison request.
[0037] In one possible implementation, the change operation is an add operation, and the change data is first data;
[0038] The step of comparing the changed data with the dataset already stored on the local end includes: comparing the first data with data in the non-co-owned dataset already stored on the local end;
[0039] The updating of data within the jointly held dataset and / or non-jointly held dataset on this end includes:
[0040] Add the first data to the shared dataset on this end, and delete the first data from the non-shared dataset on this end to obtain the updated dataset.
[0041] In one possible implementation, the change operation is a deletion operation, and the changed data is second data;
[0042] The step of comparing the changed data with the dataset already stored on the local end includes: comparing the second data with data in the jointly held dataset already stored on the local end;
[0043] The updating of data within the jointly held dataset and / or non-jointly held dataset on this end includes:
[0044] Delete the second data from the shared dataset on this end and add the second data to the non-shared dataset on this end to obtain the updated dataset.
[0045] According to a third aspect of the present invention, a data processing apparatus is provided, applied to one end of data synchronization where the dataset changes, and the dataset stored on this end includes jointly held datasets and non-jointly held datasets, the apparatus comprising:
[0046] The change detection module is used to detect changes in the local data.
[0047] The condition judgment module is used to determine whether the changed data meets preset conditions based on the change.
[0048] The data update module is used to update the data in the jointly held dataset and / or non-jointly held dataset on this end if the conditions are met.
[0049] In one possible implementation, the change detection module is specifically used to detect that the local data change is an add operation;
[0050] The condition judgment module includes:
[0051] The first data judgment submodule is used to determine whether the added first data meets the first preset condition when the change is to an add operation. The first preset condition is that the first data exists in the non-co-owned dataset on the local end; or, the first data does not exist in the co-owned dataset and non-co-owned dataset on the local end.
[0052] The data update module includes:
[0053] The first data comparison request sending submodule is used to send a first data comparison request to the peer when the first preset condition is met; the comparison request is used to instruct the peer to compare the first data with each data in the dataset stored by the peer to obtain result information;
[0054] The first data update submodule is used to update the data in the jointly held dataset and / or non-jointly held dataset on the local end in response to the result information sent by the peer end.
[0055] In one possible implementation, the first data update submodule is specifically used for:
[0056] If the first data exists in the non-co-owned dataset on this end, and the result information indicates that the first data is jointly owned by both ends, add the first data to the co-owned dataset on this end, and delete the first data from the non-co-owned dataset on this end to obtain the updated dataset;
[0057] If the first data does not exist in the jointly held dataset and the non-jointly held dataset on this end, and the result information indicates that the first data is jointly held by both ends, add the first data to the jointly held dataset on this end to obtain the updated dataset;
[0058] If the first data does not exist in the jointly held dataset and the non-jointly held dataset on this end, and the result information indicates that the first data is not jointly held by both ends, the first data is added to the non-jointly held dataset on this end to obtain the updated dataset.
[0059] In one possible implementation, the change detection module is specifically used to detect that the local data has been changed to a deletion operation;
[0060] The condition judgment module includes:
[0061] The second data judgment submodule is used to determine whether the deleted second data meets the second preset condition when the change is a deletion operation. The second preset condition is that the second data exists in the jointly held dataset on the local end; or, the second data exists in the non-jointly held dataset on the local end.
[0062] The data update module includes:
[0063] The second data update submodule is used to directly delete the second data from the local shared dataset if the second data exists in the local shared dataset, and obtain an updated dataset; and to directly delete the second data from the local non-shared dataset if the second data exists in the local non-shared dataset, and obtain an updated dataset.
[0064] In one possible implementation, the device further includes:
[0065] The second data comparison request sending module is used to send a second data comparison request to the other end before updating the data in the jointly held dataset and / or non-jointly held dataset of the local end when the second preset condition is met; after receiving the result information sent by the other end, the module then executes the step of updating the data in the jointly held dataset and / or non-jointly held dataset of the local end.
[0066] According to a fourth aspect of the present invention, a data processing apparatus is provided, applied to one end of two data synchronization endpoints that receives a comparison request, and the dataset stored on this end includes a jointly held dataset and a non-jointly held dataset, the apparatus comprising:
[0067] The request receiving module is used to receive a comparison request and identify the change operation and change data indicated in the comparison request.
[0068] The data comparison module is used to compare the changed data with the dataset already stored on the local end to obtain result information;
[0069] The data update module is used to update the data in the jointly held dataset and / or non-jointly held dataset of the local end when the result information indicates that the data is jointly held by both ends.
[0070] The result information sending module is used to send the result information back to the end that sent the comparison request.
[0071] In one possible implementation, the change operation is an add operation, and the change data is first data;
[0072] The data comparison module includes:
[0073] The first data comparison submodule is used to compare the first data with data in the non-co-owned dataset already stored on this end;
[0074] The data update module includes:
[0075] The first data update module is used to compare the first data with the data in the non-co-owned dataset already stored on the local end. If the result information indicates that the data is jointly owned by both ends, the first data is added to the co-owned dataset on the local end and deleted from the non-co-owned dataset on the local end to obtain the updated dataset.
[0076] In one possible implementation, the change operation is a deletion operation, and the changed data is second data;
[0077] The data comparison module includes:
[0078] The second data comparison submodule is used to compare the second data with the data in the shared dataset already stored on this end;
[0079] The data update module includes:
[0080] The second data update module is used to delete the second data from the local shared dataset and add the second data to the local non-shared dataset when the result information indicates that the data is shared by both ends after comparing the second data with the data in the local shared dataset, thereby obtaining the updated dataset.
[0081] According to a fifth aspect of the present invention, an electronic device is provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0082] Memory, used to store computer programs;
[0083] When a processor executes a program stored in memory, it implements any of the steps of the data processing method of the first aspect.
[0084] According to a sixth aspect of the present invention, an electronic device is provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0085] Memory, used to store computer programs;
[0086] When a processor executes a program stored in memory, it implements any of the steps described in the data processing method of the second aspect.
[0087] According to a seventh aspect of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when executed by a processor, the computer program implements any of the steps of the data processing method of the first aspect.
[0088] According to an eighth aspect of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when executed by a processor, the computer program implements any of the steps of the data processing method of the second aspect.
[0089] Beneficial effects of the embodiments of the present invention:
[0090] This invention provides a data processing method, apparatus, electronic device, and storage medium. The data processing method is applied to one end of a data synchronization process where the dataset has changed. The dataset stored on this end includes jointly held datasets and non-jointly held datasets. The method detects changes in the data on this end; based on the changes, it determines whether the changed data meets preset conditions; if so, it updates the data in the jointly held dataset and / or non-jointly held dataset on this end. Because the dataset is divided into jointly held and non-jointly held datasets, when updating the dataset, priority is given to processing a portion of the data on this end, and only in rare cases is it necessary to process all the data on this end. This ensures timely synchronization and updates of the data on this end while significantly improving the efficiency of data processing.
[0091] Of course, implementing any product or method of the present invention does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0092] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0093] Figure 1 This is a flowchart of the first data processing method provided in the embodiments of the present invention;
[0094] Figure 2 This is a flowchart of the second data processing method provided in the embodiments of the present invention;
[0095] Figure 3 This is a flowchart of the third data processing method provided in the embodiments of the present invention;
[0096] Figure 4 This is a flowchart of the fourth data processing method provided in the embodiments of the present invention;
[0097] Figure 5 This is a schematic diagram of the structure of the first data processing device provided in the embodiment of the present invention;
[0098] Figure 6 This is a schematic diagram of the structure of the second data processing device provided in the embodiment of the present invention;
[0099] Figure 7 This is a schematic diagram of the structure of the first electronic device provided in the embodiment of the present invention;
[0100] Figure 8 This is a schematic diagram of the structure of the second electronic device provided in the embodiment of the present invention. Detailed Implementation
[0101] The technical solutions of the present invention will now be described with reference to the accompanying drawings in the embodiments of the present invention.
[0102] Both parties involved in the business collaboration have local data storage. In this embodiment of the invention, the two parties that need to synchronize data are referred to as the two ends, and all the data held by each end is referred to as the dataset.
[0103] In this embodiment of the invention, the dataset held by each end is pre-divided into a jointly held dataset and a non-jointly held dataset. The jointly held dataset stores the intersection data of the datasets held by the two ends, which is the same data obtained by comparing the datasets held by the two ends; the non-jointly held dataset stores the non-intersection data of the datasets held by the two ends, which is the different data obtained by comparing the datasets held by the two ends.
[0104] The "comparison" in this invention is achieved through privacy-preserving intersection, which means finding the intersection of datasets held by two or more parties while protecting the privacy of all parties. Privacy-preserving intersection finds the intersection without disclosing any content or information outside the intersection. Therefore, in this invention, the process of "comparing" the data at both ends is essentially a process of comparing the data of both parties without revealing their contents.
[0105] Of course, this invention does not limit the method of obtaining the pre-stored jointly held dataset and non-jointly held datasets at both ends of the data synchronization process; any possible method can be applied to this invention. For example, the local end performing data synchronization can generate the jointly held dataset and non-jointly held dataset for the first time by performing a privacy-based intersection calculation between all data in its own dataset and all data in the other end performing data synchronization, obtaining an intersection result set. Then, the data belonging to the intersection result set of the local end is used as the local jointly held dataset, and the remaining data of the local end is used as the local non-jointly held dataset. The other end performing data synchronization generates its jointly held dataset and non-jointly held dataset in the same way. As another example, the data directly obtained from both ends jointly held can be stored as the jointly held dataset in each end, and the data directly obtained from both ends non-jointly held can be stored as the non-jointly held dataset in each end. The ends can be various types of terminals, such as desktop computers, laptops, smartphones, etc.
[0106] The two ends that need to synchronize data can be two parties engaged in business cooperation.
[0107] According to a first aspect of the embodiments of the present invention, see Figure 1 This is a flowchart of the first data processing method provided in this embodiment of the invention. This embodiment is applied to the end where the dataset changes during data synchronization. The dataset stored on this end includes jointly held datasets and non-jointly held datasets. Figure 1 The method shown specifically includes:
[0108] S110, A change in local data has been detected.
[0109] The data processing method provided in this embodiment of the invention can be implemented by a server or a user terminal, specifically a desktop computer, a laptop, a smartphone, or a smart tablet.
[0110] The two ends of the data synchronization described above can be any two ends that need to synchronize data. In one example, the two ends are two parties engaged in business cooperation.
[0111] The local database stores any data that needs to be synchronized with the other end for verification. In one example, the database might store user-related information such as the user's phone number, ID number, and device ID.
[0112] Changes to the data on this end can be the addition of one or more data items, the deletion of one or more data items, or the modification of one or more datasets. In fact, the process of "modification" is a combination of "deletion" and "addition." Modifying one piece of data means deleting one piece of data and adding one piece of data. Therefore, this application will only describe "addition" and "deletion" in detail, and will not describe "modification" in detail. The process of "modification" can be regarded as executing the "addition" process and the "deletion" process separately.
[0113] S120, Based on the change, determine whether the changed data meets the preset conditions.
[0114] If the change is adding data, then determine whether the added data meets the first preset condition; if the change is deleting data, then determine whether the deleted data meets the second preset condition; if the change is modifying data, then for the modification operation, determine whether the deleted data corresponding to the modification operation meets the second preset condition, and also determine whether the added data corresponding to the modification operation meets the first preset condition.
[0115] S130, if satisfied, then update the data in the jointly held dataset and / or non-jointly held dataset on this end.
[0116] In this embodiment of the invention, since the dataset is divided into jointly owned datasets and non-jointly owned datasets, when updating the dataset, priority is given to processing a portion of the data on the local end. Only in rare cases is it necessary to process all the data on the local end. This ensures timely and synchronized updates of the local data while significantly improving the efficiency of data processing.
[0117] In one possible implementation, see Figure 2 ,exist Figure 1 When the change in the illustrated embodiment is an add operation, Figure 1 The step S120 shown may include:
[0118] S1201, when changing to an add operation, determine whether the added first data meets the first preset condition, wherein the first preset condition is that the first data exists in the non-co-owned dataset on the local end; or, the first data does not exist in the co-owned dataset and non-co-owned dataset on the local end.
[0119] Figure 1 The step S130 shown may include:
[0120] S1301, when the first preset condition is met, a comparison request for the first data is sent to the other end; the comparison request is used to instruct the other end to compare the first data with each data in the dataset stored by the other end to obtain result information;
[0121] S1302, in response to the result information sent by the peer, update the data in the jointly held dataset and / or non-jointly held dataset of this end.
[0122] In this embodiment, the change is an add operation, and the change in the aforementioned data can be the addition of first data. This first data is determined based on the actual data changes on the local end. For example, if the local end detects that a user has added a bound mobile phone number, then "change" refers to adding the mobile phone number the user wants to bind, and the first data is the newly bound mobile phone number. Of course, in a single change, only one piece of information can be changed, such as adding a newly bound mobile phone number, or two or more pieces of information can be changed, such as adding a newly bound mobile phone number and an ID card number.
[0123] When the first preset condition is that the first data exists in a non-co-owned dataset on the local end, it indicates that the first data is different from the data found in a previous comparison with the peer end. In this case, the dataset on the peer end may have changed, and a comparison request for the first data needs to be sent to the peer end. For example, if the change is the addition of data A, and it is determined that data A exists in a non-co-owned dataset on the local end, and data A meets the first preset condition, it means that data A is different from the data found in a previous comparison with the peer end, and a comparison request for data A needs to be sent to the peer end.
[0124] When the first preset condition is that the first data does not exist in either the jointly held dataset or the non-jointly held dataset on this end, it indicates that the first data is newly added. In this case, it is necessary to compare it with the dataset on the other end to determine whether the first data is jointly held by both ends. Based on the determination result, the dataset on this end is updated. For example, if the change is the addition of data B, and it is determined that data B does not exist in either the jointly held dataset or the non-jointly held dataset on this end, it means that data B is newly added. In this case, a comparison request for data B needs to be sent to the other end.
[0125] The comparison request in this invention is actually a privacy intersection request, which compares data through privacy intersection. That is, it compares the data of both parties without disclosing the data in the datasets held by both parties.
[0126] The above result information can be that the first data is jointly held by both parties, or it can be that the first data is not jointly held by both parties. When the other party compares the first data with the data in its stored dataset, if any data is found to be the same, it indicates that the first data is jointly held by both parties; if no data is found to be the same, that is, if all data is found to be different, it indicates that the first data is not jointly held by both parties.
[0127] When the first data exists in the non-co-owned dataset on this end, and the result information indicates that the first data is jointly owned by both ends, update the data in the co-owned dataset and the non-co-owned dataset on this end.
[0128] Additionally, when the first data exists in the non-co-owned dataset on the local end, and the result information indicates that the first data is not jointly owned by both ends, the first data should be added to the non-co-owned dataset. However, since the first data already exists in the non-co-owned dataset, there is no need to update the local dataset.
[0129] If the first data does not exist in the local shared dataset and non-shared dataset, and the result information indicates that the first data is shared by both ends, then update the data in the local shared dataset.
[0130] If the first data does not exist in the jointly held dataset and the non-jointly held dataset on this end, and the result information indicates that the first data is not jointly held by both ends, update the data in the non-jointly held dataset on this end.
[0131] In addition, if the first data does not meet the first preset condition, that is, the first data exists in the shared data set on this end, it means that the first data has been compared and found to be the same. In this case, there is no need to send a comparison request to the other end, and since the first data already exists in the shared data set, there is no need to add the data to the shared data set.
[0132] In this embodiment of the invention, since the local end stores two datasets—a jointly held dataset and a non-jointly held dataset—a comparison request for the first data is only sent to the other end if the first data meets a first preset condition. In other words, data comparison is only required when the first data exists in the local non-jointly held dataset, or not in either the local jointly held or non-jointly held datasets, rather than performing a comparison every time the dataset changes, thus significantly reducing the number of comparisons. Furthermore, during the comparison process, it is not necessary to compare all data each time, thereby significantly reducing the time required for a single comparison, improving data processing efficiency, and enabling timely updates to the dataset. This invention effectively reduces data comparison time and improves efficiency, thus meeting the system requirements for real-time intersection calculations. Because it greatly saves intersection calculation time, it can support real-time data model statistics and related calculations, ensuring timely synchronization of data between the two ends.
[0133] In one possible implementation, the resulting information is that the first data is data jointly held by both ends;
[0134] If the first data exists in the non-co-owned dataset on this end, update the data in the co-owned dataset and / or non-co-owned dataset on this end, including:
[0135] Add the first data to the shared dataset on this end, and delete the first data from the non-shared dataset on this end to obtain the updated dataset;
[0136] If the first data does not exist in the shared and non-shared datasets on this end, update the data in the shared and / or non-shared datasets on this end, including:
[0137] Add the first data to the shared dataset on this end to obtain the updated dataset;
[0138] The result indicates that the first data is not data jointly held by both ends;
[0139] If the first data does not exist in the shared and non-shared datasets on this end, update the data in the shared and / or non-shared datasets on this end, including:
[0140] Add the first data to the non-co-owned dataset on this end to obtain the updated dataset.
[0141] In one example, data 'a' exists in the non-co-owned dataset on the local end, and the result information sent by the other end indicates that data 'a' is jointly owned by both ends. In this case, it means that data 'a' is the same as the data after comparison. Therefore, the update operation is to delete data 'a' from the non-co-owned dataset on the local end and add it to the jointly owned dataset on the local end.
[0142] In one example, data b does not exist in the local shared dataset and non-shared dataset, indicating that data b is new compared to the data in the local dataset. If the result information sent by the other end indicates that data b is shared by both ends, it means that data b is the same as the data found after comparison. Therefore, the update operation is to add data b to the local shared dataset.
[0143] In one example, data c does not exist in the local shared dataset and the non-shared dataset, and the result information sent by the other end is that data c is shared by both ends, indicating that data c is data that is different after comparison. Therefore, the update operation is to add data c to the local non-shared dataset.
[0144] In this embodiment of the invention, the dataset on the local end is updated in real time based on the first preset condition and result information satisfied by the first data, so as to ensure that the dataset can be updated in a timely manner and thus ensure the accuracy of the dataset.
[0145] In one possible implementation, see Figure 3 ,exist Figure 1 When the change in the illustrated embodiment is a deletion operation, Figure 1 The step S120 shown may include:
[0146] S1202, when changing to a deletion operation, determine whether the deleted second data meets the second preset condition, wherein the second preset condition is that the second data exists in the jointly held dataset of this end; or, the second data exists in the non-jointly held dataset of this end.
[0147] Figure 1 The step S130 shown may include:
[0148] S1303, when the second preset condition is met, if the second data exists in the jointly held dataset of this end, the second data is directly deleted from the jointly held dataset of this end to obtain the updated dataset; if the second data exists in the non-jointly held dataset of this end, the second data is directly deleted from the non-jointly held dataset of this end to obtain the updated dataset.
[0149] In this embodiment, the change is a deletion operation, and the change to the aforementioned data can be the deletion of second data. This second data is determined based on the actual data changes on the local end. For example, if the local end detects that a user account has been cancelled, then "change" refers to deleting the existing account that the user cancelled, and the second data is the existing account that the user wants to cancel. Of course, in a single change, only one piece of information can be changed, such as deleting an existing mobile phone number, or two or more pieces of information can be changed, such as deleting an existing mobile phone number and ID card number.
[0150] In one example, the change is the deletion of data C. Since it is data deletion, it must be deleted from the existing data on this end. Therefore, it is necessary to determine whether data C exists in the jointly held dataset or the non-jointly held dataset on this end. If it is determined that data C exists in the jointly held dataset on this end, then data C is directly deleted from the jointly held dataset on this end. If it is determined that data C exists in the non-jointly held dataset on this end, then data C is directly deleted from the jointly held dataset on this end.
[0151] In this embodiment of the invention, since the local end stores two datasets, namely a jointly held dataset and a non-jointly held dataset, by determining whether the second data exists in the jointly held dataset or the non-jointly held dataset on the local end, the second data is deleted from the dataset where the second data exists. The update operation only updates a part of the local dataset and ensures the accurate deletion of the second data, thereby ensuring timely and accurate updates to the local dataset.
[0152] In one possible implementation, before updating the data in the jointly held dataset and / or non-jointly held dataset on the local end when the second preset condition is met, the method may further include: sending a comparison request for the second data to the peer end; and after receiving the result information sent by the peer end, performing the step of updating the data in the jointly held dataset and / or non-jointly held dataset on the local end.
[0153] Regardless of whether the above result information indicates that the second data is jointly held by both parties or not, it will not affect the execution of subsequent steps.
[0154] In this embodiment, before deleting the second data, a comparison request for the second data is sent to the other end to confirm whether the second data is jointly held, and then the second data is deleted from the dataset, thereby improving the robustness of the data update process.
[0155] In addition, if the change involves modifying data, the steps corresponding to both the addition and deletion operations will be executed. For example, if the local device detects that a user has changed their bound mobile phone number, the "change" includes deleting the previously bound mobile phone number and adding the changed mobile phone number. The first data to be added is the user's newly bound mobile phone number, and the second data to be deleted is the user's previously bound mobile phone number, thereby updating the dataset stored on the local device.
[0156] According to a second aspect of the embodiments of the present invention, see Figure 4 This embodiment is applied to one end that receives a comparison request in the two ends of data synchronization, and the dataset stored on this end includes jointly held datasets and non-jointly held datasets. The data processing method provided in this embodiment can be executed by a server or a user terminal, specifically a desktop computer, a laptop, a smartphone, or a smart tablet.
[0157] Figure 4 The method shown may specifically include:
[0158] S410 receives a comparison request and identifies the change operation and change data indicated in the comparison request.
[0159] A comparison request can originate from the end where the data change occurred. The change operation in the request can be a deletion operation, with the changed data defined as the first data; or the change operation in the request can be a deletion operation, with the changed data defined as the second data, where the first data and the second data can be the same data or different data.
[0160] S420: Compare the changed data with the dataset already stored on this end to obtain the result information.
[0161] S430, when the result information indicates that the data is jointly held by both ends, update the data in the jointly held dataset and / or non-jointly held dataset on this end.
[0162] S440 sends the result information back to the end that sent the comparison request.
[0163] In this embodiment of the invention, after receiving a comparison request, the changed data is compared with the dataset already stored on the local end, and the result information is fed back to the other end (the end that sent the comparison request), realizing real-time interaction of information between the two parties. This enables both parties to update their stored datasets based on the real-time feedback result information, thereby achieving real-time synchronization of the datasets.
[0164] Additionally, if the result indicates that the data is not shared by both ends, there is no need to update the data on the end that received the comparison request.
[0165] During data synchronization between the two ends, if no anomalies occur, the data stored in the jointly held datasets of both ends should be consistent. In this case, the first data can be compared only with the non-jointly held datasets of this end, and the second data can be compared only with the jointly held datasets of this end. However, if an anomaly occurs, such as an interruption in information transmission causing one end to fail to update its data, resulting in inconsistencies between the datasets of the two ends, then either the first or second data can be compared with the jointly held and non-jointly held datasets already stored on this end to ensure the accuracy of the comparison results.
[0166] In one possible implementation, the change operation is an add operation, and the changed data is the first data; the above comparison of the changed data with the dataset already stored on the local end includes: comparing the first data with data in the non-co-owned dataset already stored on the local end;
[0167] The above updates to data within jointly owned datasets and / or non-jointly owned datasets on this end include:
[0168] Add the first data to the shared dataset on this end, and delete the first data from the non-shared dataset on this end to obtain the updated dataset.
[0169] In this embodiment of the invention, when the first data is compared with the data in the non-co-owned dataset already stored on the local end, and the result information indicates that it is data co-owned by both ends, the co-owned dataset and the non-co-owned dataset on the local end are updated in a timely manner, which will not cause data redundancy and thus ensure the accuracy of the dataset.
[0170] In one possible implementation, the change operation is a deletion operation, and the changed data is the second data; the comparison of the changed data with the dataset already stored on the local end includes: comparing the second data with the data in the jointly held dataset already stored on the local end;
[0171] The above updates to data within jointly owned datasets and / or non-jointly owned datasets on this end include:
[0172] Delete the second data from the shared dataset on this end and add the second data to the non-shared dataset on this end to obtain the updated dataset.
[0173] In this embodiment of the invention, when the second data is compared with the data in the jointly held dataset already stored on the local end, and the result information indicates that it is data jointly held by both ends, the second data will be deleted on the other end. Therefore, data that is not jointly held by both ends is promptly deleted from the jointly held dataset and added to the non-jointly held dataset, ensuring timely updates to the jointly held dataset and the non-jointly held dataset on the local end, thereby ensuring the accuracy of the dataset data.
[0174] In the process of cooperation between two or more parties, the data in the dataset in this invention can be user information. The jointly held data in the dataset can represent users jointly owned by the two or more cooperating parties, while the non-jointly held data in the dataset can represent users owned by one party in the cooperation. Because of the clear distinction between joint users and single users, any party in the cooperation can share the single user information in the non-jointly held dataset with other parties in the cooperation, or recommend the business of the cooperating party to users based on business cooperation, so that users can understand the business of the cooperating party to solve their own business needs. At the same time, the cooperating party can also gain more new users, thereby achieving a win-win situation for all parties.
[0175] The following is a specific example to illustrate the data processing process:
[0176] This invention first splits the dataset stored in a single dataset BlockA into two datasets, BlockM and BlockP. BlockM stores the identical data obtained after comparing the two datasets, while BlockP stores the dissimilar data obtained after comparing the two datasets, which is the data obtained by removing BlockM from BlockA. The total amount of data in BlockM and BlockP is the sum of all datasets on this end, that is, the total amount of the original dataset BlockA.
[0177] Upon detecting a change in local data (where the local end is the only end where the data has changed), when it is detected that data M needs to be added, it first determines whether data M meets a first preset condition: either data M exists within Block M, or data M does not exist within either Block M or Block P. If data M exists within Block M, or if data M does not exist within either Block M or Block P, a comparison request for data M is sent to the remote end.
[0178] If data M exists in Block P on this end, and the received result information indicates that data M is jointly held by both ends, then data M is added to Block M and deleted from Block P.
[0179] If data M does not exist in Block M and Block P, and the received result information indicates that data M is jointly held by both ends, then data M is added to Block M.
[0180] If data M does not exist in Block M and Block P, and the received result information indicates that data M is not jointly held by both ends, then data M is added to Block P.
[0181] In addition, if data M exists within BlockP and the result information indicates that data M is not jointly held by both ends, then there is no need to update the dataset.
[0182] The remote end, receiving the comparison request, first splits the dataset stored in a single dataset, peer BlockA, into two datasets, peer BlockM and peer BlockP. Peer BlockM stores the identical data obtained after comparing the two datasets, while peer BlockP stores the dissimilar data obtained after comparing the two datasets—that is, the data obtained by removing peer BlockM from peer BlockA. The total amount of data in peer BlockM and peer BlockP is the sum of all datasets on this end, i.e., the total amount of the original dataset, peer BlockA.
[0183] After receiving a comparison request to add data M, the remote end compares data M with the data in peer Block P and obtains the result information. If the result information indicates that data M is shared by both ends, then data M is added to peer Block M and removed from peer Block P, and the result information is fed back to the end that sent the comparison request.
[0184] If a change to local data is detected, and data M needs to be deleted, the system determines whether data M exists in Block M or Block P. If data M exists in Block M, it is removed from Block M; if data M exists in Block P, it is removed from Block P. Alternatively, when data M needs to be deleted, a comparison request to delete data M is sent to the remote end, and then data M is removed from either Block M or Block P.
[0185] After receiving a comparison request to delete data M, the remote end compares data M with the data in peer Block M. If the result indicates that data M is shared by both ends, then data M is added to peer Block P and removed from peer Block M.
[0186] In this embodiment of the invention, based on the detected changes in the dataset, both ends update their respective datasets, thereby achieving real-time synchronization of the datasets and ensuring the accuracy of the datasets.
[0187] According to a third aspect of the present invention, a data processing apparatus is provided, applied to one end of data synchronization where the dataset changes, and the dataset stored on this end includes jointly held datasets and non-jointly held datasets. See also... Figure 5 The device includes:
[0188] Change detection module 51 is used to detect changes in local data;
[0189] The condition judgment module 52 is used to determine whether the changed data meets preset conditions based on the change.
[0190] The data update module 53 is used to update the data in the jointly held dataset and / or non-jointly held dataset on the local end if the conditions are met.
[0191] In one possible implementation, the change detection module is specifically used to detect that the local data change is an add operation;
[0192] The condition judgment module includes:
[0193] The first data judgment submodule is used to determine whether the added first data meets the first preset condition when the change is to an add operation. The first preset condition is that the first data exists in the non-co-owned dataset on the local end; or, the first data does not exist in the co-owned dataset and non-co-owned dataset on the local end.
[0194] The data update module includes:
[0195] The first data comparison request sending submodule is used to send a first data comparison request to the peer when the first preset condition is met; the comparison request is used to instruct the peer to compare the first data with each data in the dataset stored by the peer to obtain result information;
[0196] The first data update submodule is used to update the data in the jointly held dataset and / or non-jointly held dataset on the local end in response to the result information sent by the peer end.
[0197] In one possible implementation, the result information includes: the first data is data jointly held by both parties or the first data is not data jointly held by both parties;
[0198] The first data update submodule is specifically used for:
[0199] If the first data exists in the non-co-owned dataset on this end, and the result information indicates that the first data is jointly owned by both ends, add the first data to the co-owned dataset on this end, and delete the first data from the non-co-owned dataset on this end to obtain the updated dataset;
[0200] If the first data does not exist in the jointly held dataset and the non-jointly held dataset on this end, and the result information indicates that the first data is jointly held by both ends, add the first data to the jointly held dataset on this end to obtain the updated dataset;
[0201] If the first data does not exist in the jointly held dataset and the non-jointly held dataset on this end, and the result information indicates that the first data is not jointly held by both ends, the first data is added to the non-jointly held dataset on this end to obtain the updated dataset.
[0202] In one possible implementation, the change detection module is specifically used to detect that the local data has been changed to a deletion operation;
[0203] The condition judgment module includes:
[0204] The second data judgment submodule is used to determine whether the deleted second data meets the second preset condition when the change is a deletion operation. The second preset condition is that the second data exists in the jointly held dataset on the local end; or, the second data exists in the non-jointly held dataset on the local end.
[0205] The data update module includes:
[0206] The second data update submodule is used to directly delete the second data from the local shared dataset if the second data exists in the local shared dataset, and obtain an updated dataset; and to directly delete the second data from the local non-shared dataset if the second data exists in the local non-shared dataset, and obtain an updated dataset.
[0207] In one possible implementation, the device further includes:
[0208] The second data comparison request sending module is used to send a second data comparison request to the other end before updating the data in the jointly held dataset and / or non-jointly held dataset of the local end when the second preset condition is met; after receiving the result information sent by the other end, the module then executes the step of updating the data in the jointly held dataset and / or non-jointly held dataset of the local end.
[0209] According to a fourth aspect of the present invention, a data processing apparatus is provided, applied to one end of two data synchronization endpoints that receives a comparison request, wherein the dataset stored at this end includes jointly held datasets and non-jointly held datasets, see [link to previous section]. Figure 6 The device includes:
[0210] The request receiving module 61 is used to receive a comparison request and identify the change operation and change data indicated in the comparison request.
[0211] The data comparison module 62 is used to compare the changed data with the dataset already stored on the local end to obtain result information;
[0212] Data update module 63 is used to update the data in the jointly held dataset and / or non-jointly held dataset of the local end when the result information indicates that the data is jointly held by both ends;
[0213] The result information sending module 64 is used to send the result information back to the end that sent the comparison request.
[0214] In one possible implementation, the change operation is an add operation, and the change data is first data;
[0215] The data comparison module includes:
[0216] The first data comparison submodule is used to compare the first data with data in the non-co-owned dataset already stored on this end;
[0217] The data update module includes:
[0218] The first data update module is used to compare the first data with the data in the non-co-owned dataset already stored on the local end. If the result information indicates that the data is jointly owned by both ends, the first data is added to the co-owned dataset on the local end and deleted from the non-co-owned dataset on the local end to obtain the updated dataset.
[0219] In one possible implementation, the change operation is a deletion operation, and the changed data is second data;
[0220] The data comparison module includes:
[0221] The second data comparison submodule is used to compare the second data with the data in the shared dataset already stored on this end;
[0222] The data update module includes:
[0223] The second data update module is used to delete the second data from the local shared dataset and add the second data to the local non-shared dataset when the result information indicates that the data is shared by both ends after comparing the second data with the data in the local shared dataset, thereby obtaining the updated dataset.
[0224] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0225] This invention also provides an electronic device, such as... Figure 7 As shown, it may include: processor 71, communication interface 72, memory 73 and communication bus 74, wherein processor 71, communication interface 72 and memory 73 communicate with each other through communication bus 74;
[0226] The memory 73 can be used to store computer programs;
[0227] The processor 71 can be used to execute the program stored in the memory 73 to implement any of the data processing methods described in the first aspect above.
[0228] This invention also provides an electronic device, such as... Figure 8 As shown, it may include: processor 81, communication interface 82, memory 83 and communication bus 84, wherein processor 81, communication interface 82 and memory 83 communicate with each other through communication bus 84;
[0229] The memory 83 can be used to store computer programs;
[0230] The processor 81 can be used to execute the program stored in the memory 83 to implement any of the data processing methods described in the second aspect above.
[0231] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not indicate that there is only one bus or one type of bus.
[0232] The communication interface is used for communication between the aforementioned terminal and other devices.
[0233] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0234] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0235] In another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements the data processing method of any of the first aspects in the above embodiments.
[0236] In another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements the data processing method of any of the second aspects of the above embodiments.
[0237] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the data processing method of any of the first aspects of the above embodiments.
[0238] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the data processing method of any of the second aspects of the above embodiments.
[0239] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0240] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0241] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0242] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A data processing method, characterized in that, The method, applied to one end of a data synchronization process where the dataset changes, and where the stored dataset includes both jointly held and non-jointly held datasets, includes: A change in local data has been detected; Based on the changes, determine whether the changed data meets the preset conditions; If satisfied, update the data in the jointly held dataset and / or non-jointly held dataset on this end; The change refers to an add operation and / or a delete operation; When the change is changed to an add operation, determining whether the changed data meets preset conditions includes: Determine whether the added first data meets a first preset condition, wherein the first preset condition is that the first data exists in the non-co-owned dataset on this end; or, the first data does not exist in the co-owned dataset and non-co-owned dataset on this end. When the change is changed to a deletion operation, determining whether the changed data meets preset conditions includes: Determine whether the deleted second data meets the second preset condition, wherein the second preset condition is that the second data exists in the jointly held dataset of this end; or, the second data exists in the non-jointly held dataset of this end.
2. The method according to claim 1, characterized in that, When the first preset condition is met, the step of updating the data in the jointly held dataset and / or non-jointly held dataset on this end includes: Send a comparison request for the first data to the peer; the comparison request is used to instruct the peer to compare the first data with each data in the dataset stored by the peer, and obtain result information; In response to the result information sent by the other end, update the data in the jointly held dataset and / or non-jointly held dataset on this end.
3. The method according to claim 2, characterized in that, The result information indicates that the first data is data jointly held by both ends; If the first data exists in the non-co-owned dataset on this end, updating the data in the co-owned dataset and / or non-co-owned dataset on this end includes: Add the first data to the shared dataset on this end, and delete the first data from the non-shared dataset on this end to obtain the updated dataset; If the first data does not exist in the shared dataset and non-shared dataset on this end, updating the data in the shared dataset and / or non-shared dataset on this end includes: Add the first data to the shared dataset on this end to obtain the updated dataset; The result information indicates that the first data is not data jointly held by both ends; If the first data does not exist in the shared dataset and non-shared dataset on this end, updating the data in the shared dataset and / or non-shared dataset on this end includes: Add the first data to the non-co-owned dataset on this end to obtain the updated dataset.
4. The method according to claim 1, characterized in that, When the second preset condition is met, the step of updating the data in the jointly held dataset and / or non-jointly held dataset on this end includes: If the second data exists in the shared dataset on this end, then delete the second data directly from the shared dataset on this end to obtain the updated dataset; If the second data exists in the non-co-owned dataset on this end, then the second data is directly deleted from the non-co-owned dataset on this end to obtain the updated dataset.
5. The method according to claim 4, characterized in that, When the second preset condition is met, before the step of updating the data in the jointly held dataset and / or non-jointly held dataset on this end, the method further includes: Send a comparison request for the second data to the peer; After receiving the result information sent by the other end, the step of updating the data in the jointly held dataset and / or non-jointly held dataset of this end is then executed.
6. A data processing method, characterized in that, The method, applied to one end of data synchronization receiving a comparison request, where the stored datasets include jointly held datasets and non-jointly held datasets, includes: Receive a comparison request and identify the change operation and change data indicated in the comparison request; The changed data is compared with the dataset already stored on this end to obtain the result information; When the result information indicates that the data is jointly held by both ends, update the data in the jointly held dataset and / or non-jointly held dataset on this end; The result information is fed back to the end that sent the comparison request; Wherein, when the change operation is an add operation, the changed data is the first data; the comparison request is sent by the end that sends the comparison request after determining that the added first data meets a first preset condition, wherein the first preset condition is that the first data exists in the non-co-owned dataset of the end that sends the comparison request; or, the first data does not exist in the co-owned dataset and non-co-owned dataset of the end that sends the comparison request. When the change operation is a deletion operation, the changed data is the second data; the comparison request is sent by the end that sends the comparison request after determining that the added second data meets the second preset condition, wherein the second preset condition is that the second data exists in the jointly held dataset of the end that sends the comparison request; or, the second data exists in the non-jointly held dataset of the end that sends the comparison request.
7. The method according to claim 6, characterized in that, The step of comparing the changed data with the dataset already stored on the local end includes: comparing the first data with data in the non-co-owned dataset already stored on the local end; The updating of data within the jointly held dataset and / or non-jointly held dataset on this end includes: Add the first data to the shared dataset on this end, and delete the first data from the non-shared dataset on this end to obtain the updated dataset.
8. The method according to claim 6, characterized in that, The step of comparing the changed data with the dataset already stored on the local end includes: comparing the second data with data in the jointly held dataset already stored on the local end; The updating of data within the jointly held dataset and / or non-jointly held dataset on this end includes: Delete the second data from the shared dataset on this end and add the second data to the non-shared dataset on this end to obtain the updated dataset.
9. A data processing apparatus, characterized in that, An apparatus for data synchronization where one end experiences a change in its dataset, and where the stored dataset includes both jointly held and non-jointly held datasets, comprising: The change detection module is used to detect changes in the local data. The condition judgment module is used to determine whether the changed data meets preset conditions based on the change. The data update module is used to update the data in the jointly held dataset and / or non-jointly held dataset on this end if the conditions are met. The change detection module is specifically used to detect data changes on the local end that are addition and / or deletion operations. The condition judgment module includes: The first data judgment submodule is used to determine, when the change is an add operation, whether the added first data meets a first preset condition, wherein the first preset condition is that the first data exists in the non-co-owned dataset on the local end; or, the first data does not exist in the co-owned dataset and non-co-owned dataset on the local end; and / or The second data judgment submodule is used to determine whether the deleted second data meets the second preset condition when the change is a deletion operation. The second preset condition is that the second data exists in the jointly held dataset of this terminal; or, the second data exists in the non-jointly held dataset of this terminal.
10. A data processing apparatus, characterized in that, The apparatus is used for data synchronization between two ends where a comparison request is received, and the dataset stored on this end includes jointly held datasets and non-jointly held datasets. The request receiving module is used to receive comparison requests and identify the change operation and change data indicated in the comparison request. The data comparison module is used to compare the changed data with the dataset already stored on the local end to obtain result information; The data update module is used to update the data in the jointly held dataset and / or non-jointly held dataset of the local end when the result information indicates that the data is jointly held by both ends. The result information sending module is used to send the result information back to the end that sent the comparison request; Wherein, when the change operation is an add operation, the changed data is the first data; the comparison request is sent by the end that sends the comparison request after determining that the added first data meets a first preset condition, the first preset condition being that the first data exists in the non-co-owned dataset of the end that sends the comparison request; or, the first data does not exist in the co-owned dataset and non-co-owned dataset of the end that sends the comparison request. When the change operation is a deletion operation, the changed data is the second data; the comparison request is sent by the end that sends the comparison request after determining that the added second data meets the second preset condition, wherein the second preset condition is that the second data exists in the jointly held dataset of the end that sends the comparison request; or, the second data exists in the non-jointly held dataset of the end that sends the comparison request.
11. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-5.
12. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 6-8.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-5.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 6-8.
Citation Information
Patent Citations
Data synchronization method and device, server and computer readable storage medium
CN109992628A
Data synchronization method and device, equipment and storage medium
CN115510161A