Deployment and updating method of edge end deep learning model

The deep learning model and its dependencies are packaged through the Isula container engine and the Kubernetes container orchestration platform, and combined with Ansible tools to achieve rapid deployment and online updates, solving the efficiency and security issues of traditional manual deployment methods in drone cluster scenarios, and achieving efficient, flexible and secure deployment and update of deep learning models.

CN119883298APending Publication Date: 2025-04-25CHINA ORDNANCE EQUIP GRP AUTOMATION RES INST CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411880071.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The traditional manual deployment edge-end deep learning model method has problems such as slow deployment speed, complex dependency management, and difficulty in update and maintenance in the drone cluster scenario, and there are poor real-time performance and security risks.

Method used

Using Isula container engine technology and Kubernetes container orchestration platform, deep learning models and their dependencies are packaged into lightweight Isula images, and combined with Ansible operation and maintenance tools to achieve rapid deployment and online updates. Use PyInstaller to package related scripts into independent executable files to improve system security.

Benefits of technology

It significantly improves the deployment efficiency of deep learning models, simplifies cluster management, enhances system flexibility and maintainability, and improves system security, avoids source code leakage and real-time problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883298A_ABST
    Figure CN119883298A_ABST
Patent Text Reader

Abstract

The invention discloses an edge end deep learning model deploying and updating method, and relates to the technical field of unmanned aerial vehicles, an Isula container engine technology and a Kub ernetes container arrangement platform are adopted, a deep learning model and dependencies thereof are packaged into a lightweight Isula mirror image, quick start and deployment are supported, and the deployment efficiency is remarkably improved. And the Isula mirror image contains all the dependencies, so that the complexity of manually managing the dependencies is avoided, and the consistency and stability of the environment are ensured. And in combination with an Ansible operation and maintenance tool, only part of configuration files are updated when a small version is updated, so that all unmanned aerial vehicles can obtain the latest algorithm models and security patches in time in a wireless environment. Through the Isula container and the Ansible operation and maintenance tool, centralized management and automatic deployment are realized, cluster management is simplified, and the flexibility and maintainability of the system are improved. Related scripts are packaged into independent executable files by using PyInstaller, so that source codes are protected, and the security of the system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of drone technology, and in particular to a method for rapidly deploying and updating edge-end deep learning models of drone clusters based on Isula. Background Art

[0002] As the number of drones increases, the traditional manual deployment of edge deep learning models faces many challenges, such as slow deployment, complex dependency management, and difficult updates and maintenance. These problems are particularly prominent in cluster drone scenarios, because the increasing number of drones and their wide distribution make unified management and rapid response more difficult.

[0003] Existing patent documents include "A real-time target detection method and device for UAV airborne platform deployment (application number: CN202010925793.3)", "Cloud-edge collaborative dam detection method and device based on UAV platform (application number: CN202210877656.6)", "Multi-UAV collaborative wind turbine blade positioning and defect detection method and device (application number: CN202311269495.3)", etc. The above patents all deploy relevant deep learning models based on traditional manual deployment methods.

[0004] Traditional manual deployment methods usually involve manually installing the operating system, configuring the network environment, and installing necessary software and libraries on each drone. The entire process from preparing the environment to actually running the application can take a long time, especially on resource-constrained edge devices. This method is time-consuming and error-prone, especially when there are a large number of devices. In addition, different deep learning frameworks and models may rely on different libraries and versions. Manually managing these dependencies is very cumbersome and prone to compatibility issues. When the model needs to be updated or the vulnerability needs to be fixed, each device must be accessed one by one to perform the operation, which is inefficient and easy to miss.

[0005] Existing patent documents include "A method for quickly deploying deep learning model files based on docker (application number: CN202310015116.1)", "A deep learning application system, deployment method, device and storage medium (application number: CN202310594571.1)", etc. The above patents are all based on docker deployment to replace the docker image of the entire algorithm construction.

[0006] Docker container technology is used to deploy deep learning models. These solutions usually need to update the entire Docker image file during OTA (Over-The-Air) updates. In addition, when deploying deep learning models, the technical solution does not use packaging tools to package the executable files, which means that the source code of the model and related scripts may be directly exposed on the drone, increasing the risk of source code leakage.

