Container scheduling method and device, electronic equipment and program product

By calculating the target score of the device node, selecting the most suitable device node to run the container, solving the problem of low resource utilization of the device node and improving resource utilization efficiency and cluster stability.

CN119829196APending Publication Date: 2025-04-15INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411754385.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

Among many types of device nodes, the resource utilization rate of the device node is low because container operation needs to consider the specific resource and application load characteristics of the device node.

Method used

By collecting node information of each device node, including tag information, remaining resource information and load status, calculating evaluation indicators and indicator weights, determining the target score of each device node, thereby selecting the most suitable device node to run the container to be scheduled.

Benefits of technology

It improves resource utilization efficiency and application operation performance, enhances the stability and operation and maintenance of the cluster, and significantly improves the management efficiency of the cluster and the quality of application services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829196A_ABST
    Figure CN119829196A_ABST
Patent Text Reader

Abstract

The invention discloses a container scheduling method and device, electronic equipment and a program product, and relates to the field of distribution.The method comprises the steps that first node information of each equipment node is collected; under the condition that the container to be scheduled is detected, calculating the first node information of each equipment node according to the evaluation index and the index weight to obtain a target score of each equipment node; and according to the target score of each equipment node, determining a target equipment node in the at least one equipment node, and running the to-be-scheduled container through the target equipment node. Through application of the method and the device, the problem that the resource utilization rate of the equipment nodes is relatively low due to the fact that specific resources and application load characteristics of the equipment nodes need to be considered in container operation in various types of equipment nodes in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of distributed systems, and more specifically, to a container scheduling method, device, electronic device, and program product. Background Art

[0002] At present, with the continuous advancement of container technology, container platforms are being used more and more widely in various scenarios, such as Kubernetes in the cloud-native field. While building and running distributed applications, such platforms also face challenges such as large scale, cloud, and heterogeneity. Especially in the case of large-scale and heterogeneous clusters, resource allocation decisions are particularly complex.

[0003] In large-scale, heterogeneous clusters, automatically selecting the best node for containers is the key to achieving efficient resource utilization. However, current container technology platforms lack intelligent scheduling capabilities, and resource allocation often relies on fixed strategies that cannot be dynamically adjusted based on cluster usage and container requests, resulting in idle resources or contention issues.

[0004] Due to the widespread use of container technology, cluster nodes have become diversified and complex, with many types of nodes, such as computing nodes, storage nodes, GPU nodes, FPGA nodes, etc. This makes the differences in node characteristics (such as CPU, memory, storage, bandwidth, etc.) an important factor to consider in scheduling strategies. In addition, current container scheduling systems often lack self-optimization capabilities, with fixed scheduling parameters that cannot be dynamically adjusted according to cluster usage and container requests, resulting in inefficient resource allocation.

[0005] In the related art, among various types of device nodes, since container operation needs to consider the specific resources and application load characteristics of the device nodes, resulting in low resource utilization of device nodes, no effective solution has been proposed yet. Summary of the invention

[0006] The main purpose of the present application is to provide a container scheduling method, apparatus, electronic device and program product to solve the problem in the related art that in various types of device nodes, the resource utilization of device nodes is low because the container operation needs to consider the specific resources and application load characteristics of the device nodes.

[0007] To achieve the above-mentioned purpose, according to one aspect of the present application, a container scheduling method is provided, the method is applied to a target cluster, the target cluster includes at least one device node, each device node in the at least one device node is used to run a container, the method includes: collecting first node information of each device node, wherein the first node information includes at least: label information of the device node; when a container to be scheduled is detected, the first node information of each device node is calculated according to an evaluation index and an index weight to obtain a target score of each device node, wherein the evaluation index includes at least one of the following: a first index, a second index, a third index, and a fourth index; the first index characterizes the degree of match between the resource request type of the container and the available resource type of the device node; the second index characterizes the degree of match between the label information of the container and the device node; the third index characterizes the load state of the device node; the fourth index characterizes the priority of the device node; according to the target score of each device node, a target device node is determined in the at least one device node, and the container to be scheduled is run through the target device node.

[0008] Furthermore, the evaluation index includes: a first index, and the index weight includes: a first weight. The first node information of each device node is calculated based on the evaluation index and the index weight to obtain the target score of each device node, including: for each device node, the remaining resource information of the device node is determined based on the node information of the device node to obtain the remaining resource information of each device node; the resource request information of the container to be scheduled is determined, wherein the resource request information includes at least: resource type, resource request amount; the first index is calculated based on the remaining resource information of each device node and the resource request information of the container to be scheduled, and the target score of each device node is calculated based on the first index and the first weight.

[0009] Furthermore, the evaluation index at least includes: a second index, and the index weight at least includes: a second weight. The first node information of each device node is calculated according to the evaluation index and the index weight to obtain a target score for each device node, including: determining the label information of the container to be scheduled; for each device node, matching the label information of the container to be scheduled with the label information of the device node to obtain a matching result; wherein the matching result is used to indicate whether the label information of the device node contains the label information of the container to be scheduled; determining the second index according to the matching result, and calculating the target score of each device node according to the second index, the second weight, the first index and the first weight.

[0010] Furthermore, the evaluation index at least includes: a third index and a fourth index, and the index weight at least includes: a third weight and a fourth weight. The first node information of each device node is calculated based on the evaluation index and the index weight to obtain the target score of each device node, including: determining the load information of each device node based on the node information of each device node, determining the total resource information of each device node, and determining the priority information of each device node; calculating the third index based on the load information of each device node and the total resource information of each device node; calculating the fourth index based on the priority information of each device node; calculating the target score of each device node based on the first index, the first weight, the second index, the second weight, the third index, the third weight, the fourth index and the fourth weight.

[0011] Furthermore, according to the target score of each device node, a target device node is determined in the at least one device node, including: determining a first device node corresponding to the highest target score according to the target score of each device node; determining the first device node as the target device node when available resource information of the first device node meets the resource request information of the container to be scheduled and the label information of the first device node does not contain an abnormal label, wherein the abnormal label represents a label of a device node on which the container to be scheduled cannot run; and allocating the container to be scheduled to run on the target device node.

[0012] Furthermore, before allocating the container to be scheduled to the target device node for operation, the method also includes: collecting the second node information of each device node at every preset time interval; adjusting the indicator weight according to the difference information between the second node information of each device node and the first node information of each device node to obtain the adjusted indicator weight; calculating the second node information of each device node according to the evaluation indicator and the adjusted indicator weight to obtain the updated target score of each device node; and determining the target device node in the at least one device node according to the updated target score of each device node.

[0013] Furthermore, after obtaining the updated target score of each device node, the method also includes: collecting the current third indicator of each device node; for each device node, determining each container currently running in the device node, and determining the resource requirement information of each container; when the current third indicator of the device node is greater than a preset value and the resource requirement information of each container in the device node is met, determining the target weight value, wherein the target weight value is the indicator weight used in the process of calculating the target score of the device node; storing the target weight value and the node information of the device node in a preset database.

