Methods and apparatus for secure multi-party data grouping
By employing secure disordering and merge sorting methods, the problem of high data grouping complexity in multi-party secure computation is solved, achieving efficient data grouping and improving the processing efficiency of large-scale databases.
Patent Information
- Application Number
- CN202411924005.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-12-24
AI Technical Summary
Existing technologies in multi-party secure computation suffer from high computational complexity during data grouping, especially due to poor performance of sorting algorithms, which affects the overall performance of large-scale databases and limits the development of privacy-preserving computation frameworks.
A method combining safe scrambling operations with quicksort and mergesort is used to perform scrambling, quicksort, and mergesort on the target dataset. The data is then grouped using safe comparison results, reducing computational and communication complexity.
By reducing the computational complexity to O(n*log2n), the efficiency of data grouping in multi-party secure computation is improved, communication overhead is reduced, and business processing efficiency is increased.
Smart Images

Figure CN119848940B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of secure computing technology, and in particular to a method and apparatus for secure grouping of multi-party data. Background Technology
[0002] Secure multi-party computation, also known as secure multi-party computation, refers to multiple parties collaboratively calculating the result of a function without disclosing their input data, while the result is disclosed to one or more of the parties. Typical applications of secure multi-party computation include privacy-preserving intersection and joint learning. In business processes based on secure multi-party computation, joint computations based on sorting or grouping of data tables may be involved. For example, in a data table summarizing basic user information, one party holds a "years of service" field, and another party holds a "leisure expenditure" field. The goal is to group users based on their years of service without disclosing the correlation between years of service or leisure expenditure and the users. How to effectively perform secure grouping is a crucial technical issue in the related business processes of secure multi-party computation. Summary of the Invention
[0003] This specification describes one or more embodiments of a method and apparatus for securely grouping multi-party data, in order to solve one or more problems mentioned in the background art.
[0004] According to the first aspect, a method for secure grouping of multi-party data is provided for use in multi-party secure computation. This method involves grouping multiple target data items in a target dataset jointly and securely held by multiple participating parties according to predetermined attributes. Each target data item corresponds to a value of an attribute in a secret-sharing manner. The multiple participating parties include a first party, and the method is executed by the first party. The method includes: performing a secure scrambling operation with other participating parties to obtain a first scrambled fragment of the target dataset; performing fast sorting with other participating parties through secure comparison of attribute values to determine several intermediate datasets, thereby dividing the first scrambled fragment into several first fragment sets corresponding to each intermediate dataset. The several datasets include a first dataset and a second dataset, where any attribute value in the first dataset is less than any attribute value in the second dataset; performing merge sorting on the target data contained in each intermediate dataset through secure comparison of attribute values with other participating parties, and adjusting the fragment order of the target data within each first fragment set accordingly to obtain a first ordered fragment of the ordered target dataset sorted by attribute value; and grouping the first ordered fragment based on grouping conditions satisfied by the attribute values of the target data in the ordered target dataset.
[0005] In one embodiment, each participant has its own disordering rule, and the result of the secure disordering operation is: the target data in the target dataset is disordered by sequentially superimposing the disordering rules of each participant, and each participant obtains a fragment of the disordered target dataset.
[0006] In one embodiment, the step of determining several intermediate datasets by performing fast sorting through secure comparison of various attribute values with other participants, thereby dividing the first disordered partition into first partition sets corresponding to each intermediate dataset, includes: negotiating an attribute value as a benchmark element in the disordered target dataset with other data parties, and performing secure comparisons of other attribute values with the benchmark element to obtain a secure comparison result; dividing the first disordered partition into two partition sets according to the secure comparison result; and continuing to negotiate benchmark elements with other data parties for each partition set and performing secure comparisons to recursively divide the partition set until an empty dataset, a single-element dataset, or a predetermined depth is encountered, thereby obtaining each first partition set, and each first partition set being the first partition of each intermediate dataset.
[0007] In one embodiment, the step of performing merge sorting on the target data contained in each intermediate dataset by securely comparing each attribute value with other participants includes: for a single intermediate dataset, performing secure comparisons of each pair of attribute values with other participants and obtaining comparison results; determining each first fragment in the corresponding single first fragment set as a fragment sequence corresponding to at most two target data according to the comparison results; and continuing to perform merge operations on the fragment sequences until each first fragment in the corresponding single first fragment set is arranged into a sequence according to the size order of each attribute value in the single intermediate dataset.
[0008] In one embodiment, the grouping condition is to group target data with equal attribute values on a predetermined attribute into a group; the grouping of the first ordered segment based on the grouping condition satisfied by the attribute values of the target data in the ordered target dataset includes: based on a security comparison with other participants, detecting whether the attribute values of two adjacent target data in the ordered target dataset are equal and obtaining the detection result; and dividing the target data with corresponding equal attribute values in the first ordered segment into the same group according to the detection result.
[0009] In a further embodiment, the attribute values of two adjacent target data in the ordered target dataset include adjacent first and second values. The step of detecting whether the attribute values of two adjacent target data in the ordered target dataset are equal and obtaining the detection result based on security comparison with other participants includes: detecting whether the first value is less than the second value; if the first value is not less than the second value, detecting whether the second value is less than the first value; if the second value is not less than the first value, determining that the first value and the second value are equal.
[0010] In a further embodiment, the comparison result of whether the first value is less than the second value or whether the second value is less than the first value is determined during the merge sort process.
[0011] According to the second aspect, a device for securely grouping multi-party data is provided for grouping multiple pieces of target data in a target dataset jointly and securely held by multiple participating parties according to predetermined attributes in a multi-party secure computation. Each piece of target data corresponds to a value of an attribute under a secret sharing format in the predetermined attribute. The multiple participating parties include a first party, and the device is disposed on the first party, comprising:
[0012] The out-of-order unit is configured to perform a safe out-of-order operation with other participants to obtain the first out-of-order fragment of the target dataset after out-of-order processing.
[0013] The first sorting unit is configured to perform fast sorting with other participants through secure comparison of various attribute values to determine several intermediate datasets, thereby dividing the first disordered partition into several first partition sets corresponding to each intermediate dataset. The several datasets include a first dataset and a second dataset, wherein any attribute value of a predetermined attribute in the first dataset is less than any attribute value of a predetermined attribute in the second dataset.
[0014] The second sorting unit is configured to perform merge sorting on the target data contained in each intermediate dataset by comparing the attribute values with other participants in a secure manner, and adjust the order of the target data in each first fragment set accordingly, so as to obtain the first ordered fragment of the ordered target dataset sorted by the size of the attribute values.
[0015] The grouping unit is configured to group the first ordered fragments based on the grouping conditions satisfied by the attribute values of the target data in the ordered target dataset.
[0016] According to a third aspect, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of the first aspect.
[0017] According to a fourth aspect, a computing device is provided, including a memory and a processor, wherein executable code is stored in the memory, and the processor, when executing the executable code, implements the method of the first aspect.
[0018] The apparatus and method provided in the embodiments of this specification allow for the grouping of multiple target data items in a target dataset jointly and securely held by multiple participants according to predetermined attributes. Each participant can first shuffle the target dataset to sever their control over the location information of the target data. Then, the shuffled target dataset is sorted according to the attribute values of predetermined attributes using fast sorting and merge sort based on secure comparison, resulting in an ordered dataset. Finally, secure comparison is used to group the data based on the ordered dataset. This technical solution fully utilizes the efficiency of comparison-based sorting algorithms. By first securely shuffling the data and then using fast sorting, the possibility of parallel execution can be increased using merge sort, which is easier to execute in parallel. Its complexity is reduced to O(n*log₂n), making it more efficient. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This diagram illustrates a specific implementation architecture for secure multi-party computation.
[0021] Figure 2 A schematic diagram of the process for secure data packetization according to an embodiment of this specification is shown;
[0022] Figure 3 A schematic diagram of a specific example of a safe out-of-order operation process is shown;
[0023] Figure 4 A structural block diagram of an apparatus for secure multi-party data grouping according to one embodiment of this specification is shown. Detailed Implementation
[0024] The solution provided in this specification will now be described with reference to the accompanying drawings.
[0025] First, let's introduce some related concepts.
[0026] Secure Multi-Party Computation (SMPC or MPC) solves the problem of privacy-preserving collaborative computation among a group of distrustful participants. MPC ensures the independence of inputs, the correctness of computation, and does not disclose the input values to other members participating in the computation. Figure 1 An MPC architecture is shown. The number of participants can be two or more of any reasonable number, and secure communication can be established between each pair of participants.
[0027] A common privacy protection method for multi-party secure computation is secret sharing (SS). The idea behind secret sharing is to divide private data into appropriate parts as a secret, with each part managed by a different participant. A single participant cannot recover the secret information; only through the collaboration of several participants can the secret message be recovered.
[0028] SQL (Structured Query Language) is a database language with multiple functions, including data manipulation and definition. This interactive language provides great convenience to users, and database management systems should fully utilize SQL to improve the quality and efficiency of computer application systems. SQL can not only be used independently but also as a sub-language to effectively assist other programming languages. For example, SQL can work with other programming languages to optimize program functionality, thereby providing users with more comprehensive information.
[0029] Privacy-preserving computing frameworks based on MPC can provide solutions for various processes, from data analysis and machine learning modeling. When processing data, users can use MPC's SQL for data analysis and exploration, construct human-based strategies, and then use machine learning algorithms for machine preprocessing and modeling. One of the challenges in this process is leveraging MPC's SQL capabilities.
[0030] In SQL, the GROUP BY operation is used to group data by one or more columns (which can be considered a field or attribute). It is typically used with aggregate functions (such as SUM, COUNT, AVG, etc.) to perform calculations on each group and return the results. GROUP BY is a powerful tool for extracting useful information from large amounts of data and for summarizing and analyzing it. It is widely used in various types of applications, including business analytics, data mining, report generation, data summarization, and data filtering.
[0031] Implementing GROUP BY in MPC is one of the performance bottlenecks in MPC SQL. It requires first safely sorting the target column, then safely finding the split point, with data between the split points grouped into the same group. In other words, a key step in grouping data is safe sorting, which means rearranging the order of data in the SQL database according to certain rules (such as ascending or descending order).
[0032] For example, suppose a data table is a basic employee information statistics table, including fields such as years of service and leisure expenses. These fields are distributed securely among the various participants in a multi-party computation in a confidential manner. During a business process, it is necessary to sort employees by years of service in ascending order. The data table could be an SQL data table in the form shown in Table 1 below.
[0033] Table 1. Example of Employee Leisure Expenditure Data
[0034] Id Outpay Work Years 1 1000 1 2 2000 2 3 3000 1 …… …… ……
[0035] The data table is jointly held by the first party and the second party in a secret sharing manner, and is denoted as the first shard and the second shard, as shown in Table 2 and Table 3.
[0036] Example of the first partition of the data table in Table 2
[0037] Id Outpay Work Years 23 1023 2 19 2045 3 11 4096 4 …… …… ……
[0038] Example of the second partition of the data table in Table 3
[0039]
[0040]
[0041] To avoid disclosing private information such as user identifiers (user IDs, which can also be used as data identifiers) after sorting, conventional techniques employ secure comparison methods for sorting. Taking a sorted array in descending order by the "Outpay" field as an example, for the unsorted elements, any element is selected as the starting element and securely compared with another element. A secure selection protocol is executed according to the shared sharding of the comparison results, selecting the larger element from the two for subsequent comparisons. This process is repeated until the largest unsorted element is selected and added to the sorted queue. This process is repeated until only one element remains. In this scheme, each successful sorting of an element requires one more secure comparison than the remaining number of elements. Due to security requirements, the size relationship between elements cannot be revealed during the comparison process, potentially involving numerous redundant comparisons. However, because the secure comparison protocol is relatively expensive, the computational complexity of this method is on the order of the square of the total number of elements n, for example, denoted as O(n^2). 2 Other schemes utilize input-independent sorting network structures such as Bitonic Sorting Network or Odd Even MergeSort, employing secure comparison and secure selection protocols to achieve secure sorting for multiple parties. The time and communication complexities are both O(n*log₂n*log₂n).
[0042] Therefore, when using a poorly performing sorting algorithm, it may affect the overall performance of a multi-party secure database and limit the development of privacy computing frameworks when dealing with large-scale databases (such as those with millions of records).
[0043] In view of this, this specification provides a grouping method based on secure shuffling and merge sort within a multi-party secure computation architecture. Under the technical concept of this specification, the order of data entries in a data table can be shuffled based on secure shuffling operations, preventing any participating party from individually obtaining the valid position information of any single data entry in the data table. Based on this, the secure comparison results of the element values (attribute values) of the fields (predefined attributes) upon which the sorting depends are made public. Combined with quicksort and merge sort algorithms, the overall computational and communication overhead can be reduced to O(nlog₂n), thereby significantly reducing the complexity of grouping computation and communication in MPC and improving business processing efficiency.
[0044] The following is combined with Figure 2 The illustrated embodiments provide a detailed description of the technical concept of this specification.
[0045] Figure 2 A flowchart illustrating a multi-party secure data grouping process according to one embodiment is shown. The execution entity of this process can be the computing platform of any participant in the multi-party secure computation (e.g., denoted as the first party), which can be a computer, device, server, etc., with certain computing capabilities. In the embodiments of this specification, the data to be grouped can be denoted as target data, and each piece of target data can be denoted as target dataset. The target dataset can be in the form of a data table, set, array, etc., or it can be determined according to storage address, predetermined conditions, etc. The target dataset can be jointly held by various data parties, such as in a secret-sharing form among multiple participants (i.e., for any target data, each participant holds a data fragment), a vertical partitioning form (i.e., for any target data, each participant holds a portion of fields or attributes, in which case data alignment is required through privacy intersection), or a horizontal partitioning form (i.e., each participant can hold at least one piece of data, the data fields and attributes of each participant are aligned, and the data entries are independent of each other). In an optional example, under both vertical and horizontal partitioning, the data can be split from the local data of each data party and distributed to other participants in a secret sharing manner.
[0046] It is worth noting that the technical concept in this specification is based on the business processing requirements of data tables, but it can adapt to various data grouping scenarios. In non-data table scenarios, a single target data entry can correspond to a data identifier and have at least one attribute, similar to a field in a data table. In other words, a data table is a form of target dataset; each row of data in the data table can be considered a target data entry, each field can be considered an attribute, and the element value in the field is the attribute value. Data grouping can rely on predetermined attributes, with each target data entry corresponding to a single attribute value. For example, in Table 1, data is grouped according to the "Work Years" field, grouping data with consistent attribute values (i.e., specific years of work, such as 3). It can be understood that in the current process, the target data of each participant is always aligned.
[0047] like Figure 2 As shown in the embodiments of this specification, the process for secure grouping of multi-party data may include the following steps: Step 201, performing a secure scrambling operation with other participating parties to obtain a first scrambled fragment of the target dataset; Step 202, performing a fast sorting operation with other participating parties through secure comparison of various attribute values to determine several intermediate datasets, thereby dividing the first scrambled fragment into several first fragment sets corresponding to each intermediate dataset, wherein the aforementioned several datasets include a first dataset and a second dataset, and any data in the first dataset is smaller than any data in the second dataset; Step 203, performing a merge sort on the target data contained in each intermediate dataset through secure comparison of various attribute values with other participating parties, and adjusting the fragment order of the target data in each first fragment set accordingly, to obtain a first ordered fragment of the ordered target dataset sorted according to the size of the attribute values; Step 204, grouping the first ordered fragment based on the grouping conditions satisfied by the attribute values of the target data in the ordered target dataset.
[0048] First, in step 201, a safe out-of-order operation is performed with other participants to obtain the first out-of-order fragment of the target dataset after out-of-order processing.
[0049] Secure out-of-order processing is a secure operation in which participating parties shuffle the order of target data without disclosing their local privacy data, and the reordered data order remains unknown to each participating party. Through secure out-of-order processing, each participating party obtains a fragment of the reordered target dataset (e.g., a data table that has been row-sorted). The fragment obtained by the first party is denoted as the first out-of-order fragment. These fragments constitute a shared form of the reordered target dataset. It can be understood that, for a predetermined attribute, a single participating party holds a fragment of each attribute value in the reordered target dataset. The corresponding attribute value of the reordered target data can be recovered from each fragment according to a sharing method (e.g., arithmetic sharing, Boolean sharing, etc.).
[0050] The following example uses a data table to illustrate a specific instance of a secure out-of-order execution by two parties.
[0051] To facilitate understanding, we first describe how a data table held by a single participant (let's call it Party 1) is safely shuffled, and the resulting shuffled data table is shared between two participants (let's call it Party 1 and Party 2).
[0052] Suppose x is a data table held by a second party, and p is an arbitrary data permutation operation or permutation relation, such as a row permutation operation. Given three random datasets a, b, and d, when permutation p is applied to dataset a (denoted as pa), pa - b = d is satisfied. As an example of permutation p, suppose permutation p = [1, 3, 2, 4], meaning that the first element after the permutation remains the first element of the original dataset, the second element after the permutation becomes the third element of the original dataset, and so on. If dataset a is a = [11, 13, 54, 12], then permutation p applied to dataset a can be pa = [11, 54, 13, 12]. [p, a, b, d] can be called a set of random data, corresponding to a scrambling rule. For convenience, it can be denoted as the scrambling rule corresponding to a party holding permutation p (such as the first party). Secure scrambling can be achieved when the first party holds p and d, and the second party holds a and b. This can be achieved by using a trusted third party to generate pa - b = d as a constraint. The second party uses dataset a as perturbation data for data table x, calculates xa, and provides it to the first party. The first party applies permutation p to xa and uses d as the balance term after perturbation (used to balance the data table), calculating p(xa) + d as a shared partition of the disordered data table (i.e., the disordered dataset), denoted as y1 = p(xa) + d. On the other hand, the second party uses b as another shared partition of the disordered data table, denoted as y2 = b. It is easy to verify that y1 + y2 = p(xa) + d + b = px - (pa - b) + d = px.
[0053] The above disordering operation can be extended to multiple participants, which will not be elaborated here. It is worth noting that a set of vectors or tables [p, a, b, d] that satisfies pa-b=d can also be called a safe permutation tuple, which is denoted in this specification as the disordering rule corresponding to the party holding permutation p.
[0054] According to one optional implementation, each participant can initially hold a shard of the original data table. Taking two participants as an example, the first and second parties can hold shards x1 and x2 of data table x, respectively. By performing out-of-order operations on each shard x1 and x2, a safe out-of-order operation on the entire data table can be achieved.
[0055] To ensure a synchronized scrambled result for x1 and x2, meaning the data correspondence after scrambling is consistent with that before scrambling, we can perform two superimposed scrambling operations on x1 and x2, p2 and p1 (also called permutation operations or permutation relations p2 and p1), denoted as p2p1 x1 and p2p1x2, respectively. Then, p2p1x1 + p2p1x2 = p2p1x. This generates two safe permutation tuples [p1, d1, a2, b2] and [p2, d2, a1, b1], satisfying p1a2 – b2 = d1 and p2a1 – b1 = d2, respectively. Here, index 1 indicates that the tuple is held by the first party, and index 2 indicates that it is held by the second party.
[0056] like Figure 3 As shown, in a specific example, the second party can perturb the second shard x2 of the data table x, obtaining x2 – a2, which is then provided to the first party. Furthermore, for the sake of correspondence and consistency in the description, a scrambled shard r2 = b2 can be defined. Upon receiving x2 – a2, the first party can calculate another scrambled shard (such as the first scrambled shard of the data table) r1 = p1(x2 – a2) + d1 + p1(x1). Then, the first party perturbs r1, obtaining r1 – a1, which is provided to the second party, and sets its local scrambled shard (such as the second scrambled shard of the data table) to y1 = b1. Upon receiving r1 – a1, the second party can calculate another scrambled shard y2 = p2(r1 – a1) + d2 + p2(r2). It is easy to verify that y1 + y2 = p2p1(x1 + x2), which is equivalent to sequentially superimposing the scrambled rules of each participating party to scramble the data table. The two scrambled fragments y1 and y2 constitute a shared form of the scrambled data table x' obtained by superimposing two permutations p2 and p1 on the data table x. For example, y1 is the first scrambled fragment, held by the first party, and y2 is the second scrambled fragment, held by the second party.
[0057] Thus, through secure out-of-order operations, none of the participating parties can match the data in the table with the data in the original data table, thereby effectively protecting data privacy. In other embodiments, other secure out-of-order operations can also be used, such as secure out-of-order operations based on the g-modules protocol, which will not be elaborated here.
[0058] The shuffling operations on other forms of the target dataset are similar to those on the data table. One target data item corresponds to one row of the data table. The first party can obtain the first shuffling partition of the target dataset, and the other participating parties can obtain the other shuffling partitions of the target dataset.
[0059] Then, through step 202, the first disordered shard is divided into several intermediate datasets by fast sorting through secure comparison of various attribute values with other participants, thereby dividing the first shard into each first shard set corresponding to each intermediate dataset.
[0060] Quick sort is an efficient sorting algorithm. It employs a divide-and-conquer strategy, selecting a pivot element to divide the dataset into two parts: one containing all elements smaller than the pivot, and the other containing all elements larger than the pivot. Quick sort is then recursively applied to these two parts. The average time complexity of quick sort is O(n log₂n).
[0061] In the embodiments of this specification, in order to quickly sort each target data item according to the attribute values of a predetermined attribute, a secure comparison of the attribute values corresponding to each target data item can be performed. With the secure comparison results publicly disclosed, each participating party can then partition its local out-of-order shards, thereby achieving the partitioning of the target dataset. The target dataset can be partitioned into various intermediate datasets, and each participating party can hold a shard set corresponding one-to-one with each intermediate dataset. The secure comparison can employ various conventional and feasible implementation methods, which will not be elaborated upon here. A single secure comparison can determine the magnitude relationship between two values. Typically, the result of the secure comparison is shared among the participating parties. Under the technical concept of this specification, the secure comparison result can be publicly disclosed by each participating party.
[0062] In the worst case, the time complexity of quicksort is O(n^2). 2 Thus, in one embodiment, the maximum number of rounds of quicksort can be set. For example, the hyperparameter d is set to a predetermined depth. The participating parties jointly perform at most d rounds of quicksort on the disordered target dataset. In each round, an attribute value of a predetermined attribute in the current dataset is selected as the pivot element. A safe comparison algorithm is used to compare the attribute values of all predetermined attributes in the current dataset with the pivot element, and the comparison results are made public. Based on the comparison results, the current dataset is divided into two parts: one smaller than the pivot element and the other larger than the pivot element. Then, the quicksort algorithm is recursively executed on each part, stopping the recursion when an empty dataset, a single-element dataset, or the predetermined depth d is reached. This avoids worst-case complexity and allows the target data to be divided into multiple smaller datasets. For example, 1 million target data points, after quicksort at a depth of d=7, yield 100 results (excluding empty datasets, the quicksort result is at most 2). d (Number) datasets. Each dataset has a data size order, such that data in dataset 1 is greater than any data in dataset 2, data in dataset 2 is greater than any data in dataset 3, and so on.
[0063] In this way, the disordered target data can be roughly sorted based on the attribute values of each target data point on a predetermined attribute, i.e., divided into multiple intermediate datasets. Each intermediate dataset corresponds to at least one target data point (empty datasets can be excluded). The multiple intermediate datasets are at least two, for example, denoted as the first dataset and the second dataset. In this case, any attribute value of a predetermined attribute in one intermediate dataset (such as the first dataset) is less than any attribute value of a predetermined attribute in the other intermediate dataset (such as the second dataset).
[0064] Since each participant holds a single scrambled fragment of the scrambled target data, each participant can divide its local scrambled fragment into corresponding intermediate dataset fragments based on the publicly available comparison results. These fragments are denoted as fragment sets, and a single fragment set is a fragment of a single intermediate dataset. The first party denotes each fragment set obtained from the first scrambled fragment as a first fragment set. A single first fragment set is then the first fragment of a single dataset among the multiple datasets obtained from dividing the scrambled target data.
[0065] For example, the target dataset x obtained by shuffling the target dataset x is denoted as x′. The first partition x1′ of x′ includes the first partitions of each target data item after shuffling, such as x 12 ′、x 1k ′、x 18 ′、x 1n ..., divided into various first-partition sets {x 1k ′、x 18 '……}>{……}>{x 12 '...}>..., a single first partition set such as {x 1k ′、x 18 '……} represents the intermediate dataset {x} obtained by splitting the target dataset after it has been shuffled. k The first fragment of {x', x8', ...} (corresponding to a single first fragment set) is held by other participants, such as a second party holding its second fragment {x', x8', ...}. 2k ′、x 28 '……} (as in a single second fragment set).
[0066] Next, in step 203, the target data contained in each intermediate dataset is merged and sorted by other participants through a secure comparison of each attribute value, and the target data sharding order in each first shard set is adjusted accordingly to obtain the first ordered shard of the ordered target dataset sorted by the size of the attribute value.
[0067] The merge operation, also known as the merge algorithm, is an operation that combines two sorted sequences into a single sequence. Merge sort algorithms rely on the merge operation. In this specification, since the overall size relationship between the intermediate datasets is already determined, we can perform safe merge sorting on the attribute values of the target data in each intermediate dataset according to predetermined attributes, and then disclose the merge results.
[0068] The following is a simple description of the idea behind merge sort. Taking sorting an array as an example, in merge sort, the array can be divided into two parts, sorted separately, and then merged according to the sorting results of the two parts. When sorting a single part of the array (which is also an array), it can also be divided into two parts, each part sorted first, and then merged. This process continues until a certain level of fineness is reached, forming a structure similar to a binary tree. At this point, a part may contain only one element, in which case no sorting is needed; a simple merge is sufficient. Starting from the finest granularity, merge level by level upwards until the merge is complete.
[0069] In a multi-party secure computation process, the benchmark element can be determined through negotiation among the participating parties. For example, one party may randomly designate an attribute value of the target data as the benchmark element and disclose its order to the other participating parties. The benchmark element can also be an element at a predetermined position in a disordered dataset (such as the first, halfway point, or last element).
[0070] As a concrete example, in the case of descending order sorting, the disordered target data (assuming it contains 3 target data items) can be divided into two parts. One part contains the first two target data items, corresponding to the first attribute value q1 and the second attribute value q2. The second part contains the third target data item, corresponding to the third attribute value q3. First, compare the two attribute values q1 and q2 in the first part. If the second attribute value q2 is greater than the first attribute value q1, then each participant swaps the corresponding fragments of the target data corresponding to the first and second attribute values, thus achieving the goal of swapping the target data corresponding to the first and second attribute values. Then, merge the third attribute value q3 from the other part with this part. At this point, compare the third attribute value q3 with the second attribute value q2. If the third attribute value q3 is greater than the second attribute value q2, then the target data corresponding to the third attribute value can be moved before the second attribute value q2. The target data is then sorted in descending order.
[0071] For a single participant, when adjusting the order of the target data shards, only the local shard sets need to be adjusted. For example, the first party adjusts the first shard sets to obtain the first ordered shards. Since all participants can make the same adjustment, the adjusted ordered shards constitute a secret shared form of the sorted target data in the ordered target datasets of each participant.
[0072] According to one embodiment, a single value from the attribute values of a predetermined attribute in a single intermediate dataset can be used as a starting merge sequence. Then, pairs of these values are grouped together, safely compared, and merged based on the attribute value comparison results. The resulting merge sequences are further merged pairwise until the entire intermediate dataset has been merged. Merge sort can be performed in parallel, thereby improving sorting efficiency.
[0073] Further, in step 204, the first ordered segment is grouped based on the grouping conditions satisfied by the attribute values of the target data in the ordered target dataset.
[0074] It is understandable that the participating parties can jointly determine the grouping conditions that the attribute values of the target data in the ordered target dataset must satisfy. Each participating party can determine the grouping situation of the local ordered partitions based on the size relationship, thereby achieving the purpose of grouping the target data on the basis of the ordered dataset.
[0075] Grouping criteria can be predetermined. For example, grouping criteria can be used to group target data with consistent attribute values on predetermined attributes (such as years of service) (such as data recorded by user ID), or to group target data with attribute values on predetermined attributes (such as monthly leisure expenses) within a predetermined range (such as below 3,000 yuan, between 3,000 yuan and 8,000 yuan, etc.), and so on.
[0076] When the grouping condition is to group target data with consistent attribute values on a predetermined attribute into one group, each participant can, based on a secure comparison of attribute values, detect whether the attribute values of two adjacent target data in the ordered target dataset are equal and publish the detection results. Each participant then groups the target data with corresponding equal attribute values in its local ordered partitions into the same group according to the detection results. For example, the first party groups the target data with corresponding equal attribute values in the first ordered partition into the same group. Here, the attribute values of two target data (e.g., denoted as the first value a and the second value b) are equal, i.e., a equal b, which is equivalent to a not less than b and b not less than a.
[0077] !(a < b) &&!(b < a). Here, whether a is not less than b and whether b is not less than a are determined through secure comparison. In some embodiments, the comparison results of whether the first value is less than the second value or whether the second value is less than the first value can directly use the comparison results determined in the merge sort process to save secure computing and communication volumes.
[0078] In the case where the grouping condition is to group target data with attribute values within a predetermined range on a predetermined attribute into one group, each participating party can then perform a secure comparison between the attribute values in the ordered dataset and the corresponding range endpoints, and determine the data segmentation points for each group without leaking various information of the target data. For example, if the target data in the ordered dataset are arranged in ascending order on the predetermined attribute, the attribute values arranged earlier can be sequentially and securely compared with the first range endpoint 3000 until an attribute value not less than 3000 is found, and the target data before it are divided into the first group. Then, the subsequent attribute values are sequentially and securely compared with the second range endpoint 8000 until an attribute value not less than 8000 is found, and the target data before it and after the first group are divided into the second group, and so on.
[0079] In other services, other grouping methods can also be adopted, which will not be elaborated here.
[0080] Reviewing the above process, for the method of multi-party data secure grouping provided under the technical concept of this specification, when grouping multiple target data in a target dataset jointly and securely held by multiple participating parties according to a predetermined attribute, each participating party can first disorder the target dataset to cut off each participating party's control over the position information of the target data, and then perform quicksort and merge sort based on secure comparison to sort the disordered target dataset according to the size of the attribute values on the predetermined attribute to obtain an ordered dataset, and then perform data grouping based on the ordered dataset using secure comparison. This technical solution makes full use of the high efficiency of the comparison algorithm for sorting, and by first securely disordering and then performing quicksort, it is possible to increase the possibility of parallel execution by using merge sort, which is easier to execute in parallel, with its complexity reduced to O(n * log2n) and more efficient.
[0081] According to an embodiment of another aspect, there is also provided a device for multi-party data secure grouping. This device can be set in a computer, terminal, or server with certain computing capabilities of any participating party in multi-party secure computing. This device can be used in multi-party secure computing to group multiple target data in a target dataset jointly and securely held by multiple participating parties according to a predetermined attribute. Among them, each target data corresponds to each attribute value in the form of secret sharing on the predetermined attribute.
[0082] Figure 4 FIG. shows a device 400 for multi-party data secure grouping according to an embodiment. As Figure 4 As shown, device 400 may include:
[0083] The out-of-order unit 401 is configured to perform a safe out-of-order operation with other participants to obtain the first out-of-order fragment of the target dataset after out-of-order processing.
[0084] The first sorting unit 402 is configured to perform fast sorting with other participants through secure comparison of various attribute values to determine several intermediate datasets, thereby dividing the first disordered partition into several first partition sets corresponding to each intermediate dataset. The aforementioned several datasets include at least the first dataset and the second dataset, where any attribute value of a predetermined attribute in the first dataset is less than any attribute value of a predetermined attribute in the second dataset.
[0085] The second sorting unit 403 is configured to perform merge sorting on the target data contained in each intermediate dataset by comparing the attribute values with other participants in a secure manner, and adjust the target data sharding order in each first sharding set accordingly, so as to obtain the first ordered shards of the ordered target dataset sorted by the size of the attribute values.
[0086] Grouping unit 404 is configured to group the first ordered segment based on the grouping conditions satisfied by the attribute values of the target data in the ordered target dataset.
[0087] It is worth noting that, Figure 4 The device 400 shown is Figure 2 Corresponding to the described method, Figure 4 The corresponding descriptions in the illustrated method embodiments also apply to apparatus 400, and will not be repeated here.
[0088] According to another embodiment, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed in a computer, causes the computer to perform a combination Figure 2 The methods described above.
[0089] According to another embodiment, a computing device is also provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements a combination... Figure 2 The methods described herein. Those skilled in the art will recognize that the functions described in the embodiments of this specification in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.
[0090] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the technical concept in this specification. It should be understood that the above description is only a specific embodiment of the technical concept in this specification and is not intended to limit the scope of protection of the technical concept in this specification. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solutions of the embodiments in this specification should be included within the scope of protection of the technical concept in this specification.
Claims
1. A method for secure grouping of multi-party data, used in multi-party secure computation, wherein multiple target data in a target dataset jointly and securely held by multiple participants are grouped according to predetermined attributes, and each target data corresponds to a certain attribute value under a secret sharing form in the predetermined attribute; The plurality of participating parties includes a first party, and the method is performed by the first party, including: Perform a secure out-of-order operation with other participants to obtain the first out-of-order fragment of the target dataset after out-of-order processing; The first disordered partition is divided into several intermediate datasets by fast sorting through secure comparison of various attribute values with other participants. The first dataset includes a first dataset and a second dataset. Any attribute value of a predetermined attribute in the first dataset is less than any attribute value of a predetermined attribute in the second dataset. By comparing the attribute values securely with other participants, merge sort is performed on the target data contained in each intermediate dataset, and the order of the target data in each first fragment set is adjusted accordingly to obtain the first ordered fragment of the ordered target dataset sorted by the attribute value. The first ordered segment is grouped based on the grouping conditions satisfied by the attribute values of the target data in the ordered target dataset.
2. The method as described in claim 1, wherein, Each participant has its own disordering rule. The result of the safe disordering operation is as follows: the target data in the target dataset is disordered by sequentially superimposing the disordering rules of each participant, and each participant obtains a fragment of the disordered target dataset.
3. The method as described in claim 1, wherein, The step of quickly sorting the data by secure comparison of attribute values with other participants to determine several intermediate datasets, thereby dividing the first disordered partition into each first partition set corresponding to each intermediate dataset, includes: In a target dataset with other data parties, negotiate an attribute value as a baseline element and perform a safe comparison between the other attribute values and the baseline element to obtain a safe comparison result. Based on the security comparison results, the first out-of-order fragment is divided into two fragment sets; For each shard set, continue to negotiate with other data sources for a baseline element and perform safe comparisons to recursively split the dataset. Stop when encountering an empty dataset, a single-element dataset, or reaching a predetermined depth, thereby obtaining each first shard set. Each first shard set is the first shard of each intermediate dataset.
4. The method of claim 1, wherein, The step of performing merge sorting on the target data contained in each intermediate dataset through secure comparison of various attribute values with other participants includes: For a single intermediate dataset, perform secure comparisons of attribute values in pairs with other participants and obtain the comparison results; Based on the comparison results, each first fragment in the corresponding single first fragment set is determined as a fragment sequence corresponding to at most two target data. Continue performing a merge operation on the fragmented sequence until the first fragments in the corresponding single first fragment set are arranged into a sequence according to the order of the attribute values in the single intermediate dataset.
5. The method of claim 1, wherein, The grouping condition is to group target data with equal attribute values on a predetermined attribute into one group; the grouping of the first ordered fragment based on the grouping condition satisfied by the attribute values of the target data in the ordered target dataset includes: Based on security comparisons with other participants, the system detects whether the attribute values of two adjacent target data in an ordered target dataset are equal and obtains the detection results. Based on the detection results, target data with corresponding attribute values that are equal in the first ordered segment are divided into the same group.
6. The method of claim 5, wherein, In an ordered target dataset, the attribute values of two adjacent target data points include an adjacent first value and a second value. The process of detecting whether the attribute values of two adjacent target data points in the ordered target dataset are equal based on security comparisons with other participants and obtaining the detection result includes: Check if the first value is less than the second value; If the first value is not less than the second value, check whether the second value is less than the first value; If the second value is not less than the first value, then the first value and the second value are determined to be equal.
7. The method of claim 6, wherein, The comparison result of whether the first value is less than the second value or whether the second value is less than the first value is determined during the merge sort process.
8. A device for secure grouping of multi-party data, used in multi-party secure computation to group multiple target data in a target dataset jointly and securely held by multiple participants according to predetermined attributes, wherein each target data corresponds to a certain attribute value under a secret sharing form in the predetermined attribute; The plurality of participating parties includes a first party, and the device is disposed in the first party, including: The out-of-order unit is configured to perform a safe out-of-order operation with other participants to obtain the first out-of-order fragment of the target dataset after out-of-order processing. The first sorting unit is configured to perform fast sorting with other participants through secure comparison of various attribute values to determine several intermediate datasets, thereby dividing the first disordered partition into several first partition sets corresponding to each intermediate dataset. The several datasets include a first dataset and a second dataset, wherein any attribute value of a predetermined attribute in the first dataset is less than any attribute value of a predetermined attribute in the second dataset. The second sorting unit is configured to perform merge sorting on the target data contained in each intermediate dataset by comparing the attribute values with other participants in a secure manner, and adjust the target data sharding order in each first sharding set accordingly, so as to obtain the first ordered shards of the ordered target dataset sorted by the size of the attribute values. The grouping unit is configured to group the first ordered fragments based on the grouping conditions satisfied by the attribute values of the target data in the ordered target dataset.
9. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-7.
10. A computing device, comprising a memory and a processor, characterized in that, The memory stores executable code, and when the processor executes the executable code, it implements the method of any one of claims 1-7.
Citation Information
Patent Citations
Secure grouping method and device
CN116011018A
Secure sorting method and device
CN116108084A