Container scheduling method and device of distributed system, storage medium and electronic equipment

By detecting the working status and resource matching of distributed nodes, the problem of low container scheduling efficiency in distributed systems is solved, container migration is realized based on the resource distribution of candidate nodes, and the resource utilization and stability of the system are improved.

CN118733253APending Publication Date: 2024-10-01JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410706494.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In existing distributed systems, when Prometheus is used to monitor resource usage for container migration, resource distribution cannot be accurately identified, resulting in low container scheduling efficiency.

Method used

By detecting the working status of each distributed node, based on the computing power information and resource requirements of the target node, matching the container level from high to low with the remaining resources of other nodes, finding candidate nodes that meet the resource requirements, and placing the target container Migrate to this node.

Benefits of technology

It improves the container scheduling efficiency of distributed systems, ensures that container migration is based on accurate resource distribution, and improves the resource utilization and stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733253A_ABST
    Figure CN118733253A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a container scheduling method and device of a distributed system, a storage medium and electronic device.The method comprises the steps that the working state of each distributed node is detected; and when it is detected that the working state of the target distributed node is used for indicating that the target node computing power information of the target distributed node is greater than or equal to a computing power threshold value, determining the target distributed node, matching the resource demand quantity of the application container with the resource surplus quantity of other distributed nodes in the distributed system according to the container grade of a reference application container running in the target distributed node from high to low until candidate distributed nodes of which the resource surplus quantity meets the resource demand quantity of the target application container are obtained; and migrating the target application container to the candidate distributed nodes. Through the container scheduling method and device, the problem that the container scheduling efficiency of the distributed system is low is solved, and then the effect of improving the container scheduling efficiency of the distributed system is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the computer field, and in particular, to a container scheduling method, device, storage medium, and electronic device for a distributed system. Background Art

[0002] In the related art, Prometheus (an open source system monitoring and alarm toolkit) is generally used to monitor the resource usage of distributed nodes in a distributed system, and the application containers deployed in the distributed nodes are migrated according to the resource usage. However, Prometheus alone cannot accurately identify the resource distribution in the distributed nodes, and it is also impossible to determine the migration direction of the application container, resulting in reduced container scheduling efficiency of the distributed system.

[0003] In view of the low efficiency of container scheduling in distributed systems and other issues in related technologies, no effective solutions have been proposed yet. Summary of the invention

[0004] The embodiments of the present application provide a container scheduling method, device, storage medium and electronic device for a distributed system, so as to at least solve the problem of low efficiency of container scheduling for a distributed system in the related art.

[0005] According to an embodiment of the present application, a container scheduling method for a distributed system is provided, which is applied to a controller deployed in a distributed system, wherein the distributed system includes multiple distributed nodes, and one or more application containers are allowed to run on the distributed nodes. The application container is used to run an application using application resources provided by the distributed nodes. The method includes:

[0006] Detecting the working state of each distributed node, wherein the working state is used to indicate the relationship between the first node computing power information of the corresponding distributed node and the computing power threshold, and the first node computing power information is used to indicate the node computing power currently used by the corresponding distributed node;

[0007] In the case where it is detected that the working state of the target distributed node is used to indicate that the target node computing power information of the target distributed node is greater than or equal to the computing power threshold, the resource demand of the application container is matched with the resource surplus of other distributed nodes in the distributed system according to the container level of the reference application container running in the target distributed node from high to low, until a candidate distributed node whose resource surplus meets the resource demand of the target application container is obtained, wherein the container level of the application container is positively correlated with the proportion of application resources used by the application container in the total application resources of the distributed node, and the other distributed nodes are distributed nodes other than the target distributed node among the multiple distributed nodes;

[0008] Migrate the target application container to the candidate distributed node.

[0009] In an exemplary embodiment, the matching of the resource demand of the application container with the remaining resources of other distributed nodes in the distributed system according to the container level of the reference application container running in the target distributed node from high to low until a candidate distributed node with remaining resources that meets the resource demand of the target application container is obtained includes: detecting the container level of each reference application container according to the container processor information, container memory information and container computing power information of the reference application container, and the node processor information, node memory information and second node computing power information of the target distributed node; traversing the reference application containers from high to low according to the container level of the reference application containers; matching the resource demand of the currently traversed reference application container with the remaining resources of the other distributed nodes one by one; in the case of matching a distributed node whose remaining resources meet the resource demand of the currently traversed reference application container, determining the currently traversed reference application container as the target application container, and determining the matched distributed node as the candidate distributed node; in the case of not matching a distributed node whose remaining resources meet the resource demand of the currently traversed reference application container, continuing to traverse the reference application container.

[0010] In an exemplary embodiment, the detecting the container level of each reference application container according to the container processor information, container memory information and container computing power information of the reference application container, as well as the node processor information, node memory information and second node computing power information of the target distributed node, includes: obtaining the container processor information, the container memory information and the container computing power information, as well as the node processor information, the node memory information and the second node computing power information, wherein the container processor information is used to indicate the amount of processor resources allowed to be used by the reference application container, and the container memory information is used to indicate the amount of memory resources allowed to be used by the reference application container , the container computing power information is used to indicate the computing power allowed to be used by the reference application container, the node processor information is used to indicate the amount of processor resources allowed to be used by the target distributed node, the node memory information is used to indicate the amount of memory resources allowed to be used by the target distributed node, and the second node computing power information is used to indicate the computing power allowed to be used by the target distributed node; a first sum of the container processor information, the container memory information, and the container computing power information is calculated, and a second sum of the node processor information, the node memory information, and the second node computing power information is calculated; a ratio of the first sum to the second sum is calculated to obtain the container level of the reference application container.

[0011] In an exemplary embodiment, matching the resource demand of the currently traversed reference application container with the resource remaining amounts of the other distributed nodes one by one includes: traversing the other distributed nodes; detecting the relationship between the resource remaining amounts of the currently traversed other distributed nodes and a resource threshold, wherein the resource threshold is N times the resource demand of the currently traversed reference application container, and N is greater than 1; in the case where it is detected that the resource remaining amount of the currently traversed other distributed nodes is greater than or equal to the resource threshold, determining a distributed node whose resource remaining amount meets the resource demand of the currently traversed reference application container; in the case where it is detected that the resource remaining amount of the currently traversed other distributed nodes is less than the resource threshold, continuing to traverse the other distributed nodes; in the case where the traversal of the other distributed nodes is completed but no other distributed nodes whose resource remaining amount is greater than or equal to the resource threshold are detected, determining a distributed node whose resource remaining amount meets the resource demand of the currently traversed reference application container is not matched.

[0012] In an exemplary embodiment, the detecting of the working status of each distributed node includes: accessing an extended Berkeley packet filter mapping of each distributed node, extracting the node computing power information corresponding to the node computing power field in the extended Berkeley packet filter mapping, and obtaining the first node computing power information, wherein an extended Berkeley packet filter is deployed on each distributed node, and the extended Berkeley packet filter is used to capture the node resource information of the distributed node from the corresponding distributed node and store it in the form of a key value to the extended Berkeley packet filter mapping, wherein the node resources include processor resources, memory resources and node computing power; the relationship between the first node computing power information and the computing power threshold is detected to obtain the working status.

[0013] In an exemplary embodiment, migrating the target application container to the candidate distributed node includes: obtaining a target node architecture of the target distributed node and a candidate node architecture of the candidate distributed node; determining an architectural relationship between the target distributed node and the candidate distributed node based on the target node architecture and the candidate node architecture, wherein the architectural relationship is used to indicate that the target distributed node and the candidate distributed node are isomorphic, or the target distributed node and the candidate distributed node are heterogeneous; in a case where the architectural relationship is used to indicate that the target distributed node and the candidate distributed node are heterogeneous, modifying the container image address of the target application container to a candidate container image address that conforms to the candidate node architecture, wherein the container image address of the application container is used to indicate a deployment method of the application container in the distributed node; deploying the target application container to the candidate distributed node according to the candidate container image address; in a case where the architectural relationship is used to indicate that the target distributed node and the candidate distributed node are heterogeneous, deploying the target application container to the candidate distributed node according to the container image address of the target application container.

[0014] In an exemplary embodiment, after migrating the target application container to the candidate distributed node, the method further includes: detecting a current working status of the target distributed node; when it is detected that the current working status is used to indicate that the current node computing power information of the target distributed node is still greater than or equal to the computing power threshold, continuing to migrate the application container of the target distributed node; when it is detected that the current working status is used to indicate that the current node computing power information of the target distributed node is less than the computing power threshold, executing the step of detecting the working status of each distributed node.

[0015] According to another embodiment of the present application, a container scheduling device for a distributed system is provided, which is applied to a controller deployed in a distributed system, wherein the distributed system includes multiple distributed nodes, and one or more application containers are allowed to run on the distributed nodes. The application container is used to run an application using application resources provided by the distributed nodes. The device includes:

[0016] A first detection module is used to detect the working state of each distributed node, wherein the working state is used to indicate the relationship between the first node computing power information of the corresponding distributed node and the computing power threshold, and the first node computing power information is used to indicate the node computing power currently used by the corresponding distributed node;

[0017] a matching module for matching the resource demand of the application container with the remaining resources of other distributed nodes in the distributed system according to the container level of the reference application container running in the target distributed node from high to low, when it is detected that the working state of the target distributed node indicates that the target node computing power information of the target distributed node is greater than or equal to the computing power threshold, until a candidate distributed node whose remaining resources meet the resource demand of the target application container is obtained, wherein the container level of the application container is positively correlated with the proportion of application resources used by the application container in the total application resources of the distributed node, and the other distributed nodes are distributed nodes other than the target distributed node among the multiple distributed nodes;

[0018] The first migration module is used to migrate the target application container to the candidate distributed node.

[0019] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0020] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0021] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0022] Through the present application, the working state of each distributed node is detected, wherein the working state is used to indicate the relationship between the first node computing power information of the corresponding distributed node and the computing power threshold, and the first node computing power information is used to indicate the node computing power currently used by the corresponding distributed node; when it is detected that the working state of the target distributed node is used to indicate that the target node computing power information of the target distributed node is greater than or equal to the computing power threshold, the resource demand of the application container and the resource surplus of other distributed nodes in the distributed system are matched from high to low according to the container level of the reference application container running in the target distributed node, until a candidate distributed node whose resource surplus meets the resource demand of the target application container is obtained, wherein the container level of the application container and the proportion of the application resources used by the application container in the total application resources of the distributed node are positively correlated, and the other distributed nodes are distributed nodes other than the target distributed node among the multiple distributed nodes; the target application container is migrated to the candidate distributed node. Since the controller is configured to determine the candidate distributed node whose resource surplus meets the resource demand of the target application container according to the container level of the reference application container, the resource demand of the application container and the resource surplus of other distributed nodes, the migration operation of the target application container is realized according to the resource distribution of the candidate distributed node. Therefore, the problem of low container scheduling efficiency in distributed systems can be solved, thereby achieving the effect of improving the container scheduling efficiency in distributed systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a hardware structure block diagram of a server device of a container scheduling method for a distributed system according to an embodiment of the present application;

[0024] Figure 2 is a flow chart of a container scheduling method for a distributed system according to an embodiment of the present application;

[0025] Figure 3 is a schematic diagram of a working process of a distributed node according to an embodiment of the present application;

[0026] Figure 4 is a schematic diagram of a distributed system according to an embodiment of the present application;

[0027] Figure 5 is a flowchart of a scheduling process of a container in a distributed system according to an embodiment of the present application;

[0028] Figure 6 is a structural block diagram of a container scheduling device for a distributed system according to an embodiment of the present application;

[0029] Figure 7 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0030] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0032] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a container scheduling method for a distributed system in an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 The server device may include a processor 102 (only one is shown) (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data, wherein the server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components than shown, or with different Figure 1 Different configurations are shown.

[0033] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the container scheduling method of the distributed system in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory arranged relative to the processor 102 process, and these process memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0034] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0035] In this embodiment, a container scheduling method for a distributed system is provided, which is applied to a controller deployed in a distributed system. The distributed system includes multiple distributed nodes. One or more application containers are allowed to run on the distributed nodes. The application containers are used to run applications using application resources provided by the distributed nodes. Figure 2 is a flow chart of a container scheduling method for a distributed system according to an embodiment of the present application. Figure 2 As shown, the process includes the following steps:

[0036] Step S202, detecting the working state of each distributed node, wherein the working state is used to indicate the relationship between the first node computing power information of the corresponding distributed node and the computing power threshold, and the first node computing power information is used to indicate the node computing power currently used by the corresponding distributed node;

