Multi-party data security grouping method and device
Through the methods of safe and out of order, quick sorting and merge sorting, the data in multi-party security calculations are safely grouped, solving the problem of low data grouping efficiency in multi-party security calculations, and achieving efficient and secure data grouping.
Patent Information
- Application Number
- CN202411924005.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-12-24
AI Technical Summary
In multi-party security calculation, how to effectively group data security, especially when it is necessary to group according to predetermined attributes, avoid leaking input data from each party.
The target data set is disrupted through safe and out of order operations, and the data sets after being sorted into out of order are sorted by the attribute value size on the predetermined attribute by fast sorting and merger based on safe comparison, and then the data set is grouped based on the ordered data set by safe comparison.
This method reduces the complexity of packet computing and communication in multi-party security computing, improves service processing efficiency, reduces the complexity to O(n*log2n), and is more efficient.
Smart Images

Figure CN119848940A_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of secure computing technology, and more particularly, to a method and apparatus for securely grouping multi-party data. Background Art
[0002] Secure multi-party computing is also called multi-party secure computing, that is, multiple parties jointly calculate the result of a function without disclosing the input data of each party of the function, and the result of the calculation is made public to one or more of the parties. For example, typical applications of secure multi-party computing include privacy intersection and joint learning. In the business processing process based on multi-party secure computing, joint calculations based on sorting or grouping in data tables may be involved. For example, for a data table that counts the basic information of users, one participant holds a field for years of work, and the other participant holds a field for user leisure expenditures. Grouping is required based on the user's years of work without disclosing the corresponding relationship between years of work or leisure expenditures and users to each other. How to effectively perform secure grouping is a relatively important technical issue in the relevant business processing process of multi-party secure computing. Summary of the invention
[0003] One or more embodiments of this specification describe a method and device for securely grouping data of multiple parties, so as to solve one or more problems mentioned in the background technology.
[0004] According to a first aspect, a method for secure grouping of multi-party data is provided, which is used in multi-party secure computing, and multiple target data in a target data set securely held by multiple participants are grouped according to predetermined attributes, and each target data corresponds to each attribute value in a secret sharing form on the predetermined attribute; the multiple participants include a first party, and the method is executed by the first party, including: performing a secure shuffling operation with other participants to obtain a first shuffled fragment of the shuffled target data set; performing fast sorting with other participants through secure comparison of each attribute value to determine a number of intermediate data sets, thereby dividing the first shuffled fragment into first fragment sets corresponding to each intermediate data set, respectively, the several data sets include a first data set and a second data set, and any attribute value on the predetermined attribute in the first data set is less than any attribute value on the predetermined attribute in the second data set; performing merge sorting on the target data contained in each intermediate data set through secure comparison of each attribute value with other participants, and adjusting the order of the target data fragments in each first fragment set accordingly, to obtain a first ordered fragment of the ordered target data set sorted according to the attribute value size; and grouping the first ordered fragments based on the grouping conditions satisfied by the attribute values of the target data in the ordered target data set.
[0005] In one embodiment, each participant corresponds to a respective shuffling rule, and the result of the secure shuffling operation is: the target data in the target data set is shuffled by using the respective shuffling rules of each participant in sequence, and each participant obtains each fragment of the shuffled target data set.
[0006] In one embodiment, the fast sorting through secure comparison of each attribute value with other participants to determine several intermediate data sets, thereby dividing the first random shard into first shard sets corresponding to each intermediate data set, includes: negotiating with other data parties an attribute value in the random target data set as a reference element, and performing secure comparison of other attribute values with the reference element to obtain a secure comparison result; dividing the first random shard into two shard sets according to the secure comparison result; continuing to negotiate with other data parties for secure comparison of reference elements for each shard set, recursively dividing, and stopping when encountering an empty data set, a single-element data set or reaching a predetermined depth, thereby obtaining first shard sets, each of which is the first shard of each intermediate data set.
[0007] In one embodiment, the secure comparison of attribute values with other participants to merge and sort the target data contained in each intermediate data set includes: for a single intermediate data set, secure comparison of attribute values of two groups with other participants is performed and comparison results are obtained; according to the comparison results, each first shard in the corresponding single first shard set is determined as a shard sequence corresponding to at most two target data; and the merging operation is continued on the shard sequence until each first shard in the corresponding single first shard set is arranged into a sequence according to the size order of each attribute value in the single intermediate data set.
[0008] In one embodiment, the grouping condition is to group target data with equal attribute values on predetermined attributes; the grouping condition satisfied by the attribute values of the target data in the ordered target data set includes: based on a security comparison with other participants, detecting whether the attribute values of two adjacent target data in the ordered target data set are equal and obtaining a detection result; and dividing the corresponding target data fragments with equal attribute values in the first ordered fragment 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 data set include adjacent first values and second values, and the detection of whether the attribute values of two adjacent target data in the ordered target data set are equal based on security comparison with other participants and obtaining the detection result 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 a second aspect, a device for securely grouping data of multiple parties is provided, which is used in a multi-party secure computation to group multiple target data in a target data set securely held by multiple participants according to predetermined attributes, and each target data corresponds to each attribute value in a secret sharing form on the predetermined attribute; the multiple participants include a first party, and the device is provided on the first party, and includes:
[0012] A shuffling unit, configured to perform a secure shuffling operation with other participants to obtain a first shuffled fragment of the shuffled target data set;
[0013] A first sorting unit is configured to perform fast sorting with other participants through secure comparison of each attribute value to determine a plurality of intermediate data sets, so as to divide the first out-of-order shards into respective first shard sets corresponding to the respective intermediate data sets, wherein the plurality of data sets include a first data set and a second data set, and any attribute value on a predetermined attribute in the first data set is less than any attribute value on a predetermined attribute in the second data set;
[0014] The second sorting unit is configured to perform merge sorting on the target data contained in each intermediate data set through security comparison of each attribute value with other participants, and adjust the sequence of the target data shards in each first shard set accordingly to obtain the first ordered shards of the ordered target data set sorted according to the attribute value size;
[0015] The grouping unit is configured to group the first ordered fragments based on a grouping condition satisfied by an attribute value of the target data in the ordered target data set.
[0016] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed in a computer, the computer is caused to execute the method of the first aspect.
[0017] According to a fourth aspect, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method of the first aspect is implemented.
[0018] Through the device and method provided in the embodiments of this specification, when multiple target data in a target data set that is jointly and securely held by multiple participants are grouped according to predetermined attributes, each participant can first shuffle the target data set to cut off each participant's control over the target data location information, and then sort the shuffled target data set according to the size of the attribute values on the predetermined attributes through quick sorting and merge sorting based on secure comparison to obtain an ordered data set, and then use secure comparison to group data based on the ordered data set. This technical solution makes full use of the efficiency of the comparison algorithm sorting, and by first shuffling securely and then quickly sorting, it is possible to use merge sorting that is easier to execute in parallel to increase the possibility of parallel execution, and its complexity is reduced to O(n*log2n), and it is more efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0020] Figure 1 A schematic diagram of a specific implementation architecture of multi-party secure computing is shown;
[0021] Figure 2 A schematic diagram of a process of securely grouping data of multiple parties according to an embodiment of this specification is shown;
[0022] Figure 3 A schematic diagram of a safe out-of-order operation process of a specific example is shown;
[0023] Figure 4 A structural block diagram of a device for securely grouping data of multiple parties according to an embodiment of the present specification is shown. DETAILED DESCRIPTION
[0024] The solution provided in this specification is described below in conjunction with the accompanying drawings.
[0025] First, some relevant concepts are introduced.
[0026] Secure Multi-Party Computation (SMPC or MPC) solves the problem of privacy-preserving collaborative computing between a group of mutually distrusting parties. MPC must ensure the independence of inputs and the correctness of calculations, while not leaking input values to other members participating in the calculation. Figure 1 An MPC architecture is shown, wherein the number of participants can be any reasonable number of two or more, and secure communication can be performed between any two participants.
[0027] The commonly used privacy protection method in multi-party secure computing is secret sharing (SS). The idea of secret sharing is to split private data as a secret in an appropriate way. Each share after splitting is managed by different participants. A single participant cannot recover the secret information. Only when several participants work together can the secret message be recovered.
[0028] SQL (Structured Query Language) is a database language with multiple functions such as data manipulation and data definition. This language is interactive and can provide great convenience for users. Database management systems should make full use of SQL language to improve the work quality and efficiency of computer application systems. SQL language can not only be used independently, but also can be used as a sub-language to provide effective assistance for other program designs. For example, SQL can be used with other program languages to optimize program functions, thereby providing users with more comprehensive information.
[0029] The privacy computing framework based on MPC can provide solutions for various processes such as data analysis and machine learning modeling. When users process data, they can use MPC's SQL to analyze and explore data, build artificial strategies, and use machine learning algorithms for machine preprocessing and machine modeling. One of the difficulties in this process is the SQL capability of MPC.
[0030] In SQL, the GROUP BY operation can be used to group data by one or more columns (which can be considered a field or attribute). It is often used with aggregate functions (such as SUM, COUNT, AVG, etc.) to perform calculations on each group and return results. GROUP BY is a powerful tool that can extract useful information from large amounts of data and perform summary and analysis. It is widely used in various types of applications, including business analysis, data mining, report generation, data aggregation, data filtering, etc.
[0031] Implementing GROUP BY through MPC is one of the performance bottlenecks of MPC SQL. It is necessary to first safely sort the target column, and then safely find the split point, and group the data between the split points in the same group. In other words, a key step in grouping data is safe sorting, that is, rearranging the order according to certain rules (such as ascending, descending, etc.) for the SQL database.
[0032] For example, suppose a data table is a statistical table of basic information of employees, including fields such as working years and leisure expenses. These fields are distributed among various participants of multi-party secure computing in the form of secret sharing. In a business processing process, it is necessary to sort the working years of employees in ascending order. The data table is, for example, an SQL data table in the form shown in Table 1 below.
[0033] Table 1 Example of employee leisure expenditure data table
[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 the form of secret sharing, and is respectively recorded as the first shard and the second shard, as shown in Table 2 and Table 3.
[0036] Table 2 Example of the first shard of the data table
[0037] Id Outpay Work Years 23 1023 2 19 2045 3 11 4096 4 …… …… ……
[0038] Table 3 Example of the second shard of the data table
[0039]
[0040]
[0041] In order not to leak privacy information such as the user identifier (user ID, which can also be used as a data identifier) after sorting, conventional technology can perform sorting by secure comparison. Taking a descending order according to the "Outpay" field as an example, for the unsorted elements, select any one as the starting element, and perform a secure comparison with another element, and execute the secure selection protocol according to the shared shard (share) of the comparison result, and select the larger element from the two elements for subsequent comparison, and so on, so as to recursively select the largest one of the unsorted elements and add it to the queue that has completed the sorting. This process is executed in a loop until the last element is left. Under this scheme, for each successful sorting of an element, a secure comparison of the number of remaining elements minus 1 must be performed. Due to security requirements, the size relationship between elements cannot be revealed during the comparison process, so more repeated comparisons may be involved. However, due to the large overhead of the secure comparison protocol, the computational complexity of this method is the square of the total number of elements n, for example, denoted as O(n 2 In other schemes, based on input-independent sorting network structures such as Bitonic Sorting Network or Odd Even MergeSort, secure comparison and secure selection protocols are used to implement secure sorting of multiple parties, and the time complexity and communication complexity are both O(n*log2n*log2n).
[0042] Therefore, when the sorting algorithm used has poor performance, facing a large-scale (such as millions of) database, it may affect the overall performance of the multi-party security database and limit the development of the privacy computing framework.
[0043] In view of this, this specification provides a grouping method based on secure shuffle and merge sort under a multi-party secure computing architecture. Under the technical concept of this specification, the order of each data in the data table can be disrupted based on a secure shuffle operation, and each participant cannot obtain the valid position information of any data in the data table alone. On this basis, the secure comparison results of the element values (attribute values) of the fields (predetermined attributes) on which the sorting depends are made public, and combined with the quick sort and merge sort algorithms, the overall computing and communication overhead can be reduced to O(nlog2n), thereby greatly reducing the complexity of grouping computing and communication in MPC and improving business processing efficiency.
[0044] Combine the following Figure 2 The embodiments are shown and the technical concept of the present specification is described in detail.
[0045] Figure 2 A schematic diagram of a process flow of secure grouping of multi-party data according to an embodiment is shown. The execution subject of the process can be a computing platform of any participant (such as the first party) in the multi-party secure computing, 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 recorded as target data, and each target data can be recorded as a target data set. The target data set is, for example, in the form of a data table or a set, an array, etc., and can also be in a form determined according to a storage address, a predetermined condition, etc. The target data set can be jointly held by each data party, such as in a secret sharing form formed by multiple participants (that is, for any target data, each participant holds a data slice), a vertical segmentation form (that is, for any target data, each participant holds a part of the fields or attributes, and at this time, data alignment needs to be performed through privacy intersection) or a horizontal segmentation form (that is, each participant can each hold at least one piece of data, and the data fields and attributes of each participant are aligned, and the data entries are independent of each other). In an optional example, in the vertical slicing form and the horizontal slicing form, the local data of each data party can be split and distributed to other participants to convert the shards into a secret sharing form for processing.
[0046] It is worth noting that the technical concept of this specification is proposed through the business processing requirements of the data table, but it can adapt to various data grouping situations. In the case of non-data tables, a single target data can correspond to a data identifier and have at least one attribute, and a single attribute is similar to a field in a data table. In other words, a data table is a form of a target data set, each row of data in a data table can be regarded as each target data, each field can be regarded as each attribute, and the element value on the field is the attribute value. Data grouping can be performed based on predetermined attributes, and a single target data corresponds to a single attribute value on the predetermined attribute. For example, grouping according to the "Work Years" field in Table 1, data with consistent attribute values (i.e., specific working years, such as 3) are grouped together. It can be understood that in the current process, the target data between each participant is always aligned.
[0047] like Figure 2 As shown, the process of secure grouping of multi-party data provided by the embodiment of this specification may include the following steps: Step 201, perform a secure shuffling operation with other participants to obtain a first shuffled fragment of the shuffled target data set; Step 202, perform quick sorting with other participants through secure comparison of each attribute value to determine a number of intermediate data sets, thereby dividing the first shuffled fragment into first fragment sets corresponding to each intermediate data set, wherein the above-mentioned several data sets include a first data set and a second data set, and any data in the first data set is smaller than any data in the second data set; Step 203, perform merge sorting on the target data contained in each intermediate data set through secure comparison of each attribute value with other participants, and adjust the order of the target data fragments in each first fragment set accordingly, to obtain the first ordered fragment of the ordered target data set sorted according to the size of the attribute value; Step 204, group the first ordered fragments based on the grouping conditions satisfied by the attribute values of the target data in the ordered target data set.
[0048] First, in step 201, a secure shuffle operation is performed with other participants to obtain a first shuffled fragment of the shuffled target data set.
[0049] A secure shuffle operation is a secure operation in which each participant shuffles the order of each target data without leaking local privacy data, and each participant cannot know the order of the data after shuffling. Through the secure shuffle operation, each participant can obtain a shard of the shuffled target data set (such as a data table with shuffled rows). The shuffled shard obtained by the first party is recorded as the first shuffled shard. These shards constitute a shared form of the shuffled target data set. It can be understood that for a predetermined attribute, a single participant holds a shard of each attribute value of the shuffled target data set. Each shard of a single attribute value can restore the corresponding attribute value of the shuffled target data in accordance with a sharing method (such as arithmetic sharing, Boolean sharing, etc.).
[0050] The following uses a data table as an example to describe a specific example of secure reordering performed by two parties.
[0051] For ease of understanding, it is first described that a data table held by a single participant (assuming it is called the first party) is securely shuffled, and the resulting shuffled data table is shared between two participants (assuming it is the first party and the second party).
[0052] Assume that x is a data table held by the second party, p is an arbitrary data permutation operation or permutation relationship, such as a row reordering operation, and there are three random data sets a, b, and d. When permutation p acts on data set a (denoted as pa), pa-b=d is satisfied. As an example of permutation p, suppose permutation p=[1, 3, 2, 4], which means that the first element after permutation is still the first element of the original data set, the second element after permutation is the third element of the original data set, and so on. If data set a is a=[11, 13, 54, 12], then permutation p acting on data set a can be pa=[11, 54, 13, 12]. [p, a, b, d] can be called a set of random data, corresponding to a disorder rule. For convenience, it can be recorded as the disorder rule corresponding to a participant (such as the first party) holding permutation p. Secure disorder can be achieved when the first party holds p and d, and the second party holds a and b. It can be generated with pa-b=d as a constraint with the help of a trusted third party. The second party uses data set a as the perturbation data of 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 item after perturbation (for balancing the data table), and calculates p(xa)+d as a shared shard of the disordered data table (i.e., disordered data set), such as y1=p(xa)+d. On the other hand, the second party uses b as another shared shard of the disordered data table, such as y2=b. It is easy to verify that y1+y2=p(xa)+d+b=px-(pa-b)+d=px.
[0053] The above shuffle operation can be extended to multiple parties, which will not be described in detail 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 recorded in this specification as the shuffle rule corresponding to the party holding permutation p.
[0054] According to an optional implementation method, each participant can first hold a shard of the original data table. Still taking two participants as an example, the first party and the second party can hold shards x1 and x2 of the data table x respectively. Perform shuffle operations on each shard x1 and x2 respectively, so as to complete the safe shuffle operation of the entire data table.
[0055] In order to achieve synchronous disorder results for x1 and x2, that is, the corresponding relationship of data after disorder is consistent with that before disorder, two permutations p2 and p1 (also called permutation operations or permutation relations p2 and p1) can be performed on x1 and x2 respectively, and two superposition disorder can be performed, such as p2p1 x1 and p2p1x2, then p2p1x1+p2p1x2=p2p1x. In this way, two safe permutation tuples [p1, d1, a2, b2] and [p2, d2, a1, b1] can be generated, which satisfy p1a2–b2=d1 and p2a1–b1=d2 respectively. Among them, the subscript 1 indicates that it is held by the first party, and the subscript 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 to obtain x2–a2 and provide it to the first party. In addition, for the correspondence and uniformity of the description, a random shard r2=b2 can also be set. The first party receives x2-a2 and can calculate another random shard (such as the first shard of the random data table) r1=p1(x2–a2)+d1+p1(x1). After that, the first party perturbs r1 to obtain r1-a1 and provides it to the second party, and sets the local random shard (such as the second shard of the random data table) to y1=b1. The second party receives r1-a1 and can calculate another random shard y2=p2(r1–a1)+d2+p2(r2). It is easy to verify that y1+y2=p2p1(x1+x2), which is equivalent to using the random rules of each participant to sequentially stack and randomize the data table. The two random shards y1 and y2 after random order constitute a shared form of the random data table x' obtained by superimposing two permutations p2 and p1 on the data table x. For example, y1 is the first random shard, held by the first party, and y2 is the second random shard, held by the second party.
[0057] In this way, after the secure shuffle operation, each participant cannot match the data in the table with the data in the original data table, thereby effectively protecting data privacy. In other embodiments, other secure shuffle operations may be used, such as secure shuffle operations based on the G-modules protocol, which will not be described in detail here.
[0058] The shuffle operation of the target data set in other forms is similar to the shuffle operation of the data table. One target data corresponds to one row of the data table. The first party can obtain the first shuffled fragment of the shuffled target data set, and other participating parties can obtain other shuffled fragments of the target data set.
[0059] Then, through step 202, fast sorting is performed with other participants through secure comparison of each attribute value to determine several intermediate data sets, so as to divide the first disordered shard into each first shard set corresponding to each intermediate data set.
[0060] Quick Sort is an efficient sorting algorithm. Quick Sort uses a divide-and-conquer strategy. By selecting a benchmark element, the data set is divided into two parts, one containing all elements smaller than the benchmark and the other containing all elements larger than the benchmark, and then recursively sorts the two parts. The average time complexity of Quick Sort is O(n log2n).
[0061] In an embodiment of the present specification, in order to quickly sort each target data according to the attribute value on the predetermined attribute, each participant can split the local out-of-order shards based on the security comparison of each attribute value corresponding to each target data, while disclosing the security comparison result, so as to achieve the segmentation of the target data set. The target data set can be divided into various intermediate data sets, and a single participant can hold each shard set corresponding to each intermediate data set one by one. The security comparison can adopt various conventional and feasible implementation methods, which will not be repeated here. Through a security comparison method, the size relationship between two numerical values can be determined. Usually, the result of the security comparison is in a shared form among the participants. Under the technical concept of the present specification, the security comparison result can be disclosed to each participant.
[0062] In the worst case, the time complexity of quick sort is O(n 2 ). Thus, in one embodiment, the maximum rounds of quick sort can be set. For example, the hyperparameter d is set to a predetermined depth, and each participant jointly performs at most d rounds of quick sort on the disordered target data set. In a single round, an attribute value on a predetermined attribute in the current data set is selected as a pivot element (pivot), and a secure comparison algorithm is used to compare the attribute values on all predetermined attributes in the current data set with the pivot element, and the comparison results are made public. According to the comparison results, the current data set is divided into two parts that are smaller than the pivot element and larger than the pivot element. Then, the quick sort algorithm is recursively executed on each part, and the recursion is stopped when an empty data set, a single-element data set, or a predetermined depth d is reached. In this way, the worst-case complexity can be avoided, and the target data can be divided into multiple smaller data sets. For example, 1 million target data are sorted at a depth of d=7 to obtain 100 (empty data sets are excluded, and the maximum number of quick sort results is 2 d There is a data size order between the data sets as a whole, such as the data in data set 1 is greater than any data in data set 2, the data in data set 2 is greater than any data in data set 3, and so on.
[0063] In this way, the target data after the disorder can be roughly sorted based on the attribute value of each target data on the predetermined attribute, that is, divided into multiple intermediate data sets. A single intermediate data set corresponds to at least one target data (empty data sets can be screened out). The multiple intermediate data sets divided are at least two, for example, recorded as a first data set and a second data set, then any attribute value on the predetermined attribute in one of the intermediate data sets (such as the first data set) is less than any attribute value on the predetermined attribute in another intermediate data set (such as the second data set).
[0064] Since each participant holds a single shuffled shard of the shuffled target data, the single participant can split the local shuffled shard into corresponding intermediate data set shards based on the public comparison results, for example, recorded as a shard set, and a single shard set is a corresponding shard of a single intermediate data set. The first party records each shard set obtained by splitting the first shuffled shard as each first shard set, and the single first shard set is the first shard of the corresponding single data set in the multiple data sets obtained by splitting the shuffled target data.
[0065] For example, the target data set x is shuffled to obtain the target data set x and is recorded as x′. The first shard x1′ of x′ includes the first shards of each target data after shuffling. 12 ′、x 1k ′、x 18 ′、x 1n '..., divided into each first fragment set {x 1k ′、x 18 ′……}>{……}>{x 12 '...}>..., a single first fragment set such as {x 1k ′、x 18 ′……} is the intermediate data set {x k ′, x8′…}, the first shard (corresponding to a single first shard set), and other participants hold their other shards. For example, the second party can hold its second shard {x 2k ′、x 28 '...} (such as corresponding to a single second fragment set).
[0066] Then, in step 203, through security comparison of each attribute value with other participants, merge and sort the target data contained in each intermediate data set, and adjust the order of the target data shards in each first shard set accordingly to obtain the first ordered shard of the ordered target data set sorted by attribute value size.
[0067] The merge operation, also called the merge algorithm, is an operation that can merge two sorted sequences into one sequence. The merge sort algorithm relies on the merge operation. In this specification, since the overall size relationship between the intermediate data sets has been determined, a secure merge sort can be performed on the attribute values of the target data in each intermediate data set on the predetermined attributes, and the merge results can be made public.
[0068] The following is a brief description of the idea of merge sort. Take sorting an array as an example. In the merge sort method, the array can be divided into two parts, and the two parts can be sorted separately and then merged according to the sorting results of the two parts. Among them, when sorting the single part (also an array) into which the array is divided, it can also be divided into two parts, and then each part is sorted first, and then merged. By analogy, when it is divided to a certain degree of fineness, a structure similar to a binary tree is formed. At this time, a part can have only one element, and there is no need to sort it. A simple merge is sufficient. Starting from the finest granularity, merge one level up in sequence until the merge is completed.
[0069] In the multi-party secure computation process, the benchmark element can be determined by negotiation among the participants. For example, one party randomly specifies an attribute value of a target data as the benchmark element and discloses its order to other participants. The benchmark element can also be an element at a predetermined position (such as the first, half point, last, etc.) of a random data set.
[0070] As a specific example, in the case of descending order, the disordered target data (assuming that it contains 3 target data) can be divided into two parts, one part contains the first two target data, corresponding to the first attribute value q1 and the second attribute value q2, and the latter part is the third target data, corresponding to the third attribute value q3. The size of the two attribute values q1 and q2 in the first part can be compared first. Assuming that the second attribute value q2 is greater than the first attribute value q1, each participant will exchange the corresponding fragments of the target data corresponding to the local first attribute value and the second attribute value, so as to achieve the purpose of exchanging the target data corresponding to the first attribute value and the second attribute value. Then the third attribute value q3 in the other part is merged with the part. At this time, the third attribute value q3 can be compared with the second attribute value q2. Assuming that the third attribute value q3 is greater than the second attribute value q2, the target data corresponding to the third attribute value can be adjusted to before the second attribute value q2. The target data is sorted in descending order.
[0071] For a single participant, when adjusting the order of the target data shards, only the local shard sets can be adjusted, such as the first party adjusting the first shard sets to obtain the first ordered shards. Since each participant can make the same adjustment, the adjusted ordered shards constitute the secret sharing form of the sorted target data in the ordered target data sets of each participant.
[0072] According to one embodiment, a single value in the attribute value of a single intermediate data set on a predetermined attribute can be directly used as a starting merge sequence, and then two by two are grouped together for security comparison and merged according to the attribute value comparison result, and the obtained merge sequence is further merged two by two until the single intermediate data set is merged. Merge sorting can be executed in parallel, thereby improving sorting efficiency.
[0073] Furthermore, through step 204, the first ordered fragments are grouped based on the grouping conditions satisfied by the attribute values of the target data in the ordered target data set.
[0074] It can be understood that each participant can jointly determine the grouping conditions satisfied by the attribute values of the target data in the ordered target data set, and each participant can determine the grouping situation of the local ordered slices according to the size relationship, so as to achieve the purpose of grouping the target data based on the ordered data set.
[0075] The grouping condition may be predetermined. For example, the grouping condition may be to group target data (such as recorded by user identification) with consistent attribute values on a predetermined attribute (such as years of service) into one group, or to group target data with attribute values on a predetermined attribute (such as monthly leisure expenditure) within a predetermined range (such as less than RMB 3,000, between RMB 3,000 and RMB 8,000, etc.) into one group, and so on.
[0076] When the grouping condition is to group target data with consistent attribute values on predetermined attributes, each participant can detect whether the attribute values of two adjacent target data in the ordered target data set are equal based on the security comparison between the attribute values and make the detection results public. Each participant will divide the corresponding target data shards with equal attribute values in the local ordered shards into the same group according to the detection results. For example, the first party divides the corresponding target data shards with equal attribute values in the first ordered shard into the same group. Among them, the attribute values of the two target data (such as the first value a and the second value b) are equal, that is, a equal b, which can be equivalent to a not less than b and b not less than a, that is,
[0077] !(a < b) &&!(b < a). Herein, 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 result 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 result determined in the merge sort process to save secure computing volume and communication volume.
[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 splitting points for each group without disclosing 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 ranked 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] Looking back on the above process, in the method for 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 a quick sort and a 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 through the method of first securely disordering and then quickly sorting, it is possible to use the merge sort that is easier to execute in parallel to increase the possibility of parallel execution, with its complexity reduced to O(n * log2n) and being more efficient.
[0081] According to an embodiment of another aspect, there is also provided an apparatus for multi-party data secure grouping. This apparatus can be set in a computer, a terminal, or a server with certain computing capabilities of any participating party in multi-party secure computing. This apparatus 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. 400 shows an apparatus for multi-party data secure grouping according to an embodiment. As Figure 4 As shown, the apparatus 400 may include:
[0083] The shuffling unit 401 is configured to perform a secure shuffling operation with other participants to obtain a first shuffled fragment of the shuffled target data set;
[0084] The first sorting unit 402 is configured to perform fast sorting with other participants through secure comparison of each attribute value to determine a plurality of intermediate data sets, so as to divide the first disordered shards into respective first shard sets corresponding to the respective intermediate data sets, wherein the plurality of data sets at least include the first data set and the second data set, and any attribute value of the predetermined attribute in the first data set is less than any attribute value of the predetermined attribute in the second data set;
[0085] The second sorting unit 403 is configured to perform merge sorting on the target data contained in each intermediate data set through security comparison of each attribute value with other participants, and adjust the sequence of the target data fragments in each first fragment set accordingly, to obtain the first ordered fragments of the ordered target data set sorted according to the attribute value size;
[0086] The grouping unit 404 is configured to group the first ordered fragments based on the grouping condition satisfied by the attribute value of the target data in the ordered target data set.
[0087] It is worth mentioning that Figure 4 The device 400 shown is Figure 2 The method described corresponds to Figure 4 The corresponding description in the illustrated method embodiment is also applicable to the device 400 and will not be repeated here.
[0088] According to another embodiment, there is also provided a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute a combination of Figure 2 The method described by et al.
[0089] According to another embodiment of the present invention, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the Figure 2 The method described in the above examples should be appreciated by those skilled in the art that the functions described in the embodiments of this specification can be implemented by hardware, software, firmware, or any combination thereof in one or more of the above examples. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0090] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the technical concept of this specification. It should be understood that the above description is only the specific implementation method of the technical concept of this specification, and is not used to limit the protection scope of the technical concept of this specification. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the embodiments of this specification should be included in the protection scope of the technical concept of this specification.
Claims
1. A method for secure grouping of multi-party data, used in multi-party secure computing, to group multiple pieces of target data in a target data set securely held by multiple participants according to predetermined attributes, wherein each piece of target data corresponds to each attribute value in a secret sharing form on the predetermined attribute; The plurality of parties include a first party, and the method is performed by the first party, comprising: Perform a secure shuffle operation with other participants to obtain the first shuffled fragment of the shuffled target data set; Performing quick sorting with other participants through secure comparison of each attribute value to determine a number of intermediate data sets, thereby dividing the first out-of-order shards into first shard sets corresponding to each intermediate data set, the several data sets include a first data set and a second data set, and any attribute value on a predetermined attribute in the first data set is less than any attribute value on a predetermined attribute in the second data set; Through security comparison of each attribute value with other participants, merge and sort the target data contained in each intermediate data set, and adjust the order of the target data shards in each first shard set accordingly, to obtain the first ordered shards of the ordered target data set sorted by attribute value size; The first ordered fragments are grouped based on a grouping condition satisfied by the attribute values of the target data in the ordered target data set.
2. The method of claim 1, wherein: Each participant has a corresponding disorder rule, and the result of the safe disorder operation is: the target data in the target data set is disordered by using the disorder rules of each participant in sequence, and each participant obtains each fragment of the disordered target data set.
3. The method of claim 1, wherein: The method of performing quick sorting by secure comparison of each attribute value with other participants to determine a number of intermediate data sets, thereby dividing the first random shards into first shard sets corresponding to each intermediate data set respectively includes: Negotiate with other data parties an attribute value in the disordered target data set as a reference element, and perform a secure comparison between other attribute values and the reference element to obtain a secure comparison result; Dividing the first out-of-order shards into two shard sets according to the security comparison result; For each shard set, continue to negotiate with other data parties for benchmark elements for security comparison, recursively split, and stop when encountering an empty data set, a single-element data set, or reaching a predetermined depth, so as to obtain each first shard set, and each first shard set is the first shard of each intermediate data set.
4. The method of claim 1, wherein: The performing merge sorting on the target data contained in each intermediate data set by securely comparing each attribute value with other participants includes: For a single intermediate data set, perform a secure comparison of two attribute values with other participants and obtain the comparison results; According to the comparison result, each first fragment in the corresponding single first fragment set is determined as a fragment sequence corresponding to at most two target data; The merging operation is continued to be performed on the fragment sequence until the first fragments in the corresponding single first fragment set are arranged into a sequence according to the order of magnitude of the attribute values in the single intermediate data set.
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 condition satisfied by the attribute values of the target data in the ordered target data set includes: Based on the security comparison with other participants, detect whether the attribute values of two adjacent target data in the ordered target data set are equal and obtain the detection result; According to the detection result, the target data fragments with equal corresponding attribute values in the first ordered fragments are divided into the same group.
6. The method of claim 5, wherein: The attribute values of two adjacent target data in the ordered target data set include adjacent first values and second values. The detecting whether the attribute values of two adjacent target data in the ordered target data set are equal and obtaining the detection result based on the security comparison with other participants includes: Check 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; In the case where the second value is not less than the first value, it is determined that the first value and the second value are 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 securely grouping multi-party data, used in multi-party secure computing, to group multiple target data in a target data set securely held by multiple participants according to predetermined attributes, wherein each target data corresponds to each attribute value in a secret sharing form on the predetermined attribute; The multiple parties include a first party, and the device is provided at the first party, including: A shuffling unit, configured to perform a secure shuffling operation with other participants to obtain a first shuffled fragment of the shuffled target data set; A first sorting unit is configured to perform fast sorting with other participants through secure comparison of each attribute value to determine a plurality of intermediate data sets, so as to divide the first out-of-order shards into respective first shard sets corresponding to the respective intermediate data sets, wherein the plurality of data sets include a first data set and a second data set, and any attribute value on a predetermined attribute in the first data set is less than any attribute value on a predetermined attribute in the second data set; The second sorting unit is configured to perform merge sorting on the target data contained in each intermediate data set through security comparison of each attribute value with other participants, and adjust the sequence of the target data shards in each first shard set accordingly to obtain the first ordered shards of the ordered target data set sorted according to the attribute value size; The grouping unit is configured to group the first ordered fragments based on a grouping condition satisfied by an attribute value of the target data in the ordered target data set.
9. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 7.
10. A computing device comprising a memory and a processor, characterized in that: The memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Secure grouping method and device
CN116011018A
Secure sorting method and device
CN116108084A
Ranking datasets based on data attributes
US20220197914A1
Multi-Pivot Partial Quicksort and Oblivious Comparisons of Secret Shared Arithmetic Values in a Multi-Party Computing Setting
US20230016859A1
Privacy-preserving computation using secret step size
WO2024251611A1