Secure multi-party computing method and related equipment

By introducing UUID generator and IO multiplexing mechanism in a secure multi-party computing system, concurrent execution of multi-tasks is achieved, and the problems of low computing efficiency and response time delay in the prior art are solved, and computing efficiency and throughput are improved.

CN114329533BActive Publication Date: 2025-04-18INSIGHT TECHNOLOGY (XIONGAN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111582481.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-22
Publication Date
2025-04-18
Estimated Expiration
2041-12-22

AI Technical Summary

Technical Problem

Existing secure multi-party computing technology is difficult to achieve multi-task concurrent execution, resulting in low computing efficiency and extended response time.

Method used

By introducing UUID generator and IO multiplexing mechanism in a secure multi-party computing system, a globally unique task number is generated, multi-task concurrent execution is realized, and computing efficiency is improved through technical means such as thread pools and hash tables.

Benefits of technology

It realizes secure multi-party computing for concurrent multi-task execution, improves computing efficiency and throughput, and reduces response delay.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114329533B_ABST
    Figure CN114329533B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a secure multi-party computing method and related equipment, which are applied to the first computing node in the secure multi-party computing system, the first computing node is any computing participant in the secure multi-party computing system, the secure multi-party computing system includes P computing nodes, the P computing nodes include a data provider and Q computing participants, P and Q are both positive integers, and P is greater than or equal to 2; the method includes: obtaining the first data in the secret shared data provided by the data provider; calculating the first data to obtain the first intermediate computing parameter; obtaining the second intermediate computing parameters of the other computing parties in the Q computing participants except the first computing node; performing data recovery according to the first intermediate computing parameter and the second intermediate computing parameter to obtain the final computing result. The embodiment of the present application can realize secure multi-party computing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of data security technology and privacy protection technology, and specifically to a secure multi-party computing method and related equipment. Background Art

[0002] Secure multi-party computation (SMPC) refers to the secure completion of a collaborative computation through the joint participation of multiple parties without a trusted third party. It is mainly used for multiple parties to cooperate in executing computing tasks and obtaining the final computing results without exposing their local data. Summary of the invention

[0003] The embodiments of the present application provide a secure multi-party computing method and related devices, which can realize secure multi-party computing with concurrent execution of multiple tasks.

[0004] In a first aspect, an embodiment of the present application provides a secure multi-party computing method, which is applied to a first computing node in a secure multi-party computing system, where the first computing node is any computing participant in the secure multi-party computing system, and the secure multi-party computing system includes P computing nodes, where the P computing nodes include a data provider and Q computing participants, where P and Q are both positive integers, and P is greater than or equal to 2; the method includes:

[0005] Acquire first data from the secret-sharing data provided by the data provider;

[0006] Calculate the first data to obtain a first intermediate calculation parameter;

[0007] Obtaining second intermediate computing parameters of other computing parties among the Q computing participants except the first computing node;

[0008] Data recovery is performed according to the first intermediate calculation parameter and the second intermediate calculation parameter to obtain a final calculation result.

[0009] In a second aspect, an embodiment of the present application provides a secure multi-party computing device, which is applied to a first computing node in a secure multi-party computing system, wherein the first computing node is any computing participant in the secure multi-party computing system, and the secure multi-party computing system includes P computing nodes, wherein the P computing nodes include a data provider and Q computing participants, wherein P and Q are both positive integers, and P is greater than or equal to 2; the device includes: a first acquisition unit, a computing unit, a second acquisition unit, and a data recovery unit, wherein:

[0010] The first acquisition unit is used to acquire first data from the secret-sharing data provided by the data provider;

[0011] The calculation unit is used to calculate the first data to obtain a first intermediate calculation parameter;

[0012] The second acquisition unit is used to acquire second intermediate computing parameters of other computing parties among the Q computing participants except the first computing node;

[0013] The data recovery unit is used to perform data recovery according to the first intermediate calculation parameter and the second intermediate calculation parameter to obtain a final calculation result.

[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps in the first aspect of the embodiment of the present application.

[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps described in the first aspect of the embodiment of the present application.

[0016] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in the first aspect of the embodiment of the present application. The computer program product may be a software installation package.

[0017] In a sixth aspect, an embodiment of the present application provides a secure multi-party computing system, which includes: at least one computing node and a scheduling node as described in the first aspect, and a computing node serving as a data provider.

[0018] The implementation of the embodiments of the present application has the following beneficial effects:

[0019] It can be seen that the secure multi-party computing method and related equipment described in the embodiments of the present application are applied to the first computing node in the secure multi-party computing system, the first computing node is any computing participant in the secure multi-party computing system, the secure multi-party computing system includes P computing nodes, the P computing nodes include a data provider and Q computing participants, P and Q are both positive integers, and P is greater than or equal to 2; obtain the first data in the secret shared data provided by the data provider, calculate the first data to obtain the first intermediate computing parameter, obtain the second intermediate computing parameters of the other computing parties among the Q computing participants except the first computing node, perform data recovery according to the first intermediate computing parameters and the second intermediate computing parameters, and obtain the final computing result, so as to realize secure multi-party computing. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1 It is a structural diagram of a secure multi-party computing system for implementing a secure multi-party computing method provided in an embodiment of the present application;

[0022] Figure 2 It is a flowchart of a secure multi-party computing method provided by an embodiment of the present application;

[0023] Figure 3 It is a structural diagram of another secure multi-party computing system for implementing a secure multi-party computing method provided in an embodiment of the present application;

[0024] Figure 4 is a schematic diagram of the structure of a computing node provided in an embodiment of the present application;

[0025] Figure 5 It is a demonstration diagram of a secure multi-party computing protocol provided in an embodiment of the present application;

[0026] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0027] Figure 7 It is a block diagram of the functional units of a secure multi-party computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0029] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0030] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0031] The electronic devices described in the embodiments of the present application may include smart phones (such as Android phones, iOS phones, Windows Phone phones, etc.), tablet computers, PDAs, driving recorders, laptop computers, mobile Internet devices (MID, Mobile Internet Devices) or wearable devices (such as smart watches, Bluetooth headsets), etc. The above are only examples and not exhaustive, including but not limited to the above electronic devices, and the electronic device can also be a server.