[0037] Step S204, when it is detected that the working state of the target distributed node is used to indicate that the target node computing power information of the target distributed node is greater than or equal to the computing power threshold, the resource demand of the application container is matched with the resource surplus of other distributed nodes in the distributed system according to the container level of the reference application container running in the target distributed node from high to low, until a candidate distributed node whose resource surplus meets the resource demand of the target application container is obtained, wherein the container level of the application container is positively correlated with the proportion of application resources used by the application container in the total application resources of the distributed node, and the other distributed nodes are distributed nodes other than the target distributed node among the multiple distributed nodes;

[0038] Step S206: Migrate the target application container to the candidate distributed node.

[0039] Through the above steps, the working state of each distributed node is detected, wherein the working state is used to indicate the relationship between the first node computing power information of the corresponding distributed node and the computing power threshold, and the first node computing power information is used to indicate the node computing power currently used by the corresponding distributed node; when it is detected that the working state of the target distributed node is used to indicate that the target node computing power information of the target distributed node is greater than or equal to the computing power threshold, the resource demand of the application container is matched with the resource surplus of other distributed nodes in the distributed system from high to low according to the container level of the reference application container running in the target distributed node, until a candidate distributed node whose resource surplus meets the resource demand of the target application container is obtained, wherein the container level of the application container is positively correlated with the proportion of the application resources used by the application container in the total application resources of the distributed node, and the other distributed nodes are distributed nodes other than the target distributed node among the multiple distributed nodes; the target application container is migrated to the candidate distributed node. Since the controller is configured to determine the candidate distributed node whose resource surplus meets the resource demand of the target application container according to the container level of the reference application container, the resource demand of the application container and the resource surplus of other distributed nodes, the migration operation of the target application container is realized according to the resource distribution of the candidate distributed node. Therefore, the problem of low container scheduling efficiency in distributed systems can be solved, thereby achieving the effect of improving the container scheduling efficiency in distributed systems.

[0040] Optionally, in this embodiment, the container scheduling method of the distributed system proposed in the present application is applied to a distributed system scenario. The above-mentioned distributed system may be but is not limited to a heterogeneous distributed system or a homogeneous distributed system. The distributed system includes multiple distributed nodes, and the above-mentioned distributed nodes may be but are not limited to having different hardware architectures or processor types, such as: CPU, GPU (Graphics Processing Unit), DPU (Data Processing Unit), FPGA (Field-Programmable Gate Array), etc.

[0041] In a heterogeneous distributed system, the distributed nodes can be divided into distributed nodes belonging to ARM (Advanced RISC Machine) architecture, distributed nodes belonging to AMD (Advanced Micro Devices) architecture, etc. according to the processor architecture to which the distributed nodes belong, but is not limited to.

[0042] Optionally, in this embodiment, each distributed node in the distributed system may run one or more application containers but is not limited to running one or more application containers. Each application container has its allowed application resources, and the application container implements its corresponding processing function in the application container by using the application resources.

[0043] In the technical solution provided in the above step S202, the above computing power threshold is used to indicate the upper limit of the processing capacity of the distributed node, which can be but is not limited to a pre-set fixed value, or a value that is continuously adjusted and optimized according to the actual operation of the current distributed node.

[0044] Optionally, in this embodiment, the first node computing power information of the above-mentioned distributed node can be determined, but not limited to, based on the changes in the CPU, memory, and computing power of the distributed node, such as: obtaining the CPU usage, memory usage, and computing power value of the distributed node, and detecting whether they exceed the upper limit of the resources allowed to be used by the distributed node. When there are resources in the CPU usage, memory usage, or computing power value that exceed the upper limit of the resources allowed to be used by the distributed node, it can be determined that the working state of the target distributed node is used to indicate that the target node computing power information of the target distributed node is greater than or equal to the computing power threshold. Alternatively, the controller can also determine the working state of the distributed node by obtaining the node computing power currently used by each distributed node, detecting whether the node computing power currently used by the distributed node exceeds the upper limit of the processing capacity of the distributed node, i.e., the computing power threshold.

[0045] Optionally, in this embodiment, the controller may, but is not limited to, directly detect the first node computing power information of each distributed node and compare it with the non-computing power threshold. Alternatively, by deploying a collector in each distributed system, the collector obtains the first node computing power information of each distributed node, and the collector stores the mapping relationship between the first node computing power information and the non-distributed nodes in the storage space. The controller obtains the first node computing power information of each distributed node from the storage space and determines the relationship between the first node computing power information and the non-computing power threshold. Alternatively, the controller may also obtain the first node computing power information of each distributed node in other ways, and determine the working status of each distributed node based on the relationship between the first node computing power information and the non-computing power threshold.

[0046] In an exemplary embodiment, the working status of each distributed node can be detected in the following manner, but is not limited to: accessing the extended Berkeley packet filter map of each distributed node, extracting the node computing power information corresponding to the node computing power field in the extended Berkeley packet filter map, and obtaining the first node computing power information, wherein an extended Berkeley packet filter is deployed on each distributed node, and the extended Berkeley packet filter is used to capture the node resource information of the distributed node from the corresponding distributed node and store it in the form of a key value to the extended Berkeley packet filter map, wherein the node resources include processor resources, memory resources and node computing power; detecting the relationship between the first node computing power information and the computing power threshold to obtain the working status.

[0047] Optionally, in this embodiment, an extended Berkeley Packet Filter (eBPF) may be deployed in each distributed node as a collector of each distributed node, and the node resource information of the deployed distributed node is obtained through the extended Berkeley Packet Filter and is stored in the form of a key value.<key,value> stored in the form of.

[0048] Optionally, in this embodiment, the extended Berkeley packet filter may, but is not limited to, store the acquired Berkeley packet filter mapping in the kernel of the distributed node, and the controller reads the node computing power information (value) of the node computing power field (key = node computing power) in the extended Berkeley packet filter mapping of the distributed node from the kernel of the distributed node, and determines the first node computing power information of the distributed node based on the extended Berkeley packet filter mapping.

[0049] Optionally, in this embodiment, Figure 3 is a schematic diagram of a working process of a distributed node according to an embodiment of the present application, such as Figure 3 As shown, the distributed system includes distributed node 1 and distributed node 2. The eBPF in distributed node 1 is used to obtain information about node resources of application container 1, application container 2 and application container 3 and store them in the form of key values ​​in the eBPF map of distributed node 1; the eBPF of distributed node 2 is used to obtain information about node resources of application container 4 and store them in the form of key values ​​in the eBPF map of distributed node 2.