[0007] At the same time, the real-time performance is poor. If the image file is very large, especially in a weak network environment, updating the entire image file will become very time-consuming, and may even fail to complete the update. This will cause the drone to be unable to obtain the latest model in time, affecting the real-time performance and reliability of the system.

[0008] There are also security risks. Source code leakage may lead to the algorithm being reverse engineered. The source code is directly exposed on the drone, increasing the risk of malicious tampering, making maintenance and debugging more difficult. Summary of the invention

[0009] In view of the above problems, the present invention provides an edge-end deep learning model deployment and update method for overcoming the above problems or at least partially solving the above problems. It solves many problems of the traditional manual deployment of edge-end deep learning model methods in cluster drone scenarios, provides a rapid deployment and OTA (Over-The-Air) online update method based on Isula and Ansible for drone clusters, and combines pyinstaller for script packaging to simplify cluster management and enhance the flexibility, maintainability and security of the system.

[0010] The present invention provides the following scheme:

[0011] A method for deploying and updating a deep learning model at an edge, comprising:

[0012] Perform data annotation and model training on a PC to obtain the required deep learning model;

[0013] Install the hardware dependencies and drivers required for the deployment of each node so that each node can call the hardware environment required by the deep learning model;

[0014] Write the project dependency file requirements.txt required for the deep learning model and the Dockerfile file of the software installation package, configuration file, environment variables, and entry command required for the project;

[0015] Use the isula-build plugin to build the Isula image based on the Dockerfile;

[0016] Upload the container to the cloud and use Kubernetes to distribute the Isula image to each drone cluster node through the cloud server;

[0017] Instantiate and start the container, and mount the edge NPU device and parameter configuration directory path required by the deep learning model;

[0018] Check the running status of the container and print logs. Run isula ps to view the running container and container ID. Run isula logs -f ID to view the log information printed by the container execution entry command to diagnose whether the container is running normally.

[0019] Determine that the Isula image needs to be modified, use a replacement command to replace relevant files, and then generate a new image;

[0020] Configure the SSH key pair of the master node and copy the SSH key pair to the target node so that you can use the Ansible tool to update the relevant parameter configuration files.

[0021] Preferably: the project dependency file requirements.txt contains package files required for the deep learning model and network communication.

[0022] Preferably: the Dockerfile file that writes the software installation package, configuration file, environment variables, and entry command required for the project includes:

[0023] Create a Dockerfile file to set up the basic environment, including the installed Python version and working directory;

[0024] Copy project files into the container and install project dependencies;

[0025] Use PyInstaller to package the program and mount the project directory using VOLUME.

[0026] Preferably: run isula-build ctr-img build-f Dockerfile-o image:tag to build the isula image file, where -o is used to specify the generated image name and version number.

[0027] Preferably: instantiating and starting the container, mounting the edge NPU device and parameter configuration directory required for the deep learning model includes:

[0028] Based on the image file, run the isula run-itd image:tag command to generate a container instance, add --device to specify the external device to be mounted; add —restart=always to enable the node to automatically start the container when it is powered on, add —net host to enable communication between the container and the host, and add -v / home / config_path to mount the relevant parameter directory.

[0029] Preferably: determining that the project file needs to be modified, using a replacement command to replace the relevant file, and then generating a new image includes:

[0030] Use isula cp to replace the file, run isula exec-it id bash to enter the container, and delete or query the related files;

[0031] After the project file is modified, run isula commit to generate a new image;

[0032] Run isula run to generate a new container instance based on the new image; or,

[0033] Use isula exec-it ID bash to directly enter the container to manually modify or delete the code.

[0034] Preferably: after the modification is completed, run isula commit to save the new image, and then push the new image to the cloud server so that other nodes can synchronously update the latest image file.

[0035] Preferably: configuring the SSH key pair of the master node, and copying the SSH key pair to the target node, so as to use the ansible tool to update the relevant parameter configuration file includes:

[0036] Run ssh-keygen -t rsa -b 4096 -C to generate an SSH key pair on the master node, and run ssh-copy-id -i ~ / .ssh / id_rsa.pub to copy the key to the target node so that the target node can log in to SSH without a password.

