Docker container deployment method and system based on deep learning model in numerical control system
By using Docker container technology to deploy deep learning models in CNC systems, the problems of complex deployment processes and insufficient resources are solved, efficient training and deployment of models are achieved, and the machining performance of CNC machine tools is improved.
Patent Information
- Application Number
- CN202210486646.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-06
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2042-05-06
AI Technical Summary
When deploying deep learning models in CNC systems, there are problems such as complex and cumbersome deployment process and insufficient computing resources or training data for deep learning model training.
Docker container technology is adopted to package the training code and environment dependencies of deep learning models into Docker images, and model training and deployment in Docker containers through the computing power resources and processing data provided by the CNC system cloud platform.
The cross-platform and cross-server deployment process of deep learning models is simplified, the problem of insufficient computing power resources or training data is solved, and the machining accuracy, processing speed and reliability of CNC machine tools are improved.
Smart Images

Figure CN114780140B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of numerical control machine tools and intelligent manufacturing, and more specifically, to a Docker container deployment method and system based on a deep learning model in a numerical control system. Background Art
[0002] As an important material of national strategy, CNC machine tools that integrate electromechanical control, network communication, software design and other technologies are an important production pillar of the manufacturing industry and a key equipment for improving product quality and production efficiency. Deep learning, as an important research direction of machine learning, has achieved many results in related fields such as image recognition and natural language processing. As the manufacturing industry continues to develop towards intelligent manufacturing, as the control core of CNC machine tools, CNC systems can apply relevant deep learning models in tasks such as thermal error prediction, tool wear monitoring, and machine tool fault diagnosis to improve the processing accuracy, processing speed and reliability of CNC machine tools and realize the intelligent upgrade of CNC systems.
[0003] However, there are some issues that cannot be ignored when deploying deep learning models in CNC systems. First, due to the diversity of tasks, CNC systems need to support multiple neural network frameworks and toolkits, which makes the deployment process of deep learning models complicated and cumbersome. Second, because deep learning models usually have large number of parameters and computational complexity, and under cost requirements, CNC systems generally have clear performance indicators, and resources such as video memory and memory are limited, which may lead to insufficient computing resources or training data in the training of deep learning models. Summary of the invention
[0004] In view of the above defects or improvement needs of the prior art, the present invention provides a Docker container deployment method and system based on a deep learning model in a numerical control system, which aims to solve the technical problems of complex and cumbersome deep learning model deployment process when deploying deep learning models in numerical control systems, and the technical problems of insufficient computing resources or training data in the training of deep learning models.
[0005] To achieve the above object, according to one aspect of the present invention, a method for deploying a Docker container based on a deep learning model in a numerical control system is provided, comprising the following steps:
[0006] (1) Obtain the training code of the deep learning model to be deployed in the CNC system and the environment dependencies of the training code, and package them together to create a Docker image;
[0007] (2) transferring the Docker image created in step (1) to the CNC system cloud platform, and instantiating the Docker image in the CNC system cloud platform into a Docker container;
[0008] (3) Remotely transmit the processing data of CNC machine tools to the CNC system cloud platform;
[0009] (4) Obtain computing power resources provided by the CNC system cloud platform, and based on the computing power resources and the processing data from the CNC machine tool, train the deep learning model in the Docker container obtained in step (2), and save the trained deep learning model in a serialized format.
[0010] (5) The deep learning model in serialized format obtained in step (4) is remotely transmitted to the CNC system through the CNC system cloud platform.
[0011] Preferably, step (1) specifically includes the following sub-steps:
[0012] (1-1) Obtain a Docker image with a Linux operating system from a Docker repository, and use the Docker image to obtain a Docker container with a Linux operating environment;
[0013] (1-2) Obtain the training code of the deep learning model to be deployed in the CNC system, as well as the environment dependencies of the training code;
[0014] (1-3) According to the environment dependency of the training code obtained in step (1-2), the neural network framework and toolkit required for deep learning model training are installed in the Docker container created in step (1-1), and scripts for running and testing the deep learning model are added to the Docker container, thereby obtaining an updated Docker container;
[0015] (1-4) Package the updated Docker container in step (1-3) into a Docker image;
[0016] Preferably, step (2) is to use Docker's container generation command (docker create command) to instantiate the Docker image into a Docker container.
[0017] Preferably, the computing resources specifically include a central processing unit (CPU), a graphics processing unit (GPU), and a tensor processing unit (TPU).
[0018] Preferably, the process of training the deep learning model in the Docker container in step (4) includes the following sub-steps:
[0019] (4-1) Through the data copy command (docker cp command) between the Docker container obtained in step (2) and the CNC system cloud platform, the training data of the deep learning model is loaded into the Docker container obtained in step (2).
[0020] (4-2) Start and connect to the Docker container obtained in step (2) through the Docker container startup command (docker start command) and connection command (docker attach).
[0021] (4-3) Add a script for running and testing the deep learning model through step (1-3), train the deep learning model using the training data obtained in step (4-1), and save the trained deep learning model in a serialized format.
[0022] According to another aspect of the present invention, a Docker container deployment system based on a deep learning model in a numerical control system is provided, comprising:
[0023] The first module is used to obtain the training code of the deep learning model that needs to be deployed in the CNC system and the environment dependencies of the training code, and package the two to create a Docker image;
[0024] The second module is used to transfer the Docker image created in the first module to the CNC system cloud platform, and instantiate the Docker image in the CNC system cloud platform into a Docker container;
[0025] The third module is used to remotely transmit the processing data of CNC machine tools to the CNC system cloud platform;
[0026] The fourth module is used to obtain the computing power resources provided by the CNC system cloud platform, and based on the computing power resources and the processing data from the CNC machine tool, train the deep learning model in the Docker container obtained in the second module, and save the trained deep learning model in a serialized format.
[0027] The fifth module is used to remotely transmit the deep learning model in serialized format obtained by the fourth module to the CNC system through the CNC system cloud platform.
[0028] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:
[0029] (1) Due to the adoption of step (1), the present invention packages the training code of the deep learning model and the environment dependencies of the training code into a lightweight, portable Docker container, thereby solving the complex and cumbersome technical problem of cross-platform and cross-server deployment of the deep learning model;
[0030] (2) Since the present invention adopts steps (3) and (4), the processing data of multiple CNC machine tools and the computing power resources of the CNC system cloud platform are provided for the training of the deep learning model, thereby solving the problem of insufficient computing power resources or training data that may exist in the CNC system;
[0031] (3) The method of the present invention combines the idea of transfer learning and can simply and effectively complete the training and deployment of deep learning models to improve the processing accuracy, processing speed and reliability of CNC machine tools. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a flow chart of the Docker container deployment method based on the deep learning model in the numerical control system of the present invention. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention 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 invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0034] The basic idea of the present invention is to combine Docker technology and the CNC system cloud platform to simply and effectively implement the deployment of deep learning models and solve the problem of insufficient computing resources or training data in the CNC system.
[0035] like Figure 1 As shown, the present invention provides a Docker container deployment method based on a deep learning model in a numerical control system, comprising the following steps:
[0036] (1) Obtain the training code of the deep learning model to be deployed in the CNC system and the environment dependencies of the training code, and package them together to create a Docker image;
[0037] This step specifically includes the following sub-steps:
[0038] (1-1) Obtain a Docker image with a Linux operating system from a Docker repository, and use the Docker image to obtain a Docker container with a Linux operating environment;
[0039] Specifically, Docker is an open source application container engine based on the Go language, which can deploy applications efficiently, agilely and automatically, and is lightweight, open standard, safe and reliable. Developers can encapsulate applications or services and related dependencies into Docker images, and then install and run them on any physical device (Linux, Windows, etc.) to achieve virtualization.
[0040] The advantage of this step is that the Docker container provides a lightweight Linux operating environment with low resource usage and fast startup speed.
[0041] (1-2) Obtain the training code of the deep learning model to be deployed in the CNC system, as well as the environment dependencies of the training code;
[0042] Specifically, deep learning has many applications in CNC systems, such as thermal error prediction, tool wear monitoring, machine tool fault diagnosis, etc. Different application scenarios require the use of different deep learning models (such as DNN, RNN, CNN, etc.), and therefore require different environmental dependencies.
[0043] Specifically, this step includes: first, determining the required deep learning model according to the application scenario; then, obtaining the training code of the deep learning model; and finally, determining the required environmental dependency according to the training code of the deep learning model.
[0044] (1-3) According to the environment dependency of the training code obtained in step (1-2), the neural network framework and toolkit required for deep learning model training are installed in the Docker container created in step (1-1), and scripts for running and testing the deep learning model are added to the Docker container, thereby obtaining an updated Docker container;
[0045] (1-4) Package the updated Docker container in step (1-3) into a Docker image.
[0046] The advantage of the above steps (1-1) to (1-4) is that the training code of the deep learning model and the environmental dependencies of the training code are packaged into a lightweight, portable Docker container, solving the cross-platform and cross-server deployment problem of the deep learning model.
[0047] (2) transferring the Docker image created in step (1) to the CNC system cloud platform, and instantiating the Docker image in the CNC system cloud platform into a Docker container;
[0048] Specifically, this step uses the Docker container generation command (docker create command) to instantiate the Docker image into a Docker container.
[0049] (3) Remotely transmit the processing data of CNC machine tools to the CNC system cloud platform;
[0050] The advantage of this step is that the processing data of multiple CNC machine tools can provide large-scale training data for the deep learning model, solving the problem of insufficient training data for the deep learning model in the CNC system.
[0051] (4) Obtain computing resources provided by the CNC system cloud platform, and based on the computing resources and the processing data from the CNC machine tool, train the deep learning model in the Docker container obtained in step (2), and save the trained deep learning model in a serialized format;
[0052] Specifically, computing resources include central processing unit (CPU), graphics processing unit (GPU), tensor processing unit (TPU), etc.
[0053] The advantage of this step is that the CNC system cloud platform can provide certain computing resources for the deep learning model, solving the problem of insufficient computing resources for the deep learning model in the CNC system.
[0054] The process of training a deep learning model in a Docker container in this step includes the following sub-steps:
[0055] (4-1) Through the data copy command (docker cp command) between the Docker container obtained in step (2) and the CNC system cloud platform, the training data of the deep learning model is loaded into the Docker container obtained in step (2).
[0056] (4-2) Start and connect to the Docker container obtained in step (2) through the Docker container startup command (docker start command) and connection command (docker attach).
[0057] (4-3) Add a script for running and testing the deep learning model through step (1-3), train the deep learning model using the training data obtained in step (4-1), and save the trained deep learning model in a serialized format.
[0058] In this step, saving the deep learning model in a serialized format means saving the overall structure and weight parameters of the trained deep learning model from the running memory of the CNC system cloud platform to the physical memory to achieve persistence of the deep learning model.
[0059] (5) The deep learning model in serialized format obtained in step (4) is remotely transmitted to the CNC system through the CNC system cloud platform.
[0060] Through the above steps, the training task of the deep learning model in the CNC system cloud platform is finally completed and successfully deployed to the CNC system. The CNC system can run the deep learning model with the help of the Neural-network Processing Unit (NPU) to improve the processing accuracy, processing speed and reliability of CNC machine tools.
[0061] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A Docker container deployment method based on a deep learning model in a numerical control system, characterized in that: The following steps are involved: (1) Obtain the training code of the deep learning model to be deployed in the CNC system and the environment dependencies of the training code, and package them together to create a Docker image; (2) The Docker image created in step (1) is transferred to the CNC system cloud platform, and the Docker image in the CNC system cloud platform is instantiated as a Docker container; step (1) specifically includes the following sub-steps: (1-1) Obtain a Docker image with a Linux operating system from a Docker repository, and use the Docker image to obtain a Docker container with a Linux operating environment; (1-2) Obtain the training code of the deep learning model to be deployed in the CNC system, as well as the environment dependencies of the training code; (1-3) According to the environment dependency of the training code obtained in step (1-2), the neural network framework and toolkit required for deep learning model training are installed in the Docker container created in step (1-1), and scripts for running and testing the deep learning model are added to the Docker container, thereby obtaining an updated Docker container; (1-4) Package the updated Docker container in step (1-3) into a Docker image; (3) Remotely transmit the processing data of CNC machine tools to the CNC system cloud platform; (4) Obtain computing power resources provided by the CNC system cloud platform, and based on the computing power resources and the processing data from the CNC machine tool, train the deep learning model in the Docker container obtained in step (2), and save the trained deep learning model in a serialized format; the process of training the deep learning model in the Docker container in step (4) includes the following sub-steps: (4-1) Loading the training data of the deep learning model into the Docker container obtained in step (2) through the data copy command between the Docker container obtained in step (2) and the CNC system cloud platform; (4-2) Start and connect to the Docker container obtained in step (2) using the Docker container start command and connection command; (4-3) adding a script for running and testing the deep learning model through step (1-3), training the deep learning model using the training data obtained in step (4-1), and saving the trained deep learning model in a serialized format; (5) The deep learning model in serialized format obtained in step (4) is remotely transmitted to the CNC system through the CNC system cloud platform.
2. The Docker container deployment method based on the deep learning model in the numerical control system according to claim 1 is characterized in that: Step (2) is to use Docker's container generation command to instantiate the Docker image into a Docker container.
3. The Docker container deployment method based on the deep learning model in the numerical control system according to claim 2 is characterized in that: Computing resources specifically include central processing unit CPU, graphics processing unit GPU, and tensor processing unit TPU.
4. A Docker container deployment system based on a deep learning model in a numerical control system, which is applied in the Docker container deployment method based on a deep learning model in a numerical control system according to any one of claims 1 to 3, characterized in that: include: The first module is used to obtain the training code of the deep learning model that needs to be deployed in the CNC system and the environment dependencies of the training code, and package the two to create a Docker image; The second module is used to transfer the Docker image created in the first module to the CNC system cloud platform, and instantiate the Docker image in the CNC system cloud platform into a Docker container; The third module is used to remotely transmit the processing data of CNC machine tools to the CNC system cloud platform; The fourth module is used to obtain the computing power resources provided by the CNC system cloud platform, and based on the computing power resources and the processing data from the CNC machine tool, train the deep learning model in the Docker container obtained in the second module, and save the trained deep learning model in a serialized format; The fifth module is used to remotely transmit the deep learning model in serialized format obtained by the fourth module to the CNC system through the CNC system cloud platform.
Citation Information
Patent Citations
A method and an apparatus for creating containers for in-depth learning jobs
CN108958892A
Neural network transfer learning automatic training scheduling method based on ONNX model
CN111539527A