CN113032283A - Ciphertext operation debugging method, calculation engine and ciphertext operation system - Google Patents

Ciphertext operation debugging method, calculation engine and ciphertext operation system Download PDF

Info

Publication number
CN113032283A
CN113032283A CN202110552732.1A CN202110552732A CN113032283A CN 113032283 A CN113032283 A CN 113032283A CN 202110552732 A CN202110552732 A CN 202110552732A CN 113032283 A CN113032283 A CN 113032283A
Authority
CN
China
Prior art keywords
task
flag variable
storage structure
assignment
variable
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110552732.1A
Other languages
Chinese (zh)
Other versions
CN113032283B (en
Inventor
王一帆
崔波
贾晓丰
高嵩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huakong Tsingjiao Information Technology Beijing Co Ltd
Original Assignee
Huakong Tsingjiao Information Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huakong Tsingjiao Information Technology Beijing Co Ltd filed Critical Huakong Tsingjiao Information Technology Beijing Co Ltd
Priority to CN202110552732.1A priority Critical patent/CN113032283B/en
Publication of CN113032283A publication Critical patent/CN113032283A/en
Application granted granted Critical
Publication of CN113032283B publication Critical patent/CN113032283B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3628Software debugging of optimised code

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention provides a ciphertext operation debugging method, a calculation engine and a ciphertext operation system. The method is applied to a computing engine in a cryptograph operation system, the cryptograph operation system further comprises a task control node, and the method comprises the following steps: receiving task configuration of a ciphertext operation task, wherein the task configuration comprises a ciphertext operation code and an assignment statement of a mark variable; loading an assignment statement of the flag variable, and updating the first storage structure according to the assignment of the flag variable; when a calling interface of the flag variable is executed, the assignment of the flag variable is read from the first storage structure, and the task configuration of the ciphertext operation task is updated based on the assignment of the flag variable; and sending the updated task configuration to a task control node, and issuing the updated task configuration to a task participant of the ciphertext operation task through the task control node. The embodiment of the invention can dynamically update the task configuration, reduce the learning cost of the user and improve the processing efficiency of the calculation engine.

Description

Ciphertext operation debugging method, calculation engine and ciphertext operation system
Technical Field
The invention relates to the technical field of computers, in particular to a ciphertext operation debugging method, a calculation engine and a ciphertext operation system.
Background
Various bugs or bugs may occur in the program code during development and use, and may be caused by logic errors or programming errors. In addition, according to the program test requirements or the real user requirements, various details which need to be changed or optimized may exist in the program code. These bugs, defects, or modifiable, optimizable details can generally be fixed or optimized through debugging of the program code.
The ciphertext operation debugging refers to a process of debugging the program code of the ciphertext operation and further repairing or optimizing the program code of the ciphertext operation, and the ciphertext operation can be an operation based on multi-party safe computation.
At present, dynamically adding new input parameters or output parameters can be realized through a self-defined instruction on the premise of not changing the initial task configuration of a cryptograph operation task. However, the original input interface and output interface, and the interface for dynamically adding the input parameter or output parameter may exist in the code, so that the user needs to learn the use methods of different interfaces, and the learning cost of the user is increased; in addition, the computing engine needs to execute two sets of processing logics on the two interfaces respectively, which affects the processing efficiency of the computing engine.
Disclosure of Invention
The embodiment of the invention provides a ciphertext operation debugging method, a calculation engine and a ciphertext operation system, which can dynamically update task configuration in the process of ciphertext operation debugging, improve the efficiency of debugging ciphertext operation tasks, reduce the learning cost of users and improve the processing efficiency of the calculation engine.
In order to solve the above problem, an embodiment of the present invention discloses a ciphertext operation debugging method, where the method is applied to a compute engine in a ciphertext operation system, the ciphertext operation system further includes a task control node, and the method includes:
receiving task configuration of a ciphertext operation task, wherein the task configuration comprises a ciphertext operation code and an assignment statement of a mark variable, and the mark variable is used for indicating an update parameter of the task configuration;
loading assignment statements of the flag variables, and updating a first storage structure according to assignment of the flag variables, wherein the first storage structure is used for recording relevant information of each flag variable in the task configuration;
when a calling interface to the flag variable is executed, the assignment of the flag variable is read from the first storage structure, and the task configuration of the ciphertext operation task is updated based on the assignment of the flag variable;
and sending the updated task configuration to a task control node, and issuing the updated task configuration to a task participant of the ciphertext operation task through the task control node so that the task participant executes the ciphertext operation task according to the updated task configuration.
On the other hand, the embodiment of the invention discloses a computing engine, which is applied to a cryptograph operation system, the cryptograph operation system further comprises a task control node, and the computing engine comprises:
the system comprises a configuration receiving module, a task configuration processing module and a task configuration processing module, wherein the configuration receiving module is used for receiving task configuration of a ciphertext operation task, the task configuration comprises a ciphertext operation code and a flag variable assignment statement, and the flag variable is used for indicating an update parameter of the task configuration;
the information updating module is used for loading assignment statements of the flag variables and updating a first storage structure according to assignment of the flag variables, wherein the first storage structure is used for recording relevant information of each flag variable in the task configuration;
the configuration updating module is used for reading the assignment of the flag variable from the first storage structure when executing a calling interface to the flag variable, and updating the task configuration of the ciphertext operation task based on the assignment of the flag variable;
and the configuration sending module is used for sending the updated task configuration to the task control node, and sending the updated task configuration to the task participators of the ciphertext operation task through the task control node so that the task participators execute the ciphertext operation task according to the updated task configuration.
In another aspect, an embodiment of the present invention discloses a ciphertext operation system, including: a calculation engine, a task control node, a data source node, and a result acquisition node, wherein,
the computing engine is used for receiving task configuration of a ciphertext operation task, wherein the task configuration comprises a ciphertext operation code and a flag variable assignment statement, and the flag variable is used for indicating an update parameter of the task configuration;
the computing engine is further configured to load an assignment statement of the flag variable, update a first storage structure according to the assignment of the flag variable, read the assignment of the flag variable from the first storage structure when executing a call interface to the flag variable, update task configuration of the ciphertext operation task based on the assignment of the flag variable, and send the updated task configuration to a task control node; the first storage structure is used for recording relevant information of each mark variable in the task configuration;
the task control node is used for receiving the updated task configuration sent by the computing engine and sending the updated task configuration to the task participants of the ciphertext operation task so that the task participants execute the ciphertext operation task according to the updated task configuration, and the task participants comprise the computing engine, a data source node and a result acquisition node which participate in the ciphertext operation task.
In yet another aspect, an embodiment of the present invention discloses a machine-readable medium having stored thereon instructions, which, when executed by one or more processors, cause an apparatus to perform a ciphertext operation debugging method as described in one or more of the preceding.
The embodiment of the invention has the following advantages:
the embodiment of the invention adds the assignment statement of the flag variable in the task configuration, loads the assignment statement of the flag variable before executing the call interface of the flag variable, and updates the first storage structure according to the assignment of the flag variable, wherein the first storage structure is used for recording the relevant information of each flag variable in the task configuration. In this way, when executing the call interface to the flag variable, the assignment of the flag variable is read from the first storage structure, and it can be guaranteed that the read assignment is an updated assignment. The flag variable is used for indicating the update parameters of the task configuration, such as an added data source node, an added result acquisition node, a modified data source node, a modified result acquisition node and an added result variable. In addition, in the process of dynamically updating the task configuration, the embodiment of the invention does not need to add an additional interface, can reduce the learning cost of a user, and can improve the processing efficiency of the computing engine.
Description of the drawings in order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are required to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without inventive labor.
FIG. 1 is a diagram illustrating the structure of a cryptogram algorithm and the flow of data in the cryptogram algorithm;
FIG. 2 is a flowchart illustrating steps of a ciphertext operation debugging method according to an embodiment of the present invention;
FIG. 3 is a block diagram of a computing engine embodiment of the present invention;
fig. 4 is a block diagram of a ciphertext operation system according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms first, second and the like in the description and in the claims of the present invention are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the invention may be practiced other than those illustrated or described herein, and that the objects identified as "first," "second," etc. are generally a class of objects and do not limit the number of objects, e.g., a first object may be one or more. Furthermore, the term "and/or" in the specification and claims is used to describe an association relationship of associated objects, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. The term "plurality" in the embodiments of the present invention means two or more, and other terms are similar thereto.
The ciphertext operation debugging method provided by the invention can be applied to a ciphertext operation system, and referring to fig. 1, a structure of the ciphertext operation system and a schematic diagram of a data flow direction in the ciphertext operation system are shown. As shown in fig. 1, the ciphertext operation system includes: a task control node 101, a computation engine 102, a data source node 103, and a result acquisition node 104. In practical application, the ciphertext operation system may be connected to the client 105 on the user side, and the client may receive an input parameter, an output parameter, a debugging task start instruction/a debugging task end instruction, and the like for performing ciphertext operation debugging, which are input by a user, and may return an output result of ciphertext operation debugging to the client for the user to view.
In a ciphertext computing system, the data that participates in the computation, the intermediate results, and the final result may be ciphertext. The cryptogram operation system may include at least one data node and at least one compute engine. The data nodes may provide services such as data storage, data provisioning, computation result storage, and the like. That is, the data nodes may include a data source node and a result obtaining node, and the data source node may be used to provide data storage and data providing services. The result acquisition node may be operable to provide a service that receives and stores the computed results. In a ciphertext operation task, the data source node and the result obtaining node may be the same data node or different data nodes. The calculation engine is used for executing a specific ciphertext calculation task according to the data provided by the data source node. The task control node is used for generating a ciphertext calculation task and scheduling the calculation engine to execute the ciphertext calculation task.
Further, the ciphertext operation system may include at least two computation engines, and the at least two computation engines perform collaborative computation based on a multi-party secure computation protocol to complete a ciphertext computation task generated by the task control node.
The data source node, the client and the result acquisition node can be located on a user side, and the task control node and the calculation engine can be located on a service side. The data source node, the client and the result acquisition node can be located in the same device or in different devices. The result acquisition node may be a designated certain data node or data nodes.
As shown in fig. 1, the data stream corresponding to the first step is a data stream interacted between the client and the task control node, and may include, for example, a debugging task start instruction/a debugging task end instruction issued by the client, and task state information returned by the task control node received by the client. And secondly, the corresponding data stream is a data stream for performing task configuration interaction between the task control node and each task participant, and for example, the corresponding data stream can comprise update information of task configuration and the like. And thirdly, the corresponding data flow represents the flow direction of the operation data, the intermediate result and the final result participating in the cryptograph calculation task in the cryptograph operation system.
In one example, the ciphertext operation debugging process may generally include the following steps:
a1, the client receives input parameters and output parameters corresponding to the current debugging task input by the user, and sends a task request to the task control node, wherein the task request carries the input parameters and the output parameters, and the client receives state information returned by the task control node.
The current debugging task refers to a task of debugging the program code of the current ciphertext operation. The program code of the ciphertext operation (hereinafter, referred to as ciphertext operation code) generally consists of multiple sections of code, and the debugging of the ciphertext operation code may be performed by step-by-step execution, for example, one or more sections of code are executed each time.
It should be noted that, in the embodiment of the present invention, the current debugging task refers to the whole process of debugging a program code of a certain ciphertext operation, and after receiving a debugging task ending instruction input by a user through a client, the current debugging task may be considered to be completed or ended.
The input parameter is used to specify a data source node participating in the current debugging task, for example, the input parameter may specify address information of the data source node. The output parameter is used to specify a result variable to be obtained by the current debugging task and a result obtaining node, such as specifying address information of the result obtaining node. The state information returned by the task control node may include running states of all task participants of the current debugging task, such as running, failure, success, and the like, and reasons of the failure.
A2, the client receives the ciphertext operation code input by the user, sends the ciphertext operation code to the task control node, and receives the state information returned by the task control node.
The ciphertext operation code received by the client may be a certain section or several sections of codes in the whole program code of the ciphertext operation. The state information returned by the control node may include the running states of all task participants, such as running, failure, success, and the like, and the reason of the failure, and the like.
A3, the task control node generates a ciphertext computing task and task configuration corresponding to the ciphertext computing task according to the received task request and a ciphertext computing code, and sends the task configuration to all task participants, wherein the task participants comprise a data source node specified by an input parameter, a result acquisition node used for acquiring a computing result corresponding to an output parameter, and a computing engine participating in the ciphertext computing task, and then the task control node receives state information returned by each task participant, such as states of operation, failure, success and the like, reasons of failure and the like.
A4, after receiving the task configuration, the data source node sends the operation data which is held by the data source node and is specified by the input parameters in the task configuration to the computation engine specified in the task configuration. And after receiving the task configuration, the computing engine executes the ciphertext operation codes appointed in the task configuration based on the received operation data. And after receiving the task configuration, the result acquisition node acquires a calculation result corresponding to the output parameter from a calculation engine specified in the task configuration.
And A5, returning to the step A2, and the client receives the next section of ciphertext operation codes input by the user so as to continue to execute the current debugging task.
A6, the client receives a debugging task ending instruction input by a user, and sends the debugging task ending instruction to the task control node, the task control node informs each computing engine to end the current ciphertext computing task and returns the state information of the completed computation to the client, and after receiving the state information of the completed computation returned by the task control node, the client can obtain the computation result specified by the output parameter from the result obtaining node and output the computation result to the user interface for displaying.
In the above ciphertext operation debugging process, the input parameters and the output parameters are specified in step a 1. If during the execution of the current debugging task, for example, after receiving a certain section of ciphertext operation code input by the user, that is, after step a2 is completed, the user needs to add a new output parameter to obtain a certain intermediate result of the program code of the ciphertext operation. At this time, it is necessary to return to re-execute step a1, reconfigure the input parameters and the output parameters, and restart a debugging task to add new output parameters corresponding to the intermediate result to be checked.
That is, each time a new output parameter needs to be added, the process returns to re-execute step a1, reconfigure the input parameters and the output parameters, and restart a debugging task. Similarly, if new input parameters need to be added, the process returns to step a1 to reconfigure input parameters and output parameters and restart a debugging task. Repeated operations need to be frequently executed, and therefore the efficiency of ciphertext operation debugging is affected.
In order to solve the problem, an embodiment of the present invention provides a ciphertext operation debugging method, which can dynamically update task configuration during the execution process of a current debugging task, and does not need to add an additional interface. Specifically, the embodiment of the present invention may dynamically update the input parameters and/or the output parameters, including dynamically increasing the input parameters and/or the output parameters, such as dynamically increasing data source nodes, dynamically increasing result variables to be obtained, and dynamically increasing result obtaining nodes; and dynamically modifying the input parameters and/or the output parameters, such as dynamically modifying the data source nodes and dynamically modifying the result acquisition nodes. By the embodiment of the invention, when the task configuration needs to be updated, the step A1 does not need to be executed again, the input parameters and the output parameters do not need to be reconfigured, and a debugging task does not need to be restarted, so that repeated operation is reduced, and the efficiency of ciphertext operation debugging is improved.
Referring to fig. 2, a flowchart illustrating steps of an embodiment of a ciphertext operation debugging method according to the present invention is shown, where the method may be applied to a compute engine in a ciphertext operation system, where the ciphertext operation system further includes a task control node, and the method may specifically include:
step 201, receiving task configuration of a ciphertext operation task, wherein the task configuration comprises a ciphertext operation code and an assignment statement of a flag variable, and the flag variable is used for indicating an update parameter of the task configuration;
step 202, loading assignment statements of the flag variables, and updating a first storage structure according to the assignment of the flag variables, wherein the first storage structure is used for recording relevant information of each flag variable in the task configuration;
step 203, when executing the calling interface to the flag variable, reading the assignment of the flag variable from the first storage structure, and updating the task configuration of the ciphertext operation task based on the assignment of the flag variable;
and 204, sending the updated task configuration to a task control node, and sending the updated task configuration to a task participant of the ciphertext operation task through the task control node, so that the task participant executes the ciphertext operation task according to the updated task configuration.
The embodiment of the invention dynamically updates the task configuration of the ciphertext operation task by adding the assignment statement of the flag variable in the task configuration. Specifically, in the execution process of the current debugging task, at any time before the input interface or the output interface is called, the assignment statement of the flag variable is added in the ciphertext operation code, so that the task configuration can be dynamically updated. The flag variable is used for indicating an update parameter of the task configuration. Further, the update parameters may include any one or more of an added data source node, an added result obtaining node, a modified data source node, a modified result obtaining node, and an added result variable.
The embodiment of the invention can realize dynamic update of the task configuration by adding the assignment statement of the flag variable in the task configuration and dynamically processing the flag variable which is changed and updated. Dynamically updating the task configuration includes dynamically updating the input parameters and/or the output parameters. Dynamically updating the input parameters includes dynamically adding data source nodes and dynamically modifying data source nodes. The dynamic updating output parameters comprise a dynamic increasing result variable, a dynamic increasing result acquisition node and a dynamic modifying result acquisition node.
Specifically, the computing engine may receive a task configuration of a ciphertext operation task from the client, where the task configuration includes task configuration information. In addition, the task configuration also comprises a ciphertext operation code and an assignment statement of a flag variable, wherein the assignment statement of the flag variable is positioned in front of a calling interface of the flag variable.
In the embodiment of the invention, the original input interface or output interface is still adopted in the process of realizing the dynamic updating of the task configuration, and a custom interface is not additionally added. For example, the original input interface pp.ss (source), which is an input parameter used to indicate the URL (Uniform Resource Locator) of the data source node, may be used to dynamically update the input parameter. In a specific implementation, the source may be a flag variable, for example, in the form of pflag s. The original output interface pp.real (var, pflag s.xx) can be used when dynamically updating the output parameters, var and pflag s.xx are output parameters, var is a variable name in the ciphertext operation code, and pflag s.xx is a flag variable which can be used for specifying the output parameters to be updated, such as an added or modified data source node and an added result variable.
For example, adding a result variable in a debugging task by adding an assignment statement of a flag variable xx to a ciphertext operation code at any time before calling the result variable xx by using an output interface pp. For another example, the user may add a flag variable for increasing the data source node to the ciphertext operation code at any time before the data source node is called by the input interface pp.ss (source), so that the data source node may be newly added to the debugging task.
For another example, if the result obtaining node dest2 needs to be dynamically added, an assignment statement for adding a flag variable of the result obtaining node, such as pflags. default _ destination ('dest2', 'http:// c2id _ local/res2', 'result destination2'), may be added to the ciphertext operation code, and the statement is used to assign the flag variable to 'http:// c2id _ local/res2', or 'result destination2', while defining the flag variable 'dest 2'. The assignment statement of this flag variable precedes the calling interface pp.recent (res2, pflag s.dest2).
In order to ensure that the input interface and the output interface acquire the latest assignment of the input parameters and the output parameters, when the calculation engine determines that the task configuration simultaneously contains the ciphertext operation codes and the assignment statements of the flag variables, the calculation engine loads the assignment statements of the flag variables and then executes the ciphertext operation codes.
In an optional embodiment of the present invention, the task configuration of the ciphertext operation task further includes a preset function, where the preset function is configured to, when it is determined that the task configuration simultaneously includes the ciphertext operation code and the assignment statement of the flag variable, trigger an operation of loading the assignment statement of the flag variable, so as to update the first storage structure according to the assignment of the flag variable.
In a specific implementation, a preset function, such as pp.run (), may be added at the end of each segment of code in the ciphertext operation code, and the preset function is used to trigger the operation of loading the assignment statement of the flag variable before executing the ciphertext operation code, and update the first storage structure according to the assignment of the flag variable. The first storage structure is used for recording relevant information of each mark variable in the task configuration. The type of the first storage structure is not limited in the embodiments of the present invention, for example, the first storage structure may be a table, a tree, or the like.
In an optional embodiment of the present invention, after receiving the task configuration of the ciphertext operation task, the method may further include:
and constructing a first storage structure and a second storage structure, wherein the first storage structure is used for storing the relevant information of each mark variable in the task configuration, and the second storage structure is used for storing the relevant information of the task configuration of the ciphertext operation task.
In example 1, part of the code in the initial task configuration is as follows:
################### code sequence 1 ###################
import privpy as pp
PFLAGS = pp.FLAGS()
PFLAGS.DEFINE_string(‘flag1’,xxx1,‘some description’)
PFLAGS.DEFINE_integer(‘flag2’,xxx2,‘some description’)
# other codes…
where lines are annotated with one or more "#" labeled behaviors.
In the code of example 1, FLAGS () is a command-line argument processing function provided for a library function of a ciphertext operation system. PFLAGS is the return value of the FLAGS () function, which is a custom command line argument handling class object.
Flag variable flag1 and flag variable flag2 are defined in the code of example 1, and the statement "pflag. definition _ string ('flag 1', xxx1, 'sol description')" is used to assign flag variable flag1 to xxx1 while defining flag variable flag 1. "software description" means some descriptive parameters. Likewise, the statement "pflag. default _ integer ('flag 2', xxx2, 'some description')" is used to assign the flag variable flag2 to xxx2 while defining the flag variable flag 2.
After receiving the task configuration of example 1, the computing engine constructs a first storage structure and a second storage structure, where the first storage structure is used to store information about flag variables in the task configuration. The second storage structure is used for storing the related information of the task configuration. The related information of the flag variable includes, but is not limited to, name, assignment, type, etc. of the flag variable. The relevant information of the task configuration includes, but is not limited to, a data source node, a result variable, a data source node address, a cipher text operation code, a code parameter, and the like.
Since flag variable flag1 and flag variable flag2 have been defined and assigned in the code of example 1, the relevant information for these two flag variables is recorded in the first memory structure maintained by the compute engine after execution of this piece of code.
In one example, if the assignment to flag variable flag2 is not satisfactory to be modified during subsequent debugging, dynamic update may be achieved by adding an assignment statement to flag variable flag 2. For example, an assignment statement of "pflags. flag2= xxx2 a" may be added before the output interface of flag2 is invoked. In this way, the calculation engine loads the assignment statement "pflag s. flag2= xxx2 a" before executing the ciphertext operation code, and updates the first storage structure according to the assignment xxx2a of the flag variable flag2, so that the assignment of the flag variable flag2 recorded in the first storage structure is updated from "xxx 2" to "xxx 2 a". When a calling interface to the flag variable flag2 is executed, the assignment of the flag variable flag2 is read from the first storage structure as xxx2a, and the task configuration of the ciphertext operation task is updated based on the assignment xxx2a of the flag variable flag 2. It will be appreciated that the flag variable name "flag 2", the original assignment "xxx 2", and the updated assignment "xxx 2 a" are merely exemplary of one application.
The assignment of the flag variable flag1 can also be dynamically updated by the above method, in specific implementation, the flag variables (e.g., flag1 and flag 2) can be used to indicate different types of update parameters, such as a data source node, a result obtaining node, a result variable, and the like, and by dynamically updating the assignment of the flag variables, homomorphic update of the data source node, the result obtaining node, the result variable, and the like can be achieved.
When the task configuration comprises the ciphertext operation code and the assignment statement of the flag variable, the assignment statement of the flag variable is unloaded, the first storage structure is updated according to the assignment of the flag variable, and then the ciphertext operation code is executed. Thus, when the call interface to the flag variable is executed, the assignment of the flag variable is read from the first storage structure, and it can be ensured that the read assignment is updated. And based on the assignment of the flag variable, the task configuration of the ciphertext operation task can be updated, the updated task configuration is sent to a task control node, and the updated task configuration is issued to the task participators of the ciphertext operation task through the task control node, so that the task participators execute the ciphertext operation task according to the updated task configuration, and the task configuration is dynamically updated in the execution process of the current debugging task. In addition, in the process of dynamically updating the task configuration, the embodiment of the invention does not need to add an additional interface, and the code still uses an original input interface or an original output interface, so that the learning cost of a user can be reduced, and the processing efficiency of a computing engine can be improved.
The embodiment of the invention can support the following two updating modes for the mark variable: and updating the assignment of the existing flag variables, defining new flag variables and assigning the new flag variables.
Wherein the assignment of the existing flag variable is updated, for example, in example 1, the dynamic update of the assignment of the existing flag variable flag1 may be implemented by adding an assignment statement of the flag variable flag1, or the dynamic update of the assignment of the existing flag variable flag2 may be implemented by adding an assignment statement of the flag variable flag 2.
Defining and assigning a new flag variable, namely, defining and assigning the new flag variable at the same time. The process of defining and assigning new flag variables is described below by example 2, where in example 2, part of the code in the task configuration is as follows:
################### code sequence 2 ###################
# specify --flag3 = xxx3a
@pp.es
def main()
PFLAGS.DEFINE_source(‘flag3’,xxx3,‘some description’)
a = pp.ss(FLAGS.flag3)
pp.run()
in the ciphertext operation code of the task configuration shown in example 2, a definition statement "pflag. default _ source ('flag 3', xxx3, 'solution description')" including a new flag variable flag3, and an assignment statement "— flag3 = xxx3 a" of the flag variable are included. The definition statement "pflag. define _ source ('flag 3', xxx3, 'source description')" is used to assign flag variable flag3 to xxx 3. The assignment statement "- - - -flag3 = xxx3 a" is used to assign flag variable flag3 to xxx3 a. It should be noted that, in a specific implementation, the assignment statement "- - -flag3 = xxx3 a" of the flag variable may not be present in the code shown in the code sequence 2, but may be transmitted through the command line parameter when the client submits the ciphertext operation task. The task configuration may include a parameter field in addition to the code field through which client-entered command line parameters may be passed to the compute engine. In the embodiment of the present invention, the assignment statement "- - - -flag3 = xxx3 a" is a parameter introduced in a command line manner, and may be obtained by parsing a preset function pp.
Run () is included at the end of the code of example 2, which first loads the assignment statement "- - -flag3 = xxx3 a", and updates the first storage structure so that the flag variable flag3 in the first storage structure is assigned xxx3 a. In this way, when the call interface pp.ss (flags. flag3) to flag3 is executed, the assignment of flag variable flag3 to xxx3a instead of xxx3 is read from the first memory structure, whereby a dynamic update of the assignment of flag variable flag3 to xxx3a can be achieved.
In order to avoid the situation that the operation is wrong due to misoperation such as repeated definition of the flag variables in the process of dynamically updating the flag variables, the embodiment of the invention detects the updating process of the assignment of the two types of the flag variables by adding the self-defined preset type so as to ensure the updating accuracy.
In an optional embodiment of the present invention, the assigning statement includes a first assigning statement, the loading the assigning statement of the flag variable, and updating the first storage structure according to the assignment of the flag variable includes:
step S11, loading the first assignment statement of the flag variable, and inquiring whether the flag variable exists in the first storage structure;
step S12, in a case that the flag variable does not exist in the first storage structure, adding the flag variable in the first storage structure, and recording, in the first storage structure, an assignment of the flag variable as an assignment in the first assignment statement, and recording a data type of the flag variable as a preset type;
and step S13, updating the assignment of the flag variable in the first storage structure to the assignment in the first assignment statement when the flag variable exists in the first storage structure.
The first assignment statement refers to a statement that assigns a defined flag variable, like "pflag s. flag2= xxx2 a".
When receiving the task configuration of the first assignment statement comprising the ciphertext operation code and the flag variable, the calculation engine firstly loads the first assignment statement of the flag variable and queries whether the flag variable exists in the first storage structure. If the flag variable does not exist in the first storage structure (as in the case of example 2), the flag variable is added to the first storage structure, and the assignment of the flag variable is recorded in the first storage structure as the assignment in the first assignment statement, and the data type of the flag variable is recorded as a preset type, such as TBD. In this example, the updated first storage structure is shown in table 1.
TABLE 1
Sign variable Data type Assignment of value
flag3 TBD xxx3a
If the flag variable is present in the first storage structure (as was the case for updating flag2 in example 1), the assignment for the flag variable in the first storage structure is updated to the assignment in the first assignment statement for the flag variable. In this example, the updated first storage structure is shown in table 2.
TABLE 2
Sign variable Data type Assignment of value
flag1 string xxx1
flag2 integer xxx2a
In an optional embodiment of the present invention, before the updating the assignment of the flag variable in the first storage structure to the assignment in the first assignment statement in case that the flag variable exists in the first storage structure, the method further includes:
and checking whether the data type of the flag variable in the first storage structure is matched with the data type assigned in the first assignment statement, and if not, outputting error prompt information.
In order to prevent an error from occurring in updating of the flag variable, the embodiment of the present invention compares the data type assigned in the first assignment statement with the data type of the flag variable in the first storage structure, and outputs an error prompt message if the two steps are matched, which indicates that the data type assigned in the first assignment statement is incorrect.
In an optional embodiment of the present invention, the assigning statement includes a second assigning statement, the loading the assigning statement of the flag variable, and updating the first storage structure according to the assignment of the flag variable includes:
step S21, loading a second assignment statement of the flag variable, and inquiring whether the flag variable exists in a first storage structure;
step S22, in a case that the flag variable does not exist in the first storage structure, adding the flag variable in the first storage structure, and recording the assignment of the flag variable as the assignment in the second assignment statement and recording the data type of the flag variable as a preset type in the first storage structure;
step S23, when the flag variable exists in the first storage structure and the data type of the flag variable in the first storage structure is a preset type, converting the data type of the flag variable in the first storage structure into a target type corresponding to the flag variable.
The second assignment statement refers to a statement that assigns a flag variable while defining the flag variable, and the second assignment statement may be a definition statement, such as "pflags. define _ source ('flag 3', xxx3, 'source description')".
Further, in the embodiment of the present invention, under the condition that the ciphertext operation code includes both the first assignment statement and the second assignment statement of the flag variable, the first assignment statement is loaded and the first storage structure is updated, and then the second assignment statement is executed. And under the condition that the ciphertext operation code only contains the second assignment statement of the flag variable, loading the second assignment statement and updating the first storage structure, and then executing the second assignment statement.
Taking example 2 as an example, example 2 includes both a first value statement (- -flag3 = xxx3 a) and a second value statement ((-flag 3 ', xxx3 ' home description ')). After the first assignment statement is loaded and the first storage structure is updated, the first storage structure shown in table 1 is obtained. When the second assignment statement is accessed, the fact that a flag variable flag3 exists in the first storage structure is inquired, and the type of the flag variable flag3 in the first storage structure is a preset type TBD is inquired, so that the type of the flag variable flag3 in the first storage structure is converted into a target type corresponding to the flag variable flag 3. For example, in this example, the flag3 is used to indicate a data source node to be updated, the data source node is usually represented by a URL of the node, and the URL is a string, so that the target type corresponding to the flag variable flag3 is a string, the type of the flag variable flag3 in the first storage structure is converted into a string, and the updated first storage structure is shown in table 3.
TABLE 3
Sign variable Data type Assignment of value
flag3 string xxx3a
In an optional embodiment of the invention, the method may further comprise:
and outputting error prompt information under the condition that the flag variable exists in the first storage structure and the data type of the flag variable in the first storage structure is not a preset type.
For example, in example 2, when the second assignment statement (pflag. definition _ source ('flag 3', xxx3, 'home description')) to the flag variable flag3 is executed, if the flag variable flag3 already exists in the first storage structure at this time, and the data type of the flag variable flag3 in the first storage structure is not a preset type, such as a string type, and the flag3 is already defined, where the flag3 is repeatedly defined, error notification information may be output.
That is, in the specific implementation, for the same flag variable, the flag variable may be defined and assigned using the first assignment statement once, so as to avoid repeatedly defining the same flag variable, and then the flag variable may be dynamically updated using the second assignment statement, and the number of times of the second assignment statement is not limited.
In an optional embodiment of the present invention, the reading the assignment of the flag variable from the first storage structure may include: and reading the assignment of the flag variable from the first storage structure under the condition that the flag variable exists in the first storage structure and the data type of the flag variable in the first storage structure is the target type corresponding to the flag variable.
When a call interface to a flag variable is executed, for example, when the call interface is executed to an input interface pp.ss (flag.flag 3) in example 2, the interface needs to obtain an assignment of a flag3, a first storage structure (table 3) may be queried, where a flag variable flag3 exists in the first storage structure, and a data type of the flag variable flag3 in the first storage structure is a target type string corresponding to the flag variable flag3, so that the assignment of the flag variable flag3 may be read from the first storage structure as xxx3 a.
It should be noted that, in the embodiment of the present invention, the target type is taken as an example, and in an actual application, when the data type of the flag variable is forcibly converted, the type of the conversion is determined according to the type of the update parameter indicated by the flag variable, for example, in addition to string, the conversion may be performed to another target type such as integer.
When the assignment of a certain flag variable is accessed, if and only if the flag variable exists in the first storage structure and the data type of the flag variable is the target type corresponding to the flag variable, the access is considered to be successful, otherwise, the flag variable is not defined or is defined wrongly, and error prompt information can be output.
The following describes a specific process of dynamically updating configuration according to the present invention by using a specific example of a dynamically added result acquiring node.
The client sends the initial task configuration to the task control node, and under the dynamic update configuration framework of the invention, the task control node sends the initial task configuration to the task participants, the initial task configuration comprises result variable names which need to be acquired by the data acquisition node, and each result variable name is unique.
This initial task configuration config1 is as follows:
request id:24162737,
config version:0,
engine 0: [Host]{ip: [127.0.0.1, 127.0.0.1, 127.0.0.1, ], port: [5006, 5106, 5206, ], role: s1, }
engine 1: [Host]{ip: [127.0.0.1, 127.0.0.1, 127.0.0.1, ], port: [5021, 5121, 5221, ], role: s2, }
engine 2: [Host]{ip: [127.0.0.1, 127.0.0.1, 127.0.0.1, ], port: [5015, 5115, 5215, ], role: sa, }
engine 3: [Host]{ip: [127.0.0.1, 127.0.0.1, 127.0.0.1, ], port: [5009, 5109, 5209, ], role: sb, }
id:c1id_local,
code:
import privpy as pp
PFLAGS = pp.FLAGS()
PFLAGS.DEFINE_destination('dest1', 'http://c1id_local/res1', 'result destination1')
########################code seq1 begin################
a1 = pp.sint(10)
res1 = a1 * a1
pp.reveal(res1,PFLAGS.dest1)
pp.run()
########################code seq1 finish################
[ResultDest]{dest_id: c1id_local, varname:res1, stream:no, }
and the task control node issues the initial task configuration config1 to task participants, wherein the task participants comprise a calculation engine, a data source node and a result acquisition node result. A result variable res1 to be output is stated in the above config1, and this result variable res1 is acquired by a data node whose id is c1id _ local as a result acquisition node. The version information field version value of the initial task configuration is 0.
After receiving the config1, the calculation engine executes the ciphertext operation code seq1 in the config 1. After the code execution is completed, the first storage structure shown in table 4 can be obtained.
TABLE 4
Sign variable Data type Assignment of value
dest1 string http://c1id_local/res1
Next, the client sends task configuration config2 to the task control node to dynamically update the initial task configuration, where config2 is as follows:
########################code seq2 begin################
PFLAGS.DEFINE_destination('dest2', 'http://c2id_local/res2', 'result destination2')
res2 = a1 + a1
pp.reveal(res2,PFLAGS.dest2)
pp.run()
########################code seq2 finish##############
##
since the config2 includes both the ciphertext operation code (code seq 2) and the second assignment statement of the flag variable dest2 (default _ destination ('dest2', 'http:// c2id _ local/res2', 'result destination 2')), the calculation engine loads the second assignment statement of the flag variable dest2 after receiving the config2, and updates the first storage structure. Since the flag variable dest2 does not exist in the first storage structure, the flag variable dest2 is added to the first storage structure, and the assignment of the flag variable dest2 is recorded in the first storage structure as the assignment in the second assignment statement, and the data type of the flag variable dest2 is recorded as the preset type TBD. In this example, the updated first storage structure is shown in table 5.
TABLE 5
Sign variable Data type Assignment of value
dest1 string http://c1id_local/res1
dest2 TBD http://c2id_local/res2
When the second assignment statement "DEFINE _ destination ('dest2', 'http:// c2id _ local/res2', 'result destination2') of the flag variable dest2 is accessed, it is queried that the flag variable dest2 already exists in the first storage structure shown in Table 5, and the data type of the flag variable dest2 in the first storage structure is the preset type TBD, the data type of the flag variable dest2 in the first storage structure shown in Table 5 is converted into the target type string corresponding to the flag variable dest 2. The updated first storage structure is shown in table 6.
TABLE 6
Sign variable Data type Assignment of value
dest1 string http://c1id_local/res1
dest2 string http://c2id_local/res2
When executing the call interface pp.recent (res2, pflag s.dest2) to the flag variable dest2, the flag variable dest2 is assigned http:// c2id _ local/res2, which is read from the first storage structure shown in table 6.
In an optional embodiment of the present invention, the update parameter may include an added result variable, and the task configuration of the ciphertext operation task further includes a specified result name indicating the added result variable.
After the computing engine executes the ciphertext operation code seq1 in the task configuration config1, the computing engine receives the task configuration config2, and a new result obtaining node c2id _ lcoal and a new result variable res2 are designated in the ciphertext operation code seq2 of the config 2.
res2 is a result name specified by the user, and is used to indicate an added result variable, and compared with the way in which the result name is automatically generated by the computing engine, the embodiment of the present invention may give more options to the user by specifying the result name by the user, so that the user can perform other logic processing according to the specified result name. If the result name is automatically generated by the calculation engine, the result name is unpredictable for the user, and it is inconvenient for the user to perform other operations using the result name.
In addition, in the embodiment of the present invention, an arbitrary data node may be designated as a result obtaining node to obtain an output value of a result variable. For example, the output value of the result variable res1 acquired by the result acquisition node c1id _ local is specified in config 1. The result obtaining node c2id _ lcoal obtains the output value of the newly added result variable res2 specified in the config 2.
The embodiment of the invention improves the problem that the data source node and the result acquiring node cannot be changed in the running process of the ciphertext operation task, improves the user experience, can determine when and how to change the data source node, the result variable and the result acquiring node by a user, meets the requirement of the user on quickly and conveniently debugging the ciphertext operation code, and simplifies the processing logic of a calculation engine.
In this example, the task configuration of the ciphertext operation task may be updated based on the newly added flag variable dest2, and the assignment of the newly added flag variable dest 2. The updated task configuration config3 is as follows:
request id:24162737,
config version:1,
engine 0: [Host]{ip: [127.0.0.1, 127.0.0.1, 127.0.0.1, ], port: [5006, 5106, 5206, ], role: s1, }
engine 1: [Host]{ip: [127.0.0.1, 127.0.0.1, 127.0.0.1, ], port: [5021, 5121, 5221, ], role: s2, }
engine 2: [Host]{ip: [127.0.0.1, 127.0.0.1, 127.0.0.1, ], port: [5015, 5115, 5215, ], role: sa, }
engine 3: [Host]{ip: [127.0.0.1, 127.0.0.1, 127.0.0.1, ], port: [5009, 5109, 5209, ], role: sb, }
id:c1id_local,
code:
########################code seq3 begin################
PFLAGS.DEFINE_destination('dest2', 'http://c2id_local/res2', 'result destination2')
res2 = a1 + a1
pp.reveal(res2,PFLAGS.dest2)
pp.run()
########################code seq3 finish################
[ResultDest]{dest_id:c1id_local, varname:res1, stream:no, }
[ResultDest]{dest_id:c2id_local, varname:res2, stream:no, }
the task configuration config1 before update includes a result variable res1, which is acquired by the result acquisition node c1id _ local; the updated task configuration config3 includes result variables res1 and res2, where the output value of the result variable res1 is acquired by the result acquisition node c1id _ local and the output value of the result variable res2 is acquired by the result acquisition node c2id _ local.
It should be noted that, in the process of dynamically updating task configuration, any result obtaining node may be specified in the embodiment of the present invention, for example, in the above example, the output values of the result variables res1 and res2 obtained by the obtaining node c1id _ local may also be specified.
When the calculation engine executes the ciphertext operation code seq3 and executes the output interface pp. Specifically, when the task configuration update process is started, the computing engine adds 1 to the version information field version value in the task configuration (for example, the version value in the config3 is 1), and adds the newly added data node information to the result obtaining node field ResultDest of the task configuration. And then sending the updated task configuration to the task control node through heartbeat.
In the embodiment of the present invention, when the computing engine executes the call interface to the flag variable, if the update parameter indicated by the flag variable does not exist in the original task configuration, it may be determined that a task configuration update process needs to be triggered. For example, when executing to the input interface pp.ss interface, the data source node information that does not appear in the original task configuration is detected in the parameters of the input interface, or when executing to the output interface pp.current, the result variable or the result acquiring node information that does not appear in the original task configuration is detected in the parameters of the output interface, and then the task configuration updating process is started.
And after receiving the updated task configuration sent by the computing engine, the task control node judges whether the updated task configuration meets the updating condition. Judging whether the updated task configuration meets the updating condition, including: and if the version field value of the updated task configuration is larger than the version field value of the task configuration locally stored by the task control node and the updated task configurations sent by all the computing engines participating in executing the ciphertext operation task are the same, determining that the received updated task configuration meets the updating condition. And under the condition that the task control node determines that the updated task configuration meets the updating condition, the task control node issues the updated task configuration to a task participant of the ciphertext operation task so that the task participant executes the ciphertext operation task according to the updated task configuration. The task participants comprise a calculation engine, a data source node and a result acquisition node.
In the embodiment of the invention, the data node needs to continuously monitor the task ending instruction in the task execution process. Since any data node may receive a new result variable as a result obtaining node in the updated task configuration before the task is finished, or a new data is provided as a data source node, the data node needs to take corresponding action to obtain the result from the calculation engine or provide the new data to the calculation engine.
To sum up, the embodiment of the present invention adds the assignment statement of the flag variable in the task configuration, loads the assignment statement of the flag variable before executing the call interface of the flag variable, and updates the first storage structure according to the assignment of the flag variable, where the first storage structure is used to record the relevant information of each flag variable in the task configuration. In this way, when executing the call interface to the flag variable, the assignment of the flag variable is read from the first storage structure, and it can be guaranteed that the read assignment is an updated assignment. The flag variable is used for indicating the update parameters of the task configuration, such as an added data source node, an added result acquisition node, a modified data source node, a modified result acquisition node and an added result variable. In addition, in the process of dynamically updating the task configuration, the embodiment of the invention does not need to add an additional interface, and can reduce the learning cost of the user. The computing engine only needs to process the original input interface and the original output interface, and does not need to process an additionally added interface, so that the processing efficiency of the computing engine can be improved.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 3, a block diagram of a computing engine according to an embodiment of the present invention is shown, where the computing engine is applied to a ciphertext computing system, where the ciphertext computing system further includes a task control node, and the computing engine includes:
a configuration receiving module 301, configured to receive task configuration of a ciphertext operation task, where the task configuration includes a ciphertext operation code and a flag variable assignment statement, and the flag variable is used to indicate an update parameter of the task configuration;
an information updating module 302, configured to load an assignment statement of the flag variable, and update a first storage structure according to the assignment of the flag variable, where the first storage structure is used to record relevant information of each flag variable in the task configuration;
a configuration updating module 303, configured to, when executing a call interface to the flag variable, read assignment of the flag variable from the first storage structure, and update task configuration of the ciphertext operation task based on the assignment of the flag variable;
the configuration sending module 304 is configured to send the updated task configuration to a task control node, and send the updated task configuration to a task participant of the ciphertext operation task through the task control node, so that the task participant executes the ciphertext operation task according to the updated task configuration.
Optionally, the update parameters include any one or more of an added data source node, an added result obtaining node, a modified data source node, a modified result obtaining node, and an added result variable.
Optionally, the assignment statement includes a first assignment statement, and the information updating module includes:
the first loading submodule is used for loading the first assignment statement of the flag variable and inquiring whether the flag variable exists in a first storage structure;
a first adding submodule, configured to add the flag variable in the first storage structure, record, in the first storage structure, that the assignment of the flag variable is the assignment in the first assignment statement, and record that the data type of the flag variable is a preset type, when the flag variable does not exist in the first storage structure;
and the first updating submodule is used for updating the assignment of the flag variable in the first storage structure into the assignment in the first assignment statement under the condition that the flag variable exists in the first storage structure.
Optionally, the assignment statement includes a second assignment statement, and the information updating module includes:
the second loading submodule is used for loading a second assignment statement of the flag variable and inquiring whether the flag variable exists in the first storage structure;
a second adding submodule, configured to add the flag variable in the first storage structure under the condition that the flag variable does not exist in the first storage structure, record, in the first storage structure, an assignment of the flag variable as an assignment in the second assignment statement, and record a data type of the flag variable as a preset type;
and the second updating submodule is used for converting the data type of the flag variable in the first storage structure into a target type corresponding to the flag variable under the condition that the flag variable exists in the first storage structure and the data type of the flag variable in the first storage structure is a preset type.
Optionally, the calculation engine further comprises:
and the first prompting module is used for outputting error prompting information under the condition that the flag variable exists in the first storage structure and the data type of the flag variable in the first storage structure is not a preset type.
Optionally, the configuration update module is specifically configured to, when the flag variable exists in the first storage structure and a data type of the flag variable in the first storage structure is a target type corresponding to the flag variable, read an assignment of the flag variable from the first storage structure.
Optionally, the calculation engine further comprises:
and the storage construction module is used for constructing a first storage structure and a second storage structure, wherein the first storage structure is used for storing the relevant information of each flag variable in the task configuration, and the second storage structure is used for storing the relevant information of the task configuration of the ciphertext operation task.
Optionally, the update parameter includes an added result variable, and a specified result name is further included in the task configuration of the ciphertext operation task, where the specified result name is used to indicate the added result variable.
Optionally, the task configuration of the ciphertext operation task further includes a preset function, and the preset function is configured to trigger an operation of loading an assignment statement of a flag variable when it is determined that the task configuration simultaneously includes a ciphertext operation code and an assignment statement of the flag variable, so as to update the first storage structure according to the assignment of the flag variable.
The embodiment of the invention adds the assignment statement of the flag variable in the task configuration, loads the assignment statement of the flag variable before executing the call interface of the flag variable, and updates the first storage structure according to the assignment of the flag variable, wherein the first storage structure is used for recording the relevant information of each flag variable in the task configuration. In this way, when executing the call interface to the flag variable, the assignment of the flag variable is read from the first storage structure, and it can be guaranteed that the read assignment is an updated assignment. The flag variable is used for indicating the update parameters of the task configuration, such as an added data source node, an added result acquisition node, a modified data source node, a modified result acquisition node and an added result variable. In addition, in the process of dynamically updating the task configuration, the embodiment of the invention does not need to add an additional interface, can reduce the learning cost of a user, and can improve the processing efficiency of the computing engine.
Referring to fig. 4, a block diagram of a ciphertext operation system of an embodiment of the present invention is shown, the system including: a computation engine 401, a task control node 402, a data source node 403, a result acquisition node 404, wherein,
the computing engine 401 is configured to receive task configuration of a ciphertext operation task, where the task configuration includes a ciphertext operation code and an assignment statement of a flag variable, and the flag variable is used to indicate an update parameter of the task configuration;
the computing engine 401 is further configured to load an assignment statement of the flag variable, update a first storage structure according to the assignment of the flag variable, read the assignment of the flag variable from the first storage structure when executing a call interface to the flag variable, update task configuration of the ciphertext operation task based on the assignment of the flag variable, and send the updated task configuration to a task control node; the first storage structure is used for recording relevant information of each mark variable in the task configuration;
the task control node 402 is configured to receive the updated task configuration sent by the compute engine, and send the updated task configuration to a task participant of the ciphertext operation task, so that the task participant executes the ciphertext operation task according to the updated task configuration, where the task participant includes the compute engine 401, a data source node 403, and a result obtaining node 404, which participate in the ciphertext operation task.
And after receiving the updated task configuration sent by the computing engine, the task control node judges whether the updated task configuration meets the updating condition. Judging whether the updated task configuration meets the updating condition, including: and if the version field value of the updated task configuration is larger than the version field value of the task configuration locally stored by the task control node and the updated task configurations sent by all the computing engines participating in executing the ciphertext operation task are the same, determining that the received updated task configuration meets the updating condition. And under the condition that the task control node determines that the updated task configuration meets the updating condition, the task control node issues the updated task configuration to a task participant of the ciphertext operation task so that the task participant executes the ciphertext operation task according to the updated task configuration. The task participants comprise a calculation engine, a data source node and a result acquisition node.
In the embodiment of the invention, the data node needs to continuously monitor the task ending instruction in the task execution process. Since any data node may receive a new result variable as a result obtaining node in the updated task configuration before the task is finished, or a new data is provided as a data source node, the data node needs to take corresponding action to obtain the result from the calculation engine or provide the new data to the calculation engine.
To sum up, the embodiment of the present invention adds the assignment statement of the flag variable in the task configuration, loads the assignment statement of the flag variable before executing the call interface of the flag variable, and updates the first storage structure according to the assignment of the flag variable, where the first storage structure is used to record the relevant information of each flag variable in the task configuration. In this way, when executing the call interface to the flag variable, the assignment of the flag variable is read from the first storage structure, and it can be guaranteed that the read assignment is an updated assignment. The flag variable is used for indicating the update parameters of the task configuration, such as an added data source node, an added result acquisition node, a modified data source node, a modified result acquisition node and an added result variable. In addition, in the process of dynamically updating the task configuration, the embodiment of the invention does not need to add an additional interface, can reduce the learning cost of a user, and can improve the processing efficiency of the computing engine.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
A non-transitory computer readable storage medium in which instructions, when executed by a processor of an apparatus (server or terminal), enable the apparatus to perform the ciphertext operation debugging method shown in fig. 1.
A non-transitory computer readable storage medium in which instructions, when executed by a processor of an apparatus (server or terminal), enable the apparatus to perform a ciphertext operation debugging method, the method comprising: receiving task configuration of a ciphertext operation task, wherein the task configuration comprises a ciphertext operation code and an assignment statement of a mark variable, and the mark variable is used for indicating an update parameter of the task configuration; loading assignment statements of the flag variables, and updating a first storage structure according to assignment of the flag variables, wherein the first storage structure is used for recording relevant information of each flag variable in the task configuration; when a calling interface to the flag variable is executed, the assignment of the flag variable is read from the first storage structure, and the task configuration of the ciphertext operation task is updated based on the assignment of the flag variable; and sending the updated task configuration to a task control node, and issuing the updated task configuration to a task participant of the ciphertext operation task through the task control node so that the task participant executes the ciphertext operation task according to the updated task configuration.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
The ciphertext operation debugging method, the calculation engine and the ciphertext operation system provided by the invention are introduced in detail, a specific example is applied in the text to explain the principle and the implementation mode of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (20)

1. A ciphertext operation debugging method is applied to a calculation engine in a ciphertext operation system, the ciphertext operation system further comprises a task control node, and the method comprises the following steps:
receiving task configuration of a ciphertext operation task, wherein the task configuration comprises a ciphertext operation code and an assignment statement of a mark variable, and the mark variable is used for indicating an update parameter of the task configuration;
loading assignment statements of the flag variables, and updating a first storage structure according to assignment of the flag variables, wherein the first storage structure is used for recording relevant information of each flag variable in the task configuration;
when a calling interface to the flag variable is executed, the assignment of the flag variable is read from the first storage structure, and the task configuration of the ciphertext operation task is updated based on the assignment of the flag variable;
and sending the updated task configuration to a task control node, and issuing the updated task configuration to a task participant of the ciphertext operation task through the task control node so that the task participant executes the ciphertext operation task according to the updated task configuration.
2. The method of claim 1, wherein the update parameters comprise any one or more of an added data source node, an added result capture node, a modified data source node, a modified result capture node, and an added result variable.
3. The method of claim 1, wherein the assignment statement comprises a first assignment statement, and wherein loading the assignment statement for the flag variable and updating the first storage structure based on the assignment for the flag variable comprises:
loading a first assignment statement of the flag variable, and inquiring whether the flag variable exists in a first storage structure;
under the condition that the flag variable does not exist in the first storage structure, adding the flag variable in the first storage structure, recording the assignment of the flag variable as the assignment in the first assignment statement in the first storage structure, and recording the data type of the flag variable as a preset type;
and under the condition that the flag variable exists in the first storage structure, updating the assignment of the flag variable in the first storage structure into the assignment in the first assignment statement.
4. The method of claim 1, wherein the assignment statement comprises a second assignment statement, and wherein loading the assignment statement of the flag variable and updating the first storage structure in accordance with the assignment of the flag variable comprises:
loading a second assignment statement of the flag variable, and inquiring whether the flag variable exists in a first storage structure;
under the condition that the flag variable does not exist in the first storage structure, adding the flag variable in the first storage structure, recording the assignment of the flag variable in the first storage structure as the assignment in the second assignment statement, and recording the data type of the flag variable as a preset type;
and converting the data type of the flag variable in the first storage structure into a target type corresponding to the flag variable under the condition that the flag variable exists in the first storage structure and the data type of the flag variable in the first storage structure is a preset type.
5. The method of claim 4, further comprising:
and outputting error prompt information under the condition that the flag variable exists in the first storage structure and the data type of the flag variable in the first storage structure is not a preset type.
6. The method of claim 1, wherein reading the assignment of the flag variable from the first storage structure comprises:
and reading the assignment of the flag variable from the first storage structure under the condition that the flag variable exists in the first storage structure and the data type of the flag variable in the first storage structure is the target type corresponding to the flag variable.
7. The method of claim 1, wherein after receiving the task configuration for the ciphertext operation task, the method further comprises:
and constructing a first storage structure and a second storage structure, wherein the first storage structure is used for storing the relevant information of each mark variable in the task configuration, and the second storage structure is used for storing the relevant information of the task configuration of the ciphertext operation task.
8. The method according to claim 1, wherein the update parameter includes an added result variable, and wherein a specified result name indicating the added result variable is further included in the task configuration of the ciphertext operation task.
9. The method according to claim 1, wherein the task configuration of the ciphertext operation task further includes a preset function, and the preset function is configured to trigger an operation of loading an assignment statement of the flag variable when it is determined that the task configuration includes both a ciphertext operation code and an assignment statement of the flag variable, so as to update the first storage structure according to the assignment of the flag variable.
10. A computing engine, wherein the computing engine is applied to a cryptograph computing system, the cryptograph computing system further includes a task control node, and the computing engine includes:
the system comprises a configuration receiving module, a task configuration processing module and a task configuration processing module, wherein the configuration receiving module is used for receiving task configuration of a ciphertext operation task, the task configuration comprises a ciphertext operation code and a flag variable assignment statement, and the flag variable is used for indicating an update parameter of the task configuration;
the information updating module is used for loading assignment statements of the flag variables and updating a first storage structure according to assignment of the flag variables, wherein the first storage structure is used for recording relevant information of each flag variable in the task configuration;
the configuration updating module is used for reading the assignment of the flag variable from the first storage structure when executing a calling interface to the flag variable, and updating the task configuration of the ciphertext operation task based on the assignment of the flag variable;
and the configuration sending module is used for sending the updated task configuration to the task control node, and sending the updated task configuration to the task participators of the ciphertext operation task through the task control node so that the task participators execute the ciphertext operation task according to the updated task configuration.
11. The computing engine of claim 10, wherein the update parameters comprise any one or more of an added data source node, an added result capture node, a modified data source node, a modified result capture node, and an added result variable.
12. The compute engine of claim 10, wherein the assignment statement comprises a first assignment statement, and wherein the information update module comprises:
the first loading submodule is used for loading the first assignment statement of the flag variable and inquiring whether the flag variable exists in a first storage structure;
a first adding submodule, configured to add the flag variable in the first storage structure, record, in the first storage structure, that the assignment of the flag variable is the assignment in the first assignment statement, and record that the data type of the flag variable is a preset type, when the flag variable does not exist in the first storage structure;
and the first updating submodule is used for updating the assignment of the flag variable in the first storage structure into the assignment in the first assignment statement under the condition that the flag variable exists in the first storage structure.
13. The compute engine of claim 10, wherein the assignment statement comprises a second assignment statement, and wherein the information update module comprises:
the second loading submodule is used for loading a second assignment statement of the flag variable and inquiring whether the flag variable exists in the first storage structure;
a second adding submodule, configured to add the flag variable in the first storage structure under the condition that the flag variable does not exist in the first storage structure, record, in the first storage structure, an assignment of the flag variable as an assignment in the second assignment statement, and record a data type of the flag variable as a preset type;
and the second updating submodule is used for converting the data type of the flag variable in the first storage structure into a target type corresponding to the flag variable under the condition that the flag variable exists in the first storage structure and the data type of the flag variable in the first storage structure is a preset type.
14. The compute engine of claim 13, further comprising:
and the first prompting module is used for outputting error prompting information under the condition that the flag variable exists in the first storage structure and the data type of the flag variable in the first storage structure is not a preset type.
15. The computing engine of claim 10, wherein the configuration update module is specifically configured to, when the flag variable exists in the first storage structure and a data type of the flag variable in the first storage structure is a target type corresponding to the flag variable, read an assignment of the flag variable from the first storage structure.
16. The compute engine of claim 10, further comprising:
and the storage construction module is used for constructing a first storage structure and a second storage structure, wherein the first storage structure is used for storing the relevant information of each flag variable in the task configuration, and the second storage structure is used for storing the relevant information of the task configuration of the ciphertext operation task.
17. The computing engine of claim 10, wherein the update parameters comprise an added result variable, and wherein the task configuration of the ciphertext operation task further comprises a specified result name indicating the added result variable.
18. The computing engine of claim 10, wherein the task configuration of the ciphertext operation task further comprises a preset function, and the preset function is configured to trigger an operation of loading an assignment statement of the flag variable when it is determined that the task configuration simultaneously includes a ciphertext operation code and an assignment statement of the flag variable, so as to update the first storage structure according to the assignment of the flag variable.
19. A cryptogram operation system, the system comprising: a calculation engine, a task control node, a data source node, and a result acquisition node, wherein,
the computing engine is used for receiving task configuration of a ciphertext operation task, wherein the task configuration comprises a ciphertext operation code and a flag variable assignment statement, and the flag variable is used for indicating an update parameter of the task configuration;
the computing engine is further configured to load an assignment statement of the flag variable, update a first storage structure according to the assignment of the flag variable, read the assignment of the flag variable from the first storage structure when executing a call interface to the flag variable, update task configuration of the ciphertext operation task based on the assignment of the flag variable, and send the updated task configuration to a task control node; the first storage structure is used for recording relevant information of each mark variable in the task configuration;
the task control node is used for receiving the updated task configuration sent by the computing engine and sending the updated task configuration to the task participants of the ciphertext operation task so that the task participants execute the ciphertext operation task according to the updated task configuration, and the task participants comprise the computing engine, a data source node and a result acquisition node which participate in the ciphertext operation task.
20. A machine-readable medium having stored thereon instructions, which when executed by one or more processors, cause an apparatus to perform the ciphertext operation debugging method of any of claims 1 to 9.
CN202110552732.1A 2021-05-20 2021-05-20 Ciphertext operation debugging method, calculation engine and ciphertext operation system Active CN113032283B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110552732.1A CN113032283B (en) 2021-05-20 2021-05-20 Ciphertext operation debugging method, calculation engine and ciphertext operation system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110552732.1A CN113032283B (en) 2021-05-20 2021-05-20 Ciphertext operation debugging method, calculation engine and ciphertext operation system

Publications (2)

Publication Number Publication Date
CN113032283A true CN113032283A (en) 2021-06-25
CN113032283B CN113032283B (en) 2021-08-13

Family

ID=76455617

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110552732.1A Active CN113032283B (en) 2021-05-20 2021-05-20 Ciphertext operation debugging method, calculation engine and ciphertext operation system

Country Status (1)

Country Link
CN (1) CN113032283B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113343285A (en) * 2021-08-04 2021-09-03 华控清交信息科技(北京)有限公司 Method and device for executing ciphertext calculation instruction and ciphertext calculation system
CN113486332A (en) * 2021-07-22 2021-10-08 华控清交信息科技(北京)有限公司 Computing node, privacy computing system and loading method of algorithm engine

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101339519A (en) * 2008-08-13 2009-01-07 哈尔滨工程大学 Soft and hard combined control stream checking method facing to embedded microprocessor
CN101976322A (en) * 2010-11-11 2011-02-16 清华大学 Safety metadata management method based on integrality checking
US20160357529A1 (en) * 2015-06-02 2016-12-08 Fujitsu Limited Parallel computing apparatus and parallel processing method
CN112131135A (en) * 2020-11-19 2020-12-25 华控清交信息科技(北京)有限公司 Ciphertext operation debugging method and system and device for ciphertext operation debugging

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101339519A (en) * 2008-08-13 2009-01-07 哈尔滨工程大学 Soft and hard combined control stream checking method facing to embedded microprocessor
CN101976322A (en) * 2010-11-11 2011-02-16 清华大学 Safety metadata management method based on integrality checking
US20160357529A1 (en) * 2015-06-02 2016-12-08 Fujitsu Limited Parallel computing apparatus and parallel processing method
CN112131135A (en) * 2020-11-19 2020-12-25 华控清交信息科技(北京)有限公司 Ciphertext operation debugging method and system and device for ciphertext operation debugging

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113486332A (en) * 2021-07-22 2021-10-08 华控清交信息科技(北京)有限公司 Computing node, privacy computing system and loading method of algorithm engine
CN113486332B (en) * 2021-07-22 2024-09-10 华控清交信息科技(北京)有限公司 Computing node, privacy computing system and loading method of algorithm engine
CN113343285A (en) * 2021-08-04 2021-09-03 华控清交信息科技(北京)有限公司 Method and device for executing ciphertext calculation instruction and ciphertext calculation system
CN113343285B (en) * 2021-08-04 2021-10-29 华控清交信息科技(北京)有限公司 Method and device for executing ciphertext calculation instruction and ciphertext calculation system

Also Published As

Publication number Publication date
CN113032283B (en) 2021-08-13

Similar Documents

Publication Publication Date Title
US20240204978A1 (en) Interface for digital operator platform including response caching
CN113032283B (en) Ciphertext operation debugging method, calculation engine and ciphertext operation system
CN111258773B (en) Service call flow information processing method and device and electronic equipment
CN112306881B (en) Analog data generation method, device, equipment and storage medium
CN107241315B (en) Access method and device of bank gateway interface and computer readable storage medium
CN111262897B (en) Service call routing processing method, device and system
CN110289983B (en) Load balancing application creation method and device, computer equipment and storage medium
CN110880100A (en) Business approval processing method, device and system
CN111061551A (en) Node merging and scheduling method, device, equipment and storage medium
US20180373542A1 (en) Method and apparatus for declarative action orchestration
CN106600226B (en) Method and device for optimizing process management system
US7533383B2 (en) Method, system, and apparatus for scheduling pattern based web services
CN112306471A (en) Task scheduling method and device
CN111625330B (en) Cross-thread task processing method and device, server and storage medium
CN108345508B (en) Interface call testing method and device
CN110162250B (en) Screenshot method, system and storage medium
CN115242871B (en) Service method and device of business gateway, storage medium and electronic equipment
CN115016909A (en) Task flow concurrent scheduling method and system based on parameter dependence inference execution flow
CN112367205B (en) Processing method and scheduling system for HTTP scheduling request
CN115454878A (en) Interface calling test method applied to micro service and related device
CN113535358A (en) Task processing method and device
CN111949862A (en) Method and device for managing business task flow and electronic equipment
CN111651349B (en) Test method and device
JP2000293375A (en) Object oriented computer system and computer readable storage medium with program stored therein
CN113031960B (en) Code compiling method, device, server and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant