Data query method and device and storage medium

By determining the encrypted computation file based on query information and combining it with a secret sharing conversion strategy, the problem of low query efficiency in existing technologies is solved, and fast and efficient data query is achieved.

CN114519064BActive Publication Date: 2025-12-30SANGFOR TECH INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210038169.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-13
Publication Date
2025-12-30
Estimated Expiration
2042-01-13

AI Technical Summary

Technical Problem

In existing technologies, the process of querying predetermined data parameters from partners by writing backend code takes a long time to prepare and the computational efficiency of fixed secret sharing is low, resulting in low efficiency in determining query results.

Method used

The method involves determining the encrypted calculation file based on query statement information, and then using the encrypted calculation file combined with local and partner secret random numbers and a secret sharing conversion strategy to perform data queries. This includes determining the encrypted calculation file, sending local secret random numbers, receiving partner secret random numbers, and calculating the query results by combining the secret sharing conversion strategy.

Benefits of technology

By quickly identifying the encrypted computation file and utilizing a secret sharing conversion strategy, the computational efficiency of data querying is improved, preparation time is shortened, and the efficiency of determining query results is increased.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114519064B_ABST
    Figure CN114519064B_ABST
Patent Text Reader

Abstract

The application provides a data query method and device and a storage medium. The method comprises the following steps: determining a ciphertext calculation file based on obtained query statement information; sending the ciphertext calculation file and a first set of local secret random numbers of determined local data to a cooperative node, and receiving a first set of cooperative secret random numbers fed back by the cooperative node in response to the ciphertext calculation file; determining a first secret result based on the ciphertext calculation file, by using a second set of local secret random numbers and the first set of cooperative secret random numbers, and combining a secret sharing form conversion strategy; receiving a second secret result fed back by the cooperative node, combining the first secret result and the second secret result, and determining a query result; and the second secret result and the first set of cooperative secret random numbers are determined by the cooperative node based on the ciphertext calculation file. The scheme improves the efficiency of determining the query result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the fields of Internet and computer technology, and in particular to a data query method, apparatus and storage medium. Background Technology

[0002] In related technologies, the querying party owns a relational data table R. A The partner has a relational data table R. B R A R B Both tables contain important attributes or characteristics. The querying party wants to perform statistical queries that are impossible to achieve unilaterally using the data tables of both parties. However, the data held by each party is highly private and cannot leave their local machine. The current common technical approach is for the querying party to use backend code to retrieve predetermined data parameters from the partner, and then calculate the final query result using a fixed secret sharing method. However, the backend code writing process has a long preparation time, requiring the querying party to wait, and the fixed secret sharing method has low computational efficiency, resulting in low efficiency in determining the query result. Summary of the Invention

[0003] The present invention provides a data query method, apparatus and storage medium that can improve the efficiency of determining query results.

[0004] The technical solution of this invention is implemented as follows:

[0005] This invention provides a data query method applied to a query node, comprising:

[0006] Based on the obtained query information, the encrypted calculation file is determined;

[0007] Send the encrypted calculation file and the first set of local secret random numbers of the determined local data to the cooperating node, and receive the first set of cooperating party secret random numbers fed back by the cooperating node in response to the encrypted calculation file;

[0008] Based on the encrypted calculation file, the first secret result is determined by using the second set of local secret random numbers and the first set of collaborator secret random numbers, combined with the secret sharing format conversion strategy; the first set of local secret random numbers and the second set of local secret random numbers are two sets of random numbers obtained by splitting the local data according to the predetermined secret sharing format;

[0009] The second secret result fed back by the cooperating node is received, and the query result is determined by combining the first secret result and the second secret result; the second secret result and the first set of cooperating party secret random numbers are determined by the cooperating node based on the encrypted calculation file.

[0010] In the above scheme, determining the encrypted calculation file based on the obtained query statement information includes:

[0011] The query statement information is parsed to form a query list; the query list includes: conditional query identifiers, query source data identifiers, and multiple calculation operation identifiers;

[0012] Determine the preset code templates corresponding to the conditional query identifier, the query source data identifier, and the multiple calculation operation identifiers;

[0013] The query list is converted into query code using the preset code template, and then the query code is compiled to form the encrypted calculation file.

[0014] In the above scheme, before determining the encrypted calculation file based on the obtained query statement information, the method further includes:

[0015] Obtain the query statement information; the query statement information is written by the user based on the data structure of the local data and the partner data known in advance.

[0016] In the above scheme, the predetermined secret sharing method includes: arithmetic sharing;

[0017] Before sending the encrypted computation file and the first set of local secret random numbers determined from the local data to the cooperating node, and before receiving the first set of cooperating party secret random numbers fed back by the cooperating node in response to the encrypted computation file, the method further includes:

[0018] The local data is compiled into multiple random numbers in the form of the arithmetic sharing;

[0019] The multiple random numbers are divided into two groups to obtain the first group of local secret random numbers and the second group of local secret random numbers.

[0020] In the above scheme, the step of determining the first secret result based on the encrypted calculation file, using a predicted second set of local secret random numbers and the first set of collaborator secret random numbers, combined with a secret sharing format conversion strategy, includes:

[0021] Run the encrypted calculation file and calculate the intersection of the second set of local secret random numbers and the first set of collaborator secret random numbers according to predetermined attributes; the predetermined attributes are the data attributes contained in the local data and the collaborator data;

[0022] The random numbers within the intersection of the random numbers are converted into data in the form of Yao's circuit to obtain an intermediate data set;

[0023] Perform a join operation on the intermediate data set to obtain a first intermediate data set, and restore the number of data in the first intermediate data set to the number of data in the intermediate data set to obtain a second intermediate data set;

[0024] The second intermediate data set is sorted or deduplicated to obtain the first secret result.

[0025] In the above scheme, the step of determining the first secret result based on the encrypted calculation file, using a predicted second set of local secret random numbers and the first set of collaborator secret random numbers, combined with a secret sharing format conversion strategy, includes:

[0026] The encrypted calculation file is run, and multiple calculation operations are performed using the second set of local secret random numbers and the first set of collaborator secret random numbers, combined with a secret sharing format conversion strategy, to obtain the first secret result.

[0027] In the above scheme, the multiple computational operations include k computational operations; k is a positive integer greater than 1;

[0028] The process of using the second set of local secret random numbers and the first set of partner secret random numbers, combined with a secret sharing format conversion strategy, to perform multiple calculation operations to obtain the first secret result includes:

[0029] Perform the first calculation operation on the second set of local secret random numbers and the first set of collaborator secret random numbers, and convert the calculation result into a first set of random numbers in the form of secret sharing that matches the second calculation operation;

[0030] The second calculation operation is performed on the first random number set, and the calculation result is converted into a second random number set in the secret sharing form matched by the third calculation operation, until the k-1 random number set is processed and the calculation operation is performed, and then the first secret result is obtained.

[0031] In the above scheme, the step of receiving the second secret result fed back by the cooperating node, and combining the first secret result with the second secret result to determine the query result includes:

[0032] The first secret result and the second secret result are combined to obtain the intermediate secret result;

[0033] The intermediate secret result is decrypted to obtain the query result.

[0034] This invention also provides a data query method applied to cooperative nodes, including:

[0035] The system receives a ciphertext calculation file and a first set of local secret random numbers sent by the query node; the ciphertext calculation file is determined by the query node based on the obtained query statement information.

[0036] In response to the encrypted calculation file, the first set of secret random numbers corresponding to the partner data is determined, and the first set of secret random numbers is fed back to the query node;