[0032] The following is a detailed description of the embodiments of the present application.

[0033] See also Figure 1 , Figure 1 This is a structural diagram of a secure multi-party computing system for implementing a secure multi-party computing method provided in an embodiment of the present application. As shown in the figure, the secure multi-party computing system includes: a scheduling node, a UUID generator and multiple computing nodes.

[0034] Among them, the scheduling node, the UUID generator, and each of the multiple computing nodes can be an independent electronic device.

[0035] In the embodiment of the present application, the communication mechanism between any two devices of the scheduling node, the UUID generator and the multiple computing nodes can be a TCP long connection communication mechanism. Among them, by introducing the TCP long connection communication mechanism, that is, one connection, long-term online, compared with the TCP short connection (three handshakes, each use requires a connection) communication method, the communication efficiency is improved.

[0036] In the specific implementation, based on the above Figure 1 In the secure multi-party computing system described, the first computing node is any computing participant in the secure multi-party computing system, the secure multi-party computing system includes P computing nodes, the P computing nodes include a data provider and Q computing participants, P and Q are both positive integers, and P is greater than or equal to 2, the first computing node in the secure multi-party computing system, the first computing node can be used to implement the following functions:

[0037] Acquire first data from the secret-sharing data provided by the data provider;

[0038] Calculate the first data to obtain a first intermediate calculation parameter;

[0039] Obtaining second intermediate computing parameters of other computing parties among the Q computing participants except the first computing node;

[0040] Data recovery is performed according to the first intermediate calculation parameter and the second intermediate calculation parameter to obtain a final calculation result.

[0041] It can be seen that in the embodiment of the present application, the first computing node is any computing participant in the secure multi-party computing system, the secure multi-party computing system includes P computing nodes, the P computing nodes include a data provider and Q computing participants, P and Q are both positive integers, and P is greater than or equal to 2; the first data in the secret shared data provided by the data provider is obtained, the first data is calculated to obtain a first intermediate computing parameter, the second intermediate computing parameters of the other computing parties among the Q computing participants except the first computing node are obtained, data recovery is performed according to the first intermediate computing parameters and the second intermediate computing parameters to obtain the final calculation result, so that secure multi-party computing can be realized.

[0042] See also Figure 2 , Figure 2 is a flowchart of a secure multi-party computing method provided by an embodiment of the present application, which is applied to Figure 1The secure multi-party computing system shown in the figure is applied to a first computing node in the secure multi-party computing system, the first computing node is any computing participant in the secure multi-party computing system, the secure multi-party computing system includes P computing nodes, the P computing nodes include a data provider and Q computing participants, P and Q are both positive integers, and P is greater than or equal to 2; the secure multi-party computing method includes:

[0043] 201. Obtain first data from secret-sharing data provided by the data provider.

