Method and system for managing edge gateway based on application container engine cloud
Through the cloud management method based on the application container engine, it is difficult to effectively handle the problem of marginal network equipment data and high maintenance costs based on the application container engine, realize the dynamic configuration of remote management and application of marginal gateways, reduce costs and improve flexibility.
Patent Information
- Application Number
- CN202411502743.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-01-21
AI Technical Summary
Traditional centralized data processing methods based on cloud services are difficult to effectively process massive data generated by edge network devices, and the diversity of edge computing services and device heterogeneous protocols lead to high maintenance costs for equipment and programs.
Adopt a cloud management method based on the application container engine, upload the edge gateway engine through the Docker image warehouse, and operate it in the background of the cloud platform. Issue the installation command and the edge gateway engine calls Docker to pull the image, build and run the container, and realize the edge gateway Remote management and dynamic configuration of applications.
The restrictions on field personalized installation have been eliminated, the cost of operation and maintenance is reduced, the flexibility and versatility of deployment are improved, and the implementation and operation and maintenance costs in the deployment process are significantly reduced.
Smart Images

Figure CN119341907A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of remote management and maintenance of the Internet of Things, and specifically relates to a method and system for managing an edge gateway based on a cloud-based application container engine. Background Art
[0002] With the rapid increase in the number of IoT terminal devices, the traditional centralized data processing method based on cloud services can no longer effectively process the massive data generated by edge network devices due to the limited network bandwidth, high transmission costs and high response delays. In addition, the data reported by edge devices is diverse in form, structure and content, making it difficult for cloud services to process them uniformly. The application scenarios of edge computing are very complex. Different from traditional hardware gateways, it is necessary to provide customized and diversified computing capabilities. The diversity of required development tools and programming languages has led to the flourishing of computer programming technologies and the inability to form a unified standard. The heterogeneous protocols of device terminals and the diversity of edge computing services also lead to high costs for equipment and program maintenance.
[0003] There are at least some shortcomings in the traditional implementation and operation and maintenance methods: 1. Engineers need to perform personalized installation at the equipment site. For service providers providing cloud platforms, they need to travel long distances to the customer site, which is not only inefficient but also costly to implement and maintain.
[0004] 2. During operation, once the on-site hardware is adjusted, the collection rules also need to be adjusted accordingly. At this time, new software needs to be redeveloped for adaptation. The debugging process is cumbersome and needs to be performed on-site, which also pushes up the implementation and maintenance costs and is not conducive to large-scale implementation and updating.
[0005] 3. For traditional installation methods, when engineers install edge computing services, problems such as omissions or conflicts in the installation of dependency packages may occur, which may cause unstable system operation or failures.
[0006] 4. When the edge computing solution needs to be adjusted, such as adding collected data, this process often requires developers to rewrite the source code of the application and then rebuild the application container. In this process, the old container needs to be destroyed and the updated version needs to be reinstalled on its basis to perform the new computing task. This method of adjusting the solution is not only time-consuming and labor-intensive, but also accompanied by high cost expenditures. This obviously poses a considerable challenge in the face of the rapidly changing market environment and customer needs, and is not conducive to enterprises to quickly respond to and meet the needs of the market and customers.
[0007] As IoT technology continues to advance, those skilled in the art must seek innovative solutions to meet the growing challenges. To this end, it is necessary to develop a new technical solution that aims to eliminate the limitations of on-site personalized installation. The solution should increase the flexibility of deployment, enhance its adaptability and universal applicability, and thus significantly reduce the costs during implementation and operation and maintenance. Summary of the invention
[0008] In view of the shortcomings of the current related existing technologies, the present invention provides a method for cloud-based management of edge gateways based on an application container engine, which can overcome the limitations of on-site personalized installation; there is no need to pay attention to complex dependencies, thereby reducing operation and maintenance costs and improving deployment flexibility; there is no need for coding development, which further enhances the flexibility and versatility of the system; this method significantly reduces the implementation and operation and maintenance costs during the deployment process.
[0009] To achieve the above object, the first aspect of the present invention provides a method for managing an edge gateway based on an application container engine cloud, comprising at least the following steps: Step S1: Upload the edge gateway engine to the Docker image repository and install Docker and edge gateway engine services for the edge gateway device; Step S2: Generate an application image and upload it to a private warehouse. Create an image file for the application to be deployed to the edge gateway and upload it to a private Docker warehouse for storage. Step S3: Install the application and operate in the panel of the cloud platform background. The cloud platform sends the installation command according to the configuration, and the edge gateway engine calls Docker to pull the image, build and run the container; Step S4: Manage applications, decouple application installation and configuration, and be able to execute container shutdown and update operations; it can also send down configurations to change the algorithm rules of the program running in the container, realizing functions that the container management platform does not have.
[0010] Further, in step S1, the following steps are also included: initializing the device, after the edge gateway service is running, the device heartbeat data will be reported, and the cloud platform will display the device information on the front end after persisting the device information; In step S1, the step of initializing the edge gateway engine is also included, which is as follows: before the edge gateway device is put into use, the Docker service is installed for the edge gateway and the edge gateway engine is run; When running the edge gateway engine using the command docker run, mount the Docker daemon process of the host machine to the edge gateway engine to enable the edge gateway engine to manage the applications in the edge gateway; After the edge gateway is started, the device information will be reported to the cloud platform through heartbeat. After being persisted by the cloud platform, it can be displayed and interacted with on the front end of the cloud platform background.
[0011] Furthermore, step S3 at least includes the following steps: operating configuration at the front end of the cloud platform; after the backend generates instructions, when the device reports heartbeat data, sending it to the device as a response; The edge gateway engine calls the Docker client to pull the edge gateway service image from the image repository, performs port mapping and directory mounting according to the information in the installation instructions, and starts the service after building it into a container.
[0012] Furthermore, in step S4, initialization / update configuration at least includes: operating configuration on the cloud platform panel, generating instructions in the background and sending them to the edge gateway engine, the execution of the gateway management instructions in the application, and real-time feedback to the cloud platform, which is forwarded to the specific application by the edge gateway engine, and the application dynamically provides customized services based on the configuration parameters.
[0013] Furthermore, in step S4, the specific steps of issuing the configuration at least include: S41. Perform operations in the interface of the cloud platform background to configure the relevant information of the application, including the collection points, and then asynchronously transmit the configuration information to the edge gateway; this process is not synchronized with the operation of the edge gateway engine receiving the configuration.
[0014] S42. The edge gateway engine will periodically send heartbeat data to the upper-level cloud platform to confirm its operating status; if there are tasks in the cloud platform that have been issued but have not yet been confirmed to be received by the edge gateway, these tasks will be sent to the edge gateway engine again as a response; after receiving these instructions, the edge gateway engine will pass them to the built-in instruction parsing module for processing; the parsing module will identify the configuration instructions, parse them, and then send the parsed configuration information to the corresponding application.
[0015] S43. After receiving the configuration information, the application initializes the system information according to the configuration information and adjusts the calculation rules of data collection and data decoding according to the configuration requirements; after completing these configurations, the application will report the relevant information to the cloud platform through the MQTT protocol.
[0016] Furthermore, the method is used to interact with the cloud platform to manage the edge gateway and the applications therein, and it also includes the following process: Step 1: Initialize the database connection; use the SQLite lightweight database for configuration. This database is responsible for persisting gateway and application related data, including task information, application configuration and target status; when the edge gateway engine is restarted, the edge gateway and application status can be automatically adjusted according to the persisted data.
[0017] Step 2: Start and initialize the HTTP service; This service is designed to register the status when the application starts and perform the initial configuration delivery; Step 3: Initialize the Docker client using the Docker API.
[0018] Using the Docker client, the edge gateway service can send commands such as creating containers and removing containers to Docker to implement container management operations such as installing, uninstalling, restarting, and monitoring the running status of applications; Step 4: Register the edge gateway information to the cloud platform; this step is used to obtain a communication key from the cloud platform, which is used to subsequently send heartbeat data to the cloud platform and obtain task information from the cloud platform.
[0019] Step 5: Send heartbeat data in a regular cycle; This information is used to notify the cloud platform that the gateway is online and provide the gateway's current device status information. At the same time, if the cloud platform has unsent tasks, the cloud platform can put the task information in the response and send it to the edge gateway engine. After receiving the task, the edge gateway engine provides the task information to another thread to execute step 6 to avoid affecting the heartbeat report; Step 6: Execute the cloud platform task. When receiving the task, first persist the task information to the database. The persisted task information can be added to the task queue and re-executed during the initialization process. When the task is completed, the task execution result is sent to the cloud platform.
[0020] Furthermore, when running the edge gateway engine with docker run, you need to use the "-v / var / run / docker.sock: / var / run / docker.sock" option to mount the host's Docker daemon process to the edge gateway engine, so that the edge gateway engine can manage the applications in the edge gateway. At the same time, the docker run edge gateway engine should be run with the "--restart=always" option to ensure that it can automatically restart when it is shut down.
[0021] Furthermore, the task information sent by the cloud platform contains a "task type" (type) field, which is used to identify the type of the task information; tasks are processed differently according to the task type; when fewer task types are supported, switch-case conditional statements can be used for simple processing; when there are more task types, a hash table should be used to point to different processing logics.
[0022] A second aspect of the present invention provides a system for managing edge gateways based on an application container engine cloud, the system being used to implement the above method; At least includes edge module, heartbeat module and task module; The edge module is responsible for maintaining the state of the edge gateway engine itself, including initializing and managing the Docker client and checking for updates; The heartbeat module is responsible for the interaction with the cloud platform, including reporting of device heartbeat data, receiving tasks on the cloud platform, and reporting of task results; The task module is responsible for executing tasks and recovering unfinished task data before the engine is shut down.
[0023] Furthermore, the main steps in the system are as follows: Device initialization: First, upload the edge gateway engine to the Docker image repository; when you want to initialize the device, create the edge gateway information on the cloud platform, get the edge gateway initialization instructions, and install Docker and edge gateway engine services for the edge gateway device according to the instructions; after the edge gateway service is started, the device heartbeat data will be reported, and the cloud platform can display the device status information; Issue installation instructions: configure the application on the cloud platform; after the background generates instructions, when the device reports heartbeat data, it is sent to the device as a response; Install the application: The edge gateway engine calls the Docker command to pull the edge gateway service image from the image repository, performs port mapping and directory mounting according to the information in the installation instructions, and starts the service after building it into a container; Initialize / update configuration: Configure operations on the cloud platform panel. After the background generates instructions, they are sent to the edge gateway engine. The gateway manages the execution of instructions in the application and provides real-time feedback to the cloud platform. The edge gateway engine forwards them to specific applications, and the application dynamically provides customized services based on the configuration parameters.
[0024] The present invention uses the operation in the panel of the cloud platform background. After the operation is completed, the cloud platform sends the installation command according to the configuration, and the edge gateway engine calls Docker to pull the image, build and run the container; the installation of the application and its specific configuration management functions are decoupled, and the operation at least includes one or more operations of executing container shutdown, updating and sending configuration. It has at least the following beneficial effects: The present invention can eliminate the limitations of on-site personalized installation. With this technical solution, engineers can implement one-click installation service operations for edge gateways and configure corresponding service parameters without having to worry about specific dependencies. When the acquisition or edge computing requirements change, there is no need to rewrite the application, only reconfigure the edge service, and no coding development is required, which improves flexibility and versatility. The development, implementation, and operation and maintenance costs generated by development and deployment are greatly reduced.
[0025] When the collection or edge computing requirements change, engineers do not need to rewrite the application, but only need to reconfigure the edge service without complex coding development. This not only improves the flexibility and versatility of the system, but also significantly reduces the implementation and operation costs incurred during the deployment process.
[0026] 3. By taking advantage of edge-cloud collaboration, the present invention can avoid the problem that engineers must go to the site to manage the edge gateway, thereby eliminating the limitation of on-site personalized installation. This remote management method not only improves work efficiency, but also reduces the additional costs incurred by on-site operations.
[0027] 4. By using Docker containerized deployment, the present invention reduces the complicated dependent installation steps, thereby reducing operation and maintenance costs and improving deployment flexibility. Containerization technology makes service deployment and migration simpler and faster, greatly improving the maintainability and scalability of the system.
[0028] 5. Dynamic configuration management technology for edge devices: The edge computing engine can receive and apply the configuration information issued by the cloud platform in real time, and dynamically modify the computing logic of the application. Remote instruction issuance technology of the cloud platform: Using the cloud platform, configuration information can be issued remotely, and new instructions can be quickly transmitted and applied. By issuing configurations in the form of instructions, the present invention reduces the problem of recoding and deployment when fine-tuning the acquisition and computing logic, thereby reducing development costs. By issuing configurations through instructions, more implementation and operation and maintenance functions can be realized, with high scalability and efficient operation and maintenance characteristics, which significantly reduces implementation costs.
[0029] 6. The combination of multiple technologies brings about effects that cannot be achieved by a single technology: The method provided by this patent can at least achieve the following effects; Real-time collaborative optimization: The cloud platform can collect data from different edge gateways, conduct global analysis, generate optimization strategies, and instantly distribute and apply them through dynamic configuration management technology to achieve real-time optimization and strategy adjustment from a global perspective.
[0030] Agile response and efficient updates: Combining the remote command issuance of the cloud platform and the dynamic configuration management of edge devices, the system can quickly respond to changing needs and perform efficient logic updates without reinstalling services.
[0031] Reduce maintenance time and costs: Through remote configuration and instant application, there is no need to dispatch on-site technicians to operate, which reduces maintenance time and costs and improves the efficiency and economy of system implementation, operation and maintenance.
[0032] The dynamic configuration management technology of edge devices in the present invention: the edge computing engine can receive and apply the configuration information issued by the cloud platform in real time, dynamically modify the computing logic of the application, and reduce the problem of fine-tuning the collection and re-encoding and deployment of the computing logic. By issuing instructions, more implementation and operation and maintenance functions can be realized, which has the characteristics of high scalability, more efficient operation and maintenance, and low implementation cost. 7. The traditional application update method is implemented by installing an update image, which requires uninstalling the old version and installing a new image. The process is cumbersome and easily leads to service interruption. The dynamic configuration management technology in this patent uses a set of customized specification description languages to uniformly describe the extension and dynamic configuration items of the application, and realizes real-time adjustment of application functions through cross-platform data interaction. This dynamic adjustment method not only avoids service interruption, but also significantly improves the flexibility and response speed of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] 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 or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 It is a flow chart of the method for managing edge gateway based on the application container engine cloud of the present invention; Figure 2 It is a business flow chart of the present invention based on the application container engine cloud management edge gateway; Figure 3 It is a schematic diagram of the system architecture of the present invention based on the application container engine cloud management edge gateway; Figure 4 It is a main flow chart of the implementation method of the edge gateway engine of the present invention. DETAILED DESCRIPTION
[0035] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0036] Glossary Docker: An open source application container engine that allows developers to package their applications and dependencies into a portable container and then publish it to any machine running any popular Linux or Windows operating system.
[0037] Container: A lightweight and portable virtualization technology that packages an application and its associated dependencies in a self-contained, portable unit. The container contains the necessary elements for the smooth execution of the application, such as code, environment variables, processes and execution environment, and software dependencies. Containers are similar to containers used in the transportation industry, which can isolate different goods for transportation. Containers isolate applications and their dependencies so that they can run in different environments.
[0038] Heartbeat: refers to the periodic transmission of information between the main server and each device in industrial equipment monitoring to determine the health status of the equipment and whether the other party is "alive".
[0039] Edge Gateway: A device that integrates hardware and software, including hardware-level devices, edge gateway engines and applications at the software level. It is used to connect terminal devices and cloud servers, collect data from terminal devices, process and store it, and send processed and packaged data to cloud servers.
[0040] Edge computing: refers to the use of an open platform that integrates network, computing, storage, and application core capabilities to provide the nearest end service on the side close to the object or data source. Its application is initiated on the edge side, resulting in faster network service response, meeting the basic needs of the industry in terms of real-time business, application intelligence, security and privacy protection, etc.
[0041] Edge gateway engine: An edge gateway management service written based on the standard of this invention, which can interact with the cloud platform to manage the edge gateway and the applications therein.
[0042] Application: An application program, in this article, specifically refers to an application program that can adjust its operating logic according to the application configuration, mainly an edge computing service, which is used to collect data, perform calculations and processing, and report data.
[0043] Application configuration: Necessary information for application operation, such as device data collection points, calculation parameters and logic, and calculation result reporting address.
[0044] like Figures 1 to 4 As shown, the first aspect of this embodiment provides a method for managing an edge gateway based on an application container engine cloud, comprising at least the following steps: Step S1: Upload the edge gateway engine to the Docker image repository and install Docker and edge gateway engine services for the edge gateway device; Step S2: Generate an application image and upload it to a private warehouse. Create an image file for the application to be deployed to the edge gateway and upload it to a private Docker warehouse for storage. Step S3: Install the application and operate in the panel of the cloud platform background. The cloud platform sends the installation command according to the configuration, and the edge gateway engine calls Docker to pull the image, build and run the container; Step S4: Manage applications, decouple application installation and configuration, and be able to execute container shutdown and update operations; it can also send down configurations to change the algorithm rules of the program running in the container, realizing functions that the container management platform does not have.
[0045] As a preferred implementation, in step S1 of this embodiment, the following steps are also included: initializing the device, and after the edge gateway service is running, the device heartbeat data will be reported; after the edge gateway service is running, the device heartbeat data will be reported, and the cloud platform will persist the device information and then display the device information on the front end; In step S1, the step of initializing the edge gateway engine is also included, which is as follows: before the edge gateway device is put into use, the Docker service is installed for the edge gateway and the edge gateway engine is run; When running the edge gateway engine using the command docker run, mount the Docker daemon process of the host machine to the edge gateway engine to enable the edge gateway engine to manage the applications in the edge gateway; After the edge gateway is started, the device information will be reported to the cloud platform through heartbeat. After being persisted by the cloud platform, it can be displayed and interacted with on the front end of the cloud platform background.
[0046] As a preferred implementation, in step S3 of this embodiment, at least the following steps are included: operating configuration at the front end of the cloud platform; after the backend generates instructions, when the device reports heartbeat data, sending it to the device as a response; The edge gateway engine calls the Docker client to pull the edge gateway service image from the image repository, performs port mapping and directory mounting according to the information in the installation instructions, and starts the service after building it into a container.
[0047] As a preferred implementation, in step S4 of this embodiment, initialization / update configuration at least includes: operating configuration on the cloud platform panel, generating instructions in the background and sending them to the edge gateway engine, the execution of the gateway management instructions in the application, and real-time feedback to the cloud platform, which is forwarded to the specific application by the edge gateway engine, and the application dynamically provides customized services based on the configuration parameters.
[0048] As a preferred implementation, in step S4 of this embodiment, the specific steps of issuing the configuration at least include: S41. Perform operations in the interface of the cloud platform background to configure the relevant information of the application, including the collection points, and then asynchronously transmit the configuration information to the edge gateway; this process is not synchronized with the operation of the edge gateway engine receiving the configuration.
[0049] S42. The edge gateway engine will periodically send heartbeat data to the upper-level cloud platform to confirm its operating status; if there are tasks in the cloud platform that have been issued but have not yet been confirmed to be received by the edge gateway, these tasks will be sent to the edge gateway engine again as a response; after receiving these instructions, the edge gateway engine will pass them to the built-in instruction parsing module for processing; the parsing module will identify the configuration instructions, parse them, and then send the parsed configuration information to the corresponding application.
[0050] S43. After receiving the configuration information, the application initializes the system information according to the configuration information and adjusts the calculation rules of data collection and data decoding according to the configuration requirements; after completing these configurations, the application will report the relevant information to the cloud platform through the MQTT protocol.
[0051] like Figure 2 As shown, as a preferred implementation, the method described in this embodiment is used to interact with the cloud platform to manage the edge gateway and the applications therein, which also includes the following process: Step 1: Initialize the database connection; use the SQLite lightweight database for configuration. This database is responsible for persisting gateway and application related data, including task information, application configuration and target status; when the edge gateway engine is restarted, the edge gateway and application status can be automatically adjusted according to the persisted data.
[0052] Step 2: Start and initialize the HTTP service; This service is designed to register the status when the application starts and perform the initial configuration delivery; Step 3: Initialize the Docker client using the Docker API.
[0053] Using the Docker client, the edge gateway service can send commands such as creating containers and removing containers to Docker to implement container management operations such as installing, uninstalling, restarting, and monitoring the running status of applications; Step 4: Register the edge gateway information to the cloud platform; this step is used to obtain a communication key from the cloud platform, which is used to subsequently send heartbeat data to the cloud platform and obtain task information from the cloud platform.
[0054] Furthermore, when running the edge gateway engine with docker run, you need to use the "-v / var / run / docker.sock: / var / run / docker.sock" option to mount the host's Docker daemon process to the edge gateway engine, so that the edge gateway engine can manage the applications in the edge gateway. At the same time, the docker run edge gateway engine should be run with the "--restart=always" option to ensure that it can automatically restart when it is shut down.
[0055] Step 5: Send heartbeat data in a regular cycle; This information is used to notify the cloud platform that the gateway is online and provide the gateway's current device status information. At the same time, if the cloud platform has unsent tasks, the cloud platform can put the task information in the response and send it to the edge gateway engine. After receiving the task, the edge gateway engine provides the task information to another thread to execute step 6 to avoid affecting the heartbeat report; Step 6: Execute the cloud platform task. When receiving the task, first persist the task information to the database. The persisted task information can be added to the task queue and re-executed during the initialization process. When the task is completed, the task execution result is sent to the cloud platform.
[0056] Furthermore, the task information sent by the cloud platform contains a "task type" (type) field, which is used to identify the type of the task information; tasks are processed differently according to the task type; when fewer task types are supported, switch-case conditional statements can be used for simple processing; when there are more task types, a hash table should be used to point to different processing logics.
[0057] like Figure 2 As shown in , this embodiment includes steps of some important task types: App Installation Docker application installation: The platform issues an "application installation" instruction, which includes "task type" as "application installation" and application installation task parameters, such as "image address" and "mapped port".
[0058] The edge gateway passes the task information to the "application installation" processing module.
[0059] Call the Docker client and install the corresponding application according to the task parameters.
[0060] Database persistence of application information: Application information, such as container identifiers, is persisted in the database.
[0061] Start the application (edge computing service).
[0062] Send application configuration Database query application container identifier: The platform issues a "Send application configuration" instruction, which includes "Task type" as "Send application configuration" and the configuration that needs to be sent to the application.
[0063] The edge gateway passes the task information to the "dispatching application configuration" processing module.
[0064] Docker query application container IP: Find the application container ID from the database, and use the Docker client to find out its container IP based on the table ID.
[0065] HTTP application configuration delivery: The application configuration is sent to the corresponding application through an HTTP request.
[0066] 2.4 Database deletion task information.
[0067] like Figure 3 and Figure 4 As shown, the second aspect of the present invention provides a system for managing edge gateways based on an application container engine cloud, and the system is used to implement the above method; At least includes edge module, heartbeat module and task module; The edge module is responsible for maintaining the state of the edge gateway engine itself, including initializing and managing the Docker client and checking for updates; The heartbeat module is responsible for the interaction with the cloud platform, including reporting of device heartbeat data, receiving tasks on the cloud platform, and reporting of task results; The task module is responsible for executing tasks and recovering unfinished task data before the engine is shut down.
[0068] like Figure 4 As shown, the main steps of this embodiment are as follows: Device initialization (edge gateway management): First, upload the edge gateway engine to the Docker image repository. To initialize the device, create the edge gateway information on the cloud platform, get the edge gateway initialization guide, and install Docker and the edge gateway engine service for the edge gateway device according to the guide. After the edge gateway service is started, the device heartbeat data will be reported, and the cloud platform can display information such as the device status.
[0069] Send installation instructions: Configure the application on the cloud platform. After the background generates instructions, when the device reports heartbeat data, it is sent to the device as a response. This step can also be sent using MQTT, and the edge gateway engine receives the corresponding operation instructions, which can have higher real-time performance.
[0070] Install applications (container management): The edge gateway engine calls the Docker command to pull the edge gateway service image from the image repository, performs port mapping and directory mounting according to the information in the installation instructions, and starts the service after building it into a container.
[0071] Initialize / update configuration (application configuration management): Operate configuration on the cloud platform panel, generate instructions in the background and send them to the edge gateway engine. The gateway manages the execution of instructions in the application and provides real-time feedback to the cloud platform. The edge gateway engine forwards them to specific applications, and the application dynamically provides customized services based on the configuration parameters.
[0072] In this embodiment, the organic combination of multiple technologies produces an effect that cannot be achieved by a single technology. Specifically, the following key advantages are achieved: Real-time collaborative optimization: The cloud platform can collect data from different edge gateways, conduct global analysis, generate optimization strategies, and instantly distribute and apply them through dynamic configuration management technology to achieve real-time optimization and strategy adjustment from a global perspective.
[0073] Agile response and efficient updates: Combining the remote command issuance of the cloud platform and the dynamic configuration management of edge devices, the system can quickly respond to changing needs and perform efficient logic updates without reinstalling services.
[0074] Reduce maintenance time and costs: Through remote configuration and instant application, there is no need to dispatch on-site technicians to operate, which reduces maintenance time and costs and improves the efficiency and economy of system implementation, operation and maintenance.
[0075] The traditional application update method is to install an updated image, which requires uninstalling the old version and installing a new image. The process is cumbersome and easily leads to service interruption. The dynamic configuration management technology in this patent uses a set of customized specification description languages to uniformly describe the extension and dynamic configuration items of the application, and realizes real-time adjustment of application functions through cross-platform data interaction. This dynamic adjustment method not only avoids service interruption, but also significantly improves the flexibility and response speed of the system.
[0076] Although the embodiments of the present invention have been shown and described above, it will be appreciated that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, substitute and vary the above embodiments within the scope of the present invention.
Claims
1. A method for managing edge gateways based on an application container engine cloud, characterized in that: At least the following steps are included: Step S1: Upload the edge gateway engine to the Docker image repository and install Docker and edge gateway engine services for the edge gateway device; Step S2: Generate an application image and upload it to a private warehouse. Create an image file for the application to be deployed to the edge gateway and upload it to a private Docker warehouse for storage. Step S3: Install the application and operate in the panel of the cloud platform background. The cloud platform sends the installation command according to the configuration, and the edge gateway engine calls Docker to pull the image, build and run the container; Step S4: Manage applications, decouple application installation and configuration, and be able to execute container shutdown and update operations; it can also send down configurations to change the algorithm rules of the program running in the container, realizing functions that the container management platform does not have.
2. The method according to claim 1, characterized in that: In step S1, the following steps are also included: initializing the device, and after the edge gateway service is running, the device heartbeat data will be reported; after the edge gateway service is running, the device heartbeat data will be reported, and the cloud platform will persist the device information and display the device information on the front end; In step S1, the step of initializing the edge gateway engine is also included, which is as follows: before the edge gateway device is put into use, the Docker service is installed for the edge gateway and the edge gateway engine is run; When running the edge gateway engine using the command docker run, mount the Docker daemon process of the host machine to the edge gateway engine to enable the edge gateway engine to manage the applications in the edge gateway; After the edge gateway is started, the device information will be reported to the cloud platform through heartbeat. After being persisted by the cloud platform, it can be displayed and interacted with on the front end of the cloud platform background.
3. The method according to claim 2, characterized in that: Step S3 at least includes the following steps: operating configuration at the front end of the cloud platform; after the backend generates instructions, when the device reports heartbeat data, sending it to the device as a response; The edge gateway engine calls the Docker client to pull the edge gateway service image from the image repository, performs port mapping and directory mounting according to the information in the installation instructions, and starts the service after building it into a container.
4. The method according to claim 3, characterized in that: In step S4, initialization / update configuration at least includes: operating configuration on the cloud platform panel, generating instructions in the background and sending them to the edge gateway engine, the execution of the gateway management instructions in the application, and real-time feedback to the cloud platform, which is forwarded to the specific application by the edge gateway engine, and the application dynamically provides customized services based on the configuration parameters.
5. The method according to claim 4, characterized in that: In step S4, the specific steps of issuing the configuration include at least: S41, performing operations in the backend interface of the cloud platform to configure the relevant information of the application, including the collection points, and then asynchronously transmitting the configuration information to the edge gateway; this process is not synchronized with the operation of the edge gateway engine receiving the configuration; S42, the edge gateway engine will periodically send heartbeat data to the upper cloud platform to confirm its operating status; if there are tasks in the cloud platform that have been issued but have not been confirmed to be received by the edge gateway, these tasks will be sent to the edge gateway engine again as a response; after receiving these instructions, the edge gateway engine will pass them to the built-in instruction parsing module for processing; the parsing module will identify the configuration instructions, parse them, and then send the parsed configuration information to the corresponding application; S43. After receiving the configuration information, the application initializes the system information according to the configuration information and adjusts the calculation rules of data collection and data decoding according to the configuration requirements; after completing these configurations, the application will report the relevant information to the cloud platform through the MQTT protocol.
6. The method according to any one of claims 1 to 5, characterized in that: The method is used to interact with the cloud platform to manage the edge gateway and the applications therein, and also includes the following process: Step 1: Initialize the database connection; use the SQLite lightweight database for configuration; this database is responsible for persisting gateway and application related data, including task information, application configuration and target status; When the edge gateway engine is restarted, the edge gateway and application status can be automatically adjusted based on the persistent data; Step 2: Start and initialize the HTTP service; This service is designed to register the status when the application starts and perform the initial configuration delivery; Step 3: Initialize the Docker client using the Docker API; Using the Docker client, the edge gateway service can send commands such as creating containers and removing containers to Docker to implement container management operations such as installing, uninstalling, restarting, and monitoring the running status of applications; Step 4: Register the edge gateway information with the cloud platform. This step is used to obtain a communication key from the cloud platform, which is used to send heartbeat data to the cloud platform and obtain task information from the cloud platform. Step 5: Send heartbeat data in a regular cycle; This information is used to notify the cloud platform that the gateway is online and provide the gateway's current device status information. At the same time, if the cloud platform has unsent tasks, the cloud platform can put the task information in the response and send it to the edge gateway engine. After receiving the task, the edge gateway engine provides the task information to another thread to execute step 6 to avoid affecting the heartbeat report; Step 6: Execute the cloud platform task. When receiving the task, first persist the task information to the database. The persisted task information can be added to the task queue and re-executed during the initialization process. When the task is completed, the task execution result is sent to the cloud platform.
7. The method according to claim 6, characterized in that: When running the edge gateway engine with docker run, you need to use the "-v / var / run / docker.sock: / var / run / docker.sock" option to mount the host's Docker daemon process to the edge gateway engine so that the edge gateway engine can manage applications in the edge gateway. At the same time, the docker run edge gateway engine should be run with the "--restart=always" option to ensure that it can automatically restart when it is shut down.
8. The method according to claim 7, characterized in that: The task information sent by the cloud platform contains a "task type" field, which is used to identify the type of the task information. Tasks are processed differently according to the task type. When fewer task types are supported, a switch-case conditional statement can be used for simple processing. When there are more task types, a hash table should be used to point to different processing logics.
9. A system for managing edge gateways based on an application container engine cloud, characterized in that: The system is used to implement the methods of claims 1 to 8 above; At least includes edge module, heartbeat module and task module; in The edge module is responsible for maintaining the state of the edge gateway engine itself, including initializing and managing the Docker client and checking for updates; The heartbeat module is responsible for the interaction with the cloud platform, including reporting of device heartbeat data, receiving tasks on the cloud platform, and reporting of task results; The task module is responsible for executing tasks and recovering unfinished task data before the engine is shut down.
10. The system according to claim 9, characterized in that: The main steps in the system are as follows: Device initialization: First, upload the edge gateway engine to the Docker image repository; when you want to initialize the device, create the edge gateway information on the cloud platform, get the edge gateway initialization instructions, and install Docker and edge gateway engine services for the edge gateway device according to the instructions; after the edge gateway service is started, the device heartbeat data will be reported, and the cloud platform can display the device status information; Issue installation instructions: configure the application on the cloud platform; after the background generates instructions, when the device reports heartbeat data, it is sent to the device as a response; Install the application: The edge gateway engine calls the Docker command to pull the edge gateway service image from the image repository, performs port mapping and directory mounting according to the information in the installation instructions, and starts the service after building it into a container; Initialize / update configuration: Configure operations on the cloud platform panel. After the background generates instructions, they are sent to the edge gateway engine. The gateway manages the execution of instructions in the application and provides real-time feedback to the cloud platform. The edge gateway engine forwards them to specific applications, and the application dynamically provides customized services based on the configuration parameters.