[0050] Furthermore, other devices having the same function as the non-extended Berkeley packet filter may be deployed in each distributed node but are not limited to the deployment in each distributed node to obtain information on node resources of the distributed node.

[0051] In the technical solution provided in the above step S204, the container level of the application container is determined according to the proportion of the application resources used by the application container in the total application resources of the distributed node, for example: the resource amount of the application resources allocated by the distributed node to the application container is detected, and the proportion of the resource amount of the application resources allocated to the application container in the total application resources of the distributed node is determined. The higher the proportion of the resource amount of the application resources of the application container in the total application resources of the distributed node, the higher the container level of the application container. In other words, the application resources used by the application container may include, but are not limited to, application resources used by the application container, and application resources that the application container is allowed to use but has not yet been used by the application container.

[0052] Optionally, in this embodiment, the resource demand of the application container is the amount of resources that the application container requests the distributed node to allocate to it.

[0053] Optionally, in this embodiment, the remaining amount of resources of the distributed node is the amount of resources that the distributed node has not yet allocated to the application container deployed by it, or the amount of resources that the distributed node is currently allowed to allocate to a newly added application container.

[0054] In an exemplary embodiment, the resource demand of the application container and the resource surplus of other distributed nodes in the distributed system can be matched from high to low according to the container level of the reference application container running in the target distributed node, but is not limited to the following method, until a candidate distributed node whose resource surplus meets the resource demand of the target application container is obtained: according to the container processor information, container memory information and container computing power information of the reference application container, and the node processor information, node memory information and second node computing power information of the target distributed node, the container level of each reference application container is detected; according to the reference application container, the container level of each reference application container is matched with the resource surplus of other distributed nodes in the distributed system from high to low. The reference application container is traversed from high to low using the container level of the container; the resource demand of the currently traversed reference application container is matched with the resource surplus of the other distributed nodes one by one; when a distributed node whose resource surplus meets the resource demand of the currently traversed reference application container is matched, the currently traversed reference application container is determined as the target application container, and the matched distributed node is determined as the candidate distributed node; when a distributed node whose resource surplus meets the resource demand of the currently traversed reference application container is not matched, the reference application container is continued to be traversed.

[0055] Optionally, in the present embodiment, based on the container processor information, container memory information and container computing power information of the reference application container, as well as the node processor information, node memory information and second node computing power information of the target distributed node, detecting the container level of each reference application container may include but is not limited to: determining a proportion of 1 of the container processor of the reference application container in the node processor of the target distributed node based on the container processor information of the reference application container and the node processor information of the target distributed node, determining a proportion of 2 of the container memory of the reference application container in the node memory of the target distributed node based on the container memory information of the reference application container and the node memory information of the target distributed node, determining a proportion of 3 of the container computing power of the reference application container in the node computing power of the target distributed node based on the container computing power information of the reference application container and the second node computing power information of the target distributed node, and taking the sum of proportion 1, proportion 2 and proportion 3 as the container level of the reference application container;

[0056] Alternatively, the degree of influence of the processing performance of the reference application container on the processing performance of the target distributed node is determined based on the container processor information, container memory information and container computing power information of the reference application container, as well as the node processor information, node memory information and second node computing power information of the target distributed node, thereby assigning a container level to the reference application container.

[0057] Optionally, in this embodiment, the application containers in the target distributed node can be arranged from high to low according to the container level, but are not limited to, and each application container is used as a reference application container, and the resource demand of the reference application container is matched with the resource surplus of other distributed nodes one by one. For example: taking a distributed system including distributed node 1, distributed node 2 and distributed node 3, the target distributed node is distributed node 2, and distributed node 2 includes application container 1, application container 2 and application container 3, and arranged from high to low according to the container level as application container 3, application container 1 and application container 2 as an example, the resource demand of application container 3 is matched with the resource surplus of distributed node 1 and distributed node 2. When the resource surplus of distributed node 1 and distributed node 2 does not meet the resource demand of application container 3, the resource demand of application container 1 is matched with the resource surplus of distributed node 1 and distributed node 2, until a candidate distributed node whose resource surplus meets the resource demand of the current reference application container is obtained.

[0058] In an exemplary embodiment, the container level of each reference application container can be detected based on the container processor information, container memory information and container computing power information of the reference application container, as well as the node processor information, node memory information and second node computing power information of the target distributed node, but is not limited to the following method: obtaining the container processor information, the container memory information and the container computing power information, as well as the node processor information, the node memory information and the second node computing power information, wherein the container processor information is used to indicate the amount of processor resources allowed to be used by the reference application container, and the container memory information is used to indicate the amount of memory resources allowed to be used by the reference application container. The container computing power information is used to indicate the computing power allowed to be used by the reference application container, the node processor information is used to indicate the amount of processor resources allowed to be used by the target distributed node, the node memory information is used to indicate the amount of memory resources allowed to be used by the target distributed node, and the second node computing power information is used to indicate the computing power allowed to be used by the target distributed node; a first sum of the container processor information, the container memory information and the container computing power information is calculated, and a second sum of the node processor information, the node memory information and the second node computing power information is calculated; and a ratio of the first sum to the second sum is calculated to obtain the container level of the reference application container.

[0059] Optionally, in this embodiment, the container level of the reference application container may be calculated by, but is not limited to, the following method: obtaining container processor information Container memory information and container computing power information And, the node processor information totalCpu, the node memory information totalMem and the second node computing power information totalComputility;

[0060] Calculate the first sum k of container processor information, container memory information, and container computing power information pod =(availCpu ood +avaiIMem pod +Computility pod );

[0061] Calculate the second sum k of the node processor information, the node memory information and the second node computing power information total =(totalCpu+totalMem+totalComputility);

[0062] Calculate the ratio of the first sum value to the second sum value to obtain the container level k of the reference application container i =k pod / ktotal =(availCpu pod +availMem pod +Computility pod ) / / totalCpu+totalMem+totalComputility).

[0063] In an exemplary embodiment, the resource demand of the reference application container currently traversed and the resource remaining amount of the other distributed nodes can be matched one by one in the following manner, but is not limited to: traverse the other distributed nodes; detect the relationship between the resource remaining amount of the other distributed nodes currently traversed and a resource threshold, wherein the resource threshold is N times the resource demand of the reference application container currently traversed, and N is greater than 1; when it is detected that the resource remaining amount of the other distributed nodes currently traversed is greater than or equal to the resource threshold, determine to match the distributed node whose resource remaining amount meets the resource demand of the reference application container currently traversed; when it is detected that the resource remaining amount of the other distributed nodes currently traversed is less than the resource threshold, continue to traverse the other distributed nodes; when the traversal of the other distributed nodes is completed but no other distributed nodes whose resource remaining amount is greater than or equal to the resource threshold are detected, determine to not match the distributed node whose resource remaining amount meets the resource demand of the reference application container currently traversed.