[0014] To achieve the above-mentioned purpose, according to another aspect of the present application, a container scheduling device is provided, the device is deployed in a target cluster, the target cluster includes at least one device node, each of the at least one device node is used to run a container, the device includes: a collection unit, used to collect first node information of each device node, wherein the first node information at least includes: label information of the device node; a calculation unit, used to calculate the first node information of each device node according to an evaluation index and an index weight when a container to be scheduled is detected, to obtain a target score of each device node, wherein the evaluation index includes at least one of the following: a first index, a second index, a third index, and a fourth index; the first index represents the degree of match between the resource request type of the container and the available resource type of the device node; the second index represents the degree of match between the label information of the container and the device node; the third index represents the load state of the device node; the fourth index represents the priority of the device node; an operation unit, used to determine a target device node in the at least one device node according to the target score of each device node, and run the container to be scheduled through the target device node.

[0015] Furthermore, the evaluation index includes: a first index, the index weight includes: a first weight, and the calculation unit includes: a first determination subunit, which is used to determine the remaining resource information of the device node for each device node based on the node information of the device node, and obtain the remaining resource information of each device node; a second determination subunit, which is used to determine the resource request information of the container to be scheduled, wherein the resource request information includes at least: resource type, resource request amount; a first calculation subunit, which is used to calculate the first index based on the remaining resource information of each device node and the resource request information of the container to be scheduled, and calculate the target score of each device node based on the first index and the first weight.

[0016] Furthermore, the evaluation index includes at least: a second index, the index weight includes at least: a second weight, and the calculation unit includes: a third determination subunit, used to determine the label information of the container to be scheduled; a matching subunit, used to match the label information of the container to be scheduled with the label information of the device node for each device node to obtain a matching result; wherein the matching result is used to indicate whether the label information of the device node contains the label information of the container to be scheduled; a second calculation subunit, used to determine the second index based on the matching result, and calculate the target score of each device node based on the second index, the second weight, the first index and the first weight.

[0017] Furthermore, the evaluation index includes at least: a third index and a fourth index, the index weight includes at least: a third weight and a fourth weight, and the calculation unit includes: a fourth determination subunit, used to determine the load information of each device node based on the node information of each device node, determine the total resource information of each device node, and determine the priority information of each device node; a third calculation subunit, used to calculate the third index based on the load information of each device node and the total resource information of each device node; a fourth calculation subunit, used to calculate the fourth index based on the priority information of each device node; a fifth calculation subunit, used to calculate the target score of each device node based on the first index, the first weight, the second index, the second weight, the third index, the third weight, the fourth index and the fourth weight.

[0018] Furthermore, the running unit includes: a fifth determination subunit, used to determine the first device node corresponding to the highest target score based on the target score of each device node; a sixth determination subunit, used to determine the first device node as the target device node when the available resource information of the first device node meets the resource request information of the container to be scheduled and the label information of the first device node does not contain an abnormal label, wherein the abnormal label represents the label of the device node on which the container to be scheduled cannot run; and a running subunit, used to allocate the container to be scheduled to the target device node for operation.

[0019] Furthermore, the operation unit also includes: a first collection subunit, used to collect the second node information of each device node at every preset time interval before allocating the to-be-scheduled container to the target device node for operation; an adjustment subunit, used to adjust the indicator weight according to the difference information between the second node information of each device node and the first node information of each device node, and obtain the adjusted indicator weight; a sixth calculation subunit, used to calculate the second node information of each device node according to the evaluation indicator and the adjusted indicator weight, and obtain the updated target score of each device node; a seventh determination subunit, used to determine the target device node in the at least one device node according to the updated target score of each device node.

[0020] Furthermore, the operation unit also includes: a second collection subunit, which is used to collect the current third indicator of each device node after obtaining the updated target score of each device node; an eighth determination subunit, which is used to determine, for each device node, each container currently running in the device node, and determine the resource requirement information of each container; a ninth determination subunit, which is used to determine the target weight value when the current third indicator of the device node is greater than a preset value and the resource requirement information of each container in the device node is met, wherein the target weight value is the indicator weight used in the process of calculating the target score of the device node; and a storage subunit, which is used to store the target weight value and the node information of the device node in a preset database.

[0021] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a computer program product is provided, including a computer program, which, when executed by a processor, implements any one of the above-mentioned container scheduling methods, and when executed by a processor, implements the steps of the container scheduling method described in each embodiment of the present application.

[0022] In order to achieve the above objective, according to one aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes stored computer instructions, wherein when the computer instructions are executed by a processor, any one of the above container scheduling methods is implemented.

[0023] In order to achieve the above-mentioned purpose, according to one aspect of the present application, an electronic device is provided, including one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement any one of the above-mentioned container scheduling methods.

[0024] In an embodiment of the present application, by collecting the first node information of each device node, wherein the first node information includes at least: the label information of the device node; when the container to be scheduled is detected, the first node information of each device node is calculated according to the evaluation index and the index weight to obtain the target score of each device node, wherein the evaluation index includes at least one of the following: a first index, a second index, a third index, and a fourth index; the first index characterizes the degree of match between the resource request type of the container and the available resource type of the device node; the second index characterizes the degree of match between the label information of the container and the device node; the third index characterizes the load state of the device node; the fourth index characterizes the priority of the device node; according to the target score of each device node, a target device node is determined in the at least one device node, and the container to be scheduled is run through the target device node, thereby solving the technical problem that the resource utilization of the device node is low in multiple types of device nodes because the container operation needs to consider the specific resources and application load characteristics of the device node.

[0025] By calculating the first indicator, the resource request type of the container can be accurately matched with the available resource type of the device node, avoiding resource waste and limited container performance. By calculating the second indicator, it is ensured that the container runs on the correct node, meeting the application deployment strategy and cluster isolation requirements, thereby enhancing the stability and security of the application. By calculating the third indicator, by avoiding scheduling the container to a node with an overload, it is possible to prevent node overload and maintain the health of the cluster, while also ensuring the stable operation of the container. By calculating the fourth indicator, it is possible to ensure that high-priority nodes are considered first. Therefore, this application not only improves the resource utilization efficiency and the operating performance of the application, but also enhances the stability of the cluster and the convenience of operation and maintenance, achieving the effect of significantly improving the management efficiency of the cluster and the quality of application services. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0027] Figure 1 It is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a container scheduling method provided in accordance with Embodiment 1 of the present application;

[0028] Figure 2 is a flowchart of an optional container scheduling method provided according to Embodiment 1 of the present application;

[0029] Figure 3is a schematic diagram of an optional container scheduling method provided according to Embodiment 1 of the present application;

[0030] Figure 4 is a schematic diagram of a container scheduling device provided according to Embodiment 2 of the present application;

[0031] Figure 5 It is a schematic diagram of a container scheduling electronic device provided according to Embodiment 5 of the present application. DETAILED DESCRIPTION

[0032] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0033] It should be noted that the methods and devices determined by the processing methods, devices, storage media and electronic devices of the present application documents can be used in the financial technology field to deploy containers in various types of device nodes, thereby improving the resource utilization of device nodes. They can also be used in any field other than the financial technology field. The application fields of the methods and devices determined by the processing methods, devices, storage media and electronic devices of the present application documents are not limited.

[0034] It should be noted that the collected information (including but not limited to user device information, user personal information, collected data, used data, generated data, processed data, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, collected information, used information, generated information, processed information, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with the relevant laws, regulations and standards of relevant countries and regions, necessary confidentiality measures are taken, and public order and good customs are not violated, and corresponding operation entrances are provided for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or institutions to provide users with corresponding operation entrances for users to choose to agree or refuse the results of automated decision-making; if the user chooses to refuse, the expert decision-making process will be entered.

[0035] Example 1

[0036] According to an embodiment of the present application, a method embodiment of container scheduling is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0037] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing a container scheduling method. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more (102a, 102 container scheduling, ..., 102n are used to illustrate in the figure) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (US container scheduling) port (which may be included as one of the ports of the container scheduling US bus), a network interface, a power supply and / or a camera. 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 electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0038] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0039] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the container scheduling method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned container scheduling method is realized. 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 remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 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.

[0040] 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 computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, 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.

[0041] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0042] Under the above operating environment, this application provides Figure 2 The container scheduling method shown. Figure 2 It is a flowchart of a container scheduling method according to Example 1 of the present application. The method is applied to a target cluster, and the target cluster includes at least one device node, and each device node in the at least one device node is used to run a container.

[0043] The execution subject of the container scheduling method of Example 1 of the present application is the scheduling system running in the above-mentioned target cluster (for example, Kubernetes cluster). Specifically, the scheduling system is responsible for continuously monitoring and identifying the hardware characteristics, resource status and label information of various device nodes in the cluster, and storing this information in the cluster cache, based on the resource status of the device node, application requirements and defined affinity and anti-affinity rules, calculating the target score of each node, according to the target score calculated by the intelligent scheduling algorithm, determining the device node that is most suitable for running the container to be scheduled, and implementing the scheduling decision through the Kubernetes scheduler. At the same time, the scheduling system is also responsible for policy management and adaptive learning, dynamically adjusting the scheduling strategy and weight coefficient to optimize the scheduling effect. In addition, the scheduling system can also collect historical scheduling data, analyze the running performance of the container on different device nodes, use machine learning algorithms to automatically adjust the weight coefficient to optimize the accuracy of future scheduling decisions, and monitor the running status of the container on the selected device node in real time, collect running data, compare actual performance with expected goals, and continuously optimize the scheduling strategy.

[0044] Step S201 : collecting first node information of each device node, wherein the first node information at least includes: label information of the device node.

[0045] In the first embodiment, the tag information of the device node is the key data used to identify and classify the device node in the cluster. The tag information includes, but is not limited to: hardware information (e.g., CPU architecture, GPU model), operating system version, geographic location information, resource capacity information, etc. The tag information is defined in the metadata of the device node. For example, the tag information has the functions of expressing the specific capabilities of the node (e.g., supporting GPU computing), displaying the location (e.g., the location of the data center), or displaying the status (e.g., maintenance status).

[0046] When a device node joins a cluster, it automatically registers its label information with the cluster's API server. This is usually done through the cluster's node self-discovery mechanism when the node starts, or manually set by the administrator. The scheduling system continuously monitors the status of each node in the cluster, including its label information. For example, this is achieved by listening to node events on the Kubernetes API server, or by periodically querying the node status.

[0047] The scheduling system stores the collected node information (e.g., label information) in the cluster's cache for real-time access. The cache update mechanism should ensure the real-time and accuracy of the information to reflect the latest status of the device node.

[0048] By collecting the first node information, more accurate decisions can be made based on the characteristics of the device nodes, thereby improving resource utilization efficiency, optimizing application performance, and enhancing cluster stability.

[0049] Step S202, when a container to be scheduled is detected, the first node information of each device node is calculated according to the evaluation index and the index weight to obtain the target score of each device node, wherein the evaluation index includes at least one of the following: a first index, a second index, a third index, and a fourth index; the first index represents the degree of match between the resource request type of the container and the available resource type of the device node; the second index represents the degree of match between the label information of the container and the device node; the third index represents the load status of the device node; and the fourth index represents the priority of the device node.

[0050] In the first embodiment, in order to find the most suitable device node for each container to be scheduled, it is necessary to calculate the target score of each device node, wherein the target score comprehensively considers multiple evaluation indicators and their weights.

[0051] The first indicator can also be called resource matching, which reflects the matching degree between the resource request type (such as CPU, memory, GPU, etc.) of the container to be scheduled and the available resource type of the device node. The higher the resource matching degree, the more effectively the container to be scheduled can use resources when running on the node, thereby improving resource utilization and container operation efficiency.

[0052] The second metric, also known as affinity / anti-affinity matching, evaluates the matching degree of label information between containers and device nodes. In a cluster, both device nodes and containers can be labeled to express specific attributes or requirements. Affinity rules require containers to run on device nodes with specific labels, while anti-affinity rules are used to ensure that containers are not concentrated on the same type of device nodes. By calculating the matching degree between node labels and container affinity requirements, the distribution uniformity of containers and the reliability of applications can be improved.

[0053] The third indicator can also be called a load balancing factor, which is used to measure the current load status of the device node, in order to avoid scheduling the container to an overloaded node.

[0054] The fourth metric can also be called node priority. Each device node may have different priorities based on its hardware capabilities, location, or maintenance status. When calculating the target score, nodes with higher node priorities will have a greater chance of being selected as running nodes for the containers to be scheduled.

[0055] Through the above process, when a container to be scheduled is detected, the node information of each device node is comprehensively calculated based on the evaluation indicators (i.e., the first indicator, the second indicator, the third indicator and the fourth indicator mentioned above) and the indicator weight to obtain the target score of each node, and finally the target device node is selected from at least one device node in the cluster as the running node of the container to be scheduled.

[0056] Step S203: determining a target device node from at least one device node according to the target score of each device node, and running the container to be scheduled through the target device node.

[0057] In the first embodiment of the present invention, in order to more accurately select the most suitable node to run the container to be scheduled in the scenario of multiple types of device nodes, thereby improving resource utilization and application performance, it is necessary to determine the target device node in at least one device node based on the calculated target score of each device node. Exemplarily, the node with the highest target score will be determined in at least one device node and determined as the above-mentioned target device node. If there are multiple nodes with the same or similar highest target scores, a further decision-making mechanism can be used to select, for example, random selection or a polling-based strategy to ensure load balancing of the cluster.

[0058] After determining the target device node, the scheduling system sends an instruction to the cluster's scheduler to assign the container to be scheduled to run on the target device node. The scheduler will follow this instruction and combine the cluster's container deployment rules to ensure that the container can be successfully started and run on the target device node.

[0059] Through the above process, it is possible to achieve intelligent and efficient scheduling of containers in multi-type device node scenarios, improve the resource utilization efficiency and application performance of the cluster, and maintain the stability and scalability of the cluster.

[0060] Optionally, in the container scheduling method provided in Example 1 of the present application, the evaluation index includes: a first index, the index weight includes: a first weight, and the first node information of each device node is calculated based on the evaluation index and the index weight to obtain the target score of each device node, including: for each device node, determining the remaining resource information of the device node based on the node information of the device node to obtain the remaining resource information of each device node; determining the resource request information of the container to be scheduled, wherein the resource request information includes at least: resource type, resource request amount; calculating the first index based on the remaining resource information of each device node and the resource request information of the container to be scheduled, and calculating the target score of each device node based on the first index and the first weight.

[0061] In the first embodiment of the present invention, the scheduling system collects the first node information of each device node, which includes the node's label information, hardware specifications, current resource consumption and other status information. Based on this information, the remaining resource information of each node is calculated. The remaining resource information reflects the amount of unoccupied CPU, memory, disk space, network bandwidth and other resources on the device node, which directly determines whether the device node can meet the resource requirements of the container to be scheduled.

[0062] Then, the resource request information of the container to be scheduled is obtained, including at least the resource type (such as CPU, memory) and the resource request amount. The resource amount requested by the container to be scheduled may include the expected minimum resource requirement when the container is running, which is used to guide the scheduler to select a suitable node for container deployment, and may also include the expected maximum resource requirement when the container is running.

[0063] Secondly, the first indicator (i.e., resource matching degree) is calculated to measure the matching degree between the resource request of the container to be scheduled and the remaining resources of the device node. The calculation formula of resource matching degree can be as follows: resource matching degree = remaining resources of device node / container resource request amount. The larger the value of the first indicator, the better the resource demand of the container to be scheduled on the node can be met, thereby improving the efficiency and possibility of container operation.

[0064] Finally, the target score of each device node is calculated based on the resource matching degree (first indicator) and its corresponding weight (first weight). The calculation formula of the target score can be as follows: target score = first indicator * first weight, where the first weight represents the importance of the first indicator in the overall scheduling decision. By adjusting the value of the first weight, the influence of resource matching degree on the scheduling decision can be controlled, thereby achieving a balance between efficient resource utilization and other scheduling goals (such as affinity, load balancing, priority). The first weight here can be a preset value assigned to the target object, or it can be a default preset value.

[0065] By calculating the resource matching degree (first indicator) and the first weight, it is possible to more intelligently and efficiently select the most suitable device node to run the container to be scheduled in various types of device node scenarios, thereby improving resource utilization and application performance while maintaining the stability and flexibility of the cluster.

[0066] Optionally, in the container scheduling method provided in the first embodiment of the present application, the evaluation index includes at least: a second index, the index weight includes at least: a second weight, and the first node information of each device node is calculated based on the evaluation index and the index weight to obtain a target score for each device node, including: determining the label information of the container to be scheduled; for each device node, matching the label information of the container to be scheduled with the label information of the device node to obtain a matching result; wherein the matching result is used to indicate whether the label information of the device node contains the label information of the container to be scheduled; determining the second index based on the matching result, and calculating the target score of each device node based on the second index, the second weight, the first index and the first weight.

[0067] In the first embodiment, in a cluster, containers may have affinity (Affinity, which specifies that a container should run on a node with a specific label) and anti-affinity (Anti-Affinity, which avoids running on a node with a specific label) rules. In order to meet the affinity and anti-affinity requirements of the container to be scheduled, it is necessary to determine the label information of the container to be scheduled.

[0068] The scheduling system will match the label information of the container to be scheduled with the label information of each device node to check whether the label information of the device node meets the affinity or anti-affinity rules of the container to be scheduled. Specifically, the matching results can be as follows: (1) match, that is, the label information of the device node fully meets the affinity requirements of the container to be scheduled and does not violate any anti-affinity requirements; (2) mismatch, that is, the label information of the device node is inconsistent with the affinity or anti-affinity rules of the container to be scheduled.

[0069] Based on the above matching results, a second index is determined to indicate the label matching degree between the container to be scheduled and the device node. If the label information of the device node matches the label information of the container to be scheduled, the value of the second index is high, otherwise it is low. In an optional embodiment, the second index can be set to a binary index, for example, 1 indicates a match and 0 indicates a mismatch.

[0070] Finally, the first indicator (resource matching degree) and the second indicator (label matching degree between container and device node), as well as their corresponding weights (first weight and second weight) are used to calculate the target score. The calculation formula can be as follows: target score = first indicator * first weight + second indicator * second weight. Among them, the second weight represents the importance of label matching degree in the calculation of the final target score. By adjusting the first weight and the second weight, the importance between resource utilization and container and node affinity can be balanced, so as to select the most suitable node among multiple device nodes to run the container to be scheduled.

[0071] For example, if the container to be scheduled is required to run on a node with a specific hardware configuration (such as a node with a GPU) and has a high resource requirement, GPU nodes are given priority, and while the resource matching degree is high, it is ensured that the node label matches the affinity requirement of the container.

[0072] Ultimately, by combining the first and second indicators and their weights, the best operating location can be found for the container to be scheduled, improving resource utilization and the level of scheduling intelligence, while meeting the specific operating requirements of the container and optimizing application performance.

[0073] Optionally, in the container scheduling method provided in Example 1 of the present application, the evaluation index includes at least: a third index and a fourth index, and the index weight includes at least: a third weight and a fourth weight. The first node information of each device node is calculated based on the evaluation index and the index weight to obtain the target score of each device node, including: determining the load information of each device node based on the node information of each device node, determining the total resource information of each device node, and determining the priority information of each device node; calculating the third index based on the load information of each device node and the total resource information of each device node; calculating the fourth index based on the priority information of each device node; calculating the target score of each device node based on the first index, the first weight, the second index, the second weight, the third index, the third weight, the fourth index and the fourth weight.

[0074] In the first embodiment of the present invention, the scheduling system continuously monitors the load status of each device node, including CPU usage, memory usage, disk I / O, network traffic, etc. The load information reflects the current resource consumption of the device node, which helps to evaluate whether the node is close to its resource limit and whether it is suitable for carrying more containers. At the same time, the scheduling system needs to know the total amount of resources of each device node, including the number of CPU cores, memory capacity, disk space, network bandwidth, etc. The priority information of the device node may be set based on a variety of factors, such as the hardware performance of the node, network location, maintenance status, etc. The priority information of the device node can also be determined by the staff.

[0075] Then, the third indicator is calculated based on the load information of each device node and the total resource information of each device node. The third indicator represents the load balancing factor of the device node, and its purpose is to evaluate whether the load status of the node is suitable for running more containers. The calculation formula of the load balancing factor can be as follows: load balancing factor = 1-(node ​​load information / total node resources). The closer the third indicator is to 1, the lighter the node load is, and the more suitable it is as a running node for the container to be scheduled.

[0076] Secondly, the fourth index is calculated based on the priority information of each device node. Nodes with higher priorities will be assigned higher fourth index values.

[0077] Finally, the target score is calculated based on the first indicator, the second indicator, the third indicator, and the fourth indicator. The target score is the result of the calculation of the first indicator (resource matching), the second indicator (label matching of container and device node), the third indicator (load balancing factor), and the fourth indicator (node ​​priority). The calculation formula of the target score can be shown as follows: first indicator * first weight + second indicator * second weight + third indicator * third weight + fourth indicator * fourth weight.

[0078] Through the above calculations, a target score for each device node can be generated for each container to be scheduled, and finally the device node with the highest target score is selected to deploy the container, so as to achieve optimal resource allocation, balanced load distribution, improved application performance and enhanced cluster stability, while meeting the specific operating requirements of the container, such as resource type, affinity rules and priority requirements.

[0079] Optionally, in the container scheduling method provided in the first embodiment of the present application, a target device node is determined in at least one device node based on the target score of each device node, including: determining a first device node corresponding to the highest target score based on the target score of each device node; determining the first device node as the target device node when the available resource information of the first device node meets the resource request information of the container to be scheduled and the label information of the first device node does not contain an abnormal label, wherein the abnormal label represents a label of a device node on which the container to be scheduled cannot run; and allocating the container to be scheduled to the target device node for running.

[0080] In the first embodiment, after calculating the target scores of all device nodes, the scheduling system will screen out the device node with the highest target score, which is called the first device node.

[0081] Then, after determining the first device node, check the available resource information of the node to ensure that it can meet the resource request of the container to be scheduled. This includes CPU, memory, storage space, etc., to ensure that there are sufficient resources when the container is running, and will not cause node overload or insufficient resources, thereby ensuring the stable operation of the container and the health of the cluster. In addition to resource checks, it is also necessary to ensure that there are no abnormal labels in the label information of the first device node. In the cluster, labels are used to mark nodes and containers, and affinity and anti-affinity rules are based on label information to control the scheduling of containers. Abnormal labels indicate that the node is not suitable for running labels of specific types of containers. Ensure that the label information of the first device node is consistent with the requirements of the container to be scheduled to avoid violating any affinity or anti-affinity rules.

[0082] Finally, when the available resources of the first device node meet the resource request of the container, and the label information of the node is consistent with the affinity requirements of the container, and there are no abnormal labels, the container to be scheduled will be officially assigned to the first device node for operation. Based on this decision, the cluster scheduler will execute the deployment and startup operations of the container to ensure that the container can be started in the best operating environment, thereby improving the performance and stability of the application.

[0083] Through this series of checks and decisions, not only the resource matching degree is taken into consideration, but also the matching of node labels with container requirements, as well as the load status and priority of the nodes, ensuring that the container can be scheduled to the device node that best suits its operating environment, thereby improving the cluster's resource utilization and application performance while maintaining the cluster's stability and flexibility.

[0084] Optionally, in the container scheduling method provided in the first embodiment of the present application, before allocating the container to be scheduled to the target device node for running, the method further includes: collecting the second node information of each device node at every preset time interval; adjusting the indicator weight according to the difference information between the second node information of each device node and the first node information of each device node to obtain the adjusted indicator weight; calculating the second node information of each device node according to the evaluation indicator and the adjusted indicator weight to obtain the updated target score of each device node; and determining the target device node from at least one device node according to the updated target score of each device node.

[0085] In the first embodiment, the scheduling system will periodically (for example, 1 minute, 5 minutes, etc., which is not specifically limited in the first embodiment) collect the dynamic status information of the device nodes, including the current resource utilization rate, load status, running application status, etc. The currently collected information is called the second node information. Different from the first node information, the second node information represents the node information collected after the first node information, so that the indicator weight is updated according to the second node information.

[0086] Then, the second node information is compared with the first node information to find the difference between the two. For example, if the resource utilization of a node suddenly increases, this may indicate that the weight of resource matching (the first indicator) needs to be adjusted accordingly to avoid scheduling more containers to this node. Based on the difference information, the weight can be adjusted in real time to ensure that each scheduling decision is based on the latest node status and the most optimized indicator weight.

[0087] After adjusting the indicator weights, it is necessary to recalculate the target score of each device node based on the evaluation indicators (i.e., the first indicator, the second indicator, the third indicator, and the fourth indicator, etc.) and the new indicator weights, and re-evaluate the second node information of each device node to reflect the impact of the adjusted weights on the scheduling decision.

[0088] Finally, based on the updated target score, the node with the highest target score is selected as the target device node in the cluster for deploying the container to be scheduled. This decision will fully consider the latest node status and optimized scheduling strategy to achieve optimal resource allocation and maximize application performance.

[0089] Through this series of dynamic monitoring and adaptive adjustment steps, the scheduling system can optimize the scheduling strategy in real time according to the changes in node status, ensuring the continuous optimization and intelligence of container scheduling decisions, thereby improving the resource utilization efficiency, application operation performance and overall stability of the Kubernetes cluster. This feedback mechanism enables scheduling decisions to better adapt to the changing workload and resource status.

[0090] Optionally, in the container scheduling method provided in the first embodiment of the present application, after obtaining the updated target score of each device node, the method further includes: collecting the current third indicator of each device node; for each device node, determining each container currently running in the device node, and determining the resource requirement information of each container; when the current third indicator of the device node is greater than a preset value and the resource requirement information of each container in the device node is met, determining the target weight value, wherein the target weight value is the indicator weight used in the process of calculating the target score of the device node; and storing the target weight value and the node information of the device node in a preset database.

[0091] In the first embodiment of the present invention, the scheduling system will regularly collect the load information of each device node and calculate the load balancing factor. This is an indicator that reflects the current resource utilization and remaining capacity of the node, and is used to evaluate whether the node is at a healthy and acceptable load level. At the same time, it is necessary to know the containers running on each device node and the resource requirements of each of these containers. This includes requests and restrictions for resources such as CPU, memory, and network bandwidth. This information is used to evaluate whether the node can meet the resource requirements of the newly added container, and is also used to calculate the load status of the node.

