Data processing method, device, medium, equipment and product for secure computing

By converting the data into binary difference values ​​in multi-party security calculations and performing logic and calculations, we can directly judge whether the data is equal, solving the problems of large traffic volume and low efficiency in the prior art, and achieving efficient data processing.

CN118282635BActive Publication Date: 2024-11-01BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410362127.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-27
Publication Date
2024-11-01
Estimated Expiration
2044-03-27

AI Technical Summary

Technical Problem

In multi-party security calculation, in the process of judging whether the two data are equal, the prior art has problems of large traffic volume and low efficiency, especially in the process of replication shard splitting and merging.

Method used

By converting the data into binary difference values, and generating calculated values ​​for each bit of the difference value, performing logic and operations, directly using the calculation results as judgment results, avoiding the split operation of copying shards and reducing Traffic.

Benefits of technology

While protecting private data, it greatly reduces data traffic and improves the processing efficiency of target data processing tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118282635B_ABST
    Figure CN118282635B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a data processing method, device, medium, equipment and product for secure computing. Secure computing is used for three participants to collaboratively determine whether the first data and the second data are equal. The method includes: collaboratively calculating the difference between the first data and the second data with other participants to obtain a replica of the difference; for the kth bit of the difference, based on the actual value of the first k+1 bits of the replica of the difference, generating a replica of the calculated value of the kth bit under preset conditions, the preset condition is that the first k bits of the preset difference are all 0; collaboratively performing a logical AND operation on the inverse of the calculated value of each bit of the difference with other participants to obtain a replica of the operation result, and using it as a replica of the result of the judgment of whether the first data and the second data are equal, and executing the target data processing task based on the replica of the judgment result. In this way, while protecting privacy data, the communication volume of equality judgment can be greatly reduced, and the processing efficiency of data processing tasks can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of secure multi-party computing, and in particular, to a data processing method, apparatus, medium, equipment and product for secure computing. Background Art

[0002] Secure multi-party computing is also called multi-party secure computing. Multiple parties can jointly calculate the result of a function without disclosing the input data of each party in the function. The result of the calculation is made public to one or more of the parties. Typical applications of secure multi-party computing include joint statistical analysis of multi-party data with privacy protection, machine learning, etc. The function here is a statistical operation function, a machine learning algorithm, etc.

[0003] In the process of multi-party secure computing, in order to prevent the disclosure of data and intermediate computing results of each party, the data or intermediate results can be held by each party in a shared form. A single party holds a data shard, and the shards held by each party are merged together to restore the corresponding data. Usually, the calculation is kept in a shared state. In this way, the number of data communications and the amount of communication in multi-party secure computing are important factors affecting the efficiency of secure computing. Summary of the invention

[0004] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0005] In a first aspect, the present disclosure provides a data processing method for secure computing, wherein the secure computing is used by three participants to collaboratively determine whether first data and second data are equal, wherein the first data and the second data are respectively in a replicated secret sharing form among the three participants, and the method is applied to a target participant, wherein the target participant is one of the three participants, and the method includes:

[0006] Collaboratively calculate the difference between the first data and the second data with other participants to obtain a replica shard of the difference, wherein the difference is an N-bit binary number;

[0007] For the kth bit of the difference, according to the actual value of the first k+1 bits of the replica of the difference, generate a replica of the calculated value of the kth bit under a preset condition, wherein the preset condition is that the first k bits of the difference are all 0, k=1, 2, ..., (N-1);

[0008] Cooperating with the other participants, performing a logical AND operation on the inverse of the calculated value of each bit of the difference to obtain a replica shard of the operation result, wherein the calculated value of the zeroth bit of the difference is the actual value of the zeroth bit of the difference;

[0009] The replicated slice of the operation result is used as the replicated slice of the judgment result, and the target data processing task is performed based on the replicated slice of the judgment result, wherein the judgment result is used to indicate whether the first data is equal to the second data.

[0010] In a second aspect, the present disclosure provides a data processing device for secure computing, wherein the secure computing is used by three participants to collaboratively determine whether first data and second data are equal, wherein the first data and the second data are respectively in a replicated secret sharing form among the three participants, and the device is applied to a target participant, wherein the target participant is one of the three participants, and the device comprises:

[0011] A first secure computing module, configured to collaboratively compute a difference between the first data and the second data with other participants to obtain a replica shard of the difference, wherein the difference is an N-bit binary number;

[0012] A generating module, for generating, for the kth bit of the difference, a replica of the calculated value of the kth bit under a preset condition according to the actual value of the first k+1 bits of the replica of the difference, wherein the preset condition is that the first k bits of the difference are all 0, k=1, 2, ..., (N-1);

[0013] A second secure computing module, configured to perform a logical AND operation on the inverse of the calculated value of each bit of the difference in collaboration with the other participants, to obtain a replica shard of the operation result, wherein the calculated value of the zeroth bit of the difference is the actual value of the zeroth bit of the difference;

[0014] An execution module is used to use the replica shard of the operation result as the replica shard of the judgment result, and execute the target data processing task based on the replica shard of the judgment result, wherein the judgment result is used to indicate whether the first data is equal to the second data.

[0015] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the data processing method for secure computing provided in the first aspect of the present disclosure.

[0016] In a fourth aspect, the present disclosure provides an electronic device, including:

[0017] a storage device having a computer program stored thereon;

[0018] A processing device is used to execute the computer program in the storage device to implement the steps of the data processing method for secure computing provided in the first aspect.

[0019] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the data processing method for secure computing provided in the first aspect of the present disclosure.

[0020] In the above technical scheme, when the three participants of the secure calculation jointly determine whether the first data and the second data are equal, the binary difference between the first data and the second data is first determined; then, each participant presets the right digital digit of each bit of the difference except the zeroth bit to be 0, and generates the calculated value of the bit under the preset condition; next, the three participants jointly perform a logical AND operation on the inverse of the calculated value of each bit of the difference, respectively obtain a copy of the operation result, and use the operation result as the judgment result of whether the first data and the second data are equal. Thus, the target data processing task can be executed according to the judgment result. In this way, the judgment problem of whether the first data and the second data are equal can be converted into a logical AND operation problem of multiple Boolean data without the need to perform the splitting operation of the copy shard, which saves the communication volume of the three participants when splitting the copy shard, thereby greatly reducing the data communication volume of the equality judgment while protecting the privacy data, and improving the processing efficiency of the target data processing task.

[0021] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:

[0023] Figure 1 The diagram is a schematic diagram showing a logic AND operation using a binary tree according to an exemplary embodiment.

[0024] Figure 2 The present invention is a flowchart of a data processing method for secure computing according to an exemplary embodiment.

[0025] Figure 3 is a data interaction diagram of a multiplication protocol based on replicated secret sharing according to an exemplary embodiment.

[0026] Figure 4The invention is a block diagram showing a data processing device for secure computing according to an exemplary embodiment.

[0027] Figure 5 The diagram is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0028] Before introducing the specific embodiments of the present disclosure, the terms involved in the present disclosure and the specific application scenarios of multi-party secure computing are first introduced and explained.

[0029] Ring: refers to a set that defines two operations, addition and multiplication, and forms a commutative group (i.e., Abelian group) for addition, a semigroup for multiplication for elements other than 0, and multiplication satisfies the distributive law for addition. Among them, common rings are as follows:

[0030] Integer Ring Among them, addition and multiplication refer to addition and multiplication in the usual sense;

[0031] Residual ring The ring of addition and multiplication is defined above, where addition is defined as integer addition modulo (mod) N, and multiplication is defined as integer multiplication mod N, where N is an integer greater than 1;

[0032] Polynomial ring: A polynomial ring over a ring R is a ring consisting of polynomials whose coefficients are in R, where algebraic operations are defined by multiplication and addition of polynomials;

[0033] A full matrix ring is a noncommutative ring with zero divisors consisting of matrices, where the set of all N-order matrices on the ring R is {[aij] N×N The ring formed by the addition and multiplication of matrices by |aij∈R} is called the full matrix ring on R, also known as the N-order matrix ring on R, denoted by R N or M N (R).

[0034] Secret Sharing is also called secret splitting or secret sharing. Its basic principle is to split a secret (such as a key, private data, etc.) into multiple shares and give them to different data parties for safekeeping. Only when parties exceeding a threshold number merge their shards can the secret be restored; Shares obtained from parties less than the threshold number cannot restore any information of the secret. In multi-party secure computing, the threshold number is usually the same as the number of participants, and the shares into which the secret is split can also be called shards.

[0035] Replicated Secret Sharing (RSS), also known as repetitive secret sharing, is an instance of secret sharing that ensures that secret values ​​are shared between multiple entities and remain secure when any of them fails or is attacked. In RSS, the original secret is split into multiple parts and distributed to multiple entities. Each entity has a partial replica of the original secret, and the original secret value can only be restored when at least a certain number of entities exist at the same time. In this way, if one of the entities fails or is attacked, the other entities can still restore the original secret value through the replicas they each hold.

[0036] For example, in a three-party secure computing scenario, using replicated secret sharing, a secret value s can be split into three secret shares (also called replicated shards) a, b, and c, so that s = (a+b+c) mod p (p is the size of the computing ring), where the first participant holds replicated shard a and replicated shard b, the second participant holds replicated shard b and replicated shard c, and the third participant holds replicated shard a and replicated shard c. Only when any two of the three participants merge their replicated shards can the secret value s be restored.

[0037] In practical applications, for the purpose of privacy protection, multi-party secure computing algorithms are usually black box algorithms, and the data transmission behavior between the computing nodes equipped with multi-party secure computing algorithms is opaque. As discussed in the background technology, typical applications of multi-party secure computing include machine learning, among which multi-party secure computing technology can be used to protect privacy data during the reasoning and training stages of machine learning, mainly involving the protection of model parameters and the protection of the data of each participant during the training process.

[0038] At present, common privacy-preserving machine learning solutions based on secure multi-party computing include: privacy-preserving machine learning protocols based on obfuscated circuits, oblivious transmission and other technologies, and executing secure multi-party computing protocols to complete nonlinear operation calculations such as activation functions. Based on secret sharing technology, multiple parties are allowed to participate in machine learning network model training or prediction, and the process will not disclose data or model information.

[0039] In addition to the above application areas, multi-party secure computing can also be applied to privacy-protected network security detection, joint statistical analysis of privacy-protected multi-party data, spam cleaning and filtering of encrypted emails, advertising conversion and other fields.

[0040] Among them, three-party secure computing is usually used for joint statistical analysis of two-party data with privacy protection, that is, to query across the two-party databases while protecting the private data of the two parties.

[0041] For example, consider the following Structure Query Language (SQL) statement:

[0042] select sum(if(a.sex=1,1,0))as man_num from a join b on a.id=b.id;

[0043] This SQL statement is used to align table a and table b according to the id column, and then count the number of males in the aligned table. The if conditional clause "if(a.sex=1,1,0)" is used to determine whether a.sex is equal to 1. Table a is stored in the first data owner, and table b is stored in the second data owner. The three participants (i.e., computing participants) perform SQL queries through three-party secure computing technology, and do not expose private data to each other. After the query is completed, only the query results are exposed to the query party. The computing participants can be data owners or not. When the computing participants are not data owners, the two data owners split the private data into replicated shards and distribute them to the three participants. The three participants use secure computing technology to determine whether a.sex is equal to 1, and perform SQL queries based on the judgment results, respectively obtain replicated shards of the query results, and feed back the replicated shards of the query results to the query party. The query party merges the three replicated shards of the query results to obtain the final query results.

[0044] The three parties usually use the following steps (a1) to (a5) to determine whether two data (including the first data and the second data) are equal, wherein the two data are stored in the form of arithmetic replication secret sharing in the three parties (i.e., party P0, party P1, and party P2), and the determination result of whether they are equal is stored in the form of Boolean replication secret sharing in the three parties:

[0045] Step (a1): The three parties collaboratively calculate the difference between the first data and the second data through secure computing, where the difference is an N-bit binary number, and the difference is stored in the form of arithmetic replication secret sharing among the three parties, the difference x = x0 + x1 + x2, party P0 holds the replica slices x0 and x1, party P1 holds the replica slices x1 and x2, and party P2 holds the replica slices x0 and x2, where the first data, the second data, x, x0, x1, x2∈R, and ring R is a ring N is greater than 1, that is, the value range of the first data, the second data, x, x0, x1, and x2 is [0, 2 N -1], x, x0, x1, x2 are all N-bit binary numbers.

