Secret sharing based sorting method and apparatus, electronic device, and medium
Patent Information
- Application Number
- CN202311504707.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-10
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2043-11-10
AI Technical Summary
In joint statistical analysis, existing technologies struggle to perform multi-party ranking efficiently and securely without leaking private data, especially when the encrypted comparison process is computationally intensive and involves complex steps.
A secret-sharing-based sorting method is adopted. By performing bit decomposition operations on the sample secret fragments of the participants, a secret fragment matrix is generated. Then, the secret bit vector and the anti-secret bit vector are used to determine the sorting index vector in ciphertext form, thereby realizing the sorting of sample secret fragments.
While maintaining data privacy, the efficiency and security of sorting are improved, complex encrypted comparison processes are avoided, and the accuracy and reliability of the sorting process are ensured.
Smart Images

Figure CN117453757B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a sorting method based on secret sharing, a sorting device based on secret sharing, an electronic device, and a computer-readable medium. Background Technology
[0002] Joint statistical analysis is a multi-party collaborative computing task that enables different participants to collaboratively calculate and statistically analyze comprehensive indicators among themselves without compromising local data privacy.
[0003] In joint statistical analysis, statistical functions for the privacy data of participating parties can include statistical indicators such as median, maximum, and quantile. The calculation of these statistical indicators all require pre-sorting of the privacy data of each participating party. However, the encrypted comparison process involved in the sorting algorithm is computationally intensive, complex, and time-consuming. Therefore, how to accurately, efficiently, and securely perform multi-party sorting is a problem that urgently needs to be solved in this field. Summary of the Invention
[0004] The purpose of this disclosure is to provide a secret-sharing-based sorting method, a secret-sharing-based sorting apparatus, an electronic device, and a computer-readable medium, which enables accurate, efficient, and secure sorting processing in cross-feature federated training.
[0005] According to a first aspect of this disclosure, a secret-sharing-based sorting method is provided. This method can be applied to at least two participants, each of which has a local secret fragment array containing sample secret fragments corresponding to each participant. In each participant, the method may include: performing bit decomposition on each sample secret fragment in the local secret fragment array to obtain a secret fragment matrix; traversing the secret bit vector in each column of the local secret fragment matrix to obtain the inverse secret bit vector corresponding to the secret bit vector; determining a sorting index vector in ciphertext form based on the secret bit vector and the inverse secret bit vector, the sorting index vector representing the sequence position of the secret fragment after sorting; and sorting the sample secret fragments in the participant's local secret fragment array based on the sorting index vector.
[0006] Optionally, based on the secret bit vector and the anti-secret bit vector, the sorting index vector in ciphertext form is determined, including: concatenating the secret bit vector and the anti-secret bit vector to form a first secret vector; calculating the prefix sum of the first secret vector to obtain a prefix sum vector; multiplying the prefix sum vector by the first secret vector to obtain a second secret vector; and splitting the second secret vector, adding each element and subtracting 1 to obtain the sorting index vector in ciphertext form.
[0007] Optionally, before performing bit decomposition operations on each sample secret fragment in the local secret fragment array to obtain the secret fragment matrix, the method further includes: fragmenting the local sample data based on random numbers to obtain sample secret fragments; sending the local sample secret fragments to other participants; and receiving sample secret fragments sent by other participants to obtain the local secret fragment array.
[0008] Optionally, calculating the prefix sum of the first secret vector to obtain the prefix sum vector includes: calculating the prefix sum of the first secret vector in parallel based on a binary tree to obtain the prefix sum vector.
[0009] Optionally, the prefix sum of the first secret vector is computed in parallel based on the binary tree to obtain the prefix sum vector, including: traversing the binary tree from bottom to top and then from top to bottom, computing the prefix sum in parallel at each node of the binary tree to obtain the prefix sum vector.
[0010] Optionally, the length of the secret fragment array is 2n.
[0011] Optionally, after sorting the sample secret fragments in the local secret fragment array of the participants based on the sorting index vector, the method further includes: based on the sorting result of the sample secret fragments, calling a preset statistical function to determine statistical indicators, the statistical indicators including at least one of median, quantile, maximum value, and minimum value.
[0012] According to a second aspect of this disclosure, a secret-sharing-based sorting apparatus is provided. This apparatus can be applied to at least two participants, each of which has a local secret fragment array comprising sample secret fragments corresponding to each participant. In each participant, the apparatus may include: a bit decomposition module for performing bit decomposition operations on each sample secret fragment in the local secret fragment array to obtain a secret fragment matrix; a matrix traversal module for traversing the secret bit vectors in each column of the local secret fragment matrix to obtain the anti-secret bit vectors corresponding to the secret bit vectors; an index calculation module for determining a sorting index vector in ciphertext form based on the secret bit vectors and the anti-secret bit vectors, the sorting index vector representing the sequence position of the secret fragment after sorting; and a fragment sorting module for sorting the sample secret fragments in the participant's local secret fragment array based on the sorting index vector.
[0013] Optionally, the index calculation module is specifically used to concatenate the secret bit vector and the anti-secret bit vector to form a first secret vector; calculate the prefix sum of the first secret vector to obtain a prefix sum vector; multiply the prefix sum vector by the first secret vector to obtain a second secret vector; and after splitting the second secret vector, add each element and subtract 1 to obtain a sorted index vector in ciphertext form.
[0014] Optionally, the device may further include: a fragmentation module for fragmenting local sample data based on random numbers to obtain sample secret fragments; a fragment synchronization module for sending local sample secret fragments to other participants; and a fragment synchronization module for receiving sample secret fragments sent by other participants to obtain a local array of secret fragments.
[0015] Optionally, the index calculation module is specifically used to calculate the prefix sum of the first secret vector in parallel based on the binary tree, to obtain the prefix sum vector.
[0016] Optionally, the index calculation module is specifically used to traverse the binary tree from bottom to top and then from top to bottom, calculating the prefix sum in parallel at each node of the binary tree to obtain the prefix sum vector.
[0017] Optionally, the length of the secret fragment array is 2n.
[0018] Optionally, the device may also include a statistical index module for retrieving a preset statistical function based on the sorting results of the sample secret fragments to determine statistical indexes, including at least one of median, quantile, maximum value, and minimum value.
[0019] According to a third aspect of this disclosure, an electronic device is provided, comprising: Processor; and Memory, used to store computer programs for the processor; The processor is configured to implement the secret-sharing-based sorting method of the first aspect by executing a computer program.
[0020] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the secret-sharing-based sorting method of the first aspect.
[0021] According to a fifth aspect of this disclosure, a computer program product is provided that, when run on an electronic device, causes the electronic device to perform a secret-sharing-based sorting method as described in the first aspect.
[0022] The secret-sharing-based sorting method disclosed herein involves participants obtaining a secret fragment array based on secret sharing. This array includes sample secret fragments corresponding to different participants. Each participant performs bit decomposition operations on its local sample secret fragments and iterates through the obtained secret fragment matrix to obtain the inverse secret bit vector of each column. Then, a sorting index vector in ciphertext form is determined based on the secret bit vector and the inverse secret bit vector to determine the sequence position of the sample secret fragment after sorting. This method, through secret sharing, privatizes and fragments the sample data during the sorting process. The sorting index vector can be calculated in ciphertext form without requiring complex secret comparison procedures, thus ensuring accuracy, security, and reliability in the sorting process while also improving sorting efficiency.
[0023] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0024] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0025] Figure 1 This is one of the flowcharts of a secret-sharing-based sorting method provided in an embodiment of this disclosure.
[0026] Figure 2 This is a second flowchart illustrating the steps of a secret-sharing-based sorting method provided in an embodiment of this disclosure.
[0027] Figure 3 This is a schematic diagram of the architecture of a radix sorting network based on secret sharing provided in an embodiment of this disclosure.
[0028] Figure 4 This is a schematic diagram of the first-stage parallel traversal process of a binary tree provided in an embodiment of this disclosure.
[0029] Figure 5 This is a schematic diagram of a parallelized traversal process for the second stage of a binary tree, provided as an embodiment of the present disclosure.
[0030] Figure 6 This is a structural block diagram of a secret-sharing-based sorting device provided in an embodiment of the present disclosure.
[0031] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0032] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0033] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0034] It should be noted that the data obtained in this public disclosure, including sample data, was accessed, collected, stored, and used for subsequent analysis and processing after the user or relevant data owner was clearly informed of the content of the data collection, the purpose of the data, and the processing method, and with the consent and authorization of the user or relevant data owner. Furthermore, the public can send the user or relevant data owner access, correction, and deletion of the data, as well as the method to revoke consent and authorization.
[0035] Figure 1 This is one of the flowcharts of a sorting method based on secret sharing provided in an embodiment of the present disclosure. The method can be applied to at least two parties, each party's local secret fragment array including sample secret fragments corresponding to each party.
[0036] This disclosure provides a secret-sharing-based ranking method for joint indicator statistics across feature federations. This ranking method can be applied to at least two participants to perform joint statistics on sample features from different participants. Each participant's local database includes a secret fragment array, obtained by privatizing and fragmenting local sample data and exchanging and synchronizing sample secret fragments among the participants. Each participant's secret fragment array includes sample secret fragments corresponding to each participant, enabling each participant to rank the sample secret fragments while maintaining their encrypted state.
[0037] In this embodiment of the disclosure, in each participating party, such as Figure 1 As shown, the method may include steps 101 to 104 as shown below.
[0038] Step 101: Perform bit decomposition operation on each sample secret fragment in the local secret fragment array to obtain the secret fragment matrix.
[0039] In this embodiment of the disclosure, when at least two parties perform sorting based on secret sharing, each party has a local secret fragment array. This array includes sample secret fragments corresponding to the sample data of that party, as well as sample secret fragments corresponding to the sample data of other parties. Each party can perform bit decomposition operations on each sample secret fragment in its local secret fragment array, converting the decimal sample secret fragment into a bit-shared binary representation, that is, it can... The secret fragments transformed into The secret fragments, and satisfy This allows each participant to obtain a secret fragment matrix.
[0040] Step 102: Traverse the secret bit vector of each column in the local secret fragment matrix to obtain the anti-secret bit vector corresponding to the secret bit vector.
[0041] Furthermore, each participant can iterate through the secret fragment matrix, and upon reaching the [number]th fragment... i When the bit is reached, the first bit of the secret fragment matrix can be obtained. i Columns to obtain the secret bit vector And based on the secret bit vector The secret bit vector can be obtained by inverting the bits. Corresponding anti-secret bit vector In this embodiment of the disclosure, the above traversal process is implemented in encrypted form, eliminating the need to recover the secret from plaintext.
[0042] Step 103: Based on the secret bit vector and the anti-secret bit vector, determine the sorting index vector of the ciphertext form. The sorting index vector represents the sequence position of this secret fragment after sorting.
[0043] In this embodiment, based on the secret bit vector and the anti-secret bit vector, a sorting index vector can be further calculated in the ciphertext state through secret addition and multiplication operations. This sorting index vector represents the sequence position of the secret fragment after sorting. Each participant performs the calculation of the sorting index vector in the fully ciphertext state and obtains the sorting index vector in the ciphertext state without recovering the secret bit vector. In the case of obtaining the sorted index vector in the ciphertext state This effectively improves the sorting efficiency in cross-feature federation.
[0044] Step 104: Sort the sample secret fragments in the local secret fragment array of the participants based on the sorting index vector.
[0045] In this embodiment, based on the determined sorting index vector, the sample secret fragments in the secret fragment array can be reordered according to the sorting index vector. For example, the sorting index vector can be restored to its plaintext state, and the secret fragment array can be reordered according to the included indices, so that the sample secret fragments are arranged according to the sequence positions represented by the sorting index vector. The sorting direction can be set according to actual application requirements, such as sorting from high to low or from low to high. After k sorting operations, a locally ordered set of sample secret fragments can be obtained for the participating party.
[0046] The secret-sharing-based sorting method disclosed herein involves participants obtaining a secret fragment array based on secret sharing. This array includes sample secret fragments corresponding to different participants. Each participant performs bit decomposition operations on its local sample secret fragments and iterates through the obtained secret fragment matrix to obtain the inverse secret bit vector of each column. Then, a sorting index vector in ciphertext form is determined based on the secret bit vector and the inverse secret bit vector to determine the sequence position of the sample secret fragment after sorting. This method, through secret sharing, privatizes and fragments the sample data during the sorting process. The sorting index vector can be calculated in ciphertext form without requiring complex secret comparison procedures, thus ensuring accuracy, security, and reliability in the sorting process while also improving sorting efficiency.
[0047] Figure 2 The second flowchart of a sorting method based on secret sharing provided in this disclosure embodiment is shown. The method is applied to at least two participants, and each participant's local data includes a secret fragment array, which includes sample secret fragments corresponding to each participant.
[0048] In each participating party, the method may include steps 201 to 211 as shown below.
[0049] Step 201: Fragment the local sample data based on random numbers to obtain sample secret fragments.
[0050] In this embodiment, the secret fragment array can be obtained by secretly sharing sample data from different participants, including each participant's local data and other participants outside of that participant. The participants in the cross-feature federation ranking statistics include the demand side. Provider For example, the demand side Local data includes sample data ,and Provider Local data includes sample data ,and The sample data can be stored in the form of an array, and the length of the array is n.
[0051] Based on this, the demand side With the provider Sample data can be fragmented based on random numbers, such as by participating parties. Generate random numbers and , making Participants Generate random numbers and , making .
[0052] Step 202: Send the local sample secret fragments to other participants.
[0053] Furthermore, different participants can exchange their respective sample secret fragments via communication, such as those held by the requesting party. After communicating with the provider The communication will Send to the provider The attribution of secret fragments from different samples can be determined by their superscripts.
[0054] Step 203: Receive sample secret fragments sent by other participants and obtain the local secret fragment array.
[0055] Furthermore, each participant can also receive sample secret fragments sent by other participants, such as the requester. After communicating with the provider Communication, receiving provider Sent Thus demand side The held sample secret fragments include Provider The held sample secret fragments include .
[0056] Based on the addition operation in secret sharing, each participant can perform the addition of sample secret fragments locally, such as the requesting party. Locally available Provider Locally available .
[0057] In an optional embodiment of the method disclosed herein, the length of the secret fragment array is 2n.
[0058] In this embodiment of the disclosure, the sample secret fragments may be sorted by radix sorting in the encrypted state. The sample secret fragments may be obtained by the participants through exchange. If the number of sample data in each participant's local data is n, then the length of the secret fragment array can be 2n. That is, the sorting across the feature federation involves two participants.
[0059] From the demand side For example, in the process of encrypting local sample data based on secret sharing, the local sample data can be... Encrypted as a sample secret fragment ,and ,in and All are random numbers, where j represents the current data. The j-th element in, and , Furthermore, the participating parties For all The above operations will generate a secret fragment of the sample. and Similarly, participating parties For local sample data Perform the above operation on all elements to form a sample secret fragment. and ; Based on this, each participant communicates with each other, establishes an encrypted communication channel, and exchanges local sample secret fragments with other participants, enabling the participants to... The array of secret fragments held is and Participants The array of secret fragments held is and .
[0060] By participating parties For example, the array of secret fragments held can be... and By splicing them together, a secret fragment array is formed. ,and , In This indicates that it is the element with index 0 in the plaintext data. Represents element The secret fragments of the sample were involved by the parties The fragments held.
[0061] Figure 3 This is a schematic diagram of an architecture of a radix sorting network based on secret sharing provided in an embodiment of this disclosure, such as... Figure 3 As shown, the participating parties P For the array of secret fragments held Perform bit decomposition locally to obtain , , , , , , , Constructing a secret fragment matrix; Furthermore, the secret fragment matrix is traversed using a radix sorting network to construct buckets 0 and 1, and the matrix is traversed from the column number of bit 1 to the highest bit. k The number of columns, based on a determined sorted index vector pair. Sort the data to obtain a completely ordered result. X For details, please refer to the relevant descriptions in steps 204 to 209 below.
[0062] Step 204: Perform bit decomposition operation on each sample secret fragment in the local secret fragment array to obtain the secret fragment matrix.
[0063] In this embodiment of the disclosure, step 204 can be referred to the relevant description of step 101 above. To avoid repetition, it will not be repeated here.
[0064] From the demand side For example, it applies to the secret fragment array Each sample secret fragment Perform local bit decomposition. The bit form is ,in express The bit length is The sample secret fragment. Sample data corresponding to plaintext Middle bit The secret fragments of the sample were involved by the parties The portion held. On the demand side. The secret fragment matrix is obtained through local bit decomposition. ,matrix The number of rows is The number of columns is Provider Similarly, obtain the secret fragment matrix. ,matrix The number of rows is The number of columns is .
[0065] Step 205: Traverse the secret bit vector of each column in the local secret fragment matrix to obtain the anti-secret bit vector corresponding to the secret bit vector.
[0066] In this embodiment of the disclosure, step 205 can be referred to the relevant description of step 102 above. To avoid repetition, it will not be repeated here.
[0067] For example, the demand side Holding secret bit vector and anti-secret bit vector .
[0068] Step 206: Concatenate the secret bit vector and the anti-secret bit vector to form the first secret vector.
[0069] In this embodiment of the disclosure, when determining the secret bit vector With the anti-secret bit vector [ Then, the secret bit vector can be processed. With the anti-secret bit vector [ The first secret vector is obtained by concatenating the vectors. .
[0070] For example, the demand side secret bit vector and anti-secret bit vector To perform splicing, i.e., to execute Obtain the first secret vector .
[0071] Step 207: Calculate the prefix sum of the first secret vector to obtain the prefix sum vector.
[0072] In this embodiment of the disclosure, the prefix sum refers to the vector sum preceding that position, local to each participant for each first secret vector. The prefix sum of the fragment can be calculated in the secret fragment matrix to obtain the corresponding prefix sum vector. .
[0073] For example, a prefix sum vector can be represented by the following formula (1): [ (1) Its calculation formula (2) is expressed as follows: [ (2) Based on the above formula (2), the first secret vector Calculate the prefix sum vector [ .
[0074] In an optional method embodiment of this disclosure, step 207 may specifically include the following step A.
[0075] Step A: Calculate the prefix sum of the first secret vector in parallel based on the binary tree to obtain the prefix sum vector.
[0076] In this embodiment, the computation of the sorted index vector can be parallelized to improve computational efficiency and adapt to scenarios involving large amounts of data. Specifically, in the secret fragment matrix... Traversing to the th The column, after processing, yields the first secret vector. Then, the parallel processing scheme for calculating the prefix sum is implemented as shown in the following formula (3): (3) Where, assuming n The first secret vector The length, and marked with symbols Represents the first secret vector As shown in formula (2) above, The sequence is represented in the form of a binary tree. Let be the number of levels in the binary tree. For each node at each level, the value of that node can be computed in parallel. The value of the current level node depends on the value of the node at the next lower level, thus allowing parallel traversal of the entire binary tree to obtain the first secret vector. The corresponding prefix sum vector[ .
[0077] In an optional method embodiment of this disclosure, step A may specifically include the following step A'.
[0078] Step A': Traverse the binary tree from bottom to top and then from top to bottom, calculating the prefix sum in parallel at each node of the binary tree to obtain the prefix sum vector.
[0079] In this embodiment, the traversal process can be divided into a first stage and a second stage. In the first stage, the first secret vector represented by the binary tree is traversed from the bottom layer upwards, and in the second stage, the first secret vector represented by the binary tree is traversed from the top layer downwards. Based on the aforementioned formula (3), the first for loop represents the traversal from d=0 to d= The first loop iterates through the layers, and the second loop iterates through the elements within the current layer. Indicates parallelism, with a traversal step size of . For example, when d=0, the calculation is as follows:
[0080] Based on the above logic, when traversing to level 1, the calculation continues based on the result of traversing level 0. When traversing to level 2, the calculation continues based on the result of traversing level 1, and so on, until the highest level is reached. The above process is the traversal stage of bottom-up binary tree traversal.
[0081] Figure 4 This disclosure presents a schematic diagram of a first-stage parallel traversal process for a binary tree, as provided in an embodiment of this disclosure. Figure 4 As shown, the calculation proceeds upwards from layer d=0, layer d=1, and layer d=2, with each layer performing parallel element-by-element computation.
[0082] Similarly, in the second stage, the binary tree is traversed downwards from the top level, and the calculation formula (4) is shown below: (4) Based on the aforementioned formula (4), the first for loop represents the loop from d= The first loop iterates through the layers up to d=0. The second loop iterates through the elements within the current layer. "do in parallel" indicates parallel processing, with a step size of 2. d+1 .
[0083] Figure 5 This disclosure presents a schematic diagram of a second-stage parallelized traversal process for a binary tree, as provided in an embodiment of this disclosure. Figure 5 As shown, starting from layer d=2, layer d=1, and layer d=0, the calculation is performed element-wise in parallel within each layer, and the sorting index vector is finally determined. It is made by Shift one element to the left and add element 27 to the end to get the result.
[0084] Step 208: Multiply the prefix sum vector by the first secret vector to obtain the second secret vector.
[0085] Furthermore, the prefix sum vector can be... and the first secret vector Multiplication yields the second secret vector .
[0086] For example, the demand side right and[ The second secret vector is obtained by performing element-wise multiplication. , .
[0087] Step 209: After splitting the second secret vector, add each element and subtract 1 to obtain the sorted index vector in ciphertext form. The sorted index vector represents the sequence position of this secret fragment after sorting.
[0088] In this embodiment of the disclosure, when determining the second secret vector Based on this, the second secret vector can be... Perform splitting processing, such as splitting the second secret vector The data is split into two secret bit vectors. Then, the split secret bit vectors are added element-wise and subtracted by 1 in the ciphertext state to obtain the sorted index vector. .
[0089] For example, the demand side The second secret vector Based on the aforementioned concatenation, it is re-split into two secret bit vectors, which can be... Then, add each element of the split secret bit vector and subtract 1 to obtain the sorted index vector. : ; Sort index vector[ : This indicates the sequence position of the corresponding element in the sorted vector.
[0090] Step 210: Sort the sample secret fragments in the local secret fragment array of the participants based on the sorting index vector.
[0091] In this embodiment of the disclosure, step 210 can be referred to the relevant description of step 104 above. To avoid repetition, it will not be repeated here.
[0092] Step 211: Based on the sorting results of the secret fragments of the sample, retrieve the preset statistical function and determine the statistical indicators, which include at least one of the median, quantile, maximum value, and minimum value.
[0093] In this embodiment of the disclosure, based on the sorting results of the sample secret fragments, specific statistical indicators can be calculated in different financial risk control and joint marketing business scenarios. Different statistical indicators can correspond to different preset statistical functions. These statistical indicators may include median, maximum value, minimum value, quantile, etc., and the corresponding preset statistical function can be called according to the actual statistical needs. The above-mentioned different statistical indicators are only for example. Those skilled in the art can select or configure different preset statistical functions according to statistical needs. This embodiment of the disclosure does not impose specific limitations in this regard.
[0094] The secret-sharing-based sorting method disclosed herein involves participants obtaining a secret fragment array based on secret sharing. This array includes sample secret fragments corresponding to different participants. Each participant performs bit decomposition operations on its local sample secret fragments and iterates through the obtained secret fragment matrix to obtain the inverse secret bit vector of each column. Then, a sorting index vector in ciphertext form is determined based on the secret bit vector and the inverse secret bit vector to determine the sequence position of the sample secret fragment after sorting. This method, through secret sharing, privatizes and fragments the sample data during the sorting process. The sorting index vector can be calculated in ciphertext form without requiring complex secret comparison procedures, thus ensuring accuracy, security, and reliability in the sorting process while also improving sorting efficiency.
[0095] Furthermore, this disclosure also parallelizes the calculation process of the sorting index vector. Combined with the secret sharing scheme, it can greatly improve the sorting performance in big data scenarios, avoid introducing relatively time-consuming ciphertext comparison operations during the sorting process, and the calculation process is carried out in ciphertext state, which improves the reliability and security of the data processing process.
[0096] Figure 6 A block diagram of a secret-sharing-based sorting device is also provided, such as... Figure 6 As shown, the device can be applied to at least two participants. Each participant has a local secret fragment array, which includes sample secret fragments corresponding to each participant. In each participant, the device may include: a bit decomposition module 601, used to perform bit decomposition operations on each sample secret fragment in the local secret fragment array to obtain a secret fragment matrix; a matrix traversal module 602, used to traverse the secret bit vector in each column of the local secret fragment matrix to obtain the anti-secret bit vector corresponding to the secret bit vector; an index calculation module 603, used to determine the sorting index vector in the ciphertext form based on the secret bit vector and the anti-secret bit vector, where the sorting index vector represents the sequence position of the secret fragment after sorting; and a fragment sorting module 604, used to sort the sample secret fragments in the participant's local secret fragment array based on the sorting index vector.
[0097] In an optional device embodiment of this disclosure, the index calculation module 603 is specifically used to concatenate the secret bit vector and the anti-secret bit vector to form a first secret vector; calculate the prefix sum of the first secret vector to obtain a prefix sum vector; multiply the prefix sum vector by the first secret vector to obtain a second secret vector; and after splitting the second secret vector, add each element and subtract 1 to obtain a sorted index vector in ciphertext form.
[0098] In an optional embodiment of the apparatus disclosed herein, the apparatus may further include: a fragmentation module, configured to fragment local sample data based on random numbers to obtain sample secret fragments; a fragment synchronization module, configured to send local sample secret fragments to other participants; and a fragment synchronization module, further configured to receive sample secret fragments sent by other participants to obtain a local array of secret fragments.
[0099] In an optional device embodiment of this disclosure, the index calculation module 603 is specifically used to calculate the prefix sum of the first secret vector in parallel based on the binary tree, so as to obtain the prefix sum vector.
[0100] In an optional device embodiment of this disclosure, the index calculation module 603 is specifically used to traverse the binary tree from bottom to top and then from top to bottom, calculating the prefix sum in parallel at each node of the binary tree to obtain the prefix sum vector.
[0101] In an optional device embodiment of this disclosure, the length of the secret fragment array is 2n.
[0102] In an optional embodiment of the apparatus disclosed herein, the apparatus may further include a statistical index module for determining statistical indexes based on the sorting results of the sample secret fragments by retrieving a preset statistical function. The statistical indexes include at least one of the median, quantiles, maximum value, and minimum value.
[0103] The secret-sharing-based sorting device disclosed herein allows participating parties to obtain a secret fragment array based on secret sharing. This array includes sample secret fragments corresponding to different participating parties. Each participating party performs bit decomposition operations on its local sample secret fragments and iterates through the obtained secret fragment matrix to obtain the inverse secret bit vector of each column of secret bit vectors. Then, based on the secret bit vectors and inverse secret bit vectors, a sorting index vector in ciphertext form is determined to determine the sequence position of the sample secret fragments after sorting. This method, through secret sharing, privatizes and fragments the sample data during the sorting process. The sorting index vector can be calculated in ciphertext form without the need for complex secret comparison procedures, thus ensuring accuracy, security, and reliability in the sorting process while also improving sorting efficiency.
[0104] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0105] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0106] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0107] In an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.
[0108] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."
[0109] The following reference Figure 7 To describe an electronic device 700 according to such an embodiment of the present disclosure. Figure 7 The electronic device 700 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0110] like Figure 7As shown, the electronic device 700 is manifested in the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, and a bus 730 connecting different system components (including storage unit 720 and processing unit 710).
[0111] The storage unit stores program code, which can be executed by the processing unit 710, causing the processing unit 710 to perform the steps described in the "Exemplary Methods" section above according to various exemplary embodiments of this disclosure.
[0112] Storage unit 720 may include readable media in the form of volatile storage units, such as random access memory (RAM) 7201 and / or cache memory 7202, and may further include read-only memory (ROM) 7203.
[0113] The storage unit 720 may also include a program / utility 7204 having a set (at least one) program module 7205, such program module 7205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0114] Bus 730 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0115] Electronic device 700 can also communicate with one or more external devices (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 700, and / or any device that enables electronic device 700 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed through display unit 740 and input / output (I / O) interface 750 connected to display unit 740. Furthermore, electronic device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 760. As shown, network adapter 760 communicates with other modules of electronic device 700 via bus 730. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0116] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0117] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible implementations, various aspects of this disclosure may also be implemented as a program product including program code, which, when the program product is run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure.
[0118] In embodiments of this disclosure, a program product for implementing the above-described methods is also provided. This product may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of this disclosure is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0119] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0120] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0121] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0122] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing devices can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0123] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0124] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
Claims
1. A sorting method based on secret sharing, characterized in that, The method is applied to at least two participants, each of which has a local secret fragment array, the secret fragment array including sample secret fragments corresponding to each participant. In each participant, the method includes: Perform bit decomposition operations on each sample secret fragment in the local secret fragment array to obtain a secret fragment matrix; Traverse the secret bit vector in each column of the local secret fragment matrix to obtain the anti-secret bit vector corresponding to the secret bit vector; Based on the secret bit vector and the anti-secret bit vector, a sorting index vector in ciphertext form is determined, wherein the sorting index vector represents the sequence position of the sample secret fragment after sorting; The sample secret fragments in the secret fragment array local to the participant are sorted based on the sorting index vector; The step of determining the sorted index vector in ciphertext form based on the secret bit vector and the anti-secret bit vector includes: The secret bit vector and the anti-secret bit vector are concatenated to form the first secret vector; Calculate the prefix sum of the first secret vector to obtain the prefix sum vector; Multiply the prefix sum vector by the first secret vector to obtain the second secret vector; After splitting the second secret vector, each element is added together and then subtracted by 1 to obtain the sorted index vector in ciphertext form.
2. The method according to claim 1, characterized in that, Before performing bit decomposition operations on each sample secret fragment in the local secret fragment array to obtain the secret fragment matrix, the method further includes: Fragmenting local sample data based on random numbers to obtain sample secret fragments; Send the local sample secret fragments to other participants; Receive sample secret fragments sent by the other participants and obtain a local array of secret fragments.
3. The method according to claim 1, characterized in that, The step of calculating the prefix sum of the first secret vector to obtain the prefix sum vector includes: The prefix sum vector is obtained by parallelizing the calculation of the prefix sum of the first secret vector using a binary tree.
4. The method according to claim 3, characterized in that, The step of parallelizing the computation of the prefix sum of the first secret vector based on a binary tree to obtain the prefix sum vector includes: The binary tree is traversed from bottom to top and then from top to bottom. The prefix sum is calculated in parallel at each node of the binary tree to obtain the prefix sum vector.
5. The method according to claim 1, characterized in that, The length of the secret fragment array is 2n.
6. The method according to claim 1, characterized in that, After sorting the sample secret fragments in the local secret fragment array of the participating party based on the sorting index vector, the method further includes: Based on the sorting results of the sample secret fragments, a preset statistical function is invoked to determine statistical indicators, which include at least one of the median, quantile, maximum value, and minimum value.
7. A sorting device based on secret sharing, characterized in that, The device is applied to at least two participants, each participant's local storage includes a secret fragment array, the secret fragment array including sample secret fragments corresponding to each participant, and in each participant, the device includes: The bit decomposition module is used to perform bit decomposition operations on each sample secret fragment in the local secret fragment array to obtain a secret fragment matrix; The matrix traversal module is used to traverse the secret bit vector of each column in the local secret fragment matrix to obtain the anti-secret bit vector corresponding to the secret bit vector. The index calculation module is used to determine the sorting index vector in ciphertext form based on the secret bit vector and the anti-secret bit vector, wherein the sorting index vector represents the sequence position of the sample secret fragment after sorting; The fragment sorting module is used to sort the sample secret fragments in the secret fragment array local to the participant based on the sorting index vector; The index calculation module is specifically used to concatenate the secret bit vector and the anti-secret bit vector to form a first secret vector; calculate the prefix sum of the first secret vector to obtain a prefix sum vector; multiply the prefix sum vector by the first secret vector to obtain a second secret vector; and after splitting the second secret vector, add each element and subtract 1 to obtain the sorted index vector in ciphertext form.
8. An electronic device, characterized in that, include: processor; as well as Memory for storing the computer program of the processor; The processor is configured to execute the secret-sharing-based sorting method according to any one of claims 1 to 6 by executing the computer program.
9. A computer-readable medium, wherein a computer program is stored on the computer-readable storage medium, characterized in that, When the computer program is executed by a processor, it implements the secret-sharing-based sorting method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Data processing method, ciphertext computing platform and plaintext and ciphertext hybrid computing system
CN113824550A
Sorting method and system based on secret sharing
CN114172648A