[0092] When the load balancing factor of a device node exceeds the preset value (i.e. the node's resource utilization is high) and the resource requirements of each currently running container are met, the system considers the node to be better utilized. The preset value is a threshold used to distinguish whether the node's resource utilization is high enough.

[0093] When the node meets the above conditions, the target weight value for calculating the target score of the node is determined. The target weight value reflects the optimal scheduling strategy of the node in the current state, and may be more inclined to consider the resource matching degree, affinity or load balancing factor of the node, depending on the optimization goal of the scheduling system.

[0094] The determined target weight value and node information of the device node (including the node's hardware configuration, the status of the running container, label information, etc.) will be stored in the preset database. This storage mechanism allows the system to track historical weight adjustments and changes in node status, providing data support for subsequent decision-making, and also providing a basis for monitoring and analysis for operation and maintenance personnel.

[0095] By setting up a dynamic weight adjustment mechanism, it is possible to ensure that the intelligent scheduling system can adaptively adjust the scheduling strategy according to the real-time load and resource status of the node to achieve optimal resource allocation and application performance. By storing the target weight value and node information, the scheduling system can continuously learn and optimize, continuously improve the accuracy and efficiency of scheduling, and maintain the stability and efficient operation of the cluster.

[0096] Optionally, in the first embodiment, the process of the container scheduling method of the present solution can be as follows: Figure 3 As shown, this method aims to achieve efficient and intelligent scheduling of containers on various device nodes in the cluster.

[0097] Step S301, automatically identify and classify the device nodes in the Kubernetes cluster, and store the characteristic information of the device nodes in the cluster cache. Device node 1, device node 2, and device node 3 represent different device nodes in the Kubernetes cluster, and their characteristic information includes hardware configuration, network status, and storage capacity. Through interaction with the device nodes, this information is collected, analyzed, and classified so that the subsequent intelligent scheduling algorithm can generate more accurate scheduling decisions based on this information. The node characteristic analysis module is part of this component, which further analyzes the hardware configuration, network status, and storage capacity of the device nodes in depth, providing support for the accurate identification of node types.

[0098] Step S302, based on the resource request of the container, the resource availability of the device node, the node priority, the load balancing factor, and the affinity / anti-affinity weight, the target score is calculated, and the most suitable device node is selected for container scheduling based on the target score. This step not only takes into account the current resource status, but also further combines the historical load of the node and the future predicted load to dynamically adjust the scheduling priority of the container to achieve more optimized resource allocation. The node priority takes into account the geographical location, time zone, and maintenance window of the node to ensure that the container scheduling not only takes into account the matching of resources, but also the actual availability and efficiency of the node.

[0099] Step S303, receiving the status information of the device node and the application requirements of the container in real time, and dynamically adjusting the container scheduling strategy, including policy management and adaptive learning functions, to optimize the distribution of containers on the device nodes. The policy execution monitoring submodule in the scheduling decision engine module is responsible for monitoring the execution effect of the policy, such as the running status of the container on the device node, resource utilization, etc., and automatically triggering the policy adjustment when the preset threshold is exceeded to ensure the effectiveness and adaptability of the scheduling strategy.

[0100] Step S304, feedback optimization mechanism, this mechanism adjusts the parameters of the intelligent scheduling algorithm according to the actual operation effect of the container, continuously optimizes the container scheduling strategy, and ensures the efficiency and adaptability of container scheduling. The feedback optimization mechanism module evaluates the effectiveness of the container scheduling strategy by collecting performance data of container operation, such as CPU and memory usage, network latency, etc., as well as the real-time status of device nodes, and updates the parameters of the intelligent scheduling algorithm accordingly to achieve better scheduling results.

[0101] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0102] In summary, the container scheduling method provided by the embodiment of the present application collects the first node information of each device node, wherein the first node information at least includes: the label information of the device node; when the container to be scheduled is detected, the first node information of each device node is calculated according to the evaluation index and the index weight to obtain the target score of each device node, wherein the evaluation index includes at least one of the following: the first index, the second index, the third index, and the fourth index; the first index represents the degree of match between the resource request type of the container and the available resource type of the device node; the second index represents the degree of match between the label information of the container and the device node; the third index represents the load state of the device node; the fourth index represents the priority of the device node; according to the target score of each device node, the target device node is determined in at least one device node, and the container to be scheduled is run through the target device node, which solves the problem of low resource utilization of the device node in various types of device nodes in the related art because the container operation needs to consider the specific resources and application load characteristics of the device node. And thus achieve the effect of Y.

[0103] By calculating the first indicator, the resource request type of the container can be accurately matched with the available resource type of the device node, avoiding resource waste and limited container performance. By calculating the second indicator, it is ensured that the container runs on the correct node, meeting the application deployment strategy and cluster isolation requirements, thereby enhancing the stability and security of the application. By calculating the third indicator, by avoiding scheduling the container to a node with an overload, it is possible to prevent node overload and maintain the health of the cluster, while also ensuring the stable operation of the container. By calculating the fourth indicator, it is possible to ensure that high-priority nodes are considered first. Therefore, this application not only improves the resource utilization efficiency and the operating performance of the application, but also enhances the stability of the cluster and the convenience of operation and maintenance, achieving the effect of significantly improving the management efficiency of the cluster and the quality of application services.

[0104] Example 2

[0105] The embodiment of the present application also provides a container scheduling device. It should be noted that the container scheduling device of the embodiment of the present application can be used to execute the container scheduling method provided by the embodiment of the present application. The container scheduling device provided by the embodiment of the present application is introduced below.

[0106] According to an embodiment of the present application, a device for implementing the above container scheduling method is also provided. The device is deployed in a target cluster. The target cluster includes at least one device node. Each device node in the at least one device node is used to run a container. Figure 4 As shown, the device comprises:

[0107] Specifically, the collecting unit 401 is used to collect the first node information of each device node, wherein the first node information at least includes: label information of the device node.

[0108] The calculation unit 402 is used to calculate the first node information of each device node according to the evaluation index and the index weight to obtain the target score of each device node when the container to be scheduled is detected, wherein the evaluation index includes at least one of the following: the first index, the second index, the third index, and the fourth index; the first index represents the matching degree between the resource request type of the container and the available resource type of the device node; the second index represents the matching degree between the label information of the container and the device node; the third index represents the load status of the device node; and the fourth index represents the priority of the device node.

[0109] The running unit 403 is used to determine a target device node from at least one device node according to the target score of each device node, and run the container to be scheduled through the target device node.

[0110] The container scheduling device provided in the embodiment of the present application collects the first node information of each device node through the collection unit 401, wherein the first node information includes at least: the label information of the device node; the calculation unit 402 calculates the first node information of each device node according to the evaluation index and the index weight when detecting the container to be scheduled, and obtains the target score of each device node, wherein the evaluation index includes at least one of the following: the first index, the second index, the third index, and the fourth index; the first index represents the degree of matching between the resource request type of the container and the available resource type of the device node; the second index represents the degree of matching between the label information of the container and the device node; the third index represents the load state of the device node; the fourth index represents the priority of the device node; the operation unit 403 determines the target device node in at least one device node according to the target score of each device node, and runs the container to be scheduled through the target device node, which solves the problem of low resource utilization of the device node in various types of device nodes in the related art because the container operation needs to consider the specific resources and application load characteristics of the device node.

[0111] By calculating the first indicator, the resource request type of the container can be accurately matched with the available resource type of the device node, avoiding resource waste and limited container performance. By calculating the second indicator, it is ensured that the container runs on the correct node, meeting the application deployment strategy and cluster isolation requirements, thereby enhancing the stability and security of the application. By calculating the third indicator, by avoiding scheduling the container to a node with an overload, it is possible to prevent node overload and maintain the health of the cluster, while also ensuring the stable operation of the container. By calculating the fourth indicator, it is possible to ensure that high-priority nodes are considered first. Therefore, this application not only improves the resource utilization efficiency and the operating performance of the application, but also enhances the stability of the cluster and the convenience of operation and maintenance, achieving the effect of significantly improving the management efficiency of the cluster and the quality of application services.

[0112] Optionally, in the container scheduling device provided in Example 2 of the present application, the above-mentioned evaluation index includes: a first index, the index weight includes: a first weight, and the calculation unit 402 includes: a first determination subunit, which is used to determine the remaining resource information of the device node for each device node based on the node information of the device node, and obtain the remaining resource information of each device node; a second determination subunit, which is used to determine the resource request information of the container to be scheduled, wherein the resource request information includes at least: resource type, resource request amount; a first calculation subunit, which is used to calculate the first index based on the remaining resource information of each device node and the resource request information of the container to be scheduled, and calculate the target score of each device node based on the first index and the first weight.

[0113] Optionally, in the container scheduling device provided in Embodiment 2 of the present application, the above-mentioned evaluation index includes at least: a second index, the index weight includes at least: a second weight, and the calculation unit 402 includes: a third determination subunit, used to determine the label information of the container to be scheduled; a matching subunit, used to match the label information of the container to be scheduled with the label information of the device node for each device node to obtain a matching result; wherein the matching result is used to indicate whether the label information of the device node contains the label information of the container to be scheduled; a second calculation subunit, used to determine the second index based on the matching result, and calculate the target score of each device node based on the second index, the second weight, the first index and the first weight.

[0114] Optionally, in the container scheduling device provided in Example 2 of the present application, the above-mentioned evaluation indicators include at least: a third indicator and a fourth indicator, and the indicator weights include at least: a third weight and a fourth weight. The calculation unit 402 includes: a fourth determination subunit, which is used to determine the load information of each device node based on the node information of each device node, determine the total resource information of each device node, and determine the priority information of each device node; a third calculation subunit, which is used to calculate the third indicator based on the load information of each device node and the total resource information of each device node; a fourth calculation subunit, which is used to calculate the fourth indicator based on the priority information of each device node; and a fifth calculation subunit, which is used to calculate the target score of each device node based on the first indicator, the first weight, the second indicator, the second weight, the third indicator, the third weight, the fourth indicator and the fourth weight.

[0115] Optionally, in the container scheduling device provided in Example 2 of the present application, the above-mentioned operation unit 403 includes: a fifth determination subunit, used to determine the first device node corresponding to the highest target score based on the target score of each device node; a sixth determination subunit, used to determine the first device node as the target device node when the available resource information of the first device node meets the resource request information of the container to be scheduled and the label information of the first device node does not contain an abnormal label, wherein the abnormal label represents the label of the device node on which the container to be scheduled cannot run; and an operation subunit, used to allocate the container to be scheduled to the target device node for operation.

[0116] Optionally, in the container scheduling device provided in Example 2 of the present application, the above-mentioned operation unit 403 also includes: a first collection subunit, which is used to collect the second node information of each device node at a preset time interval before allocating the container to be scheduled to the target device node for operation; an adjustment subunit, which is used to adjust the indicator weight according to the difference information between the second node information of each device node and the first node information of each device node, and obtain the adjusted indicator weight; a sixth calculation subunit, which is used to calculate the second node information of each device node according to the evaluation index and the adjusted indicator weight, and obtain the updated target score of each device node; and a seventh determination subunit, which is used to determine the target device node in at least one device node according to the updated target score of each device node.

[0117] Optionally, in the container scheduling device provided in the second embodiment of the present application, the above-mentioned operation unit 403 also includes: a second collection subunit, which is used to collect the current third indicator of each device node after obtaining the updated target score of each device node; an eighth determination subunit, which is used to determine each container currently running in the device node for each device node, and determine the resource requirement information of each container; a ninth determination subunit, which is used to determine the target weight value when the current third indicator of the device node is greater than a preset value and the resource requirement information of each container in the device node is met, wherein the target weight value is the indicator weight used in the process of calculating the target score of the device node; and a storage subunit, which is used to store the target weight value and the node information of the device node in a preset database.

[0118] It should be noted that the acquisition unit 401, the calculation unit 402 and the operation unit 403 correspond to steps S201 to S204 in Example 1, and the two modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units may be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processor 102a, 102 container scheduling, ..., 102n), and the above-mentioned modules may also be part of the device and may be run in the computer terminal 10 provided in Example 1.