[0046] Step (a2): Party P0 interacts with parties P1 and P2 to split x0+x1 into N-bit Boolean fragments y0,…,u N-1 , P1 splits -x2 into N-bit Boolean slices v0,…,v by interacting with P0 and P2. N-1 , where u0, ..., u N-1 , v0, …, v N-1 They are all held by the three parties in the form of Boolean replicated secret sharing.

[0047] Step (a3): The three participants perform bitwise XOR and inversion operations on the two Boolean slices to obtain It is an XOR operation.

[0048] Step (a4): The three participants securely calculate the result along the binary tree structure in, For logical AND operations, computing along the binary tree structure can increase parallelism and reduce communication rounds.

[0049] Step (a5): Return z.

[0050] In the above method, after obtaining the difference between the first data and the second data, the three participants determine whether the difference is equal to 0 (i.e., step (a2) to step (a4)). The communication volume involved is 9N-3 bits, and the communication round is The communication volume involved in step (a2) is 6N bits, and the communication round is 1; the communication volume involved in step (a4) is 3(N-1) bits, and the communication round is ; Step (a3) ​​does not require three-party communication interaction, and the communication volume is 0 bit.

[0051] Combine the following Figure 1 Detailed description of the three parties' safe calculation and judgment results along the binary tree structure Specific methods. Figure 1 As shown, we need to build a reference binary tree to put y0, ..., y N-1 Each of them corresponds to a leaf node of the reference binary tree. Adjacent leaf nodes are combined in pairs. The logical AND operation of every two adjacent leaf nodes is determined to be a first-level non-leaf node. For the j-th level non-leaf node, the adjacent j-1-th level non-leaf nodes are combined in pairs. The logical AND operation of every two adjacent j-1-th level non-leaf nodes is determined to be a j-th level non-leaf node.

[0052] Figure 1Take N=8 as an example, and calculate inductively from bottom to top layer by layer. The calculation of each layer can be executed in parallel. That is to say, the three participants can calculate in parallel first. The parallel computation process involves one round of interaction; after that, the three parties compute in parallel This parallel computation process involves one round of interaction; at the end, the computation The three participants need to interact for one more round. Therefore, during the entire calculation process, the number of rounds of interaction required by the three participants is the height of the reference binary tree, that is, .

[0053] in, Figure 1 Q 000 , Q 001 , Q 010 , Q 011 , Q 100 , Q 101 , Q 110 , Q 111 All are leaf nodes, corresponding to y0, y1, y2, y3, y4, y5, y6, and y7 respectively. 00 , Q 01 , Q 10 , Q 11 are all level 1 non-leaf nodes, and Corresponding to, Q0, Q1 are the second-level non-leaf nodes, and Corresponding to, Q is the third-level non-leaf node (i.e., the root node), and correspond.

[0054] Using the above method, the communication volume involved in the process of the three participants determining whether the difference between the first data and the second data is equal to 0 is 9N-3 bits, and the communication round is log2 N +1, it can be seen that when N is large, the three parties need to interact in more rounds and the communication overhead is also large.

[0055] In view of this, the present disclosure provides a data processing method, apparatus, medium, device and product for secure computing.

[0056] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0057] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0058] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0059] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0060] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0061] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0062] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0063] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's information. Thus, the user can autonomously choose whether to provide information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0064] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide information to the electronic device.

[0065] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0066] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions. Figure 2 FIG. 1 is a flow chart showing a data processing method for secure computing according to an exemplary embodiment. Figure 2 As shown, the above data processing method may include the following S101 to S104.

[0067] In S101, the difference between the first data and the second data is calculated in collaboration with other participants to obtain a replica fragment of the difference.

[0068] In the present disclosure, secure computing can be used by three participants to collaboratively determine whether the first data and the second data are equal. The first data and the second data are respectively shared in a copy secret form among the three participants, wherein the first data and the second data both belong to the N-power space of 2, that is, the value range of the first data and the second data is [0, 2 N -1]. It is understandable that the first data and the second data in the present disclosure may be any data that is not convenient for disclosure, and may include but is not limited to model parameters of a neural network model, etc. The method provided in the embodiment of the present disclosure can be applied to equal judgment operations in tasks such as data calculation, cleaning, analysis, model training, storage, and database query based on ciphertext.

[0069] The above data processing method can be applied to a target participant, wherein the target participant is any one of the above three participants. The above three participants can be called the first participant (i.e., the P0 party), the second participant (i.e., the P1 party), and the third participant (i.e., the P2 party). The present disclosure takes the application of the above data processing method to the first participant as an example for explanation, that is, the target participant in the above S101 is the first participant.

[0070] To determine whether the first data and the second data are equal is to determine whether the difference between the first data and the second data is equal to 0. Therefore, the present disclosure first calculates the difference between the first data and the second data. Since the first data and the second data constitute a copy secret sharing form among the three participants, the difference between the first data and the second data also constitutes a copy secret sharing form among the three participants. The difference belongs to the N-power space of 2, and the difference is an N-bit binary number.

[0071] The three parties use the three-party secure computing technology to collaboratively calculate the difference between the first data and the second data, and obtain two replicas of the difference. For example, the difference x = x0 + x1 + x2, P0 holds x0 and x1, P1 holds x1 and x2, and P2 holds x0.

[0072] In S102, for the kth bit of the difference, according to the actual value of the first k+1 bits of the copied slice of the difference, a copied slice of the calculated value of the kth bit under preset conditions is generated, and the preset condition is that the first k bits of the preset difference are all 0, k=1, 2,…, (N-1).

[0073] In the present disclosure, the first k bits of the preset difference are all 0, which means that it is assumed that the first k bits of the difference are all 0. The difference between the first data and the second data is an N-bit binary number. If and only if each bit of the difference is 0, the difference is equal to 0, which is equivalent to, if and only if the inverse value of the calculated value when the digital bit on the right side of the preset bit (that is, the first k bits of the difference) of each bit except the zeroth bit of the difference is 0 is 1, and the inverse value of the calculated value of the zeroth bit of the difference is 1, the difference is equal to 0. Among them, the inverse value of the calculated value refers to the inversion operation of the calculated value. For example, if the calculated value is 0, its inverse value is 1, and if the calculated value is 1, its inverse value is 0. That is, if and only if u 0 =1, When , the difference between the first data and the second data is 0, where The calculated value x of the zeroth digit of the difference 0 is the actual value of the zeroth bit (i.e. the lowest bit) of the difference. Thus, the problem of judging whether the difference is equal to 0 can be converted into a calculation The problem of determining whether the first data and the second data are equal is converted into a problem of logical AND operation of multiple Boolean data. The meaning is as follows: the first k bits of x are preset to be 0 (i.e., the 0th, 1st, 2nd, ..., k-1th bits of x are all 0, the lowest bit of x is the 0th bit, and the highest bit of x is the N-1th bit). If the kth bit of x calculated according to the preset condition is 0, that is, the calculated value of the kth bit of x is 0, then If the kth bit of x calculated according to the preset condition is 1, then

