Container deployment method, device, equipment and storage medium

By building a linear function to determine the number of container deployments, the problem of low container deployment efficiency in traditional container orchestration methods is solved, and efficient container deployment and resource utilization is achieved.

CN112256430BActive Publication Date: 2024-11-22BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011149908.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-23
Publication Date
2024-11-22
Estimated Expiration
2040-10-23

AI Technical Summary

Technical Problem

Traditional container orchestration methods use greedy algorithms to cause the machine to be computationally expensive and inefficient during container deployment, and it is impossible to effectively manage the hybrid deployment of million-level containers.

Method used

By building a linear function based on container occupancy capacity and machine resource capacity, calculate the number of container deployments with the smallest total remaining resource capacity, directly determine the number of containers on the physical machine deployment, reduce scoring operations, and improve deployment efficiency.

Benefits of technology

It greatly reduces the amount of machine computing, reduces the cost of computing, improves container deployment efficiency, and reduces resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112256430B_ABST
    Figure CN112256430B_ABST
Patent Text Reader

Abstract

The present application discloses a container deployment method, device, equipment and storage medium, which belongs to the field of cloud computing technology. The method includes: obtaining the container occupied capacity and container quantity of each type of container in n types of containers; obtaining the machine resource capacity of each physical machine in m physical machines; based on the container occupied capacity and machine resource capacity, constructing a linear function with the number of deployed containers of each type of container on each physical machine as the independent variable and the total remaining resource capacity of m physical machines after being occupied by n types of containers as the dependent variable; using the number of containers and machine resource capacity as constraints, calculating the number of deployed containers of each type of container deployed on each physical machine when the total remaining resource capacity is the minimum based on the linear function; deploying containers according to the number of deployed containers of each type of container deployed on each physical machine; the method can improve the deployment efficiency of containers and reduce the amount of machine calculation when deploying containers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing, and in particular to a container deployment method, device, equipment and storage medium. Background Art

[0002] Containerization technology is a way to share physical machine resources by providing lightweight packaged applications, which can quickly deploy applications in a standardized manner; container orchestration refers to the deployment, management, expansion and networking of automated containers.

[0003] Traditional container orchestration uses a greedy algorithm to score containers to achieve mixed deployment of containers on physical machines. For example, after a physical machine with 64 cores, 256GB of memory, and 1000M (1000Mb / s) bandwidth has many services mixed and deployed, 4 cores and 6GB of resources are left. For a 4-core, 6GB container and two 2-core, 3GB containers, the greedy algorithm will deploy the 4-core, 6GB container on the physical machine.

[0004] However, the number of online containers can reach millions, and each time resource mixed deployment is performed, it is scored, which makes the machine's computing power very large. Summary of the invention

[0005] The embodiments of the present application provide a container deployment method, device, equipment and storage medium, which can improve the deployment efficiency of containers and reduce the amount of machine calculations during container deployment. The technical solution is as follows:

[0006] According to one aspect of the present application, a container deployment method is provided, the method comprising:

[0007] Get the container occupied capacity and container quantity of each type of container in n types of containers, where n is a positive integer;

[0008] Get the machine resource capacity of each of m physical machines, where m is a positive integer;

[0009] Based on the container occupied capacity and machine resource capacity, a linear function is constructed with the number of deployed containers of each type of container on each physical machine as the independent variable and the total remaining resource capacity of m physical machines after being occupied by n types of containers as the dependent variable;

[0010] Taking the number of containers and machine resource capacity as constraints, the number of deployed containers of each type deployed on each physical machine is calculated based on a linear function when the total remaining resource capacity is minimized;

[0011] Deploy containers according to the number of containers of each type deployed on each physical machine.

[0012] According to another aspect of the present application, a container deployment device is provided, the device comprising:

[0013] The acquisition module is used to obtain the container occupied capacity and the number of containers of each type of container in n types of containers, where n is a positive integer; and obtain the machine resource capacity of each physical machine in m physical machines, where m is a positive integer;

[0014] A construction module is used to construct a linear function based on the occupied capacity of containers and the resource capacity of machines, with the number of deployed containers of each type of container on each physical machine as the independent variable and the total remaining resource capacity of m physical machines after being occupied by n types of containers as the dependent variable;

[0015] The calculation module is used to calculate the number of containers of each type deployed on each physical machine when the total remaining resource capacity is minimized based on the linear function, taking the number of containers and the machine resource capacity as constraints;

[0016] The deployment module is used to deploy containers according to the number of deployment containers of each type of container deployed on each physical machine.

[0017] According to another aspect of the present application, a computer device is provided, comprising: a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the container deployment method as described above.

[0018] According to another aspect of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the container deployment method as described above.

[0019] According to another aspect of the present application, a computer program product is provided, the computer program product includes computer instructions, and the computer instructions are 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 the computer device executes the container deployment method as described above.

[0020] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:

[0021] The container deployment method provided in the present application constructs a linear function of the remaining resource capacity after the application is deployed on the physical machine based on the resource capacity occupied by the deployment container required for the application and the resource capacity provided by the physical machine. When the remaining resource capacity is minimum, the number of deployment containers of the application on each physical machine is directly determined, and the application is deployed according to the number of deployment containers of the application on each physical machine determined above. There is no need to perform a scoring operation on each container of the application deployed on each physical machine, which greatly reduces the machine's computing power, reduces the computing cost, improves the machine's computing efficiency, and also improves the container deployment efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 A schematic diagram of the structure of a virtualization system provided by an exemplary embodiment of the present application is shown;

[0024] Figure 2 A flowchart of a container deployment method provided by an exemplary embodiment of the present application is shown;

[0025] Figure 3 A flowchart of a container deployment method provided by another exemplary embodiment of the present application is shown;

[0026] Figure 4 A flowchart of a container deployment method provided by another exemplary embodiment of the present application is shown;

[0027] Figure 5 A block diagram of a container deployment device provided by an exemplary embodiment of the present application is shown;

[0028] Figure 6 A schematic diagram of the structure of a computer device provided by an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION

[0029] 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.

[0030] First, several nouns involved in this application are introduced:

