Multi-party secure computing system, method, device, storage medium and program product

By setting the number of secure output tuples in a multi-party security computing system and adding virtual tuples, the problem of leaking sensitive information in intermediate results is solved, and the integrity and privacy protection of query results are achieved.

CN120524522AActive Publication Date: 2025-08-22BEIJING OCEANBASE TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511009905.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-08-22
Estimated Expiration
2045-07-22

AI Technical Summary

Technical Problem

When the existing multi-party security computing system performs database query operations, the scale of the intermediate results may change with the characteristics of the input data, resulting in leakage of sensitive information and affecting system security.

Method used

Ensure the integrity and correctness of the final result by setting the number of secure output tuples in the query tree and adding virtual tuples when the actual output is less than the secure output to fix the intermediate result length, while removing invalid marks when restoring the initial query result.

Benefits of technology

Effectively prevent sensitive information from leaking at intermediate results scales, ensure the integrity and correctness of query results, and improve the system's privacy protection capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120524522A_ABST
    Figure CN120524522A_ABST
Patent Text Reader

Abstract

One or more embodiments of the present specification provide a multi-party secure computing system, method, device, storage medium, and program product. The multi-party security computing system comprises a data holder, a data query party and N computing participants. The data holder splits a data table held by the data holder into N secret sub-tables and sends the N secret sub-tables to the N calculation participants respectively; the calculation participant receives and stores the secret sub-table; the data query party sends a query statement to the calculation participant; the calculation participant determines a query tree of the query statement, and an intermediate node of the query tree represents an operator and is provided with the number of secure output tuples; the calculation participant cooperatively executes the query tree with other calculation participants based on a secret sub-table corresponding to the query tree, and if the number of tuples actually output by an intermediate node is smaller 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 requirement for the number of secure output tuples, and the query tree is executed; the virtual tuple carries secret fragments with invalid marks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of this specification relate to the field of privacy computing technology, 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 Art

[0002] In the fields of data analysis and information processing, with the development of big data technologies, the demand for joint computing among different data entities is growing, especially in scenarios involving privacy-sensitive information, such as financial risk management, medical research, and government collaboration. To meet these computing needs, multi-party secure computing (MPC) technology has emerged. Existing MPC systems typically allow multiple computing participants to collaboratively complete specific query tasks without disclosing the original data of the data subject.

[0003] In practical applications, to support common database query operations such as selection, join, sort, projection, and aggregation, existing multi-party secure computation systems typically employ a strategy of sequentially combining these operations in the form of secure operators. However, during this combination process, the size of the intermediate results output by each operator may vary depending on the characteristics of the input data. Undisclosed transmission of the size of these intermediate results could leak sensitive information, such as field distribution, join hit rates, and filtering effectiveness, severely impacting the overall security of the system. Summary of the Invention

[0004] In view of this, one or more embodiments of this 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 objectives, one or more embodiments of this specification provide the following technical solutions: According to a first aspect of one or more embodiments of this specification, a multi-party secure computing system is proposed, including a data holder, a data query party, and N computing participants, where N>1; The data holder is configured to split the data table it holds 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; The computing participant is configured to receive and store the secret sub-table; The data query party is used to send a query statement to the computing participant; The computing participant is further configured to determine a query tree of the query statement, wherein 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 configured with the number of secure output tuples; The computing participant is further configured to, based on the secret sub-table corresponding to the leaf node of the query tree, collaborate with other computing participants to execute each intermediate node layer by layer from the leaf node upwards in the execution order of the query tree; if the number of tuples actually output by an intermediate node is less than the number of secure output tuples of the intermediate node, add a dummy tuple to the actual output of the intermediate node to meet the number of secure output tuples, the dummy tuple carrying a secret shard marked as invalid; after the query tree is executed, generate a secret shard of the query result and return it to the data querying party; The data query party is also used to receive the secret shards of the query results returned by the N computing participants respectively, restore the initial query result from the N secret shards of the query results, and remove the virtual tuples carrying invalid marks in the initial query result to obtain the target query result.

[0006] According to a second aspect of the embodiments of this specification, a multi-party secure computing method is provided, which is applied to the computing participants described in the first aspect, and the method includes: Receive and store secret sub-tables sent by any data holder, and receive query statements sent by any data query party; Determine a query tree of the query statement, wherein leaf nodes of the query tree represent data tables specified by the query statement, intermediate nodes of the query tree represent operation operators specified by the query statement, and the intermediate nodes are set with a number of safe output tuples; Based on the secret table corresponding to the leaf node of the query tree, in collaboration with other computing participants, execute each intermediate node layer by layer from the leaf node upwards in the execution order of the query tree. If the number of tuples actually output by an intermediate node is less than the number of secure output tuples of the intermediate node, add a dummy tuple to the actual output of the intermediate node to meet the number of secure output tuples. The dummy tuple carries a secret shard marked as invalid. After the query tree is executed, a secret slice of the query result is generated and returned to the data query party.

[0007] According to a third aspect of the embodiments of this specification, a multi-party secure computing method is provided, which is applied to the data querying party described in the first aspect, and the method includes: Sending query statements to computing participants; and, Receive secret slices of query results respectively returned by N computing participants, recover an initial query result from the N secret slices of the query results, and remove virtual tuples carrying invalid tags in the initial query result to obtain a target query result.

[0008] According to a fourth aspect of the embodiments of this specification, there is provided an electronic device, including: processor; a memory for storing processor-executable instructions; When the processor executes the executable instructions, it is used to implement the method described in the second aspect or the third aspect.

[0009] According to a fifth aspect of the embodiments of this specification, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of the method described in the second aspect or the third aspect are implemented.

[0010] According to a sixth aspect of the embodiments of this specification, a computer program product is provided, comprising a computer program, which implements the steps of the method described in the second aspect or the third aspect when executed by a processor.

[0011] The technical solutions provided by the embodiments of this specification may have the following beneficial effects: In the embodiments of this specification, a secure output control mechanism is introduced during query execution. This mechanism sets a number of secure output tuples for each intermediate node in the query tree. When the actual output size is smaller than the number of secure output tuples, dummy tuples carrying secret fragments with invalidation flags are automatically added. This ensures that the intermediate results appear to have a fixed length externally, effectively preventing the potential risk of information leakage from inferring data characteristics or query paths based on the size of the intermediate output. Furthermore, to prevent dummy tuples from interfering with the final query results, after receiving and recovering the initial query results, the data querying entity can identify invalid fields and accurately remove all dummy tuples, ensuring the integrity and correctness of the final output results.

[0012] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 This is a schematic diagram of the architecture of a multi-party secure computing system provided by an exemplary embodiment.

[0014] Figure 2 It is a schematic diagram of splitting a data table into three secret sub-tables provided by an exemplary embodiment.

[0015] Figure 3A Schematic diagram of a candidate query tree (1) provided by an exemplary embodiment.

[0016] Figure 3B It is a schematic diagram of a candidate query tree (2) provided by an exemplary embodiment.

[0017] Figure 4 is a schematic diagram of a connection operation provided by an exemplary embodiment.

[0018] Figure 5 is another schematic diagram of a connection operation provided by an exemplary embodiment.

[0019] Figure 6 is another schematic diagram of a connection operation provided by an exemplary embodiment.

[0020] Figure 7 It is a schematic diagram of updating the secret slices of the arrangement sequence numbers corresponding to the non-connected fields in the first replicated secret table provided by an exemplary embodiment.

[0021] Figure 8 This is a flowchart of a multi-party secure computing method provided by an exemplary embodiment.

[0022] Figure 9 It is a structural diagram of an electronic device provided by an exemplary embodiment. DETAILED DESCRIPTION

[0023] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The implementations described in the following exemplary embodiments are not intended to represent all implementations consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with certain aspects of one or more embodiments of this specification, as detailed in the appended claims.

[0024] It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than those described in this specification. In addition, a single step described in this specification may be broken down into multiple steps for description in other embodiments, and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0025] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0026] In recent years, secure multi-party computation (MPC) has enabled multiple data entities to collaborate on complex queries on their own private data, exposing only the final results and not leaking any intermediate information. This feature perfectly meets the needs of industries such as banking, insurance, and healthcare to share insights while protecting customer privacy.

[0027] See also Figure 1 The embodiment of this specification provides a multi-party secure computing system, including a data holder, a data query party, and N computing participants, where N>1. There can be at least one data holder, and the computing participants include at least two, such as Figure 1 As shown, there can be three computing participants to implement three-party secure computing. Different computing participants can come from different computing organizations or from the same computing organization, and this embodiment does not impose any restrictions on this. Each computing participant can include a physical server, a server cluster, or a virtual server, but is not limited to this.

[0028] The data holder is used to split the data table it holds into N secret sub-tables according to the preset secret sharing algorithm, and send the N secret sub-tables to N computing participants respectively; the table structure of the N secret sub-tables is the same as the table structure of the data table.

[0029] It is understood that the embodiments of this specification do not impose any restrictions on the secret sharing algorithm, and the specific selection can be made based on the actual application scenario. In a general architecture, the data holder splits the data table it holds into N secret sub-tables and sends the N secret sub-tables to N computing participants. Each computing participant obtains at least one of the N secret sub-tables.

[0030] For example, see Figure 2 , the data table is split into three secret sub-tables and distributed to three computing participants respectively.

[0031] In one possible implementation, the data holder uses a traditional secret sharing protocol to split the original data into three distinct secret tables and distribute each to a corresponding computational participant. Each computational participant receives only one of the secret tables, and all computations are performed based on their local share and in collaboration with other participants.

[0032] In another possible implementation, the data holder adopts 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 restore the original information. 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.