[0074] Specifically, in, x k is the calculated value of the kth digit of the difference x, c k is the carry from the first k bits to the kth bit, is the actual value of the kth bit of x0, is the actual value of the kth bit of x1, is the actual value of the kth bit of x2. Therefore, the calculation The problem is converted into the calculated value x of the kth digit of the difference x k problem, where k = 1, 2,…, (N-1).

[0075] Specifically, the target party generates a replica of the calculated value of the kth bit under preset conditions for the kth bit of the difference based on the actual values ​​of the first k+1 bits of the replica of the difference held by itself; at the same time, each of the other parties generates a replica of the calculated value of the kth bit under preset conditions for the kth bit of the difference based on the actual values ​​of the first k+1 bits of the replica of the difference held by itself.

[0076] For example, for the kth bit of the difference x, party P0 generates a calculated value x of the kth bit of the difference x under a preset condition based on the actual value of the first k+1 bits of the replica x0 of the difference held by itself and the actual value of the first k+1 bits of the replica x1. k The two replicas of x0 are the calculated values ​​of the kth bit. and the calculated value of the kth bit of x1 For the kth bit of the difference x, P1 generates the calculated value x of the kth bit of the difference x under the preset conditions based on the actual value of the first k+1 bits of the replica x1 of the difference held by itself and the actual value of the first k+1 bits of the replica x2. k The two replicas of x1 are the calculated values ​​of the kth bit. and the calculated value of the kth bit of x2 For the kth bit of the difference x, P2 generates the calculated value x of the kth bit of the difference x under the preset conditions based on the actual value of the first k+1 bits of the replica x0 of the difference held by itself and the actual value of the first k+1 bits of the replica x2. k The two replicas of x0 are the calculated values ​​of the kth bit. and the calculated value of the kth bit of x2

[0077] return Figure 2 In S103, cooperate with other participants to perform a logical AND operation on the inverse of the calculated value of each bit of the difference to obtain a copy of the operation result.

[0078] In S104, the replicated slice of the operation result is used as the replicated slice of the judgment result, and the target data processing task is performed based on the replicated slice of the judgment result, and the judgment result is used to indicate whether the first data is equal to the second data.

[0079] In the present disclosure, the three participants perform a logical AND operation on the inverse of the calculated value of each bit of the difference between the first data and the second data, and obtain two replica slices of the operation result respectively. After that, the operation result is stored in the form of a replica secret sharing among the three participants as a judgment result, that is, each participant holds two replica slices of the judgment result respectively. The three participants can share the replica slices of the judgment result held by each of them in a shared manner, and aggregate and merge the replica slices of the judgment result held by any two participants (that is, perform an XOR operation on the three replica slices of the judgment result) to obtain the judgment result.

[0080] The target data processing task may be a SQL query task, a machine learning network model training task, a machine learning network model prediction task, etc. When the target data processing task is a SQL query task, the target data processing task includes a SQL statement, wherein the structured query language statement includes an if conditional clause, and the if conditional clause is used to determine whether the first data is equal to the second data.

[0081] For example, the SQL statement in the target data processing task is select sum(if(a.sex=1,1,0))asman_num from a join b on a.id=b.id, where the if conditional clause is if(a.sex=1,1,0), the first data is a.sex, and the second data is 1.

[0082] In one embodiment, when the target data processing task is an SQL query task, each participant can execute the if conditional clause according to the replica shards of the judgment result held by itself to obtain the replica shards of the execution result, and then perform SQL query according to the replica shards of the execution result to obtain the replica shards of the query result, and then feed back the replica shards of the query result to the query party, which merges the three replica shards of the query result to obtain the final query result.

[0083] After obtaining the difference between the first data and the second data, when the three parties determine whether the difference is equal to 0, S102 does not require three-party communication interaction, and S103 is used to calculate the logical AND operation of N Boolean data. Therefore, the communication volume involved in the process of the three parties determining whether the difference is equal to 0 is the communication volume of calculating the logical AND operation of N Boolean data.

[0084] In the above technical scheme, when the three participants of the secure calculation jointly determine whether the first data and the second data are equal, the binary difference between the first data and the second data is first determined; then, each participant presets the right digital digit of each bit of the difference except the zeroth bit to be 0, and generates the calculated value of the bit under the preset condition; next, the three participants jointly perform a logical AND operation on the inverse of the calculated value of each bit of the difference, respectively obtain a copy of the operation result, and use the operation result as the judgment result of whether the first data and the second data are equal. Thus, the target data processing task can be executed according to the judgment result. In this way, the judgment problem of whether the first data and the second data are equal can be converted into a logical AND operation problem of multiple Boolean data without the need to perform the splitting operation of the copy shard, which saves the communication volume of the three participants when splitting the copy shard, thereby greatly reducing the data communication volume of the equality judgment while protecting the privacy data, and improving the processing efficiency of the target data processing task.

[0085] The following describes in detail a specific implementation method of collaboratively calculating the difference between the first data and the second data with other participants in the above S101 to obtain a replica shard of the difference.

[0086] Specifically, the target participant subtracts the two replica shards of the first data held by itself from the two replica shards of the second data held by itself, and obtains two replica shards of the difference between the first data and the second data. Similarly, other participants subtract the two replica shards of the first data held by themselves from the two replica shards of the second data held by themselves, and obtains two replica shards of the difference between the first data and the second data.

[0087] For example, party P0 holds two replica shards h0 and h1 of the first data h, and holds replica shards g0 and g1 of the second data g, then x0=h0-g0, x1=h1-g1; party P1 holds two replica shards h1 and h2 of the first data h, and holds two replica shards g1 and g2 of the second data g, then x1=h1-g1, x2=h2-g2; party P2 holds two replica shards h0 and h2 of the first data h, and holds two replica shards g0 and g2 of the second data g, then x0=h0-g0, x2=h2-g2.

