WO2023020216A1 - 多方安全确定最值的方法、装置、设备及存储介质 - Google Patents

多方安全确定最值的方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2023020216A1
WO2023020216A1 PCT/CN2022/108090 CN2022108090W WO2023020216A1 WO 2023020216 A1 WO2023020216 A1 WO 2023020216A1 CN 2022108090 W CN2022108090 W CN 2022108090W WO 2023020216 A1 WO2023020216 A1 WO 2023020216A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
data
node device
node data
average value
Prior art date
Application number
PCT/CN2022/108090
Other languages
English (en)
French (fr)
Inventor
程勇
蒋杰
刘舒
刘煜宏
陈鹏
陶阳宇
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to JP2023566958A priority Critical patent/JP2024515332A/ja
Publication of WO2023020216A1 publication Critical patent/WO2023020216A1/zh
Priority to US18/314,419 priority patent/US20230283461A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • G06F7/588Random number generators, i.e. based on natural stochastic processes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/14Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/46Secure multiparty computation, e.g. millionaire problem

Definitions

  • the embodiment of the present application relates to the field of data security technology, and in particular to the technology of multi-party security determination of the maximum value.
  • Multi-party secure computing can realize safe data cooperation and fusion applications, and combine multi-party data sources for calculation, analysis, and learning under the premise that data does not leave the domain and is legal and compliant, so as to realize data value sharing.
  • multi-party security calculation to determine the maximum value means that at least two participants have different data, and they need to compare the size of their respective data to calculate the maximum or minimum value.
  • Multi-party data size comparison methods are usually implemented based on Oblivious Transfer (OT) technology or homomorphic encryption technology.
  • the size comparison method based on inadvertent transmission has low computational complexity, it only supports data comparison between two parties. If it is extended to multi-party scenarios, it needs to perform more communication interactions, which has high communication overhead and low efficiency. It is not suitable for The application scenario of cross-public network communication; the size comparison method based on homomorphic encryption technology has high computational complexity and low practical application value.
  • Embodiments of the present application provide a method, device, device, and storage medium for multi-party security determination of the maximum value, which can reduce the computational complexity and communication overhead of multi-party security determination of the maximum value.
  • the technical scheme is as follows.
  • the embodiment of the present application provides a method for multi-party safe determination of the maximum value, the method is executed by the i-th node device in the joint computing system, the joint computing system includes n node devices, n is greater than 2 Integer, i is a positive integer less than or equal to n, and the method includes:
  • the t-th average value obtained by the t-th round of joint calculation is calculated based on n node data and average coefficients of n node devices, and the n node data includes m valid node data, and The average coefficient decreases with the increase of the number of joint calculation rounds, t is a positive integer less than n-1, m is a positive integer less than or equal to n;
  • the t+1 round of joint calculation is performed based on the effective node data of the i-th node device; if the effective node of the i-th node device If the data is less than or equal to the t-th average value, the t+1-th round of joint calculation is performed based on the invalid node data;
  • the effective node data of the i-th node device is greater than or equal to the n-1th average value, it is determined that the effective node data of the i-th node device is the most valued.
  • the embodiment of the present application provides a device for multi-party security determination of the maximum value, the device includes:
  • the first obtaining module is used to obtain the t-th average value obtained by the joint calculation of the t-th round; the t-th average value is calculated based on n node data and average coefficients of n node devices, and the n node data includes m effective node data, and the average coefficient decreases with the increase of the number of joint calculation rounds, t is a positive integer less than n-1, m is a positive integer less than or equal to n;
  • the first calculation module is configured to perform the t+1th round of joint calculation based on the effective node data of the i-th node device if the effective node data of the i-th node device is greater than the t-th average value;
  • the second calculation module is used to perform the t+1 round of joint calculation based on the invalid node data if the valid node data of the i-th node device is less than or equal to the t-th average value;
  • the first determination module is used for after the n-1th round of joint calculation, if the effective node data of the i-th node device is greater than or equal to the n-1th average value, then determine that the effective node data of the i-th node device is best value.
  • an embodiment of the present application provides a computer device, the computer device includes a processor and a memory; at least one instruction, at least one program, code set or instruction set are stored in the memory, and the at least one instruction , the at least one section of program, the code set or instruction set is loaded and executed by the processor to implement the method for multi-party security determination of the most value as described in the above aspect.
  • an embodiment of the present application provides a computer-readable storage medium, where at least one computer program is stored in the computer-readable storage medium, and the computer program is loaded and executed by a processor to implement the above aspects.
  • a computer program product or computer program comprising computer instructions stored in a computer readable storage medium.
  • the processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method for multi-party security determination of the most value provided in various optional implementation manners of the above aspect.
  • the average value of data corresponding to n node devices is calculated, and each node device can determine that its own data is not the most optimal when its own data is less than the average value value, and when it is less than or equal to the average value, replace valid node data with invalid node data to participate in the next round of average calculation, so that the average value of the joint calculation can converge, that is, gradually approach the maximum value, and then in the n-1th round
  • the result obtained can effectively solve the problem of multi-party secure calculation of the maximum value, and the node device does not need to disclose private data and the size relationship between each data.
  • the method of multi-party secure calculation of the mean value it does not involve encryption and decryption operations, computational complexity and communication. The overhead is small and the calculation efficiency can be improved.
  • Figure 1 is a schematic diagram of the implementation environment provided by the embodiment of the present application.
  • Fig. 2 is a flow chart of the method for multi-party security determination of the most value provided by the embodiment of the present application;
  • Fig. 3 is a flow chart of the method for multi-party security determination of the most value provided by the embodiment of the present application
  • Fig. 4 is a flow chart of the method for multi-party security determination of the most value provided by the embodiment of the present application.
  • Fig. 5 is a flow chart of the method for multi-party security determination of the most value provided by the embodiment of the present application.
  • Fig. 6 is a schematic diagram of the average value of the three-party security calculation provided by the embodiment of the present application.
  • Fig. 7 is a flow chart of the method for multi-party security determination of the most value provided by the embodiment of the present application.
  • Fig. 8 is a schematic diagram of the average value of the three-party security calculation provided by the embodiment of the present application.
  • Fig. 9 is a flow chart of the method for multi-party security determination of the most value provided by the embodiment of the present application.
  • Figure 10 is a schematic diagram of the three-party security determination of the maximum value provided by the embodiment of the present application.
  • Fig. 11 is a flow chart of the method for multi-party security determination of the most value provided by the embodiment of the present application.
  • Figure 12 is a schematic diagram of the three-party security determination of the maximum value provided by the embodiment of the present application.
  • Fig. 13 is a schematic diagram of multi-layer device group division provided by the embodiment of the present application.
  • Figure 14 is a flow chart of the method for multi-party security determination of the most value provided by the embodiment of the present application.
  • Figure 15 is a structural block diagram of the device for multi-party security determination of the most value provided by the embodiment of the present application.
  • Fig. 16 is a structural block diagram of a computer device provided by an embodiment of the present application.
  • Multi-party secure computing means that there are n participants P 1 , P 2 , ..., P n , among which, participant P i owns the input data Xi, and does not disclose its own input data to any other participants, and does not With the assistance of any trusted organization, the n participants jointly calculate a function f(X 1 , X 2 , . . . , X n ).
  • Multi-party secure computing has a rich theoretical foundation. Through the application of cryptography (such as homomorphic encryption), secret sharing, differential privacy and other security mechanisms to ensure the security of input data, it has begun to enter engineering and large-scale applications from the theoretical research stage. landing stage.
  • Secret sharing is a cryptographic technology that divides and stores secrets. The purpose is to prevent the secrets from being too concentrated, so as to achieve the purpose of dispersing risks and tolerating intrusions. It is an important means in information security and data confidentiality.
  • the idea of secret sharing is to split the secret in an appropriate way. After splitting, each share is managed by different participants. A single participant cannot recover the secret information, and only several participants can cooperate to recover the secret information. What's more, when any of the corresponding in-scope participants fail, the secret can still be fully recovered.
  • Multi-party secure computing can realize safe data cooperation and fusion applications. Under the premise that the data does not leave the domain and is legal and compliant, it combines multi-party data sources for calculation, analysis, and learning to realize data value sharing. In related technologies, solutions for implementing multi-party secure computing usually have problems such as high computational complexity and high communication overhead.
  • the embodiment of the present application proposes a semi-honest security model.
  • the semi-honest security model also known as the honest-but-curious security model, means that both parties A and B will strictly abide by the agreement of data size comparison and equality test, and will not maliciously deviate from the agreement, nor Will maliciously or actively attack the other party, but the participants will try to obtain more information during the execution of the agreement.
  • FIG. 1 shows a block diagram of a joint computing system provided by an embodiment of the present application.
  • the joint computing system includes n node devices (also referred to as participants), namely node devices P 1 , node devices P 2 , . . . , node devices P n , where n is an integer greater than 2.
  • Any node device can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or it can provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud Cloud servers for basic cloud computing services such as communications, middleware services, domain name services, security services, content delivery network (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
  • any two node devices have different data sources, such as data sources of different companies, or data sources of different departments of the same company. Different data are stored in different node devices. Different node devices are connected through a wireless network or a wired network.
  • node devices each store their own data, and the data cannot be leaked.
  • each node device first performs multi-party security averaging, and then compares the size relationship between its own data and the average value, and determines that it is not the maximum value when its own data is smaller than the average value , after clarifying the calculation of the "eliminated" data in this round, replace the "eliminated" data with invalid node data (for example, replace it with 0) to participate in the average calculation of the next round, and since there is at least one node after each round of calculation
  • the data of the equipment will be "eliminated", so when controlling the calculation of the average value, the average coefficient will decrease with the increase of the number of rounds of joint calculation, so that the calculation of the average value will converge, and gradually "eliminate" the data that is not the most valuable. In this process, the data of each participant will not be leaked, and the number of interactions is small, and there is no need
  • multiple node devices in the above-mentioned joint computing system can form a block chain, and the node devices are nodes on the block chain, and the data involved in the process of multi-party security determination of the most value Can be stored on the blockchain.
  • Fig. 2 shows a flowchart of a multi-party secure computing method provided by an exemplary embodiment of the present application.
  • the method is executed by the ith node device in the joint computing system as an example.
  • the joint computing system includes n node devices, n is an integer greater than 2, and i is a positive integer less than or equal to n.
  • the method Including the following steps.
  • Step 201 obtain the t-th average value obtained from the t-th round of joint calculation.
  • the t-th average value is calculated based on the n node data and the average coefficient of n node devices.
  • the n node data includes m effective node data, and the average coefficient decreases with the increase of the number of joint calculation rounds.
  • t is less than A positive integer of n-1, m is a positive integer less than or equal to n.
  • Each node device of the joint computing system first performs multi-party security averaging, and then compares the size relationship between its own data and the average value (here is a plaintext comparison), and when its own data is less than the average value, it is determined that it is not the most value, and this round of calculation is clarified After being "eliminated” (that is, less than or equal to the average value) data, replace the "eliminated” data with invalid node data (replaced with 0) to participate in the next round of average calculation, because after each round of joint calculation there are at least The data of a node device will be "eliminated", so the average coefficient (that is, the denominator of the average value calculation) decreases as the number of rounds of joint calculation increases when controlling the average value calculation, so that the calculation of the average value converges, so that the gradual "elimination" is not the most value The data.
  • the joint computing system performs multi-party security calculations based on the node data of n node devices and the average coefficient, and obtains the t-th average value of the current round, that is, the t-th round of joint computing, wherein the n node data Including valid node data that was not eliminated in the last round, and invalid node data, where the valid node data is the real value of the data owned by the node device, and the invalid node data is used to replace the valid node data that is less than or equal to the average value before the t-th round of joint calculation , for example, the invalid node data is 0, which means that the corresponding node device does not participate in the subsequent average calculation.
  • At least one valid node data of the node device is less than or equal to the t-th average value, that is, at least one valid node data is replaced with invalid node data.
  • each The node device can only know whether its own data is eliminated, but cannot know the data that is actually eliminated after this round of calculation (that is, how many valid node data are actually smaller than the average value), so the average coefficient is set to (n+1-t), Starting from the second round, at least one piece of data is eliminated in each round of mean calculation, and the average coefficient decreases round by round to ensure that there are only at most two valid node data in the n-1 round.
  • Step 202 if the effective node data of the i-th node device is greater than the t-th average value, perform the t+1 round of joint calculation based on the effective node data of the i-th node device.
  • the effective node data of the i-th node device is greater than the t-th average value, indicating that the effective node data may be the most valued, so the i-th node device can continue to carry out the next round (that is, the t+1th round) of association based on its effective node data Calculate until it is eliminated, that is, until its effective node data is less than or equal to the average value of a certain round, or determined to be the most value.
  • Step 203 if the valid node data of the i-th node device is less than or equal to the t-th average value, perform the t+1 round of joint calculation based on the invalid node data.
  • the i-th node device When the effective node data of the i-th node device is less than or equal to the t-th average value, the i-th node device will replace the valid node data with invalid node data for the next round of average value calculation.
  • the i-th node device can determine that the effective node data is not the highest value, and then only needs to participate in the average value calculation based on the invalid node data, without the need for size comparison; and when the effective node data of the i-th node device is equal to the t-th average value, there may be a situation where the data is the most valued and the effective node data of other node devices is also the most valued, that is, there are at least two nodes that have In the case where the data are equal and the largest, in order to make the average value calculation converge and avoid the situation where the average value is greater than the maximum value (because the average coefficient decreases round by round), so when the effective node data of the i-th node device is equal to the t-th average value, The i-th node device also replaces valid node data with invalid node data for the next round of average calculation, but size comparison
  • Step 204 after the n-1th round of joint calculation, if the effective node data of the i-th node device is greater than or equal to the n-1th average value, determine that the i-th node device's effective node data is the most valued.
  • the effective node data of the i-th node device is greater than the average value in the previous (n-2) rounds, and greater than or equal to (equal to the case where there are 2 equal maximum values) in the (n-1)th round ( n-1) average value, the effective node data is the most value.
  • the average value of the data corresponding to n node devices is calculated, and each node device can determine that its own data is not the best value when it is less than the average value by comparing its own data with the current round average value. Value, and when it is less than or equal to the average value, replace valid node data with invalid node data for the next round of average calculation, so that the average value can converge, that is, gradually approach the maximum value, and then get the maximum value in the n-1th round Determining the result can effectively solve the problem of multi-party secure calculation of the maximum value, and the node device does not need to disclose private data and the size relationship between each data. Based on the method of multi-party secure calculation of the mean value, it does not involve encryption and decryption operations, computational complexity and communication The overhead is small and the calculation efficiency can be improved.
  • Fig. 3 shows a flowchart of a multi-party secure computing method provided by another exemplary embodiment of the present application.
  • the method is executed by the ith node device in the joint computing system as an example.
  • the joint computing system includes n node devices, n is an integer greater than 2, and i is a positive integer less than or equal to n.
  • the method Including the following steps.
  • Step 301 obtain the t-th average value obtained from the t-th round of joint calculation.
  • Step 302 if the effective node data of the i-th node device is greater than the t-th average value, perform t+1 round of joint calculation based on the effective node data of the i-th node device.
  • steps 301 to 302 For specific implementation manners of steps 301 to 302, reference may be made to the foregoing steps 201 to 202, and details are not repeated in this embodiment of the present application.
  • Step 303 if the valid node data of the i-th node device is less than the t-th average value, perform the t+1 round of joint calculation based on the invalid node data, and determine that the valid node data corresponding to the i-th node device is not the most valued.
  • the effective node data of the i-th node device is less than the t-th average value, which means that there are other node devices whose effective node data is greater than the effective node data of the i-th node device in the joint calculation process of this round, so In this step, it can be determined that the valid data of the i-th node device is not the most valuable.
  • the i-th node device In the average calculation of each subsequent round, the i-th node device only needs to participate in the calculation based on the invalid node data, and the valid node data does not participate in the calculation, and there is no need to compare with the average value.
  • Step 304 if the valid node data of the i-th node device is equal to the t-th average value, perform the t+1-th round of joint calculation based on the invalid node data, and determine the best value based on the relationship between the t+1-th average value and the invalid node data value.
  • the effective node data of the i-th node device is equal to the t-th average value, which means that there are two possibilities in the calculation process of this round.
  • the effective node data of other node devices is greater than the effective node data of the i-th node device, and the effective node data of other node devices is smaller than the effective node data of the i-th node device.
  • the i-th node device s
  • the valid node data is not the most valued, for example, the average value of the data "1, 2, 3" in the first round is 2; the other is that the valid node data of the i-th node device is the most valued, and there may be other node devices
  • the valid node data is also the most valued, for example, the average value of the data "1, 1, 3, 3" in the first round is 2, and the second round is calculated based on "0, 0, 3, 3" and the average coefficient 3 to obtain The average is 3. Therefore, it cannot be directly determined that the effective node data of the i-th node device is not the most valued, and it is necessary to continue the joint calculation and compare it with the average value.
  • Step 304 includes the following steps.
  • Step 304a if the t+1th average value is greater than the invalid node data, it is determined that the valid node data corresponding to the i-th node device is not the most valued.
  • the i-th node device After the i-th node device performs the (t+1) round of joint calculation based on the invalid node data (the invalid node data is 0 in the embodiment of the present application), if the (t+1) average value is greater than the invalid node data, it means that the ( In the t+1) round of calculation, there are effective node data that "win" (that is, greater than the t-th average value) in the t-th round, corresponding to the first possibility above, so it can be determined that the effective node data of the i-th node device is not best value.
  • the average value of the first round is 2.
  • the node device whose effective node data is 2 cannot determine whether there are other node devices whose effective node data is greater than 2.
  • the second round Based on "0, 0, 0, 3" and the average coefficient 3, the average value is 1, which is greater than the invalid node data 0.
  • Step 304b if the t+1th average value is equal to the invalid node data, and t+1 is n-1, then determine that the valid node data corresponding to the i-th node device is the highest value.
  • the i-th node device After the i-th node device performs the (t+1) round of joint calculation based on the invalid node data, if the (t+1) average value is equal to the invalid node data, and (t+1) is (n-1), that is, the last Round calculation means that there is no valid node data at the end, that is, the maximum value in the valid node data has been replaced by invalid node data, so the valid node data equal to the average value in the previous round is the maximum value.
  • Step 304c if the t+1th average value is equal to the invalid node data, and t+1 is smaller than n-1, then determine the maximum value based on the relationship between the invalid node data and the average value obtained through subsequent joint calculation.
  • the effective node data of the i-th node device when the effective node data of the i-th node device is equal to the t-th average value, and t is equal to (n-1), that is, the last round of calculation, the effective node data of the i-th node device can be directly determined Node data is the most valuable, and node devices no longer perform joint calculations.
  • Fig. 4 shows a flow chart of size comparison and maximum value determination based on the average value
  • t is the number of rounds of joint calculation
  • M t-1 is the (t-1)th average value obtained by the joint calculation of the (t-1) round
  • M t is the t-th average value obtained by the joint calculation of the t-th round
  • X k is valid node data of the kth node device.
  • Step 305 after the n-1 round of joint calculation, if the effective node data of the i-th node device is greater than or equal to the n-1-th average value, determine that the i-th node device's effective node data is the maximum value.
  • step 305 For the specific implementation manner of step 305, reference may be made to the foregoing step 203, and details are not repeated here in this embodiment of the present application.
  • the node device judges whether the valid node data is the most value by comparing the valid node data with the t-th average value, and replaces the valid node data with Carry out subsequent joint calculations for the invalid node data, and when the valid node data is equal to the t-th average value, continue to compare the invalid node data with the subsequent average value, which can not only ensure the convergence of the average value calculation, but also avoid the possibility of omission The maximum value of , to ensure the reliability of the calculation of the maximum value.
  • Fig. 5 shows a flowchart of a multi-party secure computing method provided by another exemplary embodiment of the present application.
  • the joint computing system includes n node devices, n is an integer greater than 2, and i is a positive integer less than or equal to n.
  • the first node device refers to a node device used to generate the first random number, and any one of the n node devices can be used as the first node device to perform mean value calculation.
  • the method includes the following steps.
  • Step 501 generating a first random number.
  • the first node device After the current round of joint calculation starts, the first node device first generates the first random number R 1 .
  • the first random number R 1 is a positive number.
  • Step 502 sending the first data sum to the second node device.
  • the first data sum is the sum of the first random number and the first node data
  • the second node device is used to calculate the second data sum, and sends the second data sum to the third node device
  • the second data sum is the first data The sum of the sum and the second node data, wherein the jth node data is valid node data or invalid node data of the jth node device, and j is a positive integer less than or equal to n.
  • the first node device P 1 After the first node device P 1 generates the first random number R 1 , it sends the first data sum (R 1 +X 1 ) to the second node device P 2 .
  • the second node device P 2 After receiving the first data sum (R 1 +X 1 ) , the second node device P 2 calculates the second data sum (R 1 +X 1 ) based on the first data sum (R 1 +X 1 ) and the second node data X 2 1 +X 2 ), and send the second data sum (R 1 +X 1 +X 2 ) to the third node device, and so on, and finally the nth node device will send the nth data sum (R 1 +X 1 +X 2 +...+X n ) is sent to the first node device.
  • Step 503 receiving the nth data sum sent by the nth node device.
  • Step 504 determine the t-th average value based on the n-th data sum and the first random number.
  • the first node device P1 After the first node device P1 receives the nth data sum (R 1 +X 1 +X 2 +...+X n ) sent by the nth node device, it calculates the node data sum (R 1 +X 1 +X 2 +...+ X n -R 1 ), that is, to obtain the sum of n node data, so as to determine the t-th average value based on the average coefficient (n+1-t) on the basis of completing the sum of n squares.
  • the first node device can send the t-th average value or the summation result of the nth party (X 1 +X 2 +...+X n ) to each other node device, or, the first node device A node device sends the t-th average value or the summation result of n squares (X 1 +X 2 +...+X n ) to the second node device, and the second node device sends it to the third node device, and so on until The nth node device receives the tth average value or the summation result (X 1 +X 2 + . . . +X n ) of the nth party.
  • This embodiment of the present application does not limit it.
  • the order of sending data and the start and end positions can be determined by the n node devices through negotiation, and the order can be changed, that is, the average value calculation is performed as the first node device in turn, so as to further improve data security.
  • Step 505 if the effective node data of the i-th node device is greater than the t-th average value, perform the t+1 round of joint calculation based on the effective node data of the i-th node device.
  • Step 506 if the valid node data of the i-th node device is less than or equal to the t-th average value, perform the t+1 round of joint calculation based on the invalid node data.
  • Step 507 after the n-1th round of joint calculation, if the valid node data of the i-th node device is greater than or equal to the n-1th average value, determine that the i-th node device's valid node data is the maximum value.
  • steps 506 to 507 For specific implementation manners of steps 506 to 507, reference may be made to the above-mentioned steps 202 to 204, and details will not be repeated in this embodiment of the present application.
  • the first node device is responsible for generating the first random number, and sends the sum of the first random number and the first node data to the second node device, and the subsequent node devices sequentially Add your own data and send it to the next node device. Finally, the first node device can get the data sum of n node data according to the received data sum and the first random number, so as to calculate the average value. In the process Each node device cannot obtain the data of any other node device, which can ensure the security of data and meet the needs of multi-party secure computing.
  • the above embodiment shows the average value calculation process when the i-th node device is the first node device.
  • the t-th average value is obtained, its Specifically, perform the following steps.
  • Step 1 receiving the j-1th data sum sent by the j-1th node device; the j-1th data sum is the sum of the first node data to the j-1th node data and the first random number, j is greater than 1, and is an integer less than or equal to n.
  • Step 2 Determine the jth data sum based on the j-1th data sum; the jth data sum is the sum of the j-1th data sum and the jth node data.
  • Step 3 when j is not equal to n, send the jth data sum to the j+1th node device; when i is equal to n, send the jth data sum to the first node device.
  • each node device calculates the jth data sum based on the (j-1)th data sum sent by the previous node device, and The jth data sum is sent to the next node device, and finally the nth node device sends the nth data sum to the first node device to complete the data closed loop.
  • the (j-1)th data sum is the sum of the first node data to (j-1)th node data and the first random number, that is (R 1 +X 1 +X 2 +...+X j-1 ),
  • the jth data sum is the sum of the (j-1)th data sum and the jth node data, that is, the sum of the first node data to the jth node data and the first random number (R 1 +X 1 +X 2 +...+ X j-1 +X j ).
  • FIG. 6 shows a process of jointly calculating an average value when three node devices determine the maximum value.
  • Participant P 1 generates the first random number R 1 and sends (R 1 +X 1 ) to participant P 2 ; after receiving (R 1 +X 1 ), participant P 2 calculates (R 1 +X 1 +X 2 ), and send (R 1 +X 1 +X 2 ) to participant P 3 ; after receiving (R 1 +X 1 +X 2 ), participant P 3 calculates (R 1 +X 1 +X 2 +X 3 ), and send (R 1 +X 1 +X 2 +X 3 ) to participant P 1 ; after participant P 1 receives (R 1 +X 1 +X 2 +X 3 ), based on the A random number R 1 calculates (R 1 +X 1 +X 2 +X 3 -R 1 ) to obtain the data sum of the three parties (X 1 +X 2 +X 3 ), and then calculates the average value of the three parties (X 1 +X 2 +X 3 )/(n+1-t), where
  • Fig. 7 shows a flowchart of a multi-party secure computing method provided by another exemplary embodiment of the present application. This embodiment is described by taking the method executed by the ith node device in the joint computing system as an example.
  • the joint computing system includes n node devices, n is an integer greater than 2, and i is a positive integer less than or equal to n.
  • the method includes the following steps.
  • Step 701 generating n-1 random numbers.
  • the sum of (n-1) random numbers is the i-th node data, and the i-th node data is valid node data or invalid node data of the i-th node device.
  • the i-th node data is valid node data or invalid node data.
  • Step 702 Send n-1 random numbers to the remaining n-1 node devices respectively, and each node device receives 1 random number sent by the i-th node device.
  • the i-th node device respectively sends (n-1) node data to the remaining (n-1) node devices, so that each node device receives a random number sent by the i-th node data.
  • Step 703 Receive the random numbers sent by the remaining n-1 node devices, and calculate the sum of the received n-1 random numbers as the i-th data sum.
  • each node device needs to generate (n-1) random numbers and send them to other node devices respectively, the i-th node device will receive the random numbers sent by the other (n-1) node devices, a total of (n -1) random number.
  • the i-th node device After the i-th node device receives (n-1) random numbers, it calculates the i-th data sum, which is to add the received n-1 random numbers, for example, the first node device calculates the second node device to the n-th The sum of the random numbers sent by each node device is used to obtain the first data sum.
  • Step 704 sending the i-th data sum to the remaining n-1 node devices.
  • each node device After each node device calculates the i-th data sum, it sends it to other (n-1) node devices.
  • Step 705 receiving n-1 data sums sent by the remaining n-1 node devices, and determining the t-th average value based on the received n-1 data sums and the i-th data sum.
  • Each node device accepts the data sums sent by the remaining (n-1) node devices, a total of (n-1) data sums, the (n-1) data sums and the i-th data sums calculated by itself The sum of n node data can be obtained, and then the t-th average value can be calculated based on the obtained sum of n node data. This process is to split the node data, and each node device obtains a part of each node data, and then jointly calculates the average value.
  • FIG. 8 shows the process of safely calculating the average value when three participants determine the maximum value.
  • Step 706 if the effective node data of the i-th node device is greater than the t-th average value, perform the t+1 round of joint calculation based on the effective node data of the i-th node device.
  • Step 707 if the valid node data of the i-th node device is less than or equal to the t-th average value, perform the t+1 round of joint calculation based on the invalid node data.
  • Step 708 after the n-1 round of joint calculation, if the effective node data of the i-th node device is greater than or equal to the n-1th average value, then determine that the i-th node device's effective node data is the maximum value.
  • steps 706 to 708 For the specific implementation manners of steps 706 to 708, reference may be made to the above steps 202 to 204, and details will not be repeated here in this embodiment of the present application.
  • each node device splits its own node data into n-1 random numbers, and sends the n-1 random numbers to the remaining n-1 node devices, so that each node device Responsible for the summation operation based on a part of the data of each node, and finally exchange the obtained data sum to obtain the average value of the current round.
  • each node device cannot obtain the complete data of any other node device, which can ensure Data security meets the needs of multi-party secure computing.
  • the above-mentioned method based on average value calculation may not be used for size comparison, but each node The device calculates X i n-1 -X 1 X 2 ...X n respectively, where X i is the effective node data of the node device, and the product after the minus sign does not include X i , but other than X i (n-1 ) product of node data.
  • the effective node data of the i-th node device is not the most value; if in the (n-2) round of calculation, X i is greater than or equal to The (n-2)th average value, and the calculation result of the above formula X i n-1 -X 1 X 2 ... X n in the (n-1) round is greater than or equal to 0, then the effective node of the i-th node device The data is the most valued.
  • Fig. 9 shows a flowchart of a multi-party secure computing method provided by another exemplary embodiment of the present application. This embodiment is described by taking the method executed by the ith node device in the joint computing system as an example.
  • the joint computing system includes n node devices, n is an integer greater than 2, and i is a positive integer less than or equal to n.
  • t is n-2 and t+1 is n-1, the method includes the following steps.
  • Step 901 obtain the t-th average value obtained from the t-th round of joint calculation.
  • step 901 For the specific implementation manner of step 901, reference may be made to the foregoing step 201, and details are not described here in this embodiment of the present application.
  • Step 902 generating a second random number; the second random number is a positive number.
  • the i-th node device P i generates a positive second random number R 2i to protect data privacy.
  • Step 903 sending the second random number to the i+1th node device.
  • the (i+1)th node device is used to calculate the first data product R 2i X i+1 , and send the first data product to the (i+2)th node device, the first data product is the second random number and the The product of valid node data of (i+1) node devices.
  • Each node device sends its calculated data product to the next node device, and then each node device multiplies its own effective node data on the basis of the received data product, and sends the calculation result to the next node device, Until the i-1th node device calculates the (n - 1)th data product R 2i X 1 X 2 .
  • Step 904 receiving the n-1th data product sent by the i-1th node device.
  • the (n-1)th data product is the product of the effective node data of the (n-1) node device except the i-th node device among the n node devices and the product of the second random number, that is, R 2i X 1 X 2 ...X n .
  • the (i-1)th node device After the (i-1)th node device generates the (n-1)th data product, it sends it to the i-th node device.
  • Step 905 determine a numerical comparison operator based on the n-1th data product.
  • the value comparison operator is the difference between the (n-1)th power of the effective node data corresponding to the i-th node device and the (n-1)th data product.
  • the i-th node device After the i-th node device obtains the (n-1)th data product R 2i X 1 X 2 ...X n , divides it by the second random number, and then calculates the numerical comparison operator X i n-1 -X 1 X 2 ...X Sign of n (i.e., greater than zero, equal to zero, or less than zero). It is worth noting that if the calculation is performed in the integer field,
  • Step 906 if the value comparison operator is greater than or equal to 0, and the i-th node data in the n-2th round of joint calculation is greater than or equal to the n-2th average value, then determine that the valid node data corresponding to the i-th node device is the most valued .
  • FIG. 10 shows a process in which three participants perform the determination of the maximum value in the n-1 round (ie, the second round).
  • the participant P 1 generates the second random number R 2 and sends R 2 to the participant P 2 ;
  • the participant P 2 calculates and sends R 2 X 2 to the participant P 3 ;
  • the participant P 3 receives R 2 X 2 and calculates And send R 2 X 2 X 3 to participant P 1 ;
  • participant P 1 receives R 2 X 2 X 3 and calculates X 1 2 -X 2 X 3 .
  • both the participant P 2 and the participant P 3 perform the above steps to calculate X 2 2 -X 1 X 3 and X 3 2 -X 1 X 2 respectively.
  • the numerical comparison operator is calculated by multi-party safe multiplication calculation, which can avoid In the case of only two valid node data remaining, a node device with one valid node data can calculate another valid node data, which further improves data security.
  • Fig. 11 shows a flowchart of a multi-party secure computing method provided by another exemplary embodiment of the present application. This embodiment is described by taking the method executed by the ith node device in the joint computing system as an example.
  • the joint computing system includes n node devices, n is an integer greater than 2, and i is a positive integer less than or equal to n.
  • n is 3 and t+1 is n-1, the method includes the following steps.
  • Step 1101 obtain the t-th average value obtained from the t-th round of joint calculation.
  • step 1101 For the specific implementation manner of step 1101, reference may be made to the foregoing step 201, and details are not repeated here in this embodiment of the present application.
  • Step 1102 generating a third random number, where the third random number is a positive number.
  • the second node device generates a third random number R 3 to protect data privacy.
  • Step 1103 sending the third random number or the reciprocal of the third random number to the third node device, and sending the first product to the first node device.
  • the first product is the product of the third random number and the effective node data of the second node device
  • the third node device is used to calculate the second product and send the second product to the first node device
  • the second product is the third random number
  • the first node device is used to receive the first product and the second product, and calculate the first numerical comparison operator based on the first product and the second product, the first numerical comparison The operator is the difference between the square of the effective node data of the first node device and the third product
  • the third product is the product of the second node data and the third node data.
  • the participant P 2 generates a third random number R 3 , sends R 3 or 1/R 3 to the participant P 3 , and generates the first product R 3 X 2 and sends it to the participant P 1 , at the same time, after receiving R 3 or 1/R 3 , the participant P 3 generates the second product X 3 /R 3 and sends the second product X 3 /R 3 to the participant P 1 , so far, the participant P 1 can be calculated based on the first product R 3 X 2 and the second product X 3 /R 3 to obtain X 2 X 3 , and then to obtain the first data comparison operator X 1 2 -X 2 X 3 .
  • Step 1104 receiving the fourth product sent by the third node device and the fifth product sent by the first node device.
  • the third node device is used to generate a fourth random number and send the fourth random number to the first node device, and the first node device is used to determine the fifth product based on the fourth random number, and the fourth product is an effective value of the third node device
  • the product of the node data and the fourth random number, the fifth product is the product of the reciprocal of the fourth random data and the effective node data of the first node device.
  • the participant P 3 (or the participant P 1 ) is responsible for generating the fourth random number R 4 , and the participant P 3 calculates and reports to the participant P 2 sends the fourth product R 4 X 3 , and the participant P 3 sends the fourth random data R4 or the reciprocal 1/R 4 of the fourth random number to the participant P 1 , and the participant P 1 calculates and sends to the participant P 2 Send the fifth product X 1 /R 4 .
  • Step 1105 calculating a second numerical comparison operator based on the fourth product and the fifth product.
  • the second value comparison operator is the difference between the square of the effective node data of the second node device and the sixth product, and the sixth product is the effective node data of the first node device and the value of the third node device Product of valid node data.
  • the participant P 2 calculates X 1 X 3 based on the fourth product R 4 X and the fifth product X 1 /R 4 , and then calculates the second data comparison operator X 2 2 -X 1 X 3 .
  • Step 1106 in response to the fact that the second data comparison operator is greater than or equal to 0, and the second node data in the n-2 round of joint calculation is greater than or equal to the n-2 average value, determine that the valid node data corresponding to the second node device is best value.
  • the second node data is valid node data or invalid node data of the second node device.
  • the numerical comparison operator is calculated by multi-party safe multiplication calculation, which can avoid In the case of only two valid node data remaining, a node device with one valid node data can calculate another valid node data, which further improves data security.
  • the above embodiment shows the process of determining the maximum value by three participants. In fact, when the number of participants is odd, this method can be used to determine the maximum value in the (n-1)th round.
  • node devices can also calculate other forms of calculations, such as X i 2n-2 -X 1 2 X 2 2 ...X n 2 ,
  • the product after the minus sign does not include Xi 2 , but the product of the squares of other (n-1) node data except Xi .
  • the calculation formula used by the node device is not limited in this embodiment of the present application.
  • the node devices can be divided in a layered manner, and after the calculation of the maximum value is completed at each layer, the calculation of the next layer is continued, thereby reducing communication overhead and The most value-determined duration.
  • the participants can be divided into three groups: P 1 P 2 P 3 , P 4 , and P 5 ; when n is 7, the participants can be divided into P 1 P 2 P 3 , P 3 P 4 P 5 , and P 6 have three groups on one layer, that is, a participant can appear in multiple groups, and each group consists of 1 node device or at least 3 node devices.
  • n is large, multi-level grouping can be performed.
  • the method for multi-party safe determination of the maximum value further includes the following steps.
  • Step 4 if n is greater than 3, divide n node devices into at least one layer of device groups according to the group division method, and each layer of device groups includes at least 3 upper layer device groups, and each device in the first layer of device groups A group consists of 1 node device or at least 3 node devices.
  • the second layer of grouping divides the 9 groups of the first layer into 3 groups, and each group of the second layer contains 3 groups of the first layer, That is, ⁇ G 1 G 2 G 3 ⁇ , ⁇ G 4 G 5 G 6 ⁇ , ⁇ G 7 G 8 G 9 ⁇ three groups.
  • Step 5 if the effective node data of the i-th node device is the maximum value of the participant group where the i-th node device belongs to in the m-th layer device group, then based on the effective node data of the i-th node device, the (m+1)th layer device Joint calculation between groups, m is a positive integer.
  • a group representative is selected from it to determine the most value among the next-level (ie higher-level) groups.
  • the selection of a participant can be triggered from the perspectives of whether the computing resources of each participant are sufficient, whether the network communication is strong, reliability and security, and computational complexity, or carry out Random selection, which is not limited in this embodiment of the present application.
  • the participant P 1 , P 4 and P 7 determine the most value between the next layer of groups.
  • Step 6 if the valid node data of the i-th node device is the most value among all valid device nodes in the last-layer device group, then determine that the valid node data of the i-th node device is among the n valid node data of n node devices the most value.
  • the effective node data of the i-th node device is the most value, then it is determined that the effective node data of the i-th node device is n out of the n node devices The maximum value in the valid node data.
  • the maximum value determination within the group is first performed by dividing the group, and then the maximum value determination between the groups is performed, and multi-layer grouping can also be performed, thereby reducing communication overhead , to reduce the computational complexity and improve the efficiency of determining the maximum value.
  • Each of the foregoing embodiments shows the process of multi-party secure determination of the maximum value, where the maximum value may be a maximum value or a minimum value. If it is necessary to determine the maximum value, then directly follow the above steps to compare the maximum value, and the obtained maximum value is the maximum value; if it is necessary to determine the minimum value, each node device first inverts the local original effective node data The opposite number is used as the valid node data to compare the maximum value, and the maximum value of the opposite number is obtained, and then the minimum value can be determined by inversion.
  • Fig. 14 shows a flowchart of a multi-party secure computing method provided by another exemplary embodiment of the present application. This embodiment is described by taking the method executed by the ith node device in the joint computing system as an example.
  • the joint computing system includes n node devices, n is an integer greater than 2, and i is a positive integer less than or equal to n. When n is 3 and t+1 is n-1, the method includes the following steps.
  • Step 1401 in response to the maximum value calculation instruction, determine the original effective node data of the i-th node device as the effective node data of the i-th node device.
  • Step 1402 in response to the minimum value calculation instruction, determine the inverse number of the original valid node data of the i-th node device as the valid node data of the i-th node device.
  • the node device can determine the original valid node data as valid node data for subsequent joint calculation; when it is necessary to determine the minimum value from the data of n node devices, because The above process is determined by gradually eliminating the data that is less than the average value. Therefore, the node device determines the opposite number of the original effective node data as the effective node data for subsequent joint calculations. By determining the maximum value of the opposite number, the minimum Determination of value.
  • Step 1403 obtain the t-th average value obtained from the t-th round of joint calculation.
  • Step 1404 if the effective node data of the i-th node device is greater than the t-th average value, perform the t+1 round of joint calculation based on the effective node data of the i-th node device.
  • Step 1405 if the valid node data of the i-th node device is less than or equal to the t-th average value, perform the t+1 round of joint calculation based on the invalid node data.
  • step 1403 to step 1405 For the specific implementation manners of step 1403 to step 1405, reference may be made to the above step 201 to step 203, which will not be repeated in this embodiment of the present application.
  • Step 1406 after the n-1 round of joint calculation, if the effective node data of the i-th node device is greater than or equal to the n-1th average value, then determine that the original effective node data of the i-th node device is the maximum value.
  • the effective node data of the i-th node device is greater than or equal to the (n-1) average value, and the effective node data is n effective node data
  • the maximum value in since the valid node data is the original valid node data itself, it is determined that the original valid node data of the i-th node device is the maximum value.
  • Step 1407 after the n-1th round of joint calculation, if the effective node data of the i-th node device is greater than or equal to the n-1th average value, determine that the original effective node data of the i-th node device is the minimum value.
  • the effective node data of the i-th node device is greater than or equal to the (n-1)th average value, and the effective node data is the maximum value among the n effective node data, because the effective node
  • the data is the opposite number of the original valid node data, so it is determined that the original valid node data of the i-th node device is the minimum value.
  • the maximum value of the opposite number can be determined by performing the inversion operation on the original valid node data and performing the above-mentioned process of multi-party security determination of the maximum value based on the opposite number. That is, the minimum value of the original effective node data is obtained. If the maximum value needs to be determined, the joint calculation is directly based on the original effective node data. Therefore, the solution provided by this application can meet the requirements of determining the maximum value and the determination of the minimum value. demand.
  • Figure 15 is a structural block diagram of a device for multi-party security determination of the most value provided by an exemplary embodiment of the present application, the device includes the following structure:
  • the first acquisition module 1501 is configured to acquire the t-th average value obtained by the t-th round of joint calculation, the t-th average value is calculated based on n node data and average coefficients of n node devices, among the n node data Including m effective node data, and the average coefficient decreases with the increase of the number of joint calculation rounds, t is a positive integer less than n-1, m is a positive integer less than or equal to n;
  • the first calculation module 1502 is configured to perform the t+1 round of joint calculation based on the effective node data of the i-th node device if the effective node data of the i-th node device is greater than the t-th average value;
  • the second calculation module 1503 is configured to perform t+1 round of joint calculation based on invalid node data if the valid node data of the i-th node device is less than or equal to the t-th average value;
  • the first determination module 1504 is configured to determine the effective node of the i-th node device if the effective node data of the i-th node device is greater than or equal to the n-1th average value after the n-1th round of joint calculation The data is the most valued.
  • the second computing module 1503 includes:
  • a first calculation unit configured to perform the t+1 round of joint calculation based on the invalid node data if the valid node data of the i-th node device is less than the t-th average value, and determine the i-th node device The corresponding valid node data is not the most valuable;
  • the second calculation unit is configured to perform the t+1th round of joint calculation based on the invalid node data if the valid node data of the i-th node device is equal to the t-th average value, and based on the t+1-th average value The relationship with the invalid node data determines the maximum value.
  • the second calculation unit is also used for:
  • t+1th average value is equal to the invalid node data, and t+1 is smaller than n-1, then determine the maximum value based on the relationship between the invalid node data and the average value obtained through subsequent joint calculation.
  • the i-th node device is a first node device
  • the first obtaining module 1501 includes:
  • a first generating unit configured to generate a first random number
  • the first sending unit is configured to calculate the sum of the first node data and the first random number as the first data sum, and send the first data sum to the second node device;
  • the second node device uses For calculating the second data sum and sending the second data sum to the third node device, the second data sum is the sum of the first data sum and the second node data, wherein the jth node data is Valid node data or invalid node data of the jth node device, j is a positive integer less than or equal to n;
  • the first receiving unit is configured to receive the nth data sum sent by the nth node device, where the nth data sum is the sum of the nth node data and the first random number;
  • a first determining unit configured to determine the t-th average value based on the n-th data sum and the first random number.
  • the first acquiring module 1501 further includes:
  • the second receiving unit is configured to receive the j-1th data sum sent by the j-1th node device, the j-1th data sum is the first node data to the j-1th node data and the first random number sum, j is an integer greater than 1 and less than or equal to n;
  • a second determining unit configured to determine a jth data sum based on the j-1th data sum, where the jth data sum is the sum of the j-1th data sum and jth node data;
  • the second sending unit is configured to send the jth data sum to the j+1th node device when j is not equal to n; when j is equal to n, send the jth data sum to the first node equipment.
  • the first obtaining module 1501 includes:
  • the second generation unit is used to generate n-1 random numbers, the sum of the n-1 random numbers is i-th node data, and the i-th node data is valid node data or invalid of the i-th node device node data;
  • the third sending unit is configured to send the n-1 random numbers to the remaining n-1 node devices respectively, and each node device receives 1 random number sent by the i-th node device;
  • the third receiving unit is configured to receive the random numbers sent by the remaining n-1 node devices, and calculate the sum of the received n-1 random numbers as the i-th data sum;
  • a fourth sending unit configured to send the i-th data sum to the remaining n-1 node devices respectively;
  • the fourth receiving unit is configured to receive n-1 data sums sent by the remaining n-1 node devices, and determine the t-th average value based on the received n-1 data sums and the i-th data sum.
  • t+1 is n-1
  • the device further includes:
  • the first generation module is used to generate a second random number, and the second random number is a positive number;
  • the first sending module is configured to send the second random number to the i+1th node device, the i+1th node device is used to calculate the first data product, and send the first data product to the i+1th node device For i+2 node devices, the first data product is the product of the second random number and valid node data of the i+1th node device;
  • the first receiving module is configured to receive the n-1th data product sent by the i-1th node device, the n-1th data product is n-1 of the n node devices except the i-th node device The product of valid node data of the node device and the second random number;
  • the second determination module is configured to determine a numerical comparison operator according to the difference between the n-1th power of the effective node data of the i-th node device and the n-1th data product;
  • the third determination module is used to determine the i-th node device if the value comparison operator is greater than or equal to 0, and the i-th node data in the n-2th round of joint calculation is greater than or equal to the n-2th average value
  • the corresponding valid node data is the most valued, and the i-th node data is valid node data or invalid node data.
  • n 3
  • t+1 2
  • the i-th node device is the second node device, and the device further includes:
  • the second generation module is used to generate a third random number, and the third random number is a positive number;
  • the second sending module is configured to send the third random number or the reciprocal of the third random number to the third node device, and send the first product to the first node device, the first product being the third The product of the random number and the effective node data of the second node device, the third node device is used to calculate the second product and send the second product to the first node device, the second product is the The product of the reciprocal of the third random number and the effective node data of the third node device, the first node device is configured to receive the first product and the second product, and based on the first product and the second product, The first numerical comparison operator is calculated by the two products, and the first numerical comparison operator is the difference between the square of the effective node data of the first node device and the third product, and the third product is the second A product of node data and the third node data.
  • the device also includes:
  • the second receiving module is configured to receive the fourth product sent by the third node device and the fifth product sent by the first node device, and the third node device is used to generate a fourth random number and Four random numbers are sent to the first node device, the first node device is used to determine the fifth product based on the fourth random number, and the fourth product is valid node data of the third node device and the product of the fourth random number, the fifth product is the product of the reciprocal of the fourth random number and the effective node data of the first node device;
  • a third calculation module configured to calculate a second numerical comparison operator based on the fourth product and the fifth product, where the second numerical comparison operator is the square of the valid node data of the second node device and the second numerical comparison operator. a difference of six products, the sixth product being the product of valid node data of the first node device and valid node data of the third node device;
  • the fourth determining module is used to determine that the second The valid node data corresponding to the node device is the most valued, and the second node data is the valid node data or the invalid node data of the second node device.
  • the device also includes:
  • the grouping module is used to divide the n node devices into at least one layer of device groups according to the group division method if n is greater than 3, and each layer of device groups includes at least 3 upper layer device groups, the first layer of equipment Each device group in the group consists of 1 node device or at least 3 node devices;
  • the fourth calculation module is configured to: if the effective node data of the i-th node device is the maximum value of the participant group where the i-th node device belongs to in the m-th layer device group, based on the effective node data of the i-th node device The data is jointly calculated between the equipment groups on the m+1th layer, and m is a positive integer;
  • the fifth determining module is used to determine that the valid node data of the i-th node device is n nodes if the valid node data of the i-th node device is the most value among all valid device nodes in the last-layer device group The most value among the n valid node data corresponding to the device.
  • the device also includes:
  • a sixth determination module configured to determine the original effective node data of the i-th node device as the effective node data of the i-th node device in response to a maximum value calculation instruction
  • the first determining module 1504 also includes:
  • the third determining unit is used for determining the original effective node data of the i-th node device after the n-1th round of joint calculation is greater than or equal to the n-1th average value.
  • Node data is the maximum value.
  • the device also includes:
  • a seventh determining module configured to determine the opposite number of the original valid node data of the i-th node device as the valid node data of the i-th node device in response to a minimum value calculation instruction;
  • the first determining module 1504 also includes:
  • the fourth determination unit is used for determining the original valid node data of the i-th node device after the n-1th round of joint calculation is greater than or equal to the n-1th average value. Node data is minimum.
  • the average value of the data corresponding to n node devices is calculated, and each node device can compare its own data with the average value jointly calculated in the current round, and when its own data is less than the average value, it can It is clear that your own data is not the most value, and when it is less than or equal to the average value, replace the valid node data with invalid node data to participate in the next round of average calculation, so that the average value of the joint calculation can converge, that is, gradually approach the maximum value, and then in the next round
  • the results obtained in n-1 rounds can effectively solve the problem of multi-party secure calculation of the maximum value, and the node device does not need to disclose private data and the size relationship between each data.
  • the node device Based on the method of multi-party secure calculation of the mean value, it does not involve encryption and decryption operations. The calculation complexity and communication overhead are small, and the calculation efficiency can be improved.
  • FIG. 16 shows a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • the computer device 1600 includes a central processing unit (Central Processing Unit, CPU) 1601, a system memory 1604 including a random access memory (Random Access Memory, RAM) 1602 and a read only memory (Read Only Memory, ROM) 1603, and a connection System memory 1604 and system bus 1605 of central processing unit 1601 .
  • the computer device 1600 also includes a basic input/output (Input/Output, I/O) controller 1606 that helps to transmit information between various devices in the computer, and is used to store an operating system 1613, an application program 1614 and other program modules 1615 mass storage device 1607.
  • I/O input/output
  • the basic input/output system 1606 includes a display 1608 for displaying information and input devices 1609 such as a mouse and a keyboard for users to input information. Both the display 1608 and the input device 1609 are connected to the central processing unit 1601 through the input and output controller 1610 connected to the system bus 1605 .
  • the basic input/output system 1606 may also include an input-output controller 1610 for receiving and processing input from keyboards, mice, or electronic stylus and other devices. Similarly, input/output controller 1610 also provides output to a display screen, printer, or other type of output device.
  • the mass storage device 1607 is connected to the central processing unit 1601 through a mass storage controller (not shown) connected to the system bus 1605 .
  • the mass storage device 1607 and its associated computer-readable media provide non-volatile storage for the computer device 1600 . That is to say, the mass storage device 1607 may include a computer-readable medium (not shown) such as a hard disk or a Compact Disc Read-Only Memory (CD-ROM) drive.
  • a computer-readable medium such as a hard disk or a Compact Disc Read-Only Memory (CD-ROM) drive.
  • Computer-readable media may comprise computer storage media and communication media.
  • Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data.
  • Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (Erasable Programmable Read Only Memory, EPROM), flash memory or other solid-state storage technologies, CD-ROM, Digital Video Disc (Digital Video Disc, DVD) or other Optical storage, tape cartridge, magnetic tape, magnetic disk storage, or other magnetic storage device.
  • the computer device 1600 can also run on a remote computer connected to the network through a network such as the Internet. That is, the computer device 1600 can be connected to the network 1612 through the network interface unit 1611 connected to the system bus 1605, or in other words, the network interface unit 1611 can also be used to connect to other types of networks or remote computer systems (not shown ).
  • the memory also includes at least one instruction, at least one program, a code set, or a set of instructions stored in the memory and configured to be executed by one or more processors Execute to realize the method of multi-party secure determination of the most value mentioned above.
  • the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores at least one instruction, and the at least one instruction is loaded and executed by a processor to realize the multi-party security determination as described in the above embodiments The best value method.
  • a computer program product or computer program comprising computer instructions stored in a computer readable storage medium.
  • the processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method for multi-party security determination of the most value provided in various optional implementation manners of the above aspect.
  • the functions described in the embodiments of the present application may be implemented by hardware, software, firmware or any combination thereof.
  • the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable storage medium.
  • Computer-readable storage media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another.
  • a storage media may be any available media that can be accessed by a general purpose or special purpose computer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Software Systems (AREA)
  • Mathematical Analysis (AREA)
  • Computational Mathematics (AREA)
  • Complex Calculations (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请实施例公开了一种多方安全确定最值的方法、装置、设备及存储介质,属于数据安全技术领域。该方法包括:获取第t轮联合计算得到的第t平均值;若第i节点设备的有效节点数据大于第t平均值,则基于第i节点设备的有效节点数据进行第t+1轮联合计算;若第i节点设备的有效节点数据小于或等于第t平均值,则基于无效节点数据进行第t+1轮联合计算;第n-1轮联合计算后,若第i节点设备的有效节点数据大于或等于第n-1平均值,则确定第i节点设备的有效节点数据为最值。在上述方法中,节点设备无需泄露隐私数据以及各个数据之间的大小关系,基于多方安全计算均值的方法,不涉及加密和解密操作,计算复杂度和通信开销较小,能够提高计算效率。

Description

多方安全确定最值的方法、装置、设备及存储介质
本申请要求于2021年08月18日提交中国专利局、申请号为2021109461183、申请名称为“多方安全确定最值的方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及数据安全技术领域,特别涉及多方安全确定最值技术。
背景技术
多方安全计算的研究主要是针对,如何在无可信第三方的情况下安全地计算一个约定函数。多方安全计算可以实现安全的数据合作和融合应用,在数据不出域、合法合规的前提下联合多方数据源进行计算、分析、学习,实现数据价值共享。
相关技术中,多方安全计算确定最值是指,有至少两个参与方分别拥有不同的数据,且需要对它们各自拥有的数据进行大小比较,计算最大值或最小值。多方数据大小比较方法通常基于不经意传输(Oblivious Transfer,OT)技术或同态加密技术实现。
然而,基于不经意传输的大小比较方法虽然计算复杂度低,但只支持两方的数据比较,若扩展至多方的场景,则需要执行较多次通信交互,通信开销大、效率低,不适用于跨公网通信的应用场景;基于同态加密技术的大小比较方法,其计算复杂度较高,实际应用价值低。
发明内容
本申请实施例提供了一种多方安全确定最值的方法、装置、设备及存储介质,能够减小多方安全确定最值的计算复杂度和通信开销。所述技术方案如下。
一方面,本申请实施例提供了一种多方安全确定最值的方法,所述方法由联合计算系统中的第i节点设备执行,所述联合计算系统包括n个节点设备,n为大于2的整数,i为小于或等于n的正整数,所述方法包括:
获取第t轮联合计算得到的第t平均值;所述第t平均值是基于n个节点设备的n个节点数据以及平均系数计算得到的,n个节点数据中包括m个有效节点数据,且平均系数随联合计算轮数的增加而递减,t为小于n-1的正整数,m为小于或等于n的正整数;
若所述第i节点设备的有效节点数据大于所述第t平均值,则基于所述第i节点设备的有效节点数据进行第t+1轮联合计算;若所述第i节点设备的有效节点数据小于或等于所述第t平均值,则基于无效节点数据进行第t+1轮联合计算;
第n-1轮联合计算后,若所述第i节点设备的有效节点数据大于或等于第n-1平均值,则确定所述第i节点设备的有效节点数据为最值。
另一方面,本申请实施例提供了一种多方安全确定最值的装置,所述装置包括:
第一获取模块,用于获取第t轮联合计算得到的第t平均值;所述第t平均值是基于n个节点设备的n个节点数据以及平均系数计算得到的,n个节点数据中包括m个有效节点数据,且平均系数随联合计算轮数的增加而递减,t为小于n-1的正整数,m为小于或等于n的正整数;
第一计算模块,用于若第i节点设备的有效节点数据大于所述第t平均值,则基于所述第i节点设备的有效节点数据进行第t+1轮联合计算;
第二计算模块,用于若所述第i节点设备的有效节点数据小于或等于所述第t平均值,则基于无效节点数据进行第t+1轮联合计算;
第一确定模块,用于第n-1轮联合计算后,若所述第i节点设备的有效节点数据大于或等于第n-1平均值,则确定所述第i节点设备的有效节点数据为最值。
另一方面,本申请实施例提供了一种计算机设备,所述计算机设备包括处理器和存储器;所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如上述方面所述的多方安全确定最值的方法。
另一方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一条计算机程序,所述计算机程序由处理器加载并执行以实现如上述方面所述的多方安全确定最值的方法。
根据本申请的一个方面,提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述方面的各种可选实现方式中提供的多方安全确定最值的方法。
本申请实施例提供的技术方案至少包括以下有益效果:
本申请实施例中,计算n个节点设备对应的数据的平均值,各个节点设备通过比较己方数据与当前一轮联合计算的平均值的大小,能够在己方数据小于平均值时明确己方数据不是最值,并在小于等于平均值时将有效节点数据替换为无效节点数据参与下一轮的平均值计算,使联合计算的平均值能够收敛,即逐步接近最值,进而在第n-1轮时得到结果,能够有效解决多方安全计算最值的问题,且节点设备无需泄露隐私数据以及各个数据之间的大小关系,基于多方安全计算均值的方法,不涉及加密和解密操作,计算复杂度和通信开销较小,能够提高计算效率。
附图说明
图1是本申请实施例提供的实施环境示意图;
图2是本申请实施例提供的多方安全确定最值的方法的流程图;
图3是本申请实施例提供的多方安全确定最值的方法的流程图;
图4是本申请实施例提供的多方安全确定最值的方法的流程图;
图5是本申请实施例提供的多方安全确定最值的方法的流程图;
图6是本申请实施例提供的三方安全计算平均值的示意图;
图7是本申请实施例提供的多方安全确定最值的方法的流程图;
图8是本申请实施例提供的三方安全计算平均值的示意图;
图9是本申请实施例提供的多方安全确定最值的方法的流程图;
图10是本申请实施例提供的三方安全确定最值的示意图;
图11是本申请实施例提供的多方安全确定最值的方法的流程图;
图12是本申请实施例提供的三方安全确定最值的示意图;
图13是本申请实施例提供的多层设备组划分的示意图;
图14是本申请实施例提供的多方安全确定最值的方法的流程图;
图15是本申请实施例提供的多方安全确定最值的装置的结构框图;
图16是本申请实施例提供的计算机设备的结构框图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
首先,对本申请实施例中涉及的名词进行介绍。
1)多方安全计算:是指有n个参与方P 1,P 2,…,P n,其中,参与方P i拥有输入数据Xi,在不向任何其他参与方泄露自己的输入数据,且不借助任何可信机构的协助的前提下,所述n个参与方共同计算一个函数f(X 1,X 2,…,X n)。多方安全计算有丰富的理论基础,通过应用密码学(如同态加密)、秘密分享、差分隐私等多种安全机制,保证输入数据的安全性,已经开始从理论研究阶段进入工程化和大规模应用落地阶段。
2)秘密共享:秘密共享是一种将秘密分割存储的密码技术,目的是阻止秘密过于集中,以达到分散风险和容忍入侵的目的,是信息安全和数据保密中的重要手段。秘密共享的思想是以适当的方式拆分秘密,拆分后的每一个份额由不同的参与者管理,单个参与者无法恢复秘密信息,只有若干个参与者一同协作才能恢复秘密消息。更重要的是,当其中任何相应范围内参与者出问题时,秘密仍可以完整恢复。
近年来,由于用户隐私、数据安全、合法合规、商业竞争等因素,很难合法合规地将分散的数据源整合到一起进行计算、分析和学习。在这样的背景下,基于多方安全计算(Secure Multi-party Computation,MPC)的解决方案迅速发展起来,在不需要将分散的数据源集中在一起的情况下,就可以联 合多个分散的数据源进行联合计算、联合数据分析和联合机器学习。多方安全计算可以实现安全的数据合作和融合应用,在数据不出域、合法合规的前提下,联合多方数据源进行计算、分析、学习,实现数据价值共享。相关技术中,用于实现多方安全计算的方案通常存在计算复杂度高、通信开销大等问题。
为了解决上述技术问题,本申请实施例提出了一种半诚实(semi-honest)安全模型,在半诚实安全模型下,可以保证不泄露各参与方的数据。半诚实安全模型,也称为诚实但好奇(honest-but-curious)的安全模型,是指参与方A和B都会严格遵守数据大小比较和相等测试的协议,不会恶意背离该协议,也不会恶意或主动向对方进行攻击,但是参与方会在该协议执行过程中可以试图获得更多的信息。
图1示出了本申请实施例提供的联合计算系统的框图。该联合计算系统包括n个节点设备(也称为参与方),即节点设备P 1、节点设备P 2、…、节点设备P n,n为大于2的整数。任意一个节点设备可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。且任意两个节点设备拥有不同的数据源,例如不同公司的数据源,或同一公司不同部门的数据源。不同节点设备中存储有不同的数据。不同节点设备之间通过无线网络或有线网络相连。
n个节点设备各自存储有己方数据,且该数据不能泄露。当联合计算系统中的节点设备存在最值确定需求时,各个节点设备首先进行多方安全求平均值,然后通过比较己方数据与平均值的大小关系,在己方数据小于平均值时确定其不是最值,明确该轮计算被“淘汰”的数据后,将“淘汰”的数据替换为无效节点数据(例如替换为0)参与下一轮的平均值计算,且由于每一轮计算后至少有一个节点设备的数据会被“淘汰”,因此控制平均值计算时平均系数随联合计算的轮数增加而递减,使得均值的计算收敛,从而逐步“淘汰”不是最值的数据。该过程中,各个参与方的数据不会泄露,且交互次数较少,也无需进行加密和解密运算,因此通信开销小、计算效率高。
在一种可能的实施方式中,上述联合计算系统中的多个节点设备可以组成为一区块链,节点设备即为区块链上的节点,多方安全确定最值的过程中所涉及的数据可保存于区块链上。
图2示出了本申请一个示例性实施例提供的多方安全计算方法的流程图。本实施例以该方法由联合计算系统中的第i节点设备执行为例进行说明,联合计算系统包括n个节点设备,n为大于2的整数,i为小于或等于n的正整 数,该方法包括如下步骤。
步骤201,获取第t轮联合计算得到的第t平均值。
第t平均值是基于n个节点设备的n个节点数据以及平均系数计算得到的,n个节点数据中包括m个有效节点数据,且平均系数随联合计算轮数的增加而递减,t为小于n-1的正整数,m为小于或等于n的正整数。
联合计算系统的各个节点设备首先进行多方安全求平均值,然后比较己方数据与平均值的大小关系(此处为明文比较),在己方数据小于平均值时确定其不是最值,明确该轮计算被“淘汰”(即小于或等于平均值)的数据后,将“淘汰”的数据替换为无效节点数据(替换为0)参与下一轮的平均值计算,由于每一轮联合计算后至少有一个节点设备的数据会被“淘汰”,因此控制平均值计算时平均系数(即均值计算的分母)随联合计算的轮数增加而递减,使得均值的计算收敛,从而逐步“淘汰”不是最值的数据。
在一种可能的实施方式中,联合计算系统基于n个节点设备的节点数据以及平均系数进行多方安全计算,得到当前一轮即第t轮联合计算的第t平均值,其中n个节点数据中包括上一轮未被淘汰的有效节点数据,以及无效节点数据,其中有效节点数据为节点设备拥有的数据的真实值,无效节点数据用于替换第t轮联合计算之前小于等于均值的有效节点数据,例如无效节点数据为0,意味着对应的节点设备不参与后续的平均值计算。
示意性的,由于每一轮联合计算后至少有一个节点设备的有效节点数据小于或等于第t平均值,即至少有一个有效节点数据被替换为无效节点数据,然而由于数据的保密性,各个节点设备只能够明确己方数据是否被淘汰,并不能得知本轮计算后实际被淘汰的数据(即实际有几个有效节点数据小于均值),因此设置平均系数为(n+1-t),从第2轮开始,每一轮的均值计算中最少淘汰一个数据,平均系数逐轮递减,确保在第n-1轮时只存在最多两个有效节点数据。因此,第t平均值M t的计算公式为M t=(X 1+X 2+…+X n)/(n+1-t),其中X i为第i节点设备用于参与平均值计算的数据(有效节点数据或无效节点数据),其中第一轮计算过程中X i均为有效节点数据。
步骤202,若第i节点设备的有效节点数据大于第t平均值,则基于第i节点设备的有效节点数据进行第t+1轮联合计算。
第i节点设备的有效节点数据大于第t平均值,说明该有效节点数据有可能是最值,因此第i节点设备可以继续基于其有效节点数据进行下一轮(即第t+1轮)联合计算,直至被淘汰,即直至其有效节点数据小于或等于某一轮的平均值,或确定为最值。
步骤203,若第i节点设备的有效节点数据小于或等于第t平均值,则基于无效节点数据进行第t+1轮联合计算。
当第i节点设备的有效节点数据小于或等于第t平均值时,第i节点设备将用无效节点数据代替有效节点数据进行下一轮平均值计算。
值得注意的是,当第i节点设备的有效节点数据小于第t平均值时,第i节点设备能够确定该有效节点数据不是最值,后续只需基于无效节点数据参与平均值计算,无需进行大小比较;而当第i节点设备的有效节点数据等于第t平均值时,可能存在该数据为最值且存在其它节点设备的有效节点数据同样为最值的情况,即存在至少两个节点所拥有的数据相等且最大的情况,为了使均值计算能够收敛,避免出现平均值大于最大值的情况(因为平均系数逐轮递减),因此当第i节点设备的有效节点数据等于第t平均值时,第i节点设备同样用无效节点数据替代有效节点数据进行下一轮平均值计算,但仍需进行大小比较。
示意性的,对于4个数据“1、2、3、4”,其第一轮计算得到的平均值为5/2,其中3和4大于5/2,则在第二轮计算中,3和4仍然参与计算,1和2被替换为0,平均系数减1,即计算(0+0+3+4)/3。
步骤204,第n-1轮联合计算后,若第i节点设备的有效节点数据大于或等于第n-1平均值,则确定第i节点设备的有效节点数据为最值。
当t为(n-1)时,由于每一轮至少有一个有效节点数据被替换为无效节点数据,因此n-1轮最多只有两个有效节点数据,且平均系数m为2,因此进行第n-1轮联合计算后,能够得到最值计算结果。当第i节点设备的有效节点数据在前面(n-2)轮中均大于平均值,且第(n-1)轮中大于或等于(等于对应存在2个相等的最大值的情况)第(n-1)平均值,则其有效节点数据为最值。
综上所述,本申请实施例中,计算n个节点设备对应的数据的平均值,各个节点设备通过比较己方数据与当前一轮平均值的大小,能够在小于平均值时明确己方数据不是最值,并在小于等于平均值时将有效节点数据替换为无效节点数据进行下一轮的平均值计算,使平均值能够收敛,即逐步接近最值,进而在第n-1轮时得到最值确定结果,能够有效解决多方安全计算最值的问题,且节点设备无需泄露隐私数据以及各个数据之间的大小关系,基于多方安全计算均值的方法,不涉及加密和解密操作,计算复杂度和通信开销较小,能够提高计算效率。
需要说明的是,在n个参与方(即节点设备)各自拥有的数字X 1、X 2、…、Xn中存在浮点数时,可以首先对所有数据进行整数转换,再进行联合计算,整数转换的方法包括乘以较大整数。例如,参与方P k
Figure PCTCN2022108090-appb-000001
其中INT表示取整数,Q为一个较大的整数,例如10的6次方,Q基于n个参与方协商确定。然后对于取整后的数字进行均值计算以及最值确定。转换为整数的主要目的是通过取模运算进一步隐藏各个数字的取值范围,以三方安全确定最值为例,在三方协商计算精度Q之后,还需进一步协商数值计算范围,即协商选择整数n(称为模数),使其满足
Figure PCTCN2022108090-appb-000002
或者
Figure PCTCN2022108090-appb-000003
在一种可能的实施方式中,为了确保均值计算以及大小比较顺利进行,本申请中的有效节点数据可以均采用正数,当节点设备的数据为负数时,在第一轮联合计算之前对其进行负数编码,并将负数编码得到的数据作为有效节点数据。若X k<0,则节点设备令X k=X k+n,即对负数进行编码(其中X k为取整后的数据),因此当计算中出现
Figure PCTCN2022108090-appb-000004
或者
Figure PCTCN2022108090-appb-000005
Figure PCTCN2022108090-appb-000006
时,节点设备能够判定实际计算结果为负数,即真实结果应为
Figure PCTCN2022108090-appb-000007
图3示出了本申请另一个示例性实施例提供的多方安全计算方法的流程图。本实施例以该方法由联合计算系统中的第i节点设备执行为例进行说明,联合计算系统包括n个节点设备,n为大于2的整数,i为小于或等于n的正整数,该方法包括如下步骤。
步骤301,获取第t轮联合计算得到的第t平均值。
步骤302,若第i节点设备的有效节点数据大于第t平均值,则基于第i节点设备的有效节点数据进行第t+1轮联合计算。
步骤301至步骤302的具体实施方式可以参考上述步骤201至步骤202,本申请实施例在此不再赘述。
步骤303,若第i节点设备的有效节点数据小于第t平均值,则基于无效节点数据进行第t+1轮联合计算,并确定第i节点设备对应的有效节点数据不是最值。
在一种可能的实施方式中,第i节点设备的有效节点数据小于第t平均值,意味着本轮联合计算过程中存在其它节点设备的有效节点数据大于第i节点设备的有效节点数据,因此在这一步就能够确定第i节点设备的有效数据不是最值。在后续每一轮的平均值计算中,第i节点设备只需基于无效节点数据参与运算即可,有效节点数据不参与运算,也无需与平均值进行大小比较。
步骤304,若第i节点设备的有效节点数据等于第t平均值,则基于无效节点数据进行第t+1轮联合计算,并基于第t+1平均值与无效节点数据之间的关系确定最值。
在一种可能的实施方式中,第i节点设备的有效节点数据等于第t平均值,意味着本轮计算过程中存在两种可能。一种是既存在其它节点设备的有效节点数据大于第i节点设备的有效节点数据,也存在其它节点设备的有效节点数据小于第i节点设备的有效节点数据,这种情况下第i节点设备的有效节点数据不是最值,例如数据“1、2、3”在第一轮的平均值为2;另一种是第i节点设备的有效节点数据为最值,且还可能存在其它节点设备的有效节点数据也为最值,例如数据“1、1、3、3”在第一轮的平均值为2,第二轮基于“0、0、3、3”以及平均系数3进行计算,得到平均值为3。因此无法直接 确定第i节点设备的有效节点数据不是最值,还需继续进行联合计算并与平均值进行大小比较。
为了确保每一轮联合计算后都能够至少有一个有效节点数据被“淘汰”,使计算逐步收敛,因此,当第i节点设备的有效节点数据等于平均值时,第i节点设备基于无效节点数据参与后续的联合计算。
在一种可能的实施方式中,当第i节点设备的有效节点数据等于第t平均值,且t不等于(n-1)时,需在后续计算中进行大小比较。步骤304包括如下步骤。
步骤304a,若第t+1平均值大于无效节点数据,则确定第i节点设备对应的有效节点数据不是最值。
第i节点设备基于无效节点数据(本申请实施例中无效节点数据为0)进行第(t+1)轮联合计算后,若第(t+1)平均值大于无效节点数据,意味着第(t+1)轮计算过程中存在着在第t轮中“胜出”(即大于第t平均值)的有效节点数据,对应上述第一种可能,因此能够确定第i节点设备的有效节点数据不是最值。
例如,数据“1、2、2、3”,第一轮的平均值为2,此时有效节点数据为2的节点设备并不能确定是否存在其它节点设备的有效节点数据大于2,第二轮基于“0、0、0、3”以及平均系数3进行计算,得到平均值1,该平均值大于无效节点数据0,此时可以确定第一轮中存在其它节点设备的有效节点数据大于2,因此有效节点数据2并不是最值。
步骤304b,若第t+1平均值等于无效节点数据,且t+1为n-1,则确定第i节点设备对应的有效节点数据为最值。
第i节点设备基于无效节点数据进行第(t+1)轮联合计算后,若第(t+1)平均值等于无效节点数据,并且(t+1)为(n-1),即最后一轮计算,则意味着最后不存在有效节点数据,即有效节点数据中的最值已被替换为无效节点数据,因此在上一轮中等于平均值的有效节点数据即为最值。
步骤304c,若第t+1平均值等于无效节点数据,且t+1小于n-1,则基于无效节点数据与后续联合计算得到的平均值之间的关系确定最值。
当第(t+1)平均值等于无效节点数据,但(t+1)小于(n-1),即未达到最后一轮联合计算时,能够确定第t轮中等于第t平均值的有效节点数据为最大值,但为了确保计算收敛,还需继续进行平均值计算,直至平均系数为(n-1)。
在另一种可能的实施方式中,当第i节点设备的有效节点数据等于第t平均值,且t等于(n-1),即最后一轮计算时,能够直接确定第i节点设备的有效节点数据为最值,节点设备不再进行联合计算。
示意性的,图4示出了基于平均值进行大小比较以及最值确定的流程图,该过程包括:步骤401,基于平均系数(n+1-t)计算第t平均值;步骤402,判断t=1或X k≥M t-1是否成立,若是,则执行步骤403,若否,则执行步骤 405;步骤403,判断X k>M t还是X k≤M t,若X k>M t则执行步骤406,若X k≤M t则执行步骤404;步骤404,判断t是否为n-1,若是则执行步骤408,若否则执行步骤405;步骤405,基于无效节点数据进行后续的联合计算,且X k<M t时后续不进行大小比较,X k=M t时基于无效节点数据与平均值进行大小比较;步骤406,判断t是否为(n-1),若是则执行步骤409,若否则执行步骤407;步骤407,基于有效节点数据进行第(t+1)轮联合计算;步骤408,判断X k=M t是否成立,若是则执行步骤409,若否则确定节点设备P k对应的有效节点数据X k不是最值并结束流程;步骤409,确定节点设备P k对应的有效节点数据X k为最值。其中,t为联合计算的轮数,M t-1为第(t-1)轮联合计算得到的第(t-1)平均值,M t为第t轮联合计算得到的第t平均值;X k为第k个节点设备的有效节点数据。
步骤305,第n-1轮联合计算后,若第i节点设备的有效节点数据大于或等于第n-1平均值,则确定第i节点设备的有效节点数据为最值。
步骤305的具体实施方式可以参考上述步骤203,本申请实施例在此不再赘述。
本申请实施例中,节点设备通过比较有效节点数据与第t平均值的大小,判断有效节点数据是否为最值,在有效节点数据小于或等于第t平均值的情况下,将有效节点数据替换为无效节点数据进行后续的联合计算,并在有效节点数据等于第t平均值时,继续基于无效节点数据与后续的平均值进行大小比较,既能够保证平均值计算的收敛,也能够避免遗漏可能的最值,确保了最值计算的可靠性。
上述实施例示出了基于多方安全计算的平均值进行最值确定的过程。对于安全计算平均值,本申请实施例提出了一种实现方式。图5示出了本申请另一个示例性实施例提供的多方安全计算方法的流程图。本实施例以该方法由联合计算系统中的第一节点设备执行为例进行说明,联合计算系统包括n个节点设备,n为大于2的整数,i为小于或等于n的正整数。其中,第一节点设备是指用于生成第一随机数的节点设备,n个节点设备中的任意一个均可作为第一节点设备进行均值计算。该方法包括如下步骤。
步骤501,生成第一随机数。
第一节点设备在当前一轮联合计算开始后,首先生成第一随机数R 1。该第一随机数R 1为正数。
步骤502,将第一数据和发送至第二节点设备。
第一数据和为第一随机数与第一节点数据之和,第二节点设备用于计算第二数据和,并将第二数据和发送至第三节点设备,第二数据和为第一数据和与第二节点数据之和,其中,第j节点数据为第j节点设备的有效节点数据或无效节点数据,j为小于或等于n的正整数。
第一节点设备P 1生成第一随机数R 1后,将第一数据和(R 1+X 1)发送给第二节点设备P 2。第二节点设备P 2接收到第一数据和(R 1+X 1)后,基于第一数据和(R 1+X 1)以及第二节点数据X 2计算第二数据和(R 1+X 1+X 2),并将第二数据和(R 1+X 1+X 2)发送至第三节点设备,以此类推,最终由第n节点设备将第n数据和(R 1+X 1+X 2+…+X n)发送至第一节点设备。
步骤503,接收第n节点设备发送的第n数据和。
步骤504,基于第n数据和以及第一随机数确定第t平均值。
第一节点设备P1接收到第n节点设备发送的第n数据和(R 1+X 1+X 2+…+X n)后,计算节点数据和(R 1+X 1+X 2+…+X n-R 1),即获得n个节点数据的和,从而在完成n方求和的基础上,基于平均系数(n+1-t)确定第t平均值。
可选的,第一节点设备计算得到第t平均值后,可以向其它各个节点设备发送第t平均值或者n方的求和结果(X 1+X 2+…+X n),或者,第一节点设备将第t平均值或者n方的求和结果(X 1+X 2+…+X n)发送至第二节点设备,由第二节点设备发送至第三节点设备,以此类推直至第n节点设备接收到第t平均值或者n方的求和结果(X 1+X 2+…+X n)。本申请实施例对此不作限定。
发送数据和的顺序和起止位置可由n个节点设备自行协商确定,且该顺序可以改变,即轮流作为第一节点设备进行平均值计算,以进一步提高数据的安全性。
步骤505,若第i节点设备的有效节点数据大于第t平均值,则基于第i节点设备的有效节点数据进行第t+1轮联合计算。
步骤506,若第i节点设备的有效节点数据小于或等于第t平均值,则基于无效节点数据进行第t+1轮联合计算。
步骤507,第n-1轮联合计算后,若第i节点设备的有效节点数据大于或等于第n-1平均值,则确定第i节点设备的有效节点数据为最值。
步骤506至步骤507的具体实施方式可以参考上述步骤202至步骤204,本申请实施例在此不再赘述。
本申请实施例中,由第一节点设备负责生成第一随机数,并将第一随机数与第一节点数据之和发送至第二节点设备,后续节点设备依次在接收到的数据和的基础上添加己方数据并发送至下一节点设备,最终第一节点设备根据其接收到的数据和和第一随机数,即可得到n个节点数据的数据和,从而计算平均值,在此过程中每个节点设备均无法得到其它任意一个节点设备的数据,能够保证数据的安全性,满足多方安全计算的需求。
上述实施例示出了当第i节点设备为第一节点设备时的平均值计算过程,为了更清楚地说明该过程,对于其它并非第一节点设备的第j节点设备,获取第t平均值时其具体执行如下步骤。
步骤一,接收第j-1节点设备发送的第j-1数据和;第j-1数据和为第一 节点数据至第j-1节点数据与第一随机数之和,j为大于1,且小于或等于n的整数。
步骤二,基于第j-1数据和确定第j数据和;第j数据和为第j-1数据和与第j节点数据之和。
步骤三,当j不等于n时,将第j数据和发送至第j+1节点设备;当i等于n时,将所述第j数据和发送给第一节点设备。
本申请实施例中的均值计算是基于环形拓扑结构实现的,除了第一节点设备以外,每个节点设备均基于上一节点设备发送的第(j-1)数据和计算第j数据和,并将第j数据和发送至下一节点设备,最终由第n节点设备将第n数据和发送至第一节点设备,完成数据闭环。其中第(j-1)数据和为第一节点数据至第(j-1)节点数据与第一随机数之和,即(R 1+X 1+X 2+…+X j-1),第j数据和为第(j-1)数据和与第j节点数据之和,即第一节点数据至第j节点数据与第一随机数之和(R 1+X 1+X 2+…+X j-1+X j)。
示意性的,图6示出了3个节点设备进行最值确定时的联合计算平均值的过程。参与方P 1生成第一随机数R 1,并向参与方P 2发送(R 1+X 1);参与方P 2接收到(R 1+X 1)后,计算得到(R 1+X 1+X 2),并向参与方P 3发送(R 1+X 1+X 2);参与方P 3接收到(R 1+X 1+X 2)之后,计算(R 1+X 1+X 2+X 3),并向参与方P 1发送(R 1+X 1+X 2+X 3);参与方P 1接收到(R 1+X 1+X 2+X 3)后,基于第一随机数R 1计算(R 1+X 1+X 2+X 3-R 1)得到三方的数据和(X 1+X 2+X 3),进而计算三方的平均值即(X 1+X 2+X 3)/(n+1-t),其中n为3,t为当前轮数。
上述实施例示出了基于环形拓扑结构的多方安全求均值的过程,在另一种可能的实施方式中,n个节点设备之间还可以通过对等网络(Peer-to-Peer,P2P)实现多方安全计算平均值。图7示出了本申请另一个示例性实施例提供的多方安全计算方法的流程图。本实施例以该方法由联合计算系统中的第i节点设备执行为例进行说明,联合计算系统包括n个节点设备,n为大于2的整数,i为小于或等于n的正整数。该方法包括如下步骤。
步骤701,生成n-1个随机数。
其中,(n-1)个随机数之和为第i节点数据,该第i节点数据为第i节点设备的有效节点数据或无效节点数据。
在P2P网络中,当进行均值计算时,每个节点设备均生成(n-1)个随机数,且n-1个随机数之和应为第i节点数据,即r 1+r 2+…+r n-1=X i。其中第i节点数据为有效节点数据或无效节点数据。
步骤702,将n-1个随机数分别发送给其余n-1个节点设备,每个节点设备接收到第i节点设备发送的1个随机数。
第i节点设备分别将(n-1)个节点数据发送至其余(n-1)个节点设备,使每个节点设备均接收到1个第i节点数据发送的随机数。
步骤703,接收其余n-1个节点设备各自发送的随机数,并计算所接收到的n-1个随机数之和作为第i数据和。
由于每个节点设备均需生成(n-1)个随机数并分别发送至其它节点设备,因此第i节点设备会接收到其它(n-1)个节点设备各自发送的随机数,共(n-1)个随机数。
第i节点设备在接收到(n-1)个随机数之后,计算第i数据和,即将接收到的n-1个随机数相加,例如,第一节点设备计算第二节点设备至第n节点设备各自发送的随机数之和,得到第一数据和。
步骤704,将第i数据和发送至其余n-1个节点设备。
各个节点设备计算得到第i数据和后,将其发送至其它(n-1)个节点设备。
步骤705,接收其余n-1个节点设备发送的n-1个数据和,并基于接收到的n-1个数据和以及第i数据和确定第t平均值。
每个节点设备均接受其余(n-1)个节点设备发送的数据和,共(n-1)个数据和,将该(n-1)个数据和以及自身计算得到的第i数据和相加,即可得到n个节点数据之和,进而基于求得的n个节点数据之和计算第t平均值。该过程是将节点数据拆分,每个节点设备均获取到每个节点数据的一部分,进而共同计算得到平均值。
示意性的,图8示出了3个参与方进行最值确定时安全计算平均值的过程。参与方P 1生成随机数R 1,2和R 1,3,且满足X 1=R 1,2+R 1,3,分别向参与方P 2和参与方P 3发送R 1,2和R 1,3,同样的,参与方P 2生成随机数R 2,1和R 2,3,且满足X 2=R 2,1+R 2,3,分别向参与方P 1和参与方P 3发送R 2,1和R 2,3,参与方P 3生成随机数R 3,1和R 3,2,且满足X 3=R 3,1+R 3,2,分别向参与方P 1和参与方P 2发送R 3,1和R 3,2;参与方P 1计算第一数据和S 1=R 2,1+R 3,1,参与方P 2计算第二数据和S 2=R 1,2+R 3,2,参与方P 3计算第三数据和S 3=R 2,3+R 1,3;参与方P 1向参与方P 2和P 3发送S 1,参与方P2向参与方P 1和P 3发送S 2,参与方P 3向参与方P 2和P 1发送S 3;参与方P 1、P 2和P 3分别计算三方数字之和S 1+S 2+S 3=R 2,1+R 3,1+R 1,2+R 3,2+R 2,3+R 1,3=X 1+X 2+X 3;进而三个参与方可以计算第t轮的平均值(X 1+X 2+X 3)/(n+1-t)。
步骤706,若第i节点设备的有效节点数据大于第t平均值,则基于第i节点设备的有效节点数据进行第t+1轮联合计算。
步骤707,若第i节点设备的有效节点数据小于或等于第t平均值,则基于无效节点数据进行第t+1轮联合计算。
步骤708,第n-1轮联合计算后,若第i节点设备的有效节点数据大于或等于第n-1平均值,则确定第i节点设备的有效节点数据为最值。
步骤706至步骤708的具体实施方式可以参考上述步骤202至步骤204,本申请实施例在此不再赘述。
本申请实施例中,每个节点设备将己方的节点数据拆分成n-1个随机数,并将n-1个随机数分别发送至其余n-1个节点设备,使得每个节点设备均负责基于各个节点数据的一部分进行求和运算,最终交换求得的数据和,得到当前一轮的平均值,在此过程中每个节点设备均无法得到其它任意一个节点设备的完整数据,能够保证数据的安全性,满足多方安全计算的需求。
在上述各个实施例中,在第(n-1)轮联合计算过程中,实际参与的最多只存在两个有效节点数据,这样一来,在第(n-1)轮计算过程中存在泄漏参与方的有效节点数据的风险(即其中一个拥有有效节点数据的参与方能够根据第(n-1)平均值计算出另一个参与方的有效节点数据)。因此,为了进一步增强本申请提供的最值确定方案的安全性,在进行第(n-1)轮大小比较时,可以不采取上述基于平均值计算的方式进行大小比较,而是由每个节点设备分别计算X i n-1-X 1X 2…X n,其中X i为节点设备的有效节点数据,减号之后的乘积中不包含X i,而是除X i以外其他(n-1)个节点数据的乘积。若第(n-2)轮计算中X i小于第(n-2)平均值,则第i节点设备的有效节点数据不是最值;若第(n-2)轮计算中X i大于或等于第(n-2)平均值,且在第(n-1)轮中上式X i n-1-X 1X 2…X n的计算结果大于或等于0,则第i节点设备的有效节点数据为最值。
图9示出了本申请另一个示例性实施例提供的多方安全计算方法的流程图。本实施例以该方法由联合计算系统中的第i节点设备执行为例进行说明,联合计算系统包括n个节点设备,n为大于2的整数,i为小于或等于n的正整数。当t为n-2,t+1为n-1时,该方法包括如下步骤。
步骤901,获取第t轮联合计算得到的第t平均值。
步骤901的具体实施方式可以参考上述步骤201,本申请实施例在此不再赘述。
步骤902,生成第二随机数;第二随机数为正数。
第i节点设备P i生成正的第二随机数R 2i,用以保护数据隐私。
步骤903,将第二随机数发送给第i+1节点设备。
第(i+1)节点设备用于计算第一数据积R 2iX i+1,并将第一数据积发送至第(i+2)节点设备,第一数据积为第二随机数与第(i+1)节点设备的有效节点数据之积。
每个节点设备将其计算得到的数据积发送给下一节点设备,后续每个节点设备在接收到的数据积的基础上乘以己方的有效节点数据,并将计算结果发送至下一节点设备,直至第i-1节点设备计算得到第(n-1)数据积R 2iX 1X 2…X n,其中不包含第i节点的有效节点数据X i
步骤904,接收第i-1节点设备发送的第n-1数据积。
第(n-1)数据积为n个节点设备中除第i节点设备以外的(n-1)个节点 设备的有效节点数据以及第二随机数之积,即R 2iX 1X 2…X n
第(i-1)节点设备生成第(n-1)数据积后,将其发送至第i节点设备。
步骤905,基于第n-1数据积确定数值比较算子。
数值比较算子为第i节点设备对应的有效节点数据的(n-1)次方与第(n-1)数据积之差。
第i节点设备获取到第(n-1)数据积R 2iX 1X 2…X n后,除以第二随机数,进而计算数值比较算子X i n-1-X 1X 2…X n的符号(即大于零、等于零或小于零)。值得注意的是,如果是在整数域进行计算,还需满足|X1X2…Xn|<n/2或|X1X2…Xn|<n/3,且
Figure PCTCN2022108090-appb-000008
Figure PCTCN2022108090-appb-000009
步骤906,若数值比较算子大于或等于0,且第n-2轮联合计算中第i节点数据大于或等于第n-2平均值,则确定第i节点设备对应的有效节点数据为最值。
示意性的,图10示出了3个参与方进行第n-1轮(即第2轮)最值确定的过程。参与方P 1生成第二随机数R 2,并将R 2发送至参与方P 2;参与方P 2计算并向参与方P 3发送R 2X 2;参与方P 3接收R 2X 2计算并向参与方P 1发送R 2X 2X 3;参与方P 1接收R 2X 2X 3并计算得到X 1 2-X 2X 3。同样的,参与方P 2和参与方P 3均执行上述步骤,分别计算X 2 2-X 1X 3以及X 3 2-X 1X 2
本申请实施例中,当进行第(n-1)轮最值确定时,不继续采用基于平均值计算的方式进行大小比较,而是通过多方安全乘法计算的方式计算数值比较算子,能够避免在仅剩两个有效节点数据的情况下,拥有一个有效节点数据的节点设备能够计算得到另一个有效节点数据,进一步提高了数据安全性。
上述实施例示出了第一种基于多方安全乘法计算进行第(n-1)轮最值确定的过程。在一种可能的实施方式中,针对三个参与方的情况,即n=3,还存在第二种方式进行第(n-1)轮(即第2轮)的最值确定方式。图11示出了本申请另一个示例性实施例提供的多方安全计算方法的流程图。本实施例以该方法由联合计算系统中的第i节点设备执行为例进行说明,联合计算系统包括n个节点设备,n为大于2的整数,i为小于或等于n的正整数。当n为3,t+1为n-1时,该方法包括如下步骤。
步骤1101,获取第t轮联合计算得到的第t平均值。
步骤1101的具体实施方式可以参考上述步骤201,本申请实施例在此不再赘述。
步骤1102,生成第三随机数,第三随机数为正数。
第二节点设备生成第三随机数R 3,用以保护数据隐私。
步骤1103,将第三随机数或第三随机数的倒数发送至第三节点设备,并将第一乘积发送至第一节点设备。
第一乘积为第三随机数与第二节点设备的有效节点数据之积,第三节点 设备用于计算第二乘积并将第二乘积发送至第一节点设备,第二乘积为第三随机数的倒数与第三节点设备的有效节点数据之积,第一节点设备用于接收第一乘积和第二乘积,并基于第一乘积和第二乘积计算第一数值比较算子,第一数值比较算子为第一节点设备的有效节点数据的平方与第三乘积之差,第三乘积为第二节点数据与第三节点数据之积。
示意性的,如图12所示,参与方P 2生成第三随机数R 3,将R 3或1/R 3发送至参与方P 3,并生成第一乘积R 3X 2发送至参与方P 1,同时参与方P 3接收到R 3或1/R 3后,生成第二乘积X 3/R 3,并将第二乘积X 3/R 3发送至参与方P 1,至此,参与方P 1能够基于第一乘积R 3X 2以及第二乘积X 3/R 3计算得到X 2X 3,进而计算得到第一数据比较算子X 1 2-X 2X 3
步骤1104,接收第三节点设备发送的第四乘积和第一节点设备发送的第五乘积。
第三节点设备用于生成第四随机数并将第四随机数发送至第一节点设备,第一节点设备用于基于第四随机数确定第五乘积,第四乘积为第三节点设备的有效节点数据与第四随机数之积,第五乘积为第四随机数据的倒数与第一节点设备的有效节点数据之积。
同样的,当参与方P 2需要计算X 2 2-X 1X 3时,由参与方P 3(或者参与方P 1)负责生成第四随机数R 4,参与方P 3计算并向参与方P 2发送第四乘积R 4X 3,且参与方P 3将第四随机数据R4或者第四随机数的倒数1/R 4发送至参与方P 1,参与方P 1计算并向参与方P 2发送第五乘积X 1/R 4
步骤1105,基于第四乘积以及第五乘积计算第二数值比较算子。
第二数值比较算子为所述第二节点设备的有效节点数据的平方与第六乘积之差,所述第六乘积为所述第一节点设备的有效节点数据与所述第三节点设备的有效节点数据之积。
参与方P 2基于第四乘积R 4X以及第五乘积X 1/R 4计算得到X 1X 3,进而计算第二数据比较算子X 2 2-X 1X 3
步骤1106,响应于第二数据比较算子大于或等于0,且第n-2轮联合计算中第二节点数据大于或等于第n-2平均值,确定第二节点设备对应的有效节点数据为最值。
第二节点数据为第二节点设备的有效节点数据或无效节点数据。
本申请实施例中,当进行第(n-1)轮最值确定时,不继续采用基于平均值计算的方式进行大小比较,而是通过多方安全乘法计算的方式计算数值比较算子,能够避免在仅剩两个有效节点数据的情况下,拥有一个有效节点数据的节点设备能够计算得到另一个有效节点数据,进一步提高了数据安全性。
上述实施例示出了三个参与方进行最值确定的过程,实际上当参与方的个数为奇数时,均可采用该方法进行第(n-1)轮的最值确定。
值得一提的是,除了计算X i n-1-X 1X 2…X n,节点设备还可以计算其他形式 的算式,例如X i 2n-2-X 1 2X 2 2…X n 2,其中减号后面的乘积中不包含X i 2,而是除X i以外其他(n-1)个节点数据的平方的乘积。对于节点设备使用的计算公式,本申请实施例不作限定。
在一种可能的实施方式中,当参与方的数量较多时,可以采取分层的方式划分节点设备,在每一层完成最值计算后,继续进行下一层计算,从而减小通信开销以及最值确定的时长。例如,当n为5时,可以将参与方划分为P 1P 2P 3、P 4、P 5一层三个小组;当n为7时,可以将参与方划分为P 1P 2P 3、P 3P 4P 5、和P 6一层三个小组,即一个参与方可以出现在多个小组中,每个小组由1个节点设备或至少3个节点设备组成。当n较大时,可以进行多层分组。
在进行平均值计算之前,多方安全确定最值的方法还包括如下步骤。
步骤四,若n大于3,按照小组划分方式将n个节点设备划分为至少一层设备组,且每层设备组中包括至少3个上一层设备组,第一层设备组中每个设备组由1个节点设备或至少3个节点设备组成。
例如,当N为27时,第一层分组为9个设备组,每个组有3个参与方,即G 1={P 1P 2P 3},G 2={P 4P 5P 6},…,G 9={P 25P 26P 27},第二层分组将第一层的9个小组划分为3个小组,每个第二层的小组中包含3个第一层小组,即{G 1G 2G 3}、{G 4G 5G 6}、{G 7G 8G 9}三个组。
步骤五,若第i节点设备的有效节点数据为第m层设备组中第i节点设备所在参与方小组的最值,则基于第i节点设备的有效节点数据进行第(m+1)层设备组之间的联合计算,m为正整数。
当低层的小组中确定出至少一个最值的拥有方之后,从中选出小组代表,进行下一层(即更高层)小组之间的最值确定。其中,当存在至少两个参与方拥有最值时,可以从各个参与方的计算资源是否充裕、网络通信是否较强、可靠性和安全性以及计算复杂度等角度触发选择一个参与方,或者进行随机选择,本申请实施例对此不作限定。
如图13所示,当第一个由参与方P 1、P 2和P 3组成的设备组中确定出参与方P 1拥有最值、第二个由参与方P 4、P 5和P 6组成的设备组中确定出参与方P 4拥有最值、第三个由参与方P 7、P 8和P 9组成的设备组中确定出参与方P 7拥有最值时,由参与方P 1、P 4和P 7进行下一层小组之间的最值确定。
步骤六,若第i节点设备的有效节点数据为最后一层设备组中各个有效设备节点中的最值,则确定第i节点设备的有效节点数据为n个节点设备的n个有效节点数据中的最值。
当进行至最后一层最值确定,且完成最后一轮联合计算后,若第i节点设备的有效节点数据为最值,则确定第i节点设备的有效节点数据为n个节点设备的n个有效节点数据中的最值。
本申请实施例中,当节点设备数量较多时,通过划分小组的方式先进行 组内的最值确定,然后进行小组之间的最值确定,并且还可以进行多层分组,从而减小通信开销,降低计算复杂度,提高最值确定的效率。
上述各个实施例示出了多方安全确定最值的过程,其中,该最值可以是最大值也可以是最小值。若需确定最大值,则直接按照上述步骤进行最值比较,得到的最值即为最大值;若需确定最小值,则各个节点设备先将本地的原始有效节点数据进行取反操作,将其相反数作为有效节点数据进行最值比较,得到的为相反数的最大值,再进行取反即可确定最小值。图14示出了本申请另一个示例性实施例提供的多方安全计算方法的流程图。本实施例以该方法由联合计算系统中的第i节点设备执行为例进行说明,联合计算系统包括n个节点设备,n为大于2的整数,i为小于或等于n的正整数。当n为3,t+1为n-1时,该方法包括如下步骤。
步骤1401,响应于最大值计算指令,将第i节点设备的原始有效节点数据确定为第i节点设备的有效节点数据。
步骤1402,响应于最小值计算指令,将第i节点设备的原始有效节点数据的相反数确定为第i节点设备的有效节点数据。
当需要从n个节点设备的数据中确定最大值时,节点设备可以将原始有效节点数据确定为有效节点数据进行后续的联合计算;当需要从n个节点设备的数据中确定最小值时,由于上述过程是通过逐步淘汰小于平均值的数据进行最值确定的,因此节点设备将原始有效节点数据的相反数确定为有效节点数据进行后续的联合计算,通过确定相反数中的最大值,实现最小值的确定。
步骤1403,获取第t轮联合计算得到的第t平均值。
步骤1404,若第i节点设备的有效节点数据大于第t平均值,则基于第i节点设备的有效节点数据进行第t+1轮联合计算。
步骤1405,若第i节点设备的有效节点数据小于或等于第t平均值,则基于无效节点数据进行第t+1轮联合计算。
步骤1403至步骤1405的具体实施方式可以参考上述步骤201至步骤203,本申请实施例在此不再赘述。
步骤1406,第n-1轮联合计算后,若第i节点设备的有效节点数据大于或等于第n-1平均值,则确定第i节点设备的原始有效节点数据为最大值。
当第(n-1)轮联合计算(即最后一轮联合计算)后,第i节点设备的有效节点数据大于或等于第(n-1)平均值,该有效节点数据为n个有效节点数据中的最大值,由于有效节点数据为原始有效节点数据本身,因此确定第i节点设备的原始有效节点数据为最大值。
步骤1407,第n-1轮联合计算后,若第i节点设备的有效节点数据大于或等于第n-1平均值,则确定第i节点设备的原始有效节点数据为最小值。
当第(n-1)轮联合计算后,第i节点设备的有效节点数据大于或等于第(n-1)平均值,该有效节点数据为n个有效节点数据中的最大值,由于有效节点数据为原始有效节点数据的相反数,因此确定第i节点设备的原始有效节点数据为最小值。
本申请实施例中,若需进行最小值确定,则可以通过对原始有效节点数据进行取反运算,基于相反数进行上述多方安全确定最值的过程,即可确定出相反数中的最大值,即得到原始有效节点数据中的最小值,若需进行最大值确定,则直接基于原始有效节点数据进行联合计算,因此本申请提供的方案既能满足最大值确定的需求,也能满足最小值确定的需求。
图15是本申请一个示例性实施例提供的多方安全确定最值的装置的结构框图,该装置包括如下结构:
第一获取模块1501,用于获取第t轮联合计算得到的第t平均值,所述第t平均值是基于n个节点设备的n个节点数据以及平均系数计算得到的,n个节点数据中包括m个有效节点数据,且平均系数随联合计算轮数的增加而递减,t为小于n-1的正整数,m为小于或等于n的正整数;
第一计算模块1502,用于若第i节点设备的有效节点数据大于所述第t平均值,则基于所述第i节点设备的有效节点数据进行第t+1轮联合计算;
第二计算模块1503,用于若所述第i节点设备的有效节点数据小于或等于所述第t平均值,则基于无效节点数据进行第t+1轮联合计算;
第一确定模块1504,用于在第n-1轮联合计算后,若所述第i节点设备的有效节点数据大于或等于第n-1平均值,则确定所述第i节点设备的有效节点数据为最值。
可选的,所述第二计算模块1503,包括:
第一计算单元,用于若所述第i节点设备的有效节点数据小于所述第t平均值,则基于所述无效节点数据进行第t+1轮联合计算,并确定所述第i节点设备对应的有效节点数据不是最值;
第二计算单元,用于若所述第i节点设备的有效节点数据等于所述第t平均值,则基于所述无效节点数据进行第t+1轮联合计算,并基于第t+1平均值与所述无效节点数据之间的关系确定最值。
可选的,所述第二计算单元,还用于:
若所述第t+1平均值大于所述无效节点数据,则确定所述第i节点设备对应的有效节点数据不是最值;
若所述第t+1平均值等于所述无效节点数据,且t+1为n-1,则确定所述第i节点设备的有效节点数据为最值;
若所述第t+1平均值等于所述无效节点数据,且t+1小于n-1,则基于所述无效节点数据与后续联合计算得到的平均值之间的关系确定最值。
可选的,所述第i节点设备为第一节点设备,所述第一获取模块1501,包括:
第一生成单元,用于生成第一随机数;
第一发送单元,用于计算第一节点数据与所述第一随机数之和,作为第一数据和,并将所述第一数据和发送至第二节点设备;所述第二节点设备用于计算第二数据和,并将所述第二数据和发送至第三节点设备,所述第二数据和为所述第一数据和与第二节点数据之和,其中,第j节点数据为所述第j节点设备的有效节点数据或无效节点数据,j为小于或等于n的正整数;
第一接收单元,用于接收第n节点设备发送的第n数据和,所述第n数据和为n个节点数据与所述第一随机数之和;
第一确定单元,用于基于所述第n数据和以及所述第一随机数确定所述第t平均值。
可选的,所述第一获取模块1501,还包括:
第二接收单元,用于接收第j-1节点设备发送的第j-1数据和,所述第j-1数据和为第一节点数据至第j-1节点数据与所述第一随机数之和,j为大于1,且小于或等于n的整数;
第二确定单元,用于基于所述第j-1数据和确定第j数据和,所述第j数据和为所述第j-1数据和与第j节点数据之和;
第二发送单元,用于当j不等于n时,将所述第j数据和发送给第j+1节点设备;当j等于n时,将所述第j数据和发送给所述第一节点设备。
可选的,所述第一获取模块1501,包括:
第二生成单元,用于生成n-1个随机数,所述n-1个随机数之和为第i节点数据,所述第i节点数据为所述第i节点设备的有效节点数据或无效节点数据;
第三发送单元,用于将所述n-1个随机数分别发送给其余n-1个节点设备,每个节点设备接收到所述第i节点设备发送的1个随机数;
第三接收单元,用于接收其余n-1个节点设备各自发送的随机数,并算所接收到的n-1随机数之和作为第i数据和;
第四发送单元,用于将所述第i数据和分别发送给其余n-1个节点设备;
第四接收单元,用于接收其余n-1个节点设备发送的n-1个数据和,并基于接收到的n-1个数据和以及所述第i数据和确定所述第t平均值。
可选的,t+1为n-1,所述装置还包括:
第一生成模块,用于生成第二随机数,所述第二随机数为正数;
第一发送模块,用于将所述第二随机数发送给第i+1节点设备,所述第i+1节点设备用于计算第一数据积,并将所述第一数据积发送至第i+2节点设备,所述第一数据积为所述第二随机数与第i+1节点设备的有效节点数据之积;
第一接收模块,用于接收第i-1节点设备发送的第n-1数据积,所述第n-1数据积为所述n个节点设备中除第i节点设备以外的n-1个节点设备的有效节点数据以及所述第二随机数之积;
第二确定模块,用于根据所述第i节点设备的有效节点数据的n-1次方与所述第n-1数据积的差,确定数值比较算子;
第三确定模块,用于若所述数值比较算子大于或等于0,且第n-2轮联合计算中第i节点数据大于或等于第n-2平均值,则确定所述第i节点设备对应的有效节点数据为最值,所述第i节点数据为有效节点数据或无效节点数据。
可选的,n为3,t+1为2,所述第i节点设备为第二节点设备,所述装置还包括:
第二生成模块,用于生成第三随机数,所述第三随机数为正数;
第二发送模块,用于将所述第三随机数或第三随机数的倒数发送至第三节点设备,并将第一乘积发送至第一节点设备,所述第一乘积为所述第三随机数与第二节点设备的有效节点数据之积,所述第三节点设备用于计算第二乘积并将所述第二乘积发送至所述第一节点设备,所述第二乘积为所述第三随机数的倒数与第三节点设备的有效节点数据之积,所述第一节点设备用于接收所述第一乘积和所述第二乘积,并基于所述第一乘积和所述第二乘积计算第一数值比较算子,所述第一数值比较算子为所述第一节点设备的有效节点数据的平方与所述第三乘积之差,所述第三乘积为所述第二节点数据与所述第三节点数据之积。
可选的,所述装置还包括:
第二接收模块,用于接收所述第三节点设备发送的第四乘积和所述第一节点设备发送的第五乘积,所述第三节点设备用于生成第四随机数并将所述第四随机数发送至所述第一节点设备,所述第一节点设备用于基于所述第四随机数确定所述第五乘积,所述第四乘积为所述第三节点设备的有效节点数据与所述第四随机数之积,所述第五乘积为所述第四随机数的倒数与所述第一节点设备的有效节点数据之积;
第三计算模块,用于基于所述第四乘积以及所述第五乘积计算第二数值比较算子,所述第二数值比较算子为所述第二节点设备的有效节点数据的平方与第六乘积之差,所述第六乘积为所述第一节点设备的有效节点数据与所述第三节点设备的有效节点数据之积;
第四确定模块,用于若所述第二数据比较算子大于或等于0,且第n-2轮联合计算中第二节点数据大于或等于第n-2平均值,则确定所述第二节点设备对应的有效节点数据为最值,所述第二节点数据为所述第二节点设备的有效节点数据或所述无效节点数据。
可选的,所述装置还包括:
分组模块,用于若n大于3,则按照小组划分方式将所述n个节点设备 划分为至少一层设备组,且每层设备组中包括至少3个上一层设备组,第一层设备组中每个设备组由1个节点设备或至少3个节点设备组成;
第四计算模块,用于若所述第i节点设备的有效节点数据为第m层设备组中所述第i节点设备所在参与方小组的最值,则基于所述第i节点设备的有效节点数据进行第m+1层设备组之间的联合计算,m为正整数;
第五确定模块,用于若所述第i节点设备的有效节点数据为最后一层设备组中各个有效设备节点中的最值,则确定所述第i节点设备的有效节点数据为n个节点设备对应的n个有效节点数据中的最值。
可选的,所述装置还包括:
第六确定模块,用于响应于最大值计算指令,将所述第i节点设备的原始有效节点数据确定为所述第i节点设备的有效节点数据;
所述第一确定模块1504,还包括:
第三确定单元,用于第n-1轮联合计算后,若所述第i节点设备的有效节点数据大于或等于所述第n-1平均值,则确定所述第i节点设备的原始有效节点数据为最大值。
可选的,所述装置还包括:
第七确定模块,用于响应于最小值计算指令,将所述第i节点设备的原始有效节点数据的相反数确定为所述第i节点设备的有效节点数据;
所述第一确定模块1504,还包括:
第四确定单元,用于第n-1轮联合计算后,若所述第i节点设备的有效节点数据大于或等于所述第n-1平均值,则确定所述第i节点设备的原始有效节点数据为最小值。
综上所述,本申请实施例中,计算n个节点设备对应的数据的平均值,各个节点设备通过比较己方数据与当前一轮联合计算的平均值的大小,能够在己方数据小于平均值时明确己方数据不是最值,并在小于等于平均值时将有效节点数据替换为无效节点数据参与下一轮的平均值计算,使联合计算的平均值能够收敛,即逐步接近最值,进而在第n-1轮时得到结果,能够有效解决多方安全计算最值的问题,且节点设备无需泄露隐私数据以及各个数据之间的大小关系,基于多方安全计算均值的方法,不涉及加密和解密操作,计算复杂度和通信开销较小,能够提高计算效率。
请参考图16,其示出了本申请一个实施例提供的计算机设备的结构示意图。
所述计算机设备1600包括中央处理单元(Central Processing Unit,CPU)1601、包括随机存取存储器(Random Access Memory,RAM)1602和只读存储器(Read Only Memory,ROM)1603的系统存储器1604,以及连接系统存储器1604和中央处理单元1601的系统总线1605。所述计算机设备1600 还包括帮助计算机内的各个器件之间传输信息的基本输入/输出(Input/Output,I/O)控制器1606,和用于存储操作系统1613、应用程序1614和其他程序模块1615的大容量存储设备1607。
所述基本输入/输出系统1606包括有用于显示信息的显示器1608和用于用户输入信息的诸如鼠标、键盘之类的输入设备1609。其中所述显示器1608和输入设备1609都通过连接到系统总线1605的输入输出控制器1610连接到中央处理单元1601。所述基本输入/输出系统1606还可以包括输入输出控制器1610以用于接收和处理来自键盘、鼠标、或电子触控笔等多个其他设备的输入。类似地,输入/输出控制器1610还提供输出到显示屏、打印机或其他类型的输出设备。
所述大容量存储设备1607通过连接到系统总线1605的大容量存储控制器(未示出)连接到中央处理单元1601。所述大容量存储设备1607及其相关联的计算机可读介质为计算机设备1600提供非易失性存储。也就是说,所述大容量存储设备1607可以包括诸如硬盘或者只读光盘(Compact Disc Read-Only Memory,CD-ROM)驱动器之类的计算机可读介质(未示出)。
不失一般性,所述计算机可读介质可以包括计算机存储介质和通信介质。计算机存储介质包括以用于存储诸如计算机可读指令、数据结构、程序模块或其他数据等信息的任何方法或技术实现的易失性和非易失性、可移动和不可移动介质。计算机存储介质包括RAM、ROM、可擦除可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、闪存或其他固态存储其技术,CD-ROM、数字视频光盘(Digital Video Disc,DVD)或其他光学存储、磁带盒、磁带、磁盘存储或其他磁性存储设备。当然,本领域技术人员可知所述计算机存储介质不局限于上述几种。上述的系统存储器1604和大容量存储设备1607可以统称为存储器。
根据本申请的各种实施例,所述计算机设备1600还可以通过诸如因特网等网络连接到网络上的远程计算机运行。也即计算机设备1600可以通过连接在所述系统总线1605上的网络接口单元1611连接到网络1612,或者说,也可以使用网络接口单元1611来连接到其他类型的网络或远程计算机系统(未示出)。
所述存储器还包括至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、至少一段程序、代码集或指令集存储于存储器中,且经配置以由一个或者一个以上处理器执行,以实现上述多方安全确定最值的方法。
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质存储有至少一条指令,所述至少一条指令由处理器加载并执行以实现如上各个实施例所述的多方安全确定最值的方法。
根据本申请的一个方面,提供了一种计算机程序产品或计算机程序,该 计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述方面的各种可选实现方式中提供的多方安全确定最值的方法。
本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请实施例所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读存储介质中或者作为计算机可读存储介质上的一个或多个指令或代码进行传输。计算机可读存储介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (16)

  1. 一种多方安全确定最值的方法,所述方法由联合计算系统中的第i节点设备执行,所述联合计算系统包括n个节点设备,n为大于2的整数,i为小于或等于n的正整数,所述方法包括:
    获取第t轮联合计算得到的第t平均值;所述第t平均值是基于所述n个节点设备的n个节点数据以及平均系数计算得到的,所述n个节点数据中包括m个有效节点数据,且所述平均系数随联合计算轮数的增加而递减,t为小于n-1的正整数,m为小于或等于n的正整数;
    若所述第i节点设备的有效节点数据大于所述第t平均值,则基于所述第i节点设备的有效节点数据进行第t+1轮联合计算;若所述第i节点设备的有效节点数据小于或等于所述第t平均值,则基于无效节点数据进行第t+1轮联合计算;
    第n-1轮联合计算后,若所述第i节点设备的有效节点数据大于或等于第n-1平均值,则确定所述第i节点设备的有效节点数据为最值。
  2. 根据权利要求1所述的方法,所述若所述第i节点设备的有效节点数据小于或等于所述第t平均值,则基于无效节点数据进行第t+1轮联合计算,包括:
    若所述第i节点设备的有效节点数据小于所述第t平均值,则基于所述无效节点数据进行第t+1轮联合计算,并确定所述第i节点设备对应的有效节点数据不是最值;
    若所述第i节点设备的有效节点数据等于所述第t平均值,则基于所述无效节点数据进行第t+1轮联合计算,并基于第t+1平均值与所述无效节点数据之间的关系确定最值。
  3. 根据权利要求2所述的方法,所述基于第t+1平均值与所述无效节点数据之间的关系确定最值,包括:
    若所述第t+1平均值大于所述无效节点数据,则确定所述第i节点设备对应的有效节点数据不是最值;
    若所述第t+1平均值等于所述无效节点数据,且t+1为n-1,则确定所述第i节点设备的有效节点数据为最值;
    若所述第t+1平均值等于所述无效节点数据,且t+1小于n-1,则基于所述无效节点数据与后续联合计算得到的平均值之间的关系确定最值。
  4. 根据权利要求1至3任一所述的方法,所述第i节点设备为第一节点设备,所述获取第t轮联合计算得到的第t平均值,包括:
    生成第一随机数;
    计算第一节点数据与所述第一随机数之和,作为第一数据和,并将所述第一数据和发送给第二节点设备;所述第二节点设备用于计算第二数据和,并将所述第二数据和发送给第三节点设备,所述第二数据和为所述第一数据 和与第二节点数据之和;其中,第j节点数据为所述第j节点设备的有效节点数据或无效节点数据,j为小于或等于n的正整数;
    接收第n节点设备发送的第n数据和;所述第n数据和为n个节点数据与所述第一随机数之和;
    基于所述第n数据和以及所述第一随机数确定所述第t平均值。
  5. 根据权利要求4所述的方法,所述方法还包括:
    接收第j-1节点设备发送的第j-1数据和;所述第j-1数据和为第一节点数据至第j-1节点数据与所述第一随机数之和,j为大于1,且小于或等于n的整数;
    基于所述第j-1数据和确定第j数据和;所述第j数据和为所述第j-1数据和与第j节点数据之和;
    当j不等于n时,将所述第j数据和发送给第j+1节点设备;当j等于n时,将所述第j数据和发送给所述第一节点设备。
  6. 根据权利要求1至3任一所述的方法,所述获取第t轮联合计算得到的第t平均值,包括:
    生成n-1个随机数;所述n-1个随机数之和为第i节点数据,所述第i节点数据为所述第i节点设备的有效节点数据或无效节点数据;
    将所述n-1个随机数分别发送给其余n-1个节点设备,每个节点设备接收到所述第i节点设备发送的1个随机数;
    接收所述其余n-1个节点设备各自发送的随机数,并计算所接收到的n-1随机数之和作为第i数据和;
    将所述第i数据和分别发送给所述其余n-1个节点设备;
    接收所述其余n-1个节点设备发送的n-1个数据和,并基于接收到的n-1个数据和以及所述第i数据和确定所述第t平均值。
  7. 根据权利要求1至3任一所述的方法,t+1为n-1,所述获取第t轮联合计算得到的第t平均值之后,所述方法还包括:
    生成第二随机数;所述第二随机数为正数;
    将所述第二随机数发送给第i+1节点设备;所述第i+1节点设备用于计算第一数据积,并将所述第一数据积发送至第i+2节点设备,所述第一数据积为所述第二随机数与第i+1节点设备的有效节点数据之积;
    接收第i-1节点设备发送的第n-1数据积;所述第n-1数据积为所述n个节点设备中除所述第i节点设备以外的n-1个节点设备的有效节点数据以及所述第二随机数之积;
    根据所述第i节点设备的有效节点数据的n-1次方与所述第n-1数据积的差,确定数值比较算子;
    若所述数值比较算子大于或等于0,且第n-2轮联合计算中第i节点数据大于或等于第n-2平均值,则确定所述第i节点设备对应的有效节点数据为最 值,所述第i节点数据为有效节点数据或无效节点数据。
  8. 根据权利要求1至3任一所述的方法,n为3,t+1为2,所述第i节点设备为第二节点设备,所述获取第t轮联合计算得到的第t平均值之后,所述方法还包括:
    生成第三随机数;所述第三随机数为正数;
    将所述第三随机数或第三随机数的倒数发送至第三节点设备,并将第一乘积发送至第一节点设备;所述第一乘积为所述第三随机数与第二节点设备的有效节点数据之积;所述第三节点设备用于计算第二乘积,并将所述第二乘积发送至所述第一节点设备,所述第二乘积为所述第三随机数的倒数与第三节点设备的有效节点数据之积;所述第一节点设备用于接收所述第一乘积和所述第二乘积,并基于所述第一乘积和所述第二乘积计算第一数值比较算子,所述第一数值比较算子为所述第一节点设备的有效节点数据的平方与第三乘积之差,所述第三乘积为所述第二节点数据与所述第三节点数据之积。
  9. 根据权利要求8所述的方法,所述方法还包括:
    接收所述第三节点设备发送的第四乘积和所述第一节点设备发送的第五乘积;所述第三节点设备用于生成第四随机数并将所述第四随机数发送至所述第一节点设备;所述第一节点设备用于基于所述第四随机数确定所述第五乘积;所述第四乘积为所述第三节点设备的有效节点数据与所述第四随机数之积,所述第五乘积为所述第四随机数的倒数与所述第一节点设备的有效节点数据之积;
    基于所述第四乘积以及所述第五乘积计算第二数值比较算子;所述第二数值比较算子为所述第二节点设备的有效节点数据的平方与第六乘积之差,所述第六乘积为所述第一节点设备的有效节点数据与所述第三节点设备的有效节点数据之积;
    若所述第二数据比较算子大于或等于0,且第n-2轮联合计算中第二节点数据大于或等于第n-2平均值,则确定所述第二节点设备对应的有效节点数据为最值;所述第二节点数据为所述第二节点设备的有效节点数据或所述无效节点数据。
  10. 根据权利要求1至3任一所述的方法,所述方法还包括:
    若n大于3,则按照小组划分方式将所述n个节点设备划分为至少一层设备组,且每层设备组中包括至少3个上一层设备组,第一层设备组中每个设备组由1个节点设备或至少3个节点设备组成;
    若所述第i节点设备的有效节点数据为第m层设备组中所述第i节点设备所在参与方小组的最值,则基于所述第i节点设备的有效节点数据进行第m+1层设备组之间的联合计算,m为正整数;
    若所述第i节点设备的有效节点数据为最后一层设备组中各个有效设备节点中的最值,则确定所述第i节点设备的有效节点数据为n个节点设备的n 个有效节点数据中的最值。
  11. 根据权利要求1至3任一所述的方法,所述获取第t轮联合计算得到的第t平均值之前,所述方法还包括:
    响应于最大值计算指令,将所述第i节点设备的原始有效节点数据确定为所述第i节点设备的有效节点数据;
    所述第n-1轮联合计算后,若所述第i节点设备的有效节点数据大于或等于第n-1平均值,则确定所述第i节点设备的有效节点数据为最值,包括:
    第n-1轮联合计算后,若所述第i节点设备的有效节点数据大于或等于所述第n-1平均值,则确定所述第i节点设备的原始有效节点数据为最大值。
  12. 根据权利要求1至3任一所述的方法,所述获取第t轮联合计算得到的第t平均值之前,所述方法还包括:
    响应于最小值计算指令,将所述第i节点设备的原始有效节点数据的相反数确定为所述第i节点设备的有效节点数据;
    所述第n-1轮联合计算后,若所述第i节点设备的有效节点数据大于或等于第n-1平均值,则确定所述第i节点设备的有效节点数据为最值,包括:
    第n-1轮联合计算后,若所述第i节点设备的有效节点数据大于或等于所述第n-1平均值,则确定所述第i节点设备的原始有效节点数据为最小值。
  13. 一种多方安全确定最值的装置,所述装置包括:
    第一获取模块,用于获取第t轮联合计算得到的第t平均值;所述第t平均值是基于n个节点设备的n个节点数据以及平均系数计算得到的,所述n个节点数据中包括m个有效节点数据,且所述平均系数随联合计算轮数的增加而递减,t为小于n-1的正整数,m为小于或等于n的正整数;
    第一计算模块,用于若第i节点设备的有效节点数据大于所述第t平均值,则基于所述第i节点设备的有效节点数据进行第t+1轮联合计算;
    第二计算模块,用于若所述第i节点设备的有效节点数据小于或等于所述第t平均值,则基于无效节点数据进行第t+1轮联合计算;
    第一确定模块,用于在第n-1轮联合计算后,若所述第i节点设备的有效节点数据大于或等于第n-1平均值,则确定所述第i节点设备的有效节点数据为最值。
  14. 一种计算机设备,所述计算机设备包括处理器和存储器;所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如权利要求1至12任一所述的多方安全确定最值的方法。
  15. 一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一条计算机程序,所述计算机程序由处理器加载并执行以实现如权利要求1至12任一所述的多方安全确定最值的方法。
  16. 一种计算机程序产品,包括指令,当其在计算机上运行时,使得计 算机实现如权利要求1至12任一所述的多方安全确定最值的方法。
