Data processing method, device, electronic device and storage medium
By splitting algorithms into meta-functions and enabling asynchronous execution, the method improves the efficiency of secure multi-party computing by allowing automatic data processing and parallel operations.
Patent Information
- Application Number
- CN202111194519.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-13
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2041-10-13
AI Technical Summary
Secure multi-party computing in existing technologies is inefficient due to synchronous data processing, leading to low algorithm execution efficiency.
The method involves splitting the target algorithm into a set of meta-functions, caching initial data, and automatically calling target meta-functions based on cache operations, enabling asynchronous execution and improving efficiency.
This approach enhances algorithm execution efficiency by allowing asynchronous calculations among multiple parties, decoupling network and algorithm processes, and facilitating parallel operations.
Smart Images

Figure CN114003973B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, device, electronic device and storage medium. Background Art
[0002] Secure Multi-Party Computation (MPC) is a collaborative computing solution to the privacy protection problem among a group of mutually distrusting parties. MPC must ensure the independence of inputs, the correctness of calculations, decentralization, and other characteristics, while not leaking the input values to other members participating in the calculation. It is mainly aimed at the problem of how to securely calculate an agreed function without a trusted third party, and requires that each participant cannot obtain any input information from other entities except the calculation results. Secure multi-party computing plays an important role in scenarios such as electronic elections, electronic voting, electronic auctions, secret sharing, and threshold signatures.
[0003] Secure multi-party computation was first proposed by Professor Yao Qizhi, a Chinese-American computer scientist and Turing Award winner, through the millionaire problem. The problem is stated as follows: Two millionaires, Alice and Bob, want to know who is richer, but neither of them wants to let the other know any information about their wealth. If neither party provides real wealth information, how to compare the wealth of the two people and give a credible proof.
[0004] Secure multi-party computation is usually based on configuring specific algorithms for specific problems, such as comparing one's own data with the data of other parties without knowing the data of other parties, calculating the sum of the data of other two parties, etc.
[0005] However, the secure multi-party computing in the related art is usually written in accordance with the synchronization idea. During the execution of the algorithm, each party in the algorithm performs synchronous calculations on their own data, and the algorithm execution efficiency is low. Summary of the invention
[0006] The present application provides a data processing method, device, electronic device and storage medium to solve the problem in the prior art that secure multi-party computing is usually written according to the idea of synchronization. During the execution of the algorithm, each party to the algorithm performs synchronous calculations on their own data, resulting in low algorithm execution efficiency.
[0007] In a first aspect, an embodiment of the present application provides a data processing method, including:
[0008] After obtaining the trigger instruction, calling a start meta-function in the meta-function set, and processing the initial calculation data carried in the trigger instruction by the start meta-function to obtain first data; the meta-function set is a set of meta-functions obtained after splitting the target algorithm;
[0009] caching the first data;
[0010] After each data cache operation is detected, a callable target meta-function in the meta-function set is called according to the cached data to be processed, the data to be processed is processed by the target meta-function, and the processed second data is returned;
[0011] If the target meta-function calls an end function, determining that the second data is a calculation result;
[0012] If the target meta-function does not call the end function, cache the second data.
[0013] Optionally, performing data processing on the data to be processed by the target meta-function and returning the processed second data includes:
[0014] Extracting target data to be processed corresponding to the target meta-function from the data to be processed;
[0015] The target data to be processed is sent to the target meta-function so that the target data to be processed is processed by the target meta-function to obtain the second data, and the second data is returned.
[0016] Optionally, calling a callable target meta-function in a meta-function set according to the cached data to be processed includes:
[0017] The meta-function satisfying a calling condition is determined to be the target meta-function, wherein the calling condition is that the data to be processed includes all data corresponding to input parameters of the meta-function.
[0018] Optionally, the process of splitting the target algorithm to obtain the set of meta-functions includes:
[0019] Determining a data input node and a data output node in the target algorithm;
[0020] Splitting the data from the data input node to the adjacent data output node from the target algorithm to obtain the meta-function;
[0021] The set of meta-functions is determined as the meta-function set.
[0022] Optionally, the target algorithm is obtained by:
[0023] Get the original algorithm;
[0024] Determine the data call node and the data processing result node in the original algorithm;
[0025] The data input node is configured on the data calling node, and the data input node is configured with input parameters corresponding to the calling data;
[0026] And a data output node is configured at the data processing result node.
[0027] Optionally, when the data to be processed includes third data obtained externally, before calling the target meta-function that can be called in the meta-function set according to the cached data to be processed, the method further includes:
[0028] Obtaining a first data type and a first serialized data sent externally;
[0029] Deserialize the byte sequence according to the first data type to obtain deserialized data;
[0030] The deserialized data and the first data type are determined to be the third data.
[0031] Optionally, the second data includes encrypted data; and after caching the second data, the method further includes:
[0032] Serializing the encrypted data to obtain second serialized data;
[0033] The second data type of the encrypted data and the second serialized data are sent to a data recipient.
[0034] In a second aspect, an embodiment of the present application provides a data processing device, including:
[0035] An acquisition module, configured to call a start meta-function after acquiring a trigger instruction, and process the initial calculation data carried in the trigger instruction through the start meta-function to obtain first data;
[0036] A first cache module, used for caching the first data;
[0037] A calling module is used for calling a target meta-function that can be called in a meta-function set according to the cached data to be processed each time a data cache operation is detected, performing data processing on the data to be processed by the target meta-function, and returning the processed second data; the meta-function set is a set of meta-functions obtained after the target algorithm is split;
[0038] A determination module is used to determine that the second data is a calculation result if the target meta-function calls an end function.
[0039] The second cache module is used to cache the second data if the target meta-function does not call the end function.
[0040] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0041] The memory is used to store computer programs;
[0042] The processor is used to execute the program stored in the memory to implement the data processing method described in the first aspect.
[0043] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the data processing method described in the first aspect.
[0044] The above technical scheme provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application, after obtaining the trigger instruction, calls the start metafunction in the metafunction set, processes the initial calculation data carried in the trigger instruction through the start metafunction, and obtains the first data; caches the first data; each time a data cache operation is detected, the target metafunction that can be called in the metafunction set is called according to the cached data to be processed, and the data to be processed is processed through the target metafunction, and the second data obtained by the processing is returned; the metafunction set is a set of metafunctions obtained after the target algorithm is split; if the target metafunction calls the end function, the second data is determined to be the calculation result. In this way, after the target algorithm is split, the algorithm is executed using the metafunction set obtained by the split, and after obtaining the trigger instruction, the start metafunction in the metafunction set is directly called, and the first data obtained by the start metafunction processing is cached, and the target metafunction is automatically called by detecting the occurrence of the data cache operation, so as to achieve the purpose of the execution of the metafunction in the data trigger algorithm; and for different participants, when the data cache operation is detected, the callable target metafunction can be called, so as to achieve the asynchronous execution in the algorithm calculation process and improve the execution efficiency of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] 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.
[0046] 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.
[0047] Figure 1An application scenario diagram of a data processing method provided in an embodiment of the present application;
[0048] Figure 2 A schematic diagram of interaction in a data processing method provided in an embodiment of the present application;
[0049] Figure 3 A flowchart of a data processing method provided in one embodiment of the present application;
[0050] Figure 4 A flowchart of a data processing method provided by another embodiment of the present application;
[0051] Figure 5 A structural diagram of a data processing device provided in one embodiment of the present application;
[0052] Figure 6 A structural diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0053] 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.
[0054] According to an embodiment of the present application, a data processing method is provided. Optionally, in the embodiment of the present application, the above data processing method can be applied to Figure 1 In the hardware environment composed of the terminal 101 and the server 102 shown in FIG. Figure 1 As shown, the server 102 is connected to the terminal 101 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 102. The above-mentioned network includes but is not limited to: a wide area network, a metropolitan area network or a local area network, and the terminal 101 is not limited to a PC, a mobile phone, a tablet computer, etc.
[0055] The data processing method of the embodiment of the present application may be executed by the server 102, or by the terminal 101, or by both the server 102 and the terminal 101. The terminal 101 executes the data processing method of the embodiment of the present application, or the client installed thereon.
[0056] Taking the data processing method of the embodiment of the present application executed by the terminal as an example, before the data processing method of the present application is executed, the target algorithm is first split to obtain a set of meta-functions. Figure 2 , set up the algorithm flow controller and algorithm instance on the terminal.
[0057] Among them, the algorithm instance is the implementation of the target algorithm, which is essentially composed of a series of meta-functions of the algorithm logic. It is necessary to declare the meta-function list and send it to the algorithm process controller.
[0058] The algorithm process controller is a component used to control the execution of the algorithm process. It is used for data sending and receiving, meta-function management, and intermediate data caching.
[0059] The algorithm process controller can provide algorithm context parameters for algorithm writers to obtain some algorithm context information and send data to the specified party. It also provides a registration function to register the meta-function with the controller.
[0060] The algorithm flow controller manages the list of metafunctions registered by the algorithm instance. When the algorithm is executed, the start metafunction is called first, and the data returned by the metafunction is cached. The algorithm flow controller manages the data returned by the storage metafunction and the data received through the network. Each time the cache is performed, a scan operation is triggered to scan the data from the metafunction list for all input parameters that are already in the cache, and then take out the data corresponding to the input parameters from the cache for asynchronous calls. When the metafunction calls the data to be sent through the algorithm context parameter, the algorithm flow controller serializes the data and sends the serialized byte sequence and data type to the recipient through the network I / O (input / output). After the recipient receives it through the network I / O, it deserializes the byte sequence into the corresponding data according to the data type and caches it.
[0061] Among them, a metafunction refers to a special function used to describe a section of algorithm logic. The input of the metafunction comes from the metafunction executed in the previous step or from other participants in the algorithm. The output of the metafunction will become the input of the next metafunction to be executed. The metafunction is driven by the required input data and does not need to be actively called by the algorithm writer. The metafunction will be automatically called by the algorithm process control component after the input requirements are met.
[0062] Metafunctions can send data to other parties through algorithm context parameters. The sent data is received through the input parameters of the metafunction, and there is no need to actively receive it in a synchronous manner. Metafunctions are divided into ordinary metafunctions and start metafunctions. The start metafunction is a special metafunction that has no other input except the context parameters and is the beginning of the entire algorithm.
[0063] Figure 3is a flow chart of an optional data processing method according to an embodiment of the present application, such as Figure 3 As shown, the process of the method may include the following steps:
[0064] Step 301: after obtaining the trigger instruction, call the start metafunction in the metafunction set, and process the initial calculation data carried in the trigger instruction through the start metafunction to obtain the first data; the metafunction set is a set of metafunctions obtained after the target algorithm is split.
[0065] In some embodiments, the trigger instruction may be triggered by the user inputting the initial calculation data and clicking a related button (such as a start calculation button). The trigger instruction carries the initial calculation data, and after obtaining the trigger instruction, the start meta-function may be called, and the start meta-function processes the initial calculation data to obtain the first data.
[0066] In an optional embodiment, the process of splitting the target algorithm to obtain a set of meta-functions includes:
[0067] Determine the data input nodes and data output nodes in the target algorithm; split the data from the data input nodes to the adjacent data output nodes from the target algorithm to obtain meta-functions; determine the set of meta-functions as a meta-function set.
[0068] In some embodiments, there are data input nodes and data output nodes in the target algorithm. The data between the data input node and the data output node connected thereto is used as the data in the meta-function and is split out from the target algorithm to obtain multiple meta-functions.
[0069] In an optional embodiment, the target algorithm is obtained by:
[0070] Obtain the original algorithm; determine the data call node and the data processing result node in the original algorithm; configure the data input node in the data call node, and configure the input parameters corresponding to the call data in the data input node; and configure the data output node in the data processing result node.
[0071] There are many types of original algorithms, and any algorithm can be split according to the above-mentioned data call node and data processing result node as the start of the meta-function. Exemplarily, the original algorithm is a multi-party interactive computing algorithm, such as a secure multi-party computing algorithm.
[0072] A data calling node refers to the node used when an algorithm fragment in the original algorithm calls the calculation results of other algorithm fragments or data sent by other participants.
[0073] A data processing result node refers to a node where the data result is obtained after a certain algorithm fragment in the original algorithm is completed.
[0074] By configuring a data input node at a data call node and configuring an input parameter corresponding to the call data for the data input node, the data input node can identify the data input to its corresponding meta-function. Also, by configuring a data output node at a data processing result node, the original algorithm is split from a whole into multiple meta-functions according to the data input node and the data output node.
[0075] It should be noted that after the target algorithm is split, the meta-function required by each participant can be sent to the corresponding participant according to the different algorithm participants.
[0076] Step 302: Cache first data.
[0077] In some embodiments, after the first data is obtained by starting the meta-function processing, the first data is returned to the algorithm flow controller, and the algorithm flow controller caches the first data.
[0078] Step 303: After each data cache operation is detected, the target meta-function that can be called in the meta-function set is called according to the cached data to be processed, and the data to be processed is processed by the target meta-function, and the processed second data is returned. If the target meta-function calls the end function, step 304 is executed; if the target meta-function does not call the end function, step 305 is executed.
[0079] In some embodiments, after the algorithm flow controller detects the data caching operation, it scans the meta-function list to determine the target meta-function that can be called, and then the target meta-function processes the data to be processed. After the processing is completed, the target meta-function returns the obtained second data to the algorithm flow controller. In this way, the call of the target meta-function is triggered by the cached data to be processed, and automatic call is realized without human intervention.
[0080] In an optional embodiment, calling a callable target meta-function in a meta-function set according to the cached data to be processed includes:
[0081] A meta-function satisfying a calling condition is determined as a target meta-function, where the calling condition is all data corresponding to input parameters of the meta-function in the data to be processed.
[0082] In some embodiments, the calling metafunction set includes multiple metafunctions, and after each data is cached in the algorithm flow controller, the algorithm flow controller selects the target metafunction that can be called according to the calling condition of the metafunction. The calling condition of the metafunction is that the data corresponding to the input parameters of the metafunction are all in the cached data to be processed, and then, the algorithm flow controller calls the target metafunction, and the target metafunction scans the corresponding data in the algorithm flow controller, thereby completing the data processing.
[0083] In an optional embodiment, when the data to be processed includes third data obtained externally, before calling the target meta-function that can be called in the meta-function set according to the cached data to be processed, the method further includes:
[0084] Obtaining a first data type and first serialized data sent externally; deserializing a byte sequence according to the first data type to obtain deserialized data; and determining that the deserialized data and the first data type are third data.
[0085] In some embodiments, when the target algorithm is an algorithm involving multiple parties in the calculation, since it involves the interaction of multiple parties' data, when the data of one party is sent to the other party through the network, the data is often transmitted in the form of serialized data. Therefore, when the data to be processed includes third data obtained from the outside, since the data sent from the outside is serialized data, that is, the first serialized data and the corresponding first data type, the algorithm process controller will deserialize the first serialized data after obtaining the first serialized data and the first data type sent from the outside, and use the deserialized data and the first data type as the third data. By splitting the algorithm into multiple meta-functions and having the algorithm process controller serialize or deserialize the data sent from the outside, the algorithm does not need to pay attention to the data at the network level, and does not need metadata to serialize or deserialize the data sent from the outside, thereby improving the efficiency of algorithm execution.
[0086] Among them, the external party can be other algorithm participants.
[0087] Step 304: Determine that the second data is a calculation result.
[0088] In some embodiments, after the determined target metafunction calls the end function, it means that after the target metafunction is calculated, the result obtained becomes the final output result, that is, the above-mentioned second data is the calculation result.
[0089] Step 305: cache the second data.
[0090] In some embodiments, if the target metafunction does not call the end function, it means that after the target metafunction is calculated, the algorithm needs to continue running and cache the second data calculated by it into the algorithm process controller, thereby triggering the method to execute step 203 again until the target metafunction calls the end function.
[0091] In an optional embodiment, the second data includes encrypted data; after caching the second data, the method further includes:
[0092] The encrypted data is serialized to obtain second serialized data; and the second data type of the encrypted data and the second serialized data are sent to a data recipient.
[0093] Based on the above-mentioned related embodiments, when the target algorithm is an algorithm involving multi-party computing, since it involves the interaction of multi-party data, when the data of one party is sent to another party through the network, the data transmission form is often serialized data. Therefore, when the second data includes encrypted data, the encrypted data needs to be sent to the outside through the network I / O, so it is necessary to serialize the encrypted data, and send the obtained second serialized data and the second data type of the encrypted data to the data recipient.
[0094] In the data processing method of the present application, the calling of the algorithm can be divided into an initialization phase and an algorithm execution phase. For multiple calls of an algorithm, only one initialization phase needs to be executed.
[0095] Among them, the initialization stage: the algorithm instance component registers the information of all meta-functions to the algorithm process controller through the registration function. The algorithm process controller stores the input parameter type list of the meta-function, as well as the start meta-function and the ordinary meta-function itself.
[0096] Algorithm execution phase: The controller first calls the start meta-function, and the ordinary meta-function list is automatically called by the controller. Finally, when the end function is called in the meta-function through the algorithm context parameter, the algorithm execution result is transmitted.
[0097] In a specific embodiment, see Figure 4 Take the target algorithm as a secure multi-party computing algorithm, including the initiator and the participants as an example.
[0098] For the algorithm initiator: The algorithm process controller of the initiator first calls the start meta-function, returns data1 after execution, stores it in the cache, and scans the callable common meta-functions. When the common meta-function 1 is scanned and requires data1 to meet the calling requirements, an asynchronous call is made;
[0099] When ordinary metafunction 1 is called, data msg1 (i.e. the encrypted data mentioned above) is asynchronously sent to the participant. After the execution is completed, data2 is returned, stored in the cache, and the callable ordinary metafunction is scanned. If no callable ordinary metafunction is scanned, the process waits.
[0100] Receive the msg2 data sent by the participant, store it in the cache and scan the callable common meta-functions. Scan the common meta-function 4, which requires data2 and msg2 to meet the calling requirements, and make an asynchronous call.
[0101] When ordinary metafunction 4 is called, the Finish function (i.e. the above-mentioned end) is called through the algorithm context parameter to pass in the execution result, thus ending the algorithm calling process.
[0102] For algorithm participants: the algorithm process controller of the participant first calls the start meta-function, returns data3 after execution, stores it in the cache and scans the callable common meta-function. If no callable common meta-function is scanned, it waits;
[0103] Receive the msg1 data sent by the initiator, store it in the cache and scan the callable common meta-functions. Scan the common meta-function 2 and find that data3 and msg1 meet the calling requirements, and make an asynchronous call.
[0104] After ordinary metafunction 2 is executed, data4 is returned, stored in the cache, and the callable ordinary metafunctions are scanned. When ordinary metafunction 3 is scanned and requires data4 to meet the calling requirements, an asynchronous call is performed;
[0105] When ordinary meta-function 3 is called, data msg2 is asynchronously sent to the initiator. After the execution is completed, no data is returned and the scan is not triggered.
[0106] It can be understood that the above number of meta-functions is only used for example and does not mean that the algorithm can only be decomposed into the above number of meta-functions.
[0107] The data processing method of the present application can decouple the process logic of the network and the algorithm itself. The algorithm writer does not need to pay attention to the network level, but can focus on the algorithm itself to write complex logic more easily. In addition, it is convenient to nest calls between algorithms, and part of the logic of the algorithm is easy to reuse (by reusing ordinary meta-functions). In addition, the algorithm is based on data-driven asynchronous execution, and the efficiency of the algorithm can be improved by parallelizing network transmission operations and local computing operations.
[0108] Based on the same concept, a data processing device is provided in the embodiment of the present application. The specific implementation of the device can refer to the description of the method embodiment part, and the repeated parts will not be repeated. Figure 5 As shown, the device mainly includes:
[0109] The acquisition module 501 is used to call the start meta-function after acquiring the trigger instruction, and process the initial calculation data carried in the trigger instruction through the start meta-function to obtain the first data;
[0110] A first cache module 502, configured to cache first data;
[0111] The calling module 503 is used for calling a target meta-function that can be called in the meta-function set according to the cached data to be processed each time a data cache operation is detected, performing data processing on the data to be processed by the target meta-function, and returning the processed second data; the meta-function set is a set of meta-functions obtained after the target algorithm is split;
[0112] The determination module 504 is used to determine that the second data is a calculation result if the target meta-function calls the end function.
[0113] The second cache module 505 is used to cache the second data if the target meta-function does not call the end function.
[0114] Based on the same concept, an electronic device is also provided in the embodiment of the present application, such as Figure 6 As shown, the electronic device mainly includes: a processor 601, a memory 602 and a communication bus 603, wherein the processor 601 and the memory 602 communicate with each other through the communication bus 603. The memory 602 stores a program executable by the processor 601, and the processor 601 executes the program stored in the memory 602 to implement the following steps:
[0115] After obtaining the trigger instruction, calling the start meta-function in the meta-function set, processing the initial calculation data carried in the trigger instruction by the start meta-function, and obtaining the first data; the meta-function set is a set of meta-functions obtained after the target algorithm is split;
[0116] caching first data;
[0117] After each data cache operation is detected, a target meta-function that can be called in the meta-function set is called according to the cached data to be processed, the data to be processed is processed by the target meta-function, and the processed second data is returned;
[0118] If the target meta-function calls the end function, determining that the second data is a calculation result;
[0119] If the target meta-function does not call the end function, the second data is cached.
[0120] The communication bus 603 mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 603 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0121] The memory 602 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the processor 601.
[0122] The above-mentioned processor 601 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc., and can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0123] In another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed on a computer, the computer executes the data processing method described in the above embodiment.
[0124] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instruction is transmitted from a website site, a computer, a server or a data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integration. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape, etc.), an optical medium (such as a DVD) or a semiconductor medium (such as a solid-state hard disk), etc.
[0125] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0126] 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 processing method, characterized in that: include: After obtaining the trigger instruction, the start metafunction in the metafunction set is called, and the initial calculation data carried in the trigger instruction is processed by the start metafunction to obtain the first data; the metafunction set is a set of metafunctions obtained after the target algorithm is split; a metafunction refers to a special function used to describe a section of algorithm logic, and the input of the metafunction comes from the metafunction generated by the previous step or sent by other algorithm participants, and the output of the metafunction will become the input of the next step to be executed metafunction; the start metafunction refers to a special metafunction that has no other input except the context parameter, and is the beginning of the entire algorithm; caching the first data; After each data cache operation is detected, a callable target meta-function in the meta-function set is called according to the cached data to be processed, the data to be processed is processed by the target meta-function, and the processed second data is returned; If the target meta-function calls an end function, determining that the second data is a calculation result; If the target meta-function does not call the end function, cache the second data; The process of splitting the target algorithm to obtain the set of meta-functions includes: Determining a data input node and a data output node in the target algorithm; Splitting the data from the data input node to the adjacent data output node from the target algorithm to obtain the meta-function; Determining the set of meta-functions as the meta-function set; Wherein, the target algorithm is obtained by the following method: Get the original algorithm; Determine the data call node and the data processing result node in the original algorithm; The data input node is configured on the data calling node, and the data input node is configured with input parameters corresponding to the calling data; And configuring a data output node at the data processing result node; The step of calling a callable target meta-function in a meta-function set according to the cached data to be processed includes: Determine that the meta-function that meets the calling condition is the target meta-function, wherein the calling condition is that the data to be processed includes all data corresponding to the input parameters of the meta-function; The step of performing data processing on the data to be processed by the target meta-function and returning the processed second data comprises: Extracting target data to be processed corresponding to the target meta-function from the data to be processed; The target data to be processed is sent to the target meta-function so that the target data to be processed is processed by the target meta-function to obtain the second data, and the second data is returned.
2. The data processing method according to claim 1, characterized in that: When the data to be processed includes third data obtained externally, before calling the target meta-function that can be called in the meta-function set according to the cached data to be processed, the method further includes: Obtaining a first data type and a first serialized data sent externally; Deserialize the byte sequence according to the first data type to obtain deserialized data; The deserialized data and the first data type are determined to be the third data.
3. The data processing method according to claim 1, characterized in that: The second data includes encrypted data; and after caching the second data, the method further includes: Serializing the encrypted data to obtain second serialized data; The second data type of the encrypted data and the second serialized data are sent to a data recipient.
4. A data processing device, characterized in that: include: The acquisition module is used to call the start metafunction after acquiring the trigger instruction, and process the initial calculation data carried in the trigger instruction through the start metafunction to obtain the first data; the metafunction refers to a special function used to describe a section of algorithm logic, the input of the metafunction comes from the metafunction generated by the previous step or from the other algorithm participants, and the output of the metafunction will become the input of the next step to be executed metafunction; the start metafunction refers to a special metafunction with no other input except the context parameter, which is the beginning of the entire algorithm; A first cache module, used for caching the first data; A calling module is used for calling a target meta-function that can be called in a meta-function set according to the cached data to be processed each time a data cache operation is detected, performing data processing on the data to be processed by the target meta-function, and returning the processed second data; the meta-function set is a set of meta-functions obtained after the target algorithm is split; A determination module, configured to determine that the second data is a calculation result if the target meta-function calls an end function; A second cache module, configured to cache the second data if the target meta-function does not call the end function; The process of splitting the target algorithm to obtain the set of meta-functions includes: Determining a data input node and a data output node in the target algorithm; Splitting the data from the data input node to the adjacent data output node from the target algorithm to obtain the meta-function; Determining the set of meta-functions as the meta-function set; Wherein, the target algorithm is obtained by the following method: Get the original algorithm; Determine the data call node and the data processing result node in the original algorithm; The data input node is configured on the data calling node, and the data input node is configured with input parameters corresponding to the calling data; And configuring a data output node at the data processing result node; The step of calling a callable target meta-function in a meta-function set according to the cached data to be processed includes: Determine that the meta-function that meets the calling condition is the target meta-function, wherein the calling condition is that the data to be processed includes all data corresponding to the input parameters of the meta-function; The step of performing data processing on the data to be processed by the target meta-function and returning the processed second data comprises: Extracting target data to be processed corresponding to the target meta-function from the data to be processed; The target data to be processed is sent to the target meta-function so that the target data to be processed is processed by the target meta-function to obtain the second data, and the second data is returned.
5. An electronic device, characterized in that: include: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is used to execute the program stored in the memory to implement the data processing method described in any one of claims 1 to 3.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data processing method according to any one of claims 1 to 3 is implemented.