[0088] The following is a detailed description of the specific implementation method of generating a replica of the calculated value of the kth bit under preset conditions according to the actual value of the first k+1 bits of the replica of the difference in S102. Specifically, it can be achieved by the following steps (21) and (22):

[0089] Step (21): Determine the carry from the first k bits to the kth bit based on the actual value of the first k bits of the replicated fragment of the difference.

[0090] In one embodiment, first, the calculated value of the first k bits of the first other replica slice under preset conditions can be determined based on the actual value of the first k bits of the replica slice of the difference; then, the carry from the first k bits to the kth bit is determined based on the actual value of the first k bits of the replica slice of the difference and the calculated value of the first k bits of the first other replica slice.

[0091] In the present disclosure, the first other replica shard is a replica shard not held by the target participant among all the replica shards of the difference. For example, the target participant is P0, and the two replica shards of the difference held by P0 are x0 and x1, respectively, and x2 is not held by P0. In this case, the first other replica shard is x2.

[0092] Specifically, the calculated values ​​of the first k bits of the first other replica shard under the preset conditions can be determined according to the actual values ​​of the first k bits of the replica shard of the difference in the following manner:

[0093] First, the first k bits of the two replica shards of the difference are added to obtain a first binary number; then, the first k bits of the first binary number are subtracted from the second binary number to obtain a third binary number, wherein the second binary number is a k+1-bit binary number, the first k bits of which are all 0, and the kth bit is 1; finally, the first k bits of the third binary number are determined as the calculated value of the first k bits of the first other replica shard under preset conditions.

[0094] For example, k=3, the first 3 bits of the two replica slices of the difference are 110 and 011 respectively. At this time, the second binary number is 1000. The first 3 bits of the two replica slices of the difference are added together, and the first binary number obtained is 1001. The first 3 bits of the first binary number (i.e., 001) are subtracted from the second binary number "1000", and the third binary number obtained is 0111. At this time, the first 3 bits of the third binary number can be determined as the calculated value of the first 3 bits of the first other replica slice under preset conditions, i.e., 111.

[0095] After obtaining the actual value of the first k bits of the replica fragment of the difference and the calculated value of the first k bits of the first other replica fragment, they are added together to obtain the carry from the first k bits to the kth bit.

[0096] For example, k=3, the calculated value of the first 3 bits of the first other copy fragment is 111, and the first 3 bits of the two copy fragments of the difference are 110 and 011 respectively. By adding these three values, we can get the carry from the first 3 bits to the third bit, that is, 2.

[0097] Step (22) determines the replica of the calculated value of the kth bit according to the actual value of the kth bit of the replica of the carry and the difference.

[0098] Specifically, the target participant can, for each replica of the difference held by itself, sum the actual value of the kth bit of the replica and the carry of the replica, modulo 2 the sum, and obtain a replica of the calculated value of the kth bit of the replica.

[0099] For example, the target participant is P0, and the two replica shards of the difference held by P0 are x0 and x1 respectively; for the replica shard x0, the actual value of the kth bit of the replica shard x0 can be and carry c k Sum, then modulo 2 the sum to get the calculated value x of the kth bit of the replica x0 k A replica of x0 (i.e., the calculated value of the kth bit of x0 ),Right now For the replica x1, the actual value of the kth bit of the replica x1 can be and carry c k Sum, then modulo 2 the sum to get the calculated value x of the kth bit of the replica x1 k Another replica of x1 (i.e., the calculated value of the kth bit of x1 ),Right now

[0100] The following is a detailed description of the specific implementation method of performing a logical AND operation on the inverse of the calculated value of each bit of the difference in collaboration with other participants in the above S103. Specifically, it can be implemented through a variety of implementation methods. In one implementation method, the three participants can perform a logical AND operation on the inverse of the calculated value of the zeroth bit of the difference and the inverse of the calculated value of the first bit of the difference to obtain a Boolean result 1, and this process involves one round of communication; then, perform a logical AND operation on the Boolean result 1 and the inverse of the calculated value of the second bit of the difference to obtain a Boolean result 2, and this process involves one round of communication; ...; perform a logical AND operation on the Boolean result N-2 and the inverse of the calculated value of the N-1th bit of the difference to obtain the operation result, and this process involves one round of communication. This process involves N-1 rounds of communication. At this time, the communication volume involved in the process of the three participants determining whether the difference is equal to 0 is 3(N-1) bits, and the number of communication rounds is N-1.

[0101] In another embodiment, in order to reduce the number of communication rounds, a logical AND operation of the inverse of the calculated value of each bit of the difference can be safely calculated along the binary tree structure. Specifically, this can be achieved by the following steps (31) and (32):

[0102] Step (31): Based on the replicated shards of the inverse of the calculated value of each bit of the difference, collaborate with other participants to build the target binary tree.

[0103] In the present disclosure, the target binary tree uses the inverse value of the calculated value of each bit of the difference as a leaf node, adjacent leaf nodes are combined in pairs, and the logical AND operation of every two adjacent leaf nodes is determined to be a first-level non-leaf node. For the j-th level non-leaf node, adjacent j-1-th level non-leaf nodes are combined in pairs, and the logical AND operation of every two adjacent j-1-th level non-leaf nodes is determined to be a j-th level non-leaf node.

[0104] Step (32): In order from bottom to top of the target binary tree, coordinate with other participants to calculate the logical AND operation of the inverse of the calculated value of each bit of the difference.

[0105] Since the specific implementation method of the logical AND operation of the inverse value of each bit of the difference value is calculated in collaboration with other participants in the bottom-up order of the target binary tree, it is similar to the above step (a4) in which the three participants safely calculate the judgment result along the binary tree structure. The method is similar and will not be repeated here.

[0106] At this time, the communication volume involved in the process of the three participants determining whether the difference is equal to 0 is 3(N-1) bits, and the communication round is

[0107] In the present disclosure, three participants can perform a logical AND operation on every two adjacent leaf nodes and a logical AND operation on every two adjacent j-1th level non-leaf nodes by calling a multiplication protocol based on replicated secret sharing. The multiplication protocol based on replicated secret sharing is as follows:

