Multi-party secure computation systems, methods, devices, storage media, and program products
By setting the number of secure output tuples and adding virtual tuples in the multi-party secure computation system, the problem of intermediate result leakage is solved, the privacy and integrity of query results are protected, and system performance is improved.
Patent Information
- Application Number
- CN202511009905.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-07-22
AI Technical Summary
Existing secure multi-party computation systems may leak sensitive information and compromise system security due to changes in the size of intermediate results during database query operations.
By setting a safe number of output tuples in the intermediate nodes of the query tree and adding virtual tuples to fix the length of intermediate results when the actual output is less than the safe output, and by removing invalid tuples when restoring the initial query results, the integrity and correctness of the final results are ensured.
It effectively prevents the leakage of data characteristics due to the scale of intermediate results, ensures the privacy and integrity of query results, reduces communication traffic, and improves system throughput and response speed.
Smart Images

Figure CN120524522B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] One or more embodiments of the present specification relate to the technical field of privacy computing, and in particular to a multi-party secure computing system, a multi-party secure computing method, an electronic device, a computer readable storage medium, and a computer program product. BACKGROUND
[0002] In the field of data analysis and information processing, with the development of big data technology, the demand for joint computing between different data subjects is increasing, especially in scenarios involving privacy-sensitive information, such as financial risk control, medical research, government collaboration, etc. To meet the computing needs of security compliance, multi-party secure computing (MPC) technology has emerged. In existing multi-party secure computing systems, multiple computing participants are usually allowed to collaborate to complete specific query tasks without revealing the original data of the data subjects.
[0003] In practical applications, to support common database query operations such as selection, join, sorting, projection, aggregation, etc., existing multi-party secure computing systems usually adopt the strategy of combining these operations in the form of secure operators in sequence. However, in such a combination process, the size of the intermediate results output by each operator may vary depending on the characteristics of the specific input data. If the size of the intermediate results is transmitted without masking, sensitive information such as field distribution, join hit rate, filtering effect, etc. may be leaked, seriously affecting the overall security of the system. SUMMARY
[0004] Therefore, one or more embodiments of the present specification provide a multi-party secure computing system, a multi-party secure computing method, an electronic device, a computer readable storage medium, and a computer program product.
[0005] To achieve the above-mentioned purpose, one or more embodiments of the present specification provide technical solutions as follows:
[0006] According to a first aspect of one or more embodiments of the present specification, a multi-party secure computing system is provided, comprising a data holding party, a data querying party, and N computing participants, N > 1;
[0007] The data holding party is configured to split the data table held by itself into N secret sub-tables according to a preset secret sharing algorithm, and send the N secret sub-tables to the N computing participants respectively; the table structure of the N secret sub-tables is the same as that of the data table;
[0008] The computing participant is configured to receive and store the secret sub-tables;
[0009] The data querying party is configured to send a query statement to the computing participant;
[0010] The computing participant is further configured to determine a query tree of the query statement, leaf nodes of the query tree representing data tables specified by the query statement, and intermediate nodes of the query tree representing operation operators specified by the query statement, the intermediate nodes being provided with a safe output tuple number;
[0011] The computing participant is further configured to, based on secret sub-tables corresponding to the leaf nodes of the query tree, execute each intermediate node in an execution order of the query tree from the leaf nodes to the intermediate nodes in cooperation with other computing participants, and if there is an intermediate node whose actual output tuple number is less than the safe output tuple number of the intermediate node, add a virtual tuple to the actual output of the intermediate node to meet the safe output tuple number, the virtual tuple carrying a secret shard with an invalid mark; and after the query tree is executed, generate a secret shard of a query result and return the secret shard to the data query participant.
[0012] The data query participant is further configured to receive secret shards of query results returned by the N computing participants respectively, recover an initial query result from the N secret shards of query results, and remove the virtual tuple carrying the invalid mark from the initial query result to obtain a target query result.
[0013] According to a second aspect of the embodiments of the present specification, a multi-party secure computing method is provided, applied to the computing participant of the first aspect, and the method comprises:
[0014] receiving and storing secret sub-tables sent by any data holding participant, and receiving a query statement sent by any data query participant;
[0015] determining a query tree of the query statement, leaf nodes of the query tree representing data tables specified by the query statement, and intermediate nodes of the query tree representing operation operators specified by the query statement, the intermediate nodes being provided with a safe output tuple number;
[0016] based on secret sub-tables corresponding to the leaf nodes of the query tree, executing each intermediate node in an execution order of the query tree from the leaf nodes to the intermediate nodes in cooperation with other computing participants, and if there is an intermediate node whose actual output tuple number is less than the safe output tuple number of the intermediate node, adding a virtual tuple to the actual output of the intermediate node to meet the safe output tuple number, the virtual tuple carrying a secret shard with an invalid mark;
[0017] after the query tree is executed, generating a secret shard of a query result and returning the secret shard to the data query participant.
[0018] According to a third aspect of the embodiments of the present specification, a multi-party secure computation method is provided, applied to the data query party of the first aspect, and the method comprises:
[0019] sending the query statement to the computing participants; and
[0020] receiving secret shards of query results returned by the N computing participants respectively, recovering an initial query result from the N secret shards of query results, and removing virtual tuples carrying invalid labels existing in the initial query result to obtain a target query result.
[0021] According to a fourth aspect of the embodiments of the present specification, an electronic device is provided, comprising:
[0022] a processor;
[0023] a memory for storing processor-executable instructions;
[0024] wherein the processor executes the executable instructions to implement the method of the second aspect or the third aspect.
[0025] According to a fifth aspect of the embodiments of the present specification, a computer-readable storage medium is provided, which stores a computer program, and the program is executed by a processor to implement the steps of the method of the second aspect or the third aspect.
[0026] According to a sixth aspect of the embodiments of the present specification, a computer program product is provided, comprising a computer program, and the computer program is executed by a processor to implement the steps of the method of the second aspect or the third aspect.
[0027] The technical solutions provided by the embodiments of the present specification can include the following beneficial effects:
[0028] In the embodiments of the present specification, by introducing a secure output control mechanism in the query execution process, the number of secure output tuples is set for each intermediate node in the query tree, and when the actual output size is less than the number of secure output tuples, virtual tuples carrying invalid label secret shards are automatically filled, so that the intermediate result is externally presented as a fixed length, thereby effectively preventing the potential information leakage risk of inferring data characteristics or query paths through the intermediate output size. At the same time, in order to avoid the interference of virtual tuples on the final query result, the data query party can accurately remove all virtual tuples by identifying invalid fields after receiving and recovering the initial query result, thereby ensuring the integrity and correctness of the final output result.
[0029] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present specification. BRIEF DESCRIPTION OF DRAWINGS
[0030] Figure 1 FIG. 1 is a schematic diagram of an architecture of a multi-party secure computation system according to an example embodiment.
[0031] Figure 2 FIG. 2 is a schematic diagram of splitting a data table into three secret tables according to an example embodiment.
[0032] Figure 3A FIG. 3 is a schematic diagram of a candidate query tree (1) according to an example embodiment.
[0033] Figure 3B FIG. 4 is a schematic diagram of a candidate query tree (2) according to an example embodiment.
[0034] Figure 4 FIG. 5 is a schematic diagram of a join operation according to an example embodiment.
[0035] Figure 5 FIG. 6 is another schematic diagram of a join operation according to an example embodiment.
[0036] Figure 6 FIG. 7 is yet another schematic diagram of a join operation according to an example embodiment.
[0037] Figure 7 FIG. 8 is a schematic diagram of updating a secret shard of a permutation number corresponding to a non-join field in a first replicated secret table according to an example embodiment.
[0038] Figure 8 FIG. 9 is a flowchart of a multi-party secure computation method according to an example embodiment.
[0039] Figure 9 FIG. 10 is a schematic diagram of an electronic device according to an example embodiment. DETAILED DESCRIPTION
[0040] The example embodiments will be described in detail herein with reference to the attached drawings. The description of the example embodiments is intended to apply to all alternative modifications and variations of these example embodiments, unless it is otherwise indicated. Other aspects of the example embodiments relate to, and fully describe, various features, structures, or characteristics of the example embodiments. Accordingly, common or overlapping features between the examples embodiments are not typically repeated in every example embodiment. Further, to avoid obscuring the example embodiments, not all features of each example embodiment are necessarily shown in each of the drawings used to describe the example embodiments.
[0041] It should be noted that the steps of the corresponding method are not necessarily performed in the order shown and described in the specification in other embodiments. In some other embodiments, the steps included in the method thereof can be more or less than described in the specification. In addition, a single step described in the specification can be divided into multiple steps for description in other embodiments, and multiple steps described in the specification can be combined into a single step for description in other embodiments.
[0042] The user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the specification are information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.
[0043] In recent years, secure multi-party computation (MPC, Secure Multi-Party Computation) enables multiple data subjects to collaborate to perform complex queries on their private data, while only exposing the final results and not revealing any intermediate information. This feature exactly meets the needs of banks, insurance companies, medical institutions and other fields to share insights while protecting customer privacy.
[0044] Please refer to Figure 1 The embodiment of the specification provides a multi-party secure computing system, including a data holder, a data query party and N computing participants, N>1. The data holder can be at least one, and the computing participants include at least two, such as Figure 1 As shown, there can be three computing participants to realize three-party secure computation. Different computing participants can come from different computing institutions or from the same computing institution, and the embodiment does not make any limitation on this. Each computing participant can include a physical server, a server cluster or a virtual server, but is not limited thereto.
[0045] The data holder is configured to split a data table held by itself into N secret sub-tables according to a preset secret sharing algorithm, and send the N secret sub-tables to the N computing participants respectively; the table structure of the N secret sub-tables is the same as that of the data table.
[0046] It can be understood that the embodiment of the specification does not make any limitation on the secret sharing algorithm, and can be specifically selected according to the actual application scene. Under a general architecture, the data holder splits a data table held by itself into N secret sub-tables, and sends the N secret sub-tables to the N computing participants respectively, and each computing participant obtains at least one of the N secret sub-tables.
[0047] For example, please refer to Figure 2 , the data table is split into 3 secret sub-tables, and distributed to 3 computing participants respectively.
[0048] In one possible implementation, the data holder splits the original data into 3 mutually different secret sub-tables according to the traditional secret sharing protocol, and distributes each secret sub-table to a corresponding computing participant. Each computing participant only receives one secret sub-table, and all computing operations are based on the local share and collaborative computing with other parties.
[0049] In another possible implementation, the data holder uses the Replicated Secret Sharing algorithm, and the data table is divided into multiple "shares" and distributed among multiple computing participants. The purpose is to ensure that even if some computing participants fail or are attacked, the remaining computing participants can still recover the original information. Therefore, each computing participant obtains two of the three secret sub-tables, for example, computing participant 1 obtains secret sub-table 1 and secret sub-table 2, computing participant 2 obtains secret sub-table 1 and secret sub-table 3, and computing participant 3 obtains secret sub-table 2 and secret sub-table 3.
[0050] It should be noted that regardless of the secret sharing algorithm used, the processing flow performed by each computing participant for each secret sub-table it receives remains consistent. The encryption sorting, connection judgment, secure comparison, rearrangement permutation, and other computing tasks are all based on the local secret sub-table and are completed in collaboration with other computing participants without accessing the complete original data, thereby ensuring that the system complies with the privacy protection constraints of multi-party secure computation throughout the process.
[0051] Among them, "The table structure of the N secret sub-tables is the same as that of the data table" means that the secret sub-tables after splitting are completely consistent with the original data table in terms of data organization form, field definition and constraint relationship, including but not limited to:
[0052] (1) The number of fields is the same. The secret sub-tables contain exactly the same fields (columns) as the original data table, for example, the original table has "ID", "Name", and "Age" three fields, and each secret sub-table must also contain these three fields, without adding or reducing fields.
[0053] (2) The field types are the same. The data type (such as integer, string, date, etc.) and length constraint of each field are consistent with the original table. For example, the "Age" field in the original data table is of integer type, and the field in the secret sub-table must also be of integer type, and the value range (such as whether to allow null, whether to have a default value, etc.) remains consistent.
[0054] (3) Primary key is the same as index. If the original data table has a primary key (e.g., "ID" as the primary key) or an index, the secret split table will also retain the definition of the primary key or the index (although the actual data may be stored in shards, the constraint rules still exist).
[0055] (4) Foreign key is the same as the association. If the original data table involves foreign key association (e.g., referencing the fields of other tables), the secret split table will still retain the definition of the foreign key field to ensure that the data after splitting can still be logically associated with other tables.
[0056] (5) The field name is the same. The table name of the secret split table can be customized (e.g., "secret split table 1"), but the field name must be exactly the same as the original data table, so that the same fields can be aligned and processed in subsequent collaborative calculations.
[0057] (6) The format of each row of data (one row of data is a tuple) is the same: each row of data in the secret split table is the same as the original data table, containing the values of all fields (although the specific values may be the shards or encrypted values of the original data).
[0058] It can be understood that the embodiments of the present specification do not make any restrictions on the secret sharing algorithm, and the existing secret sharing algorithm in the related art can be directly applied.
[0059] For example, the data holder is also used to send the metadata of the data table to the N computing participants. The metadata of the data table can include field names, annotations (such as "user ID", "transaction amount", etc.), field types (such as integer, string, date), length limits (such as the "mobile phone" field is 11-bit string), constraint rules (such as primary key, non-empty, unique, etc.), to ensure that all computing participants have consistent semantic understanding of the data.
[0060] The computing participant is used to receive and store the metadata of the data table and the secret split table sent by any data holder.
[0061] The data query party is used to send a query statement to the computing participant. For example, the metadata of the data table can be disclosed to the data query party by the data holder, and the metadata includes field names, data types, index information, connection relationships, etc. The data query party can construct a legal query statement based on the metadata, and specify the query target field and the query type (such as selection, projection, aggregation, etc.).
[0062] The computing participant is also configured to receive a query statement, determine a query tree of the query statement, wherein a leaf node of the query tree represents a data table specified by the query statement, and an intermediate node of the query tree represents an operation operator specified by the query statement, and the intermediate node is provided with a safe output tuple number. The safe output tuple number provided for the intermediate node can effectively control the output size, can be used as a privacy protection boundary condition, can avoid the intermediate node output size from leaking data distribution, and can strengthen the overall computing privacy.
[0063] In a possible implementation, the query tree can be generated by a main computing participant in the N computing participants by parsing the query statement, and is synchronized to other computing participants.
[0064] In another possible implementation, each computing participant can parse the query statement, so that each computing participant generates a query tree. Since the parsing logics of all the computing participants are consistent, it is ensured that the query trees generated by the computing participants for the same query statement are consistent. In a scenario without centralized coordination, the computing participants can parse the query statement in parallel, reduce additional synchronization transmission operations, and improve the system concurrent processing capability.
[0065] In some embodiments, to improve the query execution efficiency and reduce the computing and communication burden in the multi-party secure computing process, the computing participant is specifically configured to parse the query statement to generate a plurality of candidate query trees, and the execution order of the operation operators specified by the query statement is at least partially different in different candidate query trees, that is, different candidate query trees represent different operator execution orders, and the structures of the different candidate query trees can be different in connection order, projection / filtering position, and the like. The computing participant further counts the number of fields involved in the execution process of the intermediate nodes in the candidate query trees based on the metadata of the data tables specified by the query statement, for example, the columns to be spliced in the connection, the fields to be reserved before the aggregation, and the like. Subsequently, the computing participant selects, from the plurality of candidate query trees, a query tree with the least number of involved fields based on the number of fields involved in the intermediate nodes in each candidate query tree. The selected query tree involves the least number of fields, which means that fewer data items are involved in the operations such as sorting, comparison, splicing, replication, and aggregation, thereby significantly reducing the encryption operation cost in the operator execution process. The multi-party secure computing process needs to frequently exchange encrypted intermediate results among the computing participants, and the reduction of the number of fields directly leads to the reduction of the size of the intermediate results, thereby reducing the communication traffic and improving the overall system throughput. Moreover, the reduction of the number of fields can make the query tree generate fewer intermediate data tables and smaller data blocks during the execution process, which helps to speed up the task execution progress and response speed, and is especially suitable for low-latency query scenarios. All the candidate query trees are selected based on the metadata, without exposing any field value or record content, so that the sorting optimization process does not damage the original privacy protection mechanism.
[0066] For example, taking a three-table join query of R1(A, B) Join R2(B, C) Join R3(C, D, E) as an example, the data table R1 contains fields (A, B), the data table R2 contains fields (B, C), and the data table R3 contains fields (C, D, E). The computing participant generates two candidate query trees for the three-table join query as shown in FIGS. 1 and 2. Figure 3A and Figure 3B The first join operator of the candidate query tree (1) shown in FIG. 1 is used to implement the join between R1 and R2, involving 4 field quantities, to obtain the intermediate table R4 (A, B, C). The second join operator is used to implement the join between R3 and R4, involving 6 field quantities. Figure 3A The first join operator of the candidate query tree (2) shown in FIG. 2 is used to implement the join between R2 and R3, involving 5 field quantities, to obtain the intermediate table R4 (B, C, D, E). The second join operator is used to implement the join between R1 and R4, involving 6 attributes. In comprehensive comparison, the candidate query tree (1) involves fewer field quantities, and the required computing and communication overheads are smaller. The candidate query tree (1) can be selected as the final query tree. Figure 3B
[0067] In some embodiments, if the query statement involves a join query of at least two data tables, to avoid processing a large number of final useless intermediate tuples in subsequent join or aggregation operations, before executing the query tree, the computing participant can perform a semi-join operation with other computing participants based on the secret sub-tables corresponding to the at least two data tables specified in the query statement, to check whether the tuples in the secret sub-tables participate in the query result, to obtain secret shards of the checking results of the tuples. The semi-join is a filtering sub-operation of a simplified join operation, and its logical meaning is: given two data tables R and S, performing R ⋉ S means "finding all tuples in R that have a matching item of the join field in S", but not concatenating the fields of S into the result. All tuples in R that have a matching item of the join field in S are the tuples participating in the query result, and the tuples in R that cannot find a matching item of the join field in S will not appear in the final query result in any join operation (such as an equi-join or an inner join). The description of the semi-join operation process can be referred to the following description of the semi-join operator, which is not repeated here.
[0068] After obtaining the secret shares of the check results of the respective tuples, the computing participant further collaborates with other computing participants to generate secret shares of a label field for the respective tuples based on the secret shares of the check results of the respective tuples; wherein the label field corresponding to a tuple participating in the query result is a secret share of a valid label, and the label field corresponding to a tuple not participating in the query result is a secret share of an invalid label, thereby filtering out the tuples not participating in the query result. In this way, the system can mark and filter out the invalid tuples in advance without performing complete connection, only with a small amount of communication and comparison cost. In the secret sharing environment, the cost of data transmission and processing is relatively high. By pre-screening to remove invalid tuples, the number of ciphertext data blocks that need to be synchronized can be reduced, and the total amount of communication can be reduced. The semi-join operation only performs encrypted comparison based on the secret sharing form of the field value, and generates secret shares of the label field, without leaking the field value, matching relationship or whether to retain information of any tuple, meeting the privacy requirements of multi-party computation for access pattern hiding and output size non-leakage.
[0069] In some embodiments, the setting of the number of secure output tuples of the intermediate node is exemplarily illustrated as follows:
[0070] Firstly, the computing participant can determine the final output size of the current query in one of the following two ways. One way is that the computing participant collaborates with other computing participants to estimate the final output tuple number of the query statement based on the secret shared data of the data table specified by the query statement. Another way is that the computing participant can obtain the final output tuple number set uniformly for the query statement in advance.
[0071] Secondly, the computing participant can estimate the intermediate output tuple number of each intermediate node in the query tree based on the metadata of the data table specified by the query statement. Exemplarily, if the input data table of the intermediate node is one (such as selection, projection), the intermediate output tuple number of the intermediate node is determined by the tuple number of the input data table, such as the intermediate output tuple number of the intermediate node is the tuple number of the input data table; if the input data table of the intermediate node is more than one (such as semi-join, join), the intermediate output tuple number of the intermediate node is determined by the product of the tuple numbers of the input data tables, such as the input data table of the intermediate node has two, and the intermediate output tuple number of the intermediate node is the product of the tuple numbers of the two input data tables, to represent the connection result size in the worst case.
[0072] Finally, for each intermediate node, the computing participant sets the minimum value of the final output tuple number and the intermediate output tuple number of the intermediate node as the secure output tuple number of the intermediate node, which ensures that the upper limit of the output result size is reasonable and does not leak the data distribution or the calculation path characteristics due to the generation of a large number of temporary results by a certain intermediate operator.
[0073] By setting the number of secure output tuples for the intermediate nodes of the query tree, information leakage can be effectively prevented, and sensitive attributes such as field selectivity, connection density, and data distribution can be avoided from being inferred from the actual number of output tuples of the intermediate nodes; for attackers in a multi-party secure computing environment, the amount of intermediate data appears to be a controlled fixed length, and there is no difference in the number of tuples that can be exploited.
[0074] For example, if the final output limit is 10,000, and the intermediate node estimates the result to be 1,000,000, the number of secure output tuples of the connection node is limited to 10,000; in actual execution, if only 3,000 tuples are output, the system will fill in 7,000 virtual tuples, so that the intermediate output in ciphertext form is indistinguishable from other nodes.
[0075] The computing participant is also configured to execute each intermediate node from the leaf node upwards layer by layer according to the execution order of the query tree in cooperation with other computing participants based on the secret partition table corresponding to the leaf node of the query tree, and if the number of tuples actually output by the intermediate node is less than the number of secure output tuples of the intermediate node, virtual tuples are added to the actual output of the intermediate node to meet the number of secure output tuples, and the virtual tuples carry invalid secret shards; the virtual tuples use meaningless placeholder values in data content, and each virtual tuple carries an invalid secret shard indicating that the tuple is an invalid tuple; wherein, a valid tuple can carry a valid secret shard to facilitate the differentiation of virtual tuples. After the query tree is executed, the secret shards of the query results are generated and returned to the data query party.
[0076] The data query party is also configured to receive the secret shards of the query results returned by the N computing participants respectively, and recover the initial query result from the N secret shards of the query results. In the initial result, there can be virtual tuples filled for privacy protection. Therefore, the data query party can eliminate the virtual tuples carrying invalid markers in the initial query result to obtain the target query result.
[0077] For example, an intermediate node involving a connection operator actually outputs only 5 results, but the system sets the secure output of the intermediate node to 100, so the system will add 95 virtual tuples; when the final query result is returned, the data query party recovers the result containing 100 tuples, but eliminates invalid tuples through the marker field and only outputs the correct 5 results.
[0078] The system can achieve the following beneficial effects: (1) an external or malicious party cannot infer sensitive information such as input data distribution, selectivity, connection density, etc. by the number of output tuples, thereby ensuring the key output privacy in multi-party computation; (2) although the intermediate output result is filled with invalid virtual tuples, the virtual tuples carry encrypted invalid markers, and the data querying party can accurately identify and remove the virtual tuples based on the markers during recovery, without affecting the correctness or integrity of the result.
[0079] In some embodiments, when processing complex data query requests, especially involving database operations such as sorting, filtering, joining, and aggregation, comparison, judgment, or grouping of a certain field is often involved. These operations can be efficiently completed in traditional plaintext databases, but face significant challenges in the MPC environment. Since the computing participants hold encrypted data, they cannot directly compare the size of any two data items or determine the order between data items. If plaintext comparison or exchange is directly performed, data privacy will be leaked. Therefore, in the MPC environment, a special secure sorting protocol (such as a protocol based on comparison circuits or sorting networks) must be used to sort data in an encrypted state. Traditional methods re-sort data securely once for each query, which causes the sorting operation to become a performance bottleneck during the overall query execution process. In particular, in cases where the data size is large, queries are frequent, or the combination logic is complex, the consumption of computing resources significantly increases, and the execution efficiency is severely limited.
[0080] Therefore, in the embodiments of the present specification, the process of "secure sorting" is changed from being performed for each query to being performed only once before data import or the first query, and the sorting information is obtained and saved, so that the sorting information can be reused in the subsequent query process, thereby effectively reducing repeated calculation and redundant communication and improving query efficiency.
[0081] The data holder is configured to send metadata of the data table to the N computing participants, and send N secret sub-tables of the data table to the N computing participants, respectively.
[0082] The computing participant is configured to receive and store the secret sub-tables, and determine all target fields that need to be sorted based on the metadata in the data table. For example, based on the description information of each field in the metadata, the connection field, the aggregation field, the projection field, etc. can be determined as the target fields that need to be sorted.
[0083] The computing participant is further configured to extract secret sharing columns of the target fields that need to be sorted from the secret sub-tables. For example, please refer to Figure 2Assuming that field 3 is determined as the target field, and taking each computing party holding 1 share of the secret table as an example, the computing party 1 extracts the secret sharing column of field 3 from the secret table 1, that is, {g1, k1, l1}, the computing party 2 extracts the secret sharing column of field 3 from the secret table 1, that is, {g2, k2, l2}, and the computing party 3 extracts the secret sharing column of field 3 from the secret table 3, that is, {g3, k3, l3}.
[0084] The computing party is also configured to execute a preset secure sorting algorithm with other computing parties based on the secret sharing column of the target field, to obtain a sorted secret sharing column. In this case, the N computing parties perform a secure comparison operation on each secret sharing value of the target field under the secret sharing data structure based on the secure sorting algorithm, collaboratively calculate the arrangement position of each secret sharing value in the sorting result, and perform a secure permutation operation based on the arrangement position to rearrange the corresponding secret sharing value, thereby generating the sorted secret sharing column. In the secure sorting process, each computing party completes the collaborative calculation without revealing any input value, comparison result or sorting order, thereby ensuring that the entire sorting operation process has complete privacy protection capability. It can be understood that after the secure sorting, the arrangement position of each secret sharing value in the sorted secret sharing column is naturally its arrangement serial number.
[0085] The computing party is also configured to determine, based on the sorted secret sharing column, a secret shard of the arrangement serial number corresponding to each secret sharing value in the sorted secret sharing column in collaboration with other computing parties.
[0086] In a possible implementation, the computing party is specifically configured to, in the case of being a master computing party, after obtaining the sorted secret sharing column, generate a unique arrangement serial number corresponding to each secret sharing value in the sorted secret sharing column; split each arrangement serial number into N secret shards based on a preset secret sharing algorithm, retain one secret shard, and send the other N-1 secret shards to the other N-1 computing parties. In this embodiment, although the master computing party generates the plaintext arrangement serial number, since each computing party can only see its own secret shard of the arrangement serial number after the secret sharing of the plaintext arrangement serial number, the plaintext arrangement serial number cannot be restored, and thus the plaintext arrangement serial number continues to be used in an encrypted state in the subsequent query operation without revealing any sorting details. The plaintext arrangement serial number is centrally generated by the master computing party, and is uniformly split into secret shards and distributed to each party, which is simple in operation, clear in logic, and low in implementation overhead.
[0087] In another possible implementation, each computing participant, specifically for after obtaining the sorted secret sharing column, generates a unique permutation serial number corresponding to each secret sharing value in the sorted secret sharing column; splits each permutation serial number into N secret shards based on a preset secret sharing algorithm, and retains a specified one of the N secret shards. In this embodiment, all computing participants know that "n values are to be sorted", and all have the sorted secret sharing column, so each computing participant can independently generate a secret shard of the permutation serial number, so as to continue to be used in an encrypted state in subsequent query operations without revealing any sorting details. All computing participants independently generate a secret shard of the sorting serial number responsible for themselves locally, without relying on a main computing participant or centralized operation, and are suitable for a distributed environment without a trusted main participant, without the need to transmit the secret shard of the serial number between the computing participants, and reduce the system communication burden.
[0088] Both of the above two implementation manners can ensure that the finally generated permutation serial number is stored and used in the form of secret sharing, avoiding the leakage of sensitive information such as sorting position or relative size in the sorting result.
[0089] The data query participant is configured to send a query statement to the computing participant.
[0090] The computing participant is configured to determine the query tree based on the above-described process, and cooperatively execute the query tree with other computing participants. In the process of cooperatively executing each intermediate node in the query tree with other computing participants, if the input data table of the intermediate node involves a target field, the secret shard corresponding to the input data table is rearranged according to the secret shard of the permutation serial number corresponding to the target field, to obtain a rearranged secret shard; and the operation indicated by the intermediate node is cooperatively executed with other computing participants based on the rearranged secret shard.
[0091] In this embodiment, the inventors find in the process of implementing the multi-party secure computing system described in this specification that in a three-party secure computing environment, a traditional secure query scheme usually needs to perform a secure sorting operation at each query, and the computational complexity is usually O(n*log(n)) or O(n^2), where n represents the number of tuples in the data table participating in the query, thereby causing significant query delay and communication burden, especially in high-frequency access or large data volume scenarios, affecting the real-time performance and scalability of the system.
[0092] The embodiment of the present specification proposes a query preprocessing optimization mechanism, which moves the security sorting operation originally repeated in the query stage to the data import stage or the first query stage, and caches the sorting results in the form of secret shards of arrangement serial numbers in the computing participants. In the subsequent query process, the computing participants can directly reuse the generated secret shards of arrangement serial numbers, and only need to complete a lightweight rank value based encryption rearrangement operation with other computing parties, to achieve the equivalent sorting effect, without re-executing the high overhead comparison and exchange protocol. Through the above optimization, the sorting overhead in the query path is significantly reduced from the traditional nearly logarithmic complexity O(n ) or O( ) to linear complexity O(n), effectively compresses the query delay, and greatly improves the real-time response ability and high-frequency query processing ability of the system. Moreover, the arrangement serial numbers are in the form of secret shards, and no field value, sorting order or data distribution characteristics are leaked in the entire query process, fully meeting the privacy protection requirements of multi-party computation. During the rearrangement and query operation process, all sorting information, arrangement serial numbers and data tables remain in a secret sharing state, without revealing the sorting order, field size relationship or real data content, ensuring the privacy of the entire query process.
[0093] The execution processes of different types of operation operators are exemplarily described as follows:
[0094] 1. Selection operator. The selection operator is used to filter out the tuple subset that meets the specified query condition. Since the data table is distributed in the form of secret sharing among multiple computing participants, it is not possible to directly judge whether the tuple value meets the query condition, so it is necessary to execute it through multi-party secure computation protocol.
[0095] If the operation operator of the intermediate node includes a selection operator, the computing participants can determine whether each tuple in the secret table corresponding to the input data table of the selection operator meets the query condition based on the query condition of the selection operation, and obtain the secret shard of the judgment result of each tuple; then the computing participants generate the secret shard of the mark field for each tuple based on the secret shard of the judgment result of each tuple in cooperation with other computing participants; wherein the mark field is used to indicate whether the tuple is valid, and the mark field corresponding to the tuple that meets the query condition is the secret shard of the valid mark, and the mark field corresponding to the tuple that does not meet the query condition is the secret shard of the invalid mark. The invalid tuples can be masked or ignored through the mark field in the subsequent query to ensure the accuracy of the query result.
[0096] To maintain the order and accuracy of the permutation order, after the selection, the permutation order on the target field needs to be updated. The computing participant can re-arrange the secret shards of the permutation order corresponding to the target field in the input data table in collaboration with other computing participants, obtain a rearranged secret shard, and then move the tuples with the invalid marker in the marker field to the tail of the rearranged secret shard based on the secret shards of the marker field of each tuple in the rearranged secret shard in collaboration with other computing participants, and keep the tuples with the valid marker in the marker field in the front part of the rearranged secret shard; based on the moved rearranged secret shard, the secret shards of the permutation order corresponding to the specified tuples in the moved rearranged secret shard are determined in collaboration with other computing participants, and the specified tuples at least include the tuples with the valid marker in the marker field, which ensures that the permutation order of the tuples with the valid marker in the marker field is compact (continuous 1, 2,..., m), and still retains the correct sorting position, does not contain invalid tuples screened out by the selection operation, and is convenient for subsequent operations such as paging and grouping.
[0097] In some scenarios, the secret shards of the permutation order can also be re- assigned to the tuples with the invalid marker in the marker field, and the present embodiment does not make any limitation on this.
[0098] (2) Projection operator. The projection operator refers to selecting certain specific columns (fields) from the data table and de-duplicating as the output result.
[0099] In some embodiments, in the case where the operation operator of the intermediate node includes a projection operator and the target field includes a projection field specified by the projection operator, the computing participant can re-arrange the secret shard corresponding to the input data table of the projection operator in collaboration with other computing participants according to the secret shards of the permutation order corresponding to the projection field in the data table, and obtain a rearranged secret shard corresponding to the input data table of the projection operator and arranged according to the projection field, such as sorted from small to large according to the projection field value. Since the sorting order is preprocessed, the re-arrangement process only involves position adjustment, which is efficient and does not leak specific field values.
[0100] Then, the computing participant can compare, in coordination with other computing participants, whether the projection field value of each tuple of the rearranged secret table is the same as the projection field value of its previous tuple, generate a secret shard of the comparison result of each tuple, that is, perform a deduplication judgment, and the comparison result of whether the projection field values of the tuples are the same exists in the form of secret sharing, without leaking the field equality relationship to any single party to prevent attacks. The computing participant can generate, in coordination with other computing participants, a secret shard of the mark field for each tuple based on the secret shard of the comparison result of each tuple; wherein the mark field is used to indicate whether the tuple is valid, and the mark field corresponding to the tuple whose field value is different from that of the previous tuple is a secret shard of a valid mark, and the mark field corresponding to the tuple whose field value is the same as that of the previous tuple is a secret shard of an invalid mark.
[0101] In order to maintain the continuity and accuracy of the arrangement number of the projection field used in subsequent use, the arrangement number needs to be re-allocated. The computing participant re-allocates the arrangement number based on the secret shard of the mark field of each tuple in the rearranged secret table, moves, in coordination with other computing participants, the tuples with invalid marks to the tail of the rearranged secret table, and keeps the tuples with valid marks in the front part of the rearranged secret table; and determines, in coordination with other computing participants, a secret shard of the arrangement number corresponding to the specified tuples in the rearranged secret table after the movement, the specified tuples at least including the tuples with valid marks, to finally obtain a deduplicated secret table that maintains consistent ordering structure and can continue to participate in subsequent aggregation operations and the like. In this embodiment, after the repeated tuples are screened out, the arrangement number is re-allocated to ensure the ordering accuracy, which is conducive to the correctness and stability of subsequent related operations such as paging and window functions.
[0102] In some scenarios, the secret shard of the arrangement number can also be re-allocated to the tuples with invalid marks, which is not limited in this embodiment.
[0103] (3) Aggregation operator. The aggregation operator is used to summarize, calculate and count a group of data in the query process to obtain a single result, for example, calculating the average value, sum, count and the like. The system can execute a secure aggregation process under the secret sharing data structure.
[0104] In some embodiments, in the case where the operation operator of the intermediate node includes an aggregation operator and the target field includes an aggregation field specified by the aggregation operator, the computing participant can rearrange, in coordination with other computing participants, the corresponding secret table according to the secret shard of the arrangement number corresponding to the aggregation field in the input data table of the aggregation operator, to obtain a rearranged secret table corresponding to the input data table of the aggregation operator and arranged according to the aggregation field, and the rearrangement process is completed without leaking the field value or order of the aggregation field, to prepare for subsequent grouped aggregation.
[0105] Then, the computing participant can detect, in cooperation with other computing participants, whether the aggregated field value of each tuple of the rearranged secret table is the same as that of the previous tuple, and generate a secret shard of the detection result of each tuple. If the aggregated field value of a certain tuple is the same as that of the previous tuple, they belong to the same group; if the aggregated field value of a certain tuple is different from that of the previous tuple, the tuple is the first tuple in a new group.
[0106] Based on the secret shard of the detection result of each tuple, the following operations are performed in cooperation with other computing participants: performing a grouping operation on the tuples in the rearranged secret table, the tuples with the same aggregated field value belong to the same group, and performing an aggregation operation on the tuples in each group, and writing the aggregation result in the form of secret sharing into the last tuple in the group, while generating a secret shard of the marking field for each tuple in the rearranged secret table; wherein the marking field is used to indicate whether the tuple is valid, the marking field corresponding to the last tuple in each group is a secret shard of a valid mark, and the marking fields corresponding to the remaining tuples are secret shards of invalid marks. The entire aggregation process (grouping judgment, aggregation function calculation, result marking) is completed under the secret sharing structure, without exposing the original data, grouping boundary or aggregation value, effectively preventing information leakage.
[0107] To maintain the continuity of the order, the computing participant can move, in cooperation with other computing participants, the tuples with invalid marks in the marking field to the tail of the rearranged secret table based on the secret shard of the marking field of each tuple in the rearranged secret table arranged according to the aggregated field, and keep the tuples with valid marks in the marking field in the front part of the rearranged secret table; based on the rearranged secret table after the movement, determine, in cooperation with other computing participants, a secret shard of the arrangement order corresponding to each tuple in the rearranged secret table after the movement, and the specified tuples at least include the tuples with valid marks in the marking field. After aggregation, the secret shard of the arrangement order is re-awarded to the valid tuples, so that the subsequent operations can maintain the logical order continuity, which is beneficial to the application scenarios such as page output and aggregation result display.
[0108] In some scenarios, the secret shard of the arrangement order can also be re-awarded to the tuples with invalid marks in the marking field, which is not limited in the present embodiment.
[0109] (4) Semi-join operator. Semi-join is a filtering type of join operation based on the join field, which only returns the tuples in the left table (first data table) that can find matching items in the right table (second data table), but does not concatenate the right table fields.
[0110] In some embodiments, in the case that the operation operator of the intermediate node includes a semi-join operator for two data tables, and the target field includes a join field specified by the semi-join operator, the computing participant can determine, based on a rearrangement process similar to the above, a first rearranged secret sub-table corresponding to a first data table of the two data tables and arranged according to the join field, and determine a second rearranged secret sub-table corresponding to a second data table of the two data tables and arranged according to the join field.
[0111] Then, the computing participant can determine, in coordination with other computing participants, whether each tuple in the first rearranged secret sub-table has a tuple with a matching join field value in the second rearranged secret sub-table, and generate a matching result secret shard of each tuple in the first rearranged secret sub-table; based on the matching result secret shard of each tuple in the first rearranged secret sub-table, generate, in coordination with other computing participants, a secret shard of a flag field for each tuple in the first rearranged secret sub-table, where the secret shard of the flag field for a tuple with a matching result of yes is a valid flag secret shard, and the secret shard of the flag field for a tuple with a matching result of no is an invalid flag secret shard. In the semi-join process, all field values, matching results, and flag states are in the form of secret shards, and any computing participant cannot independently infer the data content or the connection hit information.
[0112] To ensure that the output structure after the query is compact and sequential, the computing participant can move, in coordination with other computing participants, the tuples with the invalid flag field to the tail of the first rearranged secret sub-table based on the secret shard of the flag field of each tuple in the first rearranged secret sub-table, and keep the tuples with the valid flag field in the front part of the first rearranged secret sub-table; based on the moved first rearranged secret sub-table, determine, in coordination with other computing participants, a secret shard of an arrangement serial number corresponding to each specified tuple in the moved first rearranged secret sub-table, the specified tuple including at least the tuple with the valid flag field. By reassigning the secret shard of the arrangement serial number to the valid tuple, the subsequent operation can maintain logical sequential continuity. In some scenarios, the secret shard of the arrangement serial number can also be reassigned to the tuple with the invalid flag field, which is not limited in this embodiment.
[0113] (5) Join operator. In a plaintext database, the join operator (Join) is used to combine tuple pairs with equal join field values in two tables. In a secret sharing environment, the field values cannot be directly accessed for joining, so the joining process must be implemented through a coordination protocol to ensure that data privacy is not leaked.
[0114] In some embodiments, in the case that the operation operator of the intermediate node includes a join operator for two data tables, and the target field includes a join field specified by the join operator, the system can perform a secure joining process under a secret sharing data structure.
[0115] The computing participant can determine, based on a rearrangement process similar to the above, a first rearranged secret sub-table corresponding to the first data table of the two data tables and arranged according to the connection field, and determine a second rearranged secret sub-table corresponding to the second data table of the two data tables and arranged according to the connection field. Thus, the access order is optimized for subsequent matching. For example, the first data table includes fields A and B, the arrangement number corresponding to A is / A / , and the arrangement number corresponding to B is / B / , Figure 4 The secret sub-table corresponding to the first data table and the first rearranged secret sub-table are shown. The second data table includes fields B and C, the arrangement number corresponding to B is / B / , and the arrangement number corresponding to C is / C / , Figure 5 The second rearranged secret sub-table corresponding to the second data table is shown, and the two data tables are connected based on the connection field B. It should be noted that, for the convenience of understanding, Figure 4 、 Figure 5 、 Figure 6 and Figure 7 The field values and arrangement numbers in and are represented in plaintext, but in actual application, the field values and arrangement numbers exist in ciphertext.
[0116] Next, the computing participant can, in cooperation with other computing participants, count the number of tuples in the first rearranged secret sub-table that have matching connection field values in the second rearranged secret sub-table, and count the number of tuples in the second rearranged secret sub-table that have matching connection field values in the first rearranged secret sub-table, to generate secret shards of the number of matches of each tuple in the first rearranged secret sub-table, and secret shards of the number of matches of each tuple in the second rearranged secret sub-table. It should be noted that, for the convenience of understanding, Figure 4 and Figure 5 The number of copies (i.e., the number of matches) in and is represented in plaintext, but in actual application, the number of copies (i.e., the number of matches) exists in ciphertext.
[0117] Referring to Figure 4 , the computing participant can, based on the secret shards of the number of matches of each tuple in the first rearranged secret sub-table, in cooperation with other computing participants, copy the tuples in the first rearranged secret sub-table according to the corresponding number of matches, to obtain a first copied secret sub-table.
[0118] Referring to Figure 5 , the computing participant, based on the secret shards of the number of matches of each tuple in the second rearranged secret sub-table, in cooperation with other computing participants, copies the tuples in the second rearranged secret sub-table according to the corresponding number of matches, to obtain a second copied secret sub-table.
[0119] The computing participants further cooperatively count the number of connection matches of each tuple with other computing participants after rearranging the secret sub-tables corresponding to the two data tables, and perform tuple replication processing according to the number of connection matches. The reason is that in a traditional plaintext database, a connection operation (such as an equal connection) can be completed by splicing tuples with equal connection field values one by one, without additional processing. However, in the multi-party secure computing scenario, since each computing participant cannot directly observe the plaintext content of any data item, and cannot determine how many external tuples a tuple matches, it is impossible to dynamically generate all connection results. To achieve the connection semantics equivalent to the plaintext environment, the system prepares "matching pairs" that can be spliced one by one through the above connection match number counting and tuple replication process, and realizes the pre-conversion of logical connection relationship to sequential correspondence relationship in structure, so that even without direct access to field values, each computing participant can cooperatively complete secure connection splicing through the positional relationship. At the same time, the number of matches is represented in the form of secret fragments, ensuring that the statistical results do not leak the true connection distribution.
[0120] Next, referring to Figure 5 , the computing participants perform alignment processing on the second replicated secret sub-table, so that the ordering sequence of each tuple in the aligned second replicated secret sub-table is consistent with the ordering sequence of each tuple in the first replicated secret sub-table. In the process of performing alignment processing on the second replicated secret sub-table, the computing participants cooperatively perform the following operations with other computing participants: performing first sorting on the second replicated secret sub-table according to the field values of the sorting fields, for example Figure 5 sorting according to field B first, and the arrangement order is b1→b2→b3; if there are multiple tuples with the same sorting field value, such as Figure 5 , b1 corresponds to 6 tuples, then further performing second sorting on each tuple in the multiple tuples according to the replication order, in the second sorting, the tuple with earlier replication order has earlier arrangement order, thereby obtaining the aligned second replicated secret sub-table.
[0121] The reason for the alignment processing is that in a traditional plaintext database system, a join operation can be implemented by directly comparing the join fields and dynamically splicing the matching tuples. However, in a multi-party secure computation system, since all field values are stored in the form of secret sharing, the computing participants cannot directly obtain the join field values of any tuple, nor can they logically "jump" to the specified tuple position for matching and splicing. To achieve secure tuple splicing, a position alignment method is adopted, which sorts the two replicated secret sharing data tables according to the join field values, and further sorts them according to the replication order of each tuple in the replication process on the premise that the join field values are the same. The double sorting operation ensures that the tuples at corresponding positions in the two sub-tables have a matching relationship in the join field. Through this alignment processing, the system can directly splice the tuples in the two sub-tables one by one without revealing the join field values and the join hit relationship, thereby securely and efficiently completing the join operation and avoiding the problems of result errors or privacy leakage caused by misalignment.
[0122] The computing participant is also configured to determine, in cooperation with the other computing participants, the secret shares of the arrangement numbers corresponding to the sorting field for each tuple in the first replicated secret sub-table, and determine, in cooperation with the other computing participants, the secret shares of the arrangement numbers corresponding to the sorting field for each tuple in the aligned second replicated secret sub-table. For example, Figure 4 and Figure 5 , Figure 4 The arrangement numbers corresponding to the sorting field for each tuple in the first replicated secret sub-table are shown in FIG. 1. Figure 5 The arrangement numbers corresponding to the sorting field for each tuple in the aligned second replicated secret sub-table are shown in FIG. 2.
[0123] Finally, please refer to Figure 6 , the computing participant and the other computing participants splice the first replicated secret sub-table and the aligned second replicated secret sub-table in cooperation, and complete the join operation while ensuring the privacy and security of the entire data processing process.
[0124] For example, when the target fields involved in the first data table include not only the connection fields but also at least one non-connection field, in order to ensure the correctness and availability of the sorting information of the non-connection field in subsequent operations, the system also needs to update the arrangement serial number corresponding to the non-connection field when performing the connection operation. In the plaintext database, the order of the non-connection field can directly follow the natural arrangement of the connection result, but in the secret sharing environment, since the connection operation needs to copy, rearrange, align and other processes to the tuples, the original arrangement serial number information of the non-connection field will be destroyed or invalid. Therefore, if subsequent operations such as sorting, projection, deduplication, aggregation based on the non-connection field are involved, the corresponding arrangement serial number must be recalculated. Continuing the above example, the first data table also includes a non-connection field A, and the second data table also includes a non-connection field C, and the arrangement serial number thereof needs to be updated accordingly.
[0125] In the case where the target fields involved in the first data table also include non-connection fields, please refer to Figure 7 The computing party determines a third rearranged secret sub-table corresponding to the first data table and arranged according to the non-connection field, and cooperates with other computing parties to perform an update operation based on the third rearranged secret sub-table to update the secret shards of the arrangement serial number of the non-connection field in the first copied secret sub-table. Because in the first copied secret sub-table, after the tuples are copied, since one original tuple can correspond to multiple new tuples, the copied tuples must be assigned continuous arrangement serial numbers to avoid arrangement serial number conflicts or omissions.
[0126] The update operation includes: counting the number of copies of each tuple in the third rearranged secret sub-table in the first copied secret sub-table, and the number of copies of the tuples not involved in the connection is zero; based on the number of copies of each tuple in the third rearranged secret sub-table, calculating the initial sorting serial number of each tuple with a non-zero copy number, and the initial sorting serial number of the first tuple with a non-zero copy number is one secret shard, and the initial sorting serial number of other tuples is obtained by one plus the prefix accumulation of the copy number, such as Figure 7 The initial sorting serial number of the second tuple {a1, b2} in the first data table is the result of the copy number 2 of the previous tuple {a1, b1} plus one, Figure 7the initial ranking sequence number of the third tuple {a2, b1} in the third rearranged secret table is the result of 3 plus 1 obtained by accumulating the replication times of the first two tuples, and so on; each tuple in the third rearranged secret table is replicated based on the replication times of each tuple to form a third replicated secret table; in the third replicated secret table, each tuple is sequentially traversed, and the non-connection field value of the current tuple is compared with the non-connection field value of the previous tuple; if the non-connection field values of the two tuples are the same, the ranking sequence number of the current tuple is set to be one more than the ranking sequence number of the previous tuple; if not, the ranking sequence number of the current tuple remains unchanged. In this embodiment, the prefix sum of the replication times is used as the initial ranking sequence number, and the ordered increasing strategy after the same field value judgment is combined to ensure that the new ranking sequence number has continuity, monotonicity and distinguishability of repeated tuples. The updated ranking sequence number information is represented by secret fragments in the secret sharing structure, without leaking any field value, repetition relationship or tuple distribution information, ensuring privacy protection throughout the process. Next, please refer to Figure 7 After traversing all tuples in the third replicated secret table to determine the ranking sequence number corresponding to each tuple, the third replicated secret table is rearranged according to the connection field B to obtain the first replicated secret table, and in the first replicated secret table, the arrangement order of the non-connection field A is also determined.
[0127] Similarly, in the case where the target field involved in the second data table also includes a non-connection field, the computing participant determines a fourth rearranged secret table corresponding to the second data table and arranged according to the non-connection field, and based on the fourth rearranged secret table, cooperates with other computing participants to perform an update operation to update the secret fragments of the ranking sequence number corresponding to the non-connection field in the second replicated secret table.
[0128] The update operation includes: counting the replication times of each tuple in the fourth rearranged secret table in the second replicated secret table, and the replication time of a tuple not involved in the connection is zero; calculating the initial ranking sequence number of each tuple based on the replication times of each tuple in the fourth rearranged secret table, the initial ranking sequence number of the first tuple with a non-zero replication time is one secret fragment, and the initial ranking sequence number of other tuples is obtained by adding one to the prefix accumulation of the replication times; replicating each tuple in the fourth rearranged secret table based on the replication times of each tuple to form a fourth replicated secret table; in the fourth replicated secret table, each tuple is sequentially traversed, and the non-connection field value of the current tuple is compared with the non-connection field value of the previous tuple; if the non-connection field values of the two tuples are the same, the ranking sequence number of the current tuple is set to be one more than the ranking sequence number of the previous tuple; if not, the ranking sequence number of the current tuple remains unchanged.
[0129] Various technical features in the above embodiments can be combined in any manner, as long as there is no conflict or contradiction between the features, but due to the limited space, not all combinations are described, and any combination of the various technical features in the above embodiments also belongs to the scope disclosed in the specification.
[0130] In some embodiments, referring to Figure 8 The embodiments of the present specification also provide a multi-party secure computing method, applied to the above computing participants, the method comprising:
[0131] In S801, secret tables sent by any data holder are received and stored.
[0132] In S802, a query statement sent by any data query party is received.
[0133] In S803, a query tree of the query statement is determined, the leaf nodes of the query tree represent the data tables specified by the query statement, the intermediate nodes of the query tree represent the operation operators specified by the query statement, and the intermediate nodes are provided with a safe output tuple number.
[0134] In S804, based on the secret tables corresponding to the leaf nodes of the query tree, each intermediate node is executed layer by layer from the leaf node upwards in the execution order of the query tree in cooperation with other computing participants, and if the actual output tuple number of the intermediate node is less than the safe output tuple number of the intermediate node, a virtual tuple is added in the actual output of the intermediate node to meet the safe output tuple number, and the virtual tuple carries an invalid marked secret shard.
[0135] In S805, after the execution of the query tree is completed, the secret shards of the query result are generated and returned to the data query party.
[0136] In one implementation mode, it further comprises receiving and storing the metadata of the data table sent by the data holder.
[0137] In one implementation mode, it further comprises: based on the secret sharing data of the data table specified by the query statement, estimating the final output tuple number of the query statement in cooperation with other computing participants, or obtaining the final output tuple number uniformly set for the query statement in advance; based on the metadata of the data table specified by the query statement, estimating the intermediate output tuple number of each intermediate node in the query tree; for each intermediate node, setting the minimum value of the final output tuple number and the intermediate output tuple number of the intermediate node as the safe output tuple number of the intermediate node.
[0138] In an implementation, if the input data table of the intermediate node is one, the intermediate output tuple number of the intermediate node is determined by the tuple number of the input data table; if the input data table of the intermediate node is more than one, the intermediate output tuple number of the intermediate node is determined by the product of the tuple numbers of the input data tables.
[0139] In an implementation, the determining the query tree of the query statement comprises: parsing the query statement to generate a plurality of candidate query trees, the execution order of the operation operators specified by the query statement being at least partially different in different candidate query trees; counting the number of fields involved in the intermediate nodes in the candidate query trees based on the metadata of the data tables specified by the query statement; and screening the query tree with the least number of fields involved from the plurality of candidate query trees based on the number of fields involved in the intermediate nodes in each of the candidate query trees.
[0140] In an implementation, the method further comprises: if the query statement involves a join query of at least two data tables, before executing the query tree, performing a semi-join operation in cooperation with other computing participants based on the secret sub-tables corresponding to the at least two data tables specified by the query statement, to check whether the tuples in the secret sub-tables participate in the query result, to obtain a secret shard of the check result of each tuple; and generating a secret shard of the marking field for each tuple in cooperation with other computing participants based on the secret shard of the check result of each tuple; wherein the marking field corresponding to the tuple participating in the query result is a secret shard of valid marking, and the marking field corresponding to the tuple not participating in the query result is a secret shard of invalid marking.
[0141] In an implementation, the method further comprises: determining, by the computing participant, a target field to be sorted in the secret sub-table based on the metadata of the data table, and extracting a secret shared column of the target field to be sorted from the secret sub-table; performing a preset secure sorting algorithm in cooperation with other computing participants based on the secret shared column of the target field, to obtain a sorted secret shared column; and determining, in cooperation with other computing participants, a secret shard of the permutation serial number corresponding to each secret shared value in the sorted secret shared column based on the sorted secret shared column.
[0142] In an implementation, the method further comprises: in the process of executing each intermediate node in the query tree in cooperation with other computing participants, if the input data table of the intermediate node involves the target field, rearranging the secret sub-table corresponding to the input data table in cooperation with other computing participants according to the secret shard of the permutation serial number corresponding to the target field, to obtain a rearranged secret sub-table; and executing the operation indicated by the intermediate node based on the rearranged secret sub-table in cooperation with other computing participants.
[0143] In an implementation manner, based on the sorted secret sharing column, the secret shard of the permutation serial number corresponding to each secret sharing value in the sorted secret sharing column is determined in cooperation with other computing participants, including: in the case of being a master computing participant, after obtaining the sorted secret sharing column, generating a unique permutation serial number corresponding to each secret sharing value in the sorted secret sharing column; based on a preset secret sharing algorithm, each permutation serial number is split into N secret shards, one of which is retained, and the other N-1 secret shards are sent to the other N-1 computing participants respectively.
[0144] In an implementation manner, further comprising: if the operation operator of the intermediate node includes a selection operator, based on the query condition of the selection operator, it is judged whether each tuple in the secret sub-table corresponding to the input data table of the selection operator meets the query condition in cooperation with other computing participants, to obtain the secret shard of the judgment result of each tuple; based on the secret shard of the judgment result of each tuple, the secret shard of the marking field is generated for each tuple in cooperation with other computing participants; wherein the marking field is used to indicate whether the tuple is valid, the marking field corresponding to the tuple meeting the query condition is the secret shard of the valid mark, and the marking field corresponding to the tuple not meeting the query condition is the secret shard of the invalid mark.
[0145] In an implementation manner, based on the rearranged secret sub-table, the operation indicated by the intermediate node is executed in cooperation with other computing participants, including: in the case that the operation operator of the intermediate node includes a projection operator, and the target field includes a projection field specified by the projection operator, determining a rearranged secret sub-table corresponding to the input data table of the projection operator and arranged according to the projection field, comparing whether the projection field value of each tuple of the rearranged secret sub-table is the same as the projection field value of the previous tuple in cooperation with other computing participants, and generating the secret shard of the comparison result of each tuple; based on the secret shard of the comparison result of each tuple, the secret shard of the marking field is generated for each tuple in cooperation with other computing participants; wherein the marking field is used to indicate whether the tuple is valid, the marking field corresponding to the tuple whose projection field value is not the same as that of the previous tuple is the secret shard of the valid mark, and the marking field corresponding to the tuple whose projection field value is the same as that of the previous tuple is the secret shard of the invalid mark.
[0146] In an implementation, based on the rearranged secret shares, performing the operation indicated by the intermediate node in cooperation with other computing participants includes: in a case that the operation operator of the intermediate node includes an aggregation operator and the target field includes an aggregation field specified by the aggregation operator, determining rearranged secret shares corresponding to input data tables of the aggregation operator and arranged according to the aggregation field, detecting, in cooperation with other computing participants, whether the aggregation field value of each tuple of the rearranged secret shares is the same as the aggregation field value of the previous tuple, and generating secret shards of detection results of each tuple; based on the secret shards of detection results of each tuple, performing the following operations in cooperation with other computing participants: performing a grouping operation on tuples in the rearranged secret shares, tuples with the same aggregation field value belong to the same group, and performing an aggregation operation on tuples in each group, and writing the aggregation result into the last tuple in the group, and generating secret shards of a mark field for each tuple in the rearranged secret shares; wherein the mark field is used to indicate whether a tuple is valid, the secret shard of the mark field corresponding to the last tuple in each group is an effective mark, and the secret shards of the mark fields corresponding to the remaining tuples are invalid marks.
[0147] In an implementation, further comprising: based on the secret shards of the mark field of each tuple in the rearranged secret shares, moving, in cooperation with other computing participants, tuples with invalid marks in the mark field to the tail of the rearranged secret shares, and keeping tuples with effective marks in the mark field in the front of the rearranged secret shares; based on the rearranged secret shares after the moving, determining, in cooperation with other computing participants, secret shards of arrangement serial numbers corresponding one-to-one to specified tuples in the rearranged secret shares after the moving, the specified tuples at least including tuples with effective marks in the mark field.
[0148] In an implementation, based on the rearranged secret shares, performing the operation indicated by the intermediate node in collaboration with other computing participants includes: in a case where the operation operator of the intermediate node includes a semi-join operator for two data tables and the target field includes a join field specified by the semi-join operator, determining a first rearranged secret share corresponding to a first data table of the two data tables and arranged according to the join field, and determining a second rearranged secret share corresponding to a second data table of the two data tables and arranged according to the join field, determining, in collaboration with other computing participants, whether each tuple in the first rearranged secret share has a tuple with a matching join field value in the second rearranged secret share, and generating a secret shard of a matching result of each tuple in the first rearranged secret share; and based on the secret shard of the matching result of each tuple in the first rearranged secret share, generating, in collaboration with other computing participants, a secret shard of a label field for each tuple in the first rearranged secret share, wherein the secret shard of the label field corresponding to a tuple with a matching result of yes is a valid label, and the secret shard of the label field corresponding to a tuple with a matching result of no is an invalid label.
[0149] In an implementation, further including: based on the secret shard of the label field of each tuple in the first rearranged secret share, moving, in collaboration with other computing participants, a tuple with an invalid label to a tail of the first rearranged secret share, and keeping a tuple with a valid label in a front of the first rearranged secret share.
[0150] Based on the moved first rearranged secret share, determining, in collaboration with other computing participants, a secret shard of an arrangement serial number corresponding to a specified tuple in the moved first rearranged secret share, the specified tuple including at least a tuple with a valid label.
[0151] In an implementation, based on the rearranged secret table, performing the operation indicated by the intermediate node in cooperation with other computing participants, including: in a case that the operation operator of the intermediate node includes a join operator for two data tables, and the target field includes a join field specified by the join operator, determining a first rearranged secret table corresponding to a first data table of the two data tables and arranged according to the join field, and determining a second rearranged secret table corresponding to a second data table of the two data tables and arranged according to the join field, in cooperation with other computing participants, counting the number of tuples in the first rearranged secret table that have a matching join field value in the second rearranged secret table, and counting the number of tuples in the second rearranged secret table that have a matching join field value in the first rearranged secret table, generating secret shards of the number of matches for each tuple in the first rearranged secret table, and secret shards of the number of matches for each tuple in the second rearranged secret table; based on the secret shards of the number of matches for each tuple in the first rearranged secret table, replicating the tuples in the first rearranged secret table according to the corresponding number of matches in cooperation with other computing participants to obtain a first replicated secret table; and based on the secret shards of the number of matches for each tuple in the second rearranged secret table, replicating the tuples in the second rearranged secret table according to the corresponding number of matches in cooperation with other computing participants to obtain a second replicated secret table, and performing alignment processing on the second replicated secret table to make the ordering sequence of each tuple in the aligned second replicated secret table consistent with the ordering sequence of each tuple in the first replicated secret table; and splicing the first replicated secret table and the aligned second replicated secret table in cooperation with other computing participants.
[0152] For example, in the process of performing alignment processing on the second replicated secret table, the following operations are performed in cooperation with other computing participants: first sorting the second replicated secret table according to the field value of the ordering field, and if there are multiple tuples with the same ordering field value, further performing second sorting on each tuple in the multiple tuples according to the replication order of the multiple tuples to obtain the aligned second replicated secret table.
[0153] For example, for the first replicated secret table, secret shards of the arrangement number corresponding to the ordering field for each tuple in the first replicated secret table are determined in cooperation with other computing participants; and for the aligned second replicated secret table, secret shards of the arrangement number corresponding to the ordering field for each tuple in the aligned second replicated secret table are determined in cooperation with other computing participants.
[0154] In an example, in the case that the target field involved in the first data table further comprises a non-join field, a third rearranged secret sub-table corresponding to the first data table and arranged according to the non-join field is determined, and based on the third rearranged secret sub-table, an update operation is performed in cooperation with other computing participants to update the secret shards of the arrangement sequence number corresponding to the non-join field in the first replicated secret sub-table; wherein the update operation comprises: counting the replication times of each tuple in the third rearranged secret sub-table in the first replicated secret sub-table, and the replication time of a tuple not participating in the join is zero; based on the replication times of each tuple in the third rearranged secret sub-table, the initial ordering sequence number of each tuple with a non-zero replication time is calculated, and the initial ordering sequence number of the first tuple with a non-zero replication time is one secret shard, and the initial ordering sequence number of other tuples is obtained by adding one to the prefix accumulation of the replication time; based on the replication times of each tuple in the third rearranged secret sub-table, each tuple is replicated to form a third replicated secret sub-table; in the third replicated secret sub-table, each tuple is sequentially traversed, and the non-join field value of the current tuple is compared with the non-join field value of the previous tuple; if the non-join field values of the two tuples are the same, the ordering sequence number of the current tuple is set to one more than the ordering sequence number of the previous tuple; if not, the ordering sequence number of the current tuple remains unchanged.
[0155] In an example, in the case that the target field involved in the second data table further comprises a non-join field, a fourth rearranged secret sub-table corresponding to the second data table and arranged according to the non-join field is determined, and based on the fourth rearranged secret sub-table, an update operation is performed in cooperation with other computing participants to update the secret shards of the arrangement sequence number corresponding to the non-join field in the second replicated secret sub-table; wherein the update operation comprises: counting the replication times of each tuple in the fourth rearranged secret sub-table in the second replicated secret sub-table, and the replication time of a tuple not participating in the join is zero; based on the replication times of each tuple in the fourth rearranged secret sub-table, the initial ordering sequence number of each tuple with a non-zero replication time is calculated, and the initial ordering sequence number of the first tuple with a non-zero replication time is one secret shard, and the initial ordering sequence number of other tuples is obtained by adding one to the prefix accumulation of the replication time; based on the replication times of each tuple in the fourth rearranged secret sub-table, each tuple is replicated to form a fourth replicated secret sub-table; in the fourth replicated secret sub-table, each tuple is sequentially traversed, and the non-join field value of the current tuple is compared with the non-join field value of the previous tuple; if the non-join field values of the two tuples are the same, the ordering sequence number of the current tuple is set to one more than the ordering sequence number of the previous tuple; if not, the ordering sequence number of the current tuple remains unchanged.
[0156] In some embodiments, the method further includes: sending a query statement to the computing participants; and receiving secret shards of query results returned by the N computing participants respectively, recovering an initial query result from the secret shards of query results, and removing virtual tuples with invalid labels from the initial query result to obtain a target query result.
[0157] In some embodiments, the electronic device further includes a processor, a memory for storing processor-executable instructions, wherein the processor implements the method according to any one of the above embodiments by running the executable instructions.
[0158] Figure 9 is a schematic structural diagram of a device provided by an example embodiment. Please refer to Figure 9 At the hardware level, the device includes a processor 902, an internal bus 904, a network interface 906, a memory 908, and a non-volatile memory 910, and can also include other hardware required by functions. One or more embodiments of the present specification can be implemented in a software manner, such as reading a corresponding computer program from the non-volatile memory 910 into the memory 908 by the processor 902 and then running. Of course, in addition to the software implementation, one or more embodiments of the present specification do not exclude other implementation manners, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or a logic device.
[0159] Based on the same idea as the above method, the present specification further provides a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of the above embodiments.
[0160] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, disk storage, quantum memory, graphene-based storage medium or other magnetic storage device, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.
[0161] Based on the same concept as the above method, the present specification also provides a computer program product comprising computer programs / instructions which, when executed by a processor, implement the steps of the method according to any of the above embodiments.
[0162] The above description is only a preferred embodiment of one or more embodiments of the present specification, and is not intended to limit one or more embodiments of the present specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of the present specification shall be included in the protection scope of one or more embodiments of the present specification.
Claims
1. A multi-party secure computation system, comprising a data holder, a data queryer, and N computation participants, where N > 1; The data holder is configured to split its own data table into N secret sub-tables according to a preset secret sharing algorithm, and send the N secret sub-tables to the N computing participants respectively, wherein the table structure of the N secret sub-tables is the same as the table structure of the data table; and send the metadata of the data table to the N computing participants. The computing participant is used to receive and store the metadata of the secret sub-table and the data table; The computing participants are also configured to determine the target field to be sorted in the secret partition table based on the metadata of the data table, extract the secret shared column of the target field to be sorted from the secret partition table; based on the secret shared column of the target field, collaborate with other computing participants to execute a preset secure sorting algorithm to obtain the sorted secret shared column; based on the sorted secret shared column, collaborate with other computing participants to determine the secret fragments that correspond one-to-one with the arrangement number of each secret shared value in the sorted secret shared column; The data querying party is used to send query statements to the computing participants; The computational participants are also used to determine the query tree of the query statement, wherein the leaf nodes of the query tree represent the data table specified by the query statement, and the intermediate nodes of the query tree represent the operation operators specified by the query statement. The computational participants are further configured to, based on the secret partitions corresponding to the leaf nodes of the query tree, collaborate with other computational participants to execute each intermediate node layer by layer from the leaf nodes upwards according to the execution order of the query tree; during the collaborative execution of each intermediate node in the query tree with other computational participants, if the input data table of the intermediate node involves the target field, the participants collaborate with other computational participants to rearrange the secret partitions corresponding to the input data table according to the secret partitions of the sorting sequence number corresponding to the target field, obtaining rearranged secret partitions; based on the rearranged secret partitions, the participants collaborate with other computational participants to execute the operations indicated by the intermediate nodes; after the query tree is completed, the participants generate secret partitions of the query results and return them to the data querying party; The data querying party is also used to receive secret fragments of the query results returned by the N computing participants respectively, and to recover the initial query result from the secret fragments of the N query results.
2. The system according to claim 1, wherein the intermediate node is configured with a secure output tuple quantity; The computational participants are also configured to add virtual tuples to the actual output of an intermediate node to meet the number of secure output tuples if the number of tuples actually output by an intermediate node is less than the number of secure output tuples of that intermediate node. The virtual tuples carry secret fragments with invalidation tags. The data querying party is also used to remove virtual tuples carrying invalid tags from the initial query results to obtain the target query results.
3. In the system according to claim 2, the data holder is further configured to send the metadata of the data table to the N computing participants; The computing participant is also used to receive and store metadata of the data table; The computational participants are also used to estimate the final output tuple count of the query statement in collaboration with other computational participants based on the secret shared data of the data table specified by the query statement, or to obtain the final output tuple count that is uniformly set for the query statement in advance. Based on the metadata of the data table specified by the query statement, estimate the number of intermediate output tuples for each intermediate node in the query tree; For each intermediate node, the minimum value between the final output tuple count and the intermediate output tuple count of the intermediate node is set as the safe output tuple count of the intermediate node.
4. In the system according to claim 3, if the input data table of the intermediate node is one, the number of intermediate output tuples of the intermediate node is determined by the number of tuples in the input data table; If the intermediate node has more than one input data table, the number of intermediate output tuples of the intermediate node is determined by the product of the number of tuples in the input data tables.
5. In the system according to claim 3, the computational participant is specifically used to parse the query statement to generate multiple candidate query trees, wherein the execution order of the operation operators specified by the query statement is at least partially different in different candidate query trees; Based on the metadata of the data table specified by the query statement, count the number of fields involved in the intermediate nodes of the candidate query tree; Based on the number of fields involved in the intermediate nodes of each candidate query tree, the query tree with the fewest fields involved is selected from multiple candidate query trees.
6. The system according to claim 1, wherein the computing participant is further configured to: If the query statement involves a joint query of at least two data tables, before executing the query tree, based on the secret partitions corresponding to the at least two data tables specified by the query statement, a semi-join operation is performed in collaboration with other computing participants to check whether the tuples in the secret partitions participate in the query results, and to obtain the secret partitions of the check results of each tuple; Based on the secret fragments of the inspection results of each tuple, secret fragments of the labeled fields are generated collaboratively with other computational participants for each tuple; wherein, The tuples that participate in the query results have a validly labeled secret shard, while the tuples that do not participate in the query results have an invalidly labeled secret shard.
7. In the system according to claim 1, the computing participant is specifically used, when acting as the main computing participant, to generate a unique permutation number corresponding one-to-one with each secret shared value in the sorted secret shared column after obtaining the sorted secret shared column; and to split each of the permutation numbers into N secret fragments based on a preset secret sharing algorithm, retaining one secret fragment and sending the other N-1 secret fragments to the other N-1 computing participants respectively.
8. The system according to claim 1, wherein the computing participant is further configured to: If the operation operator of the intermediate node includes a selection operator, based on the query conditions of the selection operator, the operator collaborates with other computing participants to determine whether each tuple in the secret partition table corresponding to the input data table of the selection operator meets the query conditions, and obtains the secret partition of the judgment result of each tuple; Based on the judgment results of each tuple, a secret fragment is generated for each tuple in collaboration with other computational participants, along with a secret fragment containing a labeled field; wherein, The tag field is used to indicate whether a tuple is valid. Tuples that meet the query conditions are marked as valid secret shards, while tuples that do not meet the query conditions are marked as invalid secret shards.
9. The system according to claim 1, wherein the computing participant is specifically used for: When the operation operator of the intermediate node includes a projection operator and the target field includes the projection field specified by the projection operator, a rearranged secret partition table corresponding to the input data table of the projection operator and arranged according to the projection field is determined. The projection field values of each tuple in the rearranged secret partition table are compared with the projection field values of the previous tuple in collaboration with other computing participants to generate secret partitions of the comparison results of each tuple. Based on the comparison results of the tuples, secret fragments of labeled fields are generated collaboratively with other computational participants to create secret fragments for each tuple; wherein, The tag field is used to indicate whether a tuple is valid. Tuples whose tag field values are different from those of the previous tuple are secret fragments with valid tags, while tuples whose tag field values are the same as those of the previous tuple are secret fragments with invalid tags.
10. The system according to claim 1, wherein the computing participant is specifically used for: When the operation operator of the intermediate node includes an aggregation operator and the target field includes an aggregation field specified by the aggregation operator, a rearranged secret partition table corresponding to the input data table of the aggregation operator and arranged according to the aggregation field is determined. In collaboration with other computing participants, the aggregation field value of each tuple in the rearranged secret partition table is detected as being the same as the aggregation field value of the previous tuple, and a secret partition of the detection result of each tuple is generated. Based on the secret fragments generated from the detection results of each tuple, the following operations are performed in collaboration with other computational participants: grouping the tuples in the rearranged secret partition table, assigning tuples with the same aggregation field value to the same group, and performing aggregation operations on the tuples within each group, writing the aggregation result into the last tuple in each group. Simultaneously, secret fragments with labeled fields are generated for each tuple in the rearranged secret partition table; wherein… The tag field is used to indicate whether a tuple is valid. The tag field corresponding to the last tuple in each group is a secret fragment with a valid tag, and the tag fields corresponding to the remaining tuples are secret fragments with invalid tags.
11. The system according to any one of claims 8 to 10, wherein the computing participant is further configured to: Based on the secret fragments of the labeled fields of each tuple in the rearranged secret partition table, tuples with invalid labeled fields are moved to the end of the rearranged secret partition table in cooperation with other computation participants, while tuples with valid labeled fields are kept at the beginning of the rearranged secret partition table. Based on the rearranged secret partition table after the move, secret fragments are determined in collaboration with other computational participants, with each fragment corresponding to a specified tuple in the rearranged secret partition table. The specified tuple includes at least tuples with a valid tag field.
12. The system according to claim 1, wherein the computing participant is specifically used for: When the operation operator of the intermediate node includes a semi-join operator for two data tables, and the target field includes the join field specified by the semi-join operator, a first rearranged secret partition table corresponding to the first data table in the two data tables and arranged according to the join field is determined, and a second rearranged secret partition table corresponding to the second data table in the two data tables and arranged according to the join field is determined. In collaboration with other computing participants, it is determined whether there are tuples in the first rearranged secret partition table that match the join field value in the second rearranged secret partition table, and a secret fragment of the matching result of each tuple in the first rearranged secret partition table is generated. Based on the secret fragments of the matching results of each tuple in the first rearranged secret partition table, secret fragments with labeled fields are generated collaboratively with other computational participants for each tuple in the first rearranged secret partition table, wherein, The tag field corresponding to a tuple with a matching result of "yes" is a secret shard with a valid tag, and the tag field corresponding to a tuple with a matching result of "no" is a secret shard with an invalid tag.
13. The system of claim 12, wherein the computing participant is further configured to: Based on the secret fragments of the labeled fields of each tuple in the first rearranged secret partition table, tuples with invalid labeled fields are moved to the end of the first rearranged secret partition table in collaboration with other computation participants, while tuples with valid labeled fields are kept at the beginning of the first rearranged secret partition table. Based on the first rearranged secret partition table after the move, secret partitions with permutation numbers corresponding one-to-one with specified tuples in the first rearranged secret partition table are determined in collaboration with other computational participants. The specified tuples include at least tuples with valid flag fields.
14. The system according to claim 1, wherein the computing participant is specifically used for: When the operation operator of the intermediate node includes a join operator for two data tables, and the target field includes a join field specified by the join operator, a first rearranged secret partition table corresponding to the first data table in the two data tables and arranged according to the join field is determined, and a second rearranged secret partition table corresponding to the second data table in the two data tables and arranged according to the join field is determined. In collaboration with other computing participants, the number of tuples in the first rearranged secret partition table that have join field value matching in the second rearranged secret partition table and the number of tuples in the second rearranged secret partition table that have join field value matching in the first rearranged secret partition table are counted. Secret partitions with matching numbers of each tuple in the first rearranged secret partition table and secret partitions with matching numbers of each tuple in the second rearranged secret partition table are generated. Based on the secret fragments representing the number of matches for each tuple in the first rearranged secret partition table, the tuples in the first rearranged secret partition table are copied in collaboration with other computational participants according to the corresponding number of matches, resulting in a first copied secret partition table; and, Based on the secret fragments of the matching number of each tuple in the second rearranged secret partition table, the tuples in the second rearranged secret partition table are copied in collaboration with other computing participants according to the corresponding matching number to obtain a second copied secret partition table. The second copied secret partition table is then aligned so that the sorting order of each tuple in the aligned second copied secret partition table is consistent with the sorting order of each tuple in the first copied secret partition table. In collaboration with other computational participants, the first replicated secret table and the aligned second replicated secret table are spliced together.
15. The system according to claim 14, wherein the computational participant is specifically used for: During the alignment process of the second replicated secret table, the following operations are performed in collaboration with other computation participants: the second replicated secret table is sorted first according to the field value of the sorting field; if there are multiple tuples with the same sorting field value, it is further sorted secondly according to the replication order of each tuple in the multiple tuples to obtain the aligned second replicated secret table.
16. The system of claim 14, wherein the computational participant is further configured to: For the first replicated secret partition table, in collaboration with other computational participants, the secret partition table is determined by assigning the permutation number corresponding to the sorting field to each tuple in the first replicated secret partition table; and... For the aligned second replicated secret table, the secret slices of each tuple in the aligned second replicated secret table, with the sorting field corresponding to the arrangement number, are determined in collaboration with other computation participants.
17. The system of claim 14, wherein the computational participant is further configured to: If the target fields involved in the first data table also include non-connected fields, determine the third rearranged secret partition table corresponding to the first data table and arranged according to the non-connected fields. Based on the third rearranged secret partition table, perform an update operation in collaboration with other computing participants to update the secret partition of the arrangement number corresponding to the non-connected fields in the first replicated secret partition table. in, The update operation includes: counting the number of times each tuple in the third rearranged secret partition table is copied in the first replicated secret partition table, with the number of copies of tuples not involved in the join being zero; calculating the initial sort number of each tuple with a non-zero copy number based on the copy number of each tuple in the third rearranged secret partition table, with the initial sort number of the first tuple with a non-zero copy number being the secret partition with an initial sort number of one, and the initial sort numbers of other tuples being obtained by prefix summation of the copy number followed by one; copying each tuple based on the copy number of each tuple in the third rearranged secret partition table to form the third replicated secret partition table; traversing each tuple sequentially in the third replicated secret partition table, and comparing the non-join field value of the current tuple with the non-join field value of the previous tuple; if the non-join field values of the two tuples are the same, setting the sort number of the current tuple to the sort number of the previous tuple plus one; if they are different, keeping the sort number of the current tuple unchanged.
18. The system of claim 14, wherein the computing participant is further configured to: If the target fields involved in the second data table also include non-connected fields, determine the fourth rearranged secret partition table corresponding to the second data table and arranged according to the non-connected fields. Based on the fourth rearranged secret partition table, perform an update operation in collaboration with other computing participants to update the secret partition of the arrangement number corresponding to the non-connected fields in the second replicated secret partition table. in, The update operation includes: counting the number of times each tuple in the fourth rearranged secret partition table is copied in the second replicated secret partition table, with the number of copies of tuples not involved in the join being zero; calculating the initial sort number of each tuple with a non-zero copy number based on the copy number of each tuple in the fourth rearranged secret partition table, with the first tuple with a non-zero copy number having an initial sort number of one as the secret partition, and the initial sort numbers of other tuples being obtained by prefix summation of the copy number followed by one; copying each tuple based on the copy number of each tuple in the fourth rearranged secret partition table to form the fourth replicated secret partition table; traversing each tuple sequentially in the fourth replicated secret partition table, and comparing the non-join field value of the current tuple with the non-join field value of the previous tuple; if the non-join field values of the two tuples are the same, setting the sort number of the current tuple to the sort number of the previous tuple plus one; if they are different, keeping the sort number of the current tuple unchanged.
19. A multi-party secure computation method, applied to computational participants in a multi-party secure computation system as described in any one of claims 1 to 18, the method comprising: Receive and store a secret partition table and the metadata corresponding to the secret partition table sent by any data holder, and receive a query statement sent by any data querying party; Based on the metadata, the target field to be sorted in the secret partition table is determined, and the secret shared column of the target field to be sorted is extracted from the secret partition table; based on the secret shared column of the target field, a preset secure sorting algorithm is executed in collaboration with other computing participants to obtain the sorted secret shared column; and based on the sorted secret shared column, the secret partition is determined in collaboration with other computing participants to determine the arrangement number corresponding one-to-one with each secret shared value in the sorted secret shared column. Determine the query tree of the query statement, wherein the leaf nodes of the query tree represent the data table specified by the query statement, and the intermediate nodes of the query tree represent the operation operators specified by the query statement; Based on the secret partition table corresponding to the leaf node of the query tree, and in collaboration with other computing participants, each intermediate node is executed layer by layer from the leaf node upwards according to the execution order of the query tree. During the process of cooperating with other computing participants to execute each intermediate node in the query tree, if the input data table of the intermediate node involves the target field, the secret partition corresponding to the input data table is rearranged in cooperation with other computing participants according to the secret partition of the arrangement number corresponding to the target field to obtain a rearranged secret partition. Based on the rearranged secret partition, the operation indicated by the intermediate node is executed in cooperation with other computing participants. After the query tree is completed, a secret fragment of the query result is generated and returned to the data querying party.
20. The method of claim 19, wherein the intermediate node is configured with a secure output tuple quantity; the method further comprises: If the number of tuples actually output by an intermediate node is less than the number of secure output tuples for that intermediate node, then a virtual tuple is added to the actual output of that intermediate node to satisfy the required number of secure output tuples. The virtual tuple carries a secret fragment with an invalid tag.
21. A multi-party secure computation method, applied to a data query party in a multi-party secure computation system as described in any one of claims 1 to 18, the method comprising: Send query statements to the computation participants; as well as, Receive secret fragments of the query results returned by N computing participants, recover the initial query result from the secret fragments of the N query results, and remove virtual tuples carrying invalid tags in the initial query result to obtain the target query result.
22. An electronic device, comprising: processor; A memory for storing processor-executable instructions; wherein the processor implements the steps of the method as described in any one of claims 19 to 21 by executing the executable instructions.
23. A computer-readable storage medium having stored thereon computer instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 19 to 21.
24. A computer program product comprising a computer program / instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 19 to 21.
Citation Information
Patent Citations
Data query method and device, computer readable storage medium and electronic equipment
CN113486117A
Data processing method and device and computer cluster system
CN117608784A