[0044] In the specific implementation, in order to ensure the privacy and security of the local data of the computing participants, multiple rounds of communication are required between the computing nodes during the computing process, and cryptographic technologies such as pseudo-random number generation and homomorphic encryption are introduced to protect the security of the computing process. Figure 3 As shown, any one of computing node A, computing node B and computing node C can be a data provider, and the other two computing nodes can be computing participants. The three computing nodes can interact through intermediate computing parameters to restore the computing results of the computing participants, that is, to obtain the analysis results of at least one dimension of the secretly shared data. For example, the secretly shared data is the health data of different users, and the analysis result of the at least one dimension can be the ratio of male and female users obtained from the secretly shared data.

[0045] In the implementation of this application, the data provider can divide the data that needs to be shared secretly into multiple copies, the multiple copies are at least two copies, and the data of each copy is part of the data to be shared secretly. The first data can be a random number.

[0046] Optionally, the secure multi-party computing system includes: a UUID generator and a scheduling node, the UUID generator is used to generate a target task number, and the P computing nodes are configured as a group through the target task number.

[0047] Among them, the universally unique identifier (UUID) introduces a globally unique UUID to ensure the uniqueness of local computing tasks. In the embodiments of the present application, an IO multiplexing mechanism and a globally unique UUID generation mechanism are introduced to ensure the global uniqueness of secure multi-party computing tasks, thereby facilitating the concurrent execution of multiple tasks and increasing concurrency and throughput compared to secure multi-party computing tasks executed sequentially.

[0048] 202. Calculate the first data to obtain a first intermediate calculation parameter.

[0049] Among them, different computing nodes have corresponding local logics that are different, and the first computing node performs calculations according to its local specific logic, and specifically, the first data may be calculated to obtain a first intermediate calculation parameter.

[0050] Optionally, the above step 202, calculating the first data to obtain a first intermediate calculation parameter, may include the following steps:

[0051] 21. Determine a first computing task corresponding to the first data;

[0052] 22. Write the first computing task into a task queue to wait for execution of the first computing task;

[0053] 23. Polling the task queue through a computing management thread;

[0054] 24. If the task queue is not empty, take out the first task of the task queue, start the computing thread and add the first task to the thread pool for execution. The thread pool includes multiple computing task threads, each computing task thread independently executes the computing task to obtain the first intermediate computing parameter.

[0055] In the specific implementation, Figure 4 As shown, the scheduling node is used to allocate UUID, and other computing nodes interact with the computing node A for intermediate computing parameters. Computing node A may include a task management thread, a computing management thread, a computing task thread pool, a parameter hash table, a result hash table, an IO management thread, and a result recovery thread. Computing node A can be any computing node in the secure multi-party computing system, whether it is a data provider or a computing participant, and its specific structure can refer to the structure of computing node A.

[0056] Among them, the task management thread can be used to implement the task writing operation, and write the tasks to be executed into the task queue. A thread-safe queue is adopted to ensure the parallelism of computing tasks while ensuring read and write safety.

[0057] The task queue may include at least one task, for example, task-tid-1, task-tid-2, ..., task-tid-n, and so on.

[0058] The computing management thread is used to poll the task queue, obtain the corresponding tasks in the task queue in turn, and execute the tasks through the computing task thread pool.

[0059] The computing task thread pool may include multiple computing task threads, for example, thread-tid-1, thread-tid-2, ..., thread-tid-n, etc. Each computing task thread corresponds to a computing task, and each computing result is written into the parameter hash table. Specifically, the computing result can be written into the parameter hash table in the form of a polling parameter list. The thread-safe hash table and IO reuse mechanism are introduced to ensure the high efficiency of parameter transmission.

[0060] The result recovery thread can receive result recovery requests sent by other computing nodes or computing result A, and can recover the computing results through the result recovery thread to obtain the final computing result. The result recovery thread can also obtain the corresponding computing results from the result hash table, that is, obtain the computing results by polling the result list, and use these computing results to implement the operation of recovering the computing results to obtain the final computing result.

[0061] The parameter hash table may include: a mapping relationship between the calculation result of the calculation task thread and the hash parameter, that is, the parameter hash table may be represented as: tid-1-p1: param1, tid-2-p2: param2, tid-3-p3: param3, ...

[0062] Among them, the IO management thread can receive the calculation parameters sent by the calculation task thread pool, and can also receive the intermediate calculation parameters sent by other calculation nodes, and can also write the intermediate calculation parameters sent by other calculation nodes into the parameter hash table. Specifically, the intermediate calculation parameters sent by other calculation nodes can be written into the parameter hash table in the form of writing a parameter list. Of course, the parameter results can also be written to the result hash table. The processing of thread-level concurrency realizes the parallel execution of different types of calculation tasks, improves calculation efficiency, reduces response latency, and supports the parallel execution of different types of calculation tasks.