[0108] First, Pi square calculation i = 0, 1, 2, d and e are two Boolean data involved in the logical AND operation, and the two form a replicated secret sharing form among the three participants, among which Pi holds two replicated fragments of d, namely d i and d (i+1)mod 3 , and at the same time the two replica shards of e, namely e i and e (i+1)mod 3 .

[0109] Then, Pi square generates a random number r in modulo 2 space i , where r i satisfy

[0110] Next, Pi square calculation

[0111] Finally, Pi will l i Send to P (i-1)mod3 , so that P i We can obtain two replicas of the result of the logical AND operation of d and e, namely lo and l (i+1)mod 3 .

[0112] Specifically, if Figure 3 As shown, P0 square calculation And generate a random number r0, then calculate And send l0 to P2; P1 calculates And generate a random number r1, then calculate And l1 is sent to P0; P2 calculates And generate a random number r2, then calculate And send l2 to P1.

[0113] In the above multiplication protocol based on replicated secret sharing, the three participants need to send data once, namely l i , therefore, the communication amount involved is 3 bits.

[0114] In addition, after the three participants obtain the replicated shards of the judgment result respectively, they can obtain the final judgment result (i.e., the judgment result of whether the first data is equal to the second data) by aggregating them. Specifically, the above method can also include the following two steps:

[0115] Obtaining a second other replica shard of the judgment result held by any other participant;

[0116] The judgment result is determined based on all the replicated shards of the judgment result.

[0117] The second other replica shards are replica shards not held by the target participant among all the replica shards of the judgment result. After obtaining the three replica shards of the judgment result, the three replica shards of the judgment result can be XORed to obtain the judgment result. When the judgment result is 1, it indicates that the first data is equal to the second data; when the judgment result is 0, it indicates that the first data is not equal to the second data.

[0118] In addition to being executed by any one of the three participants, the above steps can also be executed by other electronic devices other than the above three participants. In this case, the other electronic device obtains three copy slices of the judgment result from any two of the three participants, and then performs XOR operation on the three copy slices to obtain the judgment result.

[0119] Figure 4 The invention is a block diagram showing a data processing device for secure computing according to an exemplary embodiment.

[0120] The secure calculation is used by three participants to collaboratively determine whether the first data and the second data are equal, the first data and the second data are respectively in the form of duplicate secret sharing by the three participants, and the device is applied to the target participant, which is one of the three participants, such as Figure 4 As shown, the device 200 includes:

[0121] A first secure computing module 201 is configured to collaboratively compute a difference between the first data and the second data with other participants to obtain a replica of the difference, wherein the difference is an N-bit binary number;

[0122] A generating module 202 is used to generate, for the kth bit of the difference, a replica of the calculated value of the kth bit under a preset condition according to the actual value of the first k+1 bits of the replica of the difference, wherein the preset condition is that the first k bits of the difference are all 0, k=1, 2, ..., (N-1);

[0123] The second secure calculation module 203 is used to cooperate with the other participants to perform a logical AND operation on the inverse of the calculated value of each bit of the difference to obtain a replica of the operation result, wherein the calculated value of the zeroth bit of the difference is the actual value of the zeroth bit of the difference;

[0124] The execution module 204 is used to use the replica shard of the operation result as the replica shard of the judgment result, and execute the target data processing task based on the replica shard of the judgment result, wherein the judgment result is used to indicate whether the first data is equal to the second data.

[0125] In the above technical scheme, when the three participants of the secure calculation jointly determine whether the first data and the second data are equal, the binary difference between the first data and the second data is first determined; then, each participant presets the right digital digit of each bit of the difference except the zeroth bit to be 0, and generates the calculated value of the bit under the preset condition; next, the three participants jointly perform a logical AND operation on the inverse of the calculated value of each bit of the difference, respectively obtain a copy of the operation result, and use the operation result as the judgment result of whether the first data and the second data are equal. Thus, the target data processing task can be executed according to the judgment result. In this way, the judgment problem of whether the first data and the second data are equal can be converted into a logical AND operation problem of multiple Boolean data without the need to perform the splitting operation of the copy shard, which saves the communication volume of the three participants when splitting the copy shard, thereby greatly reducing the data communication volume of the equality judgment while protecting the privacy data, and improving the processing efficiency of the target data processing task.

[0126] Optionally, the generating module 202 includes:

[0127] A first determination submodule, configured to determine a carry from the first k bits to the kth bit according to actual values ​​of the first k bits of the replica slice of the difference;

[0128] The second determining submodule is used to determine the replica fragment of the calculated value at the kth bit according to the carry and the actual value of the kth bit of the replica fragment of the difference.

[0129] Optionally, the first determining submodule includes:

[0130] A third determination submodule is configured to determine, according to the actual value of the first k bits of the replica shard of the difference, a calculated value of the first k bits of the first other replica shard under the preset condition, wherein the first other replica shard is a replica shard that is not held by the target participant among all the replica shards of the difference;

[0131] The fourth determination submodule is used to determine the carry from the first k bits to the kth bit according to the actual value of the first k bits of the replica fragment of the difference and the calculated value of the first k bits of the first other replica fragment.

[0132] Optionally, the second determination submodule is used to, for each replica slice of the difference, sum the actual value of the kth bit of the replica slice with the carry, modulo 2 the sum, and obtain a replica slice of the calculated value of the kth bit of the replica slice.

[0133] Optionally, the second security calculation module 203 includes:

[0134] A construction submodule is used to collaboratively construct a target binary tree with the other participants based on the replicated shards of the inverse value of the calculated value of each bit of the difference, wherein the target binary tree uses the inverse value of the calculated value of each bit of the difference as a leaf node, adjacent leaf nodes are combined in pairs, and the logical AND operation of every two adjacent leaf nodes is determined to be a first-level non-leaf node, and for the j-th level non-leaf node, adjacent j-1-th level non-leaf nodes are combined in pairs, and the logical AND operation of every two adjacent j-1-th level non-leaf nodes is determined to be a j-th level non-leaf node,

[0135] The operation submodule is used to coordinate with the other participants to calculate the logical AND operation of the inverse value of the calculated value of each bit of the difference in a bottom-up order of the target binary tree.

[0136] Optionally, the device 200 further includes:

[0137] An acquisition module, used for acquiring a second other replica shard of the judgment result held by any of the other participants, wherein the second other replica shard is a replica shard that is not held by the target participant among all the replica shards of the judgment result;