[0033] It should be noted that no matter which secret sharing algorithm is adopted, each computing participant shall follow the same processing flow for each secret table it receives. Computational tasks such as encryption sorting, connection judgment, security comparison, rearrangement and permutation are all based on local secret tables and completed in collaboration with other computing participants without access to the complete original data, thereby ensuring that the system complies with the privacy protection constraints of multi-party secure computing throughout the process.

[0034] Here, "the table structure of the N secret sub-tables is the same as the table structure of the data table" means that the data organization, field definition, and constraint relationship of the split secret sub-tables are completely consistent with the original data table, including but not limited to: (1) The same number of fields. The secret sub-table contains exactly the same fields (columns) as the original data table. For example, if the original table has three fields: "ID", "Name", and "Age", each secret sub-table must also contain these three fields. No fields will be added or subtracted.

[0035] (2) The same field type. The data type (e.g., integer, string, date, etc.) and length constraints of each field are consistent with those in the original table. For example, if the "age" field in the original data table is an integer, this field in the secret sub-table must also be an integer, and the value range (e.g., whether it can be left blank, whether it has a default value, etc.) must be consistent.

[0036] (3) Primary key and index are the same. If the original data table has a primary key (such as "ID" as the primary key) or index, the definition of the primary key or index will also be retained in the secret shard table (although the actual data may be stored in shards, the constraints still exist).

[0037] (4) Foreign keys and associations are the same. If the original data table involves foreign key associations (such as referencing fields from other tables), the definition of the foreign key fields will still be retained in the secret sharded table to ensure that the sharded data can still be logically associated with other tables.

[0038] (5) The same field name. The name of the secret table can be customized (such as "Secret Table 1"), but the field name must be exactly the same as the original data table so that it can be aligned and processed according to the same field in subsequent collaborative calculations.

[0039] (6) The format of each row of data (a row of data is a tuple) is the same: each row of data in the secret table is the same as the original data table, containing the values ​​of all fields (although the specific values ​​may be fragments of the original data or encrypted values).

[0040] It is understandable that the embodiments of this specification do not impose any restrictions on the secret sharing algorithm, and the existing secret sharing algorithm in the relevant technology can be directly applied.

[0041] For example, the data holder is also used to send the metadata of the data table to N computing participants. The metadata of the data table can include field names, annotations (such as "user ID" and "transaction amount"), field types (such as integer, string, date), length limits (such as the "mobile phone number" field is an 11-digit string), and constraints (such as primary key, non-null, unique, etc.), ensuring that all computing participants have a consistent understanding of the data semantics.

[0042] Computing participant, used to receive and store metadata and secret sub-tables of data tables sent by any data holder.

[0043] The data query party sends query statements to the computing participants. For example, the data holder can disclose the metadata of the data table to the data query party. The metadata includes field names, data types, index information, connection relationships, etc. The data query party can construct a valid query statement based on the metadata, specifying the query target field and query type (such as selection, projection, aggregation, etc.).

[0044] Computational participants are also used to receive query statements and determine the query tree for the query statement. The leaf nodes of the query tree represent the data tables specified by the query statement, and the intermediate nodes of the query tree represent the operators specified by the query statement. The intermediate nodes are configured with a certain number of secure output tuples. Setting a secure output tuple number for intermediate nodes effectively controls the output scale and can serve as a privacy protection boundary condition, preventing the size of intermediate node outputs from leaking data distribution and enhancing overall computational privacy.

[0045] In a possible implementation, the query tree may be generated by a main computing participant among N computing participants by parsing the query statement and synchronized to other computing participants.

[0046] In another possible implementation, each computing participant can parse the query statement and generate its own query tree. Since all computing participants use the same parsing logic, the query tree generated by the computing participants for the same query statement is also consistent. In scenarios where centralized coordination is not required, each computing participant can parse the query statement in parallel, reducing additional synchronous transmission operations and improving the system's concurrent processing capabilities.

[0047] In some embodiments, to improve query execution efficiency and reduce the computational and communication burden during multi-party secure computation, a computation participant specifically parses a query statement to generate multiple candidate query trees. The execution order of the operators specified in the query statement may differ at least partially in different candidate query trees. That is, different candidate query trees represent different operator execution orders, and their structures may differ in terms of join order, projection / filtering positions, and other aspects. The computation participant further counts the number of fields involved in the execution of intermediate nodes in the candidate query trees based on the metadata of the data table specified in the query statement, such as the number of columns that need to be spliced ​​during joins and the fields that need to be retained before aggregation. Subsequently, based on the number of fields involved in the intermediate nodes in each candidate query tree, the computation participant selects the query tree with the fewest fields from the multiple candidate query trees. The selected query tree with the fewest fields means fewer data items are involved in operations such as sorting, comparison, concatenation, copying, and aggregation, significantly reducing the cryptographic computation cost during operator execution. Multi-party secure computation requires frequent exchange of encrypted intermediate results between computation participants. Reducing the number of fields directly reduces the size of the intermediate results, thereby reducing communication traffic and improving overall system throughput. Furthermore, reducing the number of fields results in fewer intermediate data tables and smaller data blocks during query tree execution, accelerating task execution and response time, particularly in low-latency query scenarios. All candidate query trees are screened based on metadata, without exposing any field values ​​or record content, ensuring that the sorting optimization process maintains privacy protections.

[0048] For example, take the three-table join query R1(A, B) Join R2(B, C) Join R3(C, D, E) as an example. Table R1 contains fields (A, B), table R2 contains fields (B, C), and table R3 contains fields (C, D, E). The calculation participation policy for this three-table join query generates the following: Figure 3A and Figure 3B The two candidate query trees are shown. Figure 3AThe first join operator of the candidate query tree (1) shown is used to implement the join between R1 and R2, involving 4 fields, and obtaining the intermediate table R4 (A, B, C). The second join operator is used to implement the join between R3 and R4, involving 6 fields. Figure 3B The first join operator of the candidate query tree (2) shown is used to implement the join between R2 and R3, involving 5 fields, and obtaining 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. A comprehensive comparison shows that the candidate query tree (1) involves fewer fields and requires less computation and communication overhead. Candidate query tree (1) can be selected as the final query tree.

[0049] In some embodiments, if a query involves a join of at least two data tables, to avoid processing a large number of ultimately useless intermediate tuples in subsequent join or aggregation operations, before executing the query tree, a computation participant may collaborate with other computation participants to perform a semi-join operation based on the secret shards corresponding to the at least two data tables specified in the query statement. This operation checks whether tuples in the secret shards participate in the query result, thereby obtaining a secret shard of the check result for each tuple. A semi-join is a filtering sub-operation that simplifies the join operation. Its logical meaning is: given two data tables R and S, executing R ⋉ S means "find all tuples in R that have a match in the join field in S," but without concatenating the fields of S into the result. All tuples in R that have a match in the join field in S participate in the query result. Tuples in R that do not have a match in the join field in S will not appear in the final query result in any join operation (such as an equijoin or inner join). The semi-join operation process can be found in the description of the semi-join operator below and will not be further elaborated here.

[0050] After obtaining the secret slice of the check result for each tuple, the computational participant further collaborates with other computational participants to generate a secret slice of the tag field for each tuple based on the secret slice of the check result. The tag field corresponding to tuples participating in the query results is the validly marked secret slice, while the tag field corresponding to tuples not participating in the query results is the invalidly marked secret slice, thereby filtering out tuples not participating in the query results. This approach allows the system to pre-mark and filter out invalid tuples without performing a full join, at minimal communication and comparison costs. In a secret sharing environment, data transmission and processing are both costly. Pre-screening and eliminating invalid tuples reduces the number of ciphertext data blocks that need to be synchronized, reducing the total communication volume. The semi-join operation performs cryptographic comparisons based solely on the field values ​​in the secret-shared format and generates a secret slice of the tag field. This does not disclose the field values, matching relationships, or whether any tuples are retained, thus meeting the privacy requirements of multi-party computation for access pattern concealment and output size.

[0051] In some embodiments, the setting of the number of secure output tuples of an intermediate node is exemplified as follows: First, a computing participant can determine the final output size of the query using one of two methods: First, the computing participant can collaboratively estimate the final output tuple size of the query statement based on the secret shared data of the data table specified by the query statement. Second, the computing participant can obtain the final output tuple size that is pre-set for the query statement.

[0052] Next, the computing participants can estimate the number of intermediate output tuples for each intermediate node in the query tree based on the metadata of the data tables specified by the query statement. For example, if the intermediate node has only one input data table (e.g., selection or projection), the number of intermediate output tuples for the intermediate node is determined by the number of tuples in the input data table. For example, the number of intermediate output tuples for the intermediate node is the number of tuples in the input data table. If the intermediate node has more than one input data table (e.g., semi-join or join), the number of intermediate output tuples for the intermediate node is determined by multiplying the number of tuples in the input data tables. For example, if the intermediate node has two input data tables, the number of intermediate output tuples for the intermediate node is the product of the number of tuples in the two input data tables, to represent the scale of the join result in the worst case.

[0053] 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 safe output tuple number of the intermediate node. This strategy ensures that the upper limit of the output result scale is reasonable and does not leak data distribution or calculation path characteristics due to a large number of temporary results generated by a certain intermediate operator.

[0054] 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 based on 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 exploitable tuples.

[0055] For example, if the final output is limited to 10,000, and an intermediate node estimates 1,000,000, the number of secure output tuples for that connected node is limited to 10,000. If, in actual execution, only 3,000 tuples are output, the system will pad with 7,000 dummy tuples, making the intermediate output indistinguishable from other nodes in ciphertext form.