[0063] The result hash table may include a mapping relationship between calculation results and hash parameters, that is, the result hash table may be expressed as: tid-1-res1:res1, tid-2-res2:res2, tid-3-res3:res3, ...

[0064] In the embodiment of the present application, computing tasks are dynamically loaded in the form of a thread pool, and the type of computing tasks (such as addition, multiplication, comparison, etc.) is not bound. Therefore, different types of computing tasks can be executed concurrently, and it has high scalability.

[0065] In a specific implementation, the first data may correspond to a random number, and the first computing task corresponding to the first data may be determined. Different computing nodes may correspond to different computing tasks, which are determined by the structure of the computing node. The first computing task is then written to the task queue to wait for the execution of the first computing task. The task queue is polled by the computing management thread. If the task queue is not empty, the first task of the task queue is taken out, the computing task thread is started, and the first task is added to the thread pool for execution. The thread pool includes multiple computing task threads, and each computing task thread independently executes the computing task to obtain the first intermediate computing parameter. In order to handle the computing load problem in a high-concurrency scenario, the embodiment of the present application introduces a thread-safe message queue, and the message queue memory (computing task queue) is shared between the threads of each computing node. The computing management thread polls the computing task queue. If the queue is not empty, the first task of the team is taken out, and a computing task thread is started at the same time and added to the thread pool for multi-party computing.

[0066] In the specific implementation, an IO multiplexing mechanism can also be introduced to reduce the number of ports. A single thread can handle IO requests between computing nodes. At the same time, a thread-safe hash table can be used to store intermediate computing parameters, and the parameters can be indexed by a globally unique task number (tid) to solve the parameter conflict problem in high-concurrency scenarios. In addition, communication between concurrent threads can be achieved through thread-safe queues and hash tables.

[0067] Optionally, the following steps may also be included:

[0068] A1. Detect whether it is necessary to send the first calculation parameter;

[0069] A2. If the first calculation parameter needs to be sent, notify the IO management thread to send the calculation parameter.

[0070] In a specific implementation, the above-mentioned first calculation parameter can be understood as an internal calculation parameter. The first calculation node can detect whether the first calculation parameter needs to be sent. If the first calculation parameter needs to be sent, the IO management thread is notified to send the calculation parameter. The first calculation parameter can be written into a parameter hash table, or the first calculation parameter can be calculated to write the result parameter into a result hash table.

[0071] Optionally, the following steps may also be included:

[0072] When the IO management thread receives the second computing parameters of other computing nodes, the second computing parameters are classified according to the task numbers of the computing nodes corresponding to the second computing parameters and stored in the parameter hash table to wait for the local computing task thread to query the second computing parameters.

[0073] The second calculation parameter is a calculation parameter from other calculation results, for example, an intermediate calculation parameter. When the IO management thread receives the second calculation parameter of other calculation nodes, the second calculation parameter is classified according to the target task number of the calculation node corresponding to the second calculation parameter, and stored in the parameter hash table to wait for the local calculation task thread to query the second calculation parameter, and then, after the second calculation parameter is calculated, the result parameter can be written to the result hash table.

[0074] Optionally, the following steps may also be included:

[0075] By blocking and polling the parameter hash table to wait for parameter transmission, when the second calculation parameter is queried, corresponding calculation is performed according to the second calculation parameter.

[0076] Among them, the parameter hash table can be blocked and polled to wait for parameter transmission to ensure that the calculation is carried out in an orderly manner. When the second calculation parameter is queried, the corresponding calculation is performed according to the second calculation parameter. After the second calculation parameter is calculated, the result parameter can be written to the result hash table.

[0077] Optionally, the following steps may also be included:

[0078] The calculation results of each computing task thread are written into the result hash table so that they can be queried while waiting for the result recovery thread.

[0079] The calculation result of each calculation task thread may be written into the result hash table, and the result recovery thread may query the corresponding calculation result after receiving the result recovery request to recover the calculation result.

[0080] 203. Obtain second intermediate computing parameters of other computing parties among the Q computing participants except the first computing node.

[0081] Among them, since each of the Q computing participants includes part of the secret shared data, all the intermediate computing parameters of the Q computing participants can be concentrated, that is, all of the secret shared data can be covered, that is, when the result is restored, each party obtains the secret sharing share held by other parties after the secret sharing of the result, thereby achieving the purpose of covering all of the secret shared data, and then, the second intermediate computing parameters of other computing parties except the first computing node among the Q computing participants can be obtained, so that the calculation result can be restored to normal.