[0119] Example 3

[0120] An embodiment of the present application may provide an electronic device, Figure 5 is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 5 As shown, the electronic device may include: one or more ( Figure 5 (only one is shown) processor 502, memory 504, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0121] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned method. The memory 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 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal 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.

[0122] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: collect the first node information of each device node, wherein the first node information at least includes: the label information of the device node; when the container to be scheduled is detected, the first node information of each device node is calculated according to the evaluation index and the index weight to obtain the target score of each device node, wherein the evaluation index includes at least one of the following: the first index, the second index, the third index, and the fourth index; the first index represents the degree of match between the resource request type of the container and the available resource type of the device node; the second index represents the degree of match between the label information of the container and the device node; the third index represents the load state of the device node; the fourth index represents the priority of the device node; according to the target score of each device node, determine the target device node in at least one device node, and run the container to be scheduled through the target device node.

[0123] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: the evaluation index includes: a first index, the index weight includes: a first weight, the first node information of each device node is calculated based on the evaluation index and the index weight to obtain the target score of each device node, including: for each device node, the remaining resource information of the device node is determined based on the node information of the device node to obtain the remaining resource information of each device node; the resource request information of the container to be scheduled is determined, wherein the resource request information includes at least: resource type, resource request amount; the first index is calculated based on the remaining resource information of each device node and the resource request information of the container to be scheduled, and the target score of each device node is calculated based on the first index and the first weight.

[0124] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: the evaluation index includes at least: the second index, the index weight includes at least: the second weight, the first node information of each device node is calculated according to the evaluation index and the index weight, and the target score of each device node is obtained, including: determining the label information of the container to be scheduled; for each device node, matching the label information of the container to be scheduled with the label information of the device node to obtain a matching result; wherein the matching result is used to indicate whether the label information of the device node contains the label information of the container to be scheduled; determining the second index according to the matching result, and calculating the target score of each device node according to the second index, the second weight, the first index and the first weight.

[0125] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: the evaluation index includes at least: a third index and a fourth index, the index weight includes at least: a third weight and a fourth weight, and the first node information of each device node is calculated based on the evaluation index and the index weight to obtain the target score of each device node, including: determining the load information of each device node based on the node information of each device node, determining the total resource information of each device node, and determining the priority information of each device node; calculating the third index based on the load information of each device node and the total resource information of each device node; calculating the fourth index based on the priority information of each device node; calculating the target score of each device node based on the first index, the first weight, the second index, the second weight, the third index, the third weight, the fourth index and the fourth weight.

[0126] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: determine the target device node in at least one device node according to the target score of each device node, including: determine the first device node corresponding to the highest target score according to the target score of each device node; determine the first device node as the target device node when the available resource information of the first device node meets the resource request information of the container to be scheduled and the label information of the first device node does not have an abnormal label, wherein the abnormal label represents the label of the device node on which the container to be scheduled cannot run; and allocate the container to be scheduled to the target device node for operation.

[0127] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: before allocating the container to be scheduled to the target device node for operation, the above method also includes: collecting the second node information of each device node at each preset time interval; adjusting the indicator weight according to the difference information between the second node information of each device node and the first node information of each device node to obtain the adjusted indicator weight; calculating the second node information of each device node according to the evaluation indicator and the adjusted indicator weight to obtain the updated target score of each device node; determining the target device node in at least one device node according to the updated target score of each device node.

