Algorithm deployment method and device, computer equipment and storage medium
By deploying intelligent algorithms, the container mirror is determined and stored in the shared storage unit, solving the problem of limited deployment speed in the existing technology and the inadequate edge equipment, and achieved efficient and flexible algorithm deployment and data security.
Patent Information
- Application Number
- CN202411226212.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2025-01-28
AI Technical Summary
When deploying intelligent algorithms in the prior art, the container size has an impact on the deployment speed and is not suitable for running in edge devices or embedded devices. The wasm, model, and data are not decoupled, resulting in a long data push time and reducing the algorithm deployment efficiency. .
By obtaining the deployment algorithm and its running data, the container mirror image is determined, and it is stored with the data in the shared storage unit. The algorithm is supported in the cloud and marginal nodes, and the pre -coding processing is used to improve the deployment speed.
Improve the efficiency of algorithm deployment, meet the deployment needs of marginal equipment, reduce the storage pressure and data push time, and ensure data security and deployment flexibility.
Smart Images

Figure CN119376744A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to an algorithm deployment method, device, computer equipment, and storage medium. Background Art
[0002] With the rapid development of artificial intelligence, all walks of life in society have an inseparable relationship with artificial intelligence, such as short video recommendation algorithms in the short video field, AI image recognition in medical fields, and so on.
[0003] The traditional way to deploy intelligent algorithms is to use microservice technology based on container technology to implement algorithm training and reasoning, and then complete the operation of the algorithm. However, the size of the container in this way will affect the speed of deployment. In addition, due to the existence of container technology, it is not suitable for running in edge devices or embedded devices.
[0004] Another way is to use the webassembly runtime fusion technology route to provide reasoning services based on the wasm sandbox to complete the operation of the algorithm. However, in this way, wasm, model, and data are not decoupled, and data needs to be pushed to the container for training or reasoning. A lot of time is wasted on data push, which will reduce the efficiency of algorithm deployment. Summary of the invention
[0005] Based on this, it is necessary to provide an algorithm deployment method, device, computer equipment, and storage medium that can improve the efficiency of algorithm deployment during algorithm deployment in response to the above technical problems.
[0006] In a first aspect, the present disclosure provides a method for deploying an algorithm. The method comprises:
[0007] Acquire an algorithm to be deployed and operating data of the algorithm to be deployed that needs to be processed, wherein the algorithm to be deployed includes an algorithm to be trained and / or a model to be inferred;
[0008] Determine the container image to be deployed based on the requirements of the algorithm to be deployed on the operating environment;
[0009] The container image to be deployed and the running data to be processed of the algorithm to be deployed are stored in a storage unit, wherein the storage unit is in a shared form and is mounted in a service node in the cloud and multiple edge nodes on the local end;
[0010] In response to receiving the algorithm deployment instruction, determining a target algorithm, target operating data corresponding to the target algorithm in the storage unit, and a target container image corresponding to the target algorithm based on the algorithm deployment instruction;
[0011] Based on the target algorithm, the target operation data corresponding to the target algorithm, and using the target container image, the target algorithm is deployed in the service node and / or in the edge node.
[0012] In one of the embodiments, the target algorithm, the target operation data corresponding to the target algorithm, and the target algorithm deployed in the service node and / or in the edge node using the target container image include any one of the following:
[0013] Based on the target algorithm and target operation data corresponding to the target algorithm, and using a target container image, deploying the target algorithm in the service node;
[0014] Send a first instruction to the edge node to instruct the edge node to send target operation data corresponding to the target algorithm to the edge node, deploy the target algorithm using the target container image, and receive the operation result of the target algorithm fed back by the edge node;
[0015] The target algorithm is split into multiple target sub-algorithms, based on the target sub-algorithms and the target running data corresponding to the target sub-algorithms, the target sub-algorithms are deployed in at least one of the edge nodes and the service node using the target container image, and the running results of the target sub-algorithms fed back by the edge nodes are received; wherein, there is a connection relationship between the multiple edge nodes and the service nodes.
[0016] In one of the embodiments, based on the target sub-algorithm and the target operation data corresponding to the target sub-algorithm, deploying the target sub-algorithm in at least one of the edge nodes and the service node using a target container image, and receiving the operation result of the target sub-algorithm fed back by the edge node includes:
[0017] Determine an edge sub-algorithm executed by an edge node and a cloud sub-algorithm executed by a service node among multiple target sub-algorithms;
[0018] Sending a second instruction to the edge node to instruct at least one of the edge nodes to run the edge sub-algorithm according to the edge sub-algorithm and the edge operation data corresponding to the edge sub-algorithm and using the target container image corresponding to the edge sub-algorithm, and receiving the operation result of the edge sub-algorithm fed back by the edge node;
[0019] Based on the cloud sub-algorithm and the cloud running data corresponding to the cloud sub-algorithm, the cloud sub-algorithm is run in the service node using the target container image corresponding to the cloud sub-algorithm.
[0020] In one embodiment, the method further comprises:
[0021] In response to the disconnection of the connection relationship between the edge node and the service node, marking the disconnected edge node, wherein the target algorithm or the target sub-algorithm continues to be deployed in the disconnected edge node;
[0022] In response to the disconnected edge node re-establishing a connection relationship with the service node, an operation result of the target algorithm or the target sub-algorithm in the disconnected edge node is received.
[0023] In one of the embodiments, determining the container image to be deployed based on the requirements of the algorithm to be deployed on the operating environment includes:
[0024] According to the requirements of the algorithm to be deployed for the operating environment, delete the data in the basic image that is not related to the algorithm to be deployed, and install the runtime library required for wasm operation to obtain the container image to be deployed, wherein the basic image includes: the image generated by the algorithm to be deployed during the development process;
[0025] A wasm is generated based on the algorithm to be deployed, and the wasm is pre-encoded, wherein the wasm is stored in the storage unit after the pre-encoding process.
[0026] In one embodiment, the method further comprises:
[0027] Receive a data inference result fed back by an embedded device in the edge node, wherein the data inference result is obtained after data inference based on the perception data acquired by the embedded device, wherein the embedded device includes a pre-configured algorithm and container image.
[0028] In a second aspect, the present disclosure further provides an algorithm deployment device. The device comprises:
[0029] A data acquisition module, used to acquire the algorithm to be deployed and the operating data of the algorithm to be deployed that needs to be processed, wherein the algorithm to be deployed includes an algorithm to be trained and / or a model to be inferred;
[0030] An image determination module, used to determine the container image to be deployed based on the requirements of the algorithm to be deployed on the operating environment;
[0031] A storage module, used to store the container image to be deployed and the running data to be processed of the algorithm to be deployed in a storage unit, wherein the storage unit is in a shared form and is mounted in a service node in the cloud and multiple edge nodes on the local end;
[0032] a target algorithm determination module, configured to determine, in response to receiving an algorithm deployment instruction, a target algorithm, target operating data corresponding to the target algorithm in the storage unit, and a target container image corresponding to the target algorithm based on the algorithm deployment instruction;
[0033] A target algorithm operation module is used to deploy the target algorithm in the service node and / or in the edge node based on the target algorithm, the target operation data corresponding to the target algorithm, and using the target container image.
[0034] In a third aspect, the present disclosure further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps in any of the above method embodiments are implemented.
[0035] In a fourth aspect, the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0036] In a fifth aspect, the present disclosure further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0037] In the above embodiments, based on the requirements of the algorithm to be deployed for the operating environment, the container image to be deployed is determined, the container image can be reduced, the training and reasoning ensure that the size of the container image is reduced on the basis of normal application, and the container image to be deployed is obtained, which can improve the system response speed and reduce the storage pressure. The container image to be deployed and the operating data to be processed of the algorithm to be deployed are stored in a storage unit, wherein the storage unit is in a shared form, and the storage unit is mounted in a service node in the cloud and multiple edge nodes on the local end, which can decouple various types of data. Storing in the storage unit can ensure data security. Once the container crashes during the operation of the container, there is no need to re-upload the data, and the data can be obtained from the storage unit again, which improves the efficiency of algorithm deployment. The operating environment is installed in the container image to be deployed, and the container image to be deployed provides a more basic grassroots environment. The corresponding container images to be deployed in multiple algorithms to be deployed are stored in the storage unit, and the shared form can reduce storage and improve construction flexibility. In addition, the shared form can save data push time and save time. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0039] FIG1 is a schematic diagram of an application environment of an algorithm deployment method in one embodiment;
[0040] FIG2 is a schematic diagram of a flow chart of a method for deploying an algorithm in one embodiment;
[0041] FIG3 is a schematic diagram of a flow chart of step S210 in one embodiment;
[0042] FIG4 is a schematic diagram of a flow chart of step S306 in one embodiment;
[0043] FIG5 is a flow chart showing the steps of disconnecting the connection between an edge node and a service node in one embodiment;
[0044] FIG6 is a schematic diagram of a flow chart of step S204 in one embodiment;
[0045] FIG7 is a schematic block diagram of the structure of an algorithm deployment device in one embodiment;
[0046] FIG8 is a schematic block diagram of the structure of an algorithm operation system in one embodiment;
[0047] FIG. 9 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.
[0049] It should be noted that the terms "first", "second", etc. in the specification and claims of this article and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of this article described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0050] In this article, the term "and / or" is only a description of the association relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the related objects before and after are in an "or" relationship.
[0051] As described in the background technology, since wasm, model, and data are not decoupled, it is difficult to ensure the security of the data. During the deployment process, if the container crashes during operation, the data needs to be re-uploaded, which will reduce the efficiency of deployment. In addition, when the model or algorithm is replaced, the container needs to be rebuilt, further reducing the efficiency of deployment. In addition, the operating environment of the algorithm or model needs to be strongly bound to the container. When the model and / or algorithm needs to be upgraded, the container image needs to be adjusted. It is impossible to make a basic container image more widely adaptable to multiple models and algorithms, which will waste a lot of time.
[0052] Therefore, in order to solve the above problems, the embodiment of the present disclosure provides a method for deploying an algorithm, which can be applied in the application environment shown in Figure 1. Among them, the terminal 102 communicates with the service node 104 and the edge node 106 through the network. The terminal 102 can be deployed on the service node 104. The service node 104 and the edge node 102 can externally mount storage units 108 and 110 respectively. The terminal 102 can obtain the algorithm to be deployed and the operating data that the algorithm to be deployed needs to process. The algorithm to be deployed includes: an algorithm that needs to be trained and / or a model that needs to be inferred. The terminal 102 can determine the container image to be deployed based on the requirements of the algorithm to be deployed for the operating environment. The terminal 102 can store the container image to be deployed and the operating data that needs to be processed of the algorithm to be deployed in the storage unit. Among them, the storage unit is in a shared form, the storage unit 108 is mounted on the service node in the cloud, and the storage unit 110 is mounted in multiple edge nodes on the local end. In response to the terminal 102 receiving the algorithm deployment instruction, the target algorithm in the storage unit 108 and / or the storage unit 110, the target operation data corresponding to the target algorithm, and the target container image corresponding to the target algorithm can be determined based on the algorithm deployment instruction. The terminal 102 can deploy the target algorithm in the service node and / or in the edge node based on the target algorithm, the target operation data corresponding to the target algorithm, and the target container image. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, etc. The service node 104 and the edge node 106 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0053] In one embodiment, as shown in FIG. 2 , a method for deploying an algorithm is provided. The method is described by taking the method applied to the service node 104 in FIG. 1 as an example. Furthermore, the method can be executed by the terminal 102 deployed in the service node 104. The method includes the following steps:
[0054] S202, obtain the algorithm to be deployed and the operating data that needs to be processed of the algorithm to be deployed, wherein the algorithm to be deployed includes an algorithm that needs to be trained and / or a model that needs to be inferred. In some embodiments of the present disclosure, a more efficient and fast deployment algorithm is required. In some embodiments of the present disclosure, the specific type of the algorithm to be deployed and the functions it implements are not limited. The algorithm to be deployed can be one or more. The algorithm to be deployed can be an algorithm written in languages such as python, rust, c / c++, etc.
[0055] Specifically, when an algorithm needs to be deployed quickly, multiple algorithms to be deployed and the operating data to be processed by the algorithms to be deployed can be obtained first. The operating data may include: data used in algorithm training, data used in model reasoning, and so on.
[0056] S204: Determine a container image to be deployed based on the requirements of the algorithm to be deployed on the operating environment.
[0057] Specifically, when the algorithm to be deployed is created, its corresponding base image usually exists. The base image includes some unnecessary data or system-level data, which will not affect the operation of the algorithm to be deployed. The algorithm to be deployed can also run normally if these data are cancelled. Therefore, the base image can be slimmed down according to the operating environment requirements of the algorithm to be deployed. In addition, in order to ensure the speed of algorithm deployment, the algorithm can be deployed in a wasm manner. Therefore, the wasm runtime library can also be installed on the slimmed-down base image to support the construction of a container image to be deployed that supports wasm operation.
[0058] S206, storing the container image to be deployed and the running data to be processed of the algorithm to be deployed in a storage unit, wherein the storage unit is in a shared form and mounted in a service node in the cloud and multiple edge nodes on the local end.
[0059] The storage unit can be in the form of a memory, storage system or storage disk. Service nodes usually run on the server cluster side, with large storage, strong computing power, high performance, stable operation, real-time monitoring, and provide management, computing power and storage support for edge nodes and embedded devices. Edge nodes usually have certain storage and computing capabilities, which are inferior to those of service nodes.
[0060] Specifically, the container image to be deployed and the running data to be processed by the algorithm to be deployed can be stored in the storage unit. Since both the service node (cloud) and the edge node (local end) have corresponding computing resources, they can be used for model reasoning or algorithm training. Therefore, multiple storage units can be set up and mounted on the service node in the cloud and multiple edge nodes on the local end. In addition, different container images may mount the same model to infer different data, or they may mount different algorithms to train the same data. Therefore, the storage unit is in a shared form, which can save time for data push and time for algorithm deployment. Edge nodes and service nodes can usually deploy container orchestration tools, and use container orchestration tools to create containers, run them, and manage the container lifecycle of the containers that are destroyed after the operation ends. Generally, the functions of the container orchestration tools deployed in edge devices are relatively simple.
[0061] S208 , in response to receiving the algorithm deployment instruction, determining a target algorithm, target operating data corresponding to the target algorithm in the storage unit, and a target container image corresponding to the target algorithm based on the algorithm deployment instruction.
[0062] The algorithm deployment instruction may usually require the training of a certain algorithm or the instruction of data reasoning of a certain model. The target algorithm may usually be an algorithm among the algorithms to be deployed.
[0063] Specifically, when algorithm training and model reasoning are required, an algorithm deployment instruction can be sent to the service node. When the algorithm deployment instruction is received, the algorithm deployment instruction usually includes the algorithm that needs to be trained or the model that needs to be reasoned. Therefore, the target algorithm can be determined according to the algorithm to be trained or the model that needs to be reasoned, and the target algorithm is used to match it in the storage unit. The target operation data corresponding to the target algorithm and the target container image corresponding to the target algorithm are obtained. It can be understood that since both the service node (cloud) and the edge node (local end) have corresponding computing resources, they can be used for model reasoning or algorithm training. Therefore, the storage unit mentioned in the embodiment of the present disclosure can be a storage unit mounted on the edge node, or a storage unit mounted on the service node. Those skilled in the art can select different storage units for processing according to different application scenarios.
[0064] In some exemplary embodiments, for example, the algorithm deployment instruction includes algorithm A1, and the storage unit stores the operating data and container image corresponding to A1, the operating data and container image corresponding to A2, and the operating data and container image corresponding to A3, then the target operating data may be the operating data corresponding to A1. The target container image may be the container image corresponding to A1.
[0065] S210: Based on the target algorithm, target operation data corresponding to the target algorithm, and using a target container image, deploy the target algorithm in the service node and / or in the edge node.
[0066] Among them, deploying the target algorithm may include: performing model reasoning or performing algorithm training.
[0067] Specifically, since both the service node (cloud) and the edge node (local end) have corresponding computing resources, they can be used for model reasoning or algorithm training. Therefore, after determining the target operating data and target container image corresponding to the target algorithm, model reasoning or algorithm training can be performed in the service node and / or in the edge node.
[0068] In the deployment method of the above algorithm, based on the requirements of the algorithm to be deployed for the operating environment, the container image to be deployed is determined, the container image can be reduced, the training and reasoning ensure that the size of the container image is reduced on the basis of normal application, and the container image to be deployed is obtained, which can improve the system response speed and reduce the storage pressure. The container image to be deployed and the running data to be processed of the algorithm to be deployed are stored in a storage unit, wherein the storage unit is in a shared form, and the storage unit is mounted in a service node in the cloud and multiple edge nodes on the local end, which can decouple various types of data and make local upgrades and incremental updates of the algorithm possible, which will greatly improve the deployment and upgrade efficiency. Storing data in a storage unit can ensure data security. Once the container crashes during the operation of the container, there is no need to re-upload the data, and the data can be obtained from the storage unit again, which improves the efficiency of algorithm deployment. The operating environment is installed in the container image to be deployed, and the container image to be deployed provides a more basic grassroots environment. The corresponding container images to be deployed in multiple algorithms to be deployed are stored in the storage unit, and are in a shared form. No repeated storage is required to reduce storage space and improve construction flexibility. In addition, the shared form can save data push time and save time.
[0069] In one embodiment, as shown in FIG. 3 , the target algorithm, the target operation data corresponding to the target algorithm, and the target algorithm deployed in the service node and / or in the edge node using the target container image include any one of the following:
[0070] S302: Based on the target algorithm and target operation data corresponding to the target algorithm, and using a target container image, deploy the target algorithm in the service node.
[0071] Specifically, the service node has strong computing power. Therefore, in order to increase the speed of algorithm deployment, the target algorithm can be deployed in the service node. The target algorithm, the target operation data corresponding to the target algorithm, and the target container image in the storage unit mounted on the service node can be obtained. Then, the target container image is used in the service node to deploy the target algorithm, thereby completing model reasoning or algorithm training.
[0072] S304, sending a first instruction to the edge node to instruct the edge node to send the target operation data corresponding to the target algorithm to the edge node, deploy the target algorithm using the target container image, and receive the operation result of the target algorithm fed back by the edge node.
[0073] Specifically, the service node may be offline due to network and other reasons. When the service node is offline during the process of deploying the target algorithm, the service node cannot deploy the target algorithm, which affects the speed of algorithm deployment. Therefore, in order to ensure that the algorithm can be deployed when the service node is offline. A first instruction can be sent to the edge node. When the edge node receives the first instruction, the edge node can obtain the target algorithm, the target operation data corresponding to the target algorithm, and the target container image mounted in the storage unit of the edge node. The edge node uses the target container image to deploy the target algorithm. After the edge node deploys the target algorithm, the operation results of the target algorithm can be fed back to the service node. The service node determines whether to complete the model reasoning or algorithm training based on the operation structure of the target algorithm.
[0074] S306, split the target algorithm into multiple target sub-algorithms, deploy the target sub-algorithms in at least one edge node and the service node using the target container image based on the target sub-algorithms and the target operation data corresponding to the target sub-algorithms, and receive the operation results of the target sub-algorithms fed back by the edge node; wherein, there is a connection relationship between the multiple edge nodes and the service nodes. The connection relationship can usually be a relationship connected through a wireless network, so that the edge node and the service node can synchronize status and update information.
[0075] Specifically, since a target algorithm may have multiple steps, using only a service node or only an edge node to run it will reduce the operating efficiency of the target algorithm. Therefore, the target algorithm can be split into multiple target sub-algorithms, each of which performs a step or function. Then, the target sub-algorithm and the target operation data corresponding to the target sub-algorithm can be used to deploy different target sub-algorithms in the edge node and the service node using the target container image. After the edge node deploys the target sub-algorithm, the deployment result of the target sub-algorithm can be fed back to the service node. The service node jointly determines the deployment result of the target algorithm (the result of model reasoning or algorithm training) based on the feedback of the deployment result of the target sub-algorithm and its own deployment result of the target sub-algorithm.
[0076] In this embodiment, by deploying the target algorithm on the service node and / or edge node, it can adapt to different application scenarios, and then those skilled in the art can flexibly adapt according to different application scenarios to improve the efficiency of algorithm deployment.
[0077] In one embodiment, as shown in FIG. 4 , based on the target sub-algorithm and the target operation data corresponding to the target sub-algorithm, deploying the target sub-algorithm in at least one of the edge nodes and the service node using a target container image, and receiving the operation result of the target sub-algorithm fed back by the edge node includes:
[0078] S402, determining an edge sub-algorithm executed by an edge node and a cloud sub-algorithm executed by a service node among multiple target sub-algorithms.
[0079] Specifically, the target sub-algorithm can be classified into an edge sub-algorithm and a cloud sub-algorithm according to the number of edge nodes. The target sub-algorithm can also be classified into an edge sub-algorithm and a cloud sub-algorithm according to other preset conditions. In some embodiments of the present disclosure, there is no absolute restriction on the classification conditions, as long as the target sub-algorithm can be divided into two categories.
[0080] S404, sending a second instruction to the edge node to instruct at least one of the edge nodes to run the edge sub-algorithm according to the edge sub-algorithm and the edge operation data corresponding to the edge sub-algorithm, and using the target container image corresponding to the edge sub-algorithm, and receive the operation result of the edge sub-algorithm fed back by the edge node.
[0081] Specifically, since the edge sub-algorithm needs to be run on the edge node, the service node needs to send a second instruction to the edge node. This instructs the edge node to run the edge sub-algorithm. Therefore, after determining the edge sub-algorithm, the edge node can determine the edge operation data corresponding to the edge sub-algorithm and the target container image corresponding to the edge sub-algorithm in the storage unit mounted thereon. Then, the edge sub-algorithm is run in the edge node using the target container image corresponding to the edge sub-algorithm to obtain the running result of the edge sub-algorithm. The edge node can then feed back the running result of the edge algorithm to the service node.
[0082] In some exemplary embodiments, an algorithm training task can be set on the edge node, such as using an algorithm to filter sensitive data, and each task contains 500 pieces of data (in any form, such as pictures or data packets). When the edge node completes the processing, the processing results can be fed back to the service node.
[0083] S406, based on the cloud sub-algorithm and the cloud running data corresponding to the cloud sub-algorithm, and using the target container image corresponding to the cloud sub-algorithm in the service node to run the cloud sub-algorithm.
[0084] Specifically, in the storage unit mounted on the service node, the cloud sub-algorithm can be used to match the cloud operation data corresponding to the cloud sub-algorithm and the target container image corresponding to the cloud sub-algorithm. Then, the cloud sub-algorithm is run in the service node using the target container image corresponding to the cloud sub-algorithm. The running result of the target algorithm is obtained based on the running result of the cloud sub-algorithm and the running result of the edge sub-algorithm.
[0085] In some exemplary embodiments, when the edge node completes the edge sub-algorithm, the service node can perform status update and information merging. Status update refers to whether the edge node is online, which can be understood as a heartbeat. The edge node usually keeps pushing whether it is online. If it is offline for a long time or not pushed, it can be determined that the status is offline. Information merging can be merging the running results of the cloud sub-algorithm and the running results of the edge sub-algorithm.
[0086] In some exemplary embodiments, for example, the target sub-algorithm includes: A1, A2, A3 and A4, wherein A1 and A3 are determined as edge sub-algorithms. A2 and A4 are determined as cloud sub-algorithms. A1 and A3 can be used to determine the edge operation data corresponding to A1 and the edge operation data corresponding to A3 in the storage unit mounted on the edge node. The target container image corresponding to A1 and the target container corresponding to A3 are executed, and then A1 and A3 are respectively run in two different edge nodes, and the operation results of A1 and A3 are obtained and fed back to the service node. A2 and A4 are determined as cloud sub-algorithms and run in the service node. The service node merges information based on the operation results of A1, A2, A3 and A4, and then determines the operation result of the target algorithm. If it is algorithm training, the training results of the edge node and the training results of the service node can be merged. If it is model reasoning, the data with lower accuracy can be summarized.
[0087] In this embodiment, by splitting the target sub-algorithm into an edge sub-algorithm run by the edge node and a cloud sub-algorithm run by the service node, the edge node and the service node can jointly and synchronously deploy the edge sub-algorithm and the cloud sub-algorithm, which can further improve the efficiency of algorithm deployment.
[0088] In one embodiment, as shown in FIG5 , the method further includes:
[0089] S502: In response to the disconnection of the connection relationship between the edge node and the service node, mark the disconnected edge node, wherein the target algorithm or the target sub-algorithm continues to be deployed in the disconnected edge node.
[0090] Specifically, it has been mentioned in the above embodiments that there is a connection relationship between the edge node and the service node. When the connection relationship is disconnected, the edge node with the disconnected relationship can be marked first. Since the storage unit is also mounted in the edge node, when the connection relationship is disconnected, the data in the edge node with the disconnected relationship will not be terminated. Therefore, the target algorithm or the target sub-algorithm (such as the edge sub-algorithm mentioned in the embodiment above) can continue to be deployed in the edge node with the disconnected relationship, and the corresponding operation results can be stored locally. In addition, after marking the edge node with a disconnected relationship, if the training generation model is no longer waiting for the edge node to return the result information, and when running the model reasoning task, it is no longer waiting for the edge node to return the result.
[0091] In some exemplary embodiments, when the edge node does not send information to the service node within a preset time threshold, it can be determined that the edge node has reached an offline determination threshold and that the edge node is offline.
[0092] S504: In response to the disconnected edge node re-establishing a connection with the service node, receiving the running result of the target algorithm or the target sub-algorithm in the disconnected edge node.
[0093] Specifically, when the disconnected edge node re-establishes a connection with the service node, it is necessary to update the status and synchronize information in a timely manner. Feedback the running results of the target algorithm or target sub-algorithm in the edge node to the service node. And synchronize the online information of the edge node to the service node.
[0094] In this embodiment, when the connection between the edge node and the service node is disconnected, in order to ensure the efficiency of the deployment algorithm, the edge node needs to be marked and the return result of the edge node is no longer waited. The target algorithm or target sub-algorithm can continue to be deployed in the edge node, and the corresponding results can be stored. When the connection is re-established, the status update and information synchronization can be performed. In the case of long-term offline operation, the status information is stored locally and the status and information are synchronized after the service node is connected again.
[0095] In one embodiment, as shown in FIG6 , determining the container image to be deployed based on the requirements of the algorithm to be deployed on the operating environment includes:
[0096] S602, according to the requirements of the algorithm to be deployed for the operating environment, delete the data in the basic image that is not related to the algorithm to be deployed, and install the runtime library required for wasm operation to obtain the container image to be deployed, wherein the basic image includes: the image generated by the algorithm to be deployed during the development process.
[0097] Among them, wasm is a new encoding format and can run in the browser. wasm can coexist with JavaScript. wasm is more like a low-level assembly language. It allows us to write programs in languages other than JavaScript (such as C, C++, Rust or others), and then compile them into WebAssembly, thereby generating a web application that loads and executes very quickly. The runtime library required for wasm to run can be wasm runtime.
[0098] Specifically, according to the minimum requirements of the algorithm to be deployed for the operating environment, the data in the base image that is not related to the algorithm to be deployed can be deleted, such as some unnecessary runtime libraries, unnecessary system-level data, etc. In order to speed up the algorithm deployment, the algorithm can be deployed in the wasm way, so the runtime library required for wasm operation can be installed in the base image from which the data that is not related to the algorithm to be deployed has been deleted, thereby obtaining the container image to be deployed.
[0099] S604, generating a wasm based on the algorithm to be deployed, and performing pre-coding processing on the wasm, wherein the wasm is stored in the storage unit after the pre-coding processing.
[0100] Among them, pre-coding can usually be AOT (Ahead Of Time) pre-run compilation.
[0101] Specifically, after generating the container image to be deployed, in order to further improve the speed of algorithm deployment, wasm can be generated based on the algorithm to be deployed. Then, wasm is precompiled to avoid compilation performance consumption and memory consumption at runtime. The pre-encoded wasm is then stored in a storage unit, and the target algorithm can be deployed directly using the pre-compiled wasm, the container image to be deployed, and the running data.
[0102] In this embodiment, according to the minimum requirements of the algorithm to be deployed for the operating environment, data irrelevant to the algorithm to be deployed in the basic image is deleted, so that the image can be slimmed down and the storage pressure can be reduced. In addition, pre-compilation can be compiled before the program is run, which can avoid the compilation performance consumption and memory consumption at runtime, and can also achieve the highest performance at the beginning of the program running, and can also speed up the startup of the program.
[0103] In one embodiment, the method further comprises:
[0104] Receive a data inference result fed back by an embedded device in the edge node, wherein the data inference result is obtained after data inference based on the perception data acquired by the embedded device, wherein the embedded device includes a pre-configured algorithm and container image.
[0105] Among them, the embedded device can be a radar, camera and other devices. The perception data can be the data recognized by the radar or the data captured by the camera. An embedded device is a computer system designed specifically for a specific application. It is usually embedded in other devices to run specified algorithms and / or models. At the same time, the wasmruntime and container images have been burned in it. To upgrade the model and / or algorithm, you only need to use a new wasm aot package.
[0106] Specifically, data reasoning can be performed in the embedded device in the edge node. Since the embedded device is used to run the specified algorithm and / or model, the algorithm and / or model therein is fixed. In addition, the wasmruntime and container image have been burned. Therefore, after the embedded device obtains the perception data, it can perform data reasoning according to the configured algorithm and container image therein, and then obtain the data reasoning result. The embedded device can feed back the data reasoning result to the edge node, and the edge node feeds back the data reasoning result to the service node. The embedded device can also directly feed back the data reasoning result to the service node.
[0107] In this embodiment, embedded devices can also be used for processing, increasing support for embedded devices, so that reasoning and training can be performed on the data side more efficiently, and reasoning and training will not be unable to be performed due to offline cloud computing.
[0108] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0109] Based on the same inventive concept, the embodiment of the present disclosure also provides an algorithm deployment device for implementing the algorithm deployment method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more algorithm deployment device embodiments provided below can refer to the limitations of the algorithm deployment method above, and will not be repeated here.
[0110] In one embodiment, as shown in FIG. 7 , an algorithm deployment device 700 is provided, comprising: a data acquisition module 702, a mirror determination module 704, a storage module 706, a target algorithm determination module 708, and a target algorithm operation module 710, wherein:
[0111] A data acquisition module 700 is used to acquire the algorithm to be deployed and the operating data of the algorithm to be deployed that needs to be processed, wherein the algorithm to be deployed includes an algorithm to be trained and / or a model to be inferred;
[0112] An image determination module 704 is used to determine the container image to be deployed based on the requirements of the algorithm to be deployed on the operating environment;
[0113] The storage module 706 is used to store the container image to be deployed and the running data to be processed of the algorithm to be deployed in a storage unit, wherein the storage unit is in a shared form and is mounted in a service node in the cloud and multiple edge nodes on the local end;
[0114] A target algorithm determination module 708 is configured to determine, in response to receiving an algorithm deployment instruction, a target algorithm, target operating data corresponding to the target algorithm in the storage unit, and a target container image corresponding to the target algorithm based on the algorithm deployment instruction;
[0115] The target algorithm running module 710 is used to deploy the target algorithm in the service node and / or in the edge node based on the target algorithm, the target running data corresponding to the target algorithm, and using the target container image.
[0116] In one embodiment of the device, the target algorithm running module 708 includes:
[0117] The first operation module is used to deploy the target algorithm in the service node based on the target algorithm, the target operation data corresponding to the target algorithm, and using the target container image.
[0118] The second operation module is used to send a first instruction to the edge node to instruct the edge node to send the target operation data corresponding to the target algorithm to the edge node, deploy the target algorithm using the target container image, and receive the operation result of the target algorithm fed back by the edge node.
[0119] The third operation module is used to split the target algorithm into multiple target sub-algorithms, deploy the target sub-algorithms based on the target sub-algorithms and the target operation data corresponding to the target sub-algorithms, and use the target container image in at least one of the edge nodes and the service node, and receive the operation results of the target sub-algorithms fed back by the edge nodes; wherein, there is a connection relationship between the multiple edge nodes and the service nodes.
[0120] In one embodiment of the device, the third operation module includes: a sub-algorithm determination module, which is used to determine the edge sub-algorithm run by the edge node and the cloud sub-algorithm run by the service node among multiple target sub-algorithms.
[0121] The instruction sending module is used to send a second instruction to the edge node to instruct at least one of the edge nodes to run the edge sub-algorithm according to the edge sub-algorithm and the edge operation data corresponding to the edge sub-algorithm, and use the target container image corresponding to the edge sub-algorithm to run the edge sub-algorithm, and receive the operation result of the edge sub-algorithm fed back by the edge node.
[0122] The cloud algorithm running module is used to run the cloud sub-algorithm based on the cloud sub-algorithm and the cloud running data corresponding to the cloud sub-algorithm, and to run the cloud sub-algorithm in the service node using the target container image corresponding to the cloud sub-algorithm.
[0123] In one embodiment of the device, the device also includes: a marking module, which is used to mark the edge node with a disconnected connection relationship in response to the disconnection of the connection relationship between the edge node and the service node, wherein the target algorithm or the target sub-algorithm continues to be deployed in the edge node with a disconnected connection relationship.
[0124] The result receiving module is used for receiving the running result of the target algorithm or the target sub-algorithm in the edge node with a disconnected relationship in response to the edge node with a disconnected relationship re-establishing a connection relationship with the service node.
[0125] In one embodiment of the device, the image determination module 704 is also used to delete data in the basic image that is not related to the algorithm to be deployed, and install the runtime library required for wasm operation according to the requirements of the algorithm to be deployed for the operating environment, so as to obtain the container image to be deployed, and the basic image includes: the image generated by the algorithm to be deployed during the development process.
[0126] The storage module 706 is further used to generate wasm based on the algorithm to be deployed, and pre-encode the wasm, wherein the wasm is stored in the storage unit after pre-encoding.
[0127] In one embodiment of the device, the device also includes: an inference result receiving module, which is used to receive data inference results fed back by an embedded device in the edge node, wherein the data inference results are obtained after data inference based on the perception data acquired by the embedded device, wherein the embedded device includes a pre-configured algorithm and container image.
[0128] Each module in the deployment device of the above algorithm can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0129] In one embodiment, the present disclosure further provides an algorithm deployment system 800, as shown in FIG8 , the system includes: a container initialization module 820, a platform management module 840, an edge device autonomy module 860, and an embedded device reasoning module 880. Among them, the container initialization module and the platform management module are built in the service node. The edge device autonomy module and the embedded device reasoning module are built in the edge node.
[0130] The container initialization module 820 includes: a container slimming tool, which is used to delete data in the basic image that is not related to the algorithm to be deployed according to the requirements of the algorithm to be deployed for the operating environment, and install the runtime library required for wasm operation to obtain the container image to be deployed. The basic image includes: the image generated by the algorithm to be deployed during the development process.
[0131] A precompilation tool is used to generate wasm based on the algorithm to be deployed, and pre-encode the wasm, wherein the wasm is stored in a wasm storage unit after the pre-encoding process.
[0132] Wasm storage unit, used to store wasm after pre-encoding processing.
[0133] Container storage unit, used to store container images to be deployed.
[0134] The platform management module 840 includes: a persistent storage module, which is used to use the external mounting persistent storage form of the Wasm storage unit and the container storage unit in the service node.
[0135] The algorithm running module is used to deploy the target algorithm, or deploy the target sub-algorithm.
[0136] The device monitoring module is used to, in response to the disconnection of the connection relationship between the edge node and the service node, mark the disconnected edge node, wherein the target algorithm or target sub-algorithm continues to be deployed in the disconnected edge node; in response to the disconnected edge node re-establishing the connection relationship with the service node, receive the running result of the target algorithm or target sub-algorithm in the disconnected edge node.
[0137] The edge device autonomous module 860 includes: a persistent storage module, which is used to store the Wasm storage unit and the container storage unit in the edge node in an externally mounted persistent storage form.
[0138] The algorithm running module is used to deploy the target algorithm or the target sub-algorithm.
[0139] The feedback module is used to reconnect the disconnected edge node with the service node, and to feedback the running results of the target algorithm or target sub-algorithm, as well as the status and information synchronization.
[0140] The local storage module is used to store the results of the deployment target algorithm or the deployment target sub-algorithm.
[0141] The embedded device reasoning module 880 is used to implement local data reasoning of the embedded device and push the reasoning information of the data reasoning to the current linkable node (service node or edge node).
[0142] For the specific implementation and limitation of this embodiment, please refer to the above embodiment, which will not be repeated here.
[0143] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG9. The computer device includes a processor, a memory, and a network interface connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store container image data to be deployed. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for deploying an algorithm is implemented.
[0144] Those skilled in the art will understand that the structure shown in FIG. 9 is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the computer device to which the scheme of the present disclosure is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0145] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in any of the above method embodiments when executing the computer program.
[0146] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0147] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in any of the above method embodiments when executed by a processor.
[0148] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided by the present disclosure can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided by the present disclosure may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided by the present disclosure may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, etc., but are not limited to this.
[0149] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0150] The above-described embodiments only express several implementation methods of the present disclosure, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present disclosure, and these all belong to the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the attached claims.
Claims
1. A method for deploying an algorithm, characterized in that: The method comprises: Acquire an algorithm to be deployed and operating data of the algorithm to be deployed that needs to be processed, wherein the algorithm to be deployed includes an algorithm to be trained and / or a model to be inferred; Determine the container image to be deployed based on the requirements of the algorithm to be deployed on the operating environment; The container image to be deployed and the running data to be processed of the algorithm to be deployed are stored in a storage unit, wherein the storage unit is in a shared form and is mounted in a service node in the cloud and multiple edge nodes on the local end; In response to receiving the algorithm deployment instruction, determining a target algorithm, target operating data corresponding to the target algorithm in the storage unit, and a target container image corresponding to the target algorithm based on the algorithm deployment instruction; Based on the target algorithm, the target operation data corresponding to the target algorithm, and using the target container image, the target algorithm is deployed in the service node and / or in the edge node.
2. The method according to claim 1, characterized in that The target algorithm, the target operation data corresponding to the target algorithm, and the target algorithm deployed in the service node and / or the edge node using the target container image include any one of the following: Based on the target algorithm and target operation data corresponding to the target algorithm, the target algorithm is deployed in the service node using a target container image; Send a first instruction to the edge node to instruct the edge node to send target operation data corresponding to the target algorithm to the edge node, deploy the target algorithm using the target container image, and receive the operation result of the target algorithm fed back by the edge node; The target algorithm is split into multiple target sub-algorithms, based on the target sub-algorithms and the target running data corresponding to the target sub-algorithms, the target sub-algorithms are deployed in at least one of the edge nodes and the service node using the target container image, and the running results of the target sub-algorithms fed back by the edge nodes are received; wherein, there is a connection relationship between the multiple edge nodes and the service nodes.
3. The method according to claim 2, based on the target sub-algorithm and the target operation data corresponding to the target sub-algorithm, deploying the target sub-algorithm in at least one of the edge nodes and the service node using a target container image, and receiving the operation result of the target sub-algorithm fed back by the edge node, comprises: Determine an edge sub-algorithm executed by an edge node and a cloud sub-algorithm executed by a service node among multiple target sub-algorithms; Sending a second instruction to the edge node to instruct at least one of the edge nodes to run the edge sub-algorithm according to the edge sub-algorithm and the edge operation data corresponding to the edge sub-algorithm and using the target container image corresponding to the edge sub-algorithm, and receiving the operation result of the edge sub-algorithm fed back by the edge node; Based on the cloud sub-algorithm and the cloud running data corresponding to the cloud sub-algorithm, the cloud sub-algorithm is run in the service node using the target container image corresponding to the cloud sub-algorithm.
4. The method according to claim 2, characterized in that: The method further comprises: In response to the disconnection of the connection relationship between the edge node and the service node, marking the disconnected edge node, wherein the target algorithm or the target sub-algorithm continues to be deployed in the disconnected edge node; In response to the disconnected edge node re-establishing a connection relationship with the service node, an operation result of the target algorithm or the target sub-algorithm in the disconnected edge node is received.
5. The method according to claim 1, characterized in that The determining the container image to be deployed based on the requirements of the algorithm to be deployed on the operating environment includes: According to the requirements of the algorithm to be deployed for the operating environment, delete the data in the basic image that is not related to the algorithm to be deployed, and install the runtime library required for wasm operation to obtain the container image to be deployed, wherein the basic image includes: the image generated by the algorithm to be deployed during the development process; A wasm is generated based on the algorithm to be deployed, and the wasm is pre-encoded, wherein the wasm is stored in the storage unit after the pre-encoding process.
6. The method according to claim 1, characterized in that The method further comprises: Receive a data inference result fed back by an embedded device in the edge node, wherein the data inference result is obtained after data inference based on the perception data acquired by the embedded device, wherein the embedded device includes a pre-configured algorithm and container image.
7. An algorithm deployment device, characterized in that: The device comprises: A data acquisition module, used to acquire the algorithm to be deployed and the operating data of the algorithm to be deployed that needs to be processed, wherein the algorithm to be deployed includes an algorithm to be trained and / or a model to be inferred; An image determination module, used to determine the container image to be deployed based on the requirements of the algorithm to be deployed on the operating environment; A storage module, used to store the container image to be deployed and the running data to be processed of the algorithm to be deployed in a storage unit, wherein the storage unit is in a shared form and is mounted in a service node in the cloud and multiple edge nodes on the local end; a target algorithm determination module, configured to determine, in response to receiving an algorithm deployment instruction, a target algorithm, target operating data corresponding to the target algorithm in the storage unit, and a target container image corresponding to the target algorithm based on the algorithm deployment instruction; A target algorithm operation module is used to deploy the target algorithm in the service node and / or in the edge node based on the target algorithm, the target operation data corresponding to the target algorithm, and using the target container image.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.