[0056] The computational participant is further configured to execute each intermediate node layer by layer, starting from the leaf node and working in coordination with other computational participants, based on the secret table corresponding to the leaf node of the query tree, in the execution order of the query tree. If the number of tuples actually output by an intermediate node is less than the number of secure output tuples of the intermediate node, a dummy tuple is added to the actual output of the intermediate node to meet the number of secure output tuples. The dummy tuple carries a secret shard marked as invalid. The dummy tuple uses a meaningless placeholder value for its data content. Each dummy tuple carries a secret shard marked as invalid, indicating that the tuple is invalid. Valid tuples can carry a secret shard marked as valid to facilitate distinguishing between the dummy tuples. After the query tree is executed, a secret shard of the query result is generated and returned to the data querying party.

[0057] The data querying party is also used to receive the secret shards of the query results returned by the N computing participants and recover the initial query result from the secret shards of the N query results. This initial result may contain dummy tuples padded for privacy protection. Therefore, the data querying party can remove the dummy tuples marked as invalid in the initial query result to obtain the target query result.

[0058] For example, an intermediate node involved in a connection operator actually only outputs 5 results, but the system sets the safe output of the intermediate node to 100, then 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 removes invalid tuples through the marking field, and only outputs the correct 5 results.

[0059] This system can achieve the following beneficial effects by introducing a virtual tuple filling mechanism when the output of intermediate nodes is insufficient, and eliminating invalid tuples based on the tag field in the final recovery stage: (1) External or malicious parties cannot infer sensitive information such as input data distribution, selectivity, connection density, etc. through the number of output tuples, thereby ensuring the key output privacy in multi-party computation; (2) Although the intermediate output results are filled with invalid virtual tuples, the virtual tuples carry encrypted invalid tags. During recovery, data query parties can accurately identify and eliminate virtual tuples through the tags without affecting the correctness or integrity of the results.

[0060] In some embodiments, when processing complex data query requests, especially those involving database operations such as sorting, filtering, joining, and aggregation, it is often necessary to compare, judge, or group a certain field. These operations can be completed efficiently in traditional plaintext databases, but face significant challenges in an MPC environment. Since the computing participants hold data in encrypted form, they cannot directly compare the size of any two data items, nor can they determine the order between data items. If plaintext comparison or exchange is performed directly, data privacy will be leaked. Therefore, in an MPC environment, a special secure sorting protocol (such as a protocol based on a comparison circuit or sorting network) must be used to sort the data in an encrypted state. Traditional methods re-sort the data securely for each query, which causes the sorting operation to become a performance bottleneck during the overall query execution process. Especially when the data scale is large, the queries are frequent, or the combinational logic is complex, the computing resource consumption increases significantly and the execution efficiency is severely limited.

[0061] Based on this, the embodiments of this specification implement a method of changing the "safe sorting" process from being performed every time a query is made to being performed only once during the data import phase or before the first query, obtaining the sorting information and saving it. The sorting information can be reused in subsequent query processes, thereby effectively reducing repeated calculations and redundant communications and improving query efficiency.

[0062] The data holder is used to send the metadata of the data table to N computing participants, and to send N secret sub-tables of the data table to N computing participants respectively.

[0063] The computing participant is used to receive and store secret sub-tables. It can determine all target fields that need to be sorted based on the metadata in the data table. For example, it can determine the connection fields, aggregation fields, projection fields, etc. based on the description information of each field in the metadata, and determine these fields as the target fields that need to be sorted.

[0064] Calculation participants are also used to extract the secret shared columns of the target fields to be sorted from the secret table; for example, see Figure 2Assuming that field 3 is determined as the target field, each computing party holds one secret sub-table for exemplary explanation. Computing party 1 extracts the secret shared column of field 3 from secret sub-table 1, that is, {g1, k1, l1}. Computing party 2 extracts the secret shared column of field 3 from secret sub-table 1, that is, {g2, k2, l2}, and extracts the secret shared column of field 3 from secret sub-table 3, that is, {g3, k3, l3}.

[0065] The computation participants are further configured to collaboratively execute a pre-set secure sorting algorithm with other computation participants based on the secret shared column of the target field to obtain a sorted secret shared column. Based on the secure sorting algorithm, the N computation participants perform a secure comparison operation on each secret shared value in the target field within the secret shared data structure, collaboratively calculate the permutation position of each secret shared value in the sorted result, and perform a secure permutation operation based on the permutation position to rearrange the corresponding secret shared values ​​to generate a sorted secret shared column. During the secure sorting process, each computation participant completes the collaborative computation without disclosing any input values, comparison results, or sorting order, ensuring full privacy protection throughout the entire sorting process. It is understood that after the secure sorting, the permutation position of each secret shared value in the secret shared column within the sorted secret shared column naturally corresponds to its permutation sequence number.

[0066] The computing participant is further used to collaboratively determine, based on the sorted secret sharing column, with other computing participants, the secret shards of the arrangement numbers corresponding one-to-one to each secret sharing value in the sorted secret sharing column.

[0067] In one possible implementation, a computing participant, specifically acting as the primary computing participant, after obtaining a sorted secret sharing column, generates a unique permutation number corresponding one-to-one to each secret sharing value in the sorted secret sharing column; splits each permutation number into N secret shards based on a preset secret sharing algorithm, retains one of the secret shards, and sends the other N-1 secret shards to the other N-1 computing participants. In this embodiment, although the primary computing participant generates the plaintext permutation number, each computing participant can only see its own secret shard of the permutation number after the plaintext permutation number is secret-shared, and cannot restore the plaintext permutation number. Thus, the plaintext permutation number can continue to be used in an encrypted state in subsequent query operations without revealing any sorting details. The primary computing participant centrally generates the plaintext permutation number, uniformly splits it into secret shards, and distributes them to each participant. This simplifies operation, has clear logic, and reduces implementation overhead.

[0068] In another possible implementation, each computing participant, after obtaining the sorted secret shared column, is specifically configured to generate a unique permutation number corresponding to each secret shared value in the sorted secret shared column. Based on a preset secret sharing algorithm, each permutation number is split into N secret slices, with a designated one of the N secret slices retained. In this embodiment, all computing participants are aware of the "n values ​​to be sorted" and possess the sorted secret shared column. Therefore, each computing participant can independently generate a secret slice of the permutation number, which can then be used in an encrypted state in subsequent queries without revealing any sorting details. Each computing participant independently generates its own secret slice of the permutation number locally, without relying on a master computing party or centralized operations. This is suitable for distributed environments without a trusted master party, eliminating the need to transmit secret slices of the sequence number between computing participants and reducing system communication burden.

[0069] Both of the above implementation methods can ensure that the final generated permutation sequence number is stored and used in a secret sharing form, avoiding the disclosure of sensitive information such as the sorting position or relative size in the sorting results.

[0070] Data query party, used to send query statements to computing participants.

[0071] A computing participant is configured to determine a query tree based on the above-described process and collaboratively execute the query tree with other computing participants. During the collaborative execution of 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 participant collaboratively rearranges the secret sub-table corresponding to the input data table according to the secret shards corresponding to the arrangement sequence of the target field to obtain a rearranged secret sub-table; based on the rearranged secret sub-table, the participant collaboratively executes the operation indicated by the intermediate node with other computing participants.

[0072] In this embodiment, the inventors found in the process of implementing the multi-party secure computing system described in this specification that in a three-party secure computing environment, traditional secure query solutions usually need to perform a secure sorting operation for each query, and its computational complexity is usually O (n* ) or O( ), where n represents the number of tuples in the data table involved in the query, which leads to significant query latency and communication burden, especially affecting the real-time and scalability of the system in high-frequency access or large data volume scenarios.

[0073] The embodiments of this specification propose a query pre-processing optimization mechanism, which moves the security sorting operation that originally needs to be repeatedly performed in the query phase to the data import phase or is completed uniformly before the first query, and caches the sorting results in the form of secret slices of the arrangement sequence number in the computing participants. In the subsequent query process, the computing participants can directly reuse the generated secret slices of the arrangement sequence number, and only need to cooperate with other computing parties to complete a lightweight rank-based encryption re-arrangement operation to achieve an equivalent sorting effect without re-executing the high-overhead comparison and exchange protocol. Through the above optimization, the system reduces the sorting overhead in the query path from the traditional near-logarithmic complexity O (n* ) or O( ) is significantly reduced to linear complexity O(n), effectively compressing query latency and significantly improving the system's real-time response and high-frequency query processing capabilities. Furthermore, the permutation numbers are stored in secret shards, preventing the disclosure of any field values, sorting order, or data distribution characteristics during the entire query process, fully satisfying the privacy protection requirements of multi-party computation. During the reordering and query operations, all sorting information, permutation numbers, and data tables remain in a secret shared state, preventing the disclosure of sorting order, field size relationships, or actual data content, ensuring privacy throughout the query process.

[0074] The following is an example of the execution process of different types of operators: 1. Selection operator. The selection operator is used to select a subset of tuples that meet the specified query criteria. Because data tables are distributed among multiple computing parties in a secret-sharing manner, it is impossible to directly determine whether a tuple value meets the query criteria. Therefore, a multi-party secure computation protocol is required for collaborative execution.

[0075] If the intermediate node's operator includes a selection operator, the computational participant can, based on the query conditions of the selection operation, collaboratively determine with other computational participants whether each tuple in the secret subtable corresponding to the selection operator's input data table meets the query conditions, thereby obtaining a secret shard of the determination result for each tuple. The computational participant then collaboratively generates a secret shard of a tag field for each tuple based on the secret shard of the determination result. The tag field indicates whether the tuple is valid. Tuples that meet the query conditions have a tag field corresponding to a valid-tagged secret shard, while tuples that do not meet the query conditions have an invalid-tagged secret shard. This tag field can be used to mask or ignore invalid tuples in subsequent queries to ensure the accuracy of query results.