[0064] Optionally, in this embodiment, during the process of migrating the reference application container, in order to ensure that receiving the reference application container does not affect the original working state of the distributed node, it can be but not limited to the premise that the remaining resources of the distributed node are greater than the resource demand of the reference application container, and there is still a certain margin. Therefore, the resource threshold is set to N times the resource demand of the reference application container currently traversed. Only when the remaining resources of other distributed nodes currently traversed are greater than or equal to the resource threshold, it is considered that the migration conditions are met, so as to avoid a substantial reduction in the resources of the distributed node after migrating the reference application container to the new distributed node, thereby affecting its original work.

[0065] In the technical solution provided in the above step S206, after the target application container is migrated to the candidate distributed node, it is possible but not limited to connect the migrated application container to the eBPF in the candidate distributed node.

[0066] In an exemplary embodiment, the target application container can be migrated to the candidate distributed node in the following manner, but is not limited to: obtaining a target node architecture of the target distributed node and a candidate node architecture of the candidate distributed node; determining an architectural relationship between the target distributed node and the candidate distributed node based on the target node architecture and the candidate node architecture, wherein the architectural relationship is used to indicate that the target distributed node and the candidate distributed node are isomorphic, or the target distributed node and the candidate distributed node are heterogeneous; in a case where the architectural relationship is used to indicate that the target distributed node and the candidate distributed node are heterogeneous, modifying the container image address of the target application container to a candidate container image address that conforms to the candidate node architecture, wherein the container image address of the application container is used to indicate the deployment method of the application container in the distributed node; deploying the target application container to the candidate distributed node according to the candidate container image address; in a case where the architectural relationship is used to indicate that the target distributed node and the candidate distributed node are heterogeneous, deploying the target application container to the candidate distributed node according to the container image address of the target application container.

[0067] Optionally, in this embodiment, since the distributed system can be a heterogeneous distributed system or a homogeneous distributed system, when the target node architecture of the target distributed node is not heterogeneous with the candidate node architecture of the candidate distributed node, the container image address of the target application container needs to be modified to a candidate container image address that conforms to the candidate node architecture.

[0068] Optionally, in this embodiment, the migration of the target application container can be achieved in the following ways but are not limited to: the controller modifies the distribution strategy of the target application container (which can include but is not limited to its node label and node architecture), the container image address and the number of replicas corresponding to the label group / architecture, and according to the modified distribution strategy, the application containers under the workload are grouped according to the distribution strategy, and the redundant application containers in the group where the actual number of replicas is greater than the expected number of replicas are expelled. For example, taking the migration of application container 1 under the ARM architecture to the candidate distributed node under the ADM architecture as an example, when the distribution strategy of application container 1 is modified, the application container is divided into application container 1 belonging to the candidate distributed node under the ADM architecture according to the distribution strategy of application container 1.

[0069] Furthermore, the controller includes a releaseController (application controller) and a workloadController (workload controller). When the application controller receives a heterogeneous migration request, the application controller modifies the distribution strategy corresponding to the application container, the container image address and the number of copies corresponding to the label group / architecture. The workload controller groups the application containers under the workload according to the distribution strategy based on the modified distribution strategy, and expels excess application containers in the group where the actual number of copies is greater than the expected number of copies until the heterogeneous migration is completed.

[0070] Optionally, in this embodiment, the container image address of the application container refers to the path of the container image in the container image library. When migrating the target application container to the candidate distributed node, it is necessary to specify the correct image address for the target application container to ensure that the target application container can pull the image suitable for its scheduling node architecture.

[0071] In addition, you can also, but are not limited to, add node labels to application containers based on the architecture and characteristics of the application containers, define the distribution strategy of the application containers based on the node labels of the application containers and business requirements (that is, the node architecture to which the application containers belong), and implement the deployment and migration of application containers by marking the node labels, distribution strategies, and container image addresses of the application containers.

[0072] In an exemplary embodiment, after migrating the target application container to the candidate distributed node, the following methods may be used, but are not limited to: detecting the current working status of the target distributed node; continuing to migrate the application container of the target distributed node when it is detected that the current working status is used to indicate that the current node computing power information of the target distributed node is still greater than or equal to the computing power threshold; and executing the step of detecting the working status of each distributed node when it is detected that the current working status is used to indicate that the current node computing power information of the target distributed node is less than the computing power threshold.

[0073] Optionally, in this embodiment, after completing the migration of the target application container to the candidate distributed node, continue to detect the current working status of the target distributed node. When the current working status of the target distributed node is used to indicate that the current node computing power information of the target distributed node is still greater than or equal to the computing power threshold, it is necessary to continue to migrate the application container included in the target distributed node until the current working status of the target distributed node is used to indicate that the current node computing power information of the target distributed node is less than the computing power threshold.

[0074] In one exemplary embodiment, an example of a distributed system is provided. Figure 4 is a schematic diagram of a distributed system according to an embodiment of the present application, such as Figure 4 As shown, the distributed system includes distributed nodes with processor architecture types of ARM and AMD, and containerized applications, namely application containers, are run on each distributed node. Different application containers can include but are not limited to different services or components, which are encapsulated in lightweight and portable containers for easy management and deployment. eBPF is deployed in each distributed node to collect the extended Berkeley packet filter mapping of the application container.

[0075] Through the distributed system proposed in this application, by adding eBPF in the distributed nodes, the extended Berkeley packet filter mapping of the application container is obtained through eBPF, so that the controller can migrate the application container between different architectures according to the information in the extended Berkeley packet filter mapping, and schedule the application container to the distributed node with more abundant resources and stronger computing power, so as to avoid business interruption or abnormality caused by excessive resource pressure and provide more stable and efficient services.

[0076] In an exemplary embodiment, an example of a scheduling process of a container in a distributed system is provided. Figure 5 is a flowchart of a scheduling process of a container in a distributed system according to an embodiment of the present application, such as Figure 5 As shown, the distributed system includes distributed nodes 1, 2 and 3, distributed node 1 includes application container 1-1 and application container 1-2, distributed node 2 includes application container 2, and distributed node 3 includes application container 3-1, application container 3-2 and application container 3-3. The working status of each distributed node can be detected by, but not limited to, the following methods, and whether the target distributed node exists in the distributed system can be determined by, but not limited to, the following methods:

[0077] Step S502: accessing the extended Berkeley packet filter mapping of distributed node 1, distributed node 2, and distributed node 3, extracting the node computing power information corresponding to distributed node 1, distributed node 2, and distributed node 3, and obtaining node computing power information 1, node computing power information 2, and node computing power information 3;

[0078] Step S504: compare the node computing power information 1, the node computing power information 2 and the node computing power information 3 respectively without computing power thresholds to determine the working status of the distributed node 1, the distributed node 2 and the distributed node 3.

[0079] Taking the case where the working state of distributed node 3 is detected to indicate that the target node computing power information of distributed node 3 is greater than or equal to the computing power threshold as an example, distributed node 3 is determined as the target distributed node, and the container levels of application container 3-1, application container 3-2, and application container 3-3 included in distributed node 3 may be determined in the following manner, but is not limited to:

[0080] Step S506: respectively obtain the container processor information, container memory information and container computing power information of the application container 3-1, the application container 3-2 and the application container 3-3, and the node processor information, node memory information and the second node computing power information of the distributed node 3;

[0081] Step S508: Calculate the first sum of the container processor information, container memory information and container computing power information of application container 3-1, application container 3-2 and application container 3-3 respectively, and use the ratio of the node processor information, node memory information and the second node computing power information of non-distributed node 3 as its container level.

[0082] Taking the container levels of application container 3-1, application container 3-2 and application container 3-3 as an example, the container level of application container 3-2 is greater than the container level of application container 3-3, which is greater than the container level of application container 3-1, the target application container to be migrated may be determined in the following manner, but is not limited to:

[0083] Step S510: determining the application container 3-2 as a reference application container;

[0084] Step S512: matching the resource demand of the reference application container with the remaining resources of the distributed node 1 and the distributed node 2 one by one;

[0085] Step S514: when the remaining resources of the distributed node 1 or the distributed node 2 are greater than the resource requirement of the reference application container, the application container 3-2 is determined as the target application container for migration;

[0086] Alternatively, when the remaining amount of resources of the distributed node 1 or the distributed node 2 is less than the required amount of resources of the reference application container, the application container 3-3 is determined as the reference application container for matching;

[0087] It should be noted that, when the remaining resources of distributed node 1 and distributed node 2 are both greater than the resource demand of the reference application container, application container 3-2 may be determined as the target application container and migrated to the distributed node with higher remaining resources, but is not limited to;

[0088] Taking the migration of application container 3-2 to distributed node 1 as an example, the following steps may also be included but are not limited to:

[0089] Step S516: Detect the current working state of the distributed node 3, and determine whether the current node computing power information of the distributed node 3 is still less than the computing power threshold;

[0090] When it is detected that the current working state of the distributed node 3 is used to indicate that the current node computing power information of the distributed node 3 is still greater than or equal to the computing power threshold, the application container of the target distributed node continues to be migrated;

[0091] Alternatively, when it is detected that the current working status is used to indicate that the current node computing power information of the target distributed node is less than the computing power threshold, the step of detecting the working status of each distributed node is performed.

[0092] Through the container scheduling method for distributed systems proposed in this application, when it is necessary to meet the demand for resources of different architectures or when existing resources are tight, this application migrates application containers between different architectures, calls functions when the eBPF collector detects changes in the CPU, memory, computing power, etc. of the node, injects the collection code into the called function, stores the collected information for application heterogeneous scheduling analysis, automatically adjusts the scheduling strategy according to the comprehensive weight calculation method, schedules the application container to a node with more abundant resources and stronger computing power, and provides more stable and efficient services.

[0093] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), including a number of instructions to enable a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0094] In this embodiment, a container scheduling device for a distributed system is also provided, which is applied to a controller deployed in a distributed system. The distributed system includes multiple distributed nodes, and one or more application containers are allowed to run on the distributed nodes. The application container is used to run the application using the application resources provided by the distributed nodes. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0095] Figure 6 is a structural block diagram of a container scheduling device of a distributed system according to an embodiment of the present application, such as Figure 6 As shown, the device comprises:

[0096] A first detection module 62, configured to detect a working state of each distributed node, wherein the working state is used to indicate a relationship between first node computing power information of the corresponding distributed node and a computing power threshold, and the first node computing power information is used to indicate a node computing power currently used by the corresponding distributed node;

[0097] A matching module 64 is used to match the resource demand of the application container with the resource surplus of other distributed nodes in the distributed system according to the container level of the reference application container running in the target distributed node from high to low, when it is detected that the working state of the target distributed node indicates that the target node computing power information of the target distributed node is greater than or equal to the computing power threshold, until a candidate distributed node whose resource surplus meets the resource demand of the target application container is obtained, wherein the container level of the application container is positively correlated with the proportion of the application resources used by the application container in the total application resources of the distributed node, and the other distributed nodes are distributed nodes other than the target distributed node among the multiple distributed nodes;

[0098] The first migration module 66 is configured to migrate the target application container to the candidate distributed node.

[0099] Through the above device, the working state of each distributed node is detected, wherein the working state is used to indicate the relationship between the first node computing power information of the corresponding distributed node and the computing power threshold, and the first node computing power information is used to indicate the node computing power currently used by the corresponding distributed node; when it is detected that the working state of the target distributed node is used to indicate that the target node computing power information of the target distributed node is greater than or equal to the computing power threshold, the resource demand of the application container is matched with the resource surplus of other distributed nodes in the distributed system according to the container level of the reference application container running in the target distributed node from high to low, until a candidate distributed node whose resource surplus meets the resource demand of the target application container is obtained, wherein the container level of the application container is positively correlated with the proportion of the application resources used by the application container in the total application resources of the distributed node, and the other distributed nodes are distributed nodes other than the target distributed node among the multiple distributed nodes; the target application container is migrated to the candidate distributed node. Since the controller is configured to determine the candidate distributed node whose resource surplus meets the resource demand of the target application container according to the container level of the reference application container, the resource demand of the application container and the resource surplus of other distributed nodes, the migration operation of the target application container is realized according to the resource distribution of the candidate distributed node. Therefore, the problem of low container scheduling efficiency in distributed systems can be solved, thereby achieving the effect of improving the container scheduling efficiency in distributed systems.

