A container service management method and device
By determining the target container in the container service management method and performing service migration, the problem of containerized services cannot be hot-plugged and resource utilization is improved.
Patent Information
- Application Number
- CN202510446222.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-04-10
AI Technical Summary
In the prior art, containerized services cannot be hot-plugged when started, resulting in some services occupying independent containers, resulting in waste of resources and affecting cluster resource utilization.
Through the service configuration module, the target container is determined according to the container service query table, and the command is sent to the container scheduling platform to create a new container, load the services to be loaded and the services in the target container, and destroy the target container to achieve service migration.
It improves the load capacity of a single container, saves system resources, and improves cluster resource utilization.
Smart Images

Figure CN119960921B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of computer technology, and in particular, to a container service management method and apparatus. Background Art
[0002] Containerization technology has become the mainstream implementation method for cluster resource services, but the resource utilization problem in specific scenarios deserves attention. Currently, there are some service resources that can only be loaded when the container starts, and cannot be loaded in a hot-pluggable manner during the container startup process. This may lead to some services being individually loaded into a container to run when starting, but these individual services do not need to occupy independent containers. As the number of such services increases, it results in the container running at a low load, while the container itself requires more system resources.
[0003] As the business scale expands, the number of container instances with the above situation will linearly increase with the growth of the service volume and quickly reach the upper limit of the cluster resources. At this time, a large number of low-load containers are essentially in a state of resource vacancy, resulting in low utilization rate of computing resources and severely restricting the elastic scaling ability of the containerized architecture.
[0004] Therefore, how to improve the utilization rate of cluster resources is an urgent problem to be solved. Summary of the Invention
[0005] This specification provides a container service management method and apparatus to partially solve the above problems existing in the prior art.
[0006] This specification adopts the following technical solutions:
[0007] This specification provides a container service management method, including:
[0008] The method is applied to a service configuration module, and the method includes:
[0009] Determine the service to be loaded according to the first type of service configuration request;
[0010] According to the container service query table, determine the service list of each container existing in the container scheduling platform; for each container, the data fields in the service list of the container are used to represent the services existing in the container;
[0011] According to the service list, determine at least some of the containers as target containers;
[0012] According to the service to be loaded and the services existing in the target containers, send a container creation instruction to the container scheduling platform, so that the container scheduling platform creates a container and loads the service to be loaded and the services existing in the target containers, and destroys the target containers.
[0013] Optionally, in the container service query table, the container identifier of each existing container in the container scheduling platform is used as an index, and the service list of the existing services in each container is used as a field.
[0014] Optionally, according to the service list, at least some of the containers in each container are determined as target containers, which specifically includes:
[0015] According to the service list, determine the number of existing services in each container;
[0016] According to the quantity, determine target containers from each container, and the number of existing services in the target containers meets a preset condition.
[0017] Optionally, according to the service list, at least some of the containers in each container are determined as target containers, which specifically includes:
[0018] According to the service list, obtain the service characteristic data of the existing services in each container, where the service characteristic data includes at least one of the resource data required during service operation and the service quality level of the service;
[0019] According to the service characteristic data, determine at least some of the containers in each container as target containers.
[0020] Optionally, according to the service list, at least some of the containers in each container are determined as target containers, which specifically includes:
[0021] Judge whether the remaining system resources meet the preset alarm condition;
[0022] If it is determined that the remaining system resources meet the preset alarm condition, then according to the service list, at least some of the containers in each container are determined as target containers.
[0023] Optionally, the method further includes:
[0024] If it is determined that the remaining system resources do not meet the preset alarm condition, then according to the service to be loaded, send a container creation instruction to the container scheduling platform, so that the container scheduling platform creates a container and loads the service to be loaded.
[0025] Optionally, the method further includes:
[0026] Determine the service to be deleted according to the second type of service configuration request;
[0027] Update the container service query table according to the service to be deleted to obtain an updated container service query table;
[0028] When it is determined that the service list of the container where the service to be deleted is located is empty according to the updated container service query table, send a container destruction instruction to the container scheduling platform so that the container scheduling platform destroys the container where the service to be deleted is located.
[0029] This specification provides a container service management method, which is applied to a container scheduling platform, and the method includes:
[0030] Receive a container creation instruction sent by a service configuration module; the container creation instruction is generated by the service configuration module according to the service to be loaded and the existing services in the target container, the service to be loaded is determined by the service configuration module according to a first type of service configuration request, the target container is determined by the service configuration module according to the service list of each existing container in the container scheduling platform, and the service list is obtained by the service configuration module according to container service query;
[0031] According to the container creation instruction, create a container and load the service to be loaded and the existing services in the target container, and destroy the target container.
[0032] This specification provides a container service management device, which is used to execute a container service management method applied to a service configuration module, and includes:
[0033] A determination module, configured to determine the service to be loaded according to a first type of service configuration request;
[0034] A query module, configured to determine the service list of each existing container in the container scheduling platform according to a container service query table; for each container, the data fields in the service list of the container are used to represent the existing services in the container;
[0035] A selection module, configured to determine at least some of the containers in each container as target containers according to the service list;
[0036] A management module, configured to send a container creation instruction to the container scheduling platform according to the service to be loaded and the existing services in the target container, so that the container scheduling platform creates a container and loads the service to be loaded and the existing services in the target container, and destroys the target container.
[0037] This specification provides a container service management device, which is used to execute a container service management method applied to a container scheduling platform, and includes:
[0038] A receiving module, configured to receive a container creation instruction sent by a service configuration module; the container creation instruction is generated by the service configuration module according to a service to be loaded and services already existing in a target container, the service to be loaded is determined by the service configuration module according to a first type of service configuration request, the target container is determined by the service configuration module according to a service list of each existing container in a container scheduling platform, and the service list is obtained by the service configuration module querying container services;
[0039] An execution module, configured to create a container according to the container creation instruction, load the service to be loaded and the services already existing in the target container, and destroy the target container.
[0040] This specification provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above-mentioned container service management method is implemented.
[0041] This specification provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, the above-mentioned container service management method is implemented.
[0042] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0043] In the container service management method provided in this specification, according to a first type of service configuration request, a service to be loaded is determined, according to a container service query table, a service list of each existing container in a container scheduling platform is determined, for each container, data fields in the service list of the container are used to represent services already existing in the container, according to the service list, at least some of the containers are determined as target containers, according to the service to be loaded and the services already existing in the target containers, a container creation instruction is sent to the container scheduling platform, so that the container scheduling platform creates a container and loads the service to be loaded and the services already existing in the target containers, and destroys the target container.
[0044] It can be seen from the above method that in this method, for a new service that cannot be loaded during the container startup process, when it needs to be loaded, according to a preset container service query table, target containers that also run services that cannot be loaded during the container startup process can be determined from each existing container in the container scheduling platform, so that the services running in the target containers and the new service to be loaded can be loaded into a new container together, and after the new container is created, the target containers can be destroyed, so as to transfer the services in the target containers to the new container without affecting the services, and enable a container to perform multiple services simultaneously, while increasing the load of a single container and saving system resource overhead, so that more services can be run on limited system resources and the cluster resource utilization rate can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The drawings described herein are provided to further understand the present specification and form a part of the present specification. The illustrative embodiments of the present specification and their descriptions are used to explain the present specification and do not constitute an improper limitation of the present specification. In the drawings:
[0046] Figure 1 is a schematic flowchart of a container service management method provided in the present specification;
[0047] Figure 2 is a schematic diagram of a container service query table provided in the present specification;
[0048] Figure 3 is a schematic diagram of a service loading process provided in the present specification;
[0049] Figure 4 is a schematic diagram of a service deletion process provided in the present specification;
[0050] Figure 5 is a schematic diagram of an active resource recovery process provided in the present specification;
[0051] Figure 6 is a schematic diagram of the specific process of the container service management method provided in the present specification;
[0052] Figure 7 is a schematic flowchart of a container service management method provided in the present specification;
[0053] Figure 8 is a schematic diagram of a container service management device provided in the present specification;
[0054] Figure 9 is a schematic diagram of a container service management device provided in the present specification;
[0055] Figure 10 is a corresponding one provided in the present specification for Figure 1 schematic diagram of an electronic device. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0056] To make the objectives, technical solutions, and advantages of the present specification clearer, the technical solutions of the present specification will be clearly and completely described below in conjunction with the specific embodiments of the present specification and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present specification, rather than all of the embodiments. Based on the embodiments in the present specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present specification.
[0057] In the current context where containerization technology is widely applied, numerous application programs and services are deployed in container environments to achieve efficient resource utilization, convenient scalability, and flexible management. Containers, with their characteristics of fast startup, good isolation, and easy migration, have become an indispensable cornerstone in modern cloud computing and microservices architectures.
[0058] However, in the actual application process of container technology, there is a type of service resource that can only be loaded during the initial startup stage of the container. Once the container starts running, it is impossible to dynamically add or update these resources in a hot-pluggable manner. This limitation in the resource loading method brings many inconveniences and challenges to actual development, deployment, and operation and maintenance work.
[0059] Taking the typical scenario of containerized applications as an example, many application programs rely on resources such as specific configuration files, credential information, initialization data sets, or specific versions of dependency libraries to run properly. These resources often need to be accurately placed into the container when it starts up to ensure the stable startup and normal operation of the application.
[0060] As the business scale expands, the number of container instances with the above situation will increase linearly with the growth of service volume and quickly reach the upper limit of cluster resources. At this time, a large number of low-load containers are essentially in a state of resource vacancy, resulting in low utilization of computing resources.
[0061] Therefore, this specification provides a container service management method, and its execution subject can be various computing resources with container management capabilities that can execute the solutions in this specification, such as: servers, personal computers (PCs), distributed clusters, cloud platforms, and other computing devices or systems. This specification does not limit this, and for the convenience of explanation, this specification uses the service configuration module deployed in any of the above computing resources and used to implement the above container service management method as the execution subject for explanation.
[0062] The following will detail the technical solutions provided by each embodiment of this specification in conjunction with the accompanying drawings.
[0063] Figure 1 It is a schematic flowchart of a container service management method provided in this specification, including the following steps:
[0064] S101: Determine the service to be loaded according to the first type of service configuration request.
[0065] In one or more embodiments of the present specification, a user may send a service configuration request to a service configuration module in ways such as a graphical user interface (GUI) or a command-line interface (CLI). After the service configuration module receives the first type of service configuration request sent by the user, it authenticates the user, and after determining that the user has the permission to execute container service management according to the authentication result, it parses the received first type of service configuration request to determine the service to be loaded.
[0066] Among them, the above-mentioned first type of service configuration request may include key information of the service that the user needs to create, such as: the name of the service, the identification information of the service, the version of the service, the image address of the service, the resource requirements of the service (CPU resource requirements, memory resource requirements, etc.), the environmental variable configuration of the service, the network port mapping of the service, and the service dependency relationship, etc.
[0067] S102: According to the container service query table, determine the service list of each existing container in the container scheduling platform; for each container, the data fields in the service list of the container are used to represent the existing services in the container.
[0068] In one or more embodiments of the present specification, the service configuration module may query the service list of each existing container in the container scheduling platform from a preset container service query table.
[0069] Among them, the above-mentioned container scheduling platform refers to a platform for automatically managing and deploying containerized applications, such as: Kubernetes, Docker Swarm, and Apache Mesos, etc.
[0070] In the container service query table, use the container identifier of each existing container in the container scheduling platform as an index, and use the service list of the existing services in each container as a field, specifically as Figure 2 shown.
[0071] Figure 2 This is a schematic diagram of a container service query table provided in the present specification.
[0072] In Figure 2 , use the container identifier field container id as the primary key index to ensure that each container can be accurately located. For example: Figure 2 The field values such as contA and contB shown in
[0073] Further, in Figure 2The service list field set in it is used to store the service list running in each container. For example: Figure 2 In Figure 2 , the service list field value of contA is recorded as / s1, indicating that this container only hosts service s1. The service list field value of contB is recorded as / s1, / s2, indicating that this container hosts service s1 and service s2.
[0074] It should be noted that the field value of the above service list field can only contain the identification information of the services hosted in the container or the service paths of the services, or can contain the service characteristic data of the services. Here, the service characteristic data includes at least one of the resource data required for service operation and the service quality level of the service.
[0075] The above resource data required for service operation is used to characterize the CPU requirements, content requirements, etc. during service operation.
[0076] The above service quality level is used to characterize the priority of different services for service reliability. Among them, the higher the service quality level of a service, the higher the requirement for service reliability.
[0077] S103: According to the service list, determine at least some of the containers in each container as target containers.
[0078] S104: According to the service to be loaded and the services already existing in the target containers, send a container creation instruction to the container scheduling platform, so that the container scheduling platform creates containers and loads the service to be loaded and the services already existing in the target containers, and destroys the target containers.
[0079] Further, after the service configuration module determines the service list of each container existing in the container scheduling platform, it can determine at least some of the containers existing in the container scheduling platform as target containers according to the service list of each container.
[0080] Among them, there are various methods for the service configuration module to determine the target containers from the containers existing in the container scheduling platform according to the service list of each container. For example: The service configuration module can determine the number of services already existing in each container according to the service list, and determine the target containers from each container according to the number of services already existing in each container. Here, the number of services already existing in the target containers meets the preset conditions.
[0081] In the above content, the preset conditions that the number of services already existing in the target containers needs to meet can be set according to actual needs. For example: If the number of services already existing in the target containers is less than the preset number threshold, it can be regarded as meeting the preset conditions. If the number of services already existing in the target containers is the smallest among all target containers, it can be regarded as meeting the preset conditions, etc.
[0082] For another example: The service configuration module can obtain the service characteristic data of the existing services in each container according to the service list, and then, according to the service characteristic data of the existing services in each container, determine at least some of the containers as target containers.
[0083] In the above content, the method for the service configuration module to determine the target containers from each container according to the service characteristic data of the existing services in each container can be that the service configuration module sorts the existing services in each container according to the size of the resource data required for the existing services to run in each container, obtains the sorted services, and then, according to the order of the services, determines the target containers from each container.
[0084] For example: For each container, determine the serial number of each existing service in the container among the sorted services, and then, the average serial number value of each existing service in the container can be used as the weight corresponding to the container, so that the containers corresponding weights less than the preset weight threshold can be determined from each container as the target containers.
[0085] In the above content, the method for the service configuration module to determine the target containers from each container according to the service characteristic data of the existing services in each container can also be that the service configuration module determines, from each container, the containers in which the service quality levels of all existing services are lower than the preset level threshold as the target containers.
[0086] After determining the target containers, the service configuration module can send a container creation instruction to the container scheduling platform according to the service to be loaded and the existing services in the target containers, so that the container scheduling platform creates containers and loads the service to be loaded and the existing services in the target containers, and destroys the target containers.
[0087] In an actual application scenario, before the service configuration module determines at least some of the containers as target containers and generates a container creation instruction according to the service to be loaded and the existing services in the target containers, it can determine whether the remaining system resources meet the preset warning conditions, and then send an instruction to the container scheduling platform according to the determination result, specifically as Figure 3 shown.
[0088] Figure 3 It is a schematic diagram of the service loading process provided in this specification.
[0089] Combined with Figure 3It can be seen that the service configuration module determines whether the remaining system resources meet the preset alarm conditions. If so, according to the service list, at least some of the containers in each container are determined as target containers. Based on the service to be loaded and the services already existing in the target containers, a container creation instruction is generated and sent to the container scheduling platform, so that the container scheduling platform creates containers, and loads the service to be loaded and the services already existing in the target containers into the newly created containers, and destroys the target containers.
[0090] If not, the service configuration module can send a container creation instruction to the container scheduling platform according to the service to be loaded, so that the container scheduling platform creates containers and loads the service to be loaded.
[0091] Among them, the above-mentioned alarm conditions can be determined according to actual needs. For example, when it is determined that the maximum number of containers supported by the system is less than the preset threshold, it can be regarded as meeting the above-mentioned alarm conditions.
[0092] For another example: when it is determined that the CPU occupancy rate is higher than the preset threshold, it can be regarded as meeting the above-mentioned alarm conditions.
[0093] It should be noted that in this application, the user can also make the service configuration module delete the service to be deleted through a second type of service configuration request, specifically as Figure 4 shown.
[0094] Figure 4 This is a schematic diagram of the service deletion process provided in this specification.
[0095] Combined with Figure 4 It can be seen that when the service configuration module receives the second type of service configuration request, it can determine and stop the service to be deleted in the container according to the second type of service configuration request, and then can traverse the container service query table to delete the service identification information of the service to be deleted from the container service query table to obtain an updated container service query table.
[0096] At this time, since there may be other services running in the container where the service to be deleted is located, after updating the container service query table, it is also possible to determine whether the service list of the container where the service to be deleted is located is empty according to the updated container service query table.
[0097] Among them, when it is determined according to the updated container service query table that the service list of the container where the service to be deleted is located is empty, a container destruction instruction can be sent to the container scheduling platform to make the container scheduling platform destroy the container where the service to be deleted is located. Otherwise, the container where the service to be deleted is located can be temporarily retained.
[0098] It should be noted that in addition to responding to the first type of service configuration request sent by the user and incorporating the existing services and services to be loaded in at least some of the existing containers in the container scheduling platform into a new container, the service configuration module can also actively perform resource recycling, specifically as follows: Figure 5 as shown.
[0099] Figure 5 It is a schematic diagram of the active resource recycling process provided in this specification.
[0100] Combined with Figure 5 it can be seen that the service configuration module can, at specified time intervals, determine the service list of each container existing in the container scheduling platform according to the container service query table. According to the service list of each container existing in the container scheduling platform, at least some of the containers existing in the container scheduling platform are determined as containers to be recycled. Furthermore, the container service query table can be updated according to the existing services in each container to be recycled, and container management instructions can be sent to the container scheduling platform according to the existing services in each container to be recycled, so that the container scheduling platform creates containers and loads the existing services in each container to be recycled, and destroys each container to be recycled.
[0101] For ease of understanding, the following takes the storage resource service of the GPFS storage cluster as the service to be loaded. The storage resource corresponding to each storage resource service is a directory in the GPFS storage cluster. Taking K8S as the container scheduling platform, each time a request is made to create a container service, K8S will start a POD. A POD contains one or more containers (in this embodiment, a POD contains one container, which will be directly described as a container hereinafter). Taking the example that a maximum of 40 containers are supported on one host of K8S, the above container service management method will be described in detail.
[0102] Specifically, the above GPFS file system can be mounted on the / hostGpfs directory of the host. The service configuration module can implement dynamic service management through the following process: When creating service s1, a directory s1Path with a preset quota can be generated under the GPFS root directory (the host path is / hostGpfs / s1Path). Since the already running containers cannot map to the new directory (that is, cannot load the new service), at this time, a new container A needs to be started to map / hostGpfs / s1Path to the / dockerGpfs / s1Path path inside the container to provide the service.
[0103] When adding a new service s2, a / hostGpfs / s2Path directory can be created on the host. At this time, container B needs to be started to map both s2Path and s1Path (retaining the historical service path) at the same time, as shown in Figure 6As shown, after container B maps the dual directory, container A that only hosts s1 can be safely destroyed without affecting the service.
[0104] Among them, the service configuration module can implement service tracking through the container service query table. When adding a new service, it updates the container service query table to add the association between the container and the service. When deleting a service, it traverses the container service query table to remove the corresponding entry. If all the services that a certain container has in the service list of the container service query table are cleared, the container destruction can be automatically triggered and the corresponding entry of the container in the container service query table can be deleted to ensure efficient resource utilization.
[0105] It can be seen from the above method that for a new service that cannot be loaded during the container startup process, the service configuration module can, when it needs to be loaded, determine, according to the preset container service query table, the target container that also runs the service that cannot be loaded during the container startup process from each existing container in the container scheduling platform. Thus, the service running in the target container and the new service to be loaded can be loaded into a new container together. After the new container is created, the target container can be destroyed to transfer the service in the target container to the new container without affecting the service, and enable a container to run multiple services simultaneously, improving the load of a single container while saving the system resource overhead, so that more services can be run on limited system resources and the cluster resource utilization rate can be improved.
[0106] For the sake of easy understanding, the method executed by the container scheduling platform during the service management process by the above container service management method is described in detail below, specifically as Figure 7 shown.
[0107] Figure 7 It is a flowchart of a container service management method provided in this specification, including the following steps:
[0108] S701: Receive a container creation instruction sent by the service configuration module; the container creation instruction is generated by the service configuration module according to the service to be loaded and the services already existing in the target container. The service to be loaded is determined by the service configuration module according to the first type of service configuration request. The target container is determined by the service configuration module according to the service list of each existing container in the container scheduling platform, and the service list is obtained by the service configuration module through container service query.
[0109] S702: According to the container creation instruction, create a container and load the service to be loaded and the services already existing in the target container, and destroy the target container.
[0110] As can be seen from the above method, for service types that cannot be dynamically updated through the hot reload mechanism, the container scheduling platform can seamlessly migrate the service to a new container without interrupting the service, and implement an aggregation mode where a single container hosts multiple services. This method can not only improve the utilization rate of container resources, but also significantly reduce system overhead, enabling more services to run under limited resource conditions and achieving dual optimization of resource utilization efficiency and service density.
[0111] The above is one or more embodiments of the container service management method in this specification. Based on the same idea, this specification also provides a corresponding container service management device, as Figure 8 、 Figure 9 shown.
[0112] Figure 8 The following is a schematic diagram of a container service management device provided in this specification, including:
[0113] A determination module 801, configured to determine a service to be loaded according to a first type of service configuration request;
[0114] A query module 802, configured to determine a service list of each existing container in the container scheduling platform according to a container service query table; for each container, the data fields in the service list of the container are used to represent the existing services in the container;
[0115] A selection module 803, configured to determine at least some of the containers in each container as target containers according to the service list;
[0116] A management module 804, configured to send a container creation instruction to the container scheduling platform according to the service to be loaded and the existing services in the target container, so that the container scheduling platform creates a container and loads the service to be loaded and the existing services in the target container, and destroys the target container.
[0117] Optionally, in the container service query table, the container identifier of each existing container in the container scheduling platform is used as an index, and the service list of the existing services in each container is used as a field.
[0118] Optionally, the selection module 803 is specifically configured to determine the number of existing services in each container according to the service list; and determine the target container from each container according to the number, where the number of existing services in the target container meets a preset condition.
[0119] Optionally, the selection module 803 is specifically configured to obtain service feature data of services existing in each container according to the service list, where the service feature data includes at least one of resource data required during service operation and the service quality level of the service; and determine at least some of the containers in each container as target containers according to the service feature data.
[0120] Optionally, the selection module 803 is specifically configured to determine whether the remaining system resources meet a preset warning condition; if it is determined that the remaining system resources meet the preset warning condition, then determine at least some of the containers in each container as target containers according to the service list.
[0121] Optionally, when it is determined that the remaining system resources do not meet the preset warning condition, the management module 804 is specifically configured to send a container creation instruction to the container scheduling platform according to the service to be loaded, so that the container scheduling platform creates a container and loads the service to be loaded.
[0122] Optionally, the management module 804 is specifically configured to determine a service to be deleted according to a second type of service configuration request; update the container service query table according to the service to be deleted to obtain an updated container service query table; and when it is determined according to the updated container service query table that the service list of the container where the service to be deleted is located is empty, send a container destruction instruction to the container scheduling platform, so that the container scheduling platform destroys the container where the service to be deleted is located.
[0123] Figure 9 The figure is a schematic diagram of a container service management device provided in this specification, including:
[0124] A receiving module 901, configured to receive a container creation instruction sent by a service configuration module; the container creation instruction is generated by the service configuration module according to a service to be loaded and services existing in a target container, the service to be loaded is determined by the service configuration module according to a first type of service configuration request, the target container is determined by the service configuration module according to a service list of each container existing in the container scheduling platform, and the service list is obtained by the service configuration module according to container service query;
[0125] An execution module 902, configured to create a container according to the container creation instruction, load the service to be loaded and the services existing in the target container, and destroy the target container.
[0126] This specification further provides a computer-readable storage medium, which stores a computer program, and the computer program can be used to execute the above Figure 1 provided container service management method.
[0127] This specification also provides Figure 10 a schematic structural diagram of an electronic device corresponding to Figure 1 as shown. As Figure 10 described, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory. Of course, it may also include other hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the Figure 1 container service management method described above. Of course, in addition to the software implementation method, this specification does not exclude other implementation methods, such as logical devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logical unit, and can also be hardware or a logical device.
[0128] The improvement of a technology can be clearly distinguished as a hardware improvement (e.g., the improvement of circuit structures such as diodes, transistors, switches, etc.) or a software improvement (the improvement of method processes). However, with the development of technology, many method process improvements today can be regarded as direct improvements to hardware circuit structures. Almost all designers obtain the corresponding hardware circuit structure by programming the improved method process into the hardware circuit. Therefore, it cannot be said that an improvement in a method process cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user programming the device. Designers can program themselves to "integrate" a digital system onto a single PLD, without having to ask a chip manufacturer to design and fabricate a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly implemented using "logic compiler" software, which is similar to the software compiler used in program development and writing. The original code before compilation also has to be written in a specific programming language, which is called a hardware description language (HDL). And there is not only one type of HDL, but many types, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also be aware that by simply performing some logical programming on the method process using the above-mentioned several hardware description languages and programming it into the integrated circuit, it is easy to obtain the hardware circuit that implements the logical method process.
[0129] The controller can be implemented in any suitable manner. For example, the controller can take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of the controller include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that, in addition to implementing the controller in the form of pure computer-readable program code, it is entirely possible to logically program the method steps to enable the controller to be implemented in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, and embedded microcontrollers, etc., to achieve the same function. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be regarded as the structures within the hardware component. Or even, the devices for implementing various functions can be regarded as either software modules for implementing the method or structures within the hardware component.
[0130] The systems, devices, modules, or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.
[0131] For the convenience of description, the above devices are described by dividing them into various units according to functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0132] Those skilled in the art should understand that the embodiments of this specification can be provided as a method, a system, or a computer program product. Therefore, this specification can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0133] This specification is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the specification. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and combinations of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce a means for implementing the functions specified in one or more of the flows Figure 1 one or more of the flows and / or blocks Figure 1 or one or more of the blocks.
[0134] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction means that implements the functions specified in one or more of the flows Figure 1 one or more of the flows and / or blocks Figure 1 or one or more of the blocks.
[0135] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more of the flows Figure 1 one or more of the flows and / or blocks Figure 1 or one or more of the blocks.
[0136] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0137] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.
[0138] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0139] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0140] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0141] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0142] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant parts, reference can be made to the corresponding description in the method embodiment.
[0143] The above description is only for the embodiments of this specification and is not intended to limit this specification. For those skilled in the art, various modifications and changes can be made to this specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included within the scope of the claims of this specification.
Claims
1. A container service management method, characterized in that The method is applied to a service configuration module, and the method includes: Determine a service to be loaded according to a first type of service configuration request; Determine the service list of each existing container in the container scheduling platform according to the container service query table; for each container, the data fields in the service list of the container are used to represent the existing services in the container; Determine the number of existing services in each container according to the service list; Determine a target container from each container according to the number, and the number of existing services in the target container meets a preset condition; Send a container creation instruction to the container scheduling platform according to the service to be loaded and the existing services in the target container, so that the container scheduling platform creates a container and loads the service to be loaded and the existing services in the target container, and destroys the target container.
2. The method according to claim 1, wherein In the container service query table, the container identifier of each existing container in the container scheduling platform is used as an index, and the service list of the existing services in each container is used as a field.
3. The method according to claim 1, wherein Determine at least some of the containers in each container as target containers according to the service list, specifically including: Obtain the service characteristic data of the existing services in each container according to the service list, and the service characteristic data includes at least one of the resource data required during service operation and the service quality level of the service; Determine at least some of the containers in each container as target containers according to the service characteristic data.
4. The method according to claim 1, characterized in that, Determine at least some of the containers in each container as target containers according to the service list, specifically including: Judge whether the remaining system resources meet a preset warning condition; If it is determined that the remaining system resources meet the preset warning condition, then determine at least some of the containers in each container as target containers according to the service list.
5. The method according to claim 4, characterized in that, The method further includes: If it is determined that the remaining system resources do not meet the preset warning condition, then send a container creation instruction to the container scheduling platform according to the service to be loaded, so that the container scheduling platform creates a container and loads the service to be loaded.
6. The method according to claim 1, wherein The method further includes: Determine a service to be deleted according to a second type of service configuration request; Update the container service query table according to the service to be deleted to obtain an updated container service query table; When it is determined that the service list of the container where the service to be deleted is located is empty according to the updated container service query table, send a container destruction instruction to the container scheduling platform so that the container scheduling platform destroys the container where the service to be deleted is located.
7. A container service management method, characterized in that, The method is applied to a container scheduling platform, and the method includes: Receive a container creation instruction sent by the service configuration module; the container creation instruction is generated by the service configuration module according to the service to be loaded and the existing services in the target container, the service to be loaded is determined by the service configuration module according to a first type of service configuration request, the target container is determined by the service configuration module according to the service list of each existing container in the container scheduling platform, and the service list is obtained by the service configuration module according to the container service query; Create a container according to the container creation instruction, load the service to be loaded and the services existing in the target container, and destroy the target container.
8. A container service management device, characterized in that The device is used to execute a container service management method applied to a service configuration module. The device includes: A determination module, configured to determine the service to be loaded according to a first type of service configuration request; An inquiry module, configured to determine the service list of each existing container in the container scheduling platform according to the container service inquiry table; for each container, the data field in the service list of the container is used to represent the services existing in the container; A selection module, configured to determine the number of services existing in each container according to the service list; according to the number, determine a target container from each container, and the number of services existing in the target container meets a preset condition; A management module, configured to send a container creation instruction to the container scheduling platform according to the service to be loaded and the services existing in the target container, so that the container scheduling platform creates a container and loads the service to be loaded and the services existing in the target container, and destroys the target container.
9. A container service management device, characterized in that The device is used to execute a container service management method applied to a container scheduling platform. The device includes: A receiving module, configured to receive the container creation instruction sent by the service configuration module; the container creation instruction is generated by the service configuration module according to the service to be loaded and the services existing in the target container, the service to be loaded is determined by the service configuration module according to a first type of service configuration request, the target container is determined by the service configuration module according to the service list of each existing container in the container scheduling platform, and the service list is obtained by the service configuration module according to the container service inquiry; An execution module, configured to create a container according to the container creation instruction, load the service to be loaded and the services existing in the target container, and destroy the target container.
Citation Information
Patent Citations
Container non-perception starting method and system
CN114518935A