[0037] The second secret result is determined by using the second set of partner secret random numbers and the first set of local secret random numbers, combined with a secret sharing format conversion strategy; the first set of partner secret random numbers and the second set of partner secret random numbers are two sets of random numbers obtained by splitting the partner data according to the predetermined secret sharing format;

[0038] The second secret result is fed back to the query node, so that the query node can determine the query result based on the second secret result and the determined first secret result.

[0039] In the above scheme, the step of responding to the encrypted calculation file and determining the first set of collaborator secret random numbers corresponding to the collaborator data includes:

[0040] In response to the encrypted calculation file, the collaborator data is determined in the database;

[0041] The secret random number for the first group of partners is determined based on the partner data.

[0042] In the above scheme, the step of responding to the encrypted calculation file and determining the partner data in the database includes:

[0043] Parse the encrypted calculation file to obtain the conditional query identifier and the query source data identifier;

[0044] Based on the conditional query identifier and the query source data identifier, the partner data is determined in the database.

[0045] In the above scheme, determining the first set of secret random numbers for partners based on the partner data includes:

[0046] The collaborator data is compiled into multiple collaborator random numbers in the form of the arithmetic sharing;

[0047] The multiple random numbers from the cooperating parties are divided into two groups to obtain the first group of secret random numbers from the cooperating parties and the second group of secret random numbers from the cooperating parties.

[0048] This invention also provides a data query device applied to a query node, comprising:

[0049] The determining unit is used to determine the encrypted calculation file based on the obtained query statement information;

[0050] The first receiving unit is used to send the encrypted calculation file and the first set of local secret random numbers of the determined local data to the cooperating node, and to receive the first set of cooperating party secret random numbers fed back by the cooperating node in response to the encrypted calculation file;

[0051] The determining unit is further configured to determine the first secret result based on the encrypted calculation file by using a predicted second set of local secret random numbers and the first set of collaborator secret random numbers, combined with a secret sharing format conversion strategy; the first set of local secret random numbers and the second set of local secret random numbers are two sets of random numbers obtained by splitting the local data according to the predetermined secret sharing format;

[0052] The determining unit is further configured to receive the second secret result fed back by the cooperating node, and combine the first secret result with the second secret result to determine the query result; the second secret result and the first set of cooperating party secret random numbers are determined by the cooperating node based on the encrypted calculation file.

[0053] This invention also provides a data query device applied to a cooperating node, comprising:

[0054] The second receiving unit is used to receive the encrypted calculation file and the first set of local secret random numbers sent by the query node; the encrypted calculation file is determined by the query node based on the obtained query statement information;

[0055] The response unit is used to respond to the encrypted calculation file, determine the first set of secret random numbers of the collaborator corresponding to the collaborator data, and feed back the first set of secret random numbers of the collaborator to the query node;

[0056] The response unit is further configured to determine the second secret result by combining the second set of partner secret random numbers and the first set of local secret random numbers with a secret sharing format conversion strategy; the first set of partner secret random numbers and the second set of partner secret random numbers are two sets of random numbers obtained by splitting the partner data according to the predetermined secret sharing format;

[0057] The feedback unit is used to feed back the second secret result to the query node, so that the query node can determine the query result based on the second secret result and the determined first secret result.

[0058] This invention also provides a data query device, including a first memory and a first processor. The first memory stores a computer program that can run on the first processor. When the first processor executes the program, it implements the steps in the method on the query node side.

[0059] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a first processor, implements the steps of the method on the query node side.

[0060] This invention also provides a data query device, including a second memory and a second processor. The second memory stores a computer program that can run on the second processor. When the second processor executes the program, it implements the steps in the method on the cooperative node side.

[0061] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a second processor, implements the steps of the method on one side of the cooperative node.

[0062] In this embodiment of the invention, a encrypted computation file is determined based on the obtained query statement information. The encrypted computation file and a first set of local secret random numbers of the determined local data are sent to a cooperating node, and a first set of cooperating party secret random numbers is received from the cooperating node in response to the encrypted computation file. Based on the encrypted computation file, a first secret result is determined using a predicted second set of local secret random numbers and the first set of cooperating party secret random numbers, combined with a secret sharing format conversion strategy. The first and second sets of local secret random numbers are two sets of random numbers obtained by splitting the local data according to a predetermined secret sharing format. The second secret result is received from the cooperating node, and the query result is determined by combining the first and second secret results. The second secret result and the first set of cooperating party secret random numbers are determined by the cooperating node based on the encrypted computation file. Because this solution can determine the encrypted computation file using query statement information for data querying, the preparation time is short. Furthermore, the secret sharing format conversion strategy allows for mutual conversion between different secret sharing formats, improving computational efficiency and thus increasing the efficiency of determining the query result. Attached Figure Description

[0063] Figure 1 A schematic diagram of an optional flow of the data query method provided in an embodiment of the present invention;

[0064] Figure 2 This is an optional effect diagram of the data query method provided in an embodiment of the present invention;

[0065] Figure 3A schematic diagram of an optional flow of the data query method provided in an embodiment of the present invention;

[0066] Figure 4 A schematic diagram of an optional flow of the data query method provided in an embodiment of the present invention;

[0067] Figure 5 A schematic diagram of an optional flow of the data query method provided in an embodiment of the present invention;

[0068] Figure 6 This is an optional effect diagram of the data query method provided in an embodiment of the present invention;

[0069] Figure 7 A schematic diagram of an optional flow of the data query method provided in an embodiment of the present invention;

[0070] Figure 8 A schematic diagram of an optional flow of the data query method provided in an embodiment of the present invention;

[0071] Figure 9 A schematic diagram of an optional flow of the data query method provided in an embodiment of the present invention;

[0072] Figure 10 This is an interactive schematic diagram of the data query method provided in an embodiment of the present invention;

[0073] Figure 11 Schematic diagram of the data query device provided in the embodiments of the present invention Figure 1 ;

[0074] Figure 12 A hardware entity illustration of the data query device provided in an embodiment of the present invention. Figure 1 ;

[0075] Figure 13 Schematic diagram of the data query device provided in the embodiments of the present invention Figure 2 ;

[0076] Figure 14 A hardware entity illustration of the data query device provided in an embodiment of the present invention. Figure 2 . Detailed Implementation

[0077] Figure 1 This is an optional flowchart illustrating the data query method provided in an embodiment of the present invention, which will be combined with... Figure 1 The steps shown are explained.

[0078] S101. Based on the obtained query statement information, determine the encrypted calculation file.

[0079] In this embodiment of the invention, the query node determines the encrypted calculation file based on the obtained query statement information.

[0080] In this embodiment of the invention, the user first writes a query statement based on the data structure of the local data of the query node and the data structure of the collaborating data of the collaborating node. The data structure of the collaborating data is pre-acquired. The user inputs the query statement through the human-computer interaction device of the query node. The query node parses and compiles the query statement to obtain a encrypted computation file.

[0081] In this embodiment of the invention, the query statement information can be Structured Query Language (SQL). The encrypted computation file can be an executable file that can be processed by a Secure Multi-Party Computation (MPC) engine.

[0082] In this embodiment of the invention, the query node and the cooperating node can be a server, a terminal, or a mobile terminal.

[0083] In this embodiment of the invention, the user of the query node writes an SQL statement based on the data structure of publicly available local data and partner data, as well as the business query desired. The query node obtains the SQL statement, and its configured SQL parsing and compilation module parses the input SQL statement to form a corresponding token list (the token list includes: Join, Aggregate, and other token identifier objects). The query node combines this with a pre-written code template to generate the corresponding backend code, thereby forming a encrypted computation file.