[0082] For example, Figure 5As shown, assuming that x and y are the original data (data sources), they are secret-shared into three parts (i.e., x1, x2, x3; y1, y2, y3) and sent to three computing nodes p1, p2, and p3. Then, p1 has the secret shares with subscripts 1 and 2 (i.e., x1, x2, y1, y2), p2 has the secret shares with subscripts 2 and 3 (i.e., x2, x3, y2, y3), and p3 has the secret shares with subscripts 1 and 3 (i.e., x3, x1, y3, y1).

[0083] As shown in the following formula, the specific logic to be calculated can be obtained through this formula. z1, z2 and z3 are the logic to be calculated locally by p1, p2 and p3 respectively. When the calculation is finally completed, p1 will get z1 and z2, p2 will get z2 and z3, and p3 will get z3 and z1. x*y=z1+z2+z3, that is, when restoring the calculation result, any computing node only needs to interact with another computing node to obtain the secret sharing about z that it does not have to restore the final result of x*y.

[0084] xy=(x1+x2+x3)(y1+y2+y3)

[0085] =x1y1+x1y2+x1y3+x2y1+x2y2+x2y3+x3y1+x3y2+x3y3

[0086] Of course, in order to ensure the security of the calculation during the actual calculation process, there will be different rounds of interactions between the computing nodes (p1, p2 and p3).

[0087] Optionally, the above step 203, obtaining the second intermediate computing parameters of other computing parties among the Q computing participants except the first computing node, may include the following steps:

[0088] 31. Initiate a calculation result recovery request to the participant corresponding to the secret shared data through the result recovery thread;

[0089] 32. Obtain the second intermediate calculation result fed back by the participant corresponding to the secret sharing data.

[0090] In a specific implementation, a calculation result recovery request can be initiated to the participant corresponding to the secret shared data through a result recovery thread. That is, after receiving the calculation result recovery request, the result recovery thread can wait to obtain the second intermediate calculation result fed back by the participant corresponding to the secret shared data.

[0091] 204. Perform data recovery according to the first intermediate calculation parameter and the second intermediate calculation parameter to obtain a final calculation result.

[0092] In a specific implementation, since the first intermediate calculation parameter and the second intermediate calculation parameter cover all the contents of the secret shared data, data recovery can be performed according to the first intermediate calculation parameter and the second intermediate calculation parameter to obtain the final calculation result.

[0093] In the specific implementation, taking the three-party secure multi-party computing based on secret sharing as an example (three computing nodes, but the data providers are two of them), the general computing process includes the following steps:

[0094] B1. One party initiates a secure multi-party computing task and notifies the other two participants (computing nodes) at the same time.

[0095] B2. The data providers (two of them) perform data preprocessing respectively, share the local data in secret, and send the parameters after secret sharing to the corresponding computing nodes.

[0096] B3. Each of the three computing nodes performs calculations locally according to specific logic.

[0097] B4. The intermediate calculation parameters are transferred between the three computing nodes according to a specific process.

[0098] B5. Execute steps B3 and B4 several times according to the calculation protocol execution process, and finally obtain the secret sharing of the calculation result.

[0099] B6. The three computing nodes transmit intermediate computing parameters and perform a recovery process of secret sharing to recover the final computing result.

[0100] Among them, different operators can correspond to different computing protocols.

[0101] Further, with another example, in the embodiment of the present application, the participants include a client (receiver) and a server (sender), and the specific steps are as follows:

[0102] C1. A computing participant notifies the scheduling node and initiates a computing request.

[0103] C2. The scheduling node calls the UUID generator to generate a globally unique task number (tid).

[0104] C3. The scheduling node notifies each computing participant, sends the task number (tid) and related parameters, and initiates the computing task.

[0105] C4. After receiving the computing task, each computing participant writes the computing task into the task queue and waits for execution.

[0106] C5. The computing management thread of each computing node polls the task queue. If the queue is not empty, it takes out the first task in the queue, starts the computing task thread and joins the thread pool for execution.

[0107] Each computing task thread in the thread pool of each computing node of C6 executes computing tasks independently.

[0108] C7. If calculation parameters need to be sent, notify the IO management thread to send them;

[0109] C8, if the IO management thread receives the computing parameters from other computing nodes, it will classify them according to the task number (tid) and store them in the hash table of the local memory to wait for the local computing task thread to query;

[0110] C9. If you need to obtain the calculation parameters of other participants, block and poll the parameter hash table to wait for parameter transmission. After querying the calculation parameters, continue the subsequent protocol execution.

[0111] C10. After each computing task thread completes the calculation, it writes the result into the result hash table and waits for the result recovery thread to query it.

[0112] C11. If the calculation results need to be restored, the result recovery thread initiates a request to other nodes. The corresponding node queries the calculation result parameters according to the task number (tid) and sends them. After receiving the result parameters, the computing node restores the calculation results locally.