[0031] Virtualization technology adds a virtualization layer (Hypervisor) to the operating system, which can virtualize the physical machine's (Central Processing Unit, CPU), memory, hard disk and other resources, and install the operating system in the virtualized space, which is what we usually call a virtual machine. For example, we can virtualize a physical machine with a 32-core CPU, 64G memory, and 500G disk, and create 8 virtual machines with 4-core CPUs and 8G memory; 1G is equal to 1024 megabytes (M). Virtualization technology still has problems with application expansion and environment migration. In the era of cloud computing, these two problems are usually solved through automated scripts, but environmental differences require additional manpower for script maintenance; or use virtualization images, but the images are large and slow to start; therefore, containerization technology is proposed.

[0032] Containerization technology is a kernel-lightweight operating system layer virtualization technology. It encapsulates applications and their operating environments in the form of containers, and packages them into a lightweight, portable, and self-contained container. Containerization technology has the following advantages: First, compared with virtualization technology, containerization technology does not require an additional Hypervisor layer, and has higher performance and efficiency; a single high-configuration physical machine can run thousands of Docker containers, where Docker is an open source application container engine. Second, the container startup time is very fast, which can reach seconds or even milliseconds, because it runs directly in the host kernel without starting the operating system. Third, the container image encapsulates the application and the environment on which the application depends, ensuring the consistency of the application running environment and avoiding the problem of inconsistency between the development environment, test environment, and production environment. Fourth, after the container is created and configured once, it can be run anywhere. Testers can combine containers with continuous integration systems to automatically complete integration testing. At the same time, operation and maintenance personnel can automatically deploy applications through continuous deployment systems. Fifth, containers are easier to migrate and can be easily migrated to physical machines, virtual machines, public clouds, and private clouds. There is no need to worry about applications being unable to run due to changes in the operating environment.

[0033] Resource pool: In the era of virtualization, hardware resources are considered as a pool, which is a resource pool. The resources in this pool can be shared. There will be a Hypervisor [also known as Virtual Machine Monitor (VMM)] to count all the resources of the physical machine. When a new virtual machine needs to be installed, the Hypervisor will allocate the specified resources and manage each virtual host.

[0034] Virtualization technology can create a virtual environment for a specific purpose for a specific application purpose. It is safe, efficient, and convenient for snapshots, cloning, backup, and migration. System virtualization is to virtualize a physical computer into one or more virtual computer systems, each with its own virtual hardware. The operating system on it thinks that it is running on an independent host, and the computer software runs on a virtual platform instead of a real hardware platform. Virtualization technology can expand the capacity of hardware and simplify the software reconfiguration process. Among them, CPU virtualization can simulate multiple CPUs running in parallel with a single CPU, allowing a platform to run multiple operating systems at the same time, and applications can run in independent spaces without affecting each other. While reducing hardware costs, virtualization technology can also significantly improve system efficiency and security.

[0035] A computer system is provided, the computer system includes a physical machine, which is a physical computer device relative to a virtual machine; illustratively, the computer device may be a terminal or a server. A virtualization system is provided on the computer system, please refer to Figure 1 , shows a schematic diagram of the structure of a virtualization system provided by an exemplary embodiment of the present application, in which a physical machine 10 provides a hardware environment, a hardware abstraction layer 13 is abstracted from the hardware, and the hardware abstraction layer 13 provides a virtualization environment. The implementation of the virtualization system is usually to add a Hypervisor 12 between the hardware 11 and the operating system 14. The Hypervisor 12 is mainly responsible for the coordination of hardware resources between the various operating systems 14. Hypervisor 12 is a special operating system that runs directly on the bare metal (for full virtualization technology). Hypervisor 12 creates an underlying hardware platform abstraction, namely a hardware abstraction layer 13, and then virtualizes the hardware abstraction layer 13 to virtualize one or more virtual machines (Virtual Machine, VM), and one or more VMs share the underlying hardware platform. An operating system 14 and an application 16 run on the VM, and multiple applications 16 on each operating system 14 are isolated by a container 15, so that each application 16 can run in an independent container 15 without affecting each other. Exemplarily, the container deployment method provided in the present application is applied to the above-mentioned Hypervisor 12 to achieve hybrid deployment of the container 15 on the virtual machine abstracted from the physical machine 10.

[0036] The server in the computer system may include at least one of a server, a plurality of servers, a cloud computing platform, and a virtualization center. Those skilled in the art may know that the number of terminals in the computer system may be more or less. For example, the number of terminals in the computer system may be only one, or may be dozens or hundreds, or more. The embodiment of the present application does not limit the number and device type of terminals in the computer system.

[0037] Figure 2 A flowchart of a container deployment method provided by an exemplary embodiment of the present application is shown. The method is applied to a computer device in a computer system. The computer device may be a terminal or a server. The method includes:

[0038] Step 101: Obtain the container occupied capacity and container quantity of each type of container among n types of containers.

[0039] During the application deployment process, the computer device determines the container type and container quantity of the containers required by the application. The above container type is obtained by dividing the container specifications. The computer device obtains the container quantity of each type of n types of containers that need to be deployed, and the container occupied capacity indicated by the container specifications, where n is a positive integer.

[0040] Optionally, the resources required for the application to run include at least one of CPU, memory and bandwidth. Exemplarily, the container specifications of the container required by application A are 2 cores, 8G, and 10M, and the number of containers required is 30; the container specifications of the container required by application B are 4 cores and 8G, and the number of containers required is 10; the container specifications of the container required by application C are 1 core, 1G, and 10M, and the number of containers required is 50; then the computer device determines that the number of containers of the first type of containers among the three types of containers to be deployed is 30, and the container occupies a capacity of CPU 2 core, memory 8G, and bandwidth 10M; the number of containers of the second type of containers is 10, and the container occupies a capacity of CPU 4 core and memory 8G; the number of containers of the third type of containers is 50, and the container occupies a capacity of CPU 1 core, memory 1G, and bandwidth 10M.

[0041] The above container occupied capacity is used to indicate the resource capacity of the physical machine that the container needs to occupy to run the application. For example, if the container occupied capacity is CPU 1 core, memory 1 GB, and bandwidth 10 MB, it means that the container needs to occupy 1 CPU core, 1 GB of memory, and 10 MB of bandwidth of the physical machine.

