Disclosure of Invention
One or more embodiments of the present disclosure describe a model online method based on secure multi-party computation, which can efficiently perform model iteration.
According to a first aspect, a model online method based on secure multi-party computation is provided, which is applied to a control node, wherein the control node is used for controlling a plurality of computation nodes, each computation node in the plurality of computation nodes is respectively provided with a first local model of a new model and a second local model of an original model, the first local model of each computation node forms a complete new model, and the second local model of each computation node forms a complete original model; the control node maintains a command table and a state recording table, wherein the command table is used for recording model operation commands, and the state recording table is used for recording model states in each computing node; the method comprises the following steps:
when an on-line command of an original model and a new model loading command in the command table are detected, responding to a first heartbeat message of any computing node in the plurality of computing nodes, and sending a first feedback message to the computing node; the first heartbeat message indicates that a second local model in the computing node is in an on-line state, and the first feedback message indicates that the first local model is loaded and the second local model is maintained on-line;
responding to a third heartbeat message of any computing node, updating the state record table to a third state, and sending a third feedback message to the computing node; the third heartbeat message indicates that the first local models in the computing nodes are in a loaded state, the third state indicates that the first local models in the computing nodes are in the loaded state, and the third feedback message indicates that the first local models are online and enables the second local models to enter the loaded state;
responding to a fifth heartbeat message of any computing node, updating the state record table to a fifth state, and sending a fifth feedback message to the computing node; the fifth heartbeat message indicates that the first local model in the computing node is in an online state, the fifth state indicates that the first local model in each computing node is in an online state, and the fifth feedback message indicates that the first local model is online and the second local model is offline.
In one embodiment, the method further comprises: the method further comprises the following steps: before the third feedback message is sent to the computing node, responding to a second heartbeat message of the computing node, updating the state record table to a second state, and sending the second feedback message to the computing node, wherein the second heartbeat message indicates that the first local model of the computing node is in a loaded state or in a loading state; the second state indicates that the first local model in at least one of the plurality of compute nodes is not in a loaded state, and the second feedback packet indicates that the first local model is loaded and maintains the second local model online.
In one embodiment, the method further includes, before the sending of the fifth feedback packet to the computing node, updating the state record table to a fourth state in response to a fourth heartbeat packet of the computing node, and sending the fourth feedback packet to the computing node, where the fourth heartbeat packet indicates that the first local model in the computing node is in an online state or in a loaded state; the fourth state indicates that the first local model in at least one of the plurality of computing nodes is not in an online state, and the fourth feedback packet indicates that the first local model is online and causes the second local model to enter a loaded state.
In one embodiment, both the local model in the online state and the local model in the loaded state may participate in processing the service request.
In an embodiment, the fifth feedback packet only includes a command of the online new model, and does not include information of the original model.
In one embodiment, after sending the fifth feedback packet to the computing node, the method further includes: and deleting the on-line command of the original model in the command table, and modifying the loading command of the new model in the command table into the on-line command of the new model.
In an embodiment, the method further includes, after the sending of the fifth feedback packet to the computing node, receiving a sixth heartbeat packet of each computing node;
and when the sixth heartbeat messages of all the computing nodes do not include the state of the second local model, updating the state record table to a sixth state, wherein the state record table in the sixth state does not include the state of the second local model.
According to a second aspect, a model online method based on secure multi-party computing is provided, and is applied to a first computing node, wherein the first computing node is any one of a plurality of computing nodes controlled by a control node; each of the plurality of compute nodes has a first local model and a second local model, respectively; the first local model of each computing node forms a complete new model, and the second local model of each computing node forms a complete original model; the method comprises the following steps:
sending a first heartbeat message to the control node, wherein the first heartbeat message indicates that a second local model in the first computing node is in an on-line state;
loading the first local model according to an indication of a first feedback message received from the control node and responding to the first heartbeat message, and keeping the second local model on line;
when the first local model of the first computing node is in a loaded state, sending a third heartbeat message to the control node, wherein the third heartbeat message indicates that the first local model in the first computing node is in the loaded state;
according to the indication of the third feedback message received from the control node, the first local model is online, and the second local model is enabled to enter a loaded state; the third feedback message is a message which is sent by the control node in response to the third heartbeat message and is sent when the first local models in the computing nodes are judged to be in the loaded state;
when the first local model of the first computing node is in an on-line state, sending a fifth heartbeat message to the control node, wherein the fifth heartbeat message indicates that the first local model of the first computing node is in the on-line state;
according to a fifth feedback message indication received from the control node, the second local model is offline, and the first local model is maintained online; and the fifth feedback message is a message which is sent by the control node in response to the fifth heartbeat message and is sent when the first local model in each computing node is judged to be in the online state.
According to a third aspect, a model online device based on secure multiparty computation is provided, which is arranged at a control node, wherein the control node is used for controlling a plurality of computation nodes, each computation node in the plurality of computation nodes is respectively provided with a first local model of a new model and a second local model of an original model, the first local model of each computation node forms a complete new model, and the second local model of each computation node forms a complete original model; the control node maintains a command table and a state recording table, wherein the command table is used for recording model operation commands, and the state recording table is used for recording model states in each computing node; the device comprises:
a sending unit, configured to send a first feedback packet to any of the plurality of compute nodes in response to a first heartbeat packet of the compute node when detecting an on-line command of an original model in the command table and a new model loading command; the first heartbeat message indicates that a second local model in the computing node is in an on-line state, and the first feedback message indicates that the first local model is loaded and the second local model is maintained on-line;
the sending unit is further configured to respond to a third heartbeat message of any computing node, update the state record table to a third state, and send a third feedback message to the computing node; the third heartbeat message indicates that the first local models in the computing nodes are in a loaded state, the third state indicates that the first local models in the computing nodes are in the loaded state, and the third feedback message indicates that the first local models are online and enables the second local models to enter the loaded state;
the sending unit is further configured to respond to a fifth heartbeat message of any computing node, update the state record table to a fifth state, and send a fifth feedback message to the computing node; the fifth heartbeat message indicates that the first local model in the computing node is in an online state, the fifth state indicates that the first local model in each computing node is in an online state, and the fifth feedback message indicates that the first local model is online and the second local model is offline.
According to a fourth aspect, a model online device based on secure multi-party computation is provided, which is arranged at a first computing node, wherein the first computing node is any one of a plurality of computing nodes controlled by a control node; each of the plurality of compute nodes has a first local model and a second local model, respectively; the first local model of each computing node forms a complete new model, and the second local model of each computing node forms a complete original model; the device comprises: the system comprises a sending unit, a loading unit, an online unit and an offline unit;
the sending unit is configured to send a first heartbeat message to the control node, wherein the first heartbeat message indicates that a second local model in the first computing node is in an online state;
the loading unit is configured to load the first local model according to an instruction of a first feedback message received from the control node and responding to the first heartbeat message, and maintain the second local model on line;
the sending unit is further configured to send a third heartbeat packet to the control node when the first local model of the first computing node is in the loaded state, where the third heartbeat packet indicates that the first local model in the first computing node is in the loaded state;
the online unit is configured to online the first local model according to an instruction of a third feedback message received from the control node, and make the second model enter a loaded state; the third feedback message is a message which is sent by the control node in response to the third heartbeat message and is sent when the first local models in the computing nodes are judged to be in the loaded state;
the sending unit is further configured to send a fifth heartbeat message to the control node when the first local model of the first computing node is in an online state, where the fifth heartbeat message indicates that the first local model of the first computing node is in an online state;
the offline unit is configured to offline the second local model according to a fifth feedback message indication received from the control node and maintain the first local model online; and the fifth feedback message is a message which is sent by the control node in response to the fifth heartbeat message and is sent when the first local model in each computing node is judged to be in the online state.
According to a fifth aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method of the first aspect or the method of the second aspect.
According to a sixth aspect, there is provided a computing terminal comprising a memory having stored therein executable code and a processor which, when executing the executable code, implements the method of the first aspect or the method of the second aspect.
According to the method and the device provided by the embodiment of the specification, when the local model of the new model in each computing node is in a loaded state, the local model of the new model on each computing node is indicated; and after the local model of the new model in each computing node is on line, the local model of the original model is off line, so that the new model is on line as soon as possible under the condition of not stopping the service of the original model, and the influence of model iteration on the external service time of the MPC system is reduced.
Detailed Description
The scheme provided by the specification is described below with reference to the accompanying drawings.
The MPC-based model is divided into a plurality of local models (model part), and different local models are respectively arranged in the computing nodes of different organizations. Taking the model shown in fig. 1 as an example, the model can be divided into a local model 1, a local model 2, a local model 3, and a local model 4. Wherein, the local model 1 is arranged in a computing node 1, and the computing node 1 belongs to an organization (organization) 1; the local model 2 is arranged in a computing node 2, and the computing node 2 belongs to the mechanism 2; the local model 3 is arranged in a computation node 3, the computation node 3 belongs to the organization 3, the local model 4 is arranged in a computation node 4, and the computation node 4 belongs to the organization 4.
For the MPC-based model, the local models can be provided with online services after being deployed on the respective computing nodes. When any one computing node receives a service request of a user, the local models of the model jointly form a service link to negotiate a result for the user, so that the processing of the service request is completed.
In practical applications, there may be a need for model iteration. This requires that each computing node in each organization is on-line and respectively corresponds to a local model belonging to a new model, so that an effective model service can be provided for the user.
In one scheme, when model iteration is performed, an original model is offline, and then a new model is loaded and online. It is easy to understand that both the offline and the loading of the model take time, so that model iteration performed according to the scheme can cause that each computing node cannot provide service for a user in a period of time.
The embodiment of the specification provides a model online method based on MPC, which can instruct each computing node to load a local model of a new model under the condition that a memory of each computing node retains a local model of an old model when model iteration is carried out; when each computing node successfully loads the local model of the new model, indicating the local model of the new model on each computing node; and when the local models of the new models in each computing node are all successfully online, indicating the local models of the original models of each computing node which are offline. Therefore, under the condition of not stopping the service of the original model, the new model is on-line as soon as possible, and the influence of model iteration on the service available time of the MPC system is reduced.
Next, in various embodiments, the MPC-based on-model online method provided in the embodiments of the present disclosure is illustrated.
Referring to fig. 2, an MPC-based model online method application architecture provided by an embodiment of the present specification includes a control node and a plurality of compute nodes.
The control node, which may also be referred to as Coordinator (Coordinator), may receive an operation command of an administrator (admin), and the operation command may include an online model command and an offline model command to control a model iteration flow.
The plurality of computing nodes may belong to different organizations (institutions), wherein an organization may include one or two or more computing nodes of the plurality of computing nodes. Each computing node is used for loading or online corresponding local models. The local models corresponding to the computing nodes form a complete model, so that the computing nodes can cooperatively provide online service to process service requests.
In this embodiment of the present application, the service request may specifically be a service request received by any computing node. The processing of the service request requires the participation of a local model in the respective compute node.
Each computing node will periodically send heartbeat messages to the control node to report the state of its local model. The control node can feed back corresponding commands to each computing node according to the state of the local model reported by each computing node, so that each computing node executes related operations.
Next, the control node will be described in detail with reference to fig. 2.
The control node, i.e., the coordinator, may include a controller (controller), a commands (commands) table for recording model operation commands, and a status (status) table for recording the status of the local model in each compute node.
The command table is used for recording operation commands input by an administrator, and the operation commands may specifically include an online command (to _ online) and a loaded command (to _ loaded). The specific structure of the command table may be as shown in table 1.
TABLE 1
Where model _ id is the name of the model, for example, in the scenario of model iteration, "old" may be the name of the original model, and "new" is the name of the new model. "type" is a command type, where "TO _ LOADED" is a command TO load a local model or model, and "TO _ ONLINE" is a command TO an ONLINE local model or model.
The state table is used to record the state of the local model in each compute node, and the structure of the state table can be shown in table 2.
TABLE 2
node _ id is the name of the computing node, model _ id is the name of the model, and status is the current state of the local model, wherein the state transition flow of the local model (which may also be referred to as the state of the model) is shown in fig. 3.
Referring to fig. 3, the local model in the initial state, i.e., the offline (off) state, may be converted into the loading state (loading). A load-in-state refers to a model or a local model of a model being loaded.
The model or local model in the loading state may be converted into a loading failed (loaded) state or a loading successful (loaded) state. The load successful state may also be referred to as a loaded state. For any compute node, the local model in the loaded state means that the local model is loaded into the memory of the node and can participate in processing the service request.
The model or local model in the loaded state may be converted to an online success (online) state. The on-line success status may also be referred to as an on-line status. For any computing node, the local model that it is online means that the module is already in the node and can participate in processing the service request.
And the controller (controller) in the control node is used for processing the commands input by the administrator (admin) to the command table and the heartbeat messages reported by each computing node. Each computing node sends a heartbeat message to the control node so as to report the state of each local model in the computing node. The controller of the control node updates a status table according to the heartbeat packet, so that the status table records the latest status of each local model in each computing node. The controller can generate corresponding feedback messages to be fed back to each computing node according to the command table and the state table, so that each computing node executes corresponding operation according to the feedback messages.
The administrator can send model (local model) operation commands (e.g., an online command, an offline command) to the control node, the flow of which is as follows:
a. after receiving the administrator's online command for the new model, the control node inserts a command record of the new model with a command type of "TO _ LOADED" into the command table through the controller. The command may then be sent to each compute node via a heartbeat message. After receiving the 'TO _ LOADED' command about the new model, each computing node starts TO load the local model of the new model and periodically sends the state of the local model of the new model TO the control node. And when the state table shows that the local models of the new models in all the computing nodes are in the loaded state, the control node sends a feedback message containing a 'TO _ ONLINE' command TO each computing node TO indicate the local models of the new models on each computing node. When the state table shows that the local model of the new model in all the computing nodes is in the ONLINE state, the control node considers that the new model is ONLINE successfully, the type of the command of the new model in the command table can be changed from loading (TO _ LOADED) TO ONLINE (TO _ ONLINE), and the command that the type of the original model is ONLINE (TO _ ONLIE) is deleted.
When the controller queries the state table and finds that the local models of the new models in all the computing nodes are on-line, the 'TO _ LOADED' command about the new models in the command table is modified into a 'TO _ ONLINE' command TO indicate that the new models are on-line successfully.
b. After the control node receives an offline command of an administrator, the controller deletes the 'TO _ ONLINE' command related TO the original model in the command table TO download the original model. The control node will then no longer include the name (ID) of the original model in the commands to the compute nodes. For any computing node, when the message received from the control node does not contain the name of the original model, the local model of the original model is automatically offline.
Next, the computing node will be explained in detail.
The computing node mainly comprises an actuator (executor) and a group of local models of models (new and original models).
The actuator collects the current state of each local model of the computing node where the actuator is located, and periodically sends heartbeat to the control node so as to report the state of each local model in the computing node where the actuator is located. The executor also obtains a command (TO _ LOADED or TO _ ONLINE) sent by the control node from a feedback message received by the executor from the control node, and executes corresponding operation according TO the command.
Wherein, for the TO _ LOADED command, the executor attempts TO load the local model corresponding TO the command. For any local model, if it is in load, its state is in load (load); if the loading is successful, the state is LOADED (LOADED); if the loading fails, the status is loading failure (LOAD _ FAILED), and the subsequent flow is terminated.
Wherein, for the TO _ ONLINE command, the executor tries TO go on line the local model corresponding TO the command. If the local model corresponding to the command is found to be not LOADED (LOADED) or ONLINE (ONLINE) when the command is executed, the executor loads the local model corresponding to the command, and tries to ONLINE the local model when the state of the local model becomes LOADED.
It is easily understood that a service request can only be processed by one model, in other words, the service request can only be cooperatively processed by local models belonging to the same model. For any computing node, when the local model of the original model and the local model of the new model of the computing node are in a loaded state and an on-line state respectively, and when the node receives a service request, the executor of the node indicates that the model name of the local model in the on-line state is set in the service request, and accesses the local models in all nodes according to the model name set in the service request. In other nodes, the local model corresponding to the model name in the service request can participate in processing the service request no matter whether the local model is in an on-line state or a loaded state.
For example, the compute nodes of an MPC system are compute node 1 and compute node 2. Setting a certain time period, setting a local model of a new model in the computing node 1 to be in a loaded state and a local model of an original model to be in an on-line state, setting a local model of a new module in the computing node 2 to be in an on-line state and setting a local model of the original model to be in a loaded state. It may be assumed that during this time period, the computing node 1 receives a service request, and the executor of the computing node 1 may set the model name (e.g., old) of the original model into the service request and access the local models of the original model in all computing nodes to process the service request. It may be assumed that during a time period, compute node 2 receives a service request, and the executor of compute node 2 may set the model name (e.g., new) of the new model into the service request and access the local models of the new model in all compute nodes to process the service request.
It should be noted that, in the embodiment of the present specification, the "old" is used as an original model name, the "new" is used as a new model name, the "TO _ ONLINE" is an ONLINE command, and the "TO _ LOADED" is used as an example of a load command, and the model name, the ONLINE command, and the load command are exemplified and are not limited TO the model name, the ONLINE command, and the load command. The administrator can use any appointed characters, phrases, sentences and symbols to represent model names, on-line commands and loading commands.
Next, in an embodiment, an on-line model method of a model iteration scenario provided in this specification is illustrated with an MPC system including one control node and two compute nodes.
In the present embodiment, the two compute nodes are compute node 1 and compute node 2, respectively, where compute node 1 belongs to organization 1 and compute node 2 belongs to organization 2. The model _ id of the original model (i.e., the model name) is old, and the model _ id of the new model is new. The format of the heartbeat message sent by the computing node to the control node is [ "model _ id": state ]. The format of the feedback message sent by the control node to the computing node is [ "operation command": model _ id ]. As mentioned hereinafter, reference may be made to the specific commands represented by the characters representing the operation (on-line, load, etc.) command, and the specific states represented by the characters representing the states (loaded, on-line, loaded, etc.), as well as those described above, unless otherwise specified.
Referring to fig. 4, it can be set that at the first time, the old local model of each computing node is already deployed online and can provide online services. The command (commands) table in the control node at the first time is shown in table 3, and the status (status) table is shown in table 4.
TABLE 3
TABLE 4
Referring to fig. 5, the computing node 1 and the computing node 2 respectively report the states of the respective local models to the control node through a heartbeat message, where the specific content of the heartbeat message is [ "old": ONLINE ], that is, the current state of the local model of the old model is ONLINE. In response TO respective heartbeat messages of the computing nodes 1 and 2, the control node sends feedback messages TO the computing nodes 1 and 2 respectively, wherein the specific content of the feedback messages is { "TO _ ONLINE": old "}, that is, the control node notifies the respective old local model of ONLINE of each computing node, and the computing nodes do not need TO execute ONLINE operation repeatedly because the old local model of each computing node is ONLINE.
At a second time after the first time, the administrator inputs an instruction TO enable the control node TO have a new model with a model _ id of new, and then the control node adds a new command record TO the commands table, wherein the command is TO _ LOADED. At this time, the commands table is shown in table 5.
TABLE 5
Referring TO fig. 5, the controller issues a feedback message TO each computing node, where the content of the feedback message is { "TO _ ONLINE": old "}, {" TO _ LOADED ": new" }, that is, the local model of the ONLINE old on each computing node is indicated, and the local model of the new model is LOADED at the same time. And after each computing node receives the feedback message, executing operation of loading the new model local model. Each computing node periodically controls the node to send a heartbeat message to report the respective state, wherein the content of the heartbeat message is [ { "old": ONLINE "}, {" new ": load" } ], that is, the old local model is in an ONLINE state, and the local model of the new model is in a LOADING state.
And after receiving the heartbeat message from the computing node, the control node updates the status table. The updated status table is shown in table 6.
TABLE 6
At this time, the state of the MPC system may be as shown in fig. 7, where in fig. 7, the old local model of each compute node is in an online state and the new local model is in a loaded state.
At a third time after the second time, the state of the MPC system is as shown in FIG. 9. In fig. 9, the old local model of each compute node is in an online state, the new local model of the compute node 1 is in a loaded state, and the new local model of the compute node 2 is in a loaded state.
That is, at the third time, the compute node 1 completes the local model loading operation of the new model first, that is, the local model of the new model enters the loaded state. And the computation node 2 has not completed the local model loading operation of the new model, i.e. the local model of the new model is in a loading state.
Referring to fig. 8, the computing node 1 may report the state of its new local model and the state of its old local model to the control node through the heartbeat message; wherein, the contents of the heartbeat message are { "old": ONLINE "}, {" new ": load" }, that is, the current state of the new local model is LOADED. In response to the heartbeat message, the control node sends a feedback message to the computing node 1, where the content of the feedback message is [ { "old": ONLINE "}, {" new ": load" } to indicate that the computing node 1 maintains the ONLINE state of the old local model and the LOADED state of the new local model.
The computing node 2 can report the state of the new local model and the state of the old local model to the control node through the heartbeat message; wherein, the contents of the heartbeat message are { "old": ONLINE "}, {" new ": load" }, that is, the current state of the new model local model is in LOADING. In response to the heartbeat message, the control node sends a feedback message to the computing node 2, where the content of the feedback message is [ { "old": ONLINE "}, {" new ": load" } to instruct the computing node 2 to maintain the ONLINE state of the old local model and to make the new local model enter the LOADED state.
After receiving the heartbeat message of the computing node, the controller updates the status table, and when the heartbeat message of the computing node 1 is received first and then the heartbeat message of the computing node 2 is received, the table 7 shows the received heartbeat message of the computing node 2.
TABLE 7
While the commands table does not change.
At a fourth time after the third time, the state of the MPC system is as shown in FIG. 11. In fig. 11, the old local model of each compute node is in an online state, and the new local model is in a loaded state.
Referring to fig. 10, both the compute node 1 and the compute node 2 report the state of their respective local models to the control node through heartbeat messages, where the contents of the heartbeat messages are [ { "old": ONLINE "}, {" new ": load" }.
As shown in fig. 10, when the control node receives only the heartbeat message with the content of [ { "old": ONLINE "}, {" new ": load" } ] from the computing node 1 and does not receive the heartbeat message with the content of [ { "old": ONLINE "}, {" new ": load" } ] from the computing node 2, the control node responds to the heartbeat message of the computing node 1 and continues to send the content of [ { "old": ONLINE "}, {" new ": load" } to the computing node 1.
When the control node receives the contents [ { "old": ONLINE "}, {" new ": load" } from the computing node 2, the control node updates the status table according to the heartbeat message, and the updated status table is shown in table 8.
TABLE 8
When the new local models of the computing nodes in the status table are all in an ONLINE state, after receiving each heartbeat message, the control node responds TO each heartbeat message and sends a feedback message for indicating the ONLINE new local models TO the corresponding computing nodes, wherein the contents of the feedback message are [ { "TO _ ONLINE": new "}, {" TO _ LOADED ": old" }.
At a fifth time after the fourth time, the state of the MPC system is as shown in FIG. 13. In fig. 11, the old local model of the computing node 1 is in an online state, the new local model is in a loaded state, the old local model of the computing node 2 is in a loaded state, and the new local model is in an online state.
Referring TO fig. 12, in response TO a heartbeat message with contents of [ { "old": ONLINE "}, {" new ": load" } ] sent by the computing node 1, the control node sends a feedback message with contents of { "TO _ ONLINE": new "}, {" TO _ LOADED ": old } TO the computing node 1. The control node responds TO the heartbeat message with the content [ { "old": LOADED "}, {" new ": ONLINE" } ] sent by the computing node 2, and sends a feedback message with the content [ { "TO _ ONLINE": new "}, {" TO _ LOADED ": old" } ] TO the computing node 2.
The table 9 shows the status table updated by the control node according to the feedback message [ { "old": load "}, {" new ": ONLINE" } ] sent by the computing node 1.
TABLE 9
At a sixth time after the fifth time, the state of the MPC system is as shown in FIG. 15. In fig. 15, the new local model of each compute node is in an online state, and the old local model is in a loaded state.
At this time, the status table is shown in table 10.
Watch 10
At this time, referring TO table 11, the control node may delete the ONLINE command of the old local model in the commands table and change the command type of the new local model TO _ ONLINE.
TABLE 11
Referring TO fig. 14, after the sixth time, the control node sends a feedback message containing the contents { "TO _ ONLINE": new "} TO each computing node, where the feedback message no longer contains a command related TO the old local model. When the feedback message received by the computing node does not contain the relevant command of the old local model, the computing node automatically goes off the line of the old local model.
At a seventh time after the sixth time, the state of the MPC system is as shown in FIG. 17. In fig. 17, the new local model of each compute node is in an online state, and the old local model is in a loaded state.
Referring to fig. 16, each computing node sends a heartbeat message with the content { "new": ONLINE "} to the control node. The heartbeat message does not contain the information of the old local model, the controller deletes the relevant state of the old local model to update the status table, and the updated status is shown in the table 12.
TABLE 12
The commands table is shown in table 13.
Watch 13
And all the computing nodes finish the online of the new local model, the offline of the old local model and the online service of the new model when the whole MPC system is deployed, so that the model iteration is finished.
In this embodiment, when the local model of the new model in each compute node is in the loaded state, the local model of the new model on each compute node is indicated; and after the local model of the new model in each computing node is on line, the local model of the original model is off line, so that the new model is on line as soon as possible under the condition of not stopping the service of the original model, and the influence of model iteration on the external service time of the MPC system is reduced.
In summary, an embodiment of the present specification provides a model online method based on secure multiparty computation, which is applied to a control node, where the control node is configured to control a plurality of computing nodes, each of the computing nodes has a first local model of a new model and a second local model of an original model, the first local models of the computing nodes form a complete new model, and the second local models of the computing nodes form a complete original model; the control node maintains a command table and a state recording table, wherein the command table is used for recording model operation commands, and the state recording table is used for recording model states in each computing node. Referring to fig. 18, the method includes: 1800, when detecting an on-line command of an original model and a loading command of a new model in the command table, responding to a first heartbeat message of any computing node in the plurality of computing nodes, and sending a first feedback message to the computing node; the first heartbeat message indicates that a second local model in the computing node is in an on-line state, and the first feedback message indicates that the first local model is loaded and the second local model is maintained on-line; step 1802, in response to a third heartbeat packet of any computing node, updating the state record table to a third state, and sending a third feedback packet to the computing node; the third heartbeat message indicates that the first local models in the computing nodes are in a loaded state, the third state indicates that the first local models in the computing nodes are in the loaded state, and the third feedback message indicates that the first local models are online and enables the second local models to enter the loaded state; step 1804, responding to a fifth heartbeat message of any computing node, updating the state record table to a fifth state, and sending a fifth feedback message to the computing node; the fifth heartbeat message indicates that the first local model in the computing node is in an online state, the fifth state indicates that the first local model in each computing node is in an online state, and the fifth feedback message indicates that the first local model is online and the second local model is offline.
In some embodiments, the method further comprises: before the third feedback message is sent to the computing node, responding to a second heartbeat message of the computing node, updating the state record table to a second state, and sending the second feedback message to the computing node, wherein the second heartbeat message indicates that the first local model of the computing node is in a loaded state or in a loading state; the second state indicates that the first local model in at least one of the plurality of compute nodes is not in a loaded state, and the second feedback packet indicates that the first local model is loaded and maintains the second local model online.
In some embodiments, the method further includes, before the sending of the fifth feedback packet to the computing node, in response to a fourth heartbeat packet of the computing node, updating the state record table to a fourth state, and sending the fourth feedback packet to the computing node, where the fourth heartbeat packet indicates that the first local model in the computing node is in an online state or in a loaded state; the fourth state indicates that the first local model in at least one of the plurality of computing nodes is not in an online state, and the fourth feedback packet indicates that the first local model is online and causes the second local model to enter a loaded state.
In some embodiments, both the local model in the online state and the local model in the loaded state may participate in processing the service request.
In some embodiments, the fifth feedback message only includes a command of the online new model, and does not include information of the original model.
In some embodiments, after sending the fifth feedback packet to the computing node, the method further includes: and deleting the on-line command of the original model in the command table, and modifying the loading command of the new model in the command table into the on-line command of the new model.
In some embodiments, the method further includes, after the sending the fifth feedback packet to the computing node, receiving a sixth heartbeat packet of each computing node;
and when the sixth heartbeat messages of all the computing nodes do not include the state of the second local model, updating the state record table to a sixth state, wherein the state record table in the sixth state does not include the state of the second local model.
For the method embodiment shown in fig. 18, reference may be made to the above description of the embodiments shown in fig. 4 to 17, which is not described herein again.
In the embodiment of the present specification, when the local model of the new model in each compute node is in the loaded state, the local model of the new model on each compute node is indicated; and after the local model of the new model in each computing node is on line, the local model of the original model is off line, so that the new model is on line as soon as possible under the condition of not stopping the service of the original model, and the influence of model iteration on the service available time of the MPC system is reduced.
In addition, an embodiment of the present specification further provides a model online method based on secure multiparty computing, which is applied to a first computing node, where the first computing node is any one of a plurality of computing nodes controlled by a control node; each of the plurality of compute nodes has a first local model and a second local model, respectively; the first local model of each computing node forms a complete new model, and the second local model of each computing node forms a complete original model; referring to fig. 19, the method includes: step 1900, sending a first heartbeat message to the control node, wherein the first heartbeat message indicates that a second local model in the first computing node is in an online state; step 1902, loading the first local model according to an instruction of a first feedback message received from the control node and responding to the first heartbeat message, and keeping the second local model online; step 1904, when the first local model of the first computing node is in a loaded state, sending a third heartbeat packet to the control node, where the third heartbeat packet indicates that the first local model in the first computing node is in a loaded state; step 1906, according to the indication of the third feedback packet received from the control node, the first local model is online, and the second local model is brought into a loaded state; the third feedback message is a message which is sent by the control node in response to the third heartbeat message and is sent when the first local models in the computing nodes are judged to be in the loaded state; step 1908, when the first local model of the first computing node is in an online state, sending a fifth heartbeat message to the control node, where the fifth heartbeat message indicates that the first local model of the first computing node is in an online state; step 1910, according to a fifth feedback message indication received from the control node, the second local model is offline, and the first local model is maintained online; and the fifth feedback message is a message which is sent by the control node in response to the fifth heartbeat message and is sent when the first local model in each computing node is judged to be in the online state.
For the method embodiment shown in fig. 18, reference may be specifically made to the descriptions of the embodiments shown in fig. 4 to fig. 17 and the method embodiment described in fig. 18, and details are not described here again.
In the embodiment of the present specification, when the local model of the new model in each compute node is in the loaded state, the local model of the new model on each compute node is indicated; and after the local model of the new model in each computing node is on line, the local model of the original model is off line, so that the new model is on line as soon as possible under the condition of not stopping the service of the original model, and the influence of model iteration on the external service time of the MPC system is reduced.
The embodiment of the present specification provides a model online device 20 based on secure multiparty computation, which is disposed at a control node, where the control node is configured to control a plurality of computing nodes, each computing node in the plurality of computing nodes is respectively provided with a first local model of a new model and a second local model of an original model, the first local model of each computing node forms a complete new model, and the second local model of each computing node forms a complete original model; the control node maintains a command table and a state recording table, wherein the command table is used for recording model operation commands, and the state recording table is used for recording model states in each computing node; referring to fig. 20, the apparatus 20 includes:
a sending unit 2010 configured to send a first feedback packet to any of the plurality of compute nodes in response to a first heartbeat packet of the compute node when detecting an on-line command of an original model in the command table and a new model loading command; the first heartbeat message indicates that a second local model in the computing node is in an on-line state, and the first feedback message indicates that the first local model is loaded and the second local model is maintained on-line;
the sending unit 2010 is further configured to, in response to a third heartbeat packet of any computing node, update the state record table to a third state, and send a third feedback packet to the computing node; the third heartbeat message indicates that the first local models in the computing nodes are in a loaded state, the third state indicates that the first local models in the computing nodes are in the loaded state, and the third feedback message indicates that the first local models are online and enables the second local models to enter the loaded state;
the sending unit 2010 is further configured to, in response to a fifth heartbeat packet of any computing node, update the state record table to a fifth state, and send a fifth feedback packet to the computing node; the fifth heartbeat message indicates that the first local model in the computing node is in an online state, the fifth state indicates that the first local model in each computing node is in an online state, and the fifth feedback message indicates that the first local model is online and the second local model is offline.
In some embodiments, the sending unit 2010 is further configured to, before the sending of the third feedback packet to the computing node, update the state record table to the second state in response to a second heartbeat packet of the computing node, and send the second feedback packet to the computing node, where the second heartbeat packet indicates that the first local model of the computing node is in a loaded state or in a loading state; the second state indicates that the first local model in at least one of the plurality of compute nodes is not in a loaded state, and the second feedback packet indicates that the first local model is loaded and maintains the second local model online.
In some embodiments, the sending unit 2010 is further configured to, before the sending of the fifth feedback packet to the computing node, respond to a fourth heartbeat packet of the computing node, update the state record table to a fourth state, and send the fourth feedback packet to the computing node, where the fourth heartbeat packet indicates that the first local model in the computing node is in an online state or in a loaded state; the fourth state indicates that the first local model in at least one of the plurality of computing nodes is not in an online state, and the fourth feedback packet indicates that the first local model is online and causes the second local model to enter a loaded state.
In some embodiments, both the model in the online state and the local model in the loaded state may participate in processing service requests.
In some embodiments, the fifth feedback message only includes a command of the online new model, and does not include information of the original model.
In some embodiments, the apparatus 20 further includes a deleting unit 2020 configured to delete the original model online command in the command table and modify the new model loading command in the command table into the new model online command after sending the fifth feedback packet to the first computing node.
In some embodiments, the apparatus further includes a receiving unit 2030 configured to receive a sixth heartbeat packet of each computing node after the sending the fifth feedback packet to the computing node;
the sending unit 2010 is further configured to, when none of the sixth heartbeat messages of the respective computing nodes includes the state of the second local model, update the state record table to a sixth state, where the state record table in the sixth state does not include the state of the second local model.
The functional units of the apparatus 20 can be implemented with reference to the method embodiment shown in fig. 18, and are not described herein again.
In the embodiment of the present specification, when the local model of the new model in each compute node is in the loaded state, the local model of the new model on each compute node is indicated; and after the local model of the new model in each computing node is on line, the local model of the original model is off line, so that the new model is on line as soon as possible under the condition of not stopping the service of the original model, and the influence of model iteration on the external service time of the MPC system is reduced.
The embodiment of the specification provides a model online device 21 based on secure multiparty computation, which is arranged at a first computing node, wherein the first computing node is any one of a plurality of computing nodes controlled by a control node; each of the plurality of compute nodes has a first local model and a second local model, respectively; the first local model of each computing node forms a complete new model, and the second local model of each computing node forms a complete original model; the device 21 comprises: a sending unit 2110, a loading unit 2120, an online unit 2130 and an offline unit 2140;
the sending unit 2110 is configured to send a first heartbeat message to the control node, wherein the first heartbeat message indicates that a second local model in the first computing node is in an online state;
the loading unit 2120 is configured to load the first local model according to an instruction of a first feedback packet received from the control node in response to the first heartbeat packet, and maintain the second local model online;
the sending unit 2110 is further configured to send, to the control node, a third heartbeat packet when the first local model of the first computing node is in a loaded state, where the third heartbeat packet indicates that the first local model in the first computing node is in the loaded state;
the online unit 2130 is configured to, according to an instruction of the third feedback packet received from the control node, online the first local model, and make the second model enter a loaded state; the third feedback message is a message which is sent by the control node in response to the third heartbeat message and is sent when the first local models in the computing nodes are judged to be in the loaded state;
the sending unit 2110 is further configured to send a fifth heartbeat packet to the control node when the first local model of the first computing node is in an online state, where the fifth heartbeat packet indicates that the first local model of the first computing node is in an online state;
the offline unit 2140 is configured to, according to the fifth feedback packet indication received from the control node, offline the second local model and maintain the first local model online; and the fifth feedback message is a message which is sent by the control node in response to the fifth heartbeat message and is sent when the first local model in each computing node is judged to be in the online state.
In the embodiment of the present specification, when the local model of the new model in each compute node is in the loaded state, the local model of the new model on each compute node is indicated; and after the local model of the new model in each computing node is on line, the local model of the original model is off line, so that the new model is on line as soon as possible under the condition of not stopping the service of the original model, and the influence of model iteration on the external service time of the MPC system is reduced.
In another aspect, embodiments of the present specification provide a computer-readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method shown in fig. 18 or fig. 19.
In another aspect, embodiments of the present description provide a computing terminal including a memory and a processor, where the memory stores executable code, and the processor executes the executable code to implement the method shown in fig. 18 or fig. 19.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
It will be further appreciated by those of ordinary skill in the art that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether these functions are performed in hardware or software depends on the particular application of the solution and design constraints. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied in hardware, a software module executed by a processor, or a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.