[0113] In the specific implementation, multiple tasks are carried out simultaneously and different calculation types can be supported. The calculation type can be any calculation type. For example, the calculation type can include at least one of the following: addition calculation type, subtraction calculation type, multiplication calculation type, division calculation type, comparison calculation type, logarithmic calculation type, etc., which are not limited here.

[0114] In the embodiment of the present application, the scenario of three-party computing is taken as an example to realize the rapid execution of secure multi-party computing tasks in multi-task concurrent scenarios. The embodiment of the present application can solve the problems of dynamic loading, IO multiplexing and load balancing of different types of computing tasks in high-concurrency scenarios.

[0115] In a specific implementation, the embodiments of the present application can introduce IO multiplexing and a globally unique UUID generation mechanism to ensure the global uniqueness of secure multi-party computing tasks, thereby facilitating the concurrent execution of multiple tasks, and increasing concurrency and throughput compared to sequentially executed secure multi-party computing tasks.

[0116] To summarize, in the embodiments of the present application, a UUID generator is introduced to generate a globally unique task number (tid) to index multi-party computing tasks and intermediate computing parameters during task execution, thereby ensuring the orderliness of parameter transfer in the shared memory process during inter-thread communication. In addition, a TCP long connection is established between computing nodes to avoid the time overhead of frequent three-way handshakes to establish TCP connections, thereby improving communication efficiency. In addition, an IO multiplexing mechanism is introduced to reduce the number of ports, and a single thread handles IO requests between computing nodes. At the same time, a thread-safe hash table is used to store intermediate computing parameters, and parameter indexing is performed using a globally unique task number (tid) to solve parameter conflict problems in high concurrency scenarios.

[0117] It can be seen that the secure multi-party computing method described in the embodiment of the present application is applied to the first computing node in the secure multi-party computing system, the first computing node is any computing participant in the secure multi-party computing system, the secure multi-party computing system includes P computing nodes, the P computing nodes include a data provider and Q computing participants, P and Q are both positive integers, and P is greater than or equal to 2; obtain the first data in the secret shared data provided by the data provider, calculate the first data to obtain the first intermediate computing parameter, obtain the second intermediate computing parameters of the other computing parties among the Q computing participants except the first computing node, restore the data according to the first intermediate computing parameters and the second intermediate computing parameters, and obtain the final computing result, which can realize secure multi-party computing with concurrent execution of multiple tasks.

[0118] In accordance with the above embodiment, please refer to Figure 6 , Figure 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. As shown in the figure, the electronic device can be Figure 1 The first computing node in the secure multi-party computing system shown in the figure, the electronic device includes a processor, a memory, a communication interface and one or more programs, which are applied to the electronic device, and the one or more programs are stored in the memory and configured to be executed by the processor. In the embodiment of the present application, the program includes instructions for executing the following steps:

[0119] Acquire first data from the secret-sharing data provided by the data provider;

[0120] Calculate the first data to obtain a first intermediate calculation parameter;

[0121] Obtaining second intermediate computing parameters of other computing parties among the Q computing participants except the first computing node;

[0122] Data recovery is performed according to the first intermediate calculation parameter and the second intermediate calculation parameter to obtain a final calculation result.

[0123] Optionally, in the aspect of calculating the first data to obtain a first intermediate calculation parameter, the program includes instructions for executing the following steps:

[0124] Determining a first computing task corresponding to the first data;

[0125] Writing the first computing task into a task queue to wait for execution of the first computing task;

[0126] Polling the task queue by a computing management thread;

[0127] If the task queue is not empty, take out the first task of the task queue, start the computing task thread and add the first task to the thread pool for execution. The thread pool includes multiple computing task threads, each computing task thread independently executes the computing task to obtain the first intermediate computing parameter.

[0128] Optionally, the program further includes instructions for executing the following steps:

[0129] Detecting whether it is necessary to send the first calculation parameter;

[0130] If the first calculation parameter needs to be sent, notify the IO management thread to send the calculation parameter;

[0131] or,

[0132] When the IO management thread receives the second computing parameters of other computing nodes, the second computing parameters are classified according to the target task number of the computing node corresponding to the second computing parameter and stored in the parameter hash table to wait for the local computing task thread to query the second computing parameters.

[0133] Optionally, the program further includes instructions for executing the following steps:

[0134] By blocking and polling the parameter hash table to wait for parameter transmission, when the second calculation parameter is queried, corresponding calculation is performed according to the second calculation parameter.

[0135] Optionally, the program further includes instructions for executing the following steps:

[0136] The calculation results of each computing task thread are written into the result hash table so that they can be queried while waiting for the result recovery thread.