PCT/CN2022/108090 2021-08-18 2022-07-27 多方安全确定最值的方法、装置、设备及存储介质 WO2023020216A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2023566958A JP2024515332A (ja) 2021-08-18 2022-07-27 秘匿マルチパーティ計算に基づく極値の決定方法、装置、コンピュータ機器及びコンピュータプログラム
US18/314,419 US20230283461A1 (en) 2021-08-18 2023-05-09 Method, device, and storage medium for determining extremum based on secure multi-party computation

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110946118.3 2021-08-18
CN202110946118.3A CN113408001B (zh) 2021-08-18 2021-08-18 多方安全确定最值的方法、装置、设备及存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/314,419 Continuation US20230283461A1 (en) 2021-08-18 2023-05-09 Method, device, and storage medium for determining extremum based on secure multi-party computation

Publications (1)

Publication Number Publication Date
WO2023020216A1 true WO2023020216A1 (zh) 2023-02-23

Family

ID=77688752

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/108090 WO2023020216A1 (zh) 2021-08-18 2022-07-27 多方安全确定最值的方法、装置、设备及存储介质

Country Status (4)

Country Link
US (1) US20230283461A1 (zh)
JP (1) JP2024515332A (zh)
CN (1) CN113408001B (zh)
WO (1) WO2023020216A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116401715A (zh) * 2023-06-08 2023-07-07 中国移动紫金(江苏)创新研究院有限公司 基于区块链的医疗数据流通隐私计算方法及系统

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113408001B (zh) * 2021-08-18 2021-11-09 腾讯科技(深圳)有限公司 多方安全确定最值的方法、装置、设备及存储介质
CN115037436B (zh) * 2022-04-29 2023-09-29 北京龙腾佳讯科技股份公司 安全多方计算数据均值的方法及系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080021899A1 (en) * 2006-07-21 2008-01-24 Shmuel Avidan Method for classifying private data using secure classifiers
CN108334577A (zh) * 2018-01-24 2018-07-27 东北大学 一种安全多方数值型记录匹配方法
CN108880782A (zh) * 2018-08-31 2018-11-23 西安科技大学 一种云计算平台下最小值的保密计算方法
CN111444526A (zh) * 2020-03-27 2020-07-24 上海观源信息科技有限公司 基于计算机软件实现近似最大值计算的安全多方计算控制方法及相应的系统
CN113032839A (zh) * 2021-05-25 2021-06-25 华控清交信息科技(北京)有限公司 一种数据处理方法、装置和用于数据处理的装置
CN113408001A (zh) * 2021-08-18 2021-09-17 腾讯科技(深圳)有限公司 多方安全确定最值的方法、装置、设备及存储介质

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104632202B (zh) * 2014-12-25 2017-06-13 中国石油天然气股份有限公司 确定干粘土三孔隙度测井参数值的方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080021899A1 (en) * 2006-07-21 2008-01-24 Shmuel Avidan Method for classifying private data using secure classifiers
CN108334577A (zh) * 2018-01-24 2018-07-27 东北大学 一种安全多方数值型记录匹配方法
CN108880782A (zh) * 2018-08-31 2018-11-23 西安科技大学 一种云计算平台下最小值的保密计算方法
CN111444526A (zh) * 2020-03-27 2020-07-24 上海观源信息科技有限公司 基于计算机软件实现近似最大值计算的安全多方计算控制方法及相应的系统
CN113032839A (zh) * 2021-05-25 2021-06-25 华控清交信息科技(北京)有限公司 一种数据处理方法、装置和用于数据处理的装置
CN113408001A (zh) * 2021-08-18 2021-09-17 腾讯科技(深圳)有限公司 多方安全确定最值的方法、装置、设备及存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116401715A (zh) * 2023-06-08 2023-07-07 中国移动紫金(江苏)创新研究院有限公司 基于区块链的医疗数据流通隐私计算方法及系统
CN116401715B (zh) * 2023-06-08 2023-08-22 中国移动紫金(江苏)创新研究院有限公司 基于区块链的医疗数据流通隐私计算方法及系统