[0128] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: after obtaining the updated target score of each device node, the above method also includes: collecting the current third indicator of each device node; for each device node, determining each container currently running in the device node, and determining the resource requirement information of each container; when the current third indicator of the device node is greater than the preset value and the resource requirement information of each container in the device node is met, determining the target weight value, wherein the target weight value is the indicator weight used in the process of calculating the target score of the device node; storing the target weight value and the node information of the device node in a preset database.

[0129] Using the embodiment of the present application, a container scheduling method is provided. By collecting the first node information of each device node, wherein the first node information at least includes: the label information of the device node; when the container to be scheduled is detected, the first node information of each device node is calculated according to the evaluation index and the index weight to obtain the target score of each device node, wherein the evaluation index includes at least one of the following: the first index, the second index, the third index, and the fourth index; the first index represents the degree of matching between the resource request type of the container and the available resource type of the device node; the second index represents the degree of matching between the label information of the container and the device node; the third index represents the load state of the device node; the fourth index represents the priority of the device node; according to the target score of each device node, the target device node is determined in at least one device node, and the container to be scheduled is run through the target device node, thereby solving the technical problem that the resource utilization rate of the device node is low in multiple types of device nodes because the container operation needs to consider the specific resources and application load characteristics of the device node.

[0130] By calculating the first indicator, the resource request type of the container can be accurately matched with the available resource type of the device node, avoiding resource waste and limited container performance. By calculating the second indicator, it is ensured that the container runs on the correct node, meeting the application deployment strategy and cluster isolation requirements, thereby enhancing the stability and security of the application. By calculating the third indicator, by avoiding scheduling the container to a node with an overload, it is possible to prevent node overload and maintain the health of the cluster, while also ensuring the stable operation of the container. By calculating the fourth indicator, it is possible to ensure that high-priority nodes are considered first. Therefore, this application not only improves the resource utilization efficiency and the operating performance of the application, but also enhances the stability of the cluster and the convenience of operation and maintenance, achieving the effect of significantly improving the management efficiency of the cluster and the quality of application services.

[0131] It can be understood by those skilled in the art that Figure 5The structure shown is for illustration only, and the electronic device may also be a terminal device such as a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Moile Internet Devices, MID), or a PAD. Figure 5 The structure of the electronic device is not limited. Figure 5 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 5 Different configurations shown.

[0132] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0133] Example 4

[0134] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the container scheduling method provided in the first embodiment.

[0135] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0136] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing the program steps of the container scheduling method.

[0137] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0138] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0139] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0140] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0141] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0142] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0143] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A container scheduling method, characterized in that: The method is applied to a target cluster, the target cluster includes at least one device node, each of the at least one device node is used to run a container, and the method includes: Collecting first node information of each device node, wherein the first node information at least includes: label information of the device node; When a container to be scheduled is detected, the first node information of each device node is calculated according to an evaluation index and an index weight to obtain a target score of each device node, wherein the evaluation index includes at least one of the following: a first index, a second index, a third index, and a fourth index; the first index represents the degree of match between the resource request type of the container and the available resource type of the device node; the second index represents the degree of match between the label information of the container and the device node; the third index represents the load state of the device node; and the fourth index represents the priority of the device node; According to the target score of each device node, a target device node is determined in the at least one device node, and the to-be-scheduled container is run through the target device node.

2. The method according to claim 1, characterized in that The evaluation index includes: a first index, and the index weight includes: a first weight. The first node information of each device node is calculated according to the evaluation index and the index weight to obtain a target score for each device node, including: For each device node, determining the remaining resource information of the device node according to the node information of the device node, and obtaining the remaining resource information of each device node; Determine resource request information of the container to be scheduled, wherein the resource request information includes at least: resource type and resource request amount; The first indicator is calculated according to the remaining resource information of each device node and the resource request information of the container to be scheduled, and the target score of each device node is calculated according to the first indicator and the first weight.

3. The method according to claim 2, characterized in that The evaluation index at least includes: a second index, and the index weight at least includes: a second weight. The first node information of each device node is calculated according to the evaluation index and the index weight to obtain a target score for each device node, including: Determine the label information of the container to be scheduled; For each device node, matching the label information of the container to be scheduled with the label information of the device node to obtain a matching result; wherein the matching result is used to indicate whether the label information of the device node contains the label information of the container to be scheduled; The second indicator is determined according to the matching result, and a target score of each device node is calculated according to the second indicator, the second weight, the first indicator and the first weight.

4. The method according to claim 3, characterized in that The evaluation index at least includes: a third index and a fourth index, and the index weight at least includes: a third weight and a fourth weight. The first node information of each device node is calculated according to the evaluation index and the index weight to obtain a target score for each device node, including: Determining load information of each device node, determining total resource information of each device node, and determining priority information of each device node according to the node information of each device node; Calculating the third index according to the load information of each device node and the total resource information of each device node; Calculating the fourth index according to the priority information of each device node; A target score for each device node is calculated based on the first indicator, the first weight, the second indicator, the second weight, the third indicator, the third weight, the fourth indicator and the fourth weight.

5. The method according to claim 1, characterized in that Determining a target device node among the at least one device node according to the target score of each device node includes: Determine a first device node corresponding to a highest target score according to the target score of each device node; When the available resource information of the first device node satisfies the resource request information of the container to be scheduled, and the label information of the first device node does not contain an abnormal label, determining the first device node as the target device node, wherein the abnormal label represents a label of a device node on which the container to be scheduled cannot run; Allocate the container to be scheduled to the target device node for execution.

6. The method according to claim 5, characterized in that Before allocating the container to be scheduled to the target device node for execution, the method further includes: Collect the second node information of each device node at a preset time interval; The indicator weight is adjusted according to the difference information between the second node information of each device node and the first node information of each device node to obtain an adjusted indicator weight; Calculating the second node information of each device node according to the evaluation index and the adjusted index weight to obtain an updated target score for each device node; The target device node is determined from the at least one device node according to the updated target score of each device node.

7. The method according to claim 6, characterized in that After obtaining the updated target score of each device node, the method further includes: Collect the current third indicator of each device node; For each device node, determine each container currently running in the device node, and determine resource requirement information for each container; When the current third indicator of the device node is greater than a preset value and the resource requirement information of each container in the device node is satisfied, determine a target weight value, wherein the target weight value is the indicator weight used in calculating the target score of the device node; The target weight value and the node information of the device node are stored in a preset database.

8. A container scheduling device, characterized in that: The device is deployed in a target cluster, the target cluster includes at least one device node, each of the at least one device node is used to run a container, and the device includes: A collecting unit, used for collecting first node information of each device node, wherein the first node information at least includes: label information of the device node; A calculation unit, configured to calculate the first node information of each device node according to an evaluation index and an index weight to obtain a target score of each device node when a container to be scheduled is detected, wherein the evaluation index includes at least one of the following: a first index, a second index, a third index, and a fourth index; the first index represents the degree of match between the resource request type of the container and the available resource type of the device node; the second index represents the degree of match between the label information of the container and the device node; the third index represents the load state of the device node; and the fourth index represents the priority of the device node; The running unit is used to determine a target device node from the at least one device node according to the target score of each device node, and run the to-be-scheduled container through the target device node.

9. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 7 when running.

10. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Resource scheduling method, device, equipment, medium and product

    CN120803662A