[0137] Optionally, in the aspect of obtaining the second intermediate computing parameters of other computing parties among the Q computing participants except the first computing node, the above program includes instructions for performing the following steps:

[0138] Initiate a calculation result recovery request to the participant corresponding to the secret shared data through the result recovery thread;

[0139] Obtain the second intermediate calculation result fed back by the participant corresponding to the secret sharing data.

[0140] Optionally, the secure multi-party computing system includes: a UUID generator and a scheduling node, the UUID generator is used to generate a target task number, and the P computing nodes are configured as a group through the target task number.

[0141] Figure 7 This is a functional unit composition block diagram of the secure multi-party computing device 700 involved in the embodiment of the present application. The secure multi-party computing device 700 is applied to the first computing node in the secure multi-party computing system. The first computing node is any computing participant in the secure multi-party computing system. The secure multi-party computing system includes P computing nodes, and the P computing nodes include a data provider and Q computing participants. P and Q are both positive integers, and P is greater than or equal to 2. The device 700 includes: a first acquisition unit 701, a computing unit 702, a second acquisition unit 703 and a data recovery unit 704, wherein,

[0142] The first acquisition unit 701 is used to acquire first data from the secret shared data provided by the data provider;

[0143] The calculation unit 702 is used to calculate the first data to obtain a first intermediate calculation parameter;

[0144] The second acquisition unit 703 is used to acquire second intermediate computing parameters of other computing parties among the Q computing participants except the first computing node;

[0145] The data recovery unit 704 is used to perform data recovery according to the first intermediate calculation parameter and the second intermediate calculation parameter to obtain a final calculation result.

[0146] Optionally, in calculating the first data to obtain a first intermediate calculation parameter, the calculation unit 702 is specifically configured to:

[0147] Determining a first computing task corresponding to the first data;

[0148] Writing the first computing task into a task queue to wait for execution of the first computing task;

[0149] Polling the task queue by a computing management thread;

[0150] If the task queue is not empty, take out the first task of the task queue, start the computing task thread and add the first task to the thread pool for execution. The thread pool includes multiple computing task threads, each computing task thread independently executes the computing task to obtain the first intermediate computing parameter.

[0151] Optionally, the device 700 is further specifically used for:

[0152] Detecting whether it is necessary to send the first calculation parameter;

[0153] If the first calculation parameter needs to be sent, notify the IO management thread to send the calculation parameter;

[0154] or,

[0155] When the IO management thread receives the second computing parameters of other computing nodes, the second computing parameters are classified according to the target task number of the computing node corresponding to the second computing parameter and stored in the parameter hash table to wait for the local computing task thread to query the second computing parameters.

[0156] Optionally, the device 700 is further specifically used for:

[0157] By blocking and polling the parameter hash table to wait for parameter transmission, when the second calculation parameter is queried, corresponding calculation is performed according to the second calculation parameter.

[0158] Optionally, the device 700 is further specifically used for:

[0159] The calculation results of each computing task thread are written into the result hash table so that they can be queried while waiting for the result recovery thread.

[0160] Optionally, in the aspect of obtaining the second intermediate computing parameters of other computing parties among the Q computing participants except the first computing node, the second obtaining unit 703 is specifically used to:

[0161] Initiate a calculation result recovery request to the participant corresponding to the secret shared data through the result recovery thread;

[0162] Obtain the second intermediate calculation result fed back by the participant corresponding to the secret sharing data.

[0163] Optionally, the secure multi-party computing system includes: a UUID generator and a scheduling node, the UUID generator is used to generate a target task number, and the P computing nodes are configured as a group through the target task number.

[0164] It can be understood that the functions of each program module of the secure multi-party computing device of this embodiment can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0165] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps of any method described in the above method embodiments, and the above computer includes an electronic device.

[0166] The embodiment of the present application also provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, the computer program is operable to cause a computer to execute some or all of the steps of any method described in the method embodiment. The computer program product may be a software installation package, and the computer includes an electronic device.

[0167] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0168] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0169] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the above-mentioned units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0170] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0171] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0172] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the above-mentioned methods of each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or CD-ROM and other media that can store program codes.

[0173] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a magnetic disk or an optical disk, etc.