Also Published As

Publication number Publication date
JP2024515332A (ja) 2024-04-08
CN113408001A (zh) 2021-09-17
US20230283461A1 (en) 2023-09-07
CN113408001B (zh) 2021-11-09

Similar Documents

Publication Publication Date Title
WO2022237450A1 (zh) 多方安全计算方法、装置、设备及存储介质
Patra et al. BLAZE: blazing fast privacy-preserving machine learning
WO2023020216A1 (zh) 多方安全确定最值的方法、装置、设备及存储介质
CN111512589B (zh) 用于利用spdz的快速安全多方内积的方法
WO2021068444A1 (zh) 数据处理方法、装置、计算机设备和存储介质
Yuan et al. Privacy preserving back-propagation neural network learning made practical with cloud computing
CN113158239B (zh) 保护数据隐私的选择问题处理方法
Mendis et al. A blockchain-powered decentralized and secure computing paradigm
WO2022121623A1 (zh) 一种数据集合求交方法及装置
CN114154554B (zh) 一种基于非共谋双云服务器的隐私保护外包数据knn方法
CN111026359B (zh) 多方联合判定隐私数据的数值范围的方法和装置
CN111917533A (zh) 具有减少泄漏的区间统计量的隐私保护基准分析
Qin et al. Privacy-preserving wildcards pattern matching protocol for IoT applications
CN116743376A (zh) 基于高效密文混淆技术的多方秘密分享数据隐私比较方法
Marwan et al. A cloud-based framework to secure medical image processing
Rong et al. Privacy‐Preserving k‐Means Clustering under Multiowner Setting in Distributed Cloud Environments
Yang et al. EMPSI: Efficient multiparty private set intersection (with cardinality)
CN117768180A (zh) 一种基于对称密钥伪随机函数的隐私集合交集计算方法
Liu et al. ESA-FedGNN: Efficient secure aggregation for federated graph neural networks
Sharma et al. Privacy-preserving deep learning with SPDZ
TWI776416B (zh) 分層確定性錢包的門檻式簽章系統及其方法
Rong et al. Outsourced k-means clustering over encrypted data under multiple keys in spark framework
CN117009723B (zh) 一种多方计算方法、装置、设备及存储介质
CN116305187B (zh) 一种基于混合加密的决策流模型计算方法及装置
CN116055049B (zh) 多方安全计算方法、装置、系统、电子设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22857529

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2023566958

Country of ref document: JP

WWE Wipo information: entry into national phase

Ref document number: 2301007824

Country of ref document: TH

NENP Non-entry into the national phase

Ref country code: DE