[0076] To maintain the order and accuracy of the permutation sequence numbers, the permutation sequence numbers for the target fields must be updated after selection. A computation participant can collaborate with other computation participants to rearrange the secret table based on the secret slices of the permutation sequence numbers corresponding to the target fields in the input data table, obtaining a rearranged secret table. Then, based on the secret slices of the tag fields of each tuple in the rearranged secret table, the computation participant collaborates with other computation participants to move tuples with invalid tags in the tag fields to the end of the rearranged secret table, retaining tuples with valid tags in the tag fields at the beginning of the rearranged secret table. Based on the rearranged secret table after the shift, the computation participant collaborates with other computation participants to determine the secret slices of the permutation sequence numbers that correspond one-to-one to specific tuples in the rearranged secret table after the shift. The specific tuples include at least tuples with valid tags in the tag fields. This operation ensures that the permutation sequence numbers for tuples with valid tags in the tag fields are compact (consecutive 1, 2, ..., m), retain their correct sort positions, and exclude invalid tuples that were filtered out by the selection operation, facilitating subsequent operations such as paging and grouping.

[0077] In some scenarios, the tuples whose mark fields are marked as invalid may also be reassigned secret fragments with arranged sequence numbers. This embodiment does not impose any restrictions on this.

[0078] (2) Projection operator. The projection operator is to select certain specific columns (fields) from the data table and remove duplicates as the output result.

[0079] In some embodiments, 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, the computing participant can, according to the secret shards of the arrangement sequence numbers corresponding to the projection fields in the data table, collaborate with other computing participants to rearrange the secret sub-table corresponding to the input data table of the projection operator, and obtain a rearranged secret sub-table corresponding to the input data table of the projection operator and arranged according to the projection fields, such as sorting from small to large by the projection field values. Since the sorting order is pre-processed, the rearrangement process only involves position adjustment, which is efficient and will not leak specific field values.

[0080] Next, the computing participant can collaborate with other computing participants to compare whether the projected field values ​​of each tuple in the rearranged secret table are the same as the projected field values ​​of the previous tuple, and generate secret shards of the comparison results for each tuple, that is, to perform deduplication judgment. The comparison results of whether the projected field values ​​between tuples are the same exist in the form of secret sharing, and the field equality relationship is not disclosed to any single party to prevent attacks. Based on the secret shards of the comparison results of each tuple, the computing participant can collaborate with other computing participants to generate secret shards of the tag field for each tuple; wherein the tag field is used to indicate whether the tuple is valid. The tag field corresponding to the tuple with a different field value from the previous tuple is a valid-tagged secret shard, and the tag field corresponding to the tuple with the same field value as the previous tuple is an invalid-tagged secret shard.

[0081] In order to maintain the continuity and accuracy of the arrangement sequence numbers of the projection fields used subsequently, it is necessary to reallocate the arrangement sequence numbers. Based on the secret shards of the tag fields of each tuple in the rearranged secret sub-table, the computing participant collaborates with other computing participants to move the tuples with invalid tags in the tag fields to the end of the rearranged secret sub-table, and retain the tuples with valid tags in the tag fields at the front of the rearranged secret sub-table; based on the rearranged secret sub-table after the move, collaborate with other computing participants to determine the secret shards of the arrangement sequence numbers that correspond one-to-one to the specified tuples in the rearranged secret sub-table after the move, and the specified tuples at least include tuples with valid tags in the tag fields, and finally obtain a deduplicated secret sub-table that maintains a consistent sorting structure, which can continue to participate in subsequent aggregation and other operations. In this embodiment, after filtering out duplicate tuples, the arrangement sequence numbers are reallocated to ensure the accuracy of the sorting, which is beneficial to the correctness and stability of subsequent related operations, such as paging and window functions.

[0082] In some scenarios, the tuples whose mark fields are marked as invalid may also be reassigned secret fragments with arranged sequence numbers. This embodiment does not impose any restrictions on this.

[0083] (3) Aggregation operators. Aggregation operators are used to aggregate, calculate, and count a set of data during a query to obtain a single result, such as calculating averages, sums, and counts. The system can perform secure aggregation processes under secret shared data structures.

[0084] In some embodiments, when the operation operator of the intermediate node includes an aggregation operator and the target field includes the aggregation field specified by the aggregation operator, the computing participant can collaboratively rearrange the corresponding secret sub-table according to the secret shards of the arrangement sequence number corresponding to the aggregation field in the input data table of the aggregation operator, and obtain a rearranged secret sub-table corresponding to the input data table of the aggregation operator and arranged according to the aggregation field. The rearrangement process is completed without leaking the field value or order of the aggregation field, in preparation for subsequent group aggregation.

[0085] Next, the computational participant can collaborate with other computational participants to detect whether the aggregate field value of each tuple in the rearranged secret partition table is the same as the aggregate field value of the previous tuple, generating a secret partition of the detection results for each tuple. If the aggregate field value of a tuple is the same as the aggregate field value of the previous tuple, the two belong to the same group; if the aggregate field value of a tuple is different from the aggregate field value of the previous tuple, the tuple is regarded as the first tuple in the new group.

[0086] Based on the secret shards of the test results for each tuple, the following operations are performed in collaboration with other computational participants: tuples in the rearranged secret table are grouped, with tuples with the same aggregate field value belonging to the same group. Tuples within each group are aggregated, and the aggregation result is written to the last tuple in the group in a secret-shared format. A secret shard with a tag field is generated for each tuple in the rearranged secret table. The tag field indicates whether the tuple is valid. The tag field corresponding to the last tuple in each group is a valid-marked secret shard, while the tag fields corresponding to the remaining tuples are invalid-marked secret shards. The entire aggregation process (group determination, aggregation function calculation, and result tagging) is completed within the secret-shared structure, without exposing the original data, group boundaries, or aggregate values, effectively preventing information leakage.

[0087] To maintain the continuity of the sort, the computing participants can, based on the secret shards of the tag fields of each tuple in the rearranged secret sub-table arranged according to the aggregation field, collaborate with other computing participants to move tuples with invalid tag fields to the end of the rearranged secret sub-table, retaining tuples with valid tag fields at the beginning of the rearranged secret sub-table; based on the rearranged secret sub-table after the move, collaborate with other computing participants to determine the secret shards of the permutation sequence corresponding to the specified tuples in the rearranged secret sub-table after the move, where the specified tuples at least include tuples with valid tag fields. After aggregation, by reassigning the secret shards of the permutation sequence to the valid tuples, subsequent operations can maintain the continuity of the logical order, which is beneficial for application scenarios such as paging output and aggregation result display.

[0088] In some scenarios, the tuples whose mark fields are marked as invalid may also be reassigned secret fragments with arranged sequence numbers. This embodiment does not impose any restrictions on this.

[0089] (4) Semi-join operator. Semi-join is a filtering join operation based on the join fields. Its function is to return only the tuples in the left table (first data table) that can find matching items in the right table (second data table), but without splicing the right table fields.

[0090] In some embodiments, 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, the computing participant can determine a first rearranged secret sub-table corresponding to the first data table in the two data tables and arranged according to the join field based on a rearrangement process similar to the above, and determine a second rearranged secret sub-table corresponding to the second data table in the two data tables and arranged according to the join field.

[0091] Next, the computational participant can collaborate with other computational participants to determine whether each tuple in the first rearranged secret sub-table has a tuple with a matching connection field value in the second rearranged secret sub-table, generating a secret shard representing the matching results for each tuple in the first rearranged secret sub-table. Based on the secret shard representing the matching results for each tuple in the first rearranged secret sub-table, the computational participant can collaborate with other computational participants to generate a secret shard representing the tag field for each tuple in the first rearranged secret sub-table. Tuples with a "yes" match result correspond to a validly marked secret shard, while tuples with a "no" match result correspond to an invalidly marked secret shard. During the semi-join process, all field values, matching results, and tag states exist as secret shards, and no computational participant can independently infer data content or connection hit information.

[0092] To ensure that the output structure after the query is compact and the sequence is continuous, the computing participant can, based on the secret shards of the tag fields of each tuple in the first rearranged secret sub-table, collaborate with other computing participants to move the tuples whose tag fields are invalid tags to the end of the first rearranged secret sub-table, and retain the tuples whose tag fields are valid tags at the front of the first rearranged secret sub-table; based on the first rearranged secret sub-table after the move, collaborate with other computing participants to determine the secret shards of the permutation numbers that correspond one-to-one to the specified tuples in the first rearranged secret sub-table after the move, and the specified tuples at least include tuples whose tag fields are valid tags. By reassigning the secret shards of the permutation numbers to the valid tuples, subsequent operations can maintain the continuity of the logical sequence. In some scenarios, the secret shards of the permutation numbers can also be reassigned to the tuples whose tag fields are invalid tags, and this embodiment does not impose any restrictions on this.

[0093] (5) Join operator. In a plaintext database, the join operator (Join) is used to combine tuple pairs with equal values ​​in the join field from two tables. In a secret sharing environment, it is not possible to directly access the field values ​​for joins. Therefore, the join process must be implemented through a collaborative protocol to ensure that data privacy is not leaked.

[0094] In some embodiments, 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, the system may perform a secure connection process under a secret sharing data structure.

[0095] Based on a similar rearrangement process as described above, the computing participants can determine a first rearranged secret sub-table corresponding to the first data table in the two data tables and arranged according to the connection fields, and determine a second rearranged secret sub-table corresponding to the second data table in the two data tables and arranged according to the connection fields. This optimizes the access order for subsequent matching. For example, the first data table contains fields A and B, and the arrangement sequence number corresponding to A is / A / , and the arrangement sequence number corresponding to B is / B / . Figure 4 The second data table contains 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 ease of understanding, Figure 4 、 Figure 5 、 Figure 6 as well as Figure 7 The field values ​​and arrangement numbers in are expressed in plain text, but in actual application, the field values ​​and arrangement numbers exist in cipher text.