[0042] In some embodiments, recently released applications may have program problems and require program maintenance and other operations. Therefore, such applications cannot be deployed in a mixed manner. The computer device obtains the program release time of the application running in the candidate container; in response to the program release time being greater than or equal to the time threshold, the candidate container is determined as a container, that is, the candidate container is determined as a container that can be deployed in a mixed manner. The time threshold is pre-set on the computer device.

[0043] In some embodiments, some containers have resource utilization jitter problems, that is, the capacity of resource utilization by the container will constantly change, sometimes high and sometimes low. Therefore, such containers cannot be deployed in a mixed manner. The computer device obtains the rate of change of the resource capacity used by the candidate container within a specified time period. The rate of change indicates the rate of change of the resource capacity used by the candidate container, that is, the fluctuation of resource utilization jitter; in response to the above-mentioned change rate being less than the change rate threshold, the candidate container is determined as a container, that is, the candidate container is determined as a container that can be deployed in a mixed manner. Among them, the above-mentioned change rate threshold is pre-set on the computer device. The above-mentioned resource utilization jitter situation can be obtained from the monitoring log of the application operation.

[0044] Step 102: Obtain the machine resource capacity of each of the m physical machines.

[0045] Exemplarily, the computer device determines m physical machines that meet the application deployment requirements, where the application deployment requirements refer to the resource capacity requirements of the application on the physical machine, and m is a positive integer. For example, if the deployment of application D requires a CPU of 32 cores, a memory of 16 GB, and a bandwidth of 64 MB, then the physical machine determined by the computer device for deploying application D, under the premise that no other applications are deployed, needs to have a CPU core greater than or equal to 32 cores, a memory capacity greater than or equal to 16 GB, and a bandwidth greater than or equal to 64 GB.

[0046] The above machine resource capacity is used to indicate the resource capacity that the physical machine can provide for the container. For example, the machine resource capacity is CPU 64 core, memory 32 GB, and bandwidth 200 MB, which means that the resource capacity provided by the physical machine is CPU 64 core, memory 32 GB, and bandwidth 200 MB.

[0047] Step 103, based on the container occupied capacity and the machine resource capacity, a linear function is constructed with the number of deployed containers of each type of container on each physical machine as the independent variable and the total remaining resource capacity of m physical machines after being occupied by n types of containers as the dependent variable.

[0048] Exemplarily, for a physical machine, the computer device calculates the product of the container occupied capacity of each type of container and the number of deployed containers on the physical machine, and then calculates the sum of the above products corresponding to n types of containers, and subtracts the above sum from the machine resource capacity of the physical machine to obtain the remaining resource capacity of the physical machine after being occupied by n types of containers; the m remaining resource capacities of m physical machines after being occupied by n types of containers are added together to construct a linear function with the number of deployed containers of each type of container on each physical machine as the independent variable and the total remaining resource capacity of m physical machines after being occupied by n types of containers as the dependent variable.

[0049] For example, assume that the container specifications of application A are 2 cores, 8 GB, and 10 MB, and the number of containers required is 30; the container specifications of application E are 4 cores, 8 GB, and 20 MB, and the number of containers required is 10; the container specifications of application C are 1 core, 1 GB, and 10 MB, and the number of containers required is 50. The computer device needs to deploy the above three types of containers on three physical machines. The number of CPU cores of the first physical machine Cup1 is Core 1. total1 , memory is Mem total1 , bandwidth is Bendth total1 ; The number of CPU cores of the second physical machine Cup2 is Core total2 , memory is Mem total2 , bandwidth is Bendth total3 ; The number of CPU cores of the third physical machine Cup3 is Core total3 , memory is Mem total3 , bandwidth is Bendth total3 ;

[0050] Assume that a1 application A containers, e1 application E containers, and c1 application C containers are deployed on Cup1; a2 application A containers, e2 application E containers, and c2 application C containers are deployed on Cup2; a3 application A containers, e3 application E containers, and c3 application C containers are deployed on Cup3; construct a linear representation of the remaining resources of each type of resource on each physical machine:

[0051] LeftCore1=Core total1 -(2×a1+4×e1+1×c1);

[0052] LeftCore2=Core total2 -(2×a2+4×e2+1×c2);

[0053] LeftCore3=Core total3 -(2×a3+4×e3+1×c3);

[0054] LeftMem1=Mem total1 -(8×a1+8×e1+1×c1);

[0055] LeftMem2=Mem total2 -(8×a2+8×e2+1×c2);

[0056] LeftMem3=Mem total3 -(8×a3+8×e3+1×c3);

[0057] LeftBendth1=Bendth total1 -(10×a1+20×e1+10×c1);

[0058] LeftBendth2=Bendth total2 -(10×a2+20×e2+10×c2);

[0059] LeftBendth3=Bendth total3 -(10×a3+20×e3+10×c3);

[0060] Among them, LeftCore1, LeftCore, and LeftCore are the remaining CPU resources on Cup1, Cup2, and Cup3 respectively; LeftMem1, LeftMem2, and LeftMem3 are the remaining memory resources on Cup1, Cup2, and Cup3 respectively; LeftBendth1, LeftBendth 2, and LeftBendth 3 are the remaining bandwidth resources on Cup1, Cup2, and Cup3 respectively; the linear function of the total remaining resource capacity of the three physical machines can be expressed as:

[0061] Left=(LeftCore1+LeftCore2+LeftCore3)+(LeftMem1+LeftMem2+LeftMem3)+(LeftBendth1+LeftBendth2+LeftBendth3);

[0062] Here, Left represents the total remaining resource capacity of the three types of resources on the three physical machines.

[0063] Step 104 , taking the number of containers and the machine resource capacity as constraints, the number of deployed containers of each type of container deployed on each physical machine when the total remaining resource capacity is minimized is calculated based on a linear function.

[0064] The computer device uses the number of containers and the machine resource capacity as constraints, and calculates the number of deployed containers of each type of container deployed on each physical machine when the remaining resource capacity is minimum based on the linear function of the total remaining resource capacity of the m physical machines constructed in step 103. The above constraints are that the total amount of resources required for the containers deployed on each physical machine is less than or equal to the machine resource capacity of the physical machine, and the sum of the number of containers of each type of container deployed on the m machines is less than the above capacity.