[0174] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A secure multi-party computing method, characterized in that: A method for applying a first computing node in a secure multi-party computing system, wherein the first computing node is any computing participant in the secure multi-party computing system, wherein the secure multi-party computing system includes P computing nodes, wherein the P computing nodes include a data provider and Q computing participants, wherein the communication connection between any two devices in the P computing nodes is a TCP long connection communication mechanism, wherein P and Q are both positive integers, and P is greater than or equal to 2; wherein the method includes: Acquire first data from the secret-sharing data provided by the data provider; the first data includes a random number; Calculate the first data according to local logic to obtain a first intermediate calculation parameter; Obtaining second intermediate computing parameters of other computing parties among the Q computing participants except the first computing node; each computing party among the Q computing participants includes part of the secret shared data; Perform data recovery according to the first intermediate calculation parameter and the second intermediate calculation parameter to obtain a final calculation result, wherein the first intermediate calculation parameter and the second intermediate calculation parameter cover all contents of the secret shared data; Among them, an IO multiplexing mechanism is introduced, a single thread processes IO requests between computing nodes, and a thread-safe hash table is used to store intermediate computing parameters, and the parameters are indexed by a globally unique task number; the first data is calculated to obtain the first intermediate computing parameter, including: Determining a first computing task corresponding to the first data; Writing the first computing task into a task queue to wait for execution of the first computing task; Polling the task queue by a computing management thread; If the task queue is not empty, taking out the first task of the task queue, starting a computing task thread and adding the first task to a thread pool for execution, the thread pool includes a plurality of computing task threads, each computing task thread independently executes a computing task, and obtaining the first intermediate computing parameter; The secure multi-party computing system includes: a UUID generator and a scheduling node, wherein the UUID generator is used to generate a target task number, and the P computing nodes are configured as a group through the target task number.

2. The method according to claim 1, characterized in that The method further comprises: Detecting whether it is necessary to send the first calculation parameter; If the first calculation parameter needs to be sent, notify the IO management thread to send the calculation parameter; or, When the IO management thread receives the second computing parameters of other computing nodes, the second computing parameters are classified according to the target task number of the computing node corresponding to the second computing parameter and stored in the parameter hash table to wait for the local computing task thread to query the second computing parameters.

3. The method according to claim 2, characterized in that The method further comprises: By blocking and polling the parameter hash table to wait for parameter transmission, when the second calculation parameter is queried, corresponding calculation is performed according to the second calculation parameter.

4. The method according to claim 3, characterized in that The method further comprises: The calculation results of each computing task thread are written into the result hash table so that they can be queried while waiting for the result recovery thread.

5. The method according to any one of claims 1 to 4, characterized in that: The obtaining of second intermediate computing parameters of other computing parties among the Q computing participants except the first computing node includes: Initiate a calculation result recovery request to the participant corresponding to the secret shared data through the result recovery thread; The second intermediate calculation parameter fed back by the participant corresponding to the secret sharing data is obtained.

6. A secure multi-party computing device, characterized in that: The first computing node applied to a secure multi-party computing system, the first computing node is any computing participant in the secure multi-party computing system, the secure multi-party computing system includes P computing nodes, the P computing nodes include a data provider and Q computing participants, the communication connection between any two devices in the P computing nodes is a TCP long connection communication mechanism, P and Q are both positive integers, and P is greater than or equal to 2; the device includes: a first acquisition unit, a computing unit, a second acquisition unit and a data recovery unit, wherein, The first acquisition unit is used to acquire first data from the secret shared data provided by the data provider; the first data includes a random number; The calculation unit is used to calculate the first data according to the local logic to obtain a first intermediate calculation parameter; The second acquisition unit is used to acquire second intermediate computing parameters of other computing parties among the Q computing participants except the first computing node; each computing party among the Q computing participants includes part of the secret shared data; The data recovery unit is used to perform data recovery according to the first intermediate calculation parameter and the second intermediate calculation parameter to obtain a final calculation result, wherein the first intermediate calculation parameter and the second intermediate calculation parameter cover all contents of the secret shared data; Among them, an IO multiplexing mechanism is introduced, a single thread processes IO requests between computing nodes, and a thread-safe hash table is used to store intermediate computing parameters, and the parameters are indexed by a globally unique task number; the first data is calculated to obtain the first intermediate computing parameter, including: Determining a first computing task corresponding to the first data; Writing the first computing task into a task queue to wait for execution of the first computing task; Polling the task queue by a computing management thread; If the task queue is not empty, taking out the first task of the task queue, starting a computing task thread and adding the first task to a thread pool for execution, the thread pool includes a plurality of computing task threads, each computing task thread independently executes a computing task, and obtaining the first intermediate computing parameter; The secure multi-party computing system includes: a UUID generator and a scheduling node, wherein the UUID generator is used to generate a target task number, and the P computing nodes are configured as a group through the target task number.

7. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store one or more programs and is configured to be executed by the processor, wherein the program comprises instructions for executing the steps in the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: A computer program for electronic data exchange is stored, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Parallel task processing method based on task decomposition

    CN104793992A

  • Secure multi-party computing method, device and system and storage medium

    CN112751665A