[0100] In an exemplary embodiment, the matching module includes:

[0101] A first detection unit, configured to detect a container level of each of the reference application containers according to container processor information, container memory information, and container computing power information of the reference application container, and node processor information, node memory information, and second node computing power information of the target distributed node;

[0102] A first traversal unit, configured to traverse the reference application containers from high to low according to the container levels of the reference application containers;

[0103] A matching unit, configured to match the resource demand of the reference application container currently traversed with the resource surplus of the other distributed nodes one by one;

[0104] A first determining unit is configured to, when a distributed node whose remaining resources satisfy the resource requirement of the reference application container currently traversed is matched, determine the reference application container currently traversed as the target application container, and determine the matched distributed node as the candidate distributed node;

[0105] The second traversal unit is configured to continue traversing the reference application container if no distributed node whose remaining resources satisfy the resource requirement of the currently traversed reference application container is matched.

[0106] In an exemplary embodiment, the first detection unit is further used to: obtain the container processor information, the container memory information and the container computing power information, as well as the node processor information, the node memory information and the second node computing power information, wherein the container processor information is used to indicate the amount of processor resources allowed to be used by the reference application container, the container memory information is used to indicate the amount of memory resources allowed to be used by the reference application container, the container computing power information is used to indicate the computing power allowed to be used by the reference application container, the node processor information is used to indicate the amount of processor resources allowed to be used by the target distributed node, the node memory information is used to indicate the amount of memory resources allowed to be used by the target distributed node, and the second node computing power information is used to indicate the computing power allowed to be used by the target distributed node; calculate a first sum of the container processor information, the container memory information and the container computing power information, and calculate a second sum of the node processor information, the node memory information and the second node computing power information; calculate the ratio of the first sum to the second sum to obtain the container level of the reference application container.

[0107] In an exemplary embodiment, the matching unit is further used to: traverse the other distributed nodes; detect the relationship between the resource remaining amount of the other distributed nodes currently traversed and a resource threshold, wherein the resource threshold is N times the resource demand amount of the reference application container currently traversed, and N is greater than 1; when it is detected that the resource remaining amount of the other distributed nodes currently traversed is greater than or equal to the resource threshold, determine a distributed node whose resource remaining amount meets the resource demand amount of the reference application container currently traversed; when it is detected that the resource remaining amount of the other distributed nodes currently traversed is less than the resource threshold, continue to traverse the other distributed nodes; when the traversal of the other distributed nodes is completed but no other distributed nodes whose resource remaining amount is greater than or equal to the resource threshold are detected, determine that no distributed node whose resource remaining amount meets the resource demand amount of the reference application container currently traversed is matched.

[0108] In an exemplary embodiment, the first detection module includes:

[0109] An extraction unit is used to access the extended Berkeley packet filter mapping of each distributed node, extract the node computing power information corresponding to the node computing power field in the extended Berkeley packet filter mapping, and obtain the first node computing power information, wherein an extended Berkeley packet filter is deployed on each distributed node, and the extended Berkeley packet filter is used to capture the information of the node resources of the distributed node from the corresponding distributed node and store it in the form of a key value to the extended Berkeley packet filter mapping, and the node resources include processor resources, memory resources and node computing power;

[0110] The second detection unit is used to detect the relationship between the computing power information of the first node and the computing power threshold to obtain the working state.

[0111] In an exemplary embodiment, the first migration module includes:

[0112] An acquisition unit, configured to acquire a target node architecture of the target distributed node and a candidate node architecture of the candidate distributed node;

[0113] a second determining unit, configured to determine an architecture relationship between the target distributed node and the candidate distributed node according to the target node architecture and the candidate node architecture, wherein the architecture relationship is used to indicate that the target distributed node and the candidate distributed node are isomorphic, or that the target distributed node and the candidate distributed node are heterogeneous;

[0114] A modification unit, configured to modify the container image address of the target application container to a candidate container image address that conforms to the candidate node architecture when the architecture relationship is used to indicate that the target distributed node is heterogeneous with the candidate distributed node, wherein the container image address of the application container is used to indicate a deployment method of the application container in the distributed node; and deploy the target application container to the candidate distributed node according to the candidate container image address;

[0115] A deployment unit is used to deploy the target application container to the candidate distributed node according to the container image address of the target application container when the architecture relationship is used to indicate that the target distributed node is heterogeneous with the candidate distributed node.

[0116] In an exemplary embodiment, after migrating the target application container to the candidate distributed node, the apparatus further includes:

[0117] A second detection module, used to detect the current working state of the target distributed node;

[0118] A second migration module is used to continue migrating the application container of the target distributed node when it is detected that the current working state is used to indicate that the current node computing power information of the target distributed node is still greater than or equal to the computing power threshold;

[0119] An execution module is used to execute the step of detecting the working status of each distributed node when it is detected that the current working status is used to indicate that the current node computing power information of the target distributed node is less than the computing power threshold.

[0120] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0121] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0122] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0123] An embodiment of the present application further provides an electronic device, Figure 7 is a structural block diagram of an electronic device according to an embodiment of the present application, such as Figure 7 As shown, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the method embodiments described above.

[0124] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0125] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0126] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0127] The embodiments of the present application also provide a computer program, which includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the above method embodiments.

[0128] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0129] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0130] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A container scheduling method for a distributed system, characterized in that: A controller deployed in a distributed system, the distributed system comprising a plurality of distributed nodes, one or more application containers are allowed to run on the distributed nodes, and the application container is used to run an application using application resources provided by the distributed nodes, the method comprising: Detecting a working state of each distributed node, wherein the working state is used to indicate a relationship between first node computing power information of the corresponding distributed node and a computing power threshold, and the first node computing power information is used to indicate a node computing power currently used by the corresponding distributed node; In the case where it is detected that the working state of the target distributed node is used to indicate that the target node computing power information of the target distributed node is greater than or equal to the computing power threshold, the resource demand of the application container is matched with the resource surplus of other distributed nodes in the distributed system from high to low according to the container level of the reference application container running in the target distributed node, until a candidate distributed node whose resource surplus meets the resource demand of the target application container is obtained, wherein the container level of the application container is positively correlated with the proportion of the application resources used by the application container in the total application resources of the distributed node, and the other distributed nodes are distributed nodes other than the target distributed node among the multiple distributed nodes; Migrate the target application container to the candidate distributed node.