[0096] Next, the computing participant can collaborate with other computing participants to count the number of tuples in the first rearranged secret sub-table whose connection field values ​​match those in the second rearranged secret sub-table, and count the number of tuples in the second rearranged secret sub-table whose connection field values ​​match those in the first rearranged secret sub-table, and generate secret fragments with the number of matches for each tuple in the first rearranged secret sub-table and the number of matches for each tuple in the second rearranged secret sub-table. It should be noted that, for ease of understanding, Figure 4 and Figure 5 The number of copies (that is, the number of matches) in is expressed in plain text, but in actual application, the number of copies (that is, the number of matches) exists in cipher text.

[0097] See also Figure 4 Based on the secret shards of the matching number of each tuple in the first rearranged secret sub-table, the computing participant can collaborate with other computing participants to copy the tuples in the first rearranged secret sub-table according to the corresponding matching number to obtain a first copied secret sub-table.

[0098] See also Figure 5 Based on the secret shards of the matching number of each tuple in the second rearranged secret sub-table, the computing participant cooperates with other computing participants to copy the tuples in the second rearranged secret sub-table according to the corresponding matching number to obtain a second copied secret sub-table.

[0099] After reordering the secret tables corresponding to the two data tables, a computing participant collaborates with other computing participants to count the number of connection matches for each tuple and replicate the tuples accordingly. This is because, in traditional plaintext databases, join operations (such as equijoins) are typically performed by concatenating tuples with equal join field values, requiring no additional processing. However, in multi-party secure computation scenarios, since each computing participant cannot directly observe the plaintext content of any data item or determine how many external tuples a tuple matches, it is impossible to dynamically generate all join results. To achieve join semantics equivalent to those in a plaintext environment, this system uses the aforementioned connection match counting and tuple replication process to physically prepare "matching pairs" that can be concatenated one by one. This pre-converts logical connection relationships into structural sequential correspondences. This allows computing participants to collaboratively complete secure connection concatenation based solely on positional relationships, even without direct access to field values. Furthermore, the number of matches is represented in secret shards, ensuring that the statistical results do not reveal the true connection distribution.

[0100] Next, see Figure 5 , the computing participant aligns the second secret copy sub-table so that the sorting order of each tuple in the aligned second secret copy sub-table is consistent with the sorting order of each tuple in the first secret copy sub-table. In the process of aligning the second secret copy sub-table, the computing participant collaborates with other computing participants to perform the following operations: perform a first sort on the second secret copy sub-table according to the field value of the sorting field, for example Figure 5 First, sort by field B in the order of b1→b2→b3; if there are multiple tuples with the same sort field value, such as Figure 5 In the example, b1 corresponds to 6 tuples, and a second sort is further performed according to the copy order of each tuple in the multiple tuples. In the second sort, the tuples with a higher copy order have a higher corresponding arrangement order, thereby obtaining the aligned second copy secret partition table.

[0101] The reason for alignment is that in traditional plaintext database systems, join operations can be achieved by directly comparing join fields and dynamically splicing matching tuples. However, in multi-party secure computation systems, since all field values ​​are stored as secret shares, computation participants cannot directly access the join field values ​​of any tuple, nor can they logically "jump" to a specific tuple position for matching and splicing. To achieve secure tuple splicing, a positional alignment method is employed. The two replicated secret-shared data tables are sorted by their join field values. Assuming the join field values ​​are the same, the tuples are further sorted according to the order in which they were replicated. This double sorting operation ensures that the join fields match between tuples at corresponding positions in the two tables. Through this alignment, the system can directly and sequentially splice tuples in the two tables one by one, without revealing the join field values ​​or the join hit relationship. This allows for secure and efficient join operations, avoiding errors in results or privacy leaks caused by misplaced splicing.

[0102] The computing participant is also used to coordinate with other computing participants to determine the secret shards of the arrangement number corresponding to the sorting field for each tuple in the first copied secret sub-table; and to coordinate with other computing participants to determine the secret shards of the arrangement number corresponding to the sorting field for each tuple in the aligned second copied secret sub-table. Figure 4 and Figure 5 , Figure 4 The corresponding arrangement number of each tuple in the sorting field of the first copy secret table is shown. Figure 5 The figure shows the arrangement sequence number corresponding to each tuple in the sorting field in the aligned second copy secret sub-table.

[0103] Finally, see Figure 6 The computing participant collaborates with other computing participants to splice the first copy secret sub-table and the aligned second copy secret sub-table, completing the connection operation while ensuring the privacy and security of the entire data processing process.

[0104] For example, when the target fields involved in the first data table include not only 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 number corresponding to the non-connection field when performing the connection operation. In a plaintext database, the order of non-connection fields can be naturally arranged directly following the connection result, but in a secret sharing environment, since the connection operation requires the tuple to be copied, rearranged, aligned, etc., the original arrangement number information of the non-connection field will be destroyed or invalid. Therefore, if subsequent operations such as sorting, projection, deduplication, and aggregation based on the non-connection field are involved, the corresponding arrangement number must be recalculated. Continuing with 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 their arrangement numbers need to be updated accordingly.

[0105] In the case that the target fields involved in the first data table also include non-connected fields, please refer to Figure 7 The computational participant determines a third rearranged secret sub-table corresponding to the first data table and arranged according to non-connected fields. Based on the third rearranged secret sub-table, the computational participant collaborates with other computational participants to perform an update operation to update the secret shards of the permutation numbers corresponding to the non-connected fields in the first replicated secret sub-table. Because, after tuples are replicated in the first replicated secret sub-table, one original tuple may correspond to multiple new tuples, these replicated tuples must be assigned consecutive permutation numbers to avoid permutation number conflicts or omissions.

[0106] The update operation includes: counting the number of times each tuple in the third rearranged secret sub-table is replicated in the first replicated secret sub-table, and the number of replications of tuples not involved in the connection is zero; based on the number of replications of each tuple in the third rearranged secret sub-table, calculating the initial sorting sequence number of each tuple with a non-zero replication number, the initial sorting sequence number of the first tuple with a non-zero replication number is the secret shard of one, and the initial sorting sequence numbers of other tuples are obtained by performing prefix accumulation on the replication number and then adding one, such as Figure 7 The initial sort order of the second tuple {a1, b2} in the tuple is the result of the number of copies of the previous tuple {a1, b1}, 2 plus 1. Figure 7The initial sorting sequence number of the third tuple {a2, b1} in the table is 3 plus 1, which is the result of the cumulative number of replications of the first two tuples, and so on; each tuple is replicated based on the number of replications of each tuple in the third rearranged secret sub-table to form a third replicated secret sub-table; in the third replicated secret sub-table, each tuple is traversed in turn, and the non-connected field value of the current tuple is compared with the non-connected field value of its previous tuple; if the non-connected field values ​​of the two tuples are the same, the sorting sequence number of the current tuple is set to the sorting sequence number of the previous tuple plus one; if they are not the same, the sorting sequence number of the current tuple remains unchanged. In this embodiment, the prefix sum of the number of replications is used as the initial sorting sequence number, combined with the ordered increment strategy after the judgment of the same field value, to ensure that the new sorting sequence number is continuous, monotonic, and distinguishable from duplicate tuples. The updated sorting sequence number information is represented by a secret shard in the secret sharing structure, without leaking any field value, duplicate 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 sub-table to determine the secret shards corresponding to the arrangement sequence numbers of each tuple, the third replicated secret sub-table is rearranged according to the connection field B to obtain the first replicated secret sub-table. In the first replicated secret sub-table, the arrangement sequence of the non-connection field A is also determined.

[0107] Similarly, when the target fields involved in the second data table also include non-connected fields, the computing participant determines the fourth rearranged secret sub-table corresponding to the second data table and arranged according to the non-connected fields, and based on the fourth rearranged secret sub-table, collaboratively performs an update operation with other computing participants to update the secret fragments of the arrangement sequence numbers corresponding to the non-connected fields in the second copied secret sub-table.

[0108] Among them, the update operation includes: counting the number of times each tuple in the fourth rearranged secret sub-table is copied in the second copied secret sub-table, and the number of copies of the tuple not involved in the connection is zero; based on the number of copies of each tuple in the fourth rearranged secret sub-table, calculating the initial sorting number of each tuple, the initial sorting number of the first tuple with a non-zero number of copies is a secret shard of one, and the initial sorting numbers of other tuples are obtained by performing prefix accumulation on the number of copies and then adding one; based on the number of copies of each tuple in the fourth rearranged secret sub-table, copying each tuple to form a fourth copied secret sub-table; in the fourth copied secret sub-table, traversing each tuple in turn, and comparing the non-connected field value of the current tuple with the non-connected field value of its previous tuple; if the non-connected field values ​​of the two tuples are the same, the sorting number of the current tuple is set to the sorting number of the previous tuple plus one; if they are not the same, the sorting number of the current tuple remains unchanged.

[0109] The various technical features in the above embodiments can be combined arbitrarily as long as there is no conflict or contradiction between the combinations of features. However, due to space limitations, they are not described one by one. Therefore, the arbitrary combination of the various technical features in the above embodiments also falls within the scope of disclosure of this specification.

[0110] In some embodiments, see Figure 8 The embodiment of this specification also provides a multi-party secure computing method, which is applied to the above computing participants, and the method includes: In S801, a secret sub-table sent by any data holder is received and stored.

[0111] In S802, a query statement sent by any data query party is received.