[0065] Exemplarily, the computer device determines the value constraints of the independent variables in the above linear function, and calculates the number of deployed containers of each type of container deployed on each physical machine when the remaining resource capacity of n types of resources of m physical machines is minimized based on the linear function under the value constraints.

[0066] Exemplarily, taking the solution of the linear function in step 103 as an example, the value constraints of the variables are listed as follows:

[0067] (2×a1+4×e1+1×c1)≤Core total1 ;

[0068] (2×a2+4×e2+1×c2)≤Core total2 ;

[0069] (2×a3+4×e3+1×c3)≤Core total3 ;

[0070] (8×a1+8×e1+1×c1)≤Mem total1 ;

[0071] (8×a2+8×e2+1×c2)≤Mem total2 ;

[0072] (8×a3+8×e3+1×c3)≤Mem total3 ;

[0073] (10×a1+20×e1+10×c1)≤Bendth total1 ;

[0074] (10×a2+20×e2+10×c2)≤Bendth total2 ;

[0075] (10×a3+20×e3+10×c3)≤Bendth total3 ;

[0076] 0≤a1+a2+a3≤30;

[0077] 0≤e1+e2+e3≤10;

[0078] 0≤c1+c2+c3≤50;

[0079] The computer device solves the values ​​of a1, a2, a3, e1, e2, e3, c1, c2, and c3 when Left is minimum within the range of the above value constraints, and obtains the number of deployed containers of each type of container deployed on each physical machine.

[0080] Step 105 , deploy containers according to the number of deployed containers of each type of container deployed on each physical machine.

[0081] The computer device deploys containers according to the solved number of deployed containers of each type of container deployed on each physical machine. For example, according to the solved values ​​of a1, a2, a3, e1, e2, e3, c1, c2, and c3, application A, application E, and application C are deployed on Cup1, Cup2, and Cup3.

[0082] To summarize, the container deployment method provided in this embodiment constructs a linear function of the remaining resource capacity after the application is deployed on the physical machine based on the resource capacity occupied by the deployment container required for the application and the resource capacity provided by the physical machine. When the remaining resource capacity is minimum, the number of deployment containers applied on each physical machine is directly determined, and the application is deployed according to the number of deployment containers applied on each physical machine determined above. There is no need to perform a scoring operation on each container of the application deployed on each physical machine, which greatly reduces the machine's computing power, reduces computing costs, improves the machine's computing efficiency, and also improves the container deployment efficiency.

[0083] In some embodiments, the application container is deployed on at least two physical machines at the same time. Taking into account the need for rational use of resources on each physical machine, different machine weights are set for different physical machines. That is, the computer device stores machine weights set according to the deployment order of the machines. The i-th deployed physical machine corresponds to the i-th machine weight, where i is a positive integer less than or equal to m.

[0084] Accordingly, if Figure 3 , for the construction of the above linear function, we can Figure 2 Step 103 is implemented in the following steps:

[0085] Step 1031 , construct a linear representation of the remaining resource capacity of the i th deployed physical machine based on the occupied capacity of the containers, the number of deployed containers of each type of container on the i th deployed physical machine, and the machine resource capacity of the i th deployed physical machine.

[0086] Exemplarily, the computer device multiplies the container occupied capacity of each type of container by the number of deployed containers on the i-th deployed physical machine, and subtracts the product of the above multiplication from the machine resource capacity of the i-th deployed physical machine, thereby obtaining a linear representation of the remaining resource capacity of the i-th deployed physical machine.

[0087] As shown in the example of step 103, a linear representation of the remaining resources of each of the three types of resources on the physical machine Cup1, LeftCore1, LeftMem1, and LeftBendth1, a linear representation of the remaining resources of each of the three types of resources on the physical machine Cup2, LeftCore2, LeftMem2, and LeftBendth2, and a linear representation of the remaining resources of each of the three types of resources on the physical machine Cup3, LeftCore3, LeftMem3, and LeftBendth3, are constructed. Then, the linear representation of the remaining resource capacity of Cup1 is LeftCore1+LeftMem1+LeftBendth1, the linear representation of the remaining resource capacity of Cup2 is LeftCore2+LeftMem2+LeftBendth2, and the linear representation of the remaining resource capacity of Cup3 is LeftCore3+LeftMem3+LeftBendth3.

[0088] In some embodiments, under the premise that there are surplus resources, in order to avoid the situation where the surplus of a certain resource is zero, a surplus resource weight is set to ensure that the surplus resources can be allocated and utilized as much as possible, that is, each physical machine has at least two types of resources, and there is a j-th type of resource and the j-th surplus resource weight stored in the computer device, where j is a positive integer; for the linear representation of the surplus resource capacity of each physical machine, the computer device constructs a first linear representation of the j-th type of resource capacity occupied by n types of containers on the i-th deployed physical machine according to the container occupied capacity and the number of deployed containers of each type of container on the i-th deployed physical machine; the first linear representation is subtracted from the j-th type of resource capacity of the i-th deployed physical machine to obtain a second linear representation of the surplus capacity of the j-th type of resources of the i-th deployed physical machine; the second linear representation is multiplied by the j-th surplus resource weight to obtain a weighted second linear representation of the surplus capacity of the j-th type of resources of the i-th deployed physical machine; the weighted second linear representations of the surplus capacity of at least two types of resources are added to obtain a linear representation of the surplus resource capacity of the i-th deployed physical machine.

[0089] As shown in the example of step 103, the first linear expression of the CPU resource capacity occupied by the three types of containers in Cup1 is (2×a1+4×e1+1×c1), the first linear expression of the memory resource capacity occupied by Cup1 is (8×a1+8×e1+1×c1), and the first linear expression of the bandwidth resource capacity occupied by Cup1 is (10×a1+20×e1+10×c1); the first linear expression of the CPU resource capacity occupied by the three types of containers in Cup2 is (2×a2+4×e2+1×c2), and the first linear expression of the memory resource capacity occupied by Cup2 is (10×a1+20×e1+10×c1). The first linear expression of the quantity is (8×a2+8×e2+1×c2), and the first linear expression of the bandwidth resource capacity occupied by Cup2 is (10×a2+20×e2+10×c2); the first linear expression of the CPU resource capacity occupied by the three types of containers in Cup3 is (2×a3+4×e3+1×c3), the first linear expression of the memory resource capacity occupied by Cup3 is (8×a3+8×e3+1×c3), and the first linear expression of the bandwidth resource capacity occupied by Cup3 is (10×a3+20×e3+10×c3);