[0037] Run ansible all -m ping on the master node to test the ping connection and run ansible all -m copy -a to copy the file to all other nodes.

[0038] Preferably: Run kebuctl get pod-owide to view the isula image deployment status of all drone nodes that have been connected to the network.

[0039] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0040] An edge-end deep learning model deployment and update method provided in an embodiment of the present application uses Isula container engine technology and Kubernetes container orchestration platform to package deep learning models and their dependencies into lightweight Isula images, support rapid startup and deployment, and significantly improve deployment efficiency. The Isula image contains all dependencies, avoiding the complexity of manually managing dependencies and ensuring the consistency and stability of the environment. Combined with the Ansible operation and maintenance tool, only some configuration files are updated when a minor version is updated, ensuring that all drones can obtain the latest algorithm models and security patches in a wireless environment in a timely manner. Through the Isula container and Ansible operation and maintenance tools, centralized management and automated deployment are achieved, cluster management is simplified, and the flexibility and maintainability of the system are improved. Use PyInstaller to package related scripts into independent executable files, protect the source code, and improve the security of the system.

[0041] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0043] Figure 1 It is a flowchart of an edge deep learning model deployment and update method provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0044] The technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all of the embodiments. Based on the embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present invention.

[0045] See also Figure 1 , is a method for deploying and updating a deep learning model at an edge provided by an embodiment of the present invention, such as Figure 1 As shown, the method may include:

[0046] S101: Perform data labeling and model training on a PC to obtain the required deep learning model;

[0047] S102: Install the hardware dependencies and drivers required for the deployment of each node so that each node can call the hardware environment required by the deep learning model; such as NPU devices, etc.

[0048] S103: Write the project dependency file requirements.txt required by the deep learning model and the Dockerfile file of the software installation package, configuration file, environment variables, and entry command required by the project; the project dependency file requirements.txt contains the package files required for the deep learning model and network communication. For example:

[0049] numpy, opencv-python, torch, Pillow, Flask, fastapi, pydantic, pyYAML, ansible.

[0050] Write Dockerfile, write requirements.txt based on the software dependencies required by the deep learning model obtained previously, and then add it together with the configuration files, environment variables, entry commands, and the executable file PyInstaller package to the Dockerfile file.

[0051] In the specific implementation, the Dockerfile files that write the software installation package, configuration files, environment variables, and entry commands required for the project include:

[0052] Create a Dockerfile file to set up the basic environment, including the installed Python version and working directory;

[0053] Copy project files into the container and install project dependencies;

[0054] Use PyInstaller to package the program and mount the project directory using -VOLUME.

[0055] S104: Use the isula-build plug-in to build the Isula image based on the Dockerfile. In the specific implementation, run isula-build ctr-img build-o image:tag to build the isula image file, and -o is used to specify the generated image name and version number.

[0056] S105: Upload the container to the cloud, and use the Kubernetes container orchestration tool through the cloud server to distribute the Isula image to each drone cluster node; the generated image can be distributed to each drone cluster node by using the Kubernetes container orchestration tool through the cloud server, which greatly simplifies the deployment process and eliminates the need for manual single-machine deployment.

[0057] In actual use, the embodiment of the present application can also provide running kebuctl get pod-owide to view the deployment of the isula image of all drone nodes that have been connected to the network. It is convenient to check whether all nodes are running successfully and to track the problem of partial deployment failure.

[0058] S106: Instantiate and start the container, mount the edge NPU device and parameter configuration directory path required by the deep learning model; in specific implementation, the embodiment of the present application can provide a container instance based on the image file, run the isula run-itdimage:tag command to generate a container instance, add --device to specify the external device to be mounted, such as the NPU device for image processing; add --restart=always to realize the node startup self-start container, add --net host to realize the communication between the container and the host, and add -v / home / config_path to realize the mounting of related parameter directories. This facilitates subsequent parameter modification and replacement.

[0059] S107: Check the running status of the container and print logs, run isula ps to view the running container and container ID, and run isula logs -f ID to view the log information printed by the container execution entry command to diagnose whether the container is running normally;