[0112] In S803 , a query tree of the query statement is determined, wherein the leaf nodes of the query tree represent the data tables specified by the query statement, and the intermediate nodes of the query tree represent the operation operators specified by the query statement. The intermediate nodes are set with the number of safe output tuples.

[0113] In S804, based on the secret sub-table corresponding to the leaf node of the query tree, in collaboration with other computing participants, each intermediate node is executed layer by layer from the leaf node upward in the execution order of the query tree. If the number of tuples actually output by an intermediate node is less than the number of secure output tuples of the intermediate node, a virtual tuple is added to the actual output of the intermediate node to meet the number of secure output tuples. The virtual tuple carries a secret shard marked as invalid.

[0114] In S805, after the query tree is executed, a secret fragment of the query result is generated and returned to the data query party.

[0115] In one implementation, the method further includes: receiving and storing metadata of the data table sent by the data holder.

[0116] In one implementation, it also includes: based on the secret shared data of the data table specified by the query statement, collaboratively estimating the final output tuple number of the query statement with other computing participants, or obtaining the final output tuple number pre-set for the query statement; 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 between 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.

[0117] In one implementation, if the intermediate node has one input data table, 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.

[0118] In one implementation, determining the query tree of the query statement includes: parsing the query statement to generate multiple 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 table specified by the query statement; and screening out the query tree with the least number of fields involved from the multiple candidate query trees based on the number of fields involved in the intermediate nodes in each of the candidate query trees.

[0119] In one implementation, it also includes: if the query statement involves a joint query of at least two data tables, before executing the query tree, based on the secret sub-tables corresponding to the at least two data tables specified by the query statement, collaboratively performing a semi-join operation with other computing participants to check whether the tuples in the secret sub-table participate in the query results, and obtaining secret shards of the inspection results of each tuple; based on the secret shards of the inspection results of each tuple, collaboratively generating secret shards of the tag fields for each tuple with other computing participants; wherein, the tag fields corresponding to the tuples participating in the query results are secret shards with valid tags, and the tag fields corresponding to the tuples not participating in the query results are secret shards with invalid tags.

[0120] In one implementation, it also includes: the computing participant determines the target field to be sorted in the secret sub-table based on the metadata of the data table, and extracts the secret sharing column of the target field to be sorted from the secret sub-table; based on the secret sharing column of the target field, collaborates with other computing participants to execute a preset security sorting algorithm to obtain a sorted secret sharing column; based on the sorted secret sharing column, collaborates with other computing participants to determine the secret shards with arrangement numbers corresponding one-to-one to each secret sharing value in the sorted secret sharing column.

[0121] In one implementation, the method further includes: in the process of collaboratively executing each intermediate node in the query tree with other computing participants, if the input data table of the intermediate node involves the target field, according to the secret shards of the arrangement numbers corresponding to the target field, collaboratively with other computing participants, rearrange the secret sub-tables corresponding to the input data table to obtain rearranged secret sub-tables; based on the rearranged secret sub-tables, collaboratively execute the operations indicated by the intermediate node with other computing participants.

[0122] In one implementation, based on the sorted secret sharing column, the secret shards of the arrangement numbers corresponding one-to-one to each secret sharing value in the sorted secret sharing column are determined in collaboration with other computing participants, including: in the case of being the main computing participant, after obtaining the sorted secret sharing column, generating a unique arrangement number corresponding one-to-one to each secret sharing value in the sorted secret sharing column; based on a preset secret sharing algorithm, splitting each of the arrangement numbers into N secret shards, retaining one of the secret shards, and sending the other N-1 secret shards to the other N-1 computing participants respectively.

[0123] In one implementation, it also includes: if the operation operator of the intermediate node includes a selection operator, based on the query condition of the selection operator, collaboratively judging with other computing participants whether each tuple in the secret sub-table corresponding to the input data table of the selection operator meets the query condition, and obtaining a secret shard of the judgment result of each tuple; based on the secret shard of the judgment result of each tuple, collaboratively generating a secret shard of a tag field for each tuple with other computing participants; wherein the tag field is used to indicate whether the tuple is valid, the tag field corresponding to the tuple that meets the query condition is a secret shard with a valid tag, and the tag field corresponding to the tuple that does not meet the query condition is a secret shard with an invalid tag.

[0124] In one implementation, based on the rearranged secret sub-table, the operation indicated by the intermediate node is performed in collaboration with other computing participants, including: 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, determining the rearranged secret sub-table corresponding to the input data table of the projection operator and arranged according to the projection field, and collaboratively comparing with other computing participants whether the projection field value of each tuple in the rearranged secret sub-table is the same as the projection field value of its previous tuple, and generating a secret shard of the comparison result for each tuple; based on the secret shard of the comparison result of each tuple, collaboratively generating a secret shard of the tag field for each tuple with other computing participants; wherein the tag field is used to indicate whether the tuple is valid, the tag field corresponding to the tuple with a different field value from the previous tuple is a secret shard marked as valid, and the tag field corresponding to the tuple with the same field value as the previous tuple is a secret shard marked as invalid.

[0125] In one implementation, based on the rearranged secret sub-table, the operation indicated by the intermediate node is performed in collaboration with other computing participants, including: when the operation operator of the intermediate node includes an aggregation operator and the target field includes the aggregation field specified by the aggregation operator, determining the rearranged secret sub-table corresponding to the input data table of the aggregation operator and arranged according to the aggregation field, and collaboratively detecting with other computing participants whether the aggregation field value of each tuple of the rearranged secret sub-table is the same as the aggregation field value of its previous tuple, and generating a secret shard of the detection result of each tuple; based on the respective The secret shard of the tuple detection result collaborates with other computing participants to perform the following operations: perform a grouping operation on the tuples in the rearranged secret sub-table, tuples with the same aggregation field value belong to the same group, and perform an aggregation operation on the tuples in each group, and write the aggregation result into the last tuple in the group. At the same time, a secret shard of the tag field is generated for each tuple in the rearranged secret sub-table; wherein the tag field is used to indicate whether the tuple is valid, the tag field corresponding to the last tuple in each group is a secret shard with a valid tag, and the tag fields corresponding to the remaining tuples are secret shards with invalid tags.

[0126] In one implementation, the method further includes: based on the secret shards of the tag fields of each tuple in the rearranged secret sub-table, collaborating with other computing participants to move the tuples whose tag fields are invalid tags to the end of the rearranged secret sub-table, and retaining the tuples whose tag fields are valid tags at the front of the rearranged secret sub-table; based on the moved rearranged secret sub-table, collaborating with other computing participants to determine the secret shards of the arrangement numbers that correspond one-to-one to the specified tuples in the moved rearranged secret sub-table, wherein the specified tuples at least include tuples whose tag fields are valid tags.

[0127] In one implementation, based on the reordered secret sub-table, the operation indicated by the intermediate node is performed in collaboration with other computing participants, including: when 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 reordered secret sub-table corresponding to a first data table in the two data tables and arranged according to the join field, and determining a second reordered secret sub-table corresponding to a second data table in the two data tables and arranged according to the join field; collaboratively determining with other computing participants whether, for each tuple in the first reordered secret sub-table, there is a tuple with a matching join field value in the second reordered secret sub-table, and generating a secret shard of the matching result for each tuple in the first reordered secret sub-table; and based on the secret shard of the matching result for each tuple in the first reordered secret sub-table, collaboratively generating a secret shard of the tag field for each tuple in the first reordered secret sub-table, wherein the tag field corresponding to the tuple with a yes match result is a secret shard with a valid tag, and the tag field corresponding to the tuple with a no match result is a secret shard with an invalid tag.

[0128] In one implementation, the method further includes: based on the secret shards of the tag fields of the tuples in the first rearranged secret sub-table, collaboratively with other computation participants, moving the tuples whose tag fields are invalid to the end of the first rearranged secret sub-table, and retaining the tuples whose tag fields are valid to the front of the first rearranged secret sub-table; Based on the first rearranged secret sub-table after the move, collaborate with other computing participants to determine secret shards with permutation sequence numbers that correspond one-to-one to specified tuples in the first rearranged secret sub-table after the move, wherein the specified tuples at least include tuples whose tag fields are marked as valid.

[0129] In one implementation, based on the rearranged secret sub-table, the operation indicated by the intermediate node is performed in collaboration with other computing participants, including: when the operation operator of the intermediate node includes a connection operator for two data tables and the target field includes a connection field specified by the connection operator, determining a first rearranged secret sub-table corresponding to the first data table in the two data tables and arranged according to the connection field, and determining a second rearranged secret sub-table corresponding to the second data table in the two data tables and arranged according to the connection field, and collaboratively counting with other computing participants the number of tuples in the first rearranged secret sub-table whose connection field values ​​match in the second rearranged secret sub-table, and counting the number of tuples in the second rearranged secret sub-table whose connection field values ​​match in the first rearranged secret sub-table, to generate a list of the first rearranged secret sub-tables. the matching number of secret shards of the group, and the matching number of secret shards of each tuple in the second rearranged secret sub-table; based on the matching number of secret shards of each tuple in the first rearranged secret sub-table, collaborate with other computing participants to copy the tuples in the first rearranged secret sub-table according to the corresponding matching number, to obtain a first copied secret sub-table; and, based on the matching number of secret shards of each tuple in the second rearranged secret sub-table, collaborate with other computing participants to copy the tuples in the second rearranged secret sub-table according to the corresponding matching number, to obtain a second copied secret sub-table, and align the second copied secret sub-table so that the sorting order of each tuple in the aligned second copied secret sub-table is consistent with the sorting order of each tuple in the first copied secret sub-table; collaborate with other computing participants to splice the first copied secret sub-table and the aligned second copied secret sub-table.

