Structured query language-based multi-user data association method, device and equipment
By using the dataset association security operator of the multi-party secure computation protocol in structured query statements, and generating respective dataset association ciphertext execution plans, the privacy leakage problem caused by cross-user transmission of plaintext data is solved, and data security protection for cross-user joint data analysis is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ALIBABA (CHINA) CO LTD
- Filing Date
- 2026-01-19
- Publication Date
- 2026-06-09
AI Technical Summary
Transmitting plaintext user data across users can lead to the leakage of user privacy data and affect data security.
It employs a dataset association security operator in structured query statements to associate datasets from multiple users through privacy-preserving computation, generating separate dataset association ciphertext execution plans for each user, and using a multi-party secure computation protocol to protect user privacy.
Effectively safeguard the security of multi-party data in cross-user collaborative data analysis and prevent the leakage of user privacy data.
Smart Images

Figure CN122174260A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of database management technology, specifically to a method, apparatus, and system for multi-user data association based on structured query statements, as well as electronic devices. Background Technology
[0002] With the increasing penetration of data analysis based on Structured Query Language (SQL) statements across various fields, cross-user federated data analysis is gradually becoming an important direction in industry practice. For example, the SQL statements used in cross-user federated data analysis involve joining columns or merging rows from datasets of multiple users.
[0003] Currently, a typical way to execute structured query language (SQL) statements for cross-user collaborative data analysis is to transmit user data in plaintext between multiple users, i.e., a multi-user collaborative data analysis scheme based on cross-user transmission of plaintext user data.
[0004] However, the applicant of this application has discovered that this approach has at least the following problems: transmitting plaintext user data across users can lead to the leakage of user privacy data and affect user data security. Therefore, how to achieve cross-user collaborative data analysis while ensuring the privacy and data security of multiple users is an urgent problem that needs to be researched and tackled. Summary of the Invention
[0005] This application provides a method for multi-user data association based on structured query statements to address the problem of leaking user privacy data in existing technologies. This application also provides a device and system for multi-user data association based on structured query statements, as well as an electronic device.
[0006] This application provides a method for multi-user data association based on structured query statements, including: Retrieve the Structured Query Language (SQL) statement; Retrieve the first dataset join clause in the SQL statement that associates datasets of multiple users; Obtain the dataset association security operator that conforms to the multi-party secure computation protocol and corresponds to the dataset association operator; Based on the dataset association security operator, generate the dataset association ciphertext execution plan for each of the multiple users; The user's privacy computing engine executes the user's dataset association ciphertext execution plan; multiple dataset association security operators in the multiple dataset association ciphertext execution plans associate the datasets of multiple users in a privacy computing manner.
[0007] Optionally, the first dataset association clause includes a join clause, and the dataset association operator includes a join operator; The dataset association security operator includes a Join security operator that follows a privacy set intersection protocol; The step of generating the dataset association ciphertext execution plan for each of the multiple users based on the dataset association security operator includes: Based on the Join security operator, generate the encrypted execution plan of the Join clause for each of the multiple users.
[0008] Optionally, the Join operator adopts the equi-join method of hash Join, and the Join security operator includes a builder Join security operator and a probe Join security operator; The step of generating ciphertext execution plans for the respective Join clauses of the multiple users based on the Join security operator includes: Based on the builder's Join security operator, generate the ciphertext execution plan of the builder's Join clause; Based on the probe's Join security operator, generate the probe's Join clause ciphertext execution plan; The multiple dataset association security operator in the encrypted execution plan associates multiple datasets, and associates the datasets of multiple users in a privacy-preserving computation manner, including: The builder's Join security operator performs the following processing: it performs a first encryption on the build table join key to obtain a first ciphertext, and sends the first ciphertext; it receives a second ciphertext obtained by the probe performing a second encryption on the first ciphertext, and builds a probe matching hash table based on the second ciphertext; it receives a third ciphertext obtained by the probe performing a second encryption on the probe table join key, and performs probe matching based on the third ciphertext and the hash table. The probe join security operator performs the following processing: receiving the first ciphertext, performing a second encryption on the first ciphertext to obtain the second ciphertext, and sending the second ciphertext; performing a second encryption on the probe table connection key to obtain the third ciphertext, and sending the third ciphertext.
[0009] Optionally, the association result set is stored on the probe side; The step of generating ciphertext execution plans for the respective Join clauses of the multiple users based on the Join security operator includes: Based on the builder's Join security operator and data transmission operator, generate the builder's Join clause ciphertext execution plan; Based on the probe's Join security operator, data receiving operator, and associated result set storage operator, a probe's Join clause encrypted execution plan is generated.
[0010] Optionally, the associated result set is stored in the builder; The step of generating ciphertext execution plans for the respective Join clauses of the multiple users based on the Join security operator includes: Based on the builder's Join security operator, data receiving operator, and associated result set storage operator, generate the builder's Join clause encrypted execution plan; Based on the probe's Join security operator and data transmission operator, generate the probe's Join clause ciphertext execution plan.
[0011] Optionally, the SQL statement may also include expressions that perform relational operations on the data of the multiple users; The method further includes: Generate a plaintext execution plan for the expression; and obtain the relational operation security operator corresponding to the relational operation operator; Based on the plaintext execution plan of the expression, generate the ciphertext execution plan of the expression for each of the multiple users, including: replacing the relational operation operator that performs relational operations on the data of multiple users in the plaintext execution plan of the expression with the relational operation security operator, setting the data of other users participating in the relational operation in the plaintext execution plan as placeholder data, and using the rewritten plan of the plaintext execution plan of the expression as the ciphertext execution plan of the user's expression; The user's privacy computing engine executes the user's encrypted expression execution plan; multiple relational operation security operators in the multiple encrypted expression execution plans perform relational operations on the data of multiple users in a privacy computing manner.
[0012] Optionally, the execution of the user's encrypted expression execution plan includes: The user's encrypted expression execution plan is executed by iterating through the expression operators.
[0013] Optionally, the first dataset association clause includes a Join clause, and the expression includes the expression in the join condition of the Join clause.
[0014] Optionally, the Join operator adopts the equi-join method of hash Join; The ciphertext execution plan of the expression from the builder user includes: Based on the probe matching hash table, obtain the data of the participation relationship calculations included in the intersection records of the builders; The relational operation security operator of the builder user is used to perform relational operations based on the data involved in the relational operation.
[0015] Optionally, the SQL statement may also include expressions that perform arithmetic operations on the data of the multiple users; The method further includes: Generate a plaintext execution plan for the expression; If the data of the multiple users participating in the arithmetic operation is private data, then obtain the arithmetic operation security operator corresponding to the arithmetic operation operator; for each user in the expression, replace the arithmetic operation operator that performs arithmetic operations on the data of multiple users in the plaintext execution plan of the expression with the arithmetic operation security operator to generate the expression ciphertext execution plan of the user; The user's privacy computing engine executes the user's encrypted expression execution plan; multiple arithmetic operation security operators in the multiple encrypted expression execution plans perform arithmetic operations on the privacy data of multiple users in a privacy computing manner.
[0016] Optionally, the first dataset association clause includes a Join clause, and the expression includes an expression for the field data in the Select clause; The step of executing the user's encrypted expression execution plan through the user's privacy computing engine includes: The user's encrypted expression execution plan is executed during the dataset join process using the user's privacy computing engine.
[0017] Optionally, if the data of the multiple users participating in the arithmetic operation is non-privacy data, then the plaintext execution plan of the expression is executed after the dataset join.
[0018] Optionally, the dataset association clause includes a Union clause, the dataset association operator includes a Union operator, and the SQL statement also includes a sort clause for sorting the data set based on privacy data; The secure association operators for the dataset include: a receiver Union operator, a sender Union operator, and a ciphertext sorting operator that follow a privacy set union protocol; The step of generating the dataset association ciphertext execution plan for each of the multiple users based on the dataset association security operator includes: Based on the receiving Union operator and the ciphertext sorting operator, generate the Union clause ciphertext execution plan for the Union result set storage; Based on the sending Union operator, generate the Union clause ciphertext execution plan for the non-Union result set storage location; The multiple dataset association security operator in the encrypted execution plan associates multiple datasets, and associates the datasets of multiple users in a privacy-preserving computation manner, including: The receiving Union operator performs the following processing: it performs a first encryption on the receiving party's private data to obtain a first ciphertext, and sends the first ciphertext; it receives a second ciphertext obtained by the sending party performing a second encryption on the first ciphertext, and receives a third ciphertext obtained by the sending party performing a second encryption on the sending party's private data. The data transmission Union operator performs the following processing: receiving the first ciphertext, performing a second encryption on the first ciphertext to obtain the second ciphertext, and sending the second ciphertext; performing a second encryption on the sender's private data to obtain the third ciphertext, and sending the third ciphertext; The ciphertext sorting operator performs the following processing: performing a first decryption symmetric to the first encryption on the second ciphertext to obtain a fourth ciphertext obtained by performing a second encryption on the recipient's private data; and sorting the data set of the recipient and the sender according to the fourth ciphertext and the second ciphertext.
[0019] Optional, also includes: Retrieve the second dataset join clause in the SQL statement that associates datasets for a single user; Based on the dataset association operator, generate a plaintext execution plan for the dataset association of the individual user; Execute the plaintext execution plan associated with the dataset of the individual user.
[0020] Optionally, if the multiple users include three or more users, then two users are selected from the three or more users; for the selected two users, according to the dataset association security operator, a dataset association ciphertext execution plan is generated for each of the two selected users; dataset association processing is performed on the dataset association results of the two selected users and the datasets of the other users among the three or more users, until the dataset association results of the three or more users are obtained.
[0021] This application provides a method for multi-user data association based on structured query statements, including: Retrieve the Structured Query Language (SQL) statement; Retrieve the first dataset join clause in the SQL statement that associates datasets of multiple users; Obtain the dataset association security operator that conforms to the multi-party secure computation protocol and corresponds to the dataset association operator; Based on the dataset association security operator, generate a dataset association ciphertext execution plan for the user. The privacy computing engine of the user executes the encrypted execution plan of the user's dataset association; the dataset association security operator in the encrypted execution plan of the user's dataset association and the dataset association security operator in the encrypted execution plan of other users' dataset association associate the datasets of multiple users in a privacy computing manner.
[0022] This application provides a multi-user federated data processing device based on structured query statements, including: The SQL statement retrieval unit is used to retrieve Structured Query Language (SQL) statements. The first dataset association clause acquisition unit is used to acquire the first dataset association clause in the SQL statement that associates datasets of multiple users; The secure operator acquisition unit is used to acquire the dataset association secure operator that follows the multi-party secure computation protocol and corresponds to the dataset association operator; The ciphertext plan generation unit is used to generate ciphertext execution plans associated with the datasets of the multiple users based on the dataset association security operators. The encrypted plan execution unit is used to execute the user's dataset-associated encrypted execution plan through the user's privacy computing engine; the multiple dataset association security operators in the multiple dataset association encrypted execution plans associate the datasets of multiple users in a privacy computing manner.
[0023] This application provides a multi-user federated data processing device based on structured query statements, including: The SQL statement retrieval unit is used to retrieve Structured Query Language (SQL) statements. The first dataset association clause acquisition unit is used to acquire the first dataset association clause in the SQL statement that associates datasets of multiple users; The secure operator acquisition unit is used to acquire the dataset association secure operator that follows the multi-party secure computation protocol and corresponds to the dataset association operator; The ciphertext plan generation unit is used to generate a dataset-associated ciphertext execution plan for the user based on the dataset associating security operators. The encrypted plan execution unit is used to execute the encrypted execution plan of the user's dataset association through the user's privacy computing engine; the dataset association security operator in the encrypted execution plan of the user's dataset association and the dataset association security operator in the encrypted execution plan of other users' dataset association associate the datasets of multiple users in a privacy computing manner.
[0024] This application provides a multi-user data association system based on structured query statements, including: A first multi-user data association device is used to: acquire a Structured Query Language (SQL) statement; acquire a first dataset association clause in the SQL statement that associates datasets of multiple users; acquire a dataset association security operator that follows a multi-party secure computation protocol corresponding to the dataset association operator; generate a first dataset association encrypted execution plan for the first user based on the dataset association security operator; and execute the first dataset association encrypted execution plan through the privacy computation engine of the first user. The second multi-user data association device is used to obtain the SQL statement; obtain the first dataset association clause; obtain the dataset association security operator; generate a second user's dataset association encrypted execution plan based on the dataset association security operator; execute the second user's second dataset association encrypted execution plan through the second user's privacy computing engine; the dataset association security operator in the first dataset association encrypted execution plan and the dataset association security operator in the second dataset association encrypted execution plan associate the datasets of the first user and the second user in a privacy computing manner.
[0025] This application provides an electronic device, including: Processor; and A memory for storing a program for implementing the method described in any of the preceding methods, wherein the device is powered on and the program of the method is executed by the processor.
[0026] This application also provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the various methods described above.
[0027] This application also provides a computer program product including instructions that, when run on a computer, cause the computer to perform the various methods described above.
[0028] Compared with the prior art, this application has the following advantages: The multi-user data association method based on structured query statements provided in this application involves: obtaining a structured query language (SQL) statement; obtaining a first dataset association clause in the SQL statement that associates datasets from multiple users; obtaining a dataset association security operator that follows a multi-party secure computation protocol corresponding to the dataset association operator; generating a dataset association encrypted execution plan for each of the multiple users based on the dataset association security operator; and executing the user's dataset association encrypted execution plan through the user's privacy computation engine, thereby associating the datasets of multiple users in a privacy-preserving computation manner through multiple dataset association security operators in the multiple dataset association encrypted execution plans. This approach rewrites the plaintext execution plan of multi-user data join clauses in SQL statements into ciphertext execution plans for each user. It also redesigns dataset join operators (such as Join and Union) and transforms them into secure dataset join operators based on the Multi-Party Computation (MPC) protocol. For example, the multi-user Join operator uses a privacy set intersection protocol, the multi-user Union operator uses a privacy set union protocol, and expression operations use a secret sharing protocol. Multiple ciphertext execution plans perform cross-user joint data analysis using privacy computation methods, thus avoiding the leakage of user privacy data when executing SQL statements for cross-user joint data analysis. Therefore, it effectively ensures the security of multi-party data during the execution of SQL statements for cross-user joint data analysis. Attached Figure Description
[0029] Figure 1 This is a flowchart illustrating an embodiment of the multi-user data association method based on structured query statements provided in this application; Figure 2 This is a computational logic diagram of an embodiment of the multi-user data association method based on structured query statements provided in this application; Figure 3 This is a computational logic diagram of an embodiment of the multi-user data association method based on structured query statements provided in this application; Figure 4 This is a schematic diagram illustrating a scenario of an embodiment of the multi-user data association method based on structured query statements provided in this application; Figure 5 This is a schematic diagram of an embodiment of the multi-user data association method based on structured query statements provided in this application; Figure 6 This is a plaintext plan diagram of an embodiment of the multi-user data association method based on structured query statements provided in this application; Figure 7 This is a ciphertext plan diagram of an embodiment of the multi-user data association method based on structured query statements provided in this application. Detailed Implementation
[0030] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.
[0031] This application provides a method, apparatus, and system for multi-user data association based on structured query statements, as well as an electronic device. The various solutions are described in detail below in each embodiment.
[0032] First Embodiment Please refer to Figure 1 This is a flowchart illustrating the multi-user data association method based on structured query statements according to this application. In this embodiment, the method may include the following steps: Step S101: Obtain the Structured Query Language (SQL) statement.
[0033] Structured Query Language (SQL) is a standardized programming language used to manage relational databases and perform data query, insert, update, and delete operations. Database operation statements written in SQL are called SQL statements.
[0034] Step S103: Obtain the first dataset association clause in the SQL statement that associates datasets of multiple users.
[0035] SQL statements include one or more dataset join clauses, which can be Join, Union, etc. The first dataset join clause refers to a dataset join clause that joins datasets of multiple users, while the second dataset join clause refers to a dataset join clause that joins datasets of a single user.
[0036] The JOIN clause horizontally joins columns from multiple datasets based on the join field (also known as the join key), preserving the relationships between the datasets. It's used to integrate related field information from different datasets, such as joining an order table (order dataset) and a user table (user dataset) to retrieve details of users who have placed orders. For example, an SQL statement might include the following JOIN clause: SELECT table1.column1, table2.column2 FROM Table 1 JOIN Table 2 ON table1.related field = table2.related field WHERE filter criteria The Join clause first performs a column join on Table 1 and Table 2 based on the related fields; then it selects records that meet the filtering criteria from the column join results; finally, it retrieves column 1 of Table 1 and column 2 of Table 2 from these records.
[0037] In practical applications, multiple datasets joined using the Join clause can come from multiple participants. For example, the SQL statement is as follows: INSERT OVERWRITE res Select p1.e_dims,sum(p1.e_val1 + p2.p_val1 + p3.q_val1) as int_sum,sum(p1.e_val1 + p2.p_val1 + p3.q_val3) as double_sum1,sum(p1.e_val3 + p2.p_val3 + p3.q_val3) as sum2 from ( select aid, e_dims, e_val1, e_val3 from p1_event_data_3pc p1 inner join( select aid, p_dims, p_val1, p_val3 from p2_event_data_3pc_partner p2 on p1.aid = p2.aid and p1.e_dims = p2.p_dims inner join( select aid, q_dims, q_val1, q_val3 from p3_event_data_3pc_charlie p3 on p2.aid = p3.aid and p2.p_dims = p3.q_dims group by p1.e_dims; Figure 2 The calculation logic for this SQL statement can include the following steps: S1. Triple Join: Joins the columns of three data tables of three participants (data table p1 of participant A, data table p2 of participant B, and data table p3 of participant C). The join condition (ON clause) of the Join clause includes an equi-join operation between the two participating tables (e.g., p1.aid = p2.aid). Additionally, the join condition can also be an expression, which includes logical operations (e.g., AND) and comparison operations (e.g., p1.e_dims = p2.p_dims), and can perform simple filtering on the joined records.
[0038] S2. Triple Arithmetic Call: Summes the data of the three participants in the column concatenation result using the window function sum() (e.g., sum(p1.e_val1 + p2.p_val1 + p3.q_val1), sum(p1.e_val1 + p2.p_val1 + p3.q_val3), sum(p1.e_val3 + p2.p_val3 + p3.q_val3)). S3. Sink: The processing result of the SQL statement is written to disk and stored on the side of participant A.
[0039] During the execution of this SQL statement, apart from the data ultimately stored on participant A's disk, all other data (including data from the three participants, such as p1.aid, p1.e_dims, p1.e_val1, p1.e_val3, p2.aid, p2.e_dims, p2.e_val1, p2.e_val3, p3.aid, p3.e_dims, p3.e_val1, p3.e_val3) are the private data of each participant and can only be seen by the participant themselves, not by other participants.
[0040] The UNION clause merges multiple datasets (which can be the results of a SELECT statement query) by column, requiring that the number of columns and data types of the columns in each dataset be consistent. For example, it can be used to merge sales data from different regions. The SQL statement including the UNION clause is as follows: SELECT column1, column2 FROM table1 UNION SELECT column1, column2 FROM table2 In practical applications, multiple datasets merged using the Union clause can come from multiple participants. For example, the SQL statement is as follows: insert overwrite p1_psu_res_final select e_dims,sum(c_cnt) as pv,count(aid) as uv,count(distinct aid)as conv_uv, sum(if(c_type = 'cart',c_cnt,0)) as cart_pv / / Select data from the fourth Join result from ( / / The left table for forming the fourth Join: the event data table of participant A. select c_id,e_id,e_dims,row_number()over(partition by c_id order bye_ts asc) `as idx` / / Selects data from the results of two Unions, including the sort clause and window function. from( / / the beginning of two Unions) SELECT c_id, e_id, e_dims, e_ts FROM ( / / Left table of the first Union, data comes from the first Union) select conv.c_id,event.e_id,event.e_dims,event.e_ts,row_number() over (partition by c_id order by e_ts asc) as idx / / Select data from the results of the first join from ( / / the start of the first Join (p1 join c1) select p1.e_id,p1.aid,p1.e_dims,p1.e_ts,(p1.e_ts + 8) as e_end_tsfrom p1_event as p1 event / / The left table of the first Join (p1 join c1): p1 of participant A join ( select c1.c_id,c1.aid,c1.c_ts from p1_conversion as c1 ) conv / / The right table of the first Join (p1 join c1): c1 of participant A On conv.aid = event.aid and conv.c_ts >= event.e_ts and conv.c_ts <=event.e_end_ts) where idx = 1 / / Data filtering condition for the left table to form the first union union all SELECT c_id, e_id, e_dims, e_ts FROM ( / / Right table of the first Union, data from the second Union) select conv.c_id,event.e_id,event.e_dims,event.e_ts,row_number() over (partition by c_id order by e_ts asc) as idx / / Select data from the join result of the second join from ( / / Start of the second Join (p2 join c1) select p2.e_id,p2.aid,p2.e_dims,p2.e_ts,(p2.e_ts +8) as e_end_ts fromp2_event as p2 event / / The left table of the second Join (p2 join c1): p2 of participant B join ( select c1.c_id,c1.aid,c1.c_ts from p1_conversion as c1 ) conv / / The right table of the second Join (p2 join c1): c1 of participant A on conv.aid = event.aid and conv.c_ts >= event.e_ts and conv.c_ts <=event.e_end_ts) where idx = 1 / / Data filtering condition for the right table to form the first Union union all SELECT c_id, e_id, e_dims, e_ts FROM ( / / The right table of the second Union, data comes from the third Union) select conv1.c_id,event.e_id,event.e_dims,event.e_ts,row_number()over (partition by c_id order by e_ts asc ) as idx / / Select data from the join result of the third join from ( / / Start of the third Join (p3 join c1) select p3.e_id,p3.aid,p3.e_dims,p3.e_ts,(p3.e_ts +8) as e_end_ts fromp3_event as p3 event / / The left table of the third Join (p3 join c1): p3 of participant C join ( select c1.c_id,c1.aid,c1.c_ts from p1_conversion as c1 conv1 / / The right table of the third Join (p3 join c1): c1 of participant A on conv1.aid=event.aid and conv1.c_ts>=event.e_ts and conv1.c_ts<=event.e_end_ts) where idx = 1 / / This forms the data filtering condition for the right table of the second Union, ending the two Unions. ) event / / The left table of the fourth Join: the event data table of participant A. join ( select c1.c_id,c1.aid,c1.c_ts,c1.c_type,c1.c_cnt from p1_conversionc1 ) conv / / The right table of the fourth Join: c1 of participant A on event.c_id = conv.c_id and event.idx = 1 group by e_dims; This SQL statement includes multiple Join and Union clauses, involving data tables from three participating parties. Figure 2The calculation logic for this SQL statement, and the processing procedure for this SQL statement, may include the following steps: S1. Join the two data tables using three Join clauses, and select the same field data (c_id, e_id, e_dims, e_ts) from the join results of each Join.
[0041] The first Join clause joins the data tables p1 and c1 of participant A (a single-user data table join, as shown in the Join diagram); the second Join clause joins the data tables p2 of participant B and c1 of participant A (a cross-user data table join, as shown in the twoJoin diagram); the third Join clause joins the data tables p3 of participant C and c1 of participant A (a cross-user data table join). The join condition (ON clause) of the JOIN clause includes an equi-join operation between the two participating tables (e.g., conv1.aid = event.aid). Additionally, the join condition can also be an expression, including logical and comparison operations (e.g., conv1.c_ts >= event.e_ts and conv1.c_ts <= event.e_end_ts), which can perform simple filtering on the joined records.
[0042] S2. Triple Union + CryptoSort: For data with the same field (c_id, e_id, e_dims, e_ts) selected from the join results of each Join, these three sets of data with the same field are merged using two Unions; the records in the merge set are sorted in ascending order according to the field e_ts of the merge set, and the field idx is obtained through the window function row_number(). The three fields (c_id, e_id, e_dims) in the merge set are selected, and the data of these four fields (c_id, e_id, e_dims, idx) in the merge set are formed into a data table event; S3. Unilateral Join: The event table held by participant A, formed through S2, is used as the left table in the fourth Join clause, and the C1 table of participant A is used as the right table conv1 in the fourth Join clause. The event table and conv1 are joined by columns. S4. Sink: Select fields from the results of the fourth Join and store them on participant A's side; the join conditions of the fourth Join include not only equi-join conditions, but also the comparison expression event.idx = 1 for simple data filtering; the join results of the fourth Join include fields (pv, uv, conv_uv, cart_pv) obtained through the grouping clause group by e_dims and the window function sum(), and the fields to be stored on disk include (e_dims, pv, uv, conv_uv, cart_pv).
[0043] During the execution of this SQL statement, apart from the data that is ultimately written to disk on participant A's side, all other data (including data related to Join connection and data related to Union merging) are private data of each participant and can only be seen by the participant themselves, not by other participants.
[0044] Step S105: Obtain the dataset association security operator that follows the multi-party secure computation protocol corresponding to the dataset association operator.
[0045] An SQL statement execution plan consists of multiple operators. Operators are the smallest unit of computation when a database executes a query and are the core component of the execution plan. They can be categorized by function as follows: scan operators, logical operation operators, set / association operators, and aggregation operators. Scan operators are responsible for reading data, including full table scans, index scans, and index range scans. Logical operation operators are responsible for data processing, including filter operators, projection operators, sort operators, and distinct operators. Set / association operators are responsible for processing multiple datasets, including join operators, union operators, and intersection / difference operators. Aggregation operators are responsible for statistical calculations, including aggregation operators (Aggregate) and grouping operators (Group By).
[0046] The dataset association operators in this embodiment are existing operators corresponding to the keywords in the dataset association clause. These operators are responsible for association processing of multiple datasets, including but not limited to: Join operator and Union operator. In the SQL execution logic and database operator system, Join and Union are typical operators and are also the core association operation operators in the database query execution plan.
[0047] For SQL statements involving cross-user, multi-data joint analysis, the first dataset join clause joins datasets from multiple users. To protect the privacy and data security of all users, the method provided in this application redesigns a secure dataset join operator that follows the Secure Multi-Party Computation (MPC) protocol, based on existing dataset join operators. This MPC-based secure dataset join operator uses encrypted computation, effectively protecting user data from leakage. Secure Multi-Party Computation (MPC) is a cryptographic technique that enables multiple parties to collaboratively perform encrypted computations without the involvement of a trusted third party, aiming to ensure the privacy of input data from all parties. Its security model encompasses semi-honest, malicious, and covert attack models, with core technologies including secret sharing, homomorphic encryption, and obfuscated circuits.
[0048] In one example, the first dataset association clause includes a Join clause, the dataset association operator includes a Join operator, and the dataset association security operator includes a Join security operator that follows the Privacy Set Intersection (PSI) protocol. This Join security operator can be named the Remote Join operator. Privacy Set Intersection (PSI) is a cryptographic technique in Secure Multi-Party Computation (MPC) that allows the two parties involved in the computation to compute the intersection of their data without obtaining additional information from each other (other than the intersection itself).
[0049] In practical implementation, the RemoteJoin operator can be further distinguished according to the equi-joining method adopted by the Join operator (such as Hash Join, Nested Loop Join, Sort Merge Join), and a multi-party RemoteJoin operator that follows the Privacy Set Intersection (PSI) protocol can be designed.
[0050] In one example, the Join operator uses a hash join method for equi-joins. The RemoteJoin operator can be divided into the RemoteJoin operator for the builder (denoted as RemoteBuildJoin operator) and the RemoteJoin operator for the probe (denoted as RemoteProbeJoin operator). RemoteBuildJoin and RemoteProbeJoin both perform equi-join processing for their respective roles and follow the Privacy Set Intersection (PSI) protocol.
[0051] In specific implementation, the RemoteBuildJoin operator performs the following processing: First, it performs a first encryption on the join key of the build table to obtain a first ciphertext, and sends the first ciphertext; second, it receives a second ciphertext obtained by the probe performing a second encryption on the first ciphertext, and builds a probe matching hash table based on the second ciphertext; third, it receives a third ciphertext obtained by the probe performing a second encryption on the join key of the probe table, and performs probe matching based on the third ciphertext and the hash table. The RemoteProbeJoin operator performs the following processing: first, it receives the first ciphertext, performs a second encryption on the first ciphertext to obtain a second ciphertext, and sends the second ciphertext; second, it encrypts the join key of the probe table to obtain the third ciphertext, and sends the third ciphertext.
[0052] In another example, the Join operator uses a nested loop join as the equi-join method. Nested loop join is a fundamental algorithm for performing table join operations in relational databases. During execution, it iteratively scans the inner table for each record of the outer table, achieving data matching through nested loops between the outer table (driving table) and the inner table (driven table). Specifically, the outer table is traversed row by row, and the inner table is matched row by row. In practical implementation, the RemoteJoin operator can be divided into a driving RemoteJoin operator (denoted as RemoteOuterJoin operator) and a driven RemoteJoin operator (denoted as RemoteInnerJoin operator). RemoteOuterJoin and RemoteInnerJoin perform their respective equi-join processing functions while adhering to the Privacy Set Intersection (PSI) protocol. Users of the outer table can perform outer table join operations using the RemoteOuterJoin operator, which includes traversing each row of the outer table; the RemoteInnerJoin operator can perform inner table join operations, which includes traversing all rows of the inner table for a given row of the outer table and comparing the join conditions one by one.
[0053] The workflow of nested loop joins can be divided into three steps: S1. Select a table as the outer driving table (usually a table with a small amount of data to reduce the number of outer loops), and traverse each row of data in this table; S2. For each row of the outer table, traverse all rows of the inner driven table and compare the join conditions one by one; S3. Rows that meet the conditions will be combined as part of the result set; rows that do not meet the conditions will be skipped until all rows of the outer table have been traversed.
[0054] In another example, the Join operator uses a sort-merge join. A sort-merge join requires both tables to be sorted by the join key, and then the join operation is performed using the merged sorted result. The execution process includes a sorting phase and a merging phase. In the sorting phase, if the tables are not sorted, they are sorted by the join key. In the merging phase, two pointers are used to scan the two sorted tables, comparing the join key values of the current rows, moving the pointers according to the comparison results, and outputting the matching rows. The RemoteJoin operator for both users follows the Privacy Set Intersection (PSI) protocol. In practice, the RemoteJoin operator can be divided into a comparison-side Join-safe operator and a non-comparison-side Join-safe operator. The comparison-side Join-safe operator is denoted as the RemoteJoinCompare operator, and the non-comparison-side Join-safe operator is denoted as the RemoteJoinNoCompare operator. The comparison side performs its Join processing through the RemoteJoinCompare operator, including sorting the comparison-side join key and matching the join keys of both sides. The RemoteJoinNoCompare operator performs join processing on the non-comparator side, including sending the ciphertext of the non-comparator side's join key data to the comparator side so that the comparator side can perform traversal matching.
[0055] In one example, the first dataset association clause includes a union clause, the dataset association operator includes a union operator, and the dataset association security operator includes a union security operator that follows the Privacy Set Union (PSU) protocol. The Privacy Set Union (PSU) protocol refers to a protocol involving multiple parties, each holding their own private data. Through the PSU protocol, two parties can compute the union of their respective sets without revealing additional information, and without allowing the other party to learn any private information beyond the result.
[0056] Step S107: Generate the dataset association ciphertext execution plan for each of the multiple users based on the dataset association security operator.
[0057] Step S109: Execute the user's dataset association ciphertext execution plan through the user's privacy computing engine; the multiple dataset association security operators in the multiple dataset association ciphertext execution plan associate the datasets of multiple users in a privacy computing manner.
[0058] The processing of SQL statements involves two steps: generating an execution plan and executing the plan. Step S107 generates the execution plan for the first dataset join clause, and step S109 executes the plan.
[0059] In existing technologies, a plaintext execution plan for a dataset association clause is generated based on a dataset association operator. In this embodiment, the plaintext execution plan of the first dataset association clause, which associates datasets of multiple users, is split into encrypted dataset association execution plans for each dataset-holding user. Each encrypted dataset association execution plan includes a dataset association security operator that conforms to the MPC protocol and corresponds to the dataset association operator.
[0060] In one example, the SQL statement may include not only a first dataset join clause but also a second dataset join clause that joins datasets for individual users. For example, Figure 3 The corresponding SQL statements include a single-user column join between data tables p1 and c1 of participant A using a Join clause, and a cross-user column join between data tables p2 of participant B and data table c1 of participant A using another Join clause. When processing the second dataset join clause that associates datasets of a single user, existing techniques can still be used to generate a plaintext execution plan for the second dataset join clause based on its dataset join operator. This approach protects user privacy while improving SQL statement execution efficiency.
[0061] Figure 4 This paper demonstrates a multi-user data association system (hereinafter referred to as an SQL statement processing system) based on structured query statements, employing the method provided in the embodiments of this application. The system includes a client, a server, and proxy nodes for each participant (e.g., participant A and participant B). The client submits SQL jobs to the server, the server configures the jobs for the proxy nodes of each participant, and the proxy nodes receive and process the jobs. On the participant side, a database, server proxy nodes, and an MPC engine are deployed. The MPC engine may include a multi-party execution plan generation engine, a plaintext computation engine, and a ciphertext computation engine (privacy computation engine). The database stores the participant's own data. The server proxy nodes (e.g., proxy node A and proxy node B) receive job configurations from the server. The multi-party execution plan generation engine generates ciphertext and plaintext execution plans for the participants. The ciphertext computation engine executes the ciphertext execution plans, and the plaintext execution plans execute the plaintext execution plans. When executing their respective ciphertext execution plans, the ciphertext computation engines of the two participants transmit ciphertext between them.
[0062] by Figure 3 For example, the corresponding SQL statement includes the following three first dataset join clauses: 1. Perform a Join clause across user columns on data table p2 of participant B and data table c1 of participant A, i.e.: Figure 3In the context of participant B's `twoJoin` clause, `twoJoin` indicates that the Join clause includes two participants. This Join clause corresponds to two encrypted execution plans: the encrypted execution plan for participant B's Join clause and the encrypted execution plan for participant C's Join clause; the execution result of this Join clause is stored on participant B's side. 2. A Join clause is used to perform a cross-user column join between data table p3 of participant C and data table c1 of participant A, i.e.: Figure 3 The twoJoin clause of participant C corresponds to two encrypted execution plans: the encrypted execution plan of participant B's Join clause and the encrypted execution plan of participant A's Join clause; the execution result of this Join clause is stored on the side of participant C. 3. Perform a Union clause to merge data across user datasets, considering the Join results of data tables p1 and c1 held by participant A, the Join results of data tables p2 and c1 held by participant B, and the Join results of data tables p3 and c1 held by participant C. Figure 3 The tripleUnion+cryptoSort is used by participant A. The Union clause corresponds to three encrypted execution plans: the encrypted execution plan of participant A's Union clause, the encrypted execution plan of participant B's Union clause, and the encrypted execution plan of participant C's Union clause; the execution result of the Union clause is stored on the side of participant A.
[0063] Figure 3 The corresponding SQL statement also includes the following second dataset join clause: 1. Perform a single-user column join clause on data table p1 and data table c1 of participant A, i.e.: Figure 3 Join with participant A in the process; this Join clause corresponds to only one plaintext execution plan, and the Join result is stored on the side of participant A; 2. A Join clause is used to perform a single-user column join on the set of three-party Unions of participant A and data table c1 of participant A, namely: Figure 3 Join of participant A; the Join clause corresponds to only one plaintext execution plan, and the Join result is stored on the side of participant A through the Sink operator of participant A.
[0064] In one example, the first dataset association clause includes a Join clause, the dataset association operator includes a Join operator, and the dataset association security operator includes a Join security operator that follows the privacy set intersection PSI protocol; step S107 can be implemented as follows: based on the Join security operator, generate the encrypted execution plan of the Join clause for each of the multiple users.
[0065] In one example, the Join operator uses an equi-join method with hash joins. The Join security operator includes a builder Join security operator (RemoteBuildJoin) and a probe Join security operator (RemoteProbeJoin). Accordingly, step S107 may include the following sub-steps: generating a ciphertext execution plan for the builder's Join clause based on the builder Join security operator; and generating a ciphertext execution plan for the probe's Join clause based on the probe Join security operator.
[0066] The execution of hash joins consists of two main phases: the build phase and the probe phase. In the build phase, the table with the smaller data volume is selected as the build table (called the inner table). The builder iterates through all rows of this table, calculates the hash value based on the join key, and stores the rows in the builder's in-memory hash table according to the hash value. Rows with the same hash value are placed in the same hash bucket. In the probe phase, the larger probe table (called the outer table) is traversed. The builder calculates the same hash value for the join key of each row, locates the corresponding hash bucket in the in-memory hash table based on the hash value, and then compares the data in the hash bucket with the join key of the current row in the probe table row by row. Rows that match are merged into the result set and output. This design reduces disk I / O and improves join efficiency.
[0067] In this embodiment, the builder performs its Join process using the RemoteJoinBuild operator. The builder's Join process includes building a hash table and probe matching. Building the hash table refers to constructing a hash table based on the Join Key of the Build Table, and probe matching refers to querying the Join Key data of the Probe Table from the hash table. Specifically, the builder's Join security operator performs the following processing: First, it performs a first encryption on the Join Key of the Build Table to obtain a first ciphertext, and sends the first ciphertext; second, it receives a second ciphertext obtained by the probe from the first ciphertext, and builds a probe matching hash table based on the second ciphertext; third, it receives a third ciphertext obtained by the probe from the second encryption of the Join Key of the Probe Table, and performs probe matching based on the third ciphertext and the hash table.
[0068] The probe performs its Join process via the RemoteJoinProbe operator, including sending the encrypted join key data of the probe table to the builder, so that the builder can perform probe matching. The probe's Join security operator performs the following processing: receiving the first encrypted data, performing a second encryption on the first encrypted data to obtain the second encrypted data, and sending the second encrypted data; performing a second encryption on the join key of the probe table to obtain the third encrypted data, and sending the third encrypted data. This processing method ensures that both the builder's Join security operator and the probe's Join security operator adhere to the Privacy Set Intersection (PSI) protocol, enabling the use of equi-join methods with hash joins to find the intersection of the data from both users without leaking any information from either user other than the intersection.
[0069] In one example, if the users holding multiple datasets in the first dataset association clause include more than three users, then two users are selected from the three or more users; for the two selected users, according to the dataset association security operator, a dataset association ciphertext execution plan is generated for each of the two selected users; dataset association processing is performed on the dataset association results of the two selected users and the datasets of the other users among the three or more users, until the dataset association results of the three or more users are obtained.
[0070] For example, a hash join of three-party data is a combination of multiple rounds of pairwise hash joins. First, join two of the parties' data to obtain an intermediate result set, then use this intermediate result set to perform a hash join with the third-party data. In specific implementation, the first round of pairwise hash join processing includes: selecting two sets of data from the three parties (table P1 of participant A, table P2 of participant B, and table P3 of participant C) and performing a hash join based on the same join key. For example, first select table P2, which has a smaller data volume, as the construction table, and table P3 as the probe table. After completing the hash join, an intermediate result set P2P3 is obtained. The first round of pairwise hash join (intermediate result set + third-party table P3) processing includes: using the intermediate result set P2P3 as a new participant, and performing a hash join again with table P1 based on the join key. At this time, based on the data volume of P2P3 and table P1, the smaller one can be selected as the construction table to build the hash table, and the other one as the probe table to complete the matching, finally obtaining the result set P1P2P3 of the three-party join.
[0071] In one example, the Join result set is stored on the probe side; step S107 may include the following sub-steps: generating the ciphertext execution plan of the Join clause for the builder side based on the builder side's Join security operator and data sending operator; generating the ciphertext execution plan of the Join clause for the probe side based on the probe side's Join security operator, data receiving operator, and join result set storage operator. The builder side's Join security operator and the probe side's Join security operator collaborate to complete the ciphertext equi-join processing of the two parties' data. The builder side sends its join columns to the probe side through the data sending operator, and the probe side stores the join record of its own columns and the builder side's columns on the probe side.
[0072] For example, the SQL statement performs the following processing: 1. Join table p1 (large table) of participant A and table p2 (small table) of participant B according to the join key (p1_uid, p2_uid); 2. After joining, select some fields of data and store them on the side of participant A, such as selecting two fields (p1_field5, p1_field7) of p1 and three fields (p2_field3, p2_field4, p2_field8) of p2 for storage. Figure 5 The left side shows the plaintext logical plan of the SQL statement, and the right side shows the ciphertext logical plans of the two participants. Participant A's ciphertext logical plan includes the following operators: a Table operator for scanning table p1, a RemoteProbe operator (a Join-safe operator for the probe), a Project operator for projecting the dataset, a RemoteRecv operator for receiving the intersection data (p2_field3, p2_field4, p2_field8) from the builder, and a Sink operator for storing the SQL statement's processing result set (the intersection data of p1 and p2, including p1_field5, p1_field7, p2_field3, p2_field4, p2_field8) on Participant A's side. Participant B's ciphertext logical plan includes two operators: a Table operator for scanning table p2, a RemoteBuild operator (a Join-safe operator for the builder), and a RemoteSend operator for sending the intersection data (p2_field3, p2_field4, p2_field8) from the builder.
[0073] In another example, the Join result set is stored in the builder; step S107 may include the following sub-steps: generating the builder's Join clause ciphertext execution plan based on the builder's Join security operator, data receiving operator, and join result set storage operator; generating the probe's Join clause ciphertext execution plan based on the probe's Join security operator and data sending operator.
[0074] For example, the SQL statement performs the following processing: 1. Join table p1 of participant A and table p2 of participant B; 2. Select data from some fields in the join result and store them on the participant B's side. In this case, the plaintext logical plan of this SQL statement is different from... Figure 5 The plaintext logic plans are the same for both parties, but the ciphertext logic plan for participant A includes the following operators: the Table operator for scanning table p1, the RemoteProbe operator (a probe-side Join-safe operator), and the RemoteSend operator for sending the probe's intersection data. The ciphertext logic plan for participant B includes the following operators: the Table operator for scanning table p2, the RemoteBuild operator (a builder-side Join-safe operator), the RemoteRecv operator for receiving the probe's intersection data, and the Sink operator for storing the SQL statement's processing result set on participant B's side.
[0075] In one example, the SQL statement also includes expressions that perform relational operations on data from multiple users; the method provided in this application embodiment may further include the following steps: 1. Generating a plaintext execution plan for the expression; and obtaining a relational operation security operator corresponding to the relational operation operator; 2. Generating a ciphertext execution plan for each of the multiple users based on the plaintext execution plan for the expression, including: replacing the relational operation operator that performs relational operations on data from multiple users in the plaintext execution plan for the expression with the relational operation security operator, setting the data of other users participating in the relational operation in the plaintext execution plan as placeholder data, and using the rewritten plan of the plaintext execution plan for the expression as the ciphertext execution plan for the user; executing the ciphertext execution plan for the user's expression through the user's privacy computing engine; the multiple relational operation security operators in the multiple ciphertext execution plans for the expression perform relational operations on the data of multiple users in a privacy computing manner.
[0076] Expressions can appear in various clauses of an SQL statement, including the SELECT clause and the JOIN clause. For example, the first dataset is associated using a JOIN clause, and the join condition in the JOIN clause can include expressions, such as... Figure 3 In addition to the equi-join operation (conv.aid = event.aid, determined during the Probe phase), the ON condition of the Join clause in the corresponding SQL statement can also be tailored into the expression conv.c_ts >= event.e_ts and conv.c_ts <= event.e_end_ts). This expression includes relational operators: >= and <=. Since the two pieces of data being compared are held by different users, this expression includes relational operations on data from multiple users.
[0077] Figure 6 This displays an expression tree (plaintext execution plan), with the corresponding expression being: The operators in this expression are all operators, including relational operators: less than, greater than and equal to; arithmetic operators: multiplication; and logical operators: AND. This expression involves comparison operations on data from two participants (a and b).
[0078] Figure 7 According to Figure 6 The ciphertext execution plan for the rewritten expressions of side A and side B. Figure 7 The left side of the expression is the ciphertext execution plan of side a. The operands of the greater than and equal to operator include the data value of side b, which is changed to placeholder data. The operands of the less than operator also include the data value of side b, which is also changed to placeholder data. Figure 7 The right side of the diagram shows the encrypted execution plan of side b's expression. The multiplication operands include side a's data `value`, which is replaced with placeholder data. In both sides' encrypted execution plans, multiplication and logical AND operations are performed in local plaintext; both comparison operators are performed in local encrypted text. The comparison operations between sides a and b can be implemented using the open-source privacy-preserving machine learning framework CrypTen to protect the privacy of all parties' data.
[0079] In one example, multiple participants execute their respective encrypted expression execution plans, which can be achieved by traversing the expression operators sequentially to execute the user's encrypted expression execution plan. The operation nodes in the expression tree can be divided into two categories: local plaintext operations (one-sided participation) and remote encrypted operations (both-sided participation). Two-party encrypted computations can be executed synchronously in the order of post-order traversal. This approach allows multiple participants to perform encrypted comparisons of multi-party data for the same relational operator simultaneously, achieving synchronous relational operations.
[0080] In one example, the Join operator uses an equi-join method with hash Join; the ciphertext execution plan of the builder user's expression includes: obtaining the data involved in relational operations included in the intersection records of the builder user based on the probe matching hash table; and the builder user's relational operation security operator, used to perform relational operations based on the data involved in relational operations. The ciphertext computations of both parties can be performed synchronously in post-order traversal, which can be done during the Probing phase of the Join ciphertext computation. After the PSI protocol is executed, both parties will obtain their own intersection data. The non-Probe side, based on the mapping relationship between the locally cached encrypted key and the source data, selects the intersection data corresponding to the Probe side's order to participate in the ciphertext computation of the expression.
[0081] In one example, the SQL statement may further include an expression that performs arithmetic operations on the data of multiple users; the method provided in this application embodiment may further include the following steps: 1. Generate a plaintext execution plan for the expression; 2. If the data of the multiple users participating in the arithmetic operation is private data, then obtain the arithmetic operation security operator corresponding to the arithmetic operation operator; 3. For each user in the expression, replace the arithmetic operation operator that performs arithmetic operations on the data of multiple users in the plaintext execution plan of the expression with the arithmetic operation security operator to generate an encrypted execution plan for the user's expression; execute the encrypted execution plan of the user's expression through the user's privacy computing engine; the multiple arithmetic operation security operators in the multiple encrypted execution plans of the expression perform arithmetic operations on the private data of multiple users in a privacy computing manner. The encrypted execution plan of the user's expression may further include a data storage operator for storing the arithmetic operation result.
[0082] For example, Figure 2 The corresponding SQL statement's SELECT clause includes the arithmetic expression: p1.e_val3 + p2.p_val3 + p3.q_val3. This expression sums the data from the three participants. This expression is computed in encrypted form and can be implemented using the open-source privacy-preserving machine learning framework CrypTen to protect the privacy of all parties. In practice, the Join operator can be used to add calculations for the number of participants in the four arithmetic operations of the SELECT clause, as well as checks for field visibility. The encrypted computation of the four arithmetic operations at runtime is essentially the same as that of relational operations, and will not be elaborated upon here.
[0083] In one example, the first dataset join clause includes a Join clause, and the expression is an expression of the field data in the Select clause. Executing the user's encrypted expression execution plan through the user's privacy computing engine can be achieved as follows: The user's encrypted expression execution plan is executed during the dataset Join process through the user's privacy computing engine. This approach ensures that if an encrypted arithmetic operation is involved, the arithmetic operation is replaced with a Sink field during the execution plan rewriting stage, generating an expression tree of arithmetic operations, which is then moved to the Join stage to complete the expression calculation.
[0084] In one example, if the data of the multiple users participating in the arithmetic operation is non-privacy data, then the plaintext execution plan of the expression is executed after the dataset join. This approach allows the original computational logic to be preserved, with calculations performed after the join is complete.
[0085] In one example, the dataset association clause is a Union clause, the dataset association operator is a Union operator, and the SQL statement also includes a sort clause to sort the data set according to privacy data. The secure dataset association operator includes: a receiver Union operator, a sender Union operator, and a ciphertext sorting operator that follow a privacy set union protocol. Accordingly, step S107 may include the following sub-steps: generating a ciphertext execution plan for the Union clause of the Union result set storage party based on the receiver Union operator and the ciphertext sorting operator; generating a ciphertext execution plan for the Union clause of the non-Union result set storage party based on the sender Union operator. Accordingly, the multiple dataset association secure operators in the multiple dataset association ciphertext execution plans in step S109, the process of associating multiple users' datasets in a privacy-preserving computation manner, includes the following: 1. The following processing is performed by the Union operator on the receiving side: the receiving side's private data is first encrypted to obtain a first ciphertext, and the first ciphertext is sent; the receiving side receives the second ciphertext obtained by the sending side's second encryption of the first ciphertext, and the receiving side receives the third ciphertext obtained by the sending side's second encryption of the sending side's private data; that is: the sending side uses the same encryption method (second encryption) to encrypt the first ciphertext and the sending side's private data; 2. The data transmission Union operator performs the following processing: receiving the first ciphertext, performing a second encryption on the first ciphertext to obtain the second ciphertext, and sending the second ciphertext; performing a second encryption on the sender's private data to obtain the third ciphertext, and sending the third ciphertext; 3. Perform the following processing using the ciphertext sorting operator: perform a first decryption symmetric to the first encryption on the second ciphertext to obtain a fourth ciphertext obtained by performing a second encryption on the recipient's private data; sort the data set of the recipient and the sender according to the fourth ciphertext and the second ciphertext.
[0086] This processing method, based on the order preservation of the ciphertext field, transforms the sorting operator OrderBy into a ciphertext sorting operator. By comparing the ciphertext data of the sorting field using the encrypted sorting operator, multi-party de-ordering encryption is achieved. Ciphertext order preservation means that the encrypted data maintains the same order as the plaintext, allowing direct comparison and calculation without decryption. This ensures both data privacy and query efficiency. The encryption algorithm that achieves order preservation is primarily Order-Preserving Encryption (OPE).
[0087] In one example, the runtime encrypted computation phase is implemented in a distributed manner. Participant A's dataset association encrypted execution plan includes: Sink operator, RemoteJoinProbe operator, and TableScan operator; Participant B's dataset association encrypted execution plan includes: RemoteJoinBuild operator and TableScan operator. Common implementations of distributed joins include Sorted-Merge Join and Hash Join, where the data from both parties are sharded according to the same rules based on the Join Key in the equality condition, and the number of shards is consistent. This ensures that data with the same Join Key from both parties will be distributed across Workers with the same shard ID after shuffling, and the Workers from both parties can be connected using HashJoin. During secure data transmission, the worker using the Send operator encrypts and sends data, and the worker using the Recv operator receives and decrypts data. This process does not involve the MPC protocol; a suitable encryption protocol can be chosen.
[0088] The execution plan for the user's dataset association with the encrypted execution plan means that the executor calls the storage engine's interface to execute operators one by one according to the execution plan (such as the Scan operator to read data, the Join operator to associate tables, and the Union operator to merge results), and finally returns the result set to the user.
[0089] As can be seen from the above embodiments, the multi-user data association method based on structured query statements provided in this application involves: obtaining a structured query language (SQL) statement; obtaining a first dataset association clause in the SQL statement that associates datasets of multiple users; obtaining a dataset association security operator that follows a multi-party secure computation protocol corresponding to the dataset association operator; generating a dataset association encrypted execution plan for each of the multiple users based on the dataset association security operator; and executing the user's dataset association encrypted execution plan through the user's privacy computation engine, thereby associating the datasets of multiple users in a privacy computation manner through multiple dataset association security operators in the multiple dataset association encrypted execution plans. This approach rewrites the plaintext execution plan of multi-user data join clauses in SQL statements into ciphertext execution plans for each user. It also redesigns dataset join operators (such as Join and Union) and transforms them into secure dataset join operators based on the Multi-Party Computation (MPC) protocol. For example, the multi-user Join operator uses a privacy set intersection protocol, the multi-user Union operator uses a privacy set union protocol, and expression operations use a secret sharing protocol. Multiple ciphertext execution plans perform cross-user joint data analysis using privacy computation methods, thus avoiding the leakage of user privacy data when executing SQL statements for cross-user joint data analysis. Therefore, it effectively ensures the security of multi-party data during the execution of SQL statements for cross-user joint data analysis.
[0090] Second Embodiment In the above embodiments, a multi-user joint data processing method based on structured query statements is provided. Correspondingly, this application also provides a multi-user joint data processing apparatus based on structured query statements. This apparatus corresponds to the embodiments of the above method. Since the apparatus embodiments are basically similar to the method embodiments, the description is relatively simple, and relevant parts can be referred to in the description of the method embodiments. The apparatus embodiments described below are merely illustrative.
[0091] This application also provides a multi-user federated data processing device based on structured query statements, including: an SQL statement acquisition unit, a first dataset association clause acquisition unit, a security operator acquisition unit, a ciphertext plan generation unit, and a ciphertext plan execution unit.
[0092] The SQL statement acquisition unit is used to acquire Structured Query Language (SQL) statements; the first dataset association clause acquisition unit is used to acquire the first dataset association clause in the SQL statement that associates datasets of multiple users; the security operator acquisition unit is used to acquire the dataset association security operator that follows a multi-party secure computation protocol corresponding to the dataset association operator; the ciphertext plan generation unit is used to generate ciphertext execution plans for each of the multiple users' dataset associations based on the dataset association security operators; the ciphertext plan execution unit is used to execute the user's dataset association ciphertext execution plan through the user's privacy computation engine; the multiple dataset association security operators in the multiple dataset association ciphertext execution plans associate the datasets of multiple users in a privacy computation manner.
[0093] In one example, the first dataset association clause includes a join clause, and the dataset association operator includes a join operator; the dataset association security operator includes a join security operator that follows a privacy set intersection protocol; the step of generating the dataset association ciphertext execution plan for each of the multiple users based on the dataset association security operator includes: generating the join clause ciphertext execution plan for each of the multiple users based on the join security operator.
[0094] In one example, the Join operator uses an equi-join method of hash Join, and the Join security operator includes a builder Join security operator and a probe Join security operator. Generating ciphertext execution plans for the Join clauses of each of the multiple users based on the Join security operator includes: generating a builder Join clause ciphertext execution plan based on the builder Join security operator; generating a probe Join clause ciphertext execution plan based on the probe Join security operator; and associating multiple datasets in the ciphertext execution plans using privacy-preserving computation methods by employing multiple dataset association security operators, including: The builder's Join security operator performs the following processing: Firstly encrypts the join key of the construction table to obtain a first ciphertext, and sends the first ciphertext; receives a second ciphertext obtained by the probe from the first ciphertext through a second encryption, and constructs a probe matching hash table based on the second ciphertext; receives a third ciphertext obtained by the probe from the probe from the probe table's join key through a second encryption, and performs probe matching based on the third ciphertext and the hash table; the probe's Join security operator performs the following processing: receives the first ciphertext, performs a second encryption on the first ciphertext to obtain a second ciphertext, and sends the second ciphertext; secondly encrypts the join key of the probe table to obtain the third ciphertext, and sends the third ciphertext.
[0095] In one example, the associated result set is stored on the probe side; generating the encrypted execution plan of the Join clause for each of the multiple users according to the Join security operator includes: generating the encrypted execution plan of the Join clause for the builder side according to the Join security operator and the data sending operator of the builder side; and generating the encrypted execution plan of the Join clause for the probe side according to the Join security operator, the data receiving operator, and the associated result set storage operator of the probe side.
[0096] In one example, the associated result set is stored in the builder; generating the encrypted execution plan of the Join clause for each of the multiple users according to the Join security operator includes: generating the encrypted execution plan of the Join clause for the builder according to the builder's Join security operator, data receiving operator, and associated result set storage operator; and generating the encrypted execution plan of the Join clause for the probe according to the probe's Join security operator and data sending operator.
[0097] In one example, the SQL statement further includes an expression for performing relational operations on the data of the multiple users; the apparatus further includes: an expression processing unit, configured to generate a plaintext execution plan for the expression; and to obtain a secure relational operation operator corresponding to the relational operation operator; and to generate a ciphertext execution plan for each of the multiple users based on the plaintext execution plan, including: replacing the relational operation operator for performing relational operations on the data of the multiple users in the plaintext execution plan with the secure relational operation operator, setting the data of other users participating in the relational operation in the plaintext execution plan as placeholder data, and using the rewritten plan of the plaintext execution plan as the ciphertext execution plan for the user; executing the ciphertext execution plan for the user's expression through the user's privacy computing engine; and using the multiple secure relational operation operators in the multiple ciphertext execution plans to perform relational operations on the data of the multiple users in a privacy computing manner.
[0098] In one example, executing the user's encrypted expression execution plan includes: executing the user's encrypted expression execution plan by subsequently traversing expression operators.
[0099] In one example, the first dataset association clause includes a Join clause, and the expression includes the expression in the join condition of the Join clause.
[0100] In one example, the Join operator uses the equi-join method of hash Join; the ciphertext execution plan of the builder user's expression includes: obtaining the data of the participating relation operations included in the intersection records of the builder user based on the probe matching hash table; the relation operation security operator of the builder user is used to perform relation operations based on the data of the participating relation operations.
[0101] In one example, the SQL statement further includes an expression for performing arithmetic operations on the data of the multiple users; the apparatus further includes: an expression processing unit, used to generate a plaintext execution plan for the expression; if the data of the multiple users participating in the arithmetic operation is private data, then obtaining a secure arithmetic operation operator corresponding to the arithmetic operation operator; for each user in the expression, replacing the arithmetic operation operator for performing arithmetic operations on the data of the multiple users in the plaintext execution plan of the expression with the secure arithmetic operation operator to generate an encrypted execution plan for the user's expression; executing the encrypted execution plan of the user's expression through the user's privacy computing engine; the multiple secure arithmetic operation operators in the multiple encrypted execution plans of the expression perform arithmetic operations on the private data of the multiple users in a privacy computing manner.
[0102] In one example, the first dataset association clause includes a Join clause, and the expression includes an expression of the field data in the Select clause; the step of executing the user's expression encrypted execution plan through the user's privacy computing engine includes: executing the user's expression encrypted execution plan during the dataset Join process through the user's privacy computing engine.
[0103] In one example, if the data of the multiple users participating in the arithmetic operation is non-privacy data, then the plaintext execution plan of the expression is executed after the dataset join.
[0104] In one example, the dataset association clause includes a Union clause, the dataset association operator includes a Union operator, and the SQL statement also includes a sort clause for sorting the data set based on privacy data; the dataset secure association operator includes: a receiver Union operator, a sender Union operator, and a ciphertext sorting operator that follow a privacy set union protocol; generating the dataset association ciphertext execution plan for each of the multiple users based on the dataset association secure operator includes: generating a Union clause ciphertext execution plan for the Union result set storage based on the receiver Union operator and the ciphertext sorting operator; generating a Union clause ciphertext execution plan for the non-Union result set storage based on the sender Union operator; the multiple dataset association secure operators in the multiple dataset association ciphertext execution plans perform privacy computation on multiple... The user's dataset is associated, including: the receiving Union operator performs the following processing: first encryption of the receiving party's private data to obtain a first ciphertext, and sends the first ciphertext; receiving the sending party's second encryption of the first ciphertext to obtain a second ciphertext, and receiving the sending party's second encryption of the sending party's private data to obtain a third ciphertext; the data sending Union operator performs the following processing: receiving the first ciphertext, second encryption of the first ciphertext to obtain a second ciphertext, and sending the second ciphertext; second encryption of the sending party's private data to obtain the third ciphertext, and sending the third ciphertext; the ciphertext sorting operator performs the following processing: first decryption of the second ciphertext symmetrical to the first encryption to obtain a fourth ciphertext obtained by second encryption of the receiving party's private data; and sorting the data sets of the receiving party and the sending party according to the fourth ciphertext and the second ciphertext.
[0105] In one example, the apparatus further includes: a second dataset association clause acquisition unit, configured to acquire a second dataset association clause in the SQL statement that associates the datasets of a single user; a plaintext execution plan generation unit, configured to generate a plaintext execution plan for the dataset association of the single user based on the dataset association operator; and a plaintext plan execution unit, configured to execute the plaintext execution plan for the dataset association of the single user.
[0106] In one example, if the multiple users include more than three users, then two users are selected from the three or more users; for the two selected users, according to the dataset association security operator, a dataset association ciphertext execution plan is generated for each of the two selected users; dataset association processing is performed on the dataset association results of the two selected users and the datasets of the other users among the three or more users, until the dataset association results of the three or more users are obtained.
[0107] Third Embodiment In the above embodiments, a multi-user joint data processing method based on structured query statements is provided. Correspondingly, this application also provides a multi-user joint data processing method based on structured query statements, which can be deployed on the server-side proxy node of any participating party. This method corresponds to the first method embodiment described above. Since this embodiment is basically similar to the first method embodiment, it is described simply, and relevant parts can be referred to in the description of the first method embodiment. The method embodiments described below are merely illustrative.
[0108] This application also provides a multi-user federated data processing method based on structured query statements, including: Step 1: Obtain the Structured Query Language (SQL) statement.
[0109] Step 2: Obtain the first dataset association clause in the SQL statement that associates datasets of multiple users.
[0110] Step 3: Obtain the dataset association security operator that follows the multi-party secure computation protocol and corresponds to the dataset association operator.
[0111] Step 4: Generate a dataset association ciphertext execution plan for your own user based on the dataset association security operator.
[0112] The user referred to as Party B is the participating party itself.
[0113] Step 5: Execute the encrypted dataset association execution plan of the user's own data set through the user's privacy computing engine; associate the dataset association security operator in the encrypted dataset association execution plan of the user's own data set with the dataset association security operator in the encrypted dataset association execution plan of other users' data sets in a privacy computing manner.
[0114] Fourth embodiment In the above embodiments, a multi-user joint data processing method based on structured query statements is provided. Correspondingly, this application also provides a multi-user joint data processing apparatus based on structured query statements. This apparatus corresponds to the embodiments of the above method. Since the apparatus embodiments are basically similar to the method embodiments, the description is relatively simple, and relevant parts can be referred to in the description of the method embodiments. The apparatus embodiments described below are merely illustrative.
[0115] This application also provides a multi-user federated data processing device based on structured query statements, comprising: an SQL statement acquisition unit for acquiring a Structured Query Language (SQL) statement; a first dataset association clause acquisition unit for acquiring a first dataset association clause in the SQL statement that associates datasets of multiple users; a security operator acquisition unit for acquiring a dataset association security operator corresponding to the dataset association operator and conforming to a multi-party secure computation protocol; a ciphertext plan generation unit for generating a dataset association ciphertext execution plan for its own users based on the dataset association security operator; and a ciphertext plan execution unit for executing the dataset association ciphertext execution plan for its own users through the privacy computation engine of its own users; wherein the dataset association security operator in the dataset association ciphertext execution plan of its own users and the dataset association security operator in the dataset association ciphertext execution plan of other users associate the datasets of multiple users in a privacy computation manner.
[0116] Fifth embodiment In the above embodiments, a multi-user joint data processing method based on structured query statements is provided. Correspondingly, this application also provides a multi-user joint data processing system based on structured query statements. This system corresponds to the embodiments of the above method. Since the system embodiments are basically similar to the method embodiments, the description is relatively simple, and relevant parts can be referred to in the description of the method embodiments. The system embodiments described below are merely illustrative.
[0117] This application also provides a multi-user joint data processing system based on structured query statements, including: a first multi-user data association device and a second multi-user data association device.
[0118] The first multi-user data association device can be deployed on the first user's side. It is used to acquire a Structured Query Language (SQL) statement; acquire a first dataset association clause in the SQL statement that associates datasets from multiple users, including the first user and the second user; acquire a dataset association security operator corresponding to the dataset association operator and conforming to a multi-party secure computation protocol; generate a first dataset association encrypted execution plan for the first user based on the dataset association security operator; and execute the first dataset association encrypted execution plan through the first user's privacy computation engine. Correspondingly, the second multi-user data association device can be deployed on the second user's side. It is used to acquire the SQL statement; acquire the first dataset association clause; acquire the dataset association security operator; generate a second dataset association encrypted execution plan for the second user based on the dataset association security operator; and execute the second dataset association encrypted execution plan for the second user through the second user's privacy computation engine. The dataset association security operators in the first and second dataset association encrypted execution plans associate the datasets of the first and second users using a privacy computation method.
[0119] Sixth Embodiment In the above embodiments, a multi-user joint data processing method based on structured query statements is provided. Correspondingly, this application also provides an electronic device. This device corresponds to the embodiments of the above method. Since the device embodiments are basically similar to the method embodiments, the description is relatively simple, and relevant details can be found in the description of the method embodiments. The device embodiments described below are merely illustrative.
[0120] The electronic device of this embodiment includes: a memory and a processor; the memory is used to store a program that implements a multi-user joint data processing method based on structured query statements, and the device is powered on and runs the program of the multi-user joint data processing method based on structured query statements through the processor.
[0121] Memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0122] In specific implementations, the electronic device may further include one or more of the following components: a power supply component, an input / output (I / O) interface, and a communication component. The power supply component provides power to various components of the electronic device. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device. The I / O interface provides an interface between the processor 503 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. The communication component is configured to facilitate wired or wireless communication between the electronic device and user devices (such as smartphones, tablets, etc.).
[0123] Seventh Embodiment This application also provides a computer-readable storage medium. Since the embodiments of the computer-readable storage medium are substantially similar to the method embodiments, the description is relatively simple; relevant details can be found in the description of the method embodiments. The computer-readable storage medium embodiments described below are merely illustrative.
[0124] In this embodiment, a non-transitory computer-readable storage medium including instructions is provided, such as a memory including instructions. These instructions can be executed by a processor of an electronic device to complete the multi-user collaborative data processing method based on structured query statements provided in this disclosure. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device.
[0125] It should be noted that the embodiments of this application may involve the use of user data. In practical applications, user-specific personal data may be used in the scheme described herein within the scope permitted by applicable laws and regulations, provided that it complies with the applicable laws and regulations of the country (e.g., with the user's explicit consent, with the user being properly notified, etc.).
[0126] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.
[0127] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0128] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0129] 1. Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. 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, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carrier waves.
[0130] 2. Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
Claims
1. A method for multi-user data association based on structured query statements, characterized in that, include: Retrieve the Structured Query Language (SQL) statement; Retrieve the first dataset join clause in the SQL statement that associates datasets of multiple users; Obtain the dataset association security operator that conforms to the multi-party secure computation protocol and corresponds to the dataset association operator; Based on the dataset association security operator, generate the dataset association ciphertext execution plan for each of the multiple users; The user's privacy computing engine executes the user's dataset association ciphertext execution plan; multiple dataset association security operators in the multiple dataset association ciphertext execution plans associate the datasets of multiple users in a privacy computing manner.
2. The method according to claim 1, characterized in that, The first dataset association clause includes a join clause, and the dataset association operator includes a join operator; The dataset association security operator includes a Join security operator that follows a privacy set intersection protocol; The step of generating the dataset association ciphertext execution plan for each of the multiple users based on the dataset association security operator includes: Based on the Join security operator, generate the encrypted execution plan of the Join clause for each of the multiple users.
3. The method according to claim 2, characterized in that, The Join operator adopts the equi-join method of hash Join, and the Join security operator includes the builder Join security operator and the probe Join security operator; The step of generating ciphertext execution plans for the respective Join clauses of the multiple users based on the Join security operator includes: Based on the builder's Join security operator, generate the ciphertext execution plan of the builder's Join clause; Based on the probe's Join security operator, generate the probe's Join clause ciphertext execution plan; The multiple dataset association security operator in the encrypted execution plan associates multiple datasets, and associates the datasets of multiple users in a privacy-preserving computation manner, including: The builder's Join security operator performs the following processing: it performs a first encryption on the build table join key to obtain a first ciphertext, and sends the first ciphertext; it receives a second ciphertext obtained by the probe performing a second encryption on the first ciphertext, and builds a probe matching hash table based on the second ciphertext; it receives a third ciphertext obtained by the probe performing a second encryption on the probe table join key, and performs probe matching based on the third ciphertext and the hash table. The probe join security operator performs the following processing: receiving the first ciphertext, performing a second encryption on the first ciphertext to obtain the second ciphertext, and sending the second ciphertext; performing a second encryption on the probe table connection key to obtain the third ciphertext, and sending the third ciphertext.
4. The method according to claim 3, characterized in that, The associated result set is stored in the probe; The step of generating ciphertext execution plans for the respective Join clauses of the multiple users based on the Join security operator includes: Based on the builder's Join security operator and data transmission operator, generate the builder's Join clause ciphertext execution plan; Based on the probe's Join security operator, data receiving operator, and associated result set storage operator, a probe's Join clause encrypted execution plan is generated.
5. The method according to claim 3, characterized in that, The associated result set is stored in the builder; The step of generating ciphertext execution plans for the respective Join clauses of the multiple users based on the Join security operator includes: Based on the builder's Join security operator, data receiving operator, and associated result set storage operator, generate the builder's Join clause encrypted execution plan; Based on the probe's Join security operator and data transmission operator, generate the probe's Join clause ciphertext execution plan.
6. The method according to claim 1, characterized in that, The SQL statement also includes expressions that perform relational operations on the data of the multiple users; The method further includes: Generate a plaintext execution plan for the expression; and obtain the relational operation security operator corresponding to the relational operation operator; Based on the plaintext execution plan of the expression, generate the ciphertext execution plan of the expression for each of the multiple users, including: replacing the relational operation operator that performs relational operations on the data of multiple users in the plaintext execution plan of the expression with the relational operation security operator, setting the data of other users participating in the relational operation in the plaintext execution plan as placeholder data, and using the rewritten plan of the plaintext execution plan of the expression as the ciphertext execution plan of the user's expression; The user's privacy computing engine executes the user's encrypted expression execution plan; multiple relational operation security operators in the multiple encrypted expression execution plans perform relational operations on the data of multiple users in a privacy computing manner.
7. The method according to claim 1, characterized in that, The SQL statement also includes expressions that perform arithmetic operations on the data of the multiple users; The method further includes: Generate a plaintext execution plan for the expression; If the data of the multiple users participating in the arithmetic operation is private data, then obtain the arithmetic operation security operator corresponding to the arithmetic operation operator; for each user in the expression, replace the arithmetic operation operator that performs arithmetic operations on the data of multiple users in the plaintext execution plan of the expression with the arithmetic operation security operator to generate the expression ciphertext execution plan of the user; The user's privacy computing engine executes the user's encrypted expression execution plan; multiple arithmetic operation security operators in the multiple encrypted expression execution plans perform arithmetic operations on the privacy data of multiple users in a privacy computing manner.
8. The method according to claim 1, characterized in that, The dataset association clause includes a Union clause, the dataset association operator includes a Union operator, and the SQL statement also includes a sort clause that sorts the data set according to the privacy data; The secure association operators for the dataset include: a receiver Union operator, a sender Union operator, and a ciphertext sorting operator that follow a privacy set union protocol; The step of generating the dataset association ciphertext execution plan for each of the multiple users based on the dataset association security operator includes: Based on the receiving Union operator and the ciphertext sorting operator, generate the Union clause ciphertext execution plan for the Union result set storage; Based on the sending Union operator, generate the Union clause ciphertext execution plan for the non-Union result set storage location; The multiple dataset association security operator in the encrypted execution plan associates multiple datasets, and associates the datasets of multiple users in a privacy-preserving computation manner, including: The receiving Union operator performs the following processing: it performs a first encryption on the receiving party's private data to obtain a first ciphertext, and sends the first ciphertext; it receives a second ciphertext obtained by the sending party performing a second encryption on the first ciphertext, and receives a third ciphertext obtained by the sending party performing a second encryption on the sending party's private data. The data transmission Union operator performs the following processing: receiving the first ciphertext, performing a second encryption on the first ciphertext to obtain the second ciphertext, and sending the second ciphertext; performing a second encryption on the sender's private data to obtain the third ciphertext, and sending the third ciphertext; The ciphertext sorting operator performs the following processing: performing a first decryption symmetric to the first encryption on the second ciphertext to obtain a fourth ciphertext obtained by performing a second encryption on the recipient's private data; and sorting the data set of the recipient and the sender according to the fourth ciphertext and the second ciphertext.
9. The method according to claim 1, characterized in that, Also includes: Retrieve the second dataset join clause in the SQL statement that associates datasets for a single user; Based on the dataset association operator, generate a plaintext execution plan for the dataset association of the individual user; Execute the plaintext execution plan associated with the dataset of the individual user.
10. A multi-user data association method based on structured query statements, characterized in that, include: Retrieve the Structured Query Language (SQL) statement; Retrieve the first dataset join clause in the SQL statement that associates datasets of multiple users; Obtain the dataset association security operator that conforms to the multi-party secure computation protocol and corresponds to the dataset association operator; Based on the dataset association security operator, generate a dataset association ciphertext execution plan for the user. The privacy computing engine of the user executes the encrypted execution plan of the user's dataset association; the dataset association security operator in the encrypted execution plan of the user's dataset association and the dataset association security operator in the encrypted execution plan of other users' dataset association associate the datasets of multiple users in a privacy computing manner.
11. A multi-user joint data processing device based on structured query statements, characterized in that, include: The SQL statement retrieval unit is used to retrieve Structured Query Language (SQL) statements. The first dataset association clause acquisition unit is used to acquire the first dataset association clause in the SQL statement that associates datasets of multiple users. The security operator acquisition unit is used to acquire the dataset association security operator that follows the multi-party secure computation protocol and corresponds to the dataset association operator; The ciphertext plan generation unit is used to generate ciphertext execution plans associated with the datasets of the multiple users based on the dataset association security operators. The encrypted plan execution unit is used to execute the user's dataset-associated encrypted execution plan through the user's privacy computing engine; the multiple dataset association security operators in the multiple dataset association encrypted execution plans associate the datasets of multiple users in a privacy computing manner.
12. A multi-user joint data processing device based on structured query statements, characterized in that, include: The SQL statement retrieval unit is used to retrieve Structured Query Language (SQL) statements. The first dataset association clause acquisition unit is used to acquire the first dataset association clause in the SQL statement that associates datasets of multiple users. The security operator acquisition unit is used to acquire the dataset association security operator that follows the multi-party secure computation protocol and corresponds to the dataset association operator; The ciphertext plan generation unit is used to generate a dataset-associated ciphertext execution plan for the user based on the dataset associating security operators. The encrypted plan execution unit is used to execute the encrypted execution plan of the user's dataset association through the user's privacy computing engine; the dataset association security operator in the encrypted execution plan of the user's dataset association and the dataset association security operator in the encrypted execution plan of other users' dataset association associate the datasets of multiple users in a privacy computing manner.
13. A multi-user data association system based on structured query statements, characterized in that, include: The first multi-user data association device is used to obtain structured query language (SQL) statements; Retrieve the first dataset join clause in the SQL statement that associates datasets of multiple users; Obtain the dataset association security operator that conforms to the multi-party secure computation protocol and corresponds to the dataset association operator; Based on the dataset association security operator, generate the first dataset association ciphertext execution plan for the first user; The first user's privacy computing engine executes the encrypted execution plan associated with the first dataset; The second multi-user data association device is used to obtain the SQL statement and the first dataset association clause. Obtain the associated security operator for the dataset; Based on the dataset association security operator, generate the dataset association ciphertext execution plan for the second user; The second user's privacy computing engine executes the second user's second dataset association ciphertext execution plan; the dataset association security operator in the first dataset association ciphertext execution plan and the dataset association security operator in the second dataset association ciphertext execution plan associate the datasets of the first user and the second user in a privacy computing manner.
14. An electronic device, characterized in that, include: processor; as well as A memory for storing a program for implementing the method according to any one of claims 1 to 10, wherein the device is powered on and the program for running the method is executed by the processor.