[0060] S108: Determine that the Isula image needs to be modified, use a replacement command to replace relevant files, and then generate a new image; in specific implementation, the embodiment of the present application can provide using isula cp to replace files, run isulaexec -it id bash to enter the container, and delete or query relevant files;

[0061] After the project file is modified, run isula commit to generate a new image;

[0062] Run isula run to generate a new container instance based on the new image; or,

[0063] Use isula exec-it ID bash to directly enter the container to manually modify or delete the code.

[0064] As can be seen, if you need to modify the project image file, you can use two methods to achieve the modification. One is to enter the container directly through isula exec-it ID bash to manually modify the code or delete it. The other is to use isula cp to replace the code script file. After the modification is completed, run isula commit to save the image, and then push the image to the cloud server so that other nodes can synchronously update the latest image file.

[0065] Furthermore, after the modification is completed, run isula commit to save the new image, and then push the new image to the cloud server so that other nodes can synchronously update the latest image file.

[0066] S109: Configure the SSH key pair of the master node, and copy the SSH key pair to the target node so that the relevant parameter configuration file can be updated using the ansible tool. In specific implementation, the embodiment of the present application can also provide running ssh-keygen-t rsa-b 4096-C to generate an SSH key pair on the master node, and running ssh-copy-id-i~ / .ssh / id_rsa.pub to copy the key to the target node so that the target node can log in to SSH without a password;

[0067] Run ansible all-m ping on the master node to test the ping connection, and run ansible all-mcopy-a to copy the file to all other nodes. This will only replace part of the configuration file. This allows for fast update of parameter files in a low-traffic wireless environment.

[0068] In step S1018 and step S1019, if Figure 1 As shown in the deployment flowchart, the configuration image file can be updated in two ways. Method 1: If you need to make more modifications and updates to the image, you can rewrite the Dockerfile, create a container, upload it to the cloud, and then transmit it to each node. This method has high network requirements. Method 2: If you make fewer changes to the image file or only modify the parameter configuration file, you can use Figure 1 The configuration ansible tool in the update only updates some files. This method has low network requirements and is suitable for fast updates over wireless networks.

[0069] The traditional manual deployment method requires manually installing the operating system, configuring the network environment, and installing the necessary software and libraries on each drone. This method is time-consuming and error-prone, especially when there are a large number of devices. The method provided in this application uses the Isula container engine technology and the Kubernetes container orchestration platform to package the deep learning model and its dependencies into a lightweight Isula image, which supports fast startup and deployment and significantly improves deployment efficiency.

[0070] Different deep learning frameworks and models may depend on different libraries and versions. Manually managing these dependencies is very cumbersome and prone to compatibility issues. Isula images contain all dependencies, avoiding the complexity of manual dependency management and ensuring the consistency and stability of the environment.

[0071] When the model needs to be updated or vulnerabilities need to be fixed, the traditional method requires accessing each device one by one to perform operations, which is inefficient and easy to miss. The method provided in this application combines the Ansible operation and maintenance tool to update only part of the configuration file when a minor version is updated, ensuring that all drones can obtain the latest algorithm models and security patches in a wireless environment in a timely manner.

[0072] In the scenario of swarm drones, the number of drones is gradually increasing and their distribution range is wide, which makes unified management and rapid response more difficult. The method provided in this application realizes centralized management and automated deployment through Isula containers and Ansible operation and maintenance tools, simplifies cluster management, and improves the flexibility and maintainability of the system.

[0073] In traditional methods, the source code of the model and related scripts may be directly exposed on the drone, increasing the risk of source code leakage. The method provided in this application uses PyInstaller to package related scripts into independent executable files, protecting the source code and improving the security of the system.

[0074] In summary, the edge deep learning model deployment and update method provided by this application uses the Isula container engine technology, which is lighter than Docker, to package the deep learning model and its dependencies into a lightweight Isula image. Use the Isula image in combination with the Ansible operation and maintenance tool to update only some configuration files when updating a small version of the deep learning model. Use PyInstaller in the Isula image to package the relevant scripts into independent executable files.