[0130] Exemplarily, in the process of aligning the second copied secret sub-table, the following operations are performed in collaboration with other computing participants: the second copied secret sub-table is first sorted according to the field value of the sorting field; if there are multiple tuples with the same sorting field value, a second sort is further performed according to the copying order of each tuple in the multiple tuples to obtain the aligned second copied secret sub-table.

[0131] Exemplarily, for the first copied secret sub-table, collaborate with other computing participants to determine the secret shard of the arrangement number corresponding to the sorting field for each tuple in the first copied secret sub-table; and, for the aligned second copied secret sub-table, collaborate with other computing participants to determine the secret shard of the arrangement number corresponding to the sorting field for each tuple in the aligned second copied secret sub-table.

[0132] Exemplarily, in the case where the target field involved in the first data table also includes a non-connected field, a third rearranged secret sub-table corresponding to the first data table and arranged according to the non-connected field is determined, and based on the third rearranged secret sub-table, an update operation is performed in collaboration with other computing participants to update the secret shards of the arrangement sequence corresponding to the non-connected field in the first copied secret sub-table; wherein the update operation includes: counting the number of times each tuple in the third rearranged secret sub-table is copied in the first copied secret sub-table, and the number of copies of the tuple 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 number of copies of the non-connected field The initial sorting sequence number of each tuple is zero, the initial sorting sequence number of the first tuple with a non-zero number of replications is one, and the initial sorting sequence numbers of other tuples are obtained by prefix accumulation of the number of replications and then adding one; each tuple is replicated based on the number of replications of each tuple in the third rearranged secret sub-table to form a third replicated secret sub-table; in the third replicated secret sub-table, each tuple is traversed in turn, and the non-connected field value of the current tuple is compared with the non-connected field value of the previous tuple; if the non-connected field values ​​of the two tuples are the same, the sorting sequence number of the current tuple is set to the sorting sequence number of the previous tuple plus one; if they are different, the sorting sequence number of the current tuple remains unchanged.

[0133] Exemplarily, in the case where the target field involved in the second data table also includes a non-connected field, a fourth rearranged secret sub-table corresponding to the second data table and arranged according to the non-connected field is determined, and based on the fourth rearranged secret sub-table, an update operation is performed in collaboration with other computing participants to update the secret shards of the arrangement sequence corresponding to the non-connected field in the second copied secret sub-table; wherein the update operation includes: counting the number of copies of each tuple in the fourth rearranged secret sub-table in the second copied secret sub-table, the number of copies of the tuple not involved in the connection is zero; calculating the number of copies based on the number of copies of each tuple in the fourth rearranged secret sub-table The initial sorting sequence number of each non-zero tuple is obtained by prefix-adding the number of copies of the first tuple to the secret shard, and the initial sorting sequence number of the other tuples is obtained by prefix-adding the number of copies and then adding one; each tuple is copied based on the number of copies of each tuple in the fourth rearranged secret sub-table to form a fourth copied secret sub-table; in the fourth copied secret sub-table, each tuple is traversed in turn, and the non-connected field value of the current tuple is compared with the non-connected field value of the previous tuple; if the non-connected field values ​​of the two tuples are the same, the sorting sequence number of the current tuple is set to the sorting sequence number of the previous tuple plus one; if they are different, the sorting sequence number of the current tuple remains unchanged.

[0134] In some embodiments, the embodiments of this specification also provide a multi-party secure computing method, which is applied to the above-mentioned data query party, and the method includes: sending a query statement to the computing participants; and receiving secret shards of the query results returned by N computing participants respectively, recovering the initial query result from the N secret shards of the query results, and removing the virtual tuples carrying invalid tags in the initial query result to obtain the target query result.

[0135] In some embodiments, an embodiment of this specification further provides an electronic device, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor implements any of the above methods by running the executable instructions.

[0136] Figure 9 This is a schematic structural diagram of a device provided by an exemplary embodiment. 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. Of course, it may also include hardware required for other functions. One or more embodiments of this specification can be implemented based on software, such as the processor 902 reading the corresponding computer program from the non-volatile memory 910 into the memory 908 and then running it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, 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 logic devices.

[0137] Based on the same concept as the above method, this specification also provides a computer-readable storage medium on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in any of the above embodiments are implemented.

[0138] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can be implemented using any method or technology to store information. 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 cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.

[0139] Based on the same concept as the above method, this specification also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any of the above embodiments when executed by a processor.

[0140] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of this specification shall be included in the scope of protection of one or more embodiments of this specification.

Claims

1. A multi-party secure computing system, including a data holder, a data query party, and N computing participants, where N>1; The data holder is configured to split the data table it holds 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; The computing participant is configured to receive and store the secret sub-table; The data query party is used to send a query statement to the computing participant; The computing participant is further configured to determine a query tree of the query statement, wherein 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 configured with the number of secure output tuples; The computing participant is further configured to, based on the secret sub-table corresponding to the leaf node of the query tree, collaborate with other computing participants to execute each intermediate node layer by layer from the leaf node upwards in the execution order of the query tree; if the number of tuples actually output by an intermediate node is less than the number of secure output tuples of the intermediate node, add a dummy tuple to the actual output of the intermediate node to meet the number of secure output tuples, the dummy tuple carrying a secret shard marked as invalid; after the query tree is executed, generate a secret shard of the query result and return it to the data querying party; The data query party is also used to receive the secret shards of the query results returned by the N computing participants respectively, restore the initial query result from the N secret shards of the query results, and remove the virtual tuples carrying invalid marks in the initial query result to obtain the target query result.

2. The system according to claim 1, wherein the data holder is further configured to send metadata of the data table to the N computing participants; The computing participant is further configured to receive and store metadata of the data table; The computing participant is further configured to collaboratively estimate the number of final output tuples of the query statement with other computing participants based on the secret shared data of the data table specified by the query statement, or to obtain the number of final output tuples pre-set for the query statement; estimating the number of intermediate output tuples of each intermediate node in the query tree based on metadata of the data table specified by the query statement; For each intermediate node, the minimum value between the final output tuple number and the intermediate output tuple number of the intermediate node is set as the safe output tuple number of the intermediate node.

3. The system according to claim 2, wherein if the intermediate node has one input data table, 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 multiplying the numbers of tuples in the input data tables.

4. The system according to claim 2, wherein the computing participant is specifically configured to parse the query statement to generate multiple candidate query trees, wherein the execution order of the operation operators specified in 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, counting the number of fields involved in the intermediate nodes in the candidate query tree; Based on the number of fields involved in the intermediate nodes in each candidate query tree, the query tree involving the least number of fields is screened out from the multiple candidate query trees.

5. 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, a semi-join operation is performed in collaboration 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 tuples in the secret sub-tables participate in the query result, and obtain secret shards of the check results for each tuple; Based on the secret slices of the inspection results of each tuple, collaboratively with other computing participants, generate secret slices of the tag fields for each tuple; wherein, The tag field corresponding to the tuple participating in the query result is the secret shard with a valid tag, and the tag field corresponding to the tuple not participating in the query result is the secret shard with an invalid tag.

6. The system according to claim 1, wherein the data holder is further configured to send metadata of the data table to the N computing participants; The computing participant is further configured to receive and store metadata of the data table; The computing participant is further configured to determine, based on the metadata of the data table, a target field to be sorted in the secret sub-table, and extract a secret sharing column of the target field to be sorted from the secret sub-table; based on the secret sharing column of the target field, collaborate with other computing participants to execute a preset secure sorting algorithm to obtain a sorted secret sharing column; based on the sorted secret sharing column, collaborate with other computing participants to determine secret shards with arrangement numbers corresponding one-to-one to each secret sharing value in the sorted secret sharing column; The computing participant is further configured to, in the process of collaboratively executing each intermediate node in the query tree with other computing participants, rearrange the secret sub-table corresponding to the input data table according to the secret shards of the arrangement sequence corresponding to the target field, thereby obtaining a rearranged secret sub-table, and collaboratively execute the operation indicated by the intermediate node with other computing participants based on the rearranged secret sub-table, if the input data table of the intermediate node involves the target field.

7. The system according to claim 6, wherein the computing participant is specifically configured to, when serving as the primary computing participant, generate a unique permutation sequence number corresponding one-to-one to each secret sharing value in the sorted secret sharing column after obtaining the sorted secret sharing column; split each of the permutation sequence numbers into N secret shards based on a preset secret sharing algorithm, retain one of the secret shards, and send the other N-1 secret shards to the other N-1 computing participants respectively.

8. The system according to claim 6, wherein the computing participant is further configured to: If the operation operator of the intermediate node includes a selection operator, based on the query condition of the selection operator, the intermediate node collaboratively determines with other computation participants whether each tuple in the secret sub-table corresponding to the input data table of the selection operator meets the query condition, and obtains a secret shard of the determination result for each tuple; Based on the secret slices of the judgment results of the respective tuples, a secret slice of the tag field is generated for the respective tuples in collaboration with other computing participants; wherein, The tag field is used to indicate whether the tuple is valid. The tag field corresponding to the tuple that meets the query conditions is a secret fragment with a valid tag, and the tag field corresponding to the tuple that does not meet the query conditions is a secret fragment with an invalid tag.

9. The system according to claim 6, wherein the computing participant is specifically configured to: In a 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, determining a rearranged secret sub-table corresponding to the input data table of the projection operator and arranged according to the projection field, collaboratively comparing, with other computation participants, whether the projection field value of each tuple in the rearranged secret sub-table is the same as the projection field value of the previous tuple, and generating a secret shard of the comparison result for each tuple; Based on the secret slices of the comparison results of the respective tuples, a secret slice of the tag field is generated for the respective tuples in collaboration with other computing participants; wherein, The tag field is used to indicate whether the tuple is valid. The tag field corresponding to the tuple with a different field value from the previous tuple is a secret fragment with a valid tag, and the tag field corresponding to the tuple with the same field value as the previous tuple is a secret fragment with an invalid tag.