[0084] S102. Send the encrypted calculation file and the first set of local secret random numbers of the determined local data to the cooperating node, and receive the first set of cooperating party secret random numbers fed back by the cooperating node in response to the encrypted calculation file.

[0085] In this embodiment of the invention, the query node sends the encrypted calculation file and the first set of local secret random numbers determined by the local data to the cooperating node, and receives the first set of cooperating party secret random numbers fed back by the cooperating node in response to the encrypted calculation file.

[0086] In this embodiment of the invention, the query node determines two sets of random numbers corresponding to the local data in a predetermined secret sharing format: a first set of local secret random numbers and a second set of local secret random numbers. The query node sends the encrypted calculation file and the first set of local secret random numbers to the cooperating node. The cooperating node determines the cooperating party's data in the database based on the encrypted calculation file, and determines the first set of cooperating party secret random numbers and the second set of cooperating party secret random numbers in a predetermined secret sharing format based on the cooperating party's data. The cooperating node sends the first set of secret random numbers to the query node.

[0087] In this embodiment of the invention, the predetermined secret sharing form can be any one of arithmetic sharing, Boolean sharing, and Yao's circuit.

[0088] For example, in combination Figure 2 The query node 100 obtains the SQL statement and uses the SQL parsing and compilation module 103 to generate a corresponding encrypted calculation file. Simultaneously, the query node extracts local data from the first database 104. The query node 100 reads and encrypts this local data to obtain a first set of local secret random numbers and a second set of local secret random numbers in a predetermined secret sharing format. The query node 100 sends the first set of local secret random numbers and the encrypted calculation file to the cooperating node 101. The cooperating node 101 parses the encrypted calculation file, extracts the cooperating party's data from the second database 105, and encrypts it to generate a first set of cooperating party secret random numbers and a second set of cooperating party secret random numbers. The cooperating node 101 sends the first set of cooperating party secret random numbers to the query node 100.

[0089] In this embodiment of the invention, the first set of local secret random numbers, the second set of local secret random numbers, the first set of partner secret random numbers, and the second set of partner secret random numbers can all be sets of numbers.

[0090] S103. Based on the encrypted calculation file, the first secret result is determined by using the known second set of local secret random numbers and the first set of collaborator secret random numbers, combined with the secret sharing form conversion strategy.

[0091] In this embodiment of the invention, the query node determines the first secret result based on the encrypted calculation file, using a known second set of local secret random numbers and a first set of collaborator secret random numbers, combined with a secret sharing format conversion strategy. The first and second sets of local secret random numbers are two sets of random numbers obtained by splitting local data according to a predetermined secret sharing format.

[0092] In this embodiment of the invention, the query node runs a encrypted computation file, using a second set of local secret random numbers and a first set of collaborator secret random numbers, combined with a conversion strategy between a predetermined secret sharing format and other secret sharing formats, to perform multiple computation operations to obtain a first secret result. In this embodiment, after each computation operation, the query node converts the result into a result matching the secret sharing format for the next computation operation, and then performs the next computation operation, until the final computation operation is performed to obtain the first secret result.

[0093] In this embodiment of the invention, multiple computational operations may include join operations and aggregate computational operations.

[0094] For example, in combination Figure 2 The query node 100 uses the first secure multi-party computation engine 106 to perform multiple computational operations on the second set of local secret random numbers and the first set of partner secret random numbers, combined with the conversion strategy of fixed secret sharing form and other secret sharing forms, to obtain the first secret result.

[0095] S104. Receive the second secret result fed back by the cooperating node, and combine the first secret result with the second secret result to determine the query result.

[0096] In this embodiment of the invention, the query node receives the second secret result fed back by the cooperating node, and determines the query result by combining the first secret result and the second secret result. The second secret result and the first set of cooperating party secret random numbers are determined by the cooperating node based on a ciphertext calculation file.

[0097] In this embodiment of the invention, combined with Figure 2 The cooperating node 101 uses the second secure multi-party computation engine 107 to perform multiple computational operations on the first set of local secret random numbers and the second set of cooperating party secret random numbers, combined with a predetermined secret sharing format and a conversion strategy with other secret sharing formats, to obtain a second secret result, and returns the result. The cooperating node 101 sends the second secret result to the query node 100. The query node 100 combines the first and second secret results to form an intermediate secret result, and decrypts the intermediate secret result to obtain the query result.

[0098] In this embodiment of the invention, the query node can decrypt the intermediate secret result in a corresponding manner according to the secret sharing format of the first secret result and the second secret result.

[0099] In this embodiment of the invention, the cooperating node runs a encrypted computation file, using a second set of collaborating party secret random numbers and a first set of local secret random numbers, combined with a conversion strategy between a predetermined secret sharing format and other secret sharing formats, to perform multiple computation operations to obtain a second secret result. In this embodiment, after each computation operation, the cooperating node converts the result into a result matching the secret sharing format for the next computation operation, and then performs the next computation operation, until the final computation operation is performed to obtain the second secret result.

[0100] In this embodiment of the invention, a encrypted computation file is determined based on the obtained query statement information. The encrypted computation file and a first set of local secret random numbers of the determined local data are sent to a cooperating node. The first set of cooperating party secret random numbers is received from the cooperating node in response to the encrypted computation file. Based on the encrypted computation file, a first secret result is determined using a predicted second set of local secret random numbers and the first set of cooperating party secret random numbers, combined with a secret sharing format conversion strategy. The first and second sets of local secret random numbers are two sets of random numbers obtained by splitting the local data according to a predetermined secret sharing format. The second secret result is received from the cooperating node, and the query result is determined by combining the first and second secret results. The second secret result and the first set of cooperating party secret random numbers are determined by the cooperating node based on the encrypted computation file. Because this solution can determine the encrypted computation file using query statement information for data querying, the preparation time is short. Furthermore, the secret sharing format conversion strategy allows for mutual conversion between different secret sharing formats, improving computational efficiency and thus increasing the efficiency of determining the query result.

[0101] In some embodiments, see Figure 3 , Figure 3 This is an optional flowchart illustrating the data query method provided in an embodiment of the present invention. Figure 1 The shown S101 can be implemented through S105-S108, which will be explained in conjunction with each step.

[0102] S105. Obtain query statement information; the query statement information is written by the user based on the data structure of the known local data and the partner data.

[0103] In this embodiment of the invention, the query node obtains query statement information. This query statement information is written by the user based on the data structure of known local data and partner data.

[0104] In this embodiment of the invention, the user writes query statements through the human-computer interaction device of the query node.

[0105] S106. The query statement information is parsed to form a query list; the query list includes: condition query identifier, query source data identifier, and multiple calculation operation identifiers.

[0106] In this embodiment of the invention, the query node generates a query list from the query statement information through syntax analysis. The query list includes: a conditional query identifier, a query source data identifier, and multiple computational operation identifiers.

[0107] In real time, the query node uses a parser to parse the obtained SQL statement into a query list.

[0108] S107. Determine the conditional query identifier, the query source data identifier, and multiple calculation operation identifiers, each with its corresponding preset code template.

[0109] In this embodiment of the invention, the query node determines the condition query identifier, the query source data identifier, and multiple calculation operation identifiers, each with its corresponding preset code template.

[0110] In this embodiment of the invention, the database of the query node stores code templates corresponding to various identifiers, and the query node determines the preset code template corresponding to each identifier in the query list from the database.