[0075] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0076] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0077] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0078] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A method for deploying and updating a deep learning model at an edge, characterized in that: include: Perform data annotation and model training on a PC to obtain the required deep learning model; Install the hardware dependencies and drivers required for the deployment of each node so that each node can call the hardware environment required by the deep learning model; Write the project dependency file requirements.txt required for the deep learning model and the Dockerfile file of the software installation package, configuration file, environment variables, and entry command required for the project; Use the isula-build plugin to build the Isula image based on the Dockerfile; Upload the container to the cloud and use Kubernetes to distribute the Isula image to each drone cluster node through the cloud server; Instantiate and start the container, and mount the edge NPU device and parameter configuration directory path required by the deep learning model; Check the running status of the container and print logs. Run isula ps to view the running container and container ID. Run isulalogs -fID to view the log information printed by the container execution entry command to diagnose whether the container is running normally. Determine that the Isula image needs to be modified, use a replacement command to replace relevant files, and then generate a new image; Configure the SSH key pair of the master node and copy the SSH key pair to the target node so that you can use the Ansible tool to update the relevant parameter configuration files.

2. The edge end deep learning model deployment and update method according to claim 1 is characterized in that: The project dependency file requirements.txt contains package files required for the deep learning model and network communication.

3. The edge end deep learning model deployment and update method according to claim 1 is characterized in that: The Dockerfile files for writing the software installation packages, configuration files, environment variables, and entry commands required for the project include: Create a Dockerfile file to set up the basic environment, including the installed Python version and working directory; Copy project files into the container and install project dependencies; Use PyInstaller to package the program and mount the project directory using VOLUME.

4. The edge end deep learning model deployment and update method according to claim 1 is characterized in that: Run isula-build ctr-img build-f Dockerfile-o image:tag to build the isula image file. -o is used to specify the generated image name and version number.

5. The edge end deep learning model deployment and update method according to claim 1, characterized in that: Instantiate and start the container, and mount the edge NPU device and parameter configuration directory required for the deep learning model, including: Based on the image file, run the isula run-itd image:tag command to generate a container instance, add --device to specify the external device to be mounted; add —restart=always to enable the node to automatically start the container when it is powered on, add —net host to enable communication between the container and the host, and add -v / home / config_path to mount the relevant parameter directory.

6. The edge end deep learning model deployment and update method according to claim 1, characterized in that: Determine that the project files need to be modified, use the replace command to replace the relevant files, and then generate a new image including: Use isula cp to replace the file, run isula exec-itid bash to enter the container, and delete or query the related files; After the project file is modified, run isula commit to generate a new image; Run isula run to generate a new container instance based on the new image; or, Use isula exec-itID bash to directly enter the container to manually modify or delete the code.

7. The edge end deep learning model deployment and update method according to claim 6, characterized in that: After the modification is completed, run isula commit to save the new image, and then push the new image to the cloud server so that other nodes can synchronously update the latest image file.

8. The edge end deep learning model deployment and update method according to claim 1, characterized in that: Configure the SSH key pair of the master node and copy the SSH key pair to the target node so that you can use the ansible tool to update the relevant parameter configuration files, including: Run ssh-keygen -t rsa -b 4096 -C to generate an SSH key pair on the master node, and run ssh-copy-id -i ~ / .ssh / id_rsa.pub to copy the key to the target node so that the target node can log in to SSH without a password. Run ansible all -m ping on the master node to test the ping connection and run ansible all -m copy -a to copy the file to all other nodes.

9. The edge end deep learning model deployment and update method according to claim 1, characterized in that: Run kebuctl get pod-owide to view the isula image deployment status of all drone nodes that have been connected to the network.

Citation Information

Patent Citations

  • Real-time target detection method and device for unmanned aerial vehicle airborne platform deployment

    CN112013820A

  • Cloud edge collaborative dam detection method and device based on unmanned aerial vehicle platform

    CN115147744A

  • Multi-unmanned aerial vehicle cooperative fan blade positioning and defect detection method and device

    CN117333783A

  • Method for quickly deploying deep learning model file based on docker

    CN116149680A

  • Rapid deployment method for containerized simulation platform

    CN116450153A