Data-driven multi-party secure computing asynchronous execution method and device
By adopting data-driven asynchronous execution methods and coroutine technology in multi-party security computing, the computational efficiency problem caused by synchronous blocking mode in the existing technology is solved, and more efficient multi-party security computing is achieved.
Patent Information
- Application Number
- CN202411810760.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-10
AI Technical Summary
The existing multi-party security computing library adopts a synchronous blocking mode during the calculation process, resulting in inefficient computing. Especially when multiple participants calculate in parallel, the calculation time is longer and the calculation complexity is increased.
Using a data-driven multi-party secure computing asynchronous execution method, through the coroutine asynchronous execution of meta functions in the coroutine asynchronous execution algorithm, each participant can execute multiple meta functions asynchronously, rather than multiple meta functions in parallel, avoiding unreasonable parallel computing strategies.
It improves the efficiency of multi-party security computing, avoids performance bottlenecks in synchronous blocking mode, and improves the concurrency and efficiency of computing.
Smart Images

Figure CN119312350B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for asynchronous execution of multi-party secure computing based on data-driven. Background Art
[0002] Secure Multi-Party Computation (MPC) is a cryptographic technology that allows multiple parties to perform joint computations and obtain correct results without leaking their private data. In recent years, MPC technology has been widely used in privacy-preserving computing, financial data sharing, medical research and other fields. In order to ensure the security of the data of the participants, MPC needs to use specific protocols to ensure that the information is not leaked during the calculation process. These protocols usually use distributed computing to process data. However, existing multi-party secure computing libraries such as ABY, Fairplay, MP-SPDZ, etc. generally adopt a synchronous blocking computing mode. However, the synchronous blocking mode leads to low computing efficiency, especially when multiple participants perform parallel computing, the waiting time of one party will increase as the computing complexity of other parties increases. This dependence not only wastes time, but also makes the parallel computing part unable to be fully utilized, which leads to a bottleneck in computing performance. Summary of the invention
[0003] The present application provides a data-driven multi-party secure computing asynchronous execution method and device to solve the problem in the prior art that multiple participants in the MPC computing process use unreasonable parallel computing strategies, which results in longer computing time and more complex computing.
[0004] In the first aspect, the present application provides a data-driven multi-party secure computing asynchronous execution method, comprising: after receiving a broadcast request sent by an initiator, the participant returns a version number list to the initiator, wherein the broadcast request is used to request multiple participants to execute the same target task, and the participant is any one of the multiple participants; the version number list includes multiple versions of the algorithm for executing the target task; the participant receives the target version determined by the initiator, wherein the target version is the latest version of the algorithm associated with the multiple participants; the initiator notifies the participant of calling the algorithm corresponding to the target version, and the participant asynchronously executes the meta-function in the algorithm based on the coroutine, wherein the algorithm includes multiple meta-functions.
[0005] In the second aspect, the present application provides a data-driven multi-party secure computing asynchronous execution method, including: an initiator determines an execution target task, and determines a target version of an algorithm associated with each participant, wherein the target version is the latest version of the algorithm existing in each participant; the initiator notifies the participant to call the algorithm corresponding to the target version, receives the algorithm data returned by the participant in response to the notification, and checks the algorithm data; when the algorithm data is correct, the initiator notifies each participant to execute the target version of the algorithm.
[0006] In the third aspect, the present application provides a data-driven multi-party secure computing asynchronous execution device, which is applied to the participants, including: a sending module, which is used to return a version number list to the initiator after receiving a broadcast request sent by the initiator, wherein the broadcast request is used to request multiple participants to execute the same target task, and the participant is any one of the multiple participants; the version number list includes multiple versions of the algorithm for executing the target task; a receiving module, which is used to receive the target version determined by the initiator, wherein the target version is the latest version of the algorithm associated with the multiple participants; a first processing module, which is used to notify the initiator to call the algorithm corresponding to the target version, and asynchronously execute the meta-function in the algorithm based on the coroutine, wherein the algorithm includes multiple meta-functions.
[0007] In the fourth aspect, the present application provides a data-driven multi-party secure computing asynchronous execution device, which is applied to the initiator, including: a determination module, used to determine the execution target task, and determine the target version of the algorithm associated with each participant, wherein the target version is the latest version of the algorithm existing in each participant; a fifth processing module, used to notify the participant to call the algorithm corresponding to the target version, and receive the algorithm data returned by the participant in response to the notification, and check the algorithm data; a notification module, used to notify each participant to execute the target version of the algorithm when the algorithm data is correct.
[0008] In a fifth aspect, the present application provides an electronic device comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to execute the data-driven multi-party secure computing asynchronous execution method described in the first or second aspect of the present application.
[0009] In a sixth aspect, the present application also provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the data-driven multi-party secure computing asynchronous execution method described in the first or second aspect of the present application.
[0010] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art: through the method of the embodiment of the present application, in the process of multi-party secure computing based on the target task, each participant will execute the corresponding algorithm according to the target version determined by the initiator. That is, the corresponding target task can be executed based on the algorithm corresponding to the latest algorithm version that each participant has, avoiding the problem of version incompatibility. Moreover, in the embodiment of the present application, when the participant executes the metafunction in the algorithm, the metafunction in the algorithm is asynchronously executed based on the coroutine, that is, multiple participants can asynchronously execute multiple metafunctions instead of executing multiple metafunctions in parallel, avoiding the unreasonable parallel computing strategy of multiple participants in the MPC computing process in the prior art, resulting in longer computing time and more complex computing, and improving the efficiency of MPC computing. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0012] In order to more clearly illustrate the embodiments of the present invention 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0013] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0014] Figure 1 One of the flowcharts of a data-driven multi-party secure computing asynchronous execution method provided in an embodiment of the present application;
[0015] Figure 2 A second flowchart of a method for asynchronous execution of multi-party secure computing based on data-driven provided in an embodiment of the present application;
[0016] Figure 3 A schematic diagram of a data-driven multi-party secure computing asynchronous execution framework provided in an embodiment of the present application;
[0017] Figure 4 A schematic diagram of a specific asynchronous MPC algorithm execution subject provided in an embodiment of the present application;
[0018] Figure 5 A flowchart of the asynchronous MPC algorithm execution provided in the embodiment of the present application;
[0019] Figure 6 A flowchart of the initiator and the participant executing the MPC algorithm provided in the embodiment of the present application;
[0020] Figure 7 A flowchart of asynchronously sending data between meta-functions provided in an embodiment of the present application;
[0021] Figure 8 A flowchart of serialization and deserialization processing of data between participants provided in an embodiment of the present application;
[0022] Fig. 9 One of the structural schematic diagrams of the data-driven multi-party secure computing asynchronous execution device provided in an embodiment of the present application;
[0023] Fig.10 The second structural diagram of the asynchronous execution device for multi-party secure computing based on data-driven provided in an embodiment of the present application;
[0024] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, 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 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 making creative work are within the scope of protection of this application.
[0026] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0027] The existing multi-party secure computing libraries include:
[0028] ABY: A framework for secure two-party computation (2PC) that allows participants to flexibly switch between three different sharing models, where A stands for arithmetic secret sharing, B stands for Boolean secret sharing, and Y stands for Yao's garbled circuits. This makes ABY an effective tool for solving MPC problems in different application scenarios. In ABY, all operations must depend on the results of other parties, so non-interdependent computing tasks cannot be executed in parallel. If one participant is delayed during the calculation process, the entire calculation process will be blocked. Each step of the calculation process in ABY must be executed completely and cannot be dynamically paused, terminated, or adjusted, which is not conducive to long-running tasks.
[0029] Fairplay: A multi-party secure computation framework that is mainly used to solve the problem of secure computation under the Boolean circuit model. It uses Yao's millionaire protocol to ensure that all parties can perform joint computations securely without leaking private inputs by obfuscating circuits. Fairplay is designed mainly for Boolean circuits and two-party computation scenarios, and cannot be well extended to the broader field of multi-party computation. As the number of participants increases, the complexity and computational overhead of the system will also increase significantly.
[0030] MP-SPDZ: An advanced multi-party secure computation library that supports multiple secure computation protocols, including semi-honest and malicious participant models. The framework aims to provide efficient MPC solutions for a wide range of application scenarios through multi-protocol support. However, since MP-SPDZ needs to ensure the security of computation, it spends a lot of resources on network communication. Especially in synchronous execution mode, frequent communication rounds can lead to performance bottlenecks.
[0031] In order to solve the problem in the prior art that multiple participants perform parallel calculations during the MPC calculation process, resulting in longer calculation time and more complex calculations, the present application provides a data-driven multi-party secure computing asynchronous execution method, such as Figure 1 As shown, the steps of the method include:
[0032] Step 101, after receiving the broadcast request sent by the initiator, the participant returns a version number list to the initiator, wherein the broadcast request is used to request multiple participants to perform the same target task, and the participant is any one of the multiple participants; the version number list includes multiple versions of the algorithm used to perform the target task;
[0033] In the embodiment of the present application, the initiator can be the manager of the MPC algorithm in the MPC algorithm framework, that is, the same algorithm can have different implementations, and the external interface is consistent. The participants are the executors of the specific algorithm. In the MPC algorithm framework, the scheduling of the algorithm by the initiator and the execution of the algorithm by the participants can be completed based on the middleware, that is, the interaction and communication between the initiator and the participants can be realized through the middleware.
[0034] Step 102, the participant receives the target version determined by the initiator, wherein the target version is the latest version of the algorithm associated with the multiple participants;
[0035] In a specific example, the participants include a first participant, a second participant, and a third participant, wherein the version number list of the algorithm for executing the target task of the first participant includes version 1.0, version 2.0, version 3.0, and version 4.0, the version number list of the algorithm for executing the target task of the second participant includes version 1.0, version 2.0, and version 3.0, and the version number list of the algorithm for executing the target task of the third participant includes version 2.0 and version 3.0, wherein versions 1.0 to 4.0 are updated and iterated in sequence, that is, version 1.0 is updated to version 2.0, version 2.0 is updated to version 3.0, and version 3.0 is updated to version 4.0. It can be seen that in this specific example, the target version is version 3.0, that is, version 3.0 is the latest version of the algorithm associated with the first participant, the second participant, and the third participant. Due to the continuous updating of algorithm versions, existing multi-party computing systems often face compatibility issues, that is, different versions of algorithms are prone to cause failures when interacting. By introducing a systematic version negotiation mechanism, version differences are automatically detected and processed during algorithm interaction, and the most recent algorithm version common to all participants is adopted, making the multi-party secure computing process smoother and avoiding compatibility issues caused by version inconsistencies.
[0036] Step 103, the initiator notifies the participant to call the algorithm corresponding to the target version, and the participant asynchronously executes the meta-function in the algorithm based on the coroutine, where the algorithm includes multiple meta-functions.
[0037] In this regard, the coroutine in the embodiment of the present application is the basic unit of concurrent programming, and multiple coroutines can be executed simultaneously, and the scheduling and switching between them are the responsibility of the runtime system. That is, in the embodiment of the present application, each participant can asynchronously execute multiple meta-functions in the algorithm based on the coroutine. It can be seen that by asynchronously executing tasks through coroutines, synchronous blocking is avoided, and seamless collaborative computing between participants is achieved, thereby improving the efficiency of MPC computing.
[0038] It can be seen that through the above steps 101 to 103, in the process of multi-party secure computing based on the target task, each participant will execute the corresponding algorithm according to the target version determined by the initiator. That is, the corresponding target task can be executed based on the algorithm corresponding to the latest algorithm version that each participant has, avoiding the problem of version incompatibility. Moreover, in the embodiment of the present application, when the participant executes the metafunction in the algorithm, the metafunction in the algorithm is asynchronously executed based on the coroutine, that is, multiple participants can asynchronously execute multiple metafunctions instead of executing multiple metafunctions in parallel, avoiding the unreasonable parallel computing strategy of multiple participants in the MPC calculation process in the prior art, resulting in longer calculation time and more complex calculation, thereby improving the efficiency of MPC calculation.
[0039] In an embodiment of the present application, when executing the same target task, the algorithm required to execute the target task may include multiple meta-functions, and the output parameter of a meta-function may be the input parameter of another meta-function; wherein, the input parameter refers to the parameter that the meta-function needs to pass when calling, and these parameters are used to provide the meta-function with necessary data or configuration information so that the function can perform the corresponding operation. The output parameter is the result returned after the meta-function is executed. These results usually include the calculation results of the function or the data after the operation for the caller to use. Based on this, the method of the participants involved in step 103 in the embodiment of the present application based on the coroutine asynchronous execution of the meta-function in the algorithm can further include:
[0040] Step 11, the participant starts executing and scanning the input parameters and type information of the first metafunction, and verifies whether the input parameters match the output parameters obtained by executing the second metafunction; wherein the first metafunction is one of the multiple metafunctions;
[0041] Step 12, when the input participant and the output parameter of the second-element function are matched, the participant receives the output parameters sent by other participants after executing the second-element function, and caches them together with the scanned input parameters;
[0042] Step 13, when all parameters of the first element function are in the cache, scanning all parameters of the first element function into a corresponding parameter list;
[0043] Step 14: When it is determined that the input parameter conditions of the meta-function are met, the participant starts the coroutine to asynchronously execute the meta-function.
[0044] In an embodiment of the present application, different tasks correspond to different cache areas, that is, each task corresponds to a separate cache area to avoid confusion of meta-function parameters when multiple tasks are executed. If the output (output parameter) of a meta-function is the input (input parameter) of another meta-function, the parameters of multiple meta-functions of the algorithm can be stored in the same area for cache. In addition, in the process of asynchronous execution of meta-functions, for each participant, only the input parameter conditions of the currently executed meta-function need to be met, and then the meta-function can be executed, without waiting until other participants are completed before executing the corresponding meta-function. Therefore, compared with parallel execution, asynchronous execution of meta-functions through coroutines not only reduces waiting time, but also greatly improves the execution efficiency of the algorithm.
[0045] Furthermore, in the embodiment of the present application, the interaction of parameters between functions can be sent asynchronously by serialization and deserialization, thereby ensuring the accuracy of data interaction. Based on this, the method steps of the embodiment of the present application may also include:
[0046] Step 21, when the participant starts a coroutine to asynchronously execute the first meta-function, the participant serializes the output parameters obtained by executing the first meta-function based on the type of the first meta-function;
[0047] In the embodiment of the present application, different serialization methods can be used according to different types. If the data type is []byte, it is sent directly without serialization. The type ID and serialization method of the data are recorded in the message to facilitate the correct processing when the receiver deserializes.
[0048] If the data implements the proto.message interface, the Protocol Buffers serialization method is used, which is suitable for efficient, cross-platform data transmission.
[0049] For other types of data, use JSON for serialization and record the type ID and serialization method in the message so that the receiver knows how to handle it.
[0050] Step 22, when the size of the serialized data exceeds a preset threshold, the participant divides the serialized data into a plurality of small blocks, and sequentially sends the plurality of small blocks to another participant that executes the target task;
[0051] It can be seen that in the embodiment of the present application, splitting larger serialized data before transmission can improve the transmission efficiency of big data and avoid network congestion and delay.
[0052] Step 23, when the size of the serialized data does not exceed the preset threshold, the participant sends the serialized data directly to another participant who executes the target task; wherein the input parameters required by the other participant to execute the second meta-function are the output parameters of the participant to execute the first meta-function.
[0053] It can be seen that in the embodiment of the present application, if the current serialized data is small, it can be sent directly so that the recipient (the other participant) can directly deserialize it to obtain the input parameters of the current meta-function to be executed.
[0054] In an embodiment of the present application, the method for the participant involved in the above step 11 to start executing the input parameter and type information of the scanning meta-function and verify whether the input parameter matches the output parameter of other meta-functions may further include:
[0055] Step 31, the participant starts to execute and scan the input parameters of the first-element function, and records the type information of the first-element function;
[0056] Step 32, when it is determined that there is an input parameter among all the input parameters of the first metafunction that matches the output parameter of the second metafunction, the participant receives the serialized data and deserializes the serialized data based on the type information of the second metafunction to obtain the input parameter of the first metafunction, wherein the serialized data is the data obtained after serializing the output parameter of the second metafunction.
[0057] In this regard, in a specific example, after receiving the data, the receiver (participant) first finds the recorded input parameter type through the type ID in the message, and constructs the corresponding structure instance using reflection technology based on the type ID. According to the serialization method in the message (such as proto, JSON, etc.), the correct deserialization method is selected to convert the data back to the original structure, so that the input parameter of the first-element function can be obtained.
[0058] The above is an explanation of the present application from the perspective of the participants. The following is an explanation of the present application from the perspective of the initiator. The present application also provides a data-driven multi-party secure computing asynchronous execution method, such as Figure 2 As shown, the steps of the method include:
[0059] Step 201, the initiator determines to execute the target task and determines the target version of the algorithm associated with each participant, wherein the target version is the latest version of the algorithm existing in each participant;
[0060] Step 202, the initiator notifies the participant to call the algorithm corresponding to the target version, receives the algorithm data returned by the participant in response to the notification, and checks the algorithm data;
[0061] Step 203: When the algorithm data is correct, the initiator notifies each participant to execute the target version of the algorithm.
[0062] It can be seen that in the embodiment of the present application, the initiator is used to call the algorithm required to execute the target task, and it is also necessary to determine the latest version of the algorithm that each current participant can execute the target task, so that each participant can execute the task with its own latest algorithm, avoiding the problem of incompatible algorithm versions, and each participant can asynchronously execute the target version of the algorithm.
[0063] In the embodiment of the present application, the manner in which the initiator notifies each participant to execute the target version of the algorithm involved in the above step 202 may further include:
[0064] Step 41, the initiator calls the target function to notify the participant to execute the corresponding algorithm based on the target version, wherein the target function includes parameters for specifying the notified party and parameters for specifying the called meta-function.
[0065] In this regard, when one party only wants to notify the other party to start executing a meta-function without passing specific data. The asynchronous sending mechanism in the related art requires that an empty message type must be defined first, and then the message is sent to the recipient, which will increase the code complexity and work redundancy. Therefore, in the embodiment of the present application, the above purpose is achieved through a simplified meta-function asynchronous call mechanism. That is, the notifying party (initiator) calls the AsyncPRCEexecute function. When calling this function, the notifying party only needs to specify two parameters: the notified party and the called meta-function. The mechanism will automatically generate a message containing the meta-function ID and send it to the notified party. After the recipient (each participating party) receives the message with the meta-function ID, it does not need to process any complex message content. It only needs to extract the meta-function ID from the message, and find the corresponding meta-function in its system based on the ID, and execute it immediately.
[0066] In the embodiment of the present application, the initiator can also terminate, suspend and resume the meta-function during the execution of the meta-function by the participant to cope with different emergencies in real time. Therefore, the method in the embodiment of the present application can also include:
[0067] Step 51, in the process of the participant asynchronously executing the meta-function in the algorithm corresponding to the target version based on the coroutine, the initiator calls the termination function or the suspension function, and sets the corresponding flag bit for the target task, wherein when the participant detects the flag bit representation, the execution operation of the meta-function is terminated or the execution operation of the meta-function is suspended; or,
[0068] Step 52: After calling the pause function, the initiator calls the reply function and notifies the participants to reply to the execution operation of the meta-function.
[0069] In the existing related art, long-running tasks often lack effective control means, and once the calculation starts, it is difficult to make adjustments midway, which limits the flexibility of the system, especially in the scenario where it needs to be suspended, terminated or restored. Through the method of the embodiment of the present application, the task can be suspended, terminated and restored, so that the task can be flexibly interrupted and the task execution can be restored at the appropriate time. Especially in long-running tasks, the system can make midway adjustments according to actual needs, avoid waste of resources, and improve the adaptability of the system. This function not only improves the practicality of multi-party computing, but also provides more flexible scheduling capabilities for complex tasks. That is, when the termination function and the pause function are called, a termination flag will be set for the task. When the termination flag is checked during scheduling, the scheduling will be stopped, the participants will be notified to end the task in advance, and an error will be returned to the initial calling function. When the pause flag is detected, the data will be received normally, but the data will not be sent out, but the next step of scheduling will not be performed. At the same time, the participants will be notified to stop the next step of scheduling. When the recovery function is called, the data to be sent will be sent out and the previous progress will be restored.
[0070] In the embodiment of the present application, the initiator can also monitor the connection status of the participant in real time. Once the participant goes offline, it is necessary to terminate the execution of the current task. Therefore, the method of the embodiment of the present application also includes:
[0071] Step 61, the initiator establishes connection detection for all participants;
[0072] Step 62, when it is detected that a participant is offline, the initiator broadcasts the abnormal exit of the target task to all participants.
[0073] It can be seen that the initiator will establish a connection check for all participants, and the participants will establish a connection check for the initiator. If it is detected that the other party has gone offline, it will broadcast to all participants (including the initiator) and the task will exit abnormally. All participants will delete the cache of this task and cancel the connection check.
[0074] The present application is explained below in conjunction with the specific implementation of the embodiment of the present application. The specific implementation provides a data-driven multi-party secure computing asynchronous execution method. The specific implementation provides an overall framework of a data-driven asynchronous MPC algorithm, such as Figure 3As shown in the figure, the overall framework parallelizes the asynchronous execution of the algorithm process to improve the algorithm performance. Specifically, the algorithm version negotiation is used to achieve compatibility between the old and new node versions. A unified exception handling process is added to automatically terminate the computing task when the participant is offline and the process is abnormal. Based on the input and output parameter types of the metafunction, the algorithm process is self-organized and executed, and the framework can intervene in the control. A declarative algorithm calling mechanism is adopted, and there is no need to pay attention to the calling timing of the nested algorithm. The framework automatically triggers the call.
[0075] In this specific embodiment, based on Figure 3 In the framework, the specific asynchronous MPC algorithm execution process can be based on Figure 4 To achieve this specifically. Figure 4 The following contents are included:
[0076] protocol_manager: The manager of the MPC algorithm. The same algorithm can have different implementations, but the external interfaces are consistent. For example, OT has an RSA-based implementation and a simpleot-based implementation.
[0077] protocol_instance: The implementation of a specific algorithm, which consists of a series of meta-functions of the algorithm logic, similar to the declaration of configuration.
[0078] protocol_controller: As a middleware Controller that manages and organizes the algorithm process, it is used to coordinate the interaction and communication between the initiator and the participants. Since protocol_instance itself is just a collection of meta-functions and is static, it is necessary to call these static meta-functions based on the algorithm process through protocol_controller. Specifically, the main responsibilities of the Controller include calling and coordinating at different stages, processing intermediate data, and scheduling instance registered functions.
[0079] meta_func: represents the meta-function of part of the algorithm logic. It needs to meet certain specifications and does not need to be called actively. The input parameters will be injected by protocol_controller, and the return value (the parameter of the meta-function) will be returned to protocol_controller for management.
[0080] Combination Figure 3 and Figure 4The present application explains the asynchronous execution method of multi-party secure computing based on data-driven. In the existing related technologies, when nested calling algorithms, manually writing redundant logic code not only makes development and maintenance complicated and error-prone. Through the declarative process control and modular design in the embodiments of the present application, the algorithm calling process is abstracted. The developer only needs to declare the meta-function, and the framework will automatically manage the calling process, reducing the repetitive code that the developer needs to write manually. In addition, the modular design in the embodiments of the present application also allows the code to be flexibly reused in different scenarios, simplifying development and maintenance work. In this way, the code structure is more concise, potential errors are reduced, and the complexity of long-term maintenance is significantly reduced, and the readability and scalability of the code are enhanced. Based on the Controller controller, the algorithm execution steps in this specific implementation, such as Figure 5 As shown, including:
[0081] Step 501, version negotiation;
[0082] Specifically, the process of version negotiation can be: first, the initiator protocol_manager broadcasts the request version number list to participant 1 and participant 2 (or more participants). Then, each participant returns the version number list. Finally, the initiator finds the latest algorithm version that all participants have through protocol_manger.
[0083] Step 502, data request;
[0084] Specifically, the process of data request can be: the initiator protocol_manager calls the setup function of protocol_controller (registered by Instance) to prepare and generate the data that needs to be notified to all participants. Then, the initiator notifies participants 1 and 2 to call the handleSetup function of the negotiated version of Controller (registered by Instance) to prepare the data that needs to be returned to the initiator; participants 1 and 2 return data to the initiator; the initiator calls the InitiatorCheck function (registered by Instance) to check whether the data format of each party is correct.
[0085] Step 503, algorithm execution.
[0086] Specifically, the algorithm execution process can be: the initiator calls the InitiatorStart function of protocol_controller (registered by Instance) to start the execution of the algorithm. Then, the initiator notifies participants 1 and 2 to call the ParticipantStart function of Controller (registered by Instance) to start the execution of the algorithm.
[0087] The specific process of the above steps 501 to 503 is as follows Figure 6 In addition, during the specific algorithm execution process, the entire algorithm process is divided into multiple meta-functions, which are managed and called by the Controller. Data received from other parties will also be managed by the Controller. The core logic of the Controller management is:
[0088] 1) The output of the previous meta-function and the data sent by other parties can become the input of the next meta-function;
[0089] 2) The entry point of the algorithm is the start function without parameters, and the exit point is to actively call the Finish function in the function to return the algorithm execution result;
[0090] 3) The controller will store the results of the meta-function execution and the received data in the cache. The cache mechanism is used to store the results of the meta-function execution and the received data, and it will determine when a specific meta-function can be executed asynchronously through scanning. When the input parameter conditions of a meta-function are met, the controller will start the coroutine to execute this function asynchronously to improve the efficiency of concurrent execution. When each meta-function is executed, its input parameter data type is used as the cache key, and the used data will be deleted from the cache to ensure that the cache is always kept up to date.
[0091] Based on this, the data-driven asynchronous execution in the embodiment of the present application, through the combination of caching and coroutines, ensures that the system can efficiently schedule and execute tasks, avoiding unnecessary congestion and waste of resources. The specific implementation of this mechanism is as follows Figure 7 The steps shown may include:
[0092] Step 71, when the framework starts, scan the input parameters of all protocol instance meta-functions, cache the type information, and check whether the input parameters match the input parameter types of other functions;
[0093] Step 72: All meta-function calls are started through the go coroutine, all return values (parameters) are put into the cache, and the previously registered meta-function list is scanned.
[0094] Step 73: if all parameters of a certain meta-function exist in the cache, the scanned meta-function and parameter list are returned in advance, and the parameter list is removed from the cache;
[0095] Step 74: If an executable meta-function is scanned, the meta-function is executed.
[0096] The existing synchronous blocking mode is prone to performance bottlenecks, especially when multiple parties are computing in parallel. The waiting time tends to increase with the increase of the computational complexity of one party, wasting computing resources that can be used in parallel. In the embodiment of the present application, by introducing an asynchronous parallel computing model, that is, asynchronously executing tasks through coroutines, avoiding synchronous blocking, and realizing seamless collaborative computing between participants, not only can the waiting time be reduced, but also the execution efficiency of the algorithm is greatly improved, especially in large-scale multi-party computing scenarios, which significantly improves the overall performance of the system and enables complex computing tasks to be completed more efficiently.
[0097] In the process of executing a meta-function, if the output parameter of the current meta-function is the input parameter of other meta-functions, the data is sent asynchronously through serialization and deserialization when the meta-function is executed asynchronously. When the meta-function calls the data asynchronous sending function, the data to be sent will be serialized to ensure that the data can be transmitted on the network and can be correctly interpreted by the receiver. After receiving the data, the receiver restores the data to the structure before sending through deserialization, and stores it in the cache of the Controller for subsequent tasks or function calls. However, multi-party secure computing in the prior art usually requires developers to not only write core algorithms, but also handle complex underlying network communication logic, such as serialization, deserialization, data synchronization and other operations. These operations not only increase the difficulty of development, but also easily cause communication errors. By abstracting the details of network communication, developers do not need to directly handle complex network I / O and communication operations, and can realize data transmission and processing through simple interface calls. The framework will automatically handle serialization and deserialization according to the data type, and stream it when necessary. This not only reduces the workload of developers, but also reduces the risk of errors caused by communication details, and improves development efficiency and system reliability. Based on this, Figure 8 As shown, the asynchronous data sending process includes:
[0098] Step 801, scan the input parameters at startup, scan the input parameter types of all meta-functions, and record the types to facilitate the construction of the correct structure during subsequent deserialization operations.
[0099] Step 802, when the asynchronous sending function is called, a coroutine is started to perform the data sending operation in parallel.
[0100] The sending process will not block other operations of other callers, thus improving efficient concurrency.
[0101] Step 803: The serialization operation uses different serialization methods according to different data types.
[0102] Step 804, when sending, if the serialized data exceeds a certain size, the framework will automatically split it into multiple small blocks;
[0103] This method improves the transmission efficiency of big data and avoids network congestion and delays.
[0104] Step 805: After receiving the data, the receiver first finds the input parameter type recorded when the framework is started through the type ID in the message, and constructs the corresponding structure instance using reflection technology according to the type ID.
[0105] Specifically, you can select the correct deserialization method according to the serialization method in the message (such as proto, JSON, etc.) to convert the data back to the original structure.
[0106] Step 806: After deserialization is completed, the receiver stores the data in the cache. Once the data is successfully cached, the Controller will be triggered to scan and check whether the cache already has all the input parameters for executing a task. If the conditions are met, the corresponding task will be started.
[0107] It can be seen from the specific implementation methods of the above-mentioned embodiments of the present application that the asynchronous parallel model allows all parties to perform calculations simultaneously without dependencies, improves concurrency performance and shortens the overall calculation time. At the same time, with the help of declarative process control and modular design, the developer's workflow is simplified. The developer only needs to declare the meta-function to be automatically scheduled and executed by the framework, which reduces code redundancy and enhances the readability and maintainability of the code. In order to further improve development efficiency, the underlying serialization, deserialization, and synchronous to asynchronous conversion and other complex operations are shielded through network communication abstraction, so that developers can focus on core algorithms, reducing development difficulty and the risk of errors. At the same time, the version negotiation mechanism ensures that the system can still interact normally when the version is updated or the participants run different versions, solves the version compatibility problem, and enhances the stability of the system. In addition, it also allows developers to dynamically pause, terminate and resume long-running computing tasks, enhances the flexibility of the system, and is particularly suitable for the processing of complex tasks. In general, the embodiments of the present application not only improve the computing efficiency of the system and the work efficiency of developers, but also significantly enhance the flexibility, maintainability and stability of the system, and provide a more efficient and reliable solution for multi-party secure computing and distributed computing, meeting the high-performance computing needs in complex scenarios.
[0108] Corresponding to the above Figure 1 The embodiment of the present application also provides a data-driven multi-party secure computing asynchronous execution device, which is applied to the participants, such as Fig. 9 As shown, the device comprises:
[0109] The sending module 902 is used to return a version number list to the initiator after receiving a broadcast request sent by the initiator, wherein the broadcast request is used to request multiple participants to perform the same target task, and the participant is any one of the multiple participants; the version number list includes multiple versions of the algorithm for performing the target task;
[0110] A receiving module 904 is used to receive a target version determined by the initiator, wherein the target version is the latest version of the algorithm associated with the multiple participants;
[0111] The first processing module 906 is used to notify the participant in the initiating direction to call the algorithm corresponding to the target version, and asynchronously execute the meta-function in the algorithm based on the coroutine, wherein the algorithm includes multiple meta-functions.
[0112] Through the device of the embodiment of the present application, in the process of multi-party secure computing based on the target task, each participant will execute the corresponding algorithm according to the target version determined by the initiator. That is, the corresponding target task can be executed based on the algorithm corresponding to the latest algorithm version that each participant has, avoiding the problem of version incompatibility. Moreover, in the embodiment of the present application, when the participants execute the metafunction in the algorithm, the metafunction in the algorithm is asynchronously executed based on the coroutine, that is, multiple participants can asynchronously execute multiple metafunctions instead of executing multiple metafunctions in parallel, avoiding the unreasonable parallel computing strategy of multiple participants in the MPC computing process in the prior art, resulting in longer computing time and more complex computing, and improving the efficiency of MPC computing.
[0113] In an optional implementation manner of an embodiment of the present application, the first processing module in the embodiment of the present application may include: a first processing unit, used to start executing and scanning the input parameters and type information of the first metafunction, and verify whether the input parameters match the output parameters obtained by executing the second metafunction; wherein the first metafunction is one of multiple metafunctions; a receiving unit, used to receive the output parameters sent by other participants after executing the second metafunction when the input parameters match the output parameters of the second metafunction, and cache them together with the scanned input parameters; a scanning unit, used to scan all parameters of the first metafunction into the corresponding parameter list when all parameters of the first metafunction are in the cache; a second processing unit, used to start the coroutine asynchronous execution of the metafunction when it is determined that the input parameter conditions of the metafunction are met.
[0114] In an optional implementation manner of the embodiment of the present application, the device in the embodiment of the present application also includes: a second processing module, which is used to serialize the output parameters obtained by executing the first meta-function based on the type of the first meta-function when the participant starts a coroutine to asynchronously execute the first meta-function; a third processing module, which is used to divide the serialized data into multiple small blocks when the size of the serialized data exceeds a preset threshold, and send the multiple small blocks in turn to the other participant who executes the target task; a fourth processing module, which is used to send the serialized data directly to the other participant who executes the target task when the size of the serialized data does not exceed the preset threshold; wherein the input parameters required for the other participant to execute the second meta-function are the output parameters of the participant to execute the first meta-function.
[0115] In an optional implementation of an embodiment of the present application, the first processing unit in the embodiment of the present application includes: a first processing sub-unit, used to start executing a scan of the input parameters of the first meta-function and record the type information of the first meta-function; a second processing sub-unit, used to, when it is determined that there is an input parameter matching the output parameter of the second meta-function among all the input parameters of the first meta-function, the participating party receives the serialized data, and deserializes the serialized data based on the type information of the second meta-function to obtain the input parameter of the first meta-function, wherein the serialized data is the data obtained after serializing the output parameter of the second meta-function.
[0116] Corresponding to the above Figure 2 , the embodiment of the present application provides a data-driven multi-party secure computing asynchronous execution device, such as Fig.10 As shown, the device comprises:
[0117] A determination module 1002 is used to determine the target task to be executed and determine the target version of the algorithm associated with each participant, wherein the target version is the latest version of the algorithm existing in each participant;
[0118] The fifth processing module 1004 is used to notify the participant to call the algorithm corresponding to the target version, receive the algorithm data returned by the participant in response to the notification, and check the algorithm data;
[0119] The notification module 1006 is used to notify each participant to execute the target version of the algorithm when the algorithm data is correct.
[0120] In an optional implementation of an embodiment of the present application, the notification module in the embodiment of the present application may further include: a calling unit, used to call the target function to notify the participating party to execute the corresponding algorithm based on the target version, wherein the target function includes parameters for specifying the notified party and parameters for specifying the called meta-function.
[0121] In an optional implementation manner of an embodiment of the present application, the device in the embodiment of the present application also includes: a sixth processing module, which is used to call a termination function or a pause function and set a corresponding flag bit for the target task during the process of the participant asynchronously executing a meta-function in the algorithm corresponding to the target version based on the coroutine, wherein when the participant detects the flag bit representation, the execution operation of the meta-function is terminated or the execution operation of the meta-function is paused; or, the reply function is called after calling the pause function, and the participant is notified to reply to the execution operation of the meta-function.
[0122] In an optional implementation manner of the embodiment of the present application, the device in the embodiment of the present application also includes: an establishment module for establishing connection detection for all participants; a broadcast module for broadcasting the abnormal exit of the target task to all participants when it is detected that a participant is offline.
[0123] like Fig.11 As shown, an embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0124] Memory 113, used for storing computer programs;
[0125] In one embodiment of the present application, the processor 111, when used to execute the program stored in the memory 113, implements the data-driven multi-party secure computing asynchronous execution method provided by any of the aforementioned method embodiments, and its role is similar and will not be repeated here.
[0126] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the asynchronous execution method of multi-party secure computing based on data-driven provided in any of the aforementioned method embodiments are implemented.
[0127] The device embodiments described above are merely illustrative, wherein the units described 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0128] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.
[0129] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0130] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A data-driven multi-party secure computing asynchronous execution method, characterized in that: include: After receiving the broadcast request sent by the initiator, the participant returns a version number list to the initiator, wherein the broadcast request is used to request multiple participants to perform the same target task, and the participant is any participant among the multiple participants; the version number list includes multiple versions of the algorithm for performing the target task; The participant receives a target version determined by the initiator, wherein the target version is a latest version of the algorithm associated with the plurality of participants; The initiator notifies the participant to call the algorithm corresponding to the target version, and the participant asynchronously executes a meta-function in the algorithm based on a coroutine, wherein the algorithm includes a plurality of meta-functions; The participants asynchronously execute the meta-function in the algorithm based on the coroutine, including: The participant starts executing and scanning the input parameters and type information of the first metafunction, and verifies whether the input parameters match the output parameters obtained by executing the second metafunction; wherein the first metafunction is one of the multiple metafunctions; In the case where the input participant matches the output parameter of the second meta-function, the participant receives the output parameter sent by other participants after executing the second meta-function, and caches it together with the scanned input parameter; In the case where all parameters of the first metafunction are in the cache, the participant scans all parameters of the first metafunction into a corresponding parameter list; When it is determined that the input parameter condition of the meta-function is satisfied, the participant starts a coroutine to asynchronously execute the meta-function.
2. The method according to claim 1, characterized in that The method further comprises: When the participant starts a coroutine to asynchronously execute the first meta-function, the participant serializes the output parameters obtained by executing the first meta-function based on the type of the first meta-function; When the size of the serialized data exceeds a preset threshold, the participant divides the serialized data into a plurality of small blocks, and sequentially sends the plurality of small blocks to another participant that executes the target task; When the size of the serialized data does not exceed the preset threshold, the participant sends the serialized data directly to another participant that executes the target task; wherein the input parameters required for the other participant to execute the second meta-function are the output parameters of the participant to execute the first meta-function.
3. The method according to claim 1, characterized in that: The participant starts executing and scanning the input parameters and type information of the meta-function, and verifies whether the input parameters match the output parameters of other meta-functions, including: The participant starts executing and scanning the input parameters of the first meta-function, and records the type information of the first meta-function; When it is determined that there is an input parameter matching the output parameter of the second metafunction among all the input parameters of the first metafunction, the participant receives the serialized data and deserializes the serialized data based on the type information of the second metafunction to obtain the input parameter of the first metafunction, wherein the serialized data is the data obtained after serializing the output parameter of the second metafunction.
4. A data-driven multi-party secure computing asynchronous execution method, characterized in that: include: The initiator determines to execute the target task and determines the target version of the algorithm associated with each participant, wherein the target version is the latest version of the algorithm existing in each participant; The initiator notifies the participant to call the algorithm corresponding to the target version, receives the algorithm data returned by the participant in response to the notification, and checks the algorithm data; When the algorithm data is correct, the initiator notifies each participant to execute the target version of the algorithm; The initiator notifies each participant to execute the target version of the algorithm, including: the initiator calls the target function to notify the participant to execute the corresponding algorithm based on the target version, wherein the target function includes parameters for specifying the notified party and parameters for specifying the called meta-function; The method further includes: in the process of the participant asynchronously executing the meta-function in the algorithm corresponding to the target version based on the coroutine, the initiator calls the termination function or the pause function, and sets the corresponding flag bit for the target task, wherein when the participant detects the flag bit representation, the execution operation of the meta-function is terminated or the execution operation of the meta-function is paused; or, the initiator calls the reply function after calling the pause function, and notifies the participant to reply to the execution operation of the meta-function.
5. The method according to claim 4, characterized in that The method further comprises: The initiator establishes connection detection for all participants; In the case where it is detected that a participant is offline, the initiator broadcasts the abnormal exit of the target task to all participants.
6. A data-driven multi-party secure computing asynchronous execution device, applied to the participants, characterized in that: include: A sending module, configured to return a version number list to the initiator after receiving a broadcast request sent by the initiator, wherein the broadcast request is used to request multiple participants to perform the same target task, and the participant is any one of the multiple participants; and the version number list includes multiple versions of the algorithm for performing the target task; A receiving module, configured to receive a target version determined by the initiator, wherein the target version is the latest version of the algorithm associated with the multiple participants; A first processing module is used to notify the initiator to call the algorithm corresponding to the target version, and asynchronously execute a meta-function in the algorithm based on a coroutine, wherein the algorithm includes multiple meta-functions; Among them, the first processing module includes: a first processing unit, which is used to start executing and scanning the input parameters and type information of the first metafunction, and verify whether the input parameters match the output parameters obtained by executing the second metafunction; wherein the first metafunction is one of multiple metafunctions; a receiving unit, which is used to receive the output parameters sent by other participants after executing the second metafunction when the input parameters match the output parameters of the second metafunction, and cache them together with the scanned input parameters; a scanning unit, which is used to scan all parameters of the first metafunction into the corresponding parameter list when all parameters of the first metafunction are in the cache; a second processing unit, which is used to start the coroutine asynchronous execution of the metafunction when it is determined that the input parameter conditions of the metafunction are met.
7. A data-driven multi-party secure computing asynchronous execution device, applied to the initiator, characterized in that: include: A determination module, used to determine the target task to be executed and determine the target version of the algorithm associated with each participant, wherein the target version is the latest version of the algorithm existing in each participant; a fifth processing module, configured to notify the participant to call the algorithm corresponding to the target version, receive algorithm data returned by the participant in response to the notification, and check the algorithm data; A notification module, used for notifying each participant to execute the target version of the algorithm when the algorithm data is correct; The notification module includes: a calling unit, which is used to call the target function to notify the participating party to execute the corresponding algorithm based on the target version, wherein the target function includes parameters for specifying the notified party and parameters for specifying the called meta-function; The device also includes a sixth processing module, which is used to call a termination function or a pause function and set a corresponding flag bit for the target task during the process of the participant asynchronously executing a meta-function in the algorithm corresponding to the target version based on the coroutine, wherein when the participant detects the flag bit representation, the execution operation of the meta-function is terminated or the execution operation of the meta-function is paused; or, after calling the pause function, the reply function is called and the participant is notified to reply to the execution operation of the meta-function.
Citation Information
Patent Citations
A video object tracking method based on parallel attention correlation filter is proposed
CN109102521A
Method, apparatus, and system for wireless tracking, scanning and monitoring
EP3739356A1