[0111] S108. Use a preset code template to convert the query list into query code, and then compile the query code into a encrypted calculation file.

[0112] In this embodiment of the invention, the query node uses a preset code template to convert the query list into query code, and then compiles the query code into a encrypted calculation file.

[0113] In this embodiment of the invention, the query node uses preset code templates corresponding to the conditional query identifier, the query source data identifier, and multiple computation operation identifiers to convert the query list into query code. The query node then uses a compiler to compile the query code into an encrypted computation file.

[0114] In this embodiment of the invention, the query node performs syntax analysis and compilation on the obtained query statement information to obtain a ciphertext calculation file, which can then be sent to the query node to obtain the query result. The preparation time is short, thereby improving the efficiency of determining the query result.

[0115] In some embodiments, see Figure 4 , Figure 4 This is an optional flowchart illustrating the data query method provided in an embodiment of the present invention. Figure 3 The steps S105-S108 shown can be implemented through S401-S407, which will be explained in conjunction with each step.

[0116] S401. Obtain query statement information.

[0117] In this embodiment of the invention, the query node obtains the conditional query statement information.

[0118] S402, Analysis.

[0119] S403, Query list.

[0120] In this embodiment of the invention, the query node parses the query statement information to obtain a query list, which includes tokens such as Join, Here, and Aggregate.

[0121] S404, Join templates, Agg templates, and other declaration templates.

[0122] In this embodiment of the invention, the query node determines the Join template, Agg template, and other declaration templates.

[0123] S405, backend code.

[0124] S406, Compile.

[0125] S407, encrypted calculation file.

[0126] In this embodiment of the invention, the query node uses a compiler to compile the determined backend code into a encrypted computation file.

[0127] In this embodiment of the invention, the user inputs a valid SQL query statement into the query node. The SQL parsing module of the query node parses the SQL query statement into a corresponding list of Tokens (identifiers or token objects such as Where, From, Aggregate, etc.). The query node matches the identifiers in the Token list with the corresponding code template to generate the corresponding code. For example:

[0128] The SQL query statement `Select RA.id from RA where RA.id = RB.id` contains the following pseudocode:

[0129] #Statement RA, RB

[0130] Relation::RA;RA.load_data(RA_data_path);

[0131] Relation::RB; RB.load_data(RB_data_path);

[0132] #RA Join RB, the result of SemiJoin, the relationship remains in RA.

[0133] RA.aggregate(RA.id); RB.aggregate(RB.id);

[0134] RA.join(RB,join_attribute=(RA.id,RB.id));

[0135] #Return results to the query

[0136] RA.revealToParty(A);

[0137] Finally, the query node compiles the generated C++ backend code through the compiler and generates the corresponding executable MPC file (i.e., the encrypted computation file), and executes the corresponding privacy data fusion query task in the MPC computation engine.

[0138] In some embodiments, see Figure 3 , Figure 3 This is an optional flowchart illustrating the data query method provided in an embodiment of the present invention. Figure 1 The implementation of S102 is preceded by S109-S110, which will be explained in conjunction with each step.

[0139] S109. Compile local data into multiple random numbers in the form of arithmetic sharing.

[0140] In this embodiment of the invention, the query node compiles local data into multiple random numbers in the form of arithmetic sharing.

[0141] S110. Divide multiple random numbers into two groups to obtain the first group of local secret random numbers and the second group of local secret random numbers.

[0142] In this embodiment of the invention, the query node divides multiple random numbers into two groups to obtain a first group of local secret random numbers and a second group of local secret random numbers.

[0143] In this embodiment of the invention, the query node can divide multiple random numbers into two groups on an average basis, or it can divide multiple random numbers into two groups according to a certain ratio.

[0144] In this embodiment of the invention, the query node processes local data into a first set of local secret random numbers and a second set of local secret random numbers in the form of arithmetic sharing, thereby ensuring confidentiality during the query process.

[0145] In some embodiments, see Figure 5 , Figure 5 This is an optional flowchart illustrating the data query method provided in an embodiment of the present invention. Figure 1S103 shown can be implemented through S111-S114, which will be explained in conjunction with each step.

[0146] S111. Run the encrypted calculation file and calculate the intersection of the second set of local secret random numbers and the first set of collaborator secret random numbers according to the predetermined attributes.

[0147] In this embodiment of the invention, the query node runs a ciphertext calculation file and calculates the intersection of the second set of local secret random numbers and the first set of collaborator secret random numbers according to predetermined attributes.

[0148] Among them, the pre-defined attributes are the data attributes contained in local data and partner data.

[0149] For example, the query node determines the intersection of random numbers with the same corresponding identification information from the second set of local secret random numbers and the first set of partner secret random numbers. Both local data and partner data have their own corresponding identification information, and the arrays in each set of secret random numbers also correspond to identification information.

[0150] In this embodiment of the invention, the query node performs a Privacy Set Intersection (PSI) calculation on the second set of local secret random numbers and the first set of collaborator secret random numbers. PSI is a privacy set intersection based on secret sharing, primarily used in Join operations to find the common set of candidate attributes for intersection between the second set of local secret random numbers and the first set of collaborator secret random numbers. PSI refers to obtaining the intersection of the data held by both parties without revealing any additional information. Here, additional information refers to any information other than the intersection of the data held by both parties. In secret-sharing-based PSI, the input data from both parties is in a secret-sharing form, and the result after intersection remains in a secret-sharing form. The PSI used in this patent is based on secret sharing.

[0151] Secret Sharing (SS) involves splitting a secret in an appropriate way, with each share managed by a different participant. A single participant cannot recover the secret information; only by working together can the secret message be recovered.

[0152] S112. Convert the random numbers in the intersection of random numbers into data in the form of Yao's circuit to obtain an intermediate data set.

[0153] In this embodiment of the invention, the query node converts the random numbers within the intersection of random numbers into data in the form of Yao's circuit to obtain an intermediate data set.

[0154] In this embodiment of the invention, the second set of local secret random numbers and the first set of collaborator secret random numbers are both secret random numbers in the form of arithmetic sharing. Furthermore, the intersection of these random numbers is also a secret random number in the form of arithmetic sharing. The query node first converts the random numbers within the intersection into data in the form of a Yao circuit to obtain an intermediate data set.

[0155] S113. Perform a join operation on the intermediate data set to obtain a first intermediate data set, and restore the number of data in the first intermediate data set to the number of data in the intermediate data set to obtain a second intermediate data set.

[0156] In this embodiment of the invention, the query node performs a join calculation operation on the intermediate data set to obtain a first intermediate data set, and restores the number of data in the first intermediate data set to the number of data in the intermediate data set to obtain a second intermediate data set.

[0157] The join operation is also known as the join operation.

[0158] In this embodiment of the invention, after the query node obtains the first intermediate data set, it performs an Oblivious Extended Permutation (OEP) on the first intermediate data. The extended permutation is a function f: {1, ..., m} - {1, ..., n} used to pass through b i =a f(i) This maps an n-element vector a to an m-element vector b. An inadvertently extended permutation function allows this mapping to be performed while protecting the privacy of a, b, and f within a secure multi-party computation protocol.

[0159] S114. Sort or remove duplicates from the second intermediate data set to obtain the first secret result.

[0160] In this embodiment of the invention, the second intermediate data set of the query node is sorted or deduplicated to obtain the first secret result.

[0161] Among them, sorting or deduplication operations are also known as Aggregate calculation operations.

