Secure multi-party data synchronization preprocessing method and system based on heap structure
Through the secure multi-party data synchronization preprocessing method based on the heap structure, the existing multi-party data fusion method is solved, and the security, effective fusion and synchronization of multi-party data is achieved, which is suitable for data fusion scenarios that are more than two parties.
Patent Information
- Application Number
- CN202310340844.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2043-03-31
AI Technical Summary
The existing multi-party data fusion methods are complex, have low operating efficiency, and are difficult to effectively process more than two-party data fusion, and are costly and are not suitable for practical applications.
The secure multi-party data synchronization preprocessing method based on the heap structure is adopted to realize the fusion and synchronization of multi-party data through local sorting, minimum heap construction and update, and ensure data privacy using a secure multi-party computing protocol based on the millionaire problem.
It greatly reduces the complexity of multi-party data fusion, improves operation efficiency, realizes secure synchronization of data, and is suitable for data fusion scenarios with more than two parties, with a low cost.
Smart Images

Figure CN116450737B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure belongs to the field of computer technology, and in particular, relates to a secure multi-party data synchronization preprocessing method and system based on a heap structure. Background Art
[0002] The statements in this section merely provide background information related to the present disclosure and do not necessarily constitute prior art.
[0003] Multi-party data fusion is a technical issue that many commercial companies, enterprises and institutions are currently paying close attention to. It achieves data synchronization through a multi-party secure computing protocol, allowing different data holders to have all data samples from all parties, but without exposing the specific information of any party's data. For example: multiple hospitals jointly use their own case information for more accurate diagnosis; multiple financial institutions jointly use their own credit records to discover potential financial risks, etc. Because in multi-party data fusion, all data holders do not want to expose their data privacy, that is, user-level privacy needs to be strictly protected. In addition, multi-party data fusion can improve the quality of future data analysis-based models or the depth of problem mining.
[0004] The inventors have found that the existing multi-party data fusion method has the following disadvantages:
[0005] Most existing technologies are implemented using complex technologies such as oblivious transfer, which are complex to implement and have low operating efficiency in practice. Secondly, although existing technologies are feasible for only finding the intersection of two parties, in practice, multi-party data fusion involves more than just two parties. In most cases, more than two companies are involved in data fusion and hope to find the union of multiple data. At the same time, when existing technologies are used for multi-party fusion, the solution is very complex and requires multiple calls to the two-party data fusion algorithm, which is costly and not conducive to practical applications. Summary of the invention
[0006] In order to solve the above problems, the present disclosure provides a secure multi-party data synchronization preprocessing method and system based on a heap structure. The scheme greatly reduces the complexity of multi-party data fusion by using a secure multi-party computing size comparison protocol based on the millionaire's problem and a data merging strategy. At the same time, the scheme can achieve the final effect of data fusion, so that the data is arranged according to the identification size and strictly meets the data security requirements.
[0007] According to a first aspect of an embodiment of the present disclosure, a secure multi-party data synchronization preprocessing method based on a heap structure is provided, which is applied to multi-party data fusion between several data terminals, including:
[0008] For each data end, the data is sorted locally according to the size of its local data identifier to obtain a local data list;
[0009] For each data end, define a position pointer pointing to the first element identifier of the local data list, and construct a final data synchronization list, wherein the final data synchronization list is initially an empty list;
[0010] Construct a minimum heap based on the identifiers pointed to by the location pointers of each data end;
[0011] By traversing the local data lists in each data terminal, the minimum heap and the final data synchronization list are updated cyclically until the local data lists in each data terminal are traversed to the end, and the loop ends;
[0012] The final data synchronization list of each terminal is obtained as the fusion result of multi-party data;
[0013] Among them, the loop updates the minimum heap and the final data synchronization list, specifically: obtain the minimum element in the minimum heap structure, and add the data corresponding to the minimum element identifier to the end of the final data synchronization list of the data end corresponding to the identifier; update the position pointer of the data end corresponding to the minimum element identifier to point to the next position; delete the current minimum element in the minimum heap, and add the identifier pointed to by the position pointer of the data end corresponding to the current minimum element identifier to realize the update of the minimum heap; if the minimum element identifier of the minimum heap after the update is equal to the previously deleted minimum element, re-execute the next round of loop, if not equal, add random data to the end of the final data synchronization list of the data end to which data has not been added in this round of loop.
[0014] Furthermore, during the initialization of the minimum heap, each data end does not need to store the complete minimum heap, but only needs to store the parent node and child node pointed to by its own current position pointer and identified in the minimum heap;
[0015] or,
[0016] During the initialization process of the minimum heap, each data end maintains a complete minimum heap.
[0017] Furthermore, the current minimum element is deleted from the minimum heap, and the identifier pointed to by the data end position pointer corresponding to the current minimum element identifier is added, specifically: the identifier corresponding to the minimum element node in the minimum heap is directly updated to the newly added identifier, and the heap is updated to make it a minimum heap.
[0018] Furthermore, the updating of the heap to make it a minimum heap is specifically as follows:
[0019] Step 1: If the updated node has a parent node, the updated node and the data end corresponding to its parent node compare the size interactively; if the updated node is larger, proceed to step 2; if the updated node is smaller, swap this node with the parent node, and notify the data end corresponding to the parent node to update its position, and return to step 1 to continue comparing with the parent node;
[0020] Step 2: If the updated node has child nodes, compare the sizes with the data ends corresponding to the left and right child nodes respectively; if the updated node is larger, swap this node with the child node, and notify the data end corresponding to the child node to update its position, return to step 2 and continue to compare with the child nodes; if the updated node is smaller, go to step 3.
[0021] Step 3: Notify all data terminals of their updated location.
[0022] Furthermore, during the construction and update process of the minimum heap, for each data end, the identifier pointed to by its current position pointer and the data end numbers corresponding to the parent node and child node of the identifier in the minimum heap are stored in real time.
[0023] Furthermore, when the minimum heap is updated, the corresponding data end is found based on the parent node and child node numbers stored in each data end; the identifications of different data ends are compared pairwise by number search, wherein the comparison of the pairwise identifications adopts multi-party secure computing based on the millionaire's problem.
[0024] Furthermore, the pairwise comparison of the identifiers adopts a multi-party secure computation based on the millionaire's problem, specifically:
[0025] For the first data end and the second data end corresponding to the two identifiers to be compared, the first data end encrypts its own identifier through the millionaire protocol, records it as the first encrypted identifier, and sends it to the second data end;
[0026] The second data end compares its own identifier with the received first encrypted identifier based on the Millionaire's Protocol to obtain a comparison result; encrypts its own identifier through the Millionaire's Protocol to obtain a second encrypted identifier, and sends it to the first data end;
[0027] The first data end compares its own identifier with the received second encrypted identifier based on the Millionaire's Protocol to obtain a comparison result.
[0028] According to a second aspect of an embodiment of the present disclosure, a secure multi-party data synchronization preprocessing system based on a heap structure is provided, which is applied to multi-party data fusion between several data terminals, including:
[0029] A local sorting unit, which is used to sort the data locally for each data end according to the size of its local data identifier to obtain a local data list;
[0030] A final data synchronization list initialization unit, which is used to define, for each data end, a position pointer pointing to the first element identifier of the local data list, and construct a final data synchronization list, wherein the final data synchronization list is initially an empty list;
[0031] A minimum heap construction unit, which is used to construct a minimum heap based on the identifier pointed to by the position pointer of each data end;
[0032] A multi-party data fusion unit is used to traverse the local data lists in each data terminal, cyclically update the minimum heap and the final data synchronization list, until the local data lists in each data terminal are traversed to the end, and the loop is terminated; the final data synchronization list of each terminal is obtained as the fusion result of the multi-party data;
[0033] Among them, the loop updates the minimum heap and the final data synchronization list, specifically: obtain the minimum element in the minimum heap structure, and add the data corresponding to the minimum element identifier to the end of the final data synchronization list of the data end corresponding to the identifier; update the position pointer of the data end corresponding to the minimum element identifier to point to the next position; delete the current minimum element in the minimum heap, and add the identifier pointed to by the position pointer of the data end corresponding to the current minimum element identifier to realize the update of the minimum heap; if the minimum element identifier of the minimum heap after the update is equal to the previously deleted minimum element, re-execute the next round of loop, if not equal, add random data to the end of the final data synchronization list of the data end to which data has not been added in this round of loop.
[0034] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising a memory, a processor, and a computer program stored and running on the memory, wherein when the processor executes the program, the heap-structure-based secure multi-party data synchronization preprocessing method is implemented.
[0035] According to a fourth aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the heap-structure-based secure multi-party data synchronization preprocessing method is implemented.
[0036] Compared with the prior art, the beneficial effects of the present invention are:
[0037] (1) The present disclosure provides a secure multi-party data synchronization preprocessing method and system based on a heap structure. The scheme greatly reduces the complexity of multi-party data fusion by using a secure multi-party computing size comparison protocol based on the millionaire's problem and a data merging strategy. At the same time, the scheme can achieve the final effect of data fusion, so that the data is arranged according to the identification size and strictly meets the data security requirements.
[0038] (2) The solution disclosed in the present invention can be applied to the situation of multi-party data fusion. It is no longer a method of fusing and merging two data at a time. It is also not complicated and costly, and is easy to promote and apply.
[0039] Advantages of additional aspects of the present disclosure will be given in part in the following description and in part will become apparent from the following description or will be learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings constituting a part of the present disclosure are used to provide a further understanding of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure.
[0041] Figure 1 This is a schematic diagram of a multi-party data fusion case described in an embodiment of the present disclosure;
[0042] Figure 2 A schematic diagram of the initialization process of the minimum heap described in an embodiment of the present disclosure;
[0043] Figure 3 This is an overall flow chart of the heap-structure-based secure multi-party data synchronization preprocessing method described in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0044] The present disclosure is further described below in conjunction with the accompanying drawings and embodiments.
[0045] It should be noted that the following detailed descriptions are all illustrative and are intended to provide further explanation of the present disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present disclosure belongs.
[0046] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present disclosure. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0047] In the absence of conflict, the embodiments in the present disclosure and the features in the embodiments may be combined with each other.
[0048] Terminology explanation:
[0049] Multi-party secure computing: refers to the situation where multiple parties each hold a portion of data and interact to calculate an agreed function through a secure communication protocol without a trusted third party. The entire communication protocol needs to meet the following conditions:
[0050] 1. After the secure communication protocol ends, all parties involved in the protocol can obtain the function value calculated in the protocol;
[0051] 2. During the entire process of the secure communication protocol and after its conclusion, all parties involved in the protocol cannot obtain any information about any other party’s data.
[0052] Minimum heap: A minimum heap is a sorted complete binary tree in which the data value of any node is no greater than the values of its left and right child nodes. The minimum heap of the solution disclosed in the present invention does not record the real data value, but the number of the data end. The size comparison uses the identification comparison of each data end, and the comparison process uses a secure calculation based on the millionaire protocol to compare the size.
[0053] Millionaire's Problem: The Millionaire's Problem was proposed by Mr. Yao Qizhi, the only Turing Award winner in the Chinese world, and is the source of the field of multi-party secure computing. The problem is specifically described as follows: Assuming that A and B hold data Xa and Xb respectively, it is necessary to calculate which value of Xa and Xb is larger without a trusted third party, and after the comparison, A and B both get the information of which one is larger without any information about the other party's data. There are currently many feasible secure computing solutions (RSA, obfuscated circuits, etc.) to solve the above-mentioned millionaire's problem. The solution described in the present disclosure uses the solution to this problem to complete multi-party secure comparison of sizes.
[0054] Multi-party data synchronization: refers to the use of a multi-party secure computing protocol to synchronize data when multiple parties have different data samples or different features of the same data sample. The final result of data synchronization will include data samples of all parties and the feature dimensions of all parties' data. In other words, it aims to achieve data integration and analysis across multiple data sources. The present invention uses multi-party data synchronization without a trusted third party.
[0055] Data alignment: Among multiple data holders, each data sample point has a unique serial number or identifier, and each data can be arranged according to the identifier so that data alignment can be performed before data fusion. After data fusion, each party can obtain all data, but only knows its own serial number or identifier, without exposing the serial number or identifier of any other party.
[0056] Embodiment 1:
[0057] The purpose of this embodiment is to provide a secure multi-party data synchronization preprocessing method based on a heap structure.
[0058] For ease of understanding, the technical problem to be solved by the solution described in this embodiment is firstly described by way of example:
[0059] like Figure 1 As shown, the following uses an example to illustrate the tasks that need to be completed by multi-party (taking three parties as an example) data fusion. A, B, and C represent different three-party data terminals, key_1 to key_9 are the identifiers (keys) of the data held by each terminal, dataXX is the data corresponding to the different identifiers of each terminal, and "*" is the identifier data that each terminal cannot recognize. In the example below, before data synchronization and fusion, A holds the identifiers key_1, key_2, key_6, key_7, and key_9, as well as the corresponding data; B holds the identifiers key_2, key_3, key_5, key_8, and key_9, as well as the corresponding data; C holds the identifiers key_2, key_4, key_7, key_8, and key_9, as well as the corresponding data. Finally, through the multi-party data synchronization and fusion protocol, terminal A holds all 9 data, but only knows the key corresponding to its original data, and the identifiers of the remaining non-original data are random garbled codes or random strings. Similarly, all other parties also hold all 9 data, and only know the key corresponding to the data they hold. Those who do not have data themselves cannot obtain any information. Note that the union of the three parties’ data is 9, which means that all three parties eventually hold the union of data, but do not know the identifier of each other’s data. When each party wants to use the other party’s data later, it can initiate communication with the data holder through the Forgotten Transfer Protocol, and then obtain the data under the premise of ensuring privacy.
[0060] A secure multi-party data synchronization preprocessing method based on a heap structure, which is applied to multi-party data fusion between several data terminals, includes:
[0061] For each data end, the data is sorted locally according to the size of its local data identifier to obtain a local data list;
[0062] For each data end, define a position pointer pointing to the first element identifier of the local data list, and construct a final data synchronization list, wherein the final data synchronization list is initially an empty list;
[0063] Construct a minimum heap based on the identifiers pointed to by the location pointers of each data end;
[0064] By traversing the local data lists in each data terminal, the minimum heap and the final data synchronization list are updated cyclically until the local data lists in each data terminal are traversed to the end, and the loop ends;
[0065] The final data synchronization list of each terminal is obtained as the fusion result of multi-party data;
[0066] Among them, the loop updates the minimum heap and the final data synchronization list, specifically: obtain the minimum element in the minimum heap structure, and add the data corresponding to the minimum element identifier to the end of the final data synchronization list of the data end corresponding to the identifier; update the position pointer of the data end corresponding to the minimum element identifier to point to the next position; delete the current minimum element in the minimum heap, and add the identifier pointed to by the position pointer of the data end corresponding to the current minimum element identifier to realize the update of the minimum heap; if the minimum element identifier of the minimum heap after the update is equal to the previously deleted minimum element, re-execute the next round of loop, if not equal, add random data to the end of the final data synchronization list of the data end to which data has not been added in this round of loop.
[0067] In the specific implementation, Figure 3 As shown, the method specifically comprises the following steps:
[0068] Step 1: Multiple data terminals A1, A2, ..., Ak sort the data locally according to the size of the identifier in their respective local locations;
[0069] Among them, the local sorting in step 1 is performed according to a preset identifier. For example, in the patient information of a hospital, the patient's ID card is used as the unique identifier of each person, and the sorting is performed from small to large according to the ID card number.
[0070] Step 2: Multiple data terminals set position pointers p1, p2, ..., pk for the sorted data locally to point to the first one of their respective identifiers, that is, p1 = 1, p2 = 1, ..., pk = 1;
[0071] Step 3: Multiple data terminals initialize their local final data synchronization lists as empty lists, that is, their respective final data synchronization lists are List1, List2, …, Listk, and currently all k lists are empty lists;
[0072] Step 4: Minimum heap initialization: Multiple data terminals construct a k-element minimum heap structure according to the current identifiers pointed to by their respective position pointers;
[0073] Among them, when the minimum heap is initialized in step 4, the solution described in this embodiment uses an array to store the minimum heap. There are two solutions that can be used to initialize the heap, specifically:
[0074] Solution 1: There is no need to maintain a complete heap structure, but to store the position of each end in the heap, that is, to store its own position in the heap array, as well as its parent node and child node. The data end heap building algorithm includes the following processing steps:
[0075] (1) Interact to get the last element position, and then the position after this position is your own end (which may be recorded as x), and record your own position;
[0076] (2) Record the identifier of the data pointed to by the location pointer on its own end, move the location pointer back one position, and use the secure calculation based on the millionaire protocol to compare the size with the parent node.
[0077] i. If the parent node's identifier is smaller, the front end completes initializing the minimum heap and sends its own position to all other data ends;
[0078] ii. If the parent node's identifier is greater, the node on its own side swaps positions with the parent node, and all nodes are notified: the data end corresponding to the original parent node is updated to position x. The node's own position is updated to the parent node position, and the process continues with step (2);
[0079] (3) After the location is updated, all data terminals are notified of the location;
[0080] (4) The next data end continues with step 1. If all data ends are initialized, the minimum heap is completed and the algorithm ends.
[0081] It should be noted that the above solution does not require each data end to store the complete heap, but only needs to store the data end number of the parent node and child node of the corresponding node. Figure 2 The figure shows a process of initializing a minimum heap using this algorithm; at the beginning, only two data ends are added to the minimum heap, one with data identifier 5 and the other with data identifier 6; when a third party joins, it first adds a new element at the end and records its own position and the identifier pointed to by the current pointer (shown as 2 in this example); after comparing the size with the parent node, it finds that its own identifier is smaller, so the node positions are exchanged, and since there is no parent node, it is no longer compared upward.
[0082] Solution 2: All data terminals maintain their own minimum heap. Since the number of data terminals is a constant that is not very large, maintaining the entire minimum heap will not have a large space complexity. The algorithm is: each data terminal establishes an array of length k (k is the number of data terminals), and the identifiers recorded in the array are uniformly set to an identifier that is smaller than all identifiers. For example, when the identifier is a natural number, it can be set to 0; when the ID number is used as the identifier, it can be set to -1.
[0083] Step 5: According to the data in each terminal, the minimum heap and the final data synchronization list are updated in a loop (see step 7 for the loop termination condition):
[0084] (1) Check the smallest element in the minimum heap structure, and add the data end corresponding to the smallest element identifier (let's assume x) to the end of the Listx list;
[0085] (2) Update the position pointer px of x to point to the next position of its local data;
[0086] (3) In the minimum heap structure, delete the smallest element, increase the identifier pointed to by the identifier pointer of the data end x, and update the minimum heap; among them, in the minimum heap deletion and addition operation, since the above algorithm immediately adds a new element after deleting an element, the algorithm for combining deletion and addition of elements here is: update the identifier corresponding to the minimum element node in the minimum heap to the newly added identifier, and then update the heap to make it a minimum heap.
[0087] (4) If the minimum element of the updated minimum heap is equal to the previously deleted minimum element, continue with step i;
[0088] (5) If the minimum element of the updated minimum heap is not equal to the previously deleted minimum element, the data end that did not add data entries in this round of the inner loop locally generates a random data entry and adds it to the end of the list of each end;
[0089] Among them, the minimum heap update algorithm:
[0090] (1) If the updated node has a parent node, the updated node and the data end corresponding to its parent node interact and compare the sizes;
[0091] i. If the updated node is larger, go to step (2);
[0092] ii. If the updated node is smaller, swap this node with the parent node, notify the data end corresponding to the parent node to update its position, and return to step 1 to continue comparing with the parent node;
[0093] (2) If the updated node has child nodes, the data ends corresponding to the left and right child nodes are compared with each other in size;
[0094] i. If the updated node is larger, swap this node with the child node, notify the data end corresponding to the child node to update its position, and return to step (2) to continue comparing with the child node;
[0095] ii. If the updated node is smaller, go to step (3).
[0096] (3) Notify all data terminals of their updated location.
[0097] The comparison of the identifier size in the minimum heap uses the algorithm for comparing sizes in multi-party secure computing, which is the solution to the millionaire's problem. The following algorithm is for data end A to interact with data end B and compare the sizes of identifiers keyA and keyB:
[0098] (1) Data terminal A encrypts its own identifier keyA through the module of the Millionaire Protocol, recorded as f(keyA), and sends it to data terminal B;
[0099] (2) Data terminal B inputs its own identifier keyB and the received f(keyA) into the comparison module to determine which identifier is larger, encrypts identifier keyB to obtain f(keyB), and sends f(keyB) to data terminal A;
[0100] (3) Data terminal A inputs its own identifier keyA and the received f(keyB) into the size comparison module to determine which identifier is larger.
[0101] Step 6: When a data end has traversed to the end of the local list end, set its current flag to infinity;
[0102] Step 7: When the current flags of all lists are infinite, end the loop.
[0103] In the specific implementation, due to the need for data privacy protection, the implementation of the minimum heap structure is different from the traditional external sorting, but the algorithm idea is the same. Implementation of the minimum heap structure:
[0104] Each data end needs to maintain the identifier of the current first data and the data end number corresponding to its parent node and child node in the minimum heap;
[0105] The algorithm for updating the minimum heap (deleting the minimum element and adding a new element) needs to find the corresponding data end through the parent node and child node numbers stored in each data end in 1;
[0106] Different data terminals compare their identities in pairs by searching with numbers;
[0107] The pairwise identity comparison algorithm of the minimum heap needs to protect data privacy, so the multi-party secure computing protocol of the "Millionaire's Problem" is adopted.
[0108] Embodiment 2:
[0109] The purpose of this embodiment is to provide a secure multi-party data synchronization preprocessing system based on a heap structure.
[0110] A secure multi-party data synchronization preprocessing system based on a heap structure, which is applied to multi-party data fusion between several data terminals, including:
[0111] A local sorting unit, which is used to sort the data locally for each data end according to the size of its local data identifier to obtain a local data list;
[0112] A final data synchronization list initialization unit, which is used to define, for each data end, a position pointer pointing to the first element identifier of the local data list, and construct a final data synchronization list, wherein the final data synchronization list is initially an empty list;
[0113] A minimum heap construction unit, which is used to construct a minimum heap based on the identifier pointed to by the position pointer of each data end;
[0114] A multi-party data fusion unit is used to traverse the local data lists in each data terminal, cyclically update the minimum heap and the final data synchronization list, until the local data lists in each data terminal are traversed to the end, and the loop is terminated; the final data synchronization list of each terminal is obtained as the fusion result of the multi-party data;
[0115] Among them, the loop updates the minimum heap and the final data synchronization list, specifically: obtain the minimum element in the minimum heap structure, and add the data corresponding to the minimum element identifier to the end of the final data synchronization list of the data end corresponding to the identifier; update the position pointer of the data end corresponding to the minimum element identifier to point to the next position; delete the current minimum element in the minimum heap, and add the identifier pointed to by the position pointer of the data end corresponding to the current minimum element identifier to realize the update of the minimum heap; if the minimum element identifier of the minimum heap after the update is equal to the previously deleted minimum element, re-execute the next round of loop, if not equal, add random data to the end of the final data synchronization list of the data end to which data has not been added in this round of loop.
[0116] In further embodiments, there is also provided:
[0117] An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in Embodiment 1 is performed. For the sake of brevity, no further description is given here.
[0118] It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0119] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0120] A computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, the method described in embodiment 1 is completed.
[0121] The method in the first embodiment can be directly embodied as a hardware processor, or a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
[0122] Those skilled in the art will appreciate that the units, i.e., algorithm steps, of the various examples described in the present embodiment can be implemented in electronic hardware or in a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this disclosure.
[0123] The heap-structure-based secure multi-party data synchronization preprocessing method and system provided in the above embodiment can be implemented and have broad application prospects.
[0124] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A secure multi-party data synchronization preprocessing method based on heap structure, It is characterized in that It is used for multi-party data fusion between several data terminals, including: For each data end, the data is sorted locally according to the size of its local data identifier to obtain a local data list; For each data end, define a position pointer pointing to the first element identifier of the local data list, and construct a final data synchronization list, wherein the final data synchronization list is initially an empty list; Construct a minimum heap based on the identifiers pointed to by the location pointers of each data end; By traversing the local data lists in each data terminal, the minimum heap and the final data synchronization list are updated cyclically until the local data lists in each data terminal are traversed to the end, and the loop ends; The final data synchronization list of each terminal is obtained as the fusion result of multi-party data; Among them, the loop updates the minimum heap and the final data synchronization list, specifically: obtain the minimum element in the minimum heap structure, and add the data corresponding to the minimum element identifier to the end of the final data synchronization list of the data end corresponding to the identifier; update the position pointer of the data end corresponding to the minimum element identifier to point to the next position; delete the current minimum element in the minimum heap, and add the identifier pointed to by the position pointer of the data end corresponding to the current minimum element identifier to realize the update of the minimum heap; if the minimum element identifier of the minimum heap after the update is equal to the previously deleted minimum element, re-execute the next round of loop, if not equal, add random data to the end of the final data synchronization list of the data end to which data has not been added in this round of loop.
2. A secure multi-party data synchronization preprocessing method based on a heap structure as claimed in claim 1, It is characterized in that During the initialization of the minimum heap, each data end does not need to store the complete minimum heap, but only needs to store the parent node and child node pointed to by its own current position pointer and marked in the minimum heap; or, During the initialization process of the minimum heap, each data end maintains a complete minimum heap.
3. A secure multi-party data synchronization preprocessing method based on a heap structure as claimed in claim 1, It is characterized in that The method of deleting the current minimum element in the minimum heap and adding the identifier pointed to by the data end position pointer corresponding to the current minimum element identifier is specifically: directly updating the identifier corresponding to the minimum element node in the minimum heap to the newly added identifier, and updating this heap to make it a minimum heap.
4. A secure multi-party data synchronization preprocessing method based on a heap structure as claimed in claim 3, It is characterized in that The updating of this heap to make it a minimum heap is specifically as follows: Step 1: If the updated node has a parent node, the updated node and the data end corresponding to its parent node compare the size interactively; if the updated node is larger, proceed to step 2; if the updated node is smaller, swap this node with the parent node, and notify the data end corresponding to the parent node to update its position, and return to step 1 to continue comparing with the parent node; Step 2: If the updated node has child nodes, compare the size with the data ends corresponding to the left child node and the right child node respectively; if the updated node is larger, swap this node with the child node, and notify the data end corresponding to the child node to update its position, return to step 2 and continue to compare with the child node; if the updated node is smaller, go to step 3; Step 3: Notify all data terminals of their updated location.
5. A secure multi-party data synchronization preprocessing method based on a heap structure as claimed in claim 1, It is characterized in that During the construction and update process of the minimum heap, for each data end, the identifier pointed to by its current position pointer and the data end numbers corresponding to the parent node and child node of the identifier in the minimum heap are stored in real time.
6. A secure multi-party data synchronization preprocessing method based on a heap structure as claimed in claim 1, It is characterized in that When the minimum heap is updated, the corresponding data end is found based on the parent node and child node numbers stored in each data end; the identifications of different data ends are compared pairwise by number search, wherein the comparison of the pairwise identifications adopts multi-party secure computing based on the millionaire's problem.
7. A secure multi-party data synchronization preprocessing method based on a heap structure as claimed in claim 6, It is characterized in that The pairwise comparison of the identifiers adopts a multi-party secure computation based on the millionaire's problem, specifically: For the first data end and the second data end corresponding to the two identifiers to be compared, the first data end encrypts its own identifier through the millionaire protocol, records it as the first encrypted identifier, and sends it to the second data end; The second data end compares its own identifier with the received first encrypted identifier based on the Millionaire's Protocol to obtain a comparison result; encrypts its own identifier through the Millionaire's Protocol to obtain a second encrypted identifier, and sends it to the first data end; The first data end compares its own identifier with the received second encrypted identifier based on the Millionaire's Protocol to obtain a comparison result.
8. A secure multi-party data synchronization preprocessing system based on heap structure, It is characterized in that It is used for multi-party data fusion between several data terminals, including: A local sorting unit, which is used to sort the data locally for each data end according to the size of its local data identifier to obtain a local data list; A final data synchronization list initialization unit, which is used to define, for each data end, a position pointer pointing to the first element identifier of the local data list, and construct a final data synchronization list, wherein the final data synchronization list is initially an empty list; A minimum heap construction unit, which is used to construct a minimum heap based on the identifier pointed to by the position pointer of each data end; A multi-party data fusion unit is used to traverse the local data lists in each data terminal, cyclically update the minimum heap and the final data synchronization list, until the local data lists in each data terminal are traversed to the end, and the loop is terminated; the final data synchronization list of each terminal is obtained as the fusion result of the multi-party data; Among them, the loop updates the minimum heap and the final data synchronization list, specifically: obtain the minimum element in the minimum heap structure, and add the data corresponding to the minimum element identifier to the end of the final data synchronization list of the data end corresponding to the identifier; update the position pointer of the data end corresponding to the minimum element identifier to point to the next position; delete the current minimum element in the minimum heap, and add the identifier pointed to by the position pointer of the data end corresponding to the current minimum element identifier to realize the update of the minimum heap; if the minimum element identifier of the minimum heap after the update is equal to the previously deleted minimum element, re-execute the next round of loop, if not equal, add random data to the end of the final data synchronization list of the data end to which data has not been added in this round of loop.
9. An electronic device comprising a memory, a processor and a computer program stored and executed on the memory, It is characterized in that When the processor executes the program, the secure multi-party data synchronization preprocessing method based on a heap structure is implemented as described in any one of claims 1-7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, it implements a secure multi-party data synchronization preprocessing method based on a heap structure as described in any one of claims 1-7.
Citation Information
Patent Citations
Multi-party data fusion method and device
CN111832034A
Methods, devices and systems for a distributed coordination engine-based exchange that implements a blockchain distributed ledger
CN112424810A