[0138] A determination module is used to determine the judgment result according to all the replica shards of the judgment result.

[0139] Optionally, the target data processing task includes a structured query language statement, wherein the structured query language statement includes an if conditional clause, and the if conditional clause is used to determine whether the first data is equal to the second data.

[0140] The present disclosure also provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the above-mentioned data processing method for secure computing provided by the present disclosure.

[0141] The present disclosure also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned data processing method for secure computing provided by the present disclosure.

[0142] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device (such as a terminal device or a server) 600 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0143] like Figure 5 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0144] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0145] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0146] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0147] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0148] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0149] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: cooperates with other participants to calculate the difference between the first data and the second data to obtain a replica of the difference, wherein the difference is an N-bit binary number; for the kth bit of the difference, according to the actual value of the first k+1 bits of the replica of the difference, generates a replica of the calculated value of the kth bit under preset conditions, wherein the preset condition is that the first k bits of the difference are all preset to be 0, k=1,2,…,(N-1); cooperates with the other participants to perform a logical AND operation on the inverse of the calculated value of each bit of the difference to obtain a replica of the operation result, wherein the calculated value of the zeroth bit of the difference is the actual value of the zeroth bit of the difference; uses the replica of the operation result as the replica of the judgment result, and performs the target data processing task based on the replica of the judgment result, wherein the judgment result is used to characterize whether the first data is equal to the second data.

[0150] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0151] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0152] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of the module does not limit the module itself in some cases. For example, the acquisition module may also be described as "a module for acquiring the second other replica shard of the judgment result held by any of the other participants".

[0153] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0154] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0155] According to one or more embodiments of the present disclosure, Example 1 provides a data processing method for secure computing, wherein the secure computing is used by three participants to collaboratively determine whether first data and second data are equal, wherein the first data and the second data respectively constitute a replicated secret sharing form in the three participants, and the method is applied to a target participant, wherein the target participant is one of the three participants, and the method includes:

[0156] Collaboratively calculate the difference between the first data and the second data with other participants to obtain a replica shard of the difference, wherein the difference is an N-bit binary number;

[0157] For the kth bit of the difference, according to the actual value of the first k+1 bits of the replica of the difference, generate a replica of the calculated value of the kth bit under a preset condition, wherein the preset condition is that the first k bits of the difference are all 0, k=1, 2, ..., (N-1);

[0158] Cooperating with the other participants, performing a logical AND operation on the inverse of the calculated value of each bit of the difference to obtain a replica shard of the operation result, wherein the calculated value of the zeroth bit of the difference is the actual value of the zeroth bit of the difference;

[0159] The replicated slice of the operation result is used as the replicated slice of the judgment result, and the target data processing task is performed based on the replicated slice of the judgment result, wherein the judgment result is used to indicate whether the first data is equal to the second data.

[0160] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein generating a replica of the calculated value of the kth bit under a preset condition according to the actual value of the first k+1 bits of the replica of the difference includes:

[0161] Determine, according to actual values ​​of first k bits of the replicated fragment of the difference, a carry from the first k bits to the kth bit;

[0162] The replicated fragment of the calculated value at the kth bit is determined according to the carry and the actual value of the kth bit of the replicated fragment of the difference.

[0163] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 2, wherein determining the carry from the first k bits to the kth bit according to the actual value of the first k bits of the replica fragment of the difference includes:

[0164] Determine, according to the actual value of the first k bits of the replica shard of the difference, the calculated value of the first k bits of the first other replica shard under the preset condition, wherein the first other replica shard is a replica shard that is not held by the target participant among all the replica shards of the difference;

[0165] According to the actual value of the first k bits of the replicated fragment of the difference and the calculated value of the first k bits of the first other replicated fragment, a carry from the first k bits to the kth bit is determined.

[0166] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 2, wherein determining the replica fragment of the calculated value of the kth bit according to the carry and the actual value of the kth bit of the replica fragment of the difference value includes:

[0167] For each replica slice of the difference, the actual value of the k-th bit of the replica slice is summed with the carry, and the sum is modulo 2 to obtain a replica slice of the calculated value of the k-th bit of the replica slice.

[0168] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 1, wherein the step of performing a logical AND operation on the inverse of the calculated value of each bit of the difference in collaboration with the other participants includes:

[0169] According to the replicated shards of the inverse value of the calculated value of each bit of the difference, a target binary tree is constructed in collaboration with the other participants, wherein the target binary tree uses the inverse value of the calculated value of each bit of the difference as a leaf node, adjacent leaf nodes are combined in pairs, and the logical AND operation of every two adjacent leaf nodes is determined to be a first-level non-leaf node, and for the j-th level non-leaf node, adjacent j-1-th level non-leaf nodes are combined in pairs, and the logical AND operation of every two adjacent j-1-th level non-leaf nodes is determined to be a j-th level non-leaf node,

[0170] In a bottom-up order of the target binary tree, the logical AND operation of the inverse of the calculated value of each bit of the difference is calculated in collaboration with the other participants.

[0171] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 1, wherein the method further includes:

[0172] Acquire a second other replica shard of the judgment result held by any of the other participants, wherein the second other replica shard is a replica shard that is not held by the target participant among all the replica shards of the judgment result;

[0173] The judgment result is determined according to all the replicated fragments of the judgment result.

[0174] According to one or more embodiments of the present disclosure, Example 7 provides the method described in any one of Examples 1-6, wherein the target data processing task includes a structured query language statement, wherein the structured query language statement includes an if conditional clause, and the if conditional clause is used to determine whether the first data is equal to the second data.

[0175] According to one or more embodiments of the present disclosure, Example 8 provides a data processing device for secure computing, wherein the secure computing is used by three participants to collaboratively determine whether first data and second data are equal, wherein the first data and the second data are respectively in a replicated secret sharing form in the three participants, and the device is applied to a target participant, wherein the target participant is one of the three participants, and the device includes:

[0176] A first secure computing module, configured to collaboratively compute a difference between the first data and the second data with other participants to obtain a replica shard of the difference, wherein the difference is an N-bit binary number;

[0177] A generating module, for generating, for the kth bit of the difference, a replica of the calculated value of the kth bit under a preset condition according to the actual value of the first k+1 bits of the replica of the difference, wherein the preset condition is that the first k bits of the difference are all 0, k=1, 2, ..., (N-1);

