Cloud-edge collaborative application management method and corresponding device in edge computing
Through unified management of central cloud and sending application management instructions to edge cloud, the problems of low operation and maintenance efficiency and high cost caused by the diversity of edge computing resources are solved, and the unified application management and improvement of operation and maintenance efficiency are achieved.
Patent Information
- Application Number
- CN202210179657.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-25
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2042-02-25
AI Technical Summary
The existing technology is difficult to effectively manage diverse edge computing resources, resulting in low operation and maintenance efficiency and high cost.
Through the central cloud, the target edge virtual machine list, the target container cluster API Server component address and the number of application instances are uniformly determined, and application management instructions are sent to the edge cloud. The edge cloud parses the instructions and performs corresponding application management operations according to the type.
It realizes the unified application management of different computing types, improves operation and maintenance efficiency, and reduces operation and maintenance costs.
Smart Images

Figure CN114625479B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology. Specifically, the present application relates to a cloud-edge collaborative application management method in edge computing and a corresponding device. Background Art
[0002] Edge computing and cloud computing have their own strengths. Cloud computing is good at global, non-real-time, long-term big data processing and analysis, and can play its advantages in long-term maintenance, business decision support and other fields; edge computing is more suitable for local, real-time, short-term data processing and analysis, and can better support the real-time intelligent decision-making and execution of local business. Therefore, the relationship between edge computing and cloud computing is not a substitute, but a complementary and collaborative relationship. Edge computing and cloud computing need to work closely together to better meet the matching of various demand scenarios, thereby amplifying the application value of edge computing and cloud computing. Edge computing is not only close to the execution unit, but also the collection and preliminary processing unit of high-value data required by the cloud, which can better support cloud applications; conversely, the business rules or models output by cloud computing through big data analysis optimization can be sent to the edge side, and edge computing runs based on new business rules or models.
[0003] Since edge nodes are deployed on the edge side, they usually only have a virtualized resource pool consisting of several servers. However, various devices on the terminal are connected to the edge platform through the edge side. Therefore, generally speaking, the pressure of resource shortage on the edge side is relatively large. In many scenarios such as medical, industrial, and Internet of Vehicles, many terminals and sensors are connected to the edge platform through the network. This puts higher demands on the edge cloud. In the edge cloud, there are a large number of various edge servers and edge terminals, which need to be uniformly managed through the edge cloud and support edge applications. The central cloud manages multiple edge cloud platforms, industrial PCs, and a large number of gateways, while the edge cloud accesses various devices, sensors, etc. through edge gateways.
[0004] Cloud-edge collaboration includes collaboration in computing resources, security policies, application management, and business management. Application management collaboration refers to edge nodes providing network value-added application deployment and operating environment; the cloud implements lifecycle management of edge node value-added network applications, including application push, installation, uninstallation, and updates. The central node can incubate and start existing application images on different edge clouds to ensure high availability and hot migration of applications. At present, cloud-edge application management collaboration usually makes edge computing resources into a container cluster in a cloud-native way, and the cloud connects to the edge container cluster interface to install and deploy applications and manage their lifecycle.
[0005] However, due to the diversity of edge computing resources, each edge cloud computing resource is different and may exist in the form of a virtual machine or a physical machine, or in the form of a container, or the same edge cloud may have both a container resource pool and virtual machine resources. If a separate application management strategy is implemented for each edge cloud computing resource, the operation and maintenance efficiency will be greatly reduced and the operation and maintenance cost will be increased. Therefore, there is an urgent need to provide a new cloud-edge collaborative management solution. Summary of the invention
[0006] The purpose of this application is to solve at least one of the above technical defects. The technical solutions provided by the embodiments of this application are as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for managing cloud-edge collaborative applications in edge computing, including:
[0008] Determine the target edge virtual machine list, target container cluster API Server component address, and the number of application instances corresponding to each target edge virtual machine through the central cloud, and send an application management instruction carrying the target edge virtual machine list, target container cluster API Server component address, and the number of virtual machine instances corresponding to each target edge virtual machine to the edge cloud;
[0009] Parse application management instructions through the edge cloud to obtain the target edge virtual machine list, the target container cluster APIServer component address and the application management instruction type;
[0010] If the type of the application management instruction is an application deployment instruction, the corresponding application instance is created through the edge cloud based on the target container cluster APIServer component address, and the corresponding application instance is created based on the target virtual machine list and the number of virtual machine instances corresponding to each target edge virtual machine.
[0011] In an optional embodiment of the present application, the target edge virtual machine list corresponding to the application management, the target container cluster API Server component address, and the number of application instances corresponding to each target edge virtual machine are determined by the central cloud, including:
[0012] When deploying applications, the central cloud is used to obtain application deployment configuration information and the resource status of each edge cloud virtual machine;
[0013] Determine the number of container instances, the number of virtual machine instances, and the number of CPUs and memory required for each virtual machine instance based on the application configuration information; obtain the corresponding number of available CPUs, available memory, and the maximum number of virtual machine instances supported based on the resource conditions of each edge virtual machine;
[0014] Based on the number of virtual machine instances, the number of CPUs and memory required for each virtual machine instance, and the resource conditions of each edge virtual machine, obtain the corresponding number of available CPUs, available memory, and the maximum number of virtual machine instances supported, determine the target edge virtual machine list and the number of application instances corresponding to each target edge virtual machine, and based on the number of container instances, determine the instance copy parameter value to initiate a request to the target container cluster APIServer.
[0015] In an optional embodiment of the present application, based on the number of virtual machine instances, the number of CPUs and the amount of memory required for each virtual machine instance, and the resource conditions of each edge virtual machine, the corresponding number of available CPUs, the amount of available memory, and the maximum number of virtual machine instances supported are obtained, and a list of target edge virtual machines and the number of application instances corresponding to each target edge virtual machine are determined, including:
[0016] The edge virtual machines whose available CPU amount and available memory amount are not less than the CPU amount and memory amount required by each virtual machine instance are determined as the target edge virtual machines to be selected;
[0017] If the number of target edge virtual machines to be selected is not less than the number of virtual machine instances, then randomly select target edge virtual machines of a number corresponding to the number of virtual machine instances from the determined target edge virtual machines to be selected, and determine the selected target edge virtual machines as target edge virtual machines in the target edge virtual machine list, and the number of application instances corresponding to each target edge virtual machine is 1;
[0018] If the number of determined target edge virtual machines to be selected is less than the number of virtual machine instances, all determined target edge virtual machines to be selected will be determined as target edge virtual machines in the target edge virtual machine list, and the corresponding number of application instances will be allocated based on the ratio of the maximum number of virtual machine instances supported by each target edge virtual machine to be selected.
[0019] In an optional embodiment of the present application, a corresponding application instance is created based on the target container cluster API Server component address through the edge cloud, and a corresponding application instance is created based on the target virtual machine list and the number of virtual machine instances corresponding to each target edge virtual machine, including:
[0020] Call the container cluster API Server component interface through the edge cloud, pull the software image package corresponding to the container instance from the edge software asset library through the container cluster API Server component interface, and install the software image package to the target container cluster corresponding to the target container cluster API Server component address;
[0021] The edge agent of each target edge virtual machine is called through the edge cloud, and the software package corresponding to the virtual machine instance is pulled from the edge software asset library through the edge agent, and the software package is installed to the corresponding target edge virtual machine.
[0022] In an optional embodiment of the present application, the method further includes:
[0023] If the software image package corresponding to the container instance is not pulled from the edge software asset library through the container cluster interface, and / or the software package corresponding to the virtual machine instance is not pulled from the edge software asset library through the edge agent, the software image package corresponding to the container instance and / or the software package corresponding to the virtual machine instance is obtained from the central cloud through the edge software asset library.
[0024] In an optional embodiment of the present application, the method further includes:
[0025] If the type of application management instruction is an application lifecycle management instruction, the container cluster interface and the edge agent of each target edge virtual machine are called through the edge cloud, and the application lifecycle management instruction is executed on the container instance in each target container through the container cluster interface, and the application lifecycle management instruction is executed on the virtual machine instance in each target virtual machine through each edge agent.
[0026] In an optional embodiment of the present application, the method further includes:
[0027] If the type of application management instruction is an application service opening instruction, the container cluster interface and the edge agent of each target edge virtual machine are called through the edge cloud, and the application service opening instruction is executed on the container instance in each target container based on the reverse proxy Traefik proxy through the container cluster interface, and the application service opening instruction is executed on the virtual machine instance in each target virtual machine based on the reverse proxy Traefik proxy through each edge agent.
[0028] In a second aspect, an embodiment of the present application provides a cloud-edge collaborative application management device in edge computing, including:
[0029] The application management instruction issuing module is used to determine the target edge virtual machine list, the target container cluster API Server component address, and the number of application instances corresponding to each target edge virtual machine through the central cloud, and send an application management instruction carrying the target edge virtual machine list, the target container cluster API Server component address, and the number of virtual machine instances corresponding to each target edge virtual machine to the edge cloud;
[0030] The application management instruction type determination module is used to parse the application management instruction through the edge cloud to obtain the target edge virtual machine list, the target container cluster API Server component address and the application management instruction type;
[0031] The application deployment module is used to create a corresponding application instance based on the target container cluster API Server component address through the edge cloud if the type of the application management instruction is an application deployment instruction, and to create a corresponding application instance based on the target virtual machine list and the number of virtual machine instances corresponding to each target edge virtual machine.
[0032] In an optional embodiment of the present application, the application management instruction issuing module is specifically used to:
[0033] When deploying applications, the central cloud is used to obtain application deployment configuration information and the resource status of each edge cloud virtual machine;
[0034] Determine the number of container instances, the number of virtual machine instances, and the number of CPUs and memory required for each virtual machine instance based on the application configuration information; obtain the corresponding number of available CPUs, available memory, and the maximum number of virtual machine instances supported based on the resource conditions of each edge virtual machine;
[0035] Based on the number of virtual machine instances, the number of CPUs and memory required for each virtual machine instance, and the resource conditions of each edge virtual machine, obtain the corresponding number of available CPUs, available memory, and the maximum number of virtual machine instances supported, determine the target edge virtual machine list and the number of application instances corresponding to each target edge virtual machine, and based on the number of container instances, determine the target container cluster API Server component address.
[0036] In an optional embodiment of the present application, the application management instruction issuing module is further used to:
[0037] The edge virtual machines whose available CPU amount and available memory amount are not less than the CPU amount and memory amount required by each virtual machine instance are determined as the target edge virtual machines to be selected;
[0038] If the number of target edge virtual machines to be selected is not less than the number of virtual machine instances, then randomly select target edge virtual machines of a number corresponding to the number of virtual machine instances from the determined target edge virtual machines to be selected, and determine the selected target edge virtual machines as target edge virtual machines in the target edge virtual machine list, and the number of application instances corresponding to each target edge virtual machine is 1;
[0039] If the number of determined target edge virtual machines to be selected is less than the number of virtual machine instances, all determined target edge virtual machines to be selected will be determined as target edge virtual machines in the target edge virtual machine list, and the corresponding number of application instances will be allocated based on the ratio of the maximum number of virtual machine instances supported by each target edge virtual machine to be selected.
[0040] In an optional embodiment of the present application, the application deployment module is specifically used to:
[0041] Call the container cluster API Server component interface through the edge cloud, pull the software image package corresponding to the container instance from the edge software asset library through the container cluster API Server component interface, and install the software image package to the target container cluster corresponding to the target container cluster API Server component address;
[0042] The edge agent of each target edge virtual machine is called through the edge cloud, and the software package corresponding to the virtual machine instance is pulled from the edge software asset library through the edge agent, and the software package is installed to the corresponding target edge virtual machine.
[0043] In an optional embodiment of the present application, the application deployment module is further used to:
[0044] If the software image package corresponding to the container instance is not pulled from the edge software asset library through the container cluster interface, and / or the software package corresponding to the virtual machine instance is not pulled from the edge software asset library through the edge agent, the software image package corresponding to the container instance and / or the software package corresponding to the virtual machine instance is obtained from the central cloud through the edge software asset library.
[0045] In an optional embodiment of the present application, the device further includes an application lifecycle management module, which is used to:
[0046] If the type of application management instruction is an application lifecycle management instruction, the container cluster interface and the edge agent of each target edge virtual machine are called through the edge cloud, and the application lifecycle management instruction is executed on the container instance in each target container through the container cluster interface, and the application lifecycle management instruction is executed on the virtual machine instance in each target virtual machine through each edge agent.
[0047] In an optional embodiment of the present application, the device further includes an application service opening module, which is used to:
[0048] If the type of application management instruction is an application service opening instruction, the container cluster interface and the edge agent of each target edge virtual machine are called through the edge cloud, and the application service opening instruction is executed on the container instance in each target container based on the reverse proxy Traefik proxy through the container cluster interface, and the application service opening instruction is executed on the virtual machine instance in each target virtual machine based on the reverse proxy Traefik proxy through each edge agent.
[0049] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor;
[0050] A computer program is stored in the memory;
[0051] A processor is used to execute a computer program to implement the method provided in the embodiment of the first aspect or any optional embodiment of the first aspect.
[0052] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method provided in the embodiment of the first aspect or any optional embodiment of the first aspect is implemented.
[0053] In a fifth aspect, an embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that when the computer device executes, the method provided in the embodiment of the first aspect or any optional embodiment of the first aspect is implemented.
[0054] The beneficial effects of the technical solution provided by this application are:
[0055] The target container cluster API Server component address, target edge virtual machine list, and corresponding number of virtual machine instances in each edge virtual machine corresponding to the application management are determined through the central cloud, and the determined information is sent to the edge cloud. After the edge cloud performs analysis, it performs corresponding application management according to the application management type. When application deployment is required, the edge cloud creates the corresponding application instance based on the target container cluster API Server component address, and creates the corresponding application instance based on the target virtual machine list and the number of virtual machine instances corresponding to each target edge virtual machine, thus completing the application deployment. This solution uniformly determines the application management related information through the cloud, and then uniformly executes it through the edge end. There is no need to perform application management separately according to the computing resource type of the edge node, that is, it unifies the application management of different computing types, greatly improves the operation and maintenance efficiency, and reduces the operation and maintenance cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in describing the embodiments of the present application.
[0057] Figure 1 An architecture diagram of the cloud-edge collaborative application management system provided for the embodiment of the present application;
[0058] Figure 2 A flowchart of a method for managing cloud-edge collaborative applications in edge computing provided in an embodiment of the present application;
[0059] Figure 3 A schematic diagram of a process of resource scheduling by a resource scheduler in an example of an embodiment of the present application;
[0060] Figure 4A schematic diagram of a process of application deployment in an example of an embodiment of the present application;
[0061] Figure 5 A schematic diagram of an application lifecycle management process in an example of an embodiment of the present application;
[0062] Figure 6 A schematic diagram of a process of opening an application service in an example of an embodiment of the present application;
[0063] Figure 7 A structural block diagram of a cloud-edge collaborative application management device in edge computing is provided for an embodiment of the present application;
[0064] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.
[0066] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0067] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0068] Figure 1 This is an architecture diagram of the cloud-edge collaborative application management system provided in an embodiment of the present application. The system is the basis for implementing the cloud-edge collaborative application management method in edge computing provided in the present application. The system is divided into the cloud and edge.
[0069] Specifically, the cloud is equipped with a cloud console (hereinafter referred to as the central cloud), including: software asset library management module, edge host management module, edge container cluster management interface module, edge service open management module, edge application lifecycle management module and resource scheduler module. Specifically, the functions and effects of each module are as follows:
[0070] Software asset library management module: It unifies the two types of resources, image resources and software packages. The main attributes of the software asset model include software asset number, software asset name, introduction and icon. Software assets under the same number can contain software assets of different versions. For example, business application A contains versions 1.0 and 1.1. Each version corresponds to a software image package and a software package (war package or jar package of business application, and the associated operating environment such as JDK required by the Java application operating environment or the operating environment required by the application developed in C++). The basic information of business applications can be configured through the software asset library, and different versions of business applications can be uploaded and downloaded. The software asset library management module can open interfaces to connect to the CI / CD (continuous integration / continuous deployment) pipeline of the DevOps (Development and Operations, a general term for processes, methods and systems) platform.
[0071] Edge host management module: includes edge virtual machine or physical machine IP, edge host open port range, edge host account password, CPU, memory, available CPU, available memory and other information maintenance.
[0072] Edge container cluster management interface module: Edge
[0073] Edge service open module: refers to the real-time update of the edge service open configuration file according to the open policy configured in the cloud console after the application on the edge host is started, so as to achieve the purpose of edge application load balancing, current limiting, etc.
[0074] Edge application lifecycle management module: mainly includes edge application template management and edge application lifecycle management. Application template management unifies the configuration of virtual machine applications and container applications. The template mainly includes application basic information configuration, resource configuration information and runtime configuration. Application basic information attributes include application code, application name and description information. Application resource configuration information includes template-associated software asset selection, software asset version selection, number of CPUs, memory and network configuration (container port, protocol, whether to enable load balancing, etc.) required for single application operation. Application runtime configuration includes elastic scaling configuration (initial replica, maximum replica, minimum replica, scaling indicators, etc.), environment variable configuration, health detection configuration (detection cycle configuration, detection execution command, etc.) and script configuration (deployment script, start script, stop script, etc.). Edge application lifecycle management refers to the deployment, start, stop, uninstall and other operations of applications deployed at the edge. When deploying applications, you can configure the deployment container application instance ratio and virtual application instance ratio, and the background scheduler will schedule resources according to the ratio.
[0075] Resource scheduler module: Calculates the number of container instances and virtual machine instances based on the number of replicas configured for application deployment (i.e., the total number of application instances) and the ratio of container and virtual machine application instances. The virtual machine instance calculates the virtual machine host list and the number of instances deployed on each host based on the available CPU, memory, and storage information in the virtual machine host pool.
[0076] Specifically, the edge end is equipped with an edge EdgeServer (edge server), an edge software asset library, an edge service gateway, an edge host, and an edge EdgeAgent (edge agent). Specifically, the functions and effects of each module are as follows:
[0077] Edge EdgeServer: The edge EdgeServer mainly receives the application management instructions issued by the cloud console, parses the type of instructions that need to be executed, and if it is an installation and deployment, it is scheduled according to the number of virtual machine instances and container instances calculated by the scheduler. When the virtual machine instance is deployed or started and stopped, the edge EdgeServer sends a command to the edge EdgeAgent using the GRPC (Remote Procedure Call) protocol, and the edge EdgeAgent performs related operations after receiving the command. When the container instance is deployed or started and stopped, the container cluster interface (such as K3S (lightweight Kubernetes) API) is called to perform related operations. The container cluster interface is also called the container cluster API Server component interface. Each container cluster has a cluster API Server component interface address, and the interface address can be called to deploy and upgrade applications. Operations such as. It should be noted that the container cluster can also be K8S or other container clusters, which can be selected according to actual needs and are not limited in the embodiments of this application.
[0078] Edge software asset library: used as a cache for the cloud software warehouse to avoid pulling all software assets directly from the cloud warehouse, which would block the cloud-edge collaboration channel. When installing and deploying applications, first go to the edge software asset library to pull software resources. If the edge software asset library cannot find the software resources to be installed, the edge software asset library will initiate a request to synchronize the required software resources from the cloud software asset library management module to the edge asset library, and start the installation after the synchronization is completed.
[0079] Edge service gateway: The proxy layer for edge application access can realize load balancing, traffic control, and grayscale release of edge application services through service open configuration.
[0080] Edge host: edge virtual machine resources or edge physical machines, used by the scheduler for resource scheduling and calculation.
[0081] EdgeAgent: Each edge virtual machine will have a corresponding EdgeAgent, which is called to perform operations such as instance installation and application lifecycle management.
[0082] It should be noted that the cloud and edge are connected through a dedicated line. The edge only has an edge EdgeServer. The edge software asset library can be connected to the cloud through a dedicated line. Other operations need to forward requests through the edge EdgeServer.
[0083] Due to security requirements, the edge host cannot open the SSH (Secure Shell) protocol port. In the embodiment of the present application, the edge agent of the edge host opens a common port and receives instructions sent by the edge EdgeServer based on the GRPC protocol.
[0084] It can be understood that the system, under the collaboration of cloud and edge, shields the differences in edge hosts (virtual machines / physical machines) and container application deployment to provide a consistent application management and operation experience, unifies the software asset model, unifies the application template model, and realizes unified scheduling of edge and container resources by implementing a unified resource scheduler algorithm for virtual machines and containers.
[0085] The edge computing cloud-edge collaborative application management method proposed in this application will be described in detail below based on the above-mentioned system, the functions of each module in the system, and the interaction between each module.
[0086] Figure 2 A flowchart of a method for managing cloud-edge collaborative applications in edge computing provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, including:
[0087] Step S201, determines the target edge virtual machine list corresponding to the application management, the target container cluster API Server component address, and the number of application instances corresponding to each target edge virtual machine through the central cloud, and sends an application management instruction carrying the target edge virtual machine list, the target container cluster API Server component address, and the number of virtual machine instances corresponding to each target edge virtual machine to the edge cloud.
[0088] The central cloud is the cloud console mentioned above. Operation and maintenance personnel can configure application management configuration information through the central cloud operation interface.
[0089] Among them, the edge cloud is more specifically the edge EdgeServer described above, which can communicate with the central cloud and call the edge agent of each virtual machine and the container cluster interface.
[0090] Among them, due to different computing resources, application instances can have virtual machine instances and container instances.
[0091] Specifically, when the central cloud receives the application management configuration information uploaded by the operation and maintenance personnel, it determines the target edge virtual machine list corresponding to the application management, the target container cluster API Server component address, and the number of virtual machine instances corresponding to each target edge virtual machine. Then, the central cloud carries the determined information in the application control instruction and sends it to the edge cloud.
[0092] Step S202, parse the application management instruction through the edge cloud to obtain the target edge virtual machine list, the target container cluster API Server component address and the application management instruction type.
[0093] Specifically, there are many types of application management instructions, including application deployment, application lifecycle management, and application service opening. After receiving the application management command, the edge cloud parses it to obtain the instruction type, the edge virtual machine list carried in it, and the target container cluster API Server component address.
[0094] Step S203, if the type of the application management instruction is an application deployment instruction, a corresponding application instance is created through the edge cloud based on the target container cluster API Server component address, and a corresponding application instance is created based on the target virtual machine list and the number of virtual machine instances corresponding to each target edge virtual machine.
[0095] Specifically, if the type of application management instruction is an application deployment instruction, application deployment is required. A container instance is created in the corresponding target container according to the target container cluster API Server component address, and a virtual machine instance is created in the corresponding target virtual machine according to the target virtual machine list. It should be noted that one or more virtual machine instances can be created in each target virtual machine. The number of virtual machine instances in each target virtual machine has been determined by the central cloud, and can be created according to the determined number of virtual machines.
[0096] The solution provided by the embodiment of the present application determines the target container cluster APIServer component address, the target edge virtual machine list, and the number of virtual machine instances corresponding to the application management through the central cloud, and sends the determined information to the edge cloud. After the edge cloud performs analysis, it performs corresponding application management according to the application management type. When application deployment is required, the edge cloud creates a corresponding application instance based on the target container cluster API Server component address, and creates a corresponding application instance based on the target virtual machine list and the number of virtual machine instances corresponding to each target edge virtual machine, thus completing the application deployment. This solution uniformly determines the application management related information through the cloud, and then uniformly executes it through the edge end. There is no need to perform application management separately according to the computing resource type of the edge node, that is, it unifies the application management of different computing types, greatly improves the operation and maintenance efficiency, and reduces the operation and maintenance cost.
[0097] In an optional embodiment of the present application, the target edge virtual machine list corresponding to the application management, the target container cluster API Server component address, and the number of application instances corresponding to each target edge virtual machine are determined by the central cloud, including:
[0098] When deploying applications, the central cloud is used to obtain application deployment configuration information and the resource status of each edge cloud virtual machine;
[0099] Determine the number of container instances, the number of virtual machine instances, and the number of CPUs and memory required for each virtual machine instance based on the application configuration information; obtain the corresponding number of available CPUs, available memory, and the maximum number of virtual machine instances supported based on the resource conditions of each edge virtual machine;
[0100] Based on the number of virtual machine instances, the number of CPUs and memory required for each virtual machine instance, and the resource conditions of each edge virtual machine, obtain the corresponding number of available CPUs, available memory, and the maximum number of virtual machine instances supported, determine the target edge virtual machine list and the number of application instances corresponding to each target edge virtual machine, and based on the number of container instances, determine the target container cluster API Server component address.
[0101] Specifically, the target container cluster APIServer component address can be determined based on the number of container instances that need to be deployed when the application is deployed. According to the number of virtual machine instances that need to be deployed when the application is deployed, and the number of CPUs and memory required for each virtual machine instance, the target edge virtual machine with appropriate resources is matched to determine the target edge virtual machine list.
[0102] Specifically, based on the number of virtual machine instances, the number of CPUs and memory required for each virtual machine instance, and the resource conditions of each edge virtual machine, the corresponding number of available CPUs, available memory, and the maximum number of virtual machine instances supported are obtained, and the target edge virtual machine list and the number of application instances corresponding to each target edge virtual machine are determined, including:
[0103] The edge virtual machines whose available CPU amount and available memory amount are not less than the CPU amount and memory amount required by each virtual machine instance are determined as the target edge virtual machines to be selected;
[0104] If the number of target edge virtual machines to be selected is not less than the number of virtual machine instances, then randomly select target edge virtual machines of a number corresponding to the number of virtual machine instances from the determined target edge virtual machines to be selected, and determine the selected target edge virtual machines as target edge virtual machines in the target edge virtual machine list, and the number of application instances corresponding to each target edge virtual machine is 1;
[0105] If the number of determined target edge virtual machines to be selected is less than the number of virtual machine instances, all determined target edge virtual machines to be selected will be determined as target edge virtual machines in the target edge virtual machine list, and the corresponding number of application instances will be allocated based on the ratio of the maximum number of virtual machine instances supported by each target edge virtual machine to be selected.
[0106] For example, if Figure 3As shown in the figure, when application A needs to be deployed, the central cloud creates application A, configures the number of CPUs used for application A to run as 2, the number of memories as 3, and the number of initial application deployment copies as 10 (i.e., the total number of application instances is 10), the number of virtual machine instances accounts for 70%, and the number of container instances accounts for 30%. According to the total number of copies of application A and the proportion of virtual machine and container instances, the number of virtual machine application instances is calculated to be 7 and the number of container application instances is 3.
[0107] The virtual machine application first selects the hosts (192.168.1.101, 192.168.1.102, 192.168.1.104, 192.168.1.105) that meet the resource requirements for deploying application A from the edge virtual machine list based on the number of available CPUs and available memory of the virtual machines every day. If the number of hosts selected is greater than the number of virtual machine application instances (7), then a random allocation method is used to deploy an instance of application A on each host. In reality, only 4 machines meet the conditions. Then, we calculate the maximum number of instances of application A that can be deployed on each machine (i.e., the maximum number of virtual machine instances supported), and use a weighted average allocation algorithm based on the maximum number of deployable instances to allocate the number of instances deployed on each host. In this example, the instance allocation is as follows (192.168.1.101 deploys 1 instance, 192.168.1.102 deploys two instances, 192.168.1.104 deploys 1 instance, and 192.168.1.105 deploys 3 instances). Generate a resource deployment list, which is a list of virtual machine hosts and the number of instances deployed on each machine and the number of container deployment instances, and send it to the edge EdgeServer. The deployment of container instances calls the K3S container cluster interface to create container instances, and the deployment of virtual machine instances calls the edge agent corresponding to each edge virtual machine in the target edge virtual machine list to complete application creation.
[0108] It should be noted that this example does not provide a specific description of prompting the central cloud for insufficient resources or dynamically adjusting the number of application instances. It is intended to illustrate the unified scheduling of container and virtual machine resources through the resource scheduler to shield scheduling differences. The relevant scheduling algorithms can be implemented in different ways, which are not limited in the embodiments of this application.
[0109] In an optional embodiment of the present application, a corresponding application instance is created based on the target container cluster API Server component address through the edge cloud, and a corresponding application instance is created based on the target virtual machine list and the number of virtual machine instances corresponding to each target edge virtual machine, including:
[0110] Call the container cluster API Server component interface through the edge cloud, pull the software image package corresponding to the container instance from the edge software asset library through the container cluster API Server component interface, and install the software image package to the target container cluster corresponding to the target container cluster API Server component address;
[0111] The edge agent of each target edge virtual machine is called through the edge cloud, and the software package corresponding to the virtual machine instance is pulled from the edge software asset library through the edge agent, and the software package is installed to the corresponding target edge virtual machine.
[0112] Specifically, when deploying applications, for the deployment of container instances, the edge cloud needs to call the container cluster interface to complete it, and for the deployment of virtual machine instances, the edge cloud needs to call the edge agent of each target edge virtual machine to complete it.
[0113] Furthermore, if the software image package corresponding to the container instance is not pulled from the edge software asset library through the container cluster interface, and / or the software package corresponding to the virtual machine instance is not pulled from the edge software asset library through the edge agent, the software image package corresponding to the container instance and / or the software package corresponding to the virtual machine instance is obtained from the central cloud through the edge software asset library.
[0114] Specifically, if Figure 4 As shown in the figure, the operation and maintenance personnel issue application deployment instructions in the cloud console and send instruction data packets to the edge EdgeServer through the cloud-edge collaborative channel using the GRPC protocol.
[0115] The edge EdgeServer parses the received instruction information packet to parse out the instruction type (application installation deployment type), the number of virtual machine instances, the edge virtual machine list, and the number of container instances.
[0116] If the target is a virtual machine, the deployment instruction information is sent to all virtual machine agents using the GRPC protocol. The edge virtual machine agent receives the instruction sent by the edge gateway, parses the instruction type as application installation deployment, and first determines whether the application running dependent environment (c++ / java / python, etc.) is installed. If it is installed, the application installation command is executed. Otherwise, the application running dependent environment is installed first, and then the application installation is executed. According to the running environment type, the edge software warehouse (i.e., edge software asset library) is used to pull the software package required for the running environment. If the corresponding software package exists in the edge software warehouse, the software package installation is initiated.
[0117] If the target is a container, the container cluster management interface (i.e., container K3S cluster management API interface) is called to execute the corresponding installation command.
[0118] When executing the installation command, the edge virtual machine agent and container will go to the edge software warehouse to pull software resources. When the required software resources do not exist in the edge software warehouse, the edge software warehouse will initiate a request to the cloud software warehouse (that is, the cloud software asset management module), synchronize the required software packages to the edge software warehouse and cache them, and then initiate the software resource installation.
[0119] After the application installation and deployment is completed, the edge EdgeServer sends the application installation and deployment completion status to the cloud console through the cloud-edge collaborative channel, and the cloud console updates the application installation and deployment task status.
[0120] In an optional embodiment of the present application, the method may further include:
[0121] If the type of application management instruction is an application lifecycle management instruction, the container cluster interface and the edge agent of each target edge virtual machine are called through the edge cloud, and the application lifecycle management instruction is executed on the container instance in each target container through the container cluster interface, and the application lifecycle management instruction is executed on the virtual machine instance in each target virtual machine through each edge agent.
[0122] Specifically, if Figure 5 As shown in the figure, the operation and maintenance personnel issue application lifecycle management instructions in the cloud console and send instruction data packets to the edge EdgeServer through the cloud-edge collaborative channel using the GRPC protocol.
[0123] The edge EdgeServer parses the received instruction information packet to parse out the instruction type (application lifecycle management type) and execution target.
[0124] If the execution target is a virtual machine, the deployment instruction information is sent to all virtual machine agents (i.e. edge agents) in the list using the GRPC protocol. The edge virtual machine agent receives the instruction sent by the edge EdgeServer, parses the instruction type as the application lifecycle management type, the specific command (start / stop / restart / uninstall), and then executes the specific instruction on the edge virtual machine.
[0125] If the execution target is a container, the container management control API interface is called to execute the corresponding command (start / stop / restart / uninstall).
[0126] After the application lifecycle management operation is completed, the edge EdgeServer sends the application lifecycle completion status to the cloud console through the cloud-edge collaboration channel, and the cloud console updates the application lifecycle operation task status.
[0127] In an optional embodiment of the present application, the method may further include:
[0128] If the type of application management instruction is an application service opening instruction, the container cluster interface and the edge agent of each target edge virtual machine are called through the edge cloud, and the application service opening instruction is executed on the container instance in each target container based on the reverse proxy Traefik proxy through the container cluster interface, and the application service opening instruction is executed on the virtual machine instance in each target virtual machine based on the reverse proxy Traefik proxy through each edge agent.
[0129] Specifically, if Figure 6 As shown in the figure, the external exposure of edge applications (container applications, virtual machine applications) can be completed by using Traefik Proxy, which supports configuring open policies for virtual machine application services and container application services respectively. By collaboratively generating configuration files for policies at the edge or creating ingressroute resources in K3S, service opening is achieved through the service gateway, and policies take effect dynamically.
[0130] The operation and maintenance personnel issue service opening instructions in the cloud console and send command data packets to the edge EdgeServer through the cloud-edge collaborative channel using the GRPC protocol.
[0131] The edge gateway parses the received instruction information packet to parse out the instruction type (service exposure type) and execution target.
[0132] If the target is a virtual machine, a service open configuration file is generated through a template, and the file is sent to the virtual machine agent EdgeAgent in the list of all target virtual machines using the GRPC protocol. The edge virtual machine agent EdgeAgent transfers the file to the automatic discovery directory of traefikproxy (i.e., Traefik Providers File).
[0133] If the target is a container, the container management control API interface is called to directly create the ingressroute resource in K3S. By specifying different labels for ingressroute, it is determined which traefik proxy is used to request the load. Grayscale release will also be based on the traefik proxy.
[0134] Figure 7 The present application provides a structural block diagram of a cloud-edge collaborative application management device in edge computing, such as Figure 7 As shown, the device 700 may include: an application management instruction issuing module 701, an application management instruction type determining module 702, and an application deployment module 703, wherein:
[0135] The application management instruction issuing module 701 is used to determine the target edge virtual machine list, the target container cluster API Server component address, and the number of application instances corresponding to each target edge virtual machine corresponding to the application management through the central cloud, and send an application management instruction carrying the target edge virtual machine list, the target container cluster API Server component address, and the number of virtual machine instances corresponding to each target edge virtual machine to the edge cloud;
[0136] The application management instruction type determination module 702 is used to parse the application management instruction through the edge cloud to obtain the target edge virtual machine list, the target container cluster API Server component address and the application management instruction type;
[0137] The application deployment module 703 is used to create a corresponding application instance based on the target container cluster API Server component address through the edge cloud if the type of the application management instruction is an application deployment instruction, and to create a corresponding application instance based on the target virtual machine list and the number of virtual machine instances corresponding to each target edge virtual machine.
[0138] The solution provided by the embodiment of the present application determines the target container cluster APIServer component address, the target edge virtual machine list, and the number of virtual machine instances corresponding to the application management through the central cloud, and sends the determined information to the edge cloud. After the edge cloud performs analysis, it performs corresponding application management according to the application management type. When application deployment is required, the edge cloud creates a corresponding application instance based on the target container cluster API Server component address, and creates a corresponding application instance based on the target virtual machine list and the number of virtual machine instances corresponding to each target edge virtual machine, thus completing the application deployment. This solution uniformly determines the application management related information through the cloud, and then uniformly executes it through the edge end. There is no need to perform application management separately according to the computing resource type of the edge node, that is, it unifies the application management of different computing types, greatly improves the operation and maintenance efficiency, and reduces the operation and maintenance cost.
[0139] In an optional embodiment of the present application, the application management instruction issuing module is specifically used to:
[0140] When deploying applications, the central cloud is used to obtain application deployment configuration information and the resource status of each edge cloud virtual machine;
[0141] Determine the number of container instances, the number of virtual machine instances, and the number of CPUs and memory required for each virtual machine instance based on the application configuration information; obtain the corresponding number of available CPUs, available memory, and the maximum number of virtual machine instances supported based on the resource conditions of each edge virtual machine;
[0142] Based on the number of virtual machine instances, the number of CPUs and memory required for each virtual machine instance, and the resource conditions of each edge virtual machine, obtain the corresponding number of available CPUs, available memory, and the maximum number of virtual machine instances supported, determine the target edge virtual machine list and the number of application instances corresponding to each target edge virtual machine, and based on the number of container instances, determine the target container cluster API Server component address.
[0143] In an optional embodiment of the present application, the application management instruction issuing module is further used to:
[0144] The edge virtual machines whose available CPU amount and available memory amount are not less than the CPU amount and memory amount required by each virtual machine instance are determined as the target edge virtual machines to be selected;
[0145] If the number of target edge virtual machines to be selected is not less than the number of virtual machine instances, then randomly select target edge virtual machines of a number corresponding to the number of virtual machine instances from the determined target edge virtual machines to be selected, and determine the selected target edge virtual machines as target edge virtual machines in the target edge virtual machine list, and the number of application instances corresponding to each target edge virtual machine is 1;
[0146] If the number of determined target edge virtual machines to be selected is less than the number of virtual machine instances, all determined target edge virtual machines to be selected will be determined as target edge virtual machines in the target edge virtual machine list, and the corresponding number of application instances will be allocated based on the ratio of the maximum number of virtual machine instances supported by each target edge virtual machine to be selected.
[0147] In an optional embodiment of the present application, the application deployment module is specifically used to:
[0148] Call the container cluster API Server component interface through the edge cloud, pull the software image package corresponding to the container instance from the edge software asset library through the container cluster API Server component interface, and install the software image package to the target container cluster corresponding to the target container cluster API Server component address;
[0149] The edge agent of each target edge virtual machine is called through the edge cloud, and the software package corresponding to the virtual machine instance is pulled from the edge software asset library through the edge agent, and the software package is installed to the corresponding target edge virtual machine.
[0150] In an optional embodiment of the present application, the application deployment module is further used to:
[0151] If the software image package corresponding to the container instance is not pulled from the edge software asset library through the container cluster interface, and / or the software package corresponding to the virtual machine instance is not pulled from the edge software asset library through the edge agent, the software image package corresponding to the container instance and / or the software package corresponding to the virtual machine instance is obtained from the central cloud through the edge software asset library.
[0152] In an optional embodiment of the present application, the device further includes an application lifecycle management module, which is used to:
[0153] If the type of application management instruction is an application lifecycle management instruction, the container cluster interface and the edge agent of each target edge virtual machine are called through the edge cloud, and the application lifecycle management instruction is executed on the container instance in each target container through the container cluster interface, and the application lifecycle management instruction is executed on the virtual machine instance in each target virtual machine through each edge agent.
[0154] In an optional embodiment of the present application, the device further includes an application service opening module, which is used to:
[0155] If the type of application management instruction is an application service opening instruction, the container cluster interface and the edge agent of each target edge virtual machine are called through the edge cloud, and the application service opening instruction is executed on the container instance in each target container based on the reverse proxy Traefik proxy through the container cluster interface, and the application service opening instruction is executed on the virtual machine instance in each target virtual machine based on the reverse proxy Traefik proxy through each edge agent.
[0156] Reference below Figure 8 , which shows an electronic device suitable for implementing the embodiments of the present application (for example, executing Figure 2 The electronic device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), wearable devices, etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0157] The electronic device includes: a memory and a processor, the memory is used to store a program for executing the method described in each of the above method embodiments; the processor is configured to execute the program stored in the memory. The processor here can be referred to as the processing device 801 described below, and the memory can include at least one of the read-only memory (ROM) 802, the random access memory (RAM) 803, and the storage device 808 described below, as shown below:
[0158] like Figure 8As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0159] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0160] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 809, or installed from the storage device 808, or installed from the ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present application are executed.
[0161] It should be noted that the computer-readable storage medium mentioned above in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0162] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0163] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0164] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0165] The target edge virtual machine list, target container cluster API Server component address, and the number of application instances corresponding to each target edge virtual machine corresponding to the application management are determined through the central cloud, and an application management instruction carrying the target edge virtual machine list, target container cluster API Server component address, and the number of virtual machine instances corresponding to each target edge virtual machine is sent to the edge cloud; the application management instruction is parsed through the edge cloud to obtain the target edge virtual machine list, target container cluster API Server component address, and application management instruction type; if the type of application management instruction is an application deployment instruction, the corresponding application instance is created through the edge cloud based on the target container cluster API Server component address, and the corresponding application instance is created based on the target virtual machine list and the number of virtual machine instances corresponding to each target edge virtual machine.
[0166] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0167] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0168] The modules or units involved in the embodiments of the present application may be implemented by software or hardware. The name of a module or unit does not limit the unit itself in some cases. For example, the first program switching module may also be described as a "module for switching the first program".
[0169] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0170] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0171] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific method implemented when the above-described computer-readable medium is executed by an electronic device can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0172] The embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that when the computer device executes the computer instructions, the following conditions are achieved:
[0173] The target edge virtual machine list, target container cluster API Server component address, and the number of application instances corresponding to each target edge virtual machine corresponding to the application management are determined through the central cloud, and an application management instruction carrying the target edge virtual machine list, target container cluster API Server component address, and the number of virtual machine instances corresponding to each target edge virtual machine is sent to the edge cloud; the application management instruction is parsed through the edge cloud to obtain the target edge virtual machine list, target container cluster API Server component address, and application management instruction type; if the type of application management instruction is an application deployment instruction, the corresponding application instance is created through the edge cloud based on the target container cluster API Server component address, and the corresponding application instance is created based on the target virtual machine list and the number of virtual machine instances corresponding to each target edge virtual machine.
[0174] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0175] The above descriptions are only some embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for managing cloud-edge collaborative applications in edge computing, characterized in that: include: Determine the target edge virtual machine list, the target container cluster API Server component address, and the number of application instances corresponding to each target edge virtual machine through the central cloud, and send an application management instruction carrying the target edge virtual machine list, the target container cluster API Server component address, and the number of virtual machine instances corresponding to each target edge virtual machine to the edge cloud; Parsing the application management instruction through the edge cloud to obtain the target edge virtual machine list, the target container cluster API Server component address and the application management instruction type; If the type of the application management instruction is an application deployment instruction, the edge cloud creates a corresponding application instance based on the target container cluster API Server component address, and creates a corresponding application instance based on the target edge virtual machine list and the number of virtual machine instances corresponding to each target edge virtual machine.
2. The method according to claim 1, characterized in that: The method of determining the target edge virtual machine list corresponding to the application management, the target container cluster API Server component address, and the number of application instances corresponding to each target edge virtual machine through the central cloud includes: When deploying an application, the central cloud is used to obtain the application deployment configuration information and the resource status of each edge cloud virtual machine; Determine the number of container instances, the number of virtual machine instances, and the number of CPUs and memory required for each virtual machine instance based on the application configuration information; obtain the corresponding number of available CPUs, the amount of available memory, and the maximum number of virtual machine instances supported based on the resource conditions of each edge virtual machine; Based on the number of virtual machine instances, the number of CPUs and memory required for each virtual machine instance, and the resource conditions of each edge virtual machine, the corresponding number of available CPUs, available memory, and the maximum number of virtual machine instances supported are obtained, and the target edge virtual machine list and the number of application instances corresponding to each target edge virtual machine are determined. Based on the number of container instances, the instance copy parameter value is determined to be initiated to request the target container cluster APIServer.
3. The method according to claim 2, characterized in that Based on the number of virtual machine instances, the number of CPUs and the amount of memory required for each virtual machine instance, and the resource conditions of each edge virtual machine, the corresponding number of available CPUs, the amount of available memory, and the maximum number of virtual machine instances supported are obtained, and a list of target edge virtual machines and the number of application instances corresponding to each target edge virtual machine are determined, including: The edge virtual machines whose available CPU amount and available memory amount are not less than the CPU amount and memory amount required by each virtual machine instance are determined as the target edge virtual machines to be selected; If the number of target edge virtual machines to be selected is not less than the number of virtual machine instances, randomly select target edge virtual machines of a number corresponding to the number of virtual machine instances from the determined target edge virtual machines to be selected, and determine the selected target edge virtual machines as target edge virtual machines in the target edge virtual machine list, and the number of application instances corresponding to each target edge virtual machine is 1; If the number of target edge virtual machines determined to be selected is less than the number of virtual machine instances, the determined target edge virtual machines to be selected will all be determined as target edge virtual machines in the target edge virtual machine list, and the corresponding number of application instances will be allocated based on the ratio of the maximum number of virtual machine instances supported by each target edge virtual machine to be selected.
4. The method according to claim 1, characterized in that The creating a corresponding application instance based on the target container cluster API Server component address through the edge cloud, and creating a corresponding application instance based on the target virtual machine list and the number of virtual machine instances corresponding to each target edge virtual machine, includes: Calling the container cluster API Server component interface through the edge cloud, and pulling the software image package corresponding to the container instance from the edge software asset library through the container cluster API Server component interface, and installing the software image package to the target container cluster corresponding to the target container cluster API Server component address; The edge agent of each target edge virtual machine is called through the edge cloud, and the software package corresponding to the virtual machine instance is pulled from the edge software asset library through the edge agent, and the software package is installed to the corresponding target edge virtual machine.
5. The method according to claim 4, characterized in that The method further comprises: If the software image package corresponding to the container instance is not pulled from the edge software asset library through the container cluster interface, and / or the software package corresponding to the virtual machine instance is not pulled from the edge software asset library through the edge agent, the software image package corresponding to the container instance and / or the software package corresponding to the virtual machine instance is obtained from the central cloud through the edge software asset library.
6. The method according to claim 1, characterized in that The method further comprises: If the type of the application management instruction is an application lifecycle management instruction, the container cluster interface and the edge agent of each target edge virtual machine are called through the edge cloud, and the application lifecycle management instruction is executed on the container instance in each target container through the container cluster interface, and the application lifecycle management instruction is executed on the virtual machine instance in each target virtual machine through each edge agent.
7. The method according to claim 1, characterized in that The method further comprises: If the type of the application management instruction is an application service opening instruction, the container cluster interface and the edge agent of each target edge virtual machine are called through the edge cloud, and the application service opening instruction is executed on the container instance in each target container based on the reverse proxy Traefik proxy through the container cluster interface, and the application service opening instruction is executed on the virtual machine instance in each target virtual machine based on the reverse proxy Traefik proxy through each edge agent.
8. A cloud-edge collaborative application management device in edge computing, characterized in that: include: The application management instruction issuing module is used to determine the target edge virtual machine list, the target container cluster API Server component address, and the number of application instances corresponding to each target edge virtual machine through the central cloud, and send an application management instruction carrying the target edge virtual machine list, the target container cluster API Server component address, and the number of virtual machine instances corresponding to each target edge virtual machine to the edge cloud; An application management instruction type determination module is used to parse the application management instruction through the edge cloud to obtain the target edge virtual machine list, the target container cluster APIServer component address and the application management instruction type; An application deployment module is used to create a corresponding application instance based on the target container cluster API Server component address through the edge cloud if the type of the application management instruction is an application deployment instruction, and to create a corresponding application instance based on the target edge virtual machine list and the number of virtual machine instances corresponding to each target edge virtual machine.
9. An electronic device, characterized in that: including memory and processor; The memory stores a computer program; The processor is configured to execute the computer program to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and device for deploying virtual machine and container
CN111722906A
Cloud edge collaboration system construction method and device, equipment and readable medium
CN111901173A