[0162] For example, in combination Figure 6The query node retrieves the local data to be fused from the first database and shares it secretly. The collaborating node retrieves the collaborating data to be fused from the second database and shares it secretly. After the secret sharing, the local data and collaborating data undergo MPC encrypted computation on both the collaborating node and the query node, respectively, thus completing the privacy-preserving fusion query. During the computation, both parties deploy an MPC computation engine. Both engines execute the executable MPC backend code generated in the previous step. This backend code performs the specific MPC operations, such as Join and Aggregate operations.

[0163] Among them, the hybrid two-party secure multi-party computation framework (Arithmetic-Boolean-Yao, ABY) efficiently combines arithmetic sharing, Boolean sharing, and Yao's Garbled Circuits (GC) secure computation schemes, providing a best practice solution for secure two-party computation. In Oblivious Transfer (OT), the sender possesses some confidential information at the beginning of the protocol, and the receiver obtains part of this confidential information through a certain method after the protocol ends. The sender is unaware of which part of the confidential information the receiver has learned.

[0164] ABY offers three sharing methods:

[0165] Arithmetic sharing (A): Secret S = share_0 + share_1.

[0166] Boolean Share(B): Secret S = share_0 share_1.

[0167] Yao's circuit (Y): Secret S = LSB(share_0 share_1).

[0168] For both local and partner data, the secret sharing method used is arithmetic sharing:

[0169] The query node splits its local data and partner data into two separate secrets, share_0 and share_1 (random numbers):

[0170] Arithmetic sharing (A): Secret S = share_0 + share_1.

[0171] The query node randomly selects one copy of the multiple random numbers from its local data, keeps it locally, and sends the other copy to the cooperating node.

[0172] The query node will secretly share local data and partner data, using ABY as the underlying security protocol. ABY can switch between three methods—arithmetic sharing, Boolean sharing, and Yao's circuit—based on specific computational needs. The conversion forms include:

[0173] A2Y: Arithmetic Sharing → Yao's Circuit.

[0174] Y2B: Yao's circuit → Boolean sharing.

[0175] B2A: Boolean sharing → Arithmetic sharing.

[0176] B2Y:: Boolean sharing → Yao's circuit.

[0177] The query node is based on the ABY and OT protocols, and this method builds a PSI / OEP basic operator on top of it. The Join and Aggregation operations for privacy data fusion implemented by the query node are based on PSI, OEP, ABY, and other basic operators, where:

[0178] PSI: Privacy Set Intersection Based on Secret Sharing, mainly used in Join operations to find the common set of candidate attributes used for intersection from the first set of collaborator secret random numbers and the second set of local secret random numbers.

[0179] OEP (Optical Entry Point): Used for privacy protection of dataset size: ① In Aggregate operations, sorting and deduplication are often performed, and the size of the deduplicated dataset is generally smaller than the original dataset; ② In Join operations, the size of the returned intersection is generally smaller than the original data size; To prevent the specific information of the data from being deduced from the size of the dataset after the above operations, it is necessary to expand the intermediate results of Aggregate and Join to the size of the original data. In this embodiment of the invention, the query node uses the OEP method to map the intermediate results based on the secret sharing to the size of the original dataset, and the mapping result is also in the form of secret sharing.

[0180] In this embodiment of the invention, after the query node performs the join calculation operation, it restores the number of data in the first intermediate data set to the number of data in the intermediate data set, obtains the second intermediate data set, and then performs sorting or deduplication operations to obtain the first secret result. This can effectively prevent the data from being deciphered and improve data security.

[0181] In some embodiments, see Figure 7 , Figure 7 This is an optional flowchart illustrating the data query method provided in an embodiment of the present invention. Figure 1 The shown S103 can be implemented through S115, which will be explained in conjunction with each step.

[0182] S115. Run the encrypted calculation file, use the second set of local secret random numbers and the first set of collaborator secret random numbers, and combine the conversion strategy of secret sharing form to perform multiple calculation operations to obtain the first secret result.

[0183] In this embodiment of the invention, the query node runs a encrypted calculation file, uses a second set of local secret random numbers and a first set of collaborator secret random numbers, and combines a predetermined secret sharing format with a conversion strategy with other secret sharing formats to perform multiple calculation operations to obtain a first secret result.

[0184] In some embodiments, see Figure 8 , Figure 8 This is an optional flowchart illustrating the data query method provided in an embodiment of the present invention. Figure 7 The steps S115-S104 shown can be implemented through S116-S119, which will be explained in conjunction with each step.

[0185] S116. Perform the first calculation operation on the second set of local secret random numbers and the first set of collaborator secret random numbers, and convert the calculation result into a first set of random numbers in the form of secret sharing that matches the second calculation operation.

[0186] In this embodiment of the invention, the query node performs a first calculation operation on the second set of local secret random numbers and the first set of collaborator secret random numbers, and converts the calculation result into a first set of random numbers in the form of secret sharing that matches the second calculation operation.

[0187] The multiple computational operations include: k computational operations, where k is a positive integer greater than 1.

[0188] In this embodiment of the invention, if the secret sharing form matched by the second calculation operation is a Yao circuit, then the query node will convert the calculation result into a first random number set in the form of a Yao circuit.

[0189] S117. Perform the second calculation operation on the first random number set, and convert the calculation result into a second random number set in the secret sharing form matched by the third calculation operation, until the k-1 random number set is processed and the calculation operation is performed, and then stop to obtain the first secret result.

[0190] In this embodiment of the invention, the query node performs a second calculation operation on the first random number set and converts the calculation result into a second random number set in the secret sharing form matched by the third calculation operation, until the (k-1)th random number set is processed by the kth calculation operation, and then stops to obtain the first secret result.

[0191] S118. Combine the first secret result and the second secret result to obtain the intermediate secret result.

[0192] In this embodiment of the invention, the query node combines the first secret result and the second secret result to obtain the intermediate secret result.

[0193] S119. Decrypt the intermediate secret result to obtain the query result.

[0194] In this embodiment of the invention, the query node decrypts the intermediate secret result to obtain the query result.

[0195] In this embodiment of the invention, the query node decrypts the intermediate secret result according to the decryption method of the corresponding secret sharing form to obtain the query result.

[0196] In this embodiment of the invention, after each calculation operation, the query node converts the calculation result into data in the form of a secret sharing for the next calculation, thereby improving the efficiency of data query.

[0197] In some embodiments, see Figure 9 , Figure 9 This is an optional flowchart illustrating the data query method provided in an embodiment of the present invention, which will be explained in conjunction with each step.

[0198] S201. Receive the encrypted calculation file and the first set of local secret random numbers sent by the query node; the encrypted calculation file is determined by the query node based on the obtained query statement information.

[0199] In this embodiment of the invention, the cooperating node receives a ciphertext calculation file and a first set of local secret random numbers sent by the query node; the ciphertext calculation file is determined by the query node based on the obtained query statement information.

[0200] S202, Response encrypted calculation file, determine the first set of partner secret random numbers corresponding to the partner data, and feed back the first set of partner secret random numbers to the query node.

[0201] In this embodiment of the invention, the cooperating node responds to the encrypted calculation file, determines the first set of cooperating party secret random numbers corresponding to the cooperating party data, and feeds back the first set of cooperating party secret random numbers to the query node.

[0202] S203. Using the second set of secret random numbers from the collaborators and the first set of local secret random numbers, combined with the secret sharing format conversion strategy, the second secret result is determined.