10. The system according to claim 6, wherein the computing participant is specifically configured to: 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, determining a rearranged secret sub-table corresponding to the input data table of the aggregation operator and arranged according to the aggregation field, collaboratively detecting with other computation participants whether the aggregation field value of each tuple in the rearranged secret sub-table is the same as the aggregation field value of the previous tuple, and generating a secret shard of the detection result for each tuple; Based on the secret shards of the detection results of each tuple, collaborate with other computing participants to perform the following operations: perform a grouping operation on the tuples in the rearranged secret sub-table, tuples with the same aggregation field value belong to the same group, perform an aggregation operation on the tuples in each group, write the aggregation result into the last tuple in the group, and generate a secret shard of the tag field for each tuple in the rearranged secret sub-table; wherein, The tag field is used to indicate whether the 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 shards of the tag fields of the tuples in the rearranged secret sub-table, in collaboration with other computation participants, move the tuples whose tag fields are invalid to the end of the rearranged secret sub-table, and retain the tuples whose tag fields are valid to the front of the rearranged secret sub-table; Based on the moved rearranged secret sub-table, collaborate with other computing participants to determine secret shards with permutation sequence numbers that correspond one-to-one to designated tuples in the moved rearranged secret sub-table, where the designated tuples at least include tuples whose tag fields are marked as valid.

12. The system according to claim 6, wherein the computing participant is specifically configured to: 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 sub-table corresponding to a first data table in the two data tables and arranged according to the join field, and determining a second rearranged secret sub-table corresponding to a second data table in the two data tables and arranged according to the join field, collaboratively determining with other computation participants whether, for each tuple in the first rearranged secret sub-table, there is a tuple in the second rearranged secret sub-table with a matching join field value, and generating a secret shard of the matching result for each tuple in the first rearranged secret sub-table; Based on the secret shards of the matching results of each tuple in the first rearranged secret sub-table, collaboratively with other computing participants, generate secret shards of the tag fields for each tuple in the first rearranged secret sub-table, wherein: The tag field corresponding to the tuple with a matching result of yes is the secret fragment with a valid tag, and the tag field corresponding to the tuple with a matching result of no is the secret fragment with an invalid tag.

13. The system according to claim 12, wherein the computing participant is further configured to: Based on the secret shards of the tag fields of the tuples in the first rearranged secret sub-table, in collaboration with other computation participants, move the tuples whose tag fields are invalid to the end of the first rearranged secret sub-table, and retain the tuples whose tag fields are valid to the front of the first rearranged secret sub-table; Based on the first rearranged secret sub-table after the move, collaborate with other computing participants to determine secret shards with permutation sequence numbers that correspond one-to-one to specified tuples in the first rearranged secret sub-table after the move, wherein the specified tuples at least include tuples whose tag fields are marked as valid.

14. The system according to claim 6, wherein the computing participant is specifically configured to: In a case where 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 sub-table corresponding to a first data table in the two data tables and arranged according to the join field, and determining a second rearranged secret sub-table corresponding to a second data table in the two data tables and arranged according to the join field, collaboratively counting the number of tuples in the second rearranged secret sub-table whose join field values ​​match for each tuple in the first rearranged secret sub-table, and counting the number of tuples in the second rearranged secret sub-table whose join field values ​​match for each tuple in the first rearranged secret sub-table, and generating secret shards corresponding to the number of matches for each tuple in the first rearranged secret sub-table and the number of matches for each tuple in the second rearranged secret sub-table; Based on the secret shards of the matching number of each tuple in the first rearranged secret sub-table, in collaboration with other computing participants, copy the tuples in the first rearranged secret sub-table by the corresponding matching number to obtain a first copied secret sub-table; and Based on the matching number of secret shards for each tuple in the second rearranged secret sub-table, collaborate with other computation participants to copy the tuples in the second rearranged secret sub-table by the corresponding matching number to obtain a second copied secret sub-table, and align the second copied secret sub-table so that the sorting order of the tuples in the aligned second copied secret sub-table is consistent with the sorting order of the tuples in the first copied secret sub-table; Collaboratively with other computing participants, the first copied secret sub-table and the aligned second copied secret sub-table are spliced.

15. The system according to claim 14, wherein the computing participant is specifically configured to: During the alignment process of the second copied secret sub-table, the following operations are performed in collaboration with other computing participants: the second copied secret sub-table is first sorted according to the field value of the sorting field; if there are multiple tuples with the same sorting field value, a second sort is further performed according to the copying order of each tuple in the multiple tuples to obtain the aligned second copied secret sub-table.

16. The system according to claim 14, wherein the computing participant is further configured to: For the first replicated secret sub-table, determine, in collaboration with other computing participants, a secret shard of the permutation sequence number corresponding to the sort field for each tuple in the first replicated secret sub-table; and For the aligned second copied secret sub-table, collaborate with other computing participants to determine the secret shards of the arrangement sequence numbers corresponding to the sorting fields of each tuple in the aligned second copied secret sub-table.

17. The system according to claim 14, wherein the computing participant is further configured to: If the target fields involved in the first data table also include non-connected fields, determining a third rearranged secret sub-table corresponding to the first data table and arranged according to the non-connected fields; and collaboratively performing an update operation with other computation participants based on the third rearranged secret sub-table to update the secret shards corresponding to the arrangement sequence numbers of the non-connected fields in the first replicated secret sub-table; in, The update operation includes: counting the number of times each tuple in the third rearranged secret sub-table is copied in the first copied secret sub-table, and the number of copies of the tuple 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 number of each tuple with a non-zero number of copies, the initial sorting number of the first tuple with a non-zero number of copies is a secret shard of one, and the initial sorting numbers of other tuples are obtained by performing prefix accumulation on the number of copies and then adding one; based on the number of copies of each tuple in the third rearranged secret sub-table, copying each tuple to form a third copied secret sub-table; in the third copied secret sub-table, traversing each tuple in turn, and comparing the non-connected field value of the current tuple with the non-connected field value of its previous tuple; if the non-connected field values ​​of the two tuples are the same, setting the sorting number of the current tuple to the sorting number of the previous tuple plus one; if they are not the same, the sorting number of the current tuple remains unchanged.

18. The system according to 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, determining a fourth rearranged secret sub-table corresponding to the second data table and arranged according to the non-connected fields; and collaboratively performing an update operation with other computation participants based on the fourth rearranged secret sub-table to update the secret shards corresponding to the arrangement sequence numbers of the non-connected fields in the second replicated secret sub-table; in, The update operation includes: counting the number of times each tuple in the fourth rearranged secret sub-table is copied in the second copied secret sub-table, and the number of copies of the tuple not involved in the connection is zero; based on the number of copies of each tuple in the fourth rearranged secret sub-table, calculating the initial sorting number of each tuple with a non-zero number of copies, the initial sorting number of the first tuple with a non-zero number of copies is a secret shard of one, and the initial sorting numbers of other tuples are obtained by performing prefix accumulation on the number of copies and then adding one; based on the number of copies of each tuple in the fourth rearranged secret sub-table, copying each tuple to form a fourth copied secret sub-table; in the fourth copied secret sub-table, traversing each tuple in turn, and comparing the non-connected field value of the current tuple with the non-connected field value of its previous tuple; if the non-connected field values ​​of the two tuples are the same, the sorting number of the current tuple is set to the sorting number of the previous tuple plus one; if they are not the same, the sorting number of the current tuple remains unchanged.

19. A multi-party secure computation method, applied to the computation participants according to any one of claims 1 to 18, the method comprising: Receive and store secret sub-tables sent by any data holder, and receive query statements sent by any data query party; Determine a query tree of the query statement, wherein leaf nodes of the query tree represent data tables specified by the query statement, intermediate nodes of the query tree represent operation operators specified by the query statement, and the intermediate nodes are set with a number of safe output tuples; Based on the secret table corresponding to the leaf node of the query tree, in collaboration with other computing participants, execute each intermediate node layer by layer from the leaf node upwards in the execution order of the query tree. If the number of tuples actually output by an intermediate node is less than the number of secure output tuples of the intermediate node, add a dummy tuple to the actual output of the intermediate node to meet the number of secure output tuples. The dummy tuple carries a secret shard marked as invalid. After the query tree is executed, a secret slice of the query result is generated and returned to the data query party.

20. A multi-party secure computation method, applied to the data querying party according to any one of claims 1 to 18, the method comprising: Send query statements to computing participants; as well as, Receive secret slices of query results respectively returned by N computing participants, recover an initial query result from the N secret slices of the query results, and remove virtual tuples carrying invalid tags in the initial query result to obtain a target query result.

21. An electronic device comprising: processor; A memory for storing processor-executable instructions; wherein the processor implements the steps of the method according to claim 19 or 20 by executing the executable instructions.

22. A computer-readable storage medium having computer instructions stored thereon, which implement the steps of the method according to claim 19 or 20 when executed by a processor.

23. A computer program product comprising a computer program / instructions for implementing the steps of the method according to claim 19 or 20 when the computer program / instructions are executed by a processor.

Citation Information

Patent Citations

  • Data query method and device, computer readable storage medium and electronic equipment

    CN113486117A

  • Cross-node Join query method for database middleware based on query tree

    CN114911824A

  • Task processing method and device, electronic equipment and storage medium

    CN116305101A

  • Data processing method and device and computer cluster system

    CN117608784A

  • Method and System for Fault Tolerant and Secure Multiparty Computation with SPDZ

    US20190372760A1