[0178] A second secure computing module, configured to perform a logical AND operation on the inverse of the calculated value of each bit of the difference in collaboration with the other participants, to obtain a replica shard of the operation result, wherein the calculated value of the zeroth bit of the difference is the actual value of the zeroth bit of the difference;

[0179] An execution module is used to use the replica shard of the operation result as the replica shard of the judgment result, and execute the target data processing task based on the replica shard of the judgment result, wherein the judgment result is used to indicate whether the first data is equal to the second data.

[0180] According to one or more embodiments of the present disclosure, Example 9 provides a computer-readable medium having a computer program stored thereon, which implements the steps of any of the methods described in Examples 1-7 when executed by a processing device.

[0181] According to one or more embodiments of the present disclosure, Example 10 provides an electronic device, including:

[0182] a storage device having a computer program stored thereon;

[0183] A processing device is used to execute the computer program in the storage device to implement the steps of any one of the methods described in Examples 1-7.

[0184] According to one or more embodiments of the present disclosure, Example 11 provides a computer program product, including a computer program, which implements the steps of any one of the methods of Examples 1-7 when executed by a processor.

[0185] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0186] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0187] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims

1. A data processing method for secure computing, wherein the secure computing is used by three participants to collaboratively determine whether first data and second data are equal, wherein the first data and the second data are respectively in a duplicate secret sharing form among the three participants, characterized in that: The method is applied to a target participant, where the target participant is one of the three participants, and comprises: Collaboratively calculate the difference between the first data and the second data with other participants to obtain a replica shard of the difference, wherein the difference is an N-bit binary number; For the kth bit of the difference, according to the actual value of the first k+1 bits of the replica of the difference, generate a replica of the calculated value of the kth bit under a preset condition, wherein the preset condition is that the first k bits of the difference are all 0, k=1, 2, ..., (N-1); Cooperating with the other participants, performing a logical AND operation on the inverse of the calculated value of each bit of the difference to obtain a replica shard of the operation result, wherein the calculated value of the zeroth bit of the difference is the actual value of the zeroth bit of the difference; The replicated slice of the operation result is used as the replicated slice of the judgment result, and the target data processing task is performed based on the replicated slice of the judgment result, wherein the judgment result is used to indicate whether the first data is equal to the second data.

2. The method according to claim 1, characterized in that The step of generating a replica of the calculated value of the kth bit under a preset condition according to the actual value of the first k+1 bits of the replica of the difference comprises: Determine, according to actual values ​​of first k bits of the replicated fragment of the difference, a carry from the first k bits to the kth bit; The replicated fragment of the calculated value at the kth bit is determined according to the carry and the actual value of the kth bit of the replicated fragment of the difference.

3. The method according to claim 2, characterized in that The determining, according to actual values ​​of first k bits of the replicated fragment of the difference, a carry from the first k bits to the kth bit, comprises: Determine, according to the actual value of the first k bits of the replica shard of the difference, the calculated value of the first k bits of the first other replica shard under the preset condition, wherein the first other replica shard is a replica shard that is not held by the target participant among all the replica shards of the difference; According to the actual value of the first k bits of the replicated fragment of the difference and the calculated value of the first k bits of the first other replicated fragment, a carry from the first k bits to the kth bit is determined.

4. The method according to claim 2, characterized in that: The determining the replica of the calculated value at the kth bit according to the carry and the actual value of the kth bit of the replica of the difference value comprises: For each replica slice of the difference, the actual value of the k-th bit of the replica slice is summed with the carry, and the sum is modulo 2 to obtain a replica slice of the calculated value of the k-th bit of the replica slice.

5. The method according to claim 1, characterized in that: The step of performing a logical AND operation on the inverse of the calculated value of each bit of the difference in collaboration with the other participants includes: According to the replicated shards of the inverse value of the calculated value of each bit of the difference, a target binary tree is constructed in collaboration with the other participants, wherein the target binary tree uses the inverse value of the calculated value of each bit of the difference as a leaf node, adjacent leaf nodes are combined in pairs, and the logical AND operation of every two adjacent leaf nodes is determined to be a first-level non-leaf node, and for the j-th level non-leaf node, adjacent j-1-th level non-leaf nodes are combined in pairs, and the logical AND operation of every two adjacent j-1-th level non-leaf nodes is determined to be a j-th level non-leaf node, j=2,3,…,log2 N ; In a bottom-up order of the target binary tree, the logical AND operation of the inverse of the calculated value of each bit of the difference is calculated in collaboration with the other participants.

6. The method according to claim 1, characterized in that The method further comprises: Acquire a second other replica shard of the judgment result held by any of the other participants, wherein the second other replica shard is a replica shard that is not held by the target participant among all the replica shards of the judgment result; The judgment result is determined according to all the replicated fragments of the judgment result.

7. The method according to any one of claims 1 to 6, characterized in that The target data processing task includes a structured query language statement, wherein the structured query language statement includes an if conditional clause, and the if conditional clause is used to determine whether the first data is equal to the second data.

8. A data processing device for secure computing, wherein the secure computing is used by three participants to collaboratively determine whether first data and second data are equal, wherein the first data and the second data are respectively in a duplicate secret sharing form among the three participants, characterized in that: The device is applied to a target participant, the target participant is one of the three participants, and the device includes: A first secure computing module, configured to collaboratively compute a difference between the first data and the second data with other participants to obtain a replica shard of the difference, wherein the difference is an N-bit binary number; A generating module, for generating, for the kth bit of the difference, a replica of the calculated value of the kth bit under a preset condition according to the actual value of the first k+1 bits of the replica of the difference, wherein the preset condition is that the first k bits of the difference are all 0, k=1, 2, ..., (N-1); A second secure computing module, configured to perform a logical AND operation on the inverse of the calculated value of each bit of the difference in collaboration with the other participants, to obtain a replica shard of the operation result, wherein the calculated value of the zeroth bit of the difference is the actual value of the zeroth bit of the difference; An execution module is used to use the replica shard of the operation result as the replica shard of the judgment result, and execute the target data processing task based on the replica shard of the judgment result, wherein the judgment result is used to indicate whether the first data is equal to the second data.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processing device, the steps of the method described in any one of claims 1 to 7 are implemented.

10. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.