Model deployment method, device, storage medium and electronic device
By selecting the appropriate deployment cluster when deploying machine learning models based on preset deployment instructions, the problem of insufficient memory on a single node is solved, and efficient model deployment and computing performance improvements are achieved.
Patent Information
- Application Number
- CN201910750173.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-14
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2039-08-14
AI Technical Summary
During the machine learning model deployment process, the memory capacity of a single node is limited, resulting in more model deployment and excessive resource utilization, affecting the service performance of business nodes.
By determining the preset deployment instructions of the target model, flexibly deploying local deployment clusters or remote deployment clusters. The remote deployment method can decouple model calculations from services and realize highly parallel computing; for models with smaller model files, you can Business-party nodes are deployed locally to reduce network consumption.
Improves computing performance, reduces memory and CPU resource usage, and improves real-time computing performance.
Smart Images

Figure CN112395072B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of model deployment, and in particular, to a method, device, storage medium and electronic device for model deployment. Background Art
[0002] With the continuous development of machine learning technology, machine learning models (such as decision tree models, deep neural network models, etc.) are widely used in various business scenarios, such as food delivery business scenarios. The machine learning process is divided into offline training and online prediction stages. Before online prediction, the offline trained machine learning model needs to be deployed to the memory of each node of the server that executes the model calculation, and then the features are passed in for model calculation and real-time prediction.
[0003] In related technologies, when deploying a model, the model will be deployed to the memory of all machine nodes of the business party, and then the model calculation will be executed locally on each node of the business party. If a service depends on a large number of models and the total amount is large, all models need to be deployed on each business party node corresponding to the service. However, due to the limited memory capacity of a single node, if a large number of models are deployed, more memory and CPU resources of the business party nodes will be occupied, affecting the service performance of the business party nodes. Summary of the invention
[0004] The purpose of the present disclosure is to provide a method, device, storage medium and electronic device for model deployment.
[0005] In a first aspect, a method for model deployment is provided, the method comprising: determining a target model to be deployed; obtaining preset deployment indication information corresponding to the target model; the preset deployment indication information is used to indicate a target deployment cluster to deploy the target model; the target deployment cluster comprises one of a remote deployment cluster and a local deployment cluster; and deploying the target model to the target deployment cluster indicated by the preset deployment indication information.
[0006] Optionally, the method of determining the target model to be deployed includes one of the following two methods: determining a model currently added in a preset file directory as the target model; and determining a model selected by a user as the target model.
[0007] Optionally, the preset deployment indication information includes business identification information corresponding to the target model; accordingly, deploying the target model to the target deployment cluster indicated by the preset deployment indication information includes: determining the model deployment cluster corresponding to the business identification information as the target deployment cluster; and deploying the target model to the target deployment cluster.
[0008] Optionally, under the condition that the target deployment cluster is the remote deployment cluster, before deploying the target model to the target deployment cluster indicated by the preset deployment indication information, the method also includes: determining whether there are two or more partition models of the target model; the partition model includes a model obtained by dividing the target model according to a preset dimension; accordingly, deploying the target model to the target deployment cluster indicated by the preset deployment indication information includes: when there are two or more partition models of the target model, deploying the partition models to corresponding network nodes in the target deployment cluster respectively, wherein different partition models are deployed on different network nodes.
[0009] Optionally, deploying the target model to the target deployment cluster indicated by the preset deployment indication information includes: deploying the target model on each network node in the target deployment cluster when it is determined that the partition model does not exist in the target model.
[0010] Optionally, deploying the target model to the target deployment cluster indicated by the preset deployment indication information includes: receiving a model deployment request message sent by a target node in the set of nodes to be deployed, the model deployment request message being used to request deployment of the target model, the set of nodes to be deployed being a set consisting of two or more network nodes in the target deployment cluster; acquiring the target model in response to receiving the model deployment request message; controlling each of the target nodes in the set of nodes to be deployed to install the target model; and when it is determined that each of the target nodes has successfully installed the target model, controlling each of the target nodes to use the target model as the current application model.
[0011] Optionally, controlling each of the target nodes to install the target model includes: sending the target model to each of the target nodes; and when it is determined that each of the target nodes has successfully received the target model, sending a model loading instruction to each of the target nodes so that each of the target nodes loads the target model.
[0012] Optionally, after deploying the partition models to corresponding network nodes in the target deployment cluster respectively, the method further includes: recording a deployment correspondence between each partition model and the network node on which each partition model is deployed.
[0013] Optionally, after deploying the target model to the target deployment cluster indicated by the preset deployment indication information, the method also includes: receiving a service request message sent by a service requester, the service request message being used to request service data of a target service; in response to receiving the service request message, determining the target deployment cluster according to service identification information of the target service; if it is determined that the partition model exists in the target model deployed in the target deployment cluster, determining the target partition model corresponding to the target service in the partition model; determining the target network node corresponding to the target partition model according to the deployment correspondence; and obtaining the service data from the target partition model of the target network node.
[0014] In a second aspect, a device for module deployment is provided, the device comprising: a determination module for determining a target model to be deployed; an acquisition module for acquiring preset deployment indication information corresponding to the target model; the preset deployment indication information is used to indicate a target deployment cluster in which the target model is to be deployed; the target deployment cluster comprises one of a remote deployment cluster and a local deployment cluster; and a model deployment module for deploying the target model to the target deployment cluster indicated by the preset deployment indication information.
[0015] In a third aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of the method described in the first aspect of the present disclosure are implemented.
[0016] In a fourth aspect, an electronic device is provided, comprising: a memory on which a computer program is stored; and a processor for executing the computer program in the memory to implement the steps of the method described in the first aspect of the present disclosure.
[0017] Through the above technical solution, the target model to be deployed is determined, and the preset deployment indication information corresponding to the target model is obtained; the preset deployment indication information is used to indicate the target deployment cluster to deploy the target model; the target deployment cluster includes one of a remote deployment cluster and a local deployment cluster, and the target model is deployed to the target deployment cluster indicated by the preset deployment indication information. In this way, the model can be flexibly deployed in a local deployment cluster or a remote deployment cluster according to the preset deployment indication information corresponding to the model. This remote deployment model deployment method can decouple model calculation from business, thereby achieving highly parallel calculation and improving computing performance; for models with smaller model files, they can be retained in the business party node for local deployment. This local deployment method has no network consumption and high real-time computing performance.
[0018] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings:
[0020] Figure 1 is a flowchart of a first model deployment method according to an exemplary embodiment;
[0021] Figure 2 is a flowchart of a second model deployment method according to an exemplary embodiment;
[0022] Figure 3 is a flowchart of a third model deployment method according to an exemplary embodiment;
[0023] Figure 4 is a block diagram of a device for model deployment according to an exemplary embodiment;
[0024] Figure 5 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0025] The specific implementation of the present disclosure is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the present disclosure, and is not used to limit the present disclosure.
[0026] The present disclosure is mainly applied to the scenario of model deployment in a distributed environment. In a distributed file system (Hadoop Distributed File System, HDFS), a service usually needs to rely on multiple models (such as deep neural network models, decision tree models, etc.) to be implemented. In order to perform model calculations, the latest version of each model needs to be deployed to the memory of all machines in the cluster that execute model calculations, and then real-time predictions are performed later. In related technologies, multiple models that a service depends on will be deployed to the memory of all machine nodes of the business party at the same time, and then the model calculations will be performed locally on each node of the business party. However, if a service depends on a large number of models and the total amount is large, all models also need to be deployed on each business party node corresponding to the service. However, due to the limited memory capacity of a single node, if many models are deployed, more memory and CPU resources of the business party nodes will be occupied, affecting the service performance of the business party nodes.
[0027] To solve the above-mentioned problems, the present disclosure provides a method, device, storage medium and electronic device for model deployment. When it is determined that there is a target model to be deployed (such as a model currently added in a preset file directory, or a model selected by a user), the target deployment cluster for deploying the target model can be determined according to the preset deployment indication information set when registering the target model (the preset deployment indication information is used to indicate the target deployment cluster to be deployed with the target model). In the present disclosure, the target deployment cluster may include one of a remote deployment cluster and a local deployment cluster. The specific deployment method can be customized by the user when registering the target model. In this way, for complex models or target models with partitioned models, the user can set them to be deployed in a remote deployment cluster. This remote model deployment method can decouple model calculation from business, thereby achieving highly parallel calculation and improving computing performance. In addition, for models with smaller model files, they can be retained in the business party node for local deployment. This local deployment method has no network consumption and high real-time computing performance.
[0028] Figure 1 is a flowchart of a method for model deployment according to an exemplary embodiment. Figure 1 As shown, the method comprises the following steps:
[0029] In step 101, a target model to be deployed is determined.
[0030] Among them, the target model may include machine learning models such as decision tree models and neural network models.
[0031] In the present disclosure, the target model to be deployed can be determined in any of the following two ways:
[0032] Method 1: It can be determined whether there is a newly added model in the preset file directory. When it is determined that there is a newly added model in the preset file directory, the newly added model in the preset file directory can be determined as the target model.
[0033] Among them, the preset file directory is a file directory pre-set by the user in the distributed file system, and the newly added model can be understood as the latest version of the model generated by retraining.
[0034] In a distributed file system, before obtaining the latest version of a model through offline training, it is usually necessary to register the model on the model management server, for example, to define registration information such as the model name, model type, model version information, and the storage path of the model under the preset file directory of the HDFS. In this way, after training and generating the latest version of the model, the model obtained by the latest training can be marked according to the above registration information, and the model can be uploaded to the corresponding storage path for storage. Therefore, in method one, the preset file directory under HDFS can be scanned periodically to determine whether there is a new model. When it is determined that the new model exists, it can be determined that there is the target model to be deployed.
[0035] Method 2: Determine whether there is a model selected by the user. When it is determined that there is a model selected by the user, the model selected by the user can be determined as the target model.
[0036] In method 2, considering that in actual application scenarios, corresponding to different business needs, the user can also select any version of the model from multiple versions of the same model that have been generated as the target model for deployment. For example, the user can downgrade the model version to restore the current application model of the target node to a previous version. Therefore, in method 2, if the model selected by the user is obtained, it can be determined that the model selected by the user is the target model.
[0037] In step 102, preset deployment indication information corresponding to the target model is obtained, where the preset deployment indication information is used to indicate a target deployment cluster where the target model is to be deployed, where the target deployment cluster includes one of a remote deployment cluster and a local deployment cluster.
[0038] The remote deployment cluster may include multiple deployment clusters, the local deployment cluster may also include multiple deployment clusters, and each deployment cluster includes multiple model deployment nodes.
[0039] As mentioned above, in a distributed file system, before obtaining the latest version of the model through offline training, it is usually necessary to register the model on the model management server. It should be noted that in the model registration stage in the present disclosure, in addition to defining registration information such as the model name, model type, model version information, and the storage path of the model in the preset file directory of the HDFS, the user can also define the preset deployment indication information corresponding to the target model. The preset deployment indication information may include the business identification information corresponding to the target model. For example, if the service corresponding to the target model is a delivery estimated delivery time prediction service (that is, the target model is used to predict the delivery estimated delivery time), the business identification information corresponding to the target model can be set to ETA. If the service corresponding to the target model is a delivery scheduling engine service, the business identification information corresponding to the target model can be set to DES. This is just an example and the present disclosure is not limited to this.
[0040] In addition, the preset deployment indication information may also include a preset deployment method of the target model, which may include a local deployment method or a remote deployment method. In this way, the model management server can deploy the target model in a local deployment cluster or a remote deployment cluster according to the preset deployment method corresponding to the target model.
[0041] In step 103, the target model is deployed to the target deployment cluster indicated by the preset deployment instruction information.
[0042] In a possible implementation, the model deployment cluster corresponding to the business identification information may be determined as the target deployment cluster, and the target model may be deployed to the target deployment cluster.
[0043] For example, assuming that the business identification information corresponding to the target model is ETA, it can be determined that the service corresponding to the business identification information ETA is the delivery estimated delivery time prediction service, and the target deployment cluster corresponding to the business identification information ETA can be determined according to the pre-set correspondence (that is, the correspondence between the business identification information and the corresponding target deployment cluster) as the remote cluster 3 among the multiple deployment clusters included in the remote deployment cluster. In this way, the target model for predicting the delivery estimated delivery time can be deployed to the remote cluster 3. This is only an example and the present disclosure is not limited to this.
[0044] By adopting the above method, the model can be flexibly deployed in a local deployment cluster or a remote deployment cluster according to the preset deployment instruction information corresponding to the model. This remote deployment model deployment method can decouple model calculation from business, thereby achieving highly parallel calculation and improving computing performance. For models with smaller model files, they can be retained in the business party node for local deployment. This local deployment method has no network consumption and high real-time computing performance.
[0045] Figure 2 is a flowchart of a method for model deployment according to an exemplary embodiment. Figure 2 As shown, the method comprises the following steps:
[0046] In step 201, a target model to be deployed is determined.
[0047] Among them, the target model may include machine learning models such as decision tree models and neural network models.
[0048] In the present disclosure, the target model to be deployed can be determined in any of the following two ways:
[0049] Method 1: It can be determined whether there is a newly added model in the preset file directory. When it is determined that there is a newly added model in the preset file directory, the newly added model in the preset file directory can be determined as the target model.
[0050] Among them, the preset file directory is a file directory pre-set by the user in the distributed file system, and the newly added model can be understood as the latest version of the model generated by retraining.
[0051] In a distributed file system, before obtaining the latest version of a model through offline training, it is usually necessary to register the model on the model management server, for example, to define registration information such as the model name, model type, model version information, and the storage path of the model under the preset file directory of the HDFS. In this way, after training and generating the latest version of the model, the model obtained by the latest training can be marked according to the above registration information, and the model can be uploaded to the corresponding storage path for storage. Therefore, in method one, the preset file directory under HDFS can be scanned periodically to determine whether there is a new model. When it is determined that the new model exists, it can be determined that there is the target model to be deployed.
[0052] Method 2: Determine whether there is a model selected by the user. When it is determined that there is a model selected by the user, the model selected by the user can be determined as the target model.
[0053] In method 2, considering that in actual application scenarios, corresponding to different business needs, the user can also select any version of the model from multiple versions of the same model that have been generated as the target model for deployment. For example, the user can downgrade the model version to restore the current application model of the target node to a previous version. Therefore, in method 2, if the model selected by the user is obtained, it can be determined that the model selected by the user is the target model.
[0054] In step 202, preset deployment instruction information corresponding to the target model is obtained.
[0055] Among them, the preset deployment indication information is used to indicate the target deployment cluster where the target model is to be deployed; the target deployment cluster includes one of a remote deployment cluster and a local deployment cluster, and the remote deployment cluster may include multiple deployment clusters, the local deployment cluster may also include multiple deployment clusters, and each deployment cluster includes multiple model deployment nodes.
[0056] As mentioned above, in a distributed file system, before obtaining the latest version of the model through offline training, it is usually necessary to register the model on the model management server. It should be noted that in the model registration stage in the present disclosure, in addition to defining registration information such as the model name, model type, model version information, and the storage path of the model in the preset file directory of the HDFS, the user can also define the preset deployment indication information corresponding to the target model. The preset deployment indication information may include the business identification information corresponding to the target model. For example, if the service corresponding to the target model is a delivery estimated delivery time prediction service (that is, the target model is used to predict the delivery estimated delivery time), the business identification information corresponding to the target model can be set to ETA. If the service corresponding to the target model is a delivery scheduling engine service, the business identification information corresponding to the target model can be set to DES. This is just an example and the present disclosure is not limited to this.
[0057] In addition, the preset deployment instruction information may also include a preset deployment method of the target model, which may include a local deployment method or a remote deployment method. For example, the user may input the preset deployment method during the model registration phase, or may select the preset deployment method in a pop-up option list. In this way, the model management server may deploy the target model in a local deployment cluster or a remote deployment cluster according to the preset deployment method corresponding to the target model.
[0058] In step 203, the model deployment cluster corresponding to the business identification information is determined as the target deployment cluster.
[0059] In a possible implementation, the correspondence between the business identification information and the corresponding target deployment cluster may be predefined, so that the model deployment cluster corresponding to the business identification information may be determined as the target deployment cluster based on the correspondence.
[0060] For example, if the service corresponding to the target model is a delivery estimated delivery time prediction service (i.e., the target model is used to predict the delivery estimated delivery time), the business identification information corresponding to the target model can be set to ETA, and in the corresponding relationship, the target deployment cluster corresponding to the business identification information ETA is remote cluster 3. The above example is only for illustrative purposes and the present disclosure does not limit this.
[0061] In another possible implementation, the target deployment cluster corresponding to the target model can be determined based on the business identification information and a pre-defined preset deployment method corresponding to the target model. Specifically, it can be first determined whether the target deployment cluster is the local deployment cluster or the remote deployment cluster based on the preset deployment method. Since both the local deployment cluster and the remote deployment cluster include multiple deployment clusters, the deployment cluster corresponding to the business identification information can then be determined as the target deployment cluster among the multiple deployment clusters in the remote deployment cluster (or in the local deployment cluster).
[0062] For example, assuming that the local deployment cluster includes three deployment clusters, namely, local cluster 1, local cluster 2, and local cluster 3, and the remote deployment cluster includes four deployment clusters, namely, remote cluster 1, remote cluster 2, remote cluster 3, and remote cluster 4. If the target deployment cluster is determined to be a remote deployment cluster according to the preset deployment method of the target model, then, among the four remote deployment clusters, namely, remote cluster 1, remote cluster 2, remote cluster 3, and remote cluster 4, the remote cluster 3 corresponding to the business identification information ETA of the target model can be determined as the target deployment cluster. The above example is for illustrative purposes only and the present disclosure does not limit this.
[0063] In step 204, under the condition that the target deployment cluster is the remote deployment cluster, it is determined whether the target model has two or more partition models.
[0064] Among them, the partition model includes a model obtained by dividing the target model according to preset dimensions, and the preset dimensions may include city dimensions, distribution area dimensions, merchant dimensions, etc. For example, if the target model is an average delivery time prediction model, considering that the delivery service data generated by different cities (such as order volume, number of riders, average delivery time, etc.) will also be different, if the average delivery time of all cities is predicted using the same prediction model, it will inevitably affect the accuracy of the prediction. Therefore, in order to improve the accuracy of model prediction, an average delivery time prediction model can be trained according to the delivery service data of different cities (the model parameters of the average delivery time prediction model corresponding to different cities are different). The average delivery time prediction model corresponding to each city is the partition model of the target model divided according to the city dimension. This is only an example and the present disclosure is not limited to this.
[0065] Usually, the partition model occupies a large amount of system memory. Therefore, in order to improve the computational efficiency of the model, the target model with the partition model is usually deployed to a remote deployment cluster.
[0066] In this step, it can be determined whether the target model has two or more partition models based on the model identification information of the target model. For example, if the model identification information of the target model includes a pre-set partition model verification identifier (in the form of letters, numbers or other symbols and their combinations), it can be determined that the target model has two or more partition models. Otherwise, the partition model does not exist. This is only an example and the present disclosure is not limited to this.
[0067] If it is determined that the target model has two or more partition models, execute steps 205 and 206 ; if it is determined that the target model does not have the partition model, execute step 207 .
[0068] In step 205, the partition model is deployed to corresponding network nodes in the target deployment cluster respectively.
[0069] Different partition models are deployed on different network nodes.
[0070] For example, assuming that the target model includes three partition models, partition model 1, partition model 2, and partition model 3. After executing step 203, it is determined that the target deployment cluster corresponding to the target model is remote cluster 3, and the remote cluster 3 includes multiple model deployment nodes. Before the partition model is deployed to the remote cluster 3, it is necessary to determine the network nodes corresponding to each partition model according to the preset model deployment allocation strategy. For example, a possible model allocation strategy is to deploy partition model 1 to model deployment nodes 1 to model deployment nodes 10 in the remote cluster 3, and to deploy partition model 2 to remote cluster 3. The model deployment nodes 11 to the model deployment nodes 20 in cluster 3, and the partition model 3 are deployed to the model deployment nodes 21 to the model deployment nodes 30 in the remote cluster 3. In this way, it can be determined that the network nodes of the partition model 1 to be deployed are the model deployment nodes 1 to the model deployment nodes 10 in the remote cluster 3, the network nodes of the partition model 2 to be deployed are the model deployment nodes 11 to the model deployment nodes 20 in the remote cluster 3, and the network nodes of the partition model 3 to be deployed are the model deployment nodes 21 to the model deployment nodes 30 in the remote cluster 3. This is only an example and the present disclosure is not limited to this.
[0071] In step 206, each partition model and the deployment correspondence between each partition model and the network node where the partition model is deployed are recorded.
[0072] In step 207, the target model is deployed on each network node in the target deployment cluster.
[0073] The prerequisite for executing this step is to determine that the partition model does not exist for the target model. At this time, the target model can be deployed on each model deployment node in the target deployment cluster. That is to say, in this step, each model deployment node in the target deployment cluster is the network node.
[0074] The present disclosure can deploy the target model to the target deployment cluster indicated by the preset deployment indication information by executing the above steps, and then receive a service request message sent by a service requester, wherein the service request message is used to request service data of the target service; in response to receiving the service request message, determine the target deployment cluster according to the service identification information of the target service; if it is determined that the partition model exists in the target model deployed in the target deployment cluster, determine the target partition model corresponding to the target service in the partition model; determine the target network node corresponding to the target partition model according to the deployment correspondence; in this way, the service data can be obtained from the target partition model of the target network node.
[0075] For example, assuming that the target business is to predict the average delivery time corresponding to city 1 (that is, the business data), the business request message is a request to obtain the predicted value of the average delivery time for city 1. After receiving the business request message, the business identification information of the target business can be obtained. At this time, according to the correspondence between the pre-stored business identification information and the target deployment cluster, it can be determined that the target deployment cluster for deploying the target model (in this example, the target model is the model that can predict the average delivery time of the corresponding city) is remote cluster 2. If it is determined that the partition model exists in the target model deployed in the target deployment cluster, at this time, the target partition corresponding to the target service can be determined according to the business identification information of the target business. The model is a model for predicting the average delivery time corresponding to city 1. Then, the target network node corresponding to the target partition model can be determined according to the deployment correspondence recorded when the target model is deployed (the correspondence between each partition model and the network node where each partition model is deployed). The target network node can be any network node in the set of nodes to be deployed for deploying the target partition model. In this way, the delivery service data corresponding to city 1 can be sent to the target network node where the target partition model is deployed, so that the predicted value of the average delivery time of city 1 can be calculated at the target network node through the target partition model based on the delivery service data corresponding to city 1. The above example is only for illustrative purposes and the present disclosure is not limited to this.
[0076] Using the above method, the target deployment cluster can include one of a remote deployment cluster and a local deployment cluster. The specific deployment method can be customized by the user when registering the target model. In this way, for target models with complex models or partitioned models, users can set them to be deployed in a remote deployment cluster. This remote model deployment method can decouple model calculation from business, thereby achieving highly parallel calculations and improving computing performance. In addition, for models with smaller model files, they can be retained in the business party node for local deployment. This local deployment method has no network consumption and high real-time computing performance.
[0077] By executing the above steps, the target deployment cluster for deploying the target model and the network node in the target deployment cluster for specifically deploying the target model can be determined. Figure 3 The specific model deployment process is introduced in detail.
[0078] Figure 3 is a flowchart of a method for model deployment according to an exemplary embodiment. Figure 3 As shown, the method comprises the following steps:
[0079] In step 301, a model deployment request message sent by a target node in a set of nodes to be deployed is received.
[0080] Among them, the model deployment request message is used to request the deployment of the target model, and the set of nodes to be deployed is a set consisting of two or more network nodes in the target deployment cluster. For example, if the target model includes two or more partition models, the set of nodes to be deployed is a set consisting of model deployment nodes corresponding to each partition model (as described in the example in step 205); if the target model does not include the partition model, the set of nodes to be deployed is a set consisting of all model deployment nodes in the target deployment cluster, and the target node is any model deployment node in the set of nodes to be deployed.
[0081] Model deployment includes model downloading, model loading and model switching (or model use). In this step, the model deployment request message may include model download request information. Further, the model download request information may include model identification information of the target model requested to be downloaded.
[0082] In step 302, in response to receiving the model deployment request message, the target model is obtained.
[0083] In one possible implementation, after receiving the model deployment request message, the model management server can obtain the model identification information of the target model to be deployed. In this step, in order to obtain the target model more quickly, the target model can be first searched in the local storage space of the model management server based on the obtained model identification information of the target model. If the target model is not found in the local storage space, the model deployment request message can be forwarded to the remote server so as to download the target model from the remote server. After the download is completed, the target model is stored in the local storage space so that other target nodes can directly obtain the target model from the local storage space, so as to improve the model acquisition rate and thereby improve the efficiency of model deployment.
[0084] In step 303, each target node in the set of nodes to be deployed is controlled to install the target model.
[0085] In this step, the target model may be sent to each target node; after it is determined that each target node has successfully received the target model, a model loading instruction is sent to each target node so that each target node loads the target model.
[0086] In step 304, after it is determined that each target node has successfully installed the target model, each target node is controlled to use the target model as the current application model.
[0087] In the control process of the model deployment disclosed in the present invention, the heartbeat reporting method can be used to control each link of the deployment of the target model, that is, the target node sends a processing notification message of the target processing matter to the model management server (the processing notification message includes a processing success message or a processing failure message, for example, 1 can be used to indicate a processing success, and 0 can be used to indicate a processing failure). The target processing matter may include receiving the target model or loading the target model. Therefore, in step 303, if a reception success message (that is, a download success message) sent by each target node is received, it is determined that each target node in the set of nodes to be deployed has successfully received the target model. It can be further understood that each target node has successfully downloaded the target model. In step 304, if a loading success message sent by each target node is received, it is determined that each target node in the set of nodes to be deployed has successfully installed the target model.
[0088] In addition, if a processing failure message of the target processing item is received from at least one of the target nodes, the at least one target node is controlled to re-execute the target processing item until a processing success message of the target processing item is received from at least one of the target nodes. Specifically, if the target processing item is to receive the target model, the target model can be re-sent to at least one of the target nodes so that at least one of the target nodes can re-receive the target model to improve the success rate of model reception; if the target processing item is to load the target model, the model loading instruction can be re-sent to at least one of the target nodes so that at least one of the target nodes can reload the target model according to the model loading instruction to improve the success rate of model loading.
[0089] Taking into account the actual application scenarios, network or device problems may cause one or more target nodes in the set of nodes to be deployed to continuously receive processing failure messages sent by the target node within a period of time. At this time, in order to ensure the consistency of model deployment of each target node in the set of nodes to be deployed, in a possible implementation method, if the processing failure message sent by at least one target node is received for a preset number of consecutive times, or if the processing failure message sent by at least one target node is received continuously within a first preset time, it can be determined that the model deployment of all target nodes in the set of nodes to be deployed has failed. In other words, when the model deployment of at least one target node in the set of nodes to be deployed fails, the model deployment of all target nodes in the set of nodes to be deployed can be regarded as failed. At this time, each target node in the set of nodes to be deployed maintains the old version of the model to ensure the consistency of the model version of each target node.
[0090] By adopting the above method, when each link of the model deployment is successfully carried out for each target node in the set of nodes to be deployed, each target node in the set of nodes to be deployed can uniformly use the target model as the current application model; and when one link of the model deployment fails for any target node in the set of nodes to be deployed, all target nodes in the set of nodes to be deployed will not carry out the model deployment of the next link, which can be regarded as the failure of the current model deployment of all target nodes in the set of nodes to be deployed. At this time, the model of each target node in the set of nodes to be deployed continues to maintain the old version, so as to ensure the version consistency of the model deployment of each target node in the set of nodes to be deployed.
[0091] Figure 4 is a block diagram of a device for model deployment according to an exemplary embodiment. Figure 3 As shown, the device comprises:
[0092] A determination module 401 is used to determine a target model to be deployed;
[0093] The acquisition module 402 is used to acquire preset deployment indication information corresponding to the target model; the preset deployment indication information is used to indicate a target deployment cluster to be deployed with the target model; the target deployment cluster includes one of a remote deployment cluster and a local deployment cluster;
[0094] The model deployment module 403 is used to deploy the target model to the target deployment cluster indicated by the preset deployment instruction information.
[0095] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0096] By adopting the above-mentioned device, the model can be flexibly deployed in a local deployment cluster or a remote deployment cluster according to the preset deployment instruction information corresponding to the model. This remote deployment model deployment method can decouple model calculation from business, thereby realizing highly parallel calculation and improving computing performance. For models with smaller model files, they can be retained in the business party node for local deployment. This local deployment method has no network consumption and high real-time computing performance.
[0097] Figure 5 is a block diagram of an electronic device 500 according to an exemplary embodiment. For example, the electronic device 500 may be provided as a server. Figure 5The electronic device 500 includes a processor 522, which may be one or more, and a memory 532 for storing a computer program executable by the processor 522. The computer program stored in the memory 532 may include one or more modules, each corresponding to a set of instructions. In addition, the processor 522 may be configured to execute the computer program to perform the above-mentioned model deployment method.
[0098] In addition, the electronic device 500 may further include a power supply component 526 and a communication component 550, wherein the power supply component 526 may be configured to perform power management of the electronic device 500, and the communication component 550 may be configured to implement communication, such as wired or wireless communication, of the electronic device 500. In addition, the electronic device 500 may further include an input / output (I / O) interface 558. The electronic device 500 may operate based on an operating system stored in the memory 532, such as Windows Server™, Mac OSX™, Unix™, Linux™, etc.
[0099] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned model deployment method are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 532 including program instructions, and the above-mentioned program instructions can be executed by the processor 522 of the electronic device 500 to complete the above-mentioned model deployment method.
[0100] In another exemplary embodiment, a computer program product is also provided. The computer program product includes a computer program that can be executed by a programmable device, and the computer program has a code portion for executing the above-mentioned model deployment method when executed by the programmable device.
[0101] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings; however, the present disclosure is not limited to the specific details in the above embodiments. Within the technical concept of the present disclosure, a variety of simple modifications can be made to the technical solution of the present disclosure, and these simple modifications all fall within the protection scope of the present disclosure.
[0102] It should also be noted that the various specific technical features described in the above specific implementation methods can be combined in any suitable manner without contradiction.
[0103] In order to avoid unnecessary repetition, the present disclosure will not further explain various possible combinations.
[0104] In addition, various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.
Claims
1. A method for model deployment, characterized in that: The method comprises: Determine the target model to be deployed; Obtaining preset deployment indication information corresponding to the target model; the preset deployment indication information is used to indicate a target deployment cluster to be deployed with the target model; the target deployment cluster includes one of a remote deployment cluster and a local deployment cluster, the remote deployment cluster includes a plurality of deployment clusters, the local deployment cluster includes a plurality of deployment clusters, and each deployment cluster includes a plurality of model deployment nodes; Deploy the target model to the target deployment cluster indicated by the preset deployment instruction information; Wherein, under the condition that the target deployment cluster is the remote deployment cluster, before deploying the target model to the target deployment cluster indicated by the preset deployment instruction information, the method further includes: Determine whether the target model has two or two partition models; the partition model includes a model obtained by dividing the target model according to a preset dimension, and deploy the target model of the partition model to a remote deployment cluster; accordingly, deploying the target model to the target deployment cluster indicated by the preset deployment indication information includes: In the case where the target model has two or more partition models, the partition models are respectively deployed to corresponding network nodes in the target deployment cluster, wherein different partition models are deployed on different network nodes; The preset deployment instruction information includes the service identification information corresponding to the target model; accordingly, the step of deploying the target model to the target deployment cluster indicated by the preset deployment instruction information includes: Determine the model deployment cluster corresponding to the business identification information as the target deployment cluster; Deploy the target model to the target deployment cluster; The step of deploying the target model to the target deployment cluster indicated by the preset deployment instruction information comprises: In a case where it is determined that the target model does not have the partition model, deploying the target model on each network node in the target deployment cluster; Receive a service request message sent by a service requester, where the service request message is used to request service data of a target service; in response to receiving the service request message, determine the target deployment cluster according to the service identification information of the target service; if it is determined that the partition model exists in the target model deployed in the target deployment cluster, determine the target partition model corresponding to the target service in the partition model; determine the target network node corresponding to the target partition model according to the deployment correspondence; and obtain the service data from the target partition model of the target network node.
2. The method according to claim 1, characterized in that The method of determining the target model to be deployed includes one of the following two methods: Determine that the model currently added in the preset file directory is the target model; The model selected by the user is determined as the target model.
3. The method according to any one of claims 1 to 2, characterized in that: The step of deploying the target model to the target deployment cluster indicated by the preset deployment instruction information comprises: Receiving a model deployment request message sent by a target node in a set of nodes to be deployed, wherein the model deployment request message is used to request deployment of the target model, and the set of nodes to be deployed is a set consisting of two or more network nodes in the target deployment cluster; In response to receiving the model deployment request message, acquiring the target model; Control each of the target nodes in the set of nodes to be deployed to install the target model; After it is determined that each of the target nodes has successfully installed the target model, each of the target nodes is controlled to use the target model as a current application model.
4. The method according to claim 3, characterized in that: The controlling each of the target nodes to install the target model comprises: Sending the target model to each of the target nodes; After it is determined that each of the target nodes has successfully received the target model, a model loading instruction is sent to each of the target nodes so that each of the target nodes loads the target model.
5. The method according to claim 1, characterized in that After deploying the partition models to corresponding network nodes in the target deployment cluster respectively, the method further includes: Record each partition model and the deployment correspondence between the network nodes where each partition model is deployed.
6. The method according to claim 5, characterized in that After deploying the target model to the target deployment cluster indicated by the preset deployment instruction information, the method further includes: Receiving a service request message sent by a service requester, wherein the service request message is used to request service data of a target service; In response to receiving the service request message, determining the target deployment cluster according to the service identification information of the target service; If it is determined that the partition model exists in the target model deployed in the target deployment cluster, determining the target partition model corresponding to the target service in the partition model; Determine the target network node corresponding to the target partition model according to the deployment correspondence relationship; The service data is acquired from the target partition model of the target network node.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.
8. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Resource management method, device and system
CN105933137A
Data cluster deployment method, device and system
CN107229646A
Event stream processing cluster manager
CN108419447A
Method, device and system for deploying data clusters, and computer storage medium
WO2017161984A1