[0203] In this embodiment of the invention, the cooperating node uses a second set of collaborator secret random numbers and a first set of local secret random numbers, combined with a secret sharing format conversion strategy, to determine the second secret result. The first set of collaborator secret random numbers and the second set of collaborator secret random numbers are two sets of random numbers obtained by splitting the collaborator data according to a predetermined secret sharing format.

[0204] S204. Feed back the second secret result to the query node, so that the query node can determine the query result based on the second secret result and the determined first secret result.

[0205] In this embodiment of the invention, the cooperating node feeds back the second secret result to the query node, so that the query node can determine the query result based on the second secret result and the determined first secret result.

[0206] This scheme can determine the encrypted calculation file by using query statement information, and perform data querying. The preparation time is short. Moreover, it uses a secret sharing form conversion strategy, which allows for mutual conversion between different secret sharing forms, thereby improving the calculation efficiency and thus improving the efficiency of determining the query results.

[0207] In some embodiments, Figure 9 The shown S202 can be implemented through S205-S206, which will be explained in conjunction with each step.

[0208] S205, Response encrypted calculation file, determine the partner data in the database.

[0209] In this embodiment of the invention, the cooperating node responds with a encrypted calculation file and determines the cooperating party's data in the database.

[0210] In this embodiment of the invention, the cooperating node parses the encrypted computation file to obtain a conditional query identifier and a query source data identifier. Based on the conditional query identifier and the query source data identifier, the cooperating node determines the cooperating party's data in the database according to preset program instructions.

[0211] S206. Determine the first set of secret random numbers for the partners based on the partner data.

[0212] In this embodiment of the invention, the cooperating node determines the first set of secret random numbers for the cooperating party based on the data of the cooperating party.

[0213] In this embodiment of the invention, the cooperating node compiles the cooperating party data into multiple cooperating party random numbers in the form of arithmetic sharing. These multiple cooperating party random numbers are divided into two groups to obtain a first group of secret cooperating party random numbers and a second group of secret cooperating party random numbers.

[0214] In this embodiment of the invention, the cooperating node determines the first set of secret random numbers of the cooperating party based on the encrypted calculation file. Since the encrypted calculation file is determined by the query node through the obtained query statement information, the preparation time is shortened, thereby improving the efficiency of determining the query data results.

[0215] In some embodiments, Figure 9The shown S203 can be implemented through S207-S208, which will be explained in conjunction with each step.

[0216] S207. Perform the first calculation operation on the second set of collaborator secret random numbers and the first set of local secret random numbers, and convert the calculation result into a set of first collaborator random numbers in the secret sharing form matched by the second calculation operation.

[0217] In this embodiment of the invention, the cooperating node performs a first calculation operation on the second set of cooperating party secret random numbers and the first set of local secret random numbers, and converts the calculation result into a first set of cooperating party random numbers in a secret sharing form that matches the second calculation operation.

[0218] S208. Perform the second calculation operation on the first partner's random number set, and convert the calculation result into the second partner's random number set in the secret sharing form matched by the third calculation operation, until the k-1th partner's random number set is performed and the calculation operation is stopped, and the second secret result is obtained.

[0219] In this embodiment of the invention, the cooperating node performs the second calculation operation on the first cooperating party's random number set, and converts the calculation result into the second cooperating party's random number set in the secret sharing form matched by the third calculation operation, until the k-1 cooperating party's random number set is performed and then the second secret result is obtained.

[0220] In some embodiments, Figure 9 The shown S203 can be implemented through S209-S212, which will be explained in conjunction with each step.

[0221] S209. Run the encrypted calculation file and calculate the intersection of the second group of collaborator secret random numbers and the first group of local secret random numbers according to the predetermined attributes.

[0222] In this embodiment of the invention, the cooperating node runs a encrypted computation file and calculates the intersection of the second set of cooperating party secret random numbers and the first set of local secret random numbers according to predetermined attributes.

[0223] S210. Convert the random numbers in the intersection of the random numbers of the collaborators into data in the form of Yao's circuit to obtain the intermediate data set of the collaborators.

[0224] In this embodiment of the invention, the cooperating node converts the random numbers within the intersection of the cooperating parties' random numbers into data in the form of Yao's circuit, thereby obtaining the intermediate data set of the cooperating parties.

[0225] S211. Perform a join operation on the intermediate data set of the collaborators to obtain the first intermediate data set of the collaborators, and restore the number of data in the first intermediate data set of the collaborators to the number of data in the intermediate data set of the collaborators to obtain the second intermediate data set of the collaborators.

[0226] In this embodiment of the invention, the cooperating node performs a connection calculation operation on the intermediate data set of the cooperating party to obtain a first intermediate data set of the cooperating party, and restores the number of data in the first intermediate data set of the cooperating party to the number of data in the intermediate data set of the cooperating party to obtain a second intermediate data set of the cooperating party.

[0227] S212. Sort or remove duplicates from the intermediate data set of the second partner to obtain the second secret result.

[0228] In this embodiment of the invention, the cooperating node sorts or removes duplicates from the intermediate data set of the second cooperating party to obtain the second secret result.

[0229] In some embodiments, see Figure 10 , Figure 10 This is an interactive schematic diagram of the data query method provided in the embodiments of the present invention, which will be explained in conjunction with each step.

[0230] S301. The query node determines the encrypted calculation file based on the obtained query statement information.

[0231] The detailed implementation of step S301 is the same as that of S101, and will not be repeated here.

[0232] S302. The query node sends the encrypted calculation file and the first set of local secret random numbers of the determined local data to the cooperating node, and receives the first set of cooperating party secret random numbers fed back by the cooperating node in response to the encrypted calculation file.

[0233] The detailed implementation of step S302 is the same as that of S102, and will not be repeated here.

[0234] S303. The query node calculates the first secret result based on the encrypted calculation file, using the known second set of local secret random numbers and the first set of collaborator secret random numbers, combined with the secret sharing form conversion strategy.

[0235] The detailed implementation of step S303 is the same as that of S103, and will not be repeated here.

[0236] S304. The query node receives the second secret result from the cooperating node, and determines the query result by combining the first secret result and the second secret result.

[0237] The detailed implementation of step S304 is the same as that of S104, and will not be repeated here.

[0238] See Figure 11 , Figure 11 Schematic diagram of the data query device provided in the embodiments of the present invention Figure 1 .

[0239] This invention also provides a data query device 800, applied to a query node, comprising: a determining unit 803 and a first receiving unit 804.

[0240] The determining unit 803 is used to determine the encrypted calculation file based on the obtained query statement information;

[0241] The first receiving unit 804 is used to send the encrypted calculation file and the first set of local secret random numbers of the determined local data to the cooperating node, and to receive the first set of cooperating party secret random numbers fed back by the cooperating node in response to the encrypted calculation file;

[0242] The determining unit 803 is further configured to determine the first secret result based on the encrypted calculation file by using a predicted second set of local secret random numbers and the first set of collaborator secret random numbers, combined with a secret sharing format conversion strategy; the first set of local secret random numbers and the second set of local secret random numbers are two sets of random numbers obtained by splitting the local data according to a predetermined secret sharing format;

[0243] The determining unit 804 is further configured to receive the second secret result fed back by the cooperating node, and combine the first secret result with the second secret result to determine the query result; the second secret result and the first set of cooperating party secret random numbers are determined by the cooperating node based on the encrypted calculation file.

[0244] In this embodiment of the invention, the determining unit 803 in the data query device 800 is used to form a query list by parsing the query statement information; the query list includes: a condition query identifier, a query source data identifier, and multiple calculation operation identifiers; the predetermined code templates corresponding to the condition query identifier, the query source data identifier, and the multiple calculation operation identifiers are determined; the query list is converted into query code using the predetermined code templates, and then the query code is compiled to form the encrypted calculation file.

[0245] In this embodiment of the invention, the data query device 800 is used to obtain the query statement information; the query statement information is written by the user based on the known data structure of the local data and the partner data.

[0246] In this embodiment of the invention, the predetermined secret sharing form includes: arithmetic sharing; the determining unit 803 in the data query device 800 is used to compile the local data into multiple random numbers in the form of arithmetic sharing; the multiple random numbers are divided into two groups to obtain the first group of local secret random numbers and the second group of local secret random numbers.

[0247] In this embodiment of the invention, the determining unit 803 in the data query device 800 is used to run the encrypted calculation file, calculate the intersection of the second set of local secret random numbers and the first set of collaborator secret random numbers according to a predetermined attribute; the predetermined attribute is the data attribute contained in the local data and the collaborator data; convert the random numbers in the intersection of the random numbers into data in Yao's circuit form to obtain an intermediate data set; perform a connection calculation operation on the intermediate data set to obtain a first intermediate data set, and restore the number of data in the first intermediate data set to the number of data in the intermediate data set to obtain a second intermediate data set; perform a sorting or deduplication operation on the second intermediate data set to obtain the first secret result.

[0248] In this embodiment of the invention, the determining unit 803 in the data query device 800 is used to run the encrypted calculation file, and use the second set of local secret random numbers and the first set of collaborator secret random numbers, combined with the secret sharing form conversion strategy, to perform multiple calculation operations to obtain the first secret result.

[0249] In this embodiment of the invention, the plurality of calculation operations include k calculation operations; k is a positive integer greater than 1; the determining unit 803 in the data query device 800 is used to perform a first calculation operation on the second set of local secret random numbers and the first set of partner secret random numbers, and convert the calculation result into a first set of random numbers in a secret sharing form matched by a second calculation operation; perform the second calculation operation on the first set of random numbers, and convert the calculation result into a second set of random numbers in a secret sharing form matched by a third calculation operation, until the k-1th set of random numbers is performed and the calculation operation stops, thus obtaining the first secret result.

[0250] In this embodiment of the invention, the determining unit 803 in the data query device 800 is used to combine the first secret result and the second secret result to obtain an intermediate secret result; and to decrypt the intermediate secret result to obtain the query result.

[0251] In this embodiment of the invention, the determining unit 803 determines the encrypted calculation file based on the acquired query statement information; the first receiving unit 804 sends the encrypted calculation file and the first set of local secret random numbers of the determined local data to the cooperating node, and receives the first set of cooperating party secret random numbers fed back by the cooperating node in response to the encrypted calculation file; the determining unit 803 determines the first secret result based on the encrypted calculation file, using the predicted second set of local secret random numbers and the first set of cooperating party secret random numbers, combined with a secret sharing form conversion strategy; the first set of local secret random numbers and the second set of local secret random numbers are two sets of random numbers obtained by splitting the local data according to a predetermined secret sharing form; the determining unit 803 receives the second secret result fed back by the cooperating node, and combines the first secret result and the second secret result to determine the query result; the second secret result and the first set of cooperating party secret random numbers are determined by the cooperating node based on the encrypted calculation file. This scheme can determine the encrypted calculation file by using query statement information, and perform data querying. The preparation time is short. Moreover, it uses a secret sharing form conversion strategy, which allows for mutual conversion between different secret sharing forms, thereby improving the calculation efficiency and thus improving the efficiency of determining the query results.

[0252] It should be noted that, in the embodiments of the present invention, if the above-described data query method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present invention, or the part that contributes to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a data query device (which may be a personal computer, etc.) to execute all or part of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a magnetic disk, or an optical disk. Thus, the embodiments of the present invention are not limited to any specific hardware and software combination.

[0253] Correspondingly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method.

[0254] Correspondingly, this embodiment of the invention provides a data query device, including a first memory 802 and a first processor 801. The first memory 802 stores a computer program that can run on the first processor 801. When the first processor 801 executes the program, it implements the steps in the above method.

[0255] It should be noted that the descriptions of the storage medium and device embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium and device embodiments of the present invention, please refer to the descriptions of the method embodiments of the present invention for understanding.

[0256] It should be noted that, Figure 12 A hardware entity illustration of the data query device provided in an embodiment of the present invention. Figure 1 ,like Figure 12 As shown, the hardware entity of the data query device 800 includes: a first processor 801 and a first memory 802, wherein;

[0257] The first processor 801 typically controls the overall operation of the data query device 800.

[0258] The first memory 802 is configured to store instructions and applications executable by the first processor 801, and can also cache data to be processed or already processed by the modules in the first processor 801 and the data query device 800 (e.g., image data, audio data, voice communication data and video communication data), which can be implemented by flash memory or random access memory (RAM).

[0259] See Figure 13 , Figure 13 Schematic diagram of the data query device provided in the embodiments of the present invention Figure 2 .

[0260] This invention also provides a data query device 900, applied to a cooperative node, comprising: a second receiving unit 903, a response unit 904, and a feedback unit 905.

[0261] The second receiving unit 903 is used to receive the encrypted calculation file and the first set of local secret random numbers sent by the query node; the encrypted calculation file is determined by the query node based on the obtained query statement information;

[0262] The response unit 904 is used to respond to the encrypted calculation file, determine the first set of secret random numbers of the collaborator corresponding to the collaborator data, and feed back the first set of secret random numbers of the collaborator to the query node;

[0263] The response unit 904 is further configured to determine the second secret result by combining the second set of partner secret random numbers and the first set of local secret random numbers with a secret sharing format conversion strategy; the first set of partner secret random numbers and the second set of partner secret random numbers are two sets of random numbers obtained by splitting the partner data according to the predetermined secret sharing format;

[0264] Feedback unit 905 is used to feed back the second secret result to the query node, so that the query node can determine the query result based on the second secret result and the determined first secret result.

[0265] In this embodiment of the invention, the response unit 904 in the data query device 900 is used to run the encrypted calculation file, determine the partner data in the database, and determine the first set of partner secret random numbers based on the partner data.

[0266] In this embodiment of the invention, the response unit 904 in the data query device 900 is used to parse the encrypted calculation file to obtain a conditional query identifier and a query source data identifier; based on the conditional query identifier and the query source data identifier, the data of the collaborator is determined in the database.

[0267] In this embodiment of the invention, the response unit 904 in the data query device 900 is used to compile the collaborator data into multiple collaborator random numbers in the form of the arithmetic sharing; and divide the multiple collaborator random numbers into two groups to obtain the first group of collaborator secret random numbers and the second group of collaborator secret random numbers.

[0268] In this embodiment of the invention, a second receiving unit 903 is used to receive a encrypted calculation file and a first set of local secret random numbers sent by a query node; the encrypted calculation file is determined by the query node based on the obtained query statement information; a response unit 904 is used to respond to the encrypted calculation file, determine the first set of partner secret random numbers corresponding to the partner data, and feed back the first set of partner secret random numbers to the query node; the response unit 904 is also used to determine a second secret result by using the second set of partner secret random numbers and the first set of local secret random numbers, combined with a secret sharing format conversion strategy; the first set of partner secret random numbers and the second set of partner secret random numbers are two sets of random numbers obtained by splitting the partner data according to the predetermined secret sharing format; a feedback unit 905 is used to feed back the second secret result to the query node, so that the query node can determine the query result based on the second secret result and the determined first secret result. Because this solution can determine the encrypted calculation file using query statement information for data querying, the preparation time is short, and the secret sharing format conversion strategy allows different secret sharing formats to interact with each other.