[0090] Then, the second linear expression of the remaining capacity of the CPU resource of Cup1 is determined to be LeftCore1, the second linear expression of the remaining capacity of the memory resource of Cup1 is LeftMem1, and the second linear expression of the remaining capacity of the bandwidth resource of Cup1 is LeftBendth1; the second linear expression of the remaining capacity of the CPU resource of Cup2 is determined to be LeftCore2, the second linear expression of the remaining capacity of the memory resource of Cup2 is LeftMem2, and the second linear expression of the remaining capacity of the bandwidth resource of Cup2 is LeftBendth2; the second linear expression of the remaining capacity of the CPU resource of Cup3 is determined to be LeftCore3, the second linear expression of the remaining capacity of the memory resource of Cup3 is LeftMem3, and the second linear expression of the remaining capacity of the bandwidth resource of Cup3 is LeftBendth3;

[0091] If the remaining resource weight of the CPU resource is W1, the remaining resource weight of the memory resource is W2, and the remaining resource weight of the bandwidth resource is W3; then the weighted second linear representation of the CPU resource of Cup1 is (W1×LeftCore1), the weighted second linear representation of the memory resource of Cup1 is (W2×LeftMem1), and the weighted second linear representation of the bandwidth resource of Cup1 is (W3×LeftBendth1); the weighted second linear representation of the CPU resource of Cup2 is (W1×Left Core2), the weighted second linear expression of Cup2's memory resources is (W2×LeftMem2), and the weighted second linear expression of Cup2's bandwidth resources is (W3×LeftBendth2); the weighted second linear expression of Cup3's CPU resources is (W1×LeftCore3), the weighted second linear expression of Cup3's memory resources is (W2×LeftMem3), and the weighted second linear expression of Cup3's bandwidth resources is (W3×LeftBendth3);

[0092] Finally, the linear expression of the remaining resource capacity of Cup1 is [(W1×LeftCore1)+(W2×LeftMem1)+(W3×LeftBendth1)], the linear expression of the remaining resource capacity of Cup2 is [(W1×LeftCore2)+(W2×LeftMem2)+(W3×LeftBendth2)], and the linear expression of the remaining resource capacity of Cup3 is [(W1×LeftCore3)+(W2×LeftMem3)+(W3×LeftBendth3)].

[0093] Step 1032 : multiply the linear representation of the remaining resource capacity of the ith deployed physical machine by the weight of the ith machine to obtain a weighted linear representation of the remaining resource capacity of the ith deployed physical machine.

[0094] The computer device is pre-set with m machine weights corresponding to m physical machines. The computer device determines the i-th machine weight corresponding to the i-th deployed physical machine, multiplies the linear representation of the remaining resource capacity of the i-th deployed physical machine by the i-th machine weight, and obtains the weighted linear representation corresponding to the i-th deployed physical machine.

[0095] Optionally, the sum of the machine weights of the m physical machines in the computer device is set to 1, and the m machine weights are an arithmetic progression. Optionally, the machine weight is negatively correlated with the deployment order of the physical machines, and the later the physical machine is ranked, the smaller the machine weight is.

[0096] Exemplarily, if the deployment order of physical machines in step 1031 is Cup1, Cup2, and Cup3, the corresponding machine weights are We1, We2, and We3, respectively, where the sum of We1, We2, and We3 is 1, and the computer device obtains the weighted linear representation of Cup1 as We1×(LeftCore1+LeftMem1+LeftBendth1), the weighted linear representation of Cup2 as We2×(LeftCore2+LeftMem2+LeftBendth2), and the weighted linear representation of Cup3 as We3×(LeftCore3+LeftMem3+LeftBendth3).

[0097] In some embodiments, the weighted linear representation of Cup1 obtained by the computer device can also be We1×[(W1×LeftCore1)+(W2×LeftMem1)+(W3×LeftBendth1)], the weighted linear representation of Cup2 can also be We2×[(W1×LeftCore2)+(W2×LeftMem2)+(W3×LeftBendth2)], and the weighted linear representation of Cup3 can also be We3×[(W1×LeftCore3)+(W2×LeftMem3)+(W3×LeftBendth3)].

[0098] Step 1033, add the m weighted linear representations of the remaining resource capacity of the m physical machines to obtain a linear function with the number of deployed containers of each type of container on each physical machine as the independent variable and the total remaining resource capacity of the m physical machines as the dependent variable.

[0099] Exemplarily, the three weighted linear representations corresponding to the above three physical machines are added to obtain a linear function: Left = We1×(LeftCore1+LeftMem1+LeftBendth1)+We2×(LeftCore2+LeftMem2+LeftBendth2)+We3×(LeftCore3+LeftMem3+LeftBendth3).

[0100] In some embodiments, the three weighted linear representations corresponding to the above three physical machines are added together to obtain a linear function: Left = We1×[(W1×LeftCore1)+(W2×LeftMem1)+(W3×LeftBendth1)]+We2×[(W1×LeftCore2)+(W2×LeftMem2)+(W3×LeftBendth2)]+We3×[(W1×LeftCore3)+(W2×LeftMem3)+(W3×LeftBendth3)]; accordingly, the function Left is solved.min =Min{We1×[(W1×LeftCore1)+(W2×LeftMem1)+(W3×LeftBendth1)]+We2×[(W1×LeftCore2)+(W2×LeftMem2)+(W3×LeftBendth2)]+We3×[(W1×LeftCore3)+(W2×LeftMem3)+(W3×LeftBendth3)]}, that is, the number of deployed containers of each type of container on each physical machine is obtained, where Min{} means finding the minimum value.

[0101] To summarize, the container deployment method and container planning method provided in this embodiment simultaneously plan the container deployment on each physical machine, taking into account the resource utilization of all physical machines to be deployed, and setting weights for the resource utilization of each physical machine to achieve a global optimal effect; in order to ensure that if each physical machine has remaining resources, it can still be allocated and utilized, the method also sets remaining resource weights, so as to achieve the effect of fully utilizing the resources on each physical machine and minimizing the waste of physical machine resources.

[0102] The above embodiment can be a method for mixed deployment of containers on a physical machine where no containers are deployed, or a method for mixed deployment of containers on a physical machine where containers are deployed and where there is more remaining resource capacity. If mixed deployment of containers is performed on a physical machine where containers are deployed (i.e., a deployed physical machine), the machine resource capacity of the above physical machine is the remaining resource capacity. There is also a situation where the remaining resource capacity of the deployed physical machine is less than the minimum schedulable resource, i.e., the deployed physical machine has remaining resource capacity, but no container can be deployed. At this time, in order to make use of this remaining resource capacity, the computer device can schedule the containers on the deployed physical machine and redeploy the containers. For example, Figure 4 , shows a container deployment method provided by another exemplary embodiment of the present application, the method comprising:

[0103] Step 201, in response to the remaining resource capacity of the deployed physical machine being less than the minimum schedulable resource, at least two deployed containers in the deployed physical machine are sorted from small to large according to the occupied resource capacity to obtain a sorted sequence of the at least two deployed containers.

[0104] The computer device detects that the remaining resource capacity of the deployed physical machine is less than the minimum schedulable resource. In response to this detection information, the computer device obtains the occupied resource capacity of each deployed container on the deployed physical machine, and arranges at least two deployed containers in an ascending order according to their respective occupied resource capacities to obtain a sequence of the at least two deployed containers.

[0105] Optionally, there are at least two types of resources on the deployed physical machine, and each type of resource is set with a priority. When the computer device sorts the deployed containers based on the occupied resource capacity, it compares them in sequence according to the priority of each type of resource. For example, when sorting according to CPU, memory and bandwidth, the occupied capacity of the CPU is compared first, the occupied capacity of the memory is compared second, and the occupied capacity of the bandwidth is compared last.

[0106] Step 202: In response to the sum of the remaining resource capacities of the first k deployed containers and the deployed physical machines in the sequence being greater than or equal to the minimum schedulable resources, the first k deployed containers are evicted from the deployed physical machines and placed in a pool of containers to be deployed.

[0107] Wherein, k is a positive integer. Exemplarily, the computer device places the first deployed container in the list of containers to be evicted and updates the sequence; then continues to determine whether the sum of the resource occupation capacity and the remaining resource capacity of the deployed containers in the list to be evicted is greater than or less than the minimum schedulable resource. If so, the deployed container in the list to be evicted is evicted from the deployed physical machine; if not, the first deployed container in the updated sequence is placed in the list of containers to be evicted, until the sum of the resource occupation capacity and the remaining resource capacity of the deployed containers in the list to be evicted is greater than or equal to the minimum schedulable resource, and the evicted container is placed in the pool of containers to be deployed, waiting for redeployment. It should be noted that the screening and expulsion of deployed containers is stopped only when the sum of the remaining resource capacity of each type of resource is greater than the minimum schedulable resource of that type of resource.

[0108] In summary, the container deployment method provided in this embodiment can splice the fragmented resources on the deployed physical machine and reuse them, thereby achieving full utilization of the resources of the deployed physical machine and avoiding waste of physical machine resources.

[0109] Figure 5 A block diagram of a container deployment device provided by an exemplary embodiment of the present application is shown. The device can be implemented as part or all of a server or terminal through software, hardware, or a combination of both. The device includes:

[0110] The acquisition module 301 is used to acquire the container occupied capacity and the number of containers of each type of container in n types of containers, where n is a positive integer; and to acquire the machine resource capacity of each physical machine in m physical machines, where m is a positive integer;

[0111] A construction module 302 is used to construct a linear function based on the container occupied capacity and the machine resource capacity, with the number of deployed containers of each type of container on each physical machine as an independent variable and the total remaining resource capacity of m physical machines after being occupied by n types of containers as a dependent variable;

[0112] The calculation module 303 is used to calculate the number of deployed containers of each type of container deployed on each physical machine when the total remaining resource capacity is minimized based on a linear function, taking the number of containers and the machine resource capacity as constraints;

[0113] The deployment module 304 is used to deploy containers according to the number of deployment containers of each type of container deployed on each physical machine.

[0114] In some embodiments, the device stores machine weights set according to the deployment order of the machines, the i-th deployed physical machine corresponds to the i-th machine weight, and i is a positive integer less than or equal to m;

[0115] A construction module 302 is used to construct a linear representation of the remaining resource capacity of the i-th deployed physical machine based on the occupied capacity of the container, the number of deployed containers of each type of container on the i-th deployed physical machine, and the machine resource capacity of the i-th deployed physical machine;

[0116] A construction module 302 is used to multiply the linear representation of the remaining resource capacity of the i-th deployed physical machine by the i-th machine weight to obtain a weighted linear representation of the remaining resource capacity of the i-th deployed physical machine;

[0117] The construction module 302 is used to add the m weighted linear representations of the remaining resource capacity of the m physical machines to obtain a linear function with the number of deployed containers of each type of container on each physical machine as the independent variable and the total remaining resource capacity after the m physical machines as the dependent variable.

[0118] In some embodiments, each physical machine has at least two types of resources, and the device has a j-th type of resource and a j-th remaining resource weight stored correspondingly, where j is a positive integer;

[0119] A construction module 302 is used to construct a first linear representation of the capacity of the j-th resource type occupied by n types of containers on the i-th deployed physical machine according to the occupied capacity of the containers and the number of deployed containers of each type of container on the i-th deployed physical machine; subtract the first linear representation from the capacity of the j-th resource type of the i-th deployed physical machine to obtain a second linear representation of the remaining capacity of the j-th resource type of the i-th deployed physical machine;

[0120] Construction module 302 is used to multiply the second linear representation by the jth remaining resource weight to obtain a weighted second linear representation of the remaining capacity of the jth type of resources of the i-th deployed physical machine; and add the weighted second linear representations of the remaining capacity of at least two types of resources to obtain a linear representation of the remaining resource capacity of the i-th deployed physical machine.

[0121] In some embodiments, the acquisition module 301 is used to acquire the program release duration of the application program running in the candidate container; in response to the program release duration being greater than the duration threshold, the candidate container is determined as the container.

[0122] In some embodiments, the acquisition module 301 is used to acquire a change rate of resource capacity used by a candidate container within a specified time period; in response to the change rate being less than a change rate threshold, the candidate container is determined as a container.

[0123] In some embodiments, the apparatus further comprises:

[0124] A sorting module 305 is used to sort at least two deployed containers in the deployed physical machine from small to large according to occupied resource capacity in response to the remaining resource capacity of the deployed physical machine being less than the minimum schedulable resource, to obtain a sorted sequence of the at least two deployed containers;

[0125] The scheduling module 306 is used to evict the first k deployed containers from the deployed physical machines and place them in the to-be-deployed container pool in response to the sum of the remaining resource capacities of the first k deployed containers and the deployed physical machines in the sequence being greater than the minimum schedulable resources, where k is a positive integer.

[0126] To summarize, the container deployment device provided in this embodiment constructs a linear function of the remaining resource capacity after the application is deployed on the physical machine based on the resource capacity occupied by the deployment container required for the application and the resource capacity provided by the physical machine. When the remaining resource capacity is minimum, the number of deployment containers applied on each physical machine is directly determined, and the application is deployed according to the number of deployment containers applied on each physical machine determined above. There is no need to perform a scoring operation on each container of the application deployed on each physical machine, which greatly reduces the machine's computing power, reduces computing costs, improves the machine's computing efficiency, and also improves the container deployment efficiency.

[0127] Figure 6 A schematic diagram of the structure of a computer device provided by an exemplary embodiment of the present application is shown. The computer device may be a device for executing the container deployment method provided by the present application, and the computer device may be a terminal or a server. Specifically:

[0128] The computer device 400 includes a central processing unit (CPU) 401, a system memory 404 including a random access memory (RAM) 402 and a read only memory (ROM) 403, and a system bus 405 connecting the system memory 404 and the central processing unit 401. The computer device 400 also includes a basic input / output system (I / O system) 406 for facilitating information transmission between various components in the computer, and a large-capacity storage device 407 for storing an operating system 413, application programs 414, and other program modules 415.

[0129] The basic input / output system 406 includes a display 408 for displaying information and an input device 409 such as a mouse and a keyboard for user inputting information. The display 408 and the input device 409 are connected to the central processing unit 401 through an input / output controller 410 connected to the system bus 405. The basic input / output system 406 may also include an input / output controller 410 for receiving and processing inputs from a plurality of other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 410 also provides output to a display screen, a printer, or other types of output devices.

[0130] The mass storage device 407 is connected to the central processing unit 401 through a mass storage controller (not shown) connected to the system bus 405. The mass storage device 407 and its associated computer readable media provide non-volatile storage for the computer device 400. That is, the mass storage device 407 may include a computer readable medium (not shown) such as a hard disk or a compact disc read only memory (CD-ROM) drive.

[0131] Computer readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Flash memory or other solid-state storage technologies, CD-ROM, Digital Versatile Disc (DVD) or Solid State Drive (SSD), other optical storage, cassettes, tapes, disk storage or other magnetic storage devices. Among them, random access memory may include resistance random access memory (ReRAM) and dynamic random access memory (DRAM). Of course, those skilled in the art will know that computer storage media are not limited to the above. The above-mentioned system memory 404 and large-capacity storage device 407 can be collectively referred to as memory.

[0132] According to various embodiments of the present application, the computer device 400 can also be connected to a remote computer on the network through a network such as the Internet. That is, the computer device 400 can be connected to the network 412 through the network interface unit 411 connected to the system bus 405, or the network interface unit 411 can be used to connect to other types of networks or remote computer systems (not shown).

[0133] The above-mentioned memory also includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU.

[0134] In an optional embodiment, a computer device is provided, which includes a processor and a memory, wherein at least one instruction, at least one program, a code set, or an instruction set is stored in the memory, and the at least one instruction, at least one program, a code set, or an instruction set is loaded and executed by the processor to implement the container deployment method as described above.

[0135] In an optional embodiment, a computer-readable storage medium is provided, in which at least one instruction, at least one program, code set or instruction set is stored, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the container deployment method as described above.

[0136] Optionally, the computer readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a solid state drive (SSD), or an optical disk. Among them, the random access memory may include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM). The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

[0137] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0138] The present application also provides a computer-readable storage medium, which stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the container deployment method provided by the above-mentioned method embodiments.

[0139] The present application also provides a computer program product, the computer program product includes computer instructions, the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the container deployment method as described above.

[0140] It should be understood that the "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0141] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0142] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A container deployment method, characterized in that: The method comprises: Get the container occupied capacity and container quantity of each type of container in n types of containers, where n is a positive integer; Get the machine resource capacity of each of the m physical machines, where m is a positive integer; Based on the container occupied capacity and the machine resource capacity, a linear function is constructed with the number of deployed containers of each type of container on each physical machine as an independent variable and the total remaining resource capacity of the m physical machines after being occupied by the n types of containers as a dependent variable; Taking the number of containers and the machine resource capacity as constraints, the number of deployed containers of each type of container deployed on each physical machine is calculated based on the linear function when the total remaining resource capacity is minimized; Deploy containers according to the number of deployed containers of each type of container deployed on each physical machine; Applied in a computer device, the computer device stores machine weights set according to the deployment order of the machines, the i-th deployed physical machine corresponds to the i-th machine weight, and i is a positive integer less than or equal to m; The step of constructing a linear function based on the container occupied capacity and the machine resource capacity, taking the number of deployed containers of each type of container on each physical machine as an independent variable and the total remaining resource capacity of the m physical machines after being occupied by the n types of containers as a dependent variable, includes: Constructing a linear representation of the remaining resource capacity of the i-th deployed physical machine based on the occupied capacity of the container, the number of deployed containers of each type of container on the i-th deployed physical machine, and the machine resource capacity of the i-th deployed physical machine; Multiplying the linear representation of the remaining resource capacity of the i-th deployed physical machine by the i-th machine weight to obtain a weighted linear representation of the remaining resource capacity of the i-th deployed physical machine; Adding m weighted linear representations of the remaining resource capacity of the m physical machines to obtain the linear function with the number of deployed containers of each type of container on each physical machine as the independent variable and the total remaining resource capacity of the m physical machines as the dependent variable; Each of the physical machines has at least two types of resources, and the computer device has a j-th type of resource and a j-th remaining resource weight stored correspondingly, where j is a positive integer; The step of constructing a linear representation of the remaining resource capacity of the i-th deployed physical machine based on the occupied capacity of the container, the number of deployed containers of each type of container on the i-th deployed physical machine, and the machine resource capacity of the i-th deployed physical machine includes: Constructing a first linear representation of the j-th resource capacity occupied by the n-th type of containers on the i-th deployed physical machine according to the capacity occupied by the containers and the number of deployed containers of each type of containers on the i-th deployed physical machine; Subtract the first linear representation from the capacity of the j-th resource of the i-th deployed physical machine to obtain a second linear representation of the remaining capacity of the j-th resource of the i-th deployed physical machine; Multiplying the second linear representation by the j-th remaining resource weight to obtain a weighted second linear representation of the remaining capacity of the j-th type of resources of the i-th deployed physical machine; The weighted second linear representations of the remaining capacities of the at least two types of resources are added together to obtain a linear representation of the remaining resource capacity of the i-th deployed physical machine.

2. The method according to claim 1, characterized in that Before obtaining the container occupied capacity and the container quantity of each type of container in the n types of containers, the method includes: Get the program release time of the application running in the candidate container; In response to the program release duration being greater than a duration threshold, the candidate container is determined as the container.

3. The method according to claim 1, characterized in that Before obtaining the container occupied capacity and the container quantity of each type of container in the n types of containers, the method includes: Obtain the change rate of resource capacity used by the candidate container within a specified time period; In response to the change rate being less than a change rate threshold, the candidate container is determined as the container.

4. The method according to claim 1, characterized in that The method further comprises: In response to the remaining resource capacity of the deployed physical machine being less than the minimum schedulable resource, sorting at least two deployed containers in the deployed physical machine from small to large according to the occupied resource capacity to obtain a sorted sequence of the at least two deployed containers; In response to the sum of the remaining resource capacity of the first k deployed containers in the sequence and the deployed physical machine being greater than the minimum schedulable resource, the first k deployed containers are evicted from the deployed physical machine and placed in a pool of containers to be deployed, where k is a positive integer.

5. A container deployment device, characterized in that: The device comprises: The acquisition module is used to obtain the container occupied capacity and the number of containers of each type of container in n types of containers, where n is a positive integer; and obtain the machine resource capacity of each physical machine in m physical machines, where m is a positive integer; A construction module, configured to construct a linear function based on the occupied capacity of the container and the resource capacity of the machine, with the number of deployed containers of each type of container on each physical machine as an independent variable and the total remaining resource capacity of the m physical machines after being occupied by the n types of containers as a dependent variable; A calculation module, configured to calculate the number of deployed containers of each type of container deployed on each physical machine when the total remaining resource capacity is minimized based on the linear function, taking the number of containers and the machine resource capacity as constraints; A deployment module, used to deploy containers according to the number of deployed containers of each type of container deployed on each physical machine; The device stores machine weights set according to the deployment order of the machines, the i-th deployed physical machine corresponds to the i-th machine weight, and i is a positive integer less than or equal to m; The construction module is used to construct a linear representation of the remaining resource capacity of the i-th deployed physical machine based on the occupied capacity of the container, the number of deployed containers of each type of container on the i-th deployed physical machine, and the machine resource capacity of the i-th deployed physical machine; The construction module is used to multiply the linear representation of the remaining resource capacity of the i-th deployed physical machine by the i-th machine weight to obtain a weighted linear representation of the remaining resource capacity of the i-th deployed physical machine; The construction module is used to add the m weighted linear representations of the remaining resource capacity of the m physical machines to obtain the linear function with the number of deployed containers of each type of container on each physical machine as the independent variable and the total remaining resource capacity after the m physical machines as the dependent variable; Each of the physical machines has at least two types of resources, and the device has a j-th type of resource and a j-th remaining resource weight stored correspondingly, where j is a positive integer; The construction module is used to construct a first linear representation of the capacity of the j-th resource type occupied by the n-type containers on the i-th deployed physical machine according to the capacity occupied by the containers and the number of deployed containers of each type of container on the i-th deployed physical machine; subtract the first linear representation from the capacity of the j-th resource type of the i-th deployed physical machine to obtain a second linear representation of the remaining capacity of the j-th resource type of the i-th deployed physical machine; The construction module is used to multiply the second linear representation by the j-th remaining resource weight to obtain a weighted second linear representation of the remaining capacity of the j-th type of resources of the i-th deployed physical machine; and add the weighted second linear representations of the remaining capacity of the at least two types of resources to obtain a linear representation of the remaining resource capacity of the i-th deployed physical machine.

6. The device according to claim 5, characterized in that The acquisition module is configured to acquire a program release duration of an application program running in a candidate container; and in response to the program release duration being greater than a duration threshold, determine the candidate container as the container.

7. The device according to claim 5, characterized in that The acquisition module is used to acquire a change rate of resource capacity used by a candidate container within a specified time period; in response to the change rate being less than a change rate threshold, determine the candidate container as the container.

8. The device according to claim 5, characterized in that The device also includes: a sorting module, configured to sort at least two deployed containers in the deployed physical machine from small to large according to occupied resource capacity in response to the remaining resource capacity of the deployed physical machine being less than the minimum schedulable resource, to obtain a sorted sequence of the at least two deployed containers; A scheduling module, configured to evict the first k deployed containers from the deployed physical machine and place them in a pool of containers to be deployed in response to the sum of the remaining resource capacity of the first k deployed containers in the sequence and the deployed physical machine being greater than the minimum schedulable resource, where k is a positive integer.

9. A computer device, characterized in that: The computer device comprises: a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the container deployment method according to any one of claims 1 to 4.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the container deployment method according to any one of claims 1 to 4.