A method for heterogeneous deployment of power edge based on cloud-edge collaboration
The power edge heterogeneous deployment method through cloud-edge collaboration solves the problem of power IoT edge application management and update, achieves multiple deployment methods and security, adapts to the unique needs of the power grid, and improves management and maintenance efficiency.
Patent Information
- Application Number
- CN202111160801.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2041-09-30
AI Technical Summary
Existing technology is difficult to achieve full-link management, expansion and update of power Internet of Things edge applications, rapid recovery and remote operation and maintenance of edge devices, and there are problems such as mixed business data and management data, inability to meet the customized needs of the power grid, and security risks. .
Adopting the power edge heterogeneous deployment method of cloud-edge collaboration, by managing application packages, building container images, registering edge components, configuring edge devices, and monitoring applications, it supports host and container deployment, achieves application isolation and resource management, and introduces Jenkins and Gitlab performs continuous integration and continuous delivery.
It realizes support for multiple deployment methods of edge applications, reduces operation difficulty and cost, improves equipment management and maintenance efficiency, ensures security and flexibility, and adapts to the unique needs of the power grid.
Smart Images

Figure CN114024951B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric power Internet of Things, and in particular to a method for heterogeneous deployment of electric power edges based on cloud-edge collaboration. Background Art
[0002] Compared with the Internet, the Internet of Things emphasizes the connection of things, and the connection of things is inseparable from the applications running on them. When a large number of things are connected to the network, in order to cope with the explosive business needs and changes in demand, multiple applications are required to run on the things, and they can be deployed and upgraded quickly and conveniently. The management of things and applications running on them, including deployment, updates and upgrades, becomes a difficult point; the traditional manual on-site upgrade of a single device is costly, and on-site software upgrades for desert Gobi or even foreign equipment are time-consuming and laborious. To solve these problems, a unified heterogeneous deployment solution based on cloud-edge collaboration was born; the power industry has different deployment requirements for different edge applications. Some require running on the host machine, while some applications require better independence and isolation and require running in containers, and some applications are highly correlated and require running in the same container, so a set of heterogeneous deployment solutions that support various deployment methods is needed.
[0003] As power grid companies promote the construction of the power Internet of Things, the development of the power system based on the cloud-edge-end overall architecture of the power Internet of Things provides an opportunity for the rise of edge computing, while raising power grid services to a higher level, solving problems that were previously unsolvable nearby and quickly. The increased demands for the power Internet of Things to achieve comprehensive state perception, fast and efficient information processing, and convenient and flexible application deployment and update will inevitably lead to an exponential growth in terminal devices connected to the power Internet of Things and the amount of data. This requires a new architecture to adapt to the acquisition and processing of large amounts of data, and requires the solution to support cluster parallel processing of these large amounts of management and monitoring data.
[0004] The data of the power Internet of Things can be divided into two categories, business data and management data; business needs are changeable, while management data is single and fixed, so the management of edge terminals can be unified and platformized; the existing business data and management data are not separated, and the edge terminals are still upgraded using protocols. Business data and management are mixed together, making it difficult to manage and maintain, and the architecture is not clear; to achieve these common functions, it is required that the business data channel and the management channel of the edge terminal equipment are separated, independent of each other, and do not affect each other. When processing business needs, you can focus on the business itself, without having to pay attention to the deployment, upgrade, monitoring and other general needs of the business APP, and accelerate the realization of business needs.
[0005] The edge component deployment steps of the existing IoT platforms of major cloud vendors are as follows: purchase edge nodes -> activate IoT edge services -> activate device access services -> deploy IoT edge applications -> device access edge nodes. It supports two deployment methods for edge applications: one is containerized deployment, and the other is installation package deployment. However, the installation package deployment is not isolated, and business data and management data are mixed together. In addition, the services of cloud vendors are all standard services, which cannot meet the customized needs of the power grid. In addition, the cost of using the public cloud is high and there are security risks.
[0006] The audit requirements of the power industry are high, and when problems are found, they must be quickly located and solved. However, the existing technical solutions do not link the construction, packaging and operation of the code and edge applications, and cannot quickly locate and solve the problems. The power grid system involves the safety, stability and reliability requirements of people's livelihood electricity, and the security level requirements are high. The existing technical solutions are all based on public cloud solutions. There are security risks in uploading data to the cloud. Once a security problem occurs, the consequences are disastrous. The unique deployment requirements of the power grid require that edge applications can be deployed on the host and the container. At the same time, it also requires that edge applications can be attached to existing containers for operation, that is, multiple edge applications can be run in one container, and the same type or related applications can run in the same container. The existing technical solutions can only achieve container-level management, and cannot achieve management of edge applications in containers. Summary of the invention
[0007] The technical problem to be solved by the present invention is to provide a power edge heterogeneous deployment method that can realize full-link management, expansion and update of edge applications, rapid recovery of edge devices, and remote operation and maintenance.
[0008] In order to solve the above technical problems, the present invention provides a cloud-edge collaborative power edge heterogeneous deployment method, comprising the following steps:
[0009] Step S1, manage application packages and upload the written application packages to the system;
[0010] Step S2, building the application package into an image and putting it into the container image repository;
[0011] Step S3, directly registering the application package as an edge component or registering the built container image as an edge application for use by edge devices;
[0012] Step S4: Device registration, creating a digital edge device, configuring the edge components that need to run in it, and storing the application list and configuration running in the edge device on the server side;
[0013] Step S5: Send the configured edge application list to the edge proxy module, and the edge proxy module deploys and updates according to the configuration: when the component is a native application component, it is deployed and updated on the host or attached to the container for deployment and update; when the component is a mirror component, it is deployed and updated in a container;
[0014] Step S6: The management platform monitors the edge devices and the applications running therein.
[0015] Furthermore, the step of building the application package into an image in step S2 includes:
[0016] Step S21, obtaining an application package file;
[0017] Step S22, creating a Dockerfile file;
[0018] Step S23, generating a docker build command and executing it in the docker environment;
[0019] Step S24, push the generated image to the executed harbor image repository;
[0020] Step S25: If the building process is too slow, asynchronous processing is adopted. After receiving the building command, "processing" is immediately returned, and then the building progress is polled. If an error occurs, the corresponding error information is returned.
[0021] Furthermore, the step S5 of attaching to the container deployment and updating includes the following steps:
[0022] Step S501: The management platform front end sends a deployment request attached to a container to the management platform back end. The deployment request includes a download address of the file and a temporary authorization code for downloading the file, but does not include an actual file stream.
[0023] Step S502, the management platform backend assembles parameters and attaches them to the container deployment request and forwards them to the edge proxy module via the file server;
[0024] Step S503, the edge proxy module returns the processing status to the management platform front end, and sends an application and configuration file download request to the file server;
[0025] Step S504, the file server returns the application and configuration file stream to the edge proxy module;
[0026] Step S505, the edge proxy module saves the application and configuration files to the specified directory, performs file signature verification, and reports the processing status to the management platform backend;
[0027] Step S506, the edge proxy module prepares the application execution environment;
[0028] Step S507, the edge proxy module starts / restarts the application process and records the progress;
[0029] Step S508, the edge proxy module polls and requests deployment progress information and reports the deployment progress to the file server, and the file server forwards the deployment progress to the management platform backend;
[0030] Step S509, the management platform backend records the progress;
[0031] Step S510: the management platform front end polls the management platform back end for deployment progress, and the management platform back end returns deployment progress information to the management platform front end.
[0032] Furthermore, the edge proxy module in step S506 prepares the application execution environment including the following steps:
[0033] Step S5061: if it is not hot loading, merge the application container running parameters, back up the original application and data in the container, and rebuild the container; otherwise, directly execute the next step;
[0034] Step S5062, generating a container configuration file for the application;
[0035] Step S5063, copy all applications including the original applications and data files in the container and their container configuration files into the container;
[0036] Step S5064, if it is an update in the application component container, notify the management program in the container to stop and delete the old application, otherwise execute the next step;
[0037] Step S5065, the hypervisor in the container reloads the application configuration;
[0038] The hot loading described in step S5061 is to load the application, which only involves environment variables, resource restrictions and CMD parameters, and the deployment and update of the application can be achieved without rebuilding the host container.
[0039] Furthermore, the host deployment and update in step S5 includes the following steps:
[0040] Step S511, the management platform front end sends a host deployment request to the management platform back end, the deployment request includes the download address of the file and the temporary authorization code for downloading the file, but does not include the actual file stream;
[0041] Step S512, the management platform backend assembles parameters and forwards the host deployment request to the edge proxy module via the file server;
[0042] Step S513, the edge proxy module returns the processing status to the management platform front end, and sends an application and configuration file download request to the file server;
[0043] Step S514, the file server returns the application and configuration file stream to the edge proxy module;
[0044] Step S515, the edge proxy module saves the application and configuration files to a specified directory;
[0045] Step S516: If the MD5 value of the application compression package has not changed, the configuration file needs to be updated and then the application is restarted in step S518; otherwise, the file signature is verified and the processing status is reported to the management platform backend;
[0046] Step S517, the edge proxy module prepares the application execution environment and manages the platform backend to record the progress;
[0047] Step S518, the edge proxy module starts / restarts the application and records the progress;
[0048] Step S519, the edge proxy module polls and requests deployment progress information and reports the deployment progress to the management platform backend, and the management platform backend records the progress;
[0049] Step S520: the management platform front end polls the management platform back end for deployment progress, and the management platform back end returns deployment progress information to the management platform front end.
[0050] Furthermore, the edge proxy module in step S517 prepares the application execution environment including the following steps:
[0051] Step S5171, decompress to a specified directory;
[0052] Step S5172: If the host machine is updated, the original application is stopped and deleted.
[0053] Furthermore, in step S504 or step S514, the file server returns the application and configuration file stream to the edge proxy module so that the edge proxy module downloads the file package from the file server, including the following steps:
[0054] Step S531, the edge proxy module reads the downloaded temporary file and obtains the number of downloaded bytes;
[0055] Step S532, the edge proxy module requests the file server to download the file with the download start location;
[0056] Step S533, the file server starts transmitting the file stream to the edge proxy module from the specified starting position;
[0057] Step S534, the edge proxy module saves the file stream to a temporary file;
[0058] Step S535, if the file stream download is interrupted, return to step S531, otherwise rename the temporary file after the download is completed.
[0059] Furthermore, the process also includes starting / stopping the container / application, the steps of which are:
[0060] Step S81, the management platform front end sends a start / stop request of a container / application to the management platform back end;
[0061] Step S82: The management platform backend assembles parameters and sends a start / stop request for the container / application to the edge proxy module;
[0062] Step S83, the edge proxy module starts / stops the host application or container, and the edge proxy module returns the processing status to the management platform front end via the management platform back end;
[0063] Step S84, the management platform backend records the progress;
[0064] Step S85, the edge proxy module polls the request execution progress information and sends the execution progress to the management platform backend;
[0065] Step S86, the management platform backend records the progress;
[0066] Step S87, the management platform front end polls the management platform back end for execution progress;
[0067] Step S88: The management platform backend returns execution progress information to the management platform frontend.
[0068] Furthermore, the step of monitoring the edge device and the application running therein by the management platform in step S6 includes:
[0069] Step S61, the edge proxy module polls to obtain device hardware and software information;
[0070] Step S62, the edge proxy module checks whether the data has changed, and if so, updates the database through the edge data receiving server;
[0071] Step S63, the management platform front end sends a device hardware and software information query command to the management platform back end;
[0072] Step S64, the management platform backend returns the device hardware and software information to the management platform frontend through database query;
[0073] Step S65, the management platform front end sends a device time query command to the management platform back end;
[0074] Step S66, the management platform backend sends a device time query command to the edge proxy module;
[0075] Step S67, the edge proxy module obtains the current time and returns the time information to the management platform front end through the management platform back end.
[0076] Furthermore, Jenkins software is introduced to integrate with Gitlab to achieve continuous integration and continuous delivery of the application package development and deployment:
[0077] Among them, the Jenkins pipeline configuration and execution steps are:
[0078] Step S901, adding credentials, including account and password credentials for accessing Gitlab, and account and password credentials for ssh access to the execution node;
[0079] Step S902, adding a task execution node, where the execution node is a server used to execute the pipeline;
[0080] Step S903, adding a task configuration pipeline;
[0081] Step S904: Manual execution or Gitlab-triggered execution. When Gitlab-triggered execution is adopted, the Jenkins build trigger address needs to be configured in Gitlab, and the Gitlab administrator needs to allow the hook operation.
[0082] Step S905, the node executes the pipeline;
[0083] The steps of the server-side program pipeline are: pull the code from Gitlab, build the application package and archive it, generate the image corresponding to the application and push it to the Harbor warehouse, and notify the execution result by email.
[0084] The beneficial effects of the present invention are:
[0085] The present invention discloses a cloud-edge architecture suitable for heterogeneous deployment of edge computing applications in edge devices. Different from traditional application deployment methods, this architecture supports multiple deployment methods, including host application deployment, container deployment, and a hybrid deployment mode in which applications are attached to containers (single container, multiple applications). It is compatible with traditional host deployment methods and also supports new containerized deployment methods. It uses container technology and cgroup technology to isolate applications and restrict the use of application resources: for edge devices with limited resources that cannot run containers, traditional host deployment methods can be used. For edge devices with abundant resources and capable of running containers, container deployment methods can be used to manage the application execution environment in a mirrored manner, eliminating the tedious and error-prone operation of preparing the application execution environment for each edge device; for some interrelated applications, they can be deployed in the same container so that they can access each other, while ensuring that the cloud uniformly configures the applications and deployment parameters running in the edge devices, and uses the same set of configurations to parse in different ways. The application list and configuration running in the edge devices are uniformly stored in the cloud. Even if the entire edge device hardware is completely damaged, it can be quickly restored based on the configuration in this system; remote application deployment and upgrade in the cloud. After the device is installed and initialized, there is no need for local deployment operations, and the interface-based remote online configuration and deployment of applications can be realized, which greatly simplifies the difficulty of operation and reduces the need for professional knowledge. BRIEF DESCRIPTION OF THE DRAWINGS
[0086] Figure 1 It is a flow chart of an implementation method of the power edge heterogeneous deployment method based on cloud-edge collaboration of the present invention.
[0087] Figure 2 It is a heterogeneous deployment flow chart.
[0088] Figure 3 yes Figure 2 Automatically build the image flow chart in .
[0089] Figure 4 yes Figure 2 Attach to an existing container deployment flowchart.
[0090] Figure 5 yes Figure 2 Host deployment flow chart.
[0091] Figure 6 It is a timing flow chart of file downloading.
[0092] Figure 7 This is a flowchart of the application / container start and stop sequence.
[0093] Figure 8 It is a timing flow chart of edge device information query. DETAILED DESCRIPTION
[0094] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0095] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0096] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0097] like Figure 1 As shown, a power edge heterogeneous deployment method based on cloud-edge collaboration includes the following steps:
[0098] S101, application package management, uploading the written application package to the system;
[0099] S102, building the application package into an image and putting it into the container image repository;
[0100] S103, directly registering the application package as an edge component or registering the built container image as an edge application, and building a component warehouse for use by edge devices;
[0101] S104, edge node management, including device registration, creating digital edge devices, and configuring edge components that need to run in them;
[0102] S105, sending the configured edge application list to the edge, and the edge deploys and updates according to the configuration;
[0103] S106, the edge management cloud platform monitors the edge devices and the applications running therein.
[0104] like Figure 2 As shown in the figure, after the APP (application) is developed and built through application package management (native APP package), it can be directly registered as an APP component, or the image can be automatically built through DockerFile or manually built and the image component can be registered. The APP component can be configured to be deployed on the edge node host or deployed with added value to an existing container, and the image component can be configured to be deployed on the edge node container.
[0105] In step S102, the application package management implements the management of the APP file package, including uploading and downloading, adding, deleting, modifying and checking, and version management of the APP file package. The corresponding application package and the signed application package can be downloaded from the application list, and can be edited, the historical version can be viewed, and the deletion operation can be performed. When the application package has been used, it is not allowed to be deleted.
[0106] If adding / editing, after uploading, the background will parse the application name and application version from the file name, sign the MD5 value of the file package, and store it in the database. The uploaded application package name must be application name@version number.tar and can only contain letters / numbers / underscores / hyphens / decimal points. If the application is not in use, it is allowed to be overwritten in adding / editing. If it has been used, the user will be prompted that modification is not allowed.
[0107] If you view and download historical versions, you are not allowed to delete the application after it has been used.
[0108] The application package file structure is as follows:
[0109]
[0110]
[0111] In step S102, the application image building function is placed in the image warehouse module, and the corresponding building record is editable. After editing, the building operation can be performed again, and the record of successful building is not allowed to be deleted.
[0112] The image building process is as follows:
[0113] 1) Select the image repository and product to which the image needs to be built;
[0114] 2) Select the application package and version to be built. In the image build file, use the variable APP_PACKAGE to represent the application file package name, and use APP_NAME to represent the application name (the folder name after decompression);
[0115] 3) Select the base image used for image building, which is represented by the variable BASE_IMAGE in the image building file;
[0116] 4) The default template is automatically brought out in the image building file, and users can modify it based on the default template;
[0117] 5) After completing the information, you can execute the build action.
[0118] For example, using the docker build command:
[0119] sudo docker build-t jizhi:1.0--build-arg APP_PACKAGE=app01.tar--build-arg
[0120] BASE_IMAGE=192.168.0.2:8000 / base / alpine-armv7-cplus:1.0--build-arg
[0121] APP_NAME=app01--no-cache.
[0122] You need to pass three build parameters APP_PACKAGE, APP_NAME, BASE_IMAGE (derived from the selected information) to build based on the base image, copy the application files into the image, and automatically execute the startup program specified by the application in the container. The executable file name is declared in the binname field in the app.cfg file.
[0123] like Figure 3 As shown, the automatic image building process is as follows:
[0124] 1) Obtain the application package file;
[0125] 2) Create a Dockerfile file;
[0126] 3) Generate a docker build command and execute it in the docker environment;
[0127] 4) Push the generated image to the executed harbor image repository;
[0128] 5) If the building process is too slow, asynchronous processing is used. After receiving the building command, "Processing" is immediately returned, and then the building progress is polled. If an error occurs, the corresponding error information is returned.
[0129] In step S103, the native application is registered as a component and managed as follows:
[0130] 1) Select the application and application version. The latest version is selected by default. If it is an image component, select the image and image version.
[0131] 2) Select the operating system and CPU architecture suitable for the application, and set its category;
[0132] 3) Fill in the running parameters. The parameter setting format is the same as the running parameter format of the image, and a common set is used to facilitate management and switching deployment methods;
[0133] 4) Save.
[0134] In step S104, edge node component management includes: storing the application list and configuration running in the edge device on the server side, so that even if the entire edge device hardware is completely damaged, it can be quickly restored according to the configuration in this system. Support online operation. After the device is installed and initialized, no local deployment operation is required to realize the interface-based remote online configuration and deployment of applications, which greatly simplifies the difficulty of operation and reduces the need for professional knowledge. At the same time, it supports the update operation of edge applications, including the update of execution programs and the update of running configurations, realizes the interface-based remote configuration upgrade and expansion of applications, simplifies the difficulty of operation and reduces the cost of expansion and upgrade. Attach the application component to the container of the edge node, or add the application component directly to the edge node, and configure its operating parameters and mounted files to realize online deployment. When the selected component is a native application component, you can choose the deployment method host deployment or additional container deployment. When you choose additional container deployment, you will need to select the container to which it is attached; when the selected component is a mirror component, you can only choose containerized deployment.
[0135] The data structure of the running parameter configuration of the three deployment modes of container running, attached to container running, and host running is maintained in one set. The support of the three running modes for each configuration item is as follows:
[0136] Configuration item\deployment method Container Run Attach to container run Host machine running Environment variables support support support Port exposure support Rebuild container support Not involved Restart strategy support Inheriting the host container Support(customized) File Mount support Rebuild container support Support (customization, consider soft link method) Resource Limitations support To be studied To be studied Hostname specified support Rebuild container support Not supported (for security reasons) Privileged Mode support Rebuild container support Not supported Serial port mapping support Rebuild container support Not involved Startup parameter settings support Support(customized) support Log Configuration support Inheriting the host container Support(customized) CMD Parameters support Support(customized) Support(customized)
[0137] The host operation mode can parse the CMD parameters into the program's operation parameters. The file mount configuration can link the configuration file to the specified execution program directory through a soft link. After the deployment is completed, if you need to update the application and its configuration, you can modify the device component list again and execute the deployment action again to compare whether the locally deployed components have changed. Incremental deployment is supported, and only the changed components (including the addition, update, deletion, start and stop of components) are sent.
[0138] like Figure 4 As shown, the deployment process of attaching to an existing container is as follows:
[0139] 1) The management platform front end sends a deployment request attached to the container to the management platform back end. The deployment request contains the download address of the file and the temporary authorization code for downloading the file, but does not contain the actual file stream;
[0140] 2) The management platform backend assembles the parameters and attaches them to the container deployment request and forwards it to the edge proxy module via the file server;
[0141] 3) The edge proxy module returns the processing status to the management platform front end and sends a request to the file server to download the application and configuration files;
[0142] 4) The file server returns the application and configuration file stream to the edge proxy module;
[0143] 5) The edge proxy module saves the application and configuration files to the specified directory, verifies the file signature, and reports the processing status to the management platform backend;
[0144] 6) The edge proxy module prepares the application execution environment:
[0145] 61) If it is not hot loading, merge the application container running parameters, back up the original application and data in the container, and rebuild the container, otherwise directly execute the next step; the hot loading is to load the application only involving environment variables, resource restrictions and CMD parameters, and the application can be deployed and updated without rebuilding the host container.
[0146] 62) Generate a container configuration file for the application;
[0147] 63) Copy all applications and their container configuration files including the original applications and data files in the container into the container;
[0148] 64) If the update is within the application component container, notify the management program within the container to stop and delete the old application, otherwise execute the next step;
[0149] 65) The container manager reloads the application configuration;
[0150] 7) The edge proxy module starts / restarts the application process and records the progress;
[0151] 8) The edge proxy module polls and requests deployment progress information and reports the deployment progress to the file server, and the file server forwards the deployment progress to the management platform backend;
[0152] 9) Record progress on the back end of the management platform;
[0153] 10) The management platform front end polls the management platform back end to request the deployment progress, and the management platform back end returns the deployment progress information to the management platform front end.
[0154] Among them, the application and its configuration file need to be placed in the specified folder for the container management program to read. Each application has a separate application container configuration file, which writes the environment variables, resource restrictions, and CMD parameter configurations. For parameters that cannot be hot-loaded: port exposure, file mounting, hostname, privileged mode, and serial port mapping configuration, they need to be merged with the running parameters of the host container, and then the merged parameters are used to rebuild the container. Applications are only allowed to be attached to containers built based on the base image (there is no application management program in other containers). When attached to the container runtime, it is necessary to check whether the container is built based on the base image, otherwise an exception will be reported. When the container is restarted abnormally (such as power outage, device upgrade), it is necessary to ensure that all applications in the container can start normally---so the application files, application configurations, and application container configuration files must be placed in the container. When the container is restarted, the management program in the container will reload all configurations and run all applications. The container will be rebuilt when it does not meet the hot load requirements.
[0155] As an optimization solution, develop a service program for internal deployment of the container, and the host program is executed through docker exec
[0156] {containerName}appctl start{appName}, docker exec{containerName}appctlrestart{appName} command calls the program to start the application; use the docker cp command to copy the file into the container.
[0157] like Figure 5 As shown, the host deployment steps include:
[0158] 1) The management platform front end sends a host deployment request to the management platform back end. The deployment request contains the download address of the file and the temporary authorization code for downloading the file, but does not contain the actual file stream;
[0159] 2) The management platform backend assembles parameters and forwards the host deployment request to the edge proxy module via the file server;
[0160] 3) The edge proxy module returns the processing status to the management platform front end and sends a request to the file server to download the application and configuration files;
[0161] 4) The file server returns the application and configuration file stream to the edge proxy module;
[0162] 5) The edge proxy module saves the application and configuration files to the specified directory;
[0163] 6) If the MD5 value of the application compression package has not changed, the configuration file needs to be updated and the application is restarted in step S518. Otherwise, the file signature verification is performed and the processing status is reported to the management platform backend;
[0164] 7) The edge proxy module prepares the application execution environment and manages the platform backend to record progress:
[0165] 71) Unzip to the specified directory;
[0166] 72) If the host machine is updated, the original application is stopped and deleted.
[0167] 8) The edge proxy module starts / restarts the application and records the progress;
[0168] 9) The edge proxy module polls and requests deployment progress information and reports the deployment progress to the management platform backend, while the management platform backend records the progress;
[0169] 10) The management platform front end polls the management platform back end to request the deployment progress, and the management platform back end returns the deployment progress information to the management platform front end.
[0170] The application and its configuration file must be placed in the specified folder. Each application has a separate running configuration file, in which the environment variables, resource limits, and CMD parameter configurations are written. When the device or application restarts abnormally (such as power outage, device upgrade), it is necessary to ensure that all applications in the host can start normally. When the application restarts, the deployment upgrade module will reload all configurations and run all applications.
[0171] The entire container image and application package are not allowed to be modified after the version is released. When the image or application package is modified, a new version will be formed. When deploying to different terminals requires different running parameters, they are passed to the application in the following three ways:
[0172] 1) File mounting method: mount the configuration file into the application.
[0173] 2) Environment variables are passed in. The application obtains its running parameters by reading environment variables during operation.
[0174] 3) Apply command line parameters by passing in run parameters when executing the application.
[0175] During the deployment or upgrade process, the application needs to download the file package from the file server. If the download process fails, breakpoint resuming is supported. Figure 6 As shown, the file download timing process is as follows:
[0176] 1) The edge proxy module reads the downloaded temporary file and obtains the number of bytes downloaded;
[0177] 2) The edge proxy module requests the file server to download the file with the download start location;
[0178] 3) The file server starts transmitting the file stream to the edge proxy module from the specified starting position;
[0179] 4) The edge proxy module saves the file stream to a temporary file;
[0180] 5) If the file stream download is interrupted, return to step 1), otherwise rename the temporary file after the download is completed.
[0181] like Figure 7 As shown, when configuring the component list of the edge node, specify whether to start the container / application; after the edge component is started, the configuration will not take effect immediately, and the deployment operation needs to be performed and redeployed to take effect. When the component stops, it should prompt the related dependent components that may be affected, as well as all the affected applications in the container, and finally execute the application deployment. The stop and start request and deployment request sent to the edge are the same request, which uses request parameters to declare which application needs to be started and which application needs to be stopped. The execution sequence is as follows:
[0182] 1) The management platform front end sends a start / stop request for the container / application to the management platform back end;
[0183] 2) The management platform backend assembles parameters and sends a start / stop request for the container / application to the edge proxy module;
[0184] 3) The edge proxy module starts / stops the host application or container, and returns the processing status to the management platform front end via the management platform back end;
[0185] 4) Record progress on the back end of the management platform;
[0186] 5) The edge proxy module polls the request execution progress information and sends the execution progress to the management platform backend;
[0187] 6) Record progress on the back end of the management platform;
[0188] 7) The management platform front end polls the management platform back end for execution progress;
[0189] 8) The management platform backend returns the execution progress information to the management platform frontend.
[0190] To start or stop an application in a container, use the docker exec{containerName}appctlstart{appName} and docker exec{containerName}appctl stop{appName} commands.
[0191] In order to realize on-site log viewing and troubleshooting, it is necessary to remotely view and export logs, which is convenient for quick troubleshooting and saves operation and maintenance costs. The logs to be viewed include kernel logs, system logs, user logs, permission logs, edge management logs, and edge application logs. Since the log files may be too large, asynchronous processing is used to avoid page waiting for response timeouts. Remote monitoring and viewing of device information includes: device type, device name, electronic tag, manufacturer information, device status, MAC address, device current time, device startup time, device running time, platform version and patch version information, hardware version information, device uplink communication interface information, device memory usage, and device internal storage usage.
[0192] The data acquisition strategy is as follows: For device hardware and software information that does not change frequently, the strategy of reporting when the information changes is adopted, and the reported data is stored in the server database, and only the last data is retained. For the current time and startup time, the edge provides a query interface, and the query is called in real time when entering the page. The device status, CPU, memory, and internal storage usage adopt a scheduled reporting strategy (report once every 1 minute, configurable), and the reported data is stored in the server database, and the data for a period of time is retained to see the trend (regularly clean up historical data).
[0193] like Figure 8 As shown in the figure, the process of querying device hardware and software information and time information is as follows:
[0194] 1) The edge proxy module polls to obtain device software and hardware information;
[0195] 2) The edge proxy module checks whether the data has changed, and if so, updates the database through the edge data receiving server;
[0196] 3) The management platform front end sends a command to query the device software and hardware information to the management platform back end;
[0197] 4) The management platform backend returns the equipment hardware and software information to the management platform frontend through database query;
[0198] 5) The management platform front end sends a device time query command to the management platform back end;
[0199] 6) The management platform backend sends a device time query command to the edge proxy module;
[0200] 7) The edge proxy module obtains the current time and returns the time information to the management platform front end through the management platform back end.
[0201] When querying logs, directly request responsive return of log information to be displayed on the page; when exporting logs, first send a log export request (with a unique request ID) to the edge log module. After receiving the request, the log module returns the processing status and asynchronously uploads the log file to the file server. After the upload is successful, the management platform front end can request the file server to download the log file.
[0202] Introduce Jenkins software and integrate it with Gitlab to achieve continuous integration and continuous delivery (CICD) of the application package development and deployment:
[0203] Among them, the Jenkins pipeline configuration and execution steps are:
[0204] 1) Add credentials, including the account and password credentials for accessing Gitlab and the account and password credentials for ssh access to the execution node;
[0205] 2) Add task execution nodes, which are servers used to execute pipelines;
[0206] 3) Add task configuration pipeline;
[0207] 4) Manual execution or Gitlab-triggered execution. When Gitlab is used to trigger the execution, the Jenkins build trigger address needs to be configured in Gitlab, and the Gitlab administrator needs to allow hook operations;
[0208] 5) Node execution pipeline;
[0209] The steps of the server-side program pipeline are: pull the code from Gitlab, build the application package and archive it, generate the image corresponding to the application and push it to the Harbor warehouse, and notify the execution result by email.
[0210] The edge image component pipeline steps are: integrating Gitlab (a tool for managing application source code), Jenkins (a tool for implementing CICD), harbor repository (a tool for managing container images) and this system to achieve full process management from code submission to edge deployment of application images.
[0211] The embodiments of the present invention can be adjusted, merged and deleted in sequence according to actual needs.
[0212] The embodiments have been described in detail. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The above embodiments are only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A power edge heterogeneous deployment method based on cloud-edge collaboration, It is characterized in that The following steps are involved: S1, manage application packages and upload written application packages to the system; S2, build the application package into an image and put it into the container image repository; S3, directly registers the application package as an edge component or registers the built container image as an edge application for use by edge devices; S4, device registration, creating a digital edge device, configuring the edge components that need to run in it, and storing the application list and configuration running in the edge device on the server side; S5: Send the configured edge application list to the edge proxy module, and the edge proxy module deploys and updates according to the configuration: when the component is a native application component, it is deployed and updated on the host or attached to the container for deployment and update; when the component is a mirror component, it is deployed and updated in a container; S6, the management platform monitors the edge devices and the applications running on them; The step S5 of attaching to the container deployment and updating includes the following steps: S501, the management platform front end sends a deployment request attached to a container to the management platform back end, the deployment request includes a download address of the file and a temporary authorization code for downloading the file, but does not include an actual file stream; S502, the management platform backend assembles parameters and attaches them to the container deployment request and forwards them to the edge proxy module via the file server; S503, the edge proxy module returns the processing status to the management platform front end, and sends an application and configuration file download request to the file server; S504, the file server returns the application and configuration file stream to the edge proxy module; S505, the edge proxy module saves the application and configuration files to the specified directory, performs file signature verification, and reports the processing status to the management platform backend; S506, the edge proxy module prepares the application execution environment; S507, the edge proxy module starts / restarts the application process and records the progress; S508, the edge proxy module polls and requests deployment progress information and reports the deployment progress to the file server, and the file server forwards the deployment progress to the management platform backend; S509, the management platform backend records the progress; S510, the management platform front end polls the management platform back end for deployment progress, and the management platform back end returns deployment progress information to the management platform front end; The host deployment and update in step S5 includes the following steps: S511, the management platform front end sends a host deployment request to the management platform back end, the deployment request includes a file download address and a temporary authorization code for downloading the file, but does not include an actual file stream; S512, the management platform backend assembles parameters and forwards the host deployment request to the edge proxy module via the file server; S513, the edge proxy module returns the processing status to the management platform front end, and sends an application and configuration file download request to the file server; S514, the file server returns the application and configuration file stream to the edge proxy module; S515, the edge proxy module saves the application and configuration files to a specified directory; S516, if the MD5 value of the application compression package has not changed, the configuration file needs to be updated and then the application is restarted in step S518, otherwise the file signature verification is performed and the processing status is reported to the management platform backend; S517, the edge proxy module prepares the application execution environment and manages the platform backend to record the progress; S518, the edge proxy module starts / restarts the application and records the progress; S519, the edge proxy module polls and requests deployment progress information and reports the deployment progress to the management platform backend, and the management platform backend records the progress; S520, the management platform front end polls the management platform back end to request the deployment progress, and the management platform back end returns the deployment progress information to the management platform front end.
2. According to the method for heterogeneous deployment of power edge based on cloud-edge collaboration according to claim 1, It is characterized in that The step of building the application package into an image in step S2 includes: S21, obtaining an application package file; S22, create a Dockerfile file; S23, generate a docker build command and execute it in the docker environment; S24, push the generated image to the executed harbor image repository; S25: If the building process is too slow, asynchronous processing is adopted. After receiving the building command, "Processing" is immediately returned, and then the building progress is polled. If an error occurs, the corresponding error information is returned.
3. According to the method for heterogeneous deployment of power edge based on cloud-edge collaboration according to claim 1, It is characterized in that The edge proxy module preparing the application execution environment in step S506 includes the following steps: S5061, if it is not hot loading, merge the application container running parameters, back up the original application and data in the container, and rebuild the container, otherwise directly execute the next step; S5062, generating a container configuration file for the application; S5063, copy all applications including the original applications and data files in the container and their container configuration files into the container; S5064, if the update is in the application component container, notify the management program in the container to stop and delete the old application, otherwise execute the next step; S5065, the hypervisor in the container reloads the application configuration; The hot loading described in step S5061 is to load the application, which only involves environment variables, resource restrictions and CMD parameters, and the deployment and update of the application can be achieved without rebuilding the host container.
4. According to the method for heterogeneous deployment of power edge based on cloud-edge collaboration according to claim 1, It is characterized in that The edge proxy module preparing the application execution environment in step S517 includes the following steps: S5171, unzip to the specified directory; S5172: If the host machine is updated, the original application is stopped and deleted.
5. The power edge heterogeneous deployment method based on cloud-edge collaboration according to any one of claims 1 to 4, It is characterized in that In step S504 or step S514, the file server returns the application and configuration file stream to the edge proxy module so that the edge proxy module downloads the file package from the file server, including the following steps: S531, the edge proxy module reads the downloaded temporary file and obtains the number of downloaded bytes; S532, the edge proxy module requests the file server to download the file with the download start position; S533, the file server starts transmitting the file stream to the edge proxy module from the specified starting position; S534, the edge proxy module saves the file stream to a temporary file; S535, if the file stream download is interrupted, return to step S531, otherwise rename the temporary file after the download is completed.
6. According to the method for heterogeneous deployment of power edge based on cloud-edge collaboration according to claim 1, It is characterized in that It also includes starting / stopping the container / application, the steps of which are: S81, the management platform front end sends a start / stop request for the container / application to the management platform back end; S82, the management platform backend assembles parameters and sends a start / stop request for the container / application to the edge proxy module; S83, the edge proxy module starts / stops the host application or container, and the edge proxy module returns the processing status to the management platform front end via the management platform back end; S84, the management platform backend records the progress; S85, the edge proxy module polls the request execution progress information and sends the execution progress to the management platform backend; S86, management platform backend records progress; S87, the management platform front end polls the management platform back end for execution progress; S88, the management platform backend returns the execution progress information to the management platform frontend.
7. According to the method for heterogeneous deployment of power edge based on cloud-edge collaboration according to claim 1, It is characterized in that Step S6: The management platform monitors the edge device and the applications running therein, including: S61, the edge proxy module polls to obtain device software and hardware information; S62, the edge proxy module checks whether the data has changed, and if so, updates the database through the edge data receiving server; S63, the management platform front end sends a device hardware and software information query command to the management platform back end; S64, the management platform backend returns the device hardware and software information to the management platform frontend through database query; S65, the management platform front end sends a device time query command to the management platform back end; S66, the management platform backend sends a device time query command to the edge proxy module; S67, the edge proxy module obtains the current time and returns the time information to the management platform front end through the management platform back end.
8. According to the method for heterogeneous deployment of power edge based on cloud-edge collaboration according to claim 1, It is characterized in that Introduce Jenkins software and integrate it with Gitlab to achieve continuous integration and continuous delivery of the application package development and deployment: Among them, the Jenkins pipeline configuration and execution steps are: S901, add credentials, including the account and password credentials for accessing Gitlab, and the account and password credentials for ssh access to the execution node; S902, adding a task execution node, where the execution node is a server used to execute the pipeline; S903, adding task configuration pipeline; S904, manual execution or Gitlab-triggered execution. When Gitlab-triggered execution is used, the Jenkins build trigger address needs to be configured in Gitlab, and the Gitlab administrator needs to allow hook operations; S905, the node executes the pipeline; The steps of the server-side program pipeline are: pull the code from Gitlab, build the application package and archive it, generate the image corresponding to the application and push it to the Harbor warehouse, and notify the execution result by email.