[0269] Correspondingly, this embodiment of the invention provides a data query device, including a second memory 902 and a second processor 901. The second memory 902 stores a computer program that can run on the second processor 901. When the second processor 901 executes the program, it implements the steps in the above method.

[0270] It should be noted that the descriptions of the storage medium and device embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium and device embodiments of the present invention, please refer to the descriptions of the method embodiments of the present invention for understanding.

[0271] It should be noted that, Figure 14 A hardware entity illustration of the data query device provided in an embodiment of the present invention. Figure 2 ,like Figure 14 As shown, the hardware entity of the data query device 900 includes: a second processor 901 and a second memory 902, wherein;

[0272] The second processor 901 typically controls the overall operation of the data query device 900.

[0273] The second memory 902 is configured to store instructions and applications executable by the second processor 901, and can also cache data to be processed or already processed by the modules in the second processor 901 and the data query device 900 (e.g., image data, audio data, voice communication data and video communication data), which can be implemented by flash memory or random access memory (RAM).

[0274] The above description is merely an embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A data query method, characterized by, The method is applied to a query node and comprises the following steps: determining a ciphertext calculation file based on obtained query statement information; sending the ciphertext calculation file and a first set of local secret random numbers of local data to a cooperative node, and receiving a first set of cooperative secret random numbers fed back by the cooperative node in response to the ciphertext calculation file; running the ciphertext calculation file, using a second set of local secret random numbers known in advance and the first set of cooperative secret random numbers, combining a predetermined secret sharing form and a conversion strategy of other secret sharing forms to perform a plurality of calculation operations, converting the result obtained after each calculation operation into a result matching the secret sharing form of the next calculation operation for the next calculation until a final calculation operation is performed to determine a first secret result; the first set of local secret random numbers and the second set of local secret random numbers are two sets of random numbers obtained by splitting the local data according to the predetermined secret sharing form; receiving a second secret result fed back by the cooperative node, combining the first secret result and the second secret result to determine a query result; the second secret result and the first set of cooperative secret random numbers are determined by the cooperative node based on the ciphertext calculation file.

2. The data query method of claim 1, wherein, The method further comprises the following steps before the step of determining the ciphertext calculation file based on the obtained query statement information: obtaining the query statement information; the query statement information is written by a user according to the data structure of the local data and the cooperative data known in advance. The predetermined secret sharing form comprises arithmetic sharing. The method further comprises the following steps before the step of sending the ciphertext calculation file and the first set of local secret random numbers of the local data to the cooperative node and receiving the first set of cooperative secret random numbers fed back by the cooperative node in response to the ciphertext calculation file:

3. The data query method of claim 1, wherein, compiling the local data into a plurality of random numbers in the form of the arithmetic sharing; dividing the plurality of random numbers into two sets to obtain the first set of local secret random numbers and the second set of local secret random numbers.

4. The data query method of claim 1, wherein, The method further comprises the following steps in the step of running the ciphertext calculation file, using the second set of local secret random numbers known in advance and the first set of cooperative secret random numbers, combining the predetermined secret sharing form and the conversion strategy of other secret sharing forms to perform the plurality of calculation operations, converting the result obtained after each calculation operation into the result matching the secret sharing form of the next calculation operation for the next calculation until the final calculation operation is performed to determine the first secret result: ​ ​ ​ 5. The data query method of claim 1, wherein, ​ running the ciphertext calculation file to obtain a random number intersection of the second set of local secret random numbers and the first set of partner secret random numbers according to a predetermined attribute; the predetermined attribute is an attribute of data contained in the local data and the partner data; converting random numbers in the random number intersection into data in the form of Yao's circuit to obtain an intermediate data set; performing a connection calculation operation on the intermediate data set to obtain a first intermediate data set, and restoring a number of data in the first intermediate data set to a number of data in the intermediate data set to obtain a second intermediate data set; performing a sorting or deduplication operation on the second intermediate data set to obtain the first secret result.

6. The data query method of claim 1, wherein, The plurality of calculation operations includes k calculation operations; k is a positive integer greater than 1; The plurality of calculation operations is performed by using the second set of local secret random numbers and the first set of partner secret random numbers in combination with a conversion strategy of a predetermined secret sharing form and other secret sharing forms, converting a result obtained after each calculation operation into a result matching a secret sharing form of a next calculation operation for the next calculation, until a last calculation operation is performed to determine the first secret result, including: performing a first calculation operation on the second set of local secret random numbers and the first set of partner secret random numbers, and converting a calculation result into a first random number set in a secret sharing form matching a second calculation operation; performing the second calculation operation on the first random number set, converting a calculation result into a second random number set in a secret sharing form matching a third calculation operation, and stopping after performing a kth calculation operation on a k-1th random number set to obtain the first secret result.

7. The data query method of any of claims 1-6, wherein, The second secret result fed back by the partner node is received, the first secret result and the second secret result are combined to determine a query result, including: combining the first secret result and the second secret result to obtain an intermediate secret result; decrypting the intermediate secret result to obtain the query result.

8. A data query method, characterized by, Applied to a partner node, including: receiving a ciphertext calculation file and a first set of local secret random numbers sent by a query node; the ciphertext calculation file is determined by the query node based on obtained query statement information; determining a first set of partner secret random numbers corresponding to partner data in response to the ciphertext calculation file, and feeding back the first set of partner secret random numbers to the query node; performing a plurality of calculation operations by using a second set of partner secret random numbers and the first set of local secret random numbers in combination with a secret sharing form conversion strategy, converting a result obtained after each calculation operation into a result matching a secret sharing form of a next calculation operation for the next calculation, until a last calculation operation is performed to determine a second secret result; the first set of partner secret random numbers and the second set of partner secret random numbers are two sets of random numbers obtained by splitting the partner data according to a predetermined secret sharing form. The second secret result is fed back to the query node, and the query node determines a query result according to the second secret result and a determined first secret result.

9. A data query apparatus, characterized by comprising: Applied to a query node, comprising: A determining unit is configured to determine a ciphertext calculation file based on obtained query statement information; A first receiving unit is configured to send the ciphertext calculation file and a first set of local secret random numbers of determined local data to a cooperative node, and receive a first set of partner secret random numbers fed back by the cooperative node in response to the ciphertext calculation file; The determining unit is further configured to run the ciphertext calculation file, utilize a second set of local secret random numbers and the first set of partner secret random numbers, combine a predetermined secret sharing form and a conversion strategy of other secret sharing forms to perform a plurality of calculation operations, convert a result obtained after each calculation operation into a result matched with a secret sharing form of a next calculation operation after each calculation operation, and perform the next calculation until a last calculation operation is performed to determine a first secret result; the first set of local secret random numbers and the second set of local secret random numbers are two sets of random numbers obtained by splitting the local data according to the predetermined secret sharing form; The determining unit is further configured to receive a second secret result fed back by the cooperative node, combine the first secret result and the second secret result to determine a query result; the second secret result and the first set of partner secret random numbers are determined by the cooperative node based on the ciphertext calculation file.

10. A data query apparatus, characterized by comprising: The computer program is executed by the first processor to implement the steps in the method of any one of claims 1-7.

11. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the first processor to implement the steps in the method of any one of claims 1-7.

Citation Information

Patent Citations

  • Data processing method and device and device for data processing

    CN112688779A

  • Digital data retention management

    US20150134619A1