2. The method according to claim 1, characterized in that The matching of the resource requirement of the application container with the resource surplus of other distributed nodes in the distributed system from high to low according to the container level of the reference application container running in the target distributed node until a candidate distributed node whose resource surplus meets the resource requirement of the target application container is obtained includes: Detecting the container level of each of the reference application containers according to the container processor information, container memory information and container computing power information of the reference application container, and the node processor information, node memory information and second node computing power information of the target distributed node; Traversing the reference application containers from high to low according to the container levels of the reference application containers; Matching the resource demand of the reference application container currently traversed with the remaining resources of the other distributed nodes one by one; In the case of matching a distributed node whose remaining resources satisfy the resource requirement of the currently traversed reference application container, determining the currently traversed reference application container as the target application container, and determining the matched distributed node as the candidate distributed node; If no distributed node whose remaining resources satisfy the resource requirement of the currently traversed reference application container is matched, the reference application container continues to be traversed.

3. The method according to claim 2, characterized in that The detecting the container level of each reference application container according to the container processor information, container memory information and container computing power information of the reference application container, and the node processor information, node memory information and second node computing power information of the target distributed node includes: Obtain the container processor information, the container memory information and the container computing power information, as well as the node processor information, the node memory information and the second node computing power information, wherein the container processor information is used to indicate the amount of processor resources allowed to be used by the reference application container, the container memory information is used to indicate the amount of memory resources allowed to be used by the reference application container, the container computing power information is used to indicate the computing power allowed to be used by the reference application container, the node processor information is used to indicate the amount of processor resources allowed to be used by the target distributed node, the node memory information is used to indicate the amount of memory resources allowed to be used by the target distributed node, and the second node computing power information is used to indicate the computing power allowed to be used by the target distributed node; Calculate a first sum of the container processor information, the container memory information, and the container computing power information, and calculate a second sum of the node processor information, the node memory information, and the second node computing power information; The container level of the reference application container is obtained by calculating the ratio of the first sum value to the second sum value.

4. The method according to claim 2, characterized in that: The matching of the resource demand of the currently traversed reference application container with the remaining resources of the other distributed nodes one by one includes: Traversing the other distributed nodes; Detecting a relationship between a resource remaining amount of the other distributed nodes currently traversed and a resource amount threshold, wherein the resource amount threshold is N times the resource demand amount of the reference application container currently traversed, and N is greater than 1; When it is detected that the remaining amount of resources of the other distributed nodes currently traversed is greater than or equal to the resource amount threshold, determining a distributed node matched with the remaining amount of resources satisfying the resource requirement of the reference application container currently traversed; When it is detected that the remaining amount of resources of the other distributed nodes currently traversed is less than the resource amount threshold, continue to traverse the other distributed nodes; When the traversal of the other distributed nodes is completed but no other distributed nodes whose remaining resources are greater than or equal to the resource threshold are detected, it is determined that no distributed node whose remaining resources meet the resource requirement of the currently traversed reference application container is matched.

5. The method according to claim 1, characterized in that The detecting the working status of each distributed node includes: Accessing the extended Berkeley packet filter mapping of each distributed node, extracting the node computing power information corresponding to the node computing power field in the extended Berkeley packet filter mapping, and obtaining the first node computing power information, wherein an extended Berkeley packet filter is deployed on each distributed node, and the extended Berkeley packet filter is used to capture the information of the node resources of the distributed node from the corresponding distributed node and store it in the form of a key value to the extended Berkeley packet filter mapping, wherein the node resources include processor resources, memory resources and node computing power; The working status is obtained by detecting the relationship between the computing power information of the first node and the computing power threshold.

6. The method according to claim 1, characterized in that The migrating the target application container to the candidate distributed node includes: Acquire a target node architecture of the target distributed node and a candidate node architecture of the candidate distributed node; Determining an architecture relationship between the target distributed node and the candidate distributed node according to the target node architecture and the candidate node architecture, wherein the architecture relationship is used to indicate that the target distributed node and the candidate distributed node are isomorphic, or that the target distributed node and the candidate distributed node are heterogeneous; In the case where the architecture relationship is used to indicate that the target distributed node and the candidate distributed node are heterogeneous, modifying the container image address of the target application container to a candidate container image address that conforms to the candidate node architecture, wherein the container image address of the application container is used to indicate the deployment method of the application container in the distributed node; deploying the target application container to the candidate distributed node according to the candidate container image address; In a case where the architectural relationship is used to indicate that the target distributed node and the candidate distributed node are heterogeneous, the target application container is deployed to the candidate distributed node according to the container image address of the target application container.

7. The method according to claim 1, characterized in that After migrating the target application container to the candidate distributed node, the method further includes: Detecting the current working status of the target distributed node; When it is detected that the current working state is used to indicate that the current node computing power information of the target distributed node is still greater than or equal to the computing power threshold, continue to migrate the application container of the target distributed node; In the case where it is detected that the current working state is used to indicate that the current node computing power information of the target distributed node is less than the computing power threshold, a step of detecting the working state of each distributed node is performed.

8. A container scheduling device for a distributed system, characterized in that: A controller deployed in a distributed system, wherein the distributed system includes a plurality of distributed nodes, wherein one or more application containers are allowed to run on the distributed nodes, and the application container is used to run applications using application resources provided by the distributed nodes, wherein the device includes: A first detection module, used to detect the working state of each distributed node, wherein the working state is used to indicate the relationship between the first node computing power information of the corresponding distributed node and the computing power threshold, and the first node computing power information is used to indicate the node computing power currently used by the corresponding distributed node; A matching module, configured to match the resource demand of the application container with the remaining resources of other distributed nodes in the distributed system from high to low according to the container level of the reference application container running in the target distributed node, when it is detected that the working state of the target distributed node indicates that the target node computing power information of the target distributed node is greater than or equal to the computing power threshold, until a candidate distributed node whose remaining resources meet the resource demand of the target application container is obtained, wherein the container level of the application container is positively correlated with the proportion of application resources used by the application container in the total application resources of the distributed node, and the other distributed nodes are distributed nodes other than the target distributed node among the multiple distributed nodes; The first migration module is used to migrate the target application container to the candidate distributed node.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Distributed service method based on service platform and platform

    CN119739540A

  • A service platform-based distributed service method and platform

    CN119739540B

  • CPU (Central Processing Unit) resource allocation method for DPU (Distributed Processing Unit) centralized service grid

    CN120295789A