Method and device for determining execution node, storage medium and electronic device
Through the filtering and scoring methods, the most suitable execution node is determined, which solves the challenges of Kubernetes in heterogeneous resource scheduling and management, and improves resource utilization.
Patent Information
- Application Number
- CN202411228180.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-09-03
AI Technical Summary
Kubernetes cannot implement fine-grained scheduling management of heterogeneous resources, especially when dealing with complex instruction sets and GPU resources.
By obtaining the information of the pod to be scheduled and the information of the executable nodes, including the central processor instruction set type, resource demand vector and free resource vector, the node queue that meets the pod needs is selected, and the score is calculated through the resource demand and free resource, and the results are determined. The most suitable execution node.
The fine-grained scheduling and management of heterogeneous resources is realized, which avoids unreasonable resource allocation caused by resource competition and improves the utilization rate of Kubernetes cluster resources.
Smart Images

Figure CN118740844B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a method and device for determining an execution node, a storage medium, and an electronic device. Background Art
[0002] In the field of cloud computing, especially in complex computing environments, balanced and efficient use of computing resources is a key factor in improving task execution efficiency and overall cluster utilization. With the development of computing technology, applications and workloads have become more and more complex and diverse, from traditional office software to big data processing and artificial intelligence. In order to meet these needs, central processing unit (CPU) designers continue to expand instruction sets and add new instructions to accelerate specific types of operations. In addition, graphics processing units (GPUs) have become indispensable hardware accelerators for these technologies due to their parallel processing capabilities. GPUs, which were originally used mainly for graphics rendering, currently play an important role in deep learning, complex algorithm operations, and data analysis. As the preferred tool in the field of container orchestration in cloud platforms, Kubernetes plays an important role in automating the deployment, management, and expansion of containerized applications. However, Kubernetes still faces challenges in handling heterogeneous resources, especially in fine-grained scheduling and management of complex instruction sets and high-performance computing resources such as GPUs.
[0003] In the existing technology, Kubernetes cannot achieve fine-grained scheduling and management of heterogeneous resources, which has not yet been effectively solved. Summary of the invention
[0004] The present application provides a method and device for determining an execution node, a storage medium, and an electronic device, so as to at least solve the problem in the prior art that a multi-container orchestration engine (Kubernetes, abbreviated as K8s) cannot achieve fine-grained scheduling and management of heterogeneous resources.
[0005] According to an embodiment of the present application, a method for determining an execution node is provided, comprising: obtaining first information of a pod to be scheduled, and obtaining second information of each first node among multiple first nodes that are allowed to execute the pod to be scheduled (container group), wherein the first information at least includes: a first instruction set type and a resource requirement vector of a central processing unit instruction set for executing the pod to be scheduled, and the second information at least includes: an idle resource vector; wherein the first information is used to indicate the requirement of the pod to be scheduled; the multiple first nodes are screened by the first instruction set type and the idle resource vector to obtain a first queue, wherein the first queue includes multiple second nodes that meet the requirement of the pod to be scheduled; first scores corresponding to the multiple second nodes in the first queue are determined by the resource requirement vector and the idle resource vector; and the second node corresponding to the highest first score among the multiple first scores is determined as the execution node of the pod to be scheduled.
[0006] In an exemplary embodiment, the multiple first nodes are screened by the first instruction set type and the idle resource vector to obtain a first queue, including: determining a second instruction set type of a central processing unit instruction set supported by each of the first nodes, wherein the second information also includes: the second instruction set type; determining a third instruction set type that is the same as the first instruction set type among the multiple second instruction set types; determining a second queue through a third node corresponding to the third instruction set type among the multiple first nodes; and filtering out the first queue from the second queue through the resource demand vector and the idle resource vector.
[0007] In an exemplary embodiment, filtering out the first queue from the second queue using the resource requirement vector and the idle resource vector includes: determining the multiple second nodes in the second queue whose idle resource vectors satisfy the resource requirement vector; and determining the multiple second nodes as the first queue.
[0008] In an exemplary embodiment, the multiple first nodes are screened by the first instruction set type and the idle resource vector to obtain a first queue, including: a judgment step: extracting a fourth node from the multiple first nodes, and judging whether the fourth node meets the requirements of the pod to be scheduled by the first instruction set type and the idle resource vector, wherein the fourth node is any node among the multiple first nodes; a adding step: if the fourth node meets the requirements of the pod to be scheduled, adding the fourth node to a preset queue; an updating step: updating the multiple first nodes by extracting multiple first nodes after the fourth node; and looping the judging step, the adding step and the updating step until the multiple first nodes are all judged to obtain the first queue.
[0009] In an exemplary embodiment, the first scores respectively corresponding to multiple second nodes in the first queue are determined by the resource requirement vector and the free resource vector, including: obtaining the second score corresponding to each second node, and obtaining the third score and the fourth score corresponding to each second node through the resource requirement vector and the free resource vector, wherein the second score is used to indicate the computing power performance score of each second node, the third score is used to indicate the resource matching score of each second node, and the fourth score is used to indicate the free resource ratio score of each second node; the first score corresponding to each second node is calculated by the second score, the third score and the fourth score.
[0010] In an exemplary embodiment, obtaining a second score corresponding to each second node includes: obtaining a first computing speed of each second node, wherein the first computing speed includes at least one of the following: a second computing speed of a central processing unit on each second node, a third computing speed of a graphics processing unit on each second node, and a data reading and writing speed of each second node; and determining the second score by the first computing speed.
[0011] In an exemplary embodiment, determining the second score by the first computing speed includes: determining a first weight assigned to the first computing speed, wherein the first weight includes at least one of the following: a second weight assigned to the second computing speed, a third weight assigned to the third computing speed, and a fourth weight assigned to the data reading and writing speed, wherein the sum of the first weights is equal to a first value; determining the sum of a first product of the first computing speed and the first weight as the second score, wherein the first product includes at least one of the following: a second product of the second computing speed and the second weight, a third product of the third computing speed and the third weight, and a fourth product of the data reading and writing speed and the fourth weight.
[0012] In an exemplary embodiment, determining the sum of the first computing speed and the first product of the first weight as the second score includes: determining the sum of the first computing speed and the first product of the first weight as a third score; and performing a normalization operation on the third score to obtain the second score.
[0013] In an exemplary embodiment, obtaining the third score corresponding to each second node through the resource requirement vector and the idle resource vector includes: determining the cosine similarity between the resource requirement vector and the idle resource vector; and determining the cosine similarity as the third score.
[0014] In an exemplary embodiment, obtaining the fourth score corresponding to each second node through the resource demand vector and the idle resource vector includes: obtaining the total resource vector of each second node; and determining the fourth score through the idle resource vector and the total resource vector.
[0015] In an exemplary embodiment, calculating the first score corresponding to each second node by using the second score, the third score and the fourth score includes: determining whether the amount of graphics processor resources possessed by each second node is equal to a second value; when the amount of resources is not equal to the second value, calculating a fifth score by using a first functional relationship to obtain the first score, wherein the fifth score includes: the second score, the third score and the fourth score; when the amount of resources is equal to the second value, calculating the fifth score by using a second functional relationship to obtain the first score.
[0016] In an exemplary embodiment, calculating the fifth score through a first functional relationship to obtain the first score includes: determining a fifth product of the second score, the third score and the fourth score; and determining the fifth product as the first score.
[0017] In an exemplary embodiment, calculating the fifth score through a second functional relationship to obtain the first score includes: determining the second score, a fifth product of the third score and the fourth score; and performing an exponential operation on the fifth product and a third value to obtain the first score.
[0018] In an exemplary embodiment, obtaining second information of each first node among a plurality of first nodes that are allowed to execute the pod to be scheduled includes: when the second information is the idle resource vector, determining idle central processing unit resources of each first node, determining idle graphics processing unit resources of each first node, and determining idle memory resources of each first node; and establishing the idle resource vector by using the idle central processing unit resources, the idle graphics processing unit resources, and the idle memory resources.
[0019] In an exemplary embodiment, obtaining first information of the pod to be scheduled includes: when the first information is a resource requirement vector, determining a central processing unit resource required by the pod to be scheduled, determining a graphics processing unit resource required by the pod to be scheduled, and determining a memory resource required by the pod to be scheduled; and constructing the resource requirement vector by using the central processing unit resources, the graphics processing unit resources, and the memory resources.
[0020] In an exemplary embodiment, obtaining first information of the pod to be scheduled includes: when the first information is the first instruction set type, obtaining a custom annotation of the pod to be scheduled; obtaining an instruction set supported by the pod to be scheduled from the custom annotation; and determining the first instruction set type according to the instruction set.
[0021] According to another embodiment of the present application, a device for determining an execution node is provided, comprising: an acquisition module, used to acquire first information of the pod to be scheduled, and to acquire second information of each first node among multiple first nodes that are allowed to execute the pod to be scheduled, wherein the first information at least includes: a first instruction set type and a resource requirement vector of a central processing unit instruction set for executing the pod to be scheduled, and the second information at least includes: an idle resource vector; wherein the first information is used to indicate the requirement of the pod to be scheduled; a screening module, used to screen the multiple first nodes by the first instruction set type and the idle resource vector to obtain a first queue, wherein the first queue includes multiple second nodes that meet the requirement of the pod to be scheduled; a first determination module, used to determine first scores corresponding to multiple second nodes in the first queue respectively by the resource requirement vector and the idle resource vector; and a second determination module, used to determine the second node corresponding to the highest first score among the multiple first scores as the execution node of the pod to be scheduled.
[0022] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0023] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0024] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0025] Through this application, the first information of the pod to be scheduled is obtained, and the second information of each first node in the multiple first nodes that are allowed to execute the pod to be scheduled is obtained, wherein the first information at least includes: a first instruction set type and a resource requirement vector of a central processing unit instruction set for executing the pod to be scheduled, and the second information at least includes: an idle resource vector; wherein the first information is used to indicate the requirements of the pod to be scheduled; the multiple first nodes are screened by the first instruction set type and the idle resource vector to obtain a first queue, wherein the first queue includes multiple second nodes that meet the requirements of the pod to be scheduled; the first scores corresponding to the multiple second nodes in the first queue are determined by the resource requirement vector and the idle resource vector; and the second node corresponding to the highest first score among the multiple first scores is determined as the execution node of the pod to be scheduled. That is, by screening multiple first nodes, multiple second nodes that meet the requirements of the generation scheduling pod (including meeting the requirements of the pod to be scheduled for the first instruction set type) are obtained; and by scoring multiple second pods, the second node whose idle resource vector best matches the resource requirement vector of the pod to be scheduled (i.e., has the highest first score) is determined as the execution node of the pod to be scheduled. The technical effect of fine-grained resource (such as idle resource vectors, central processing unit instruction sets, i.e., complex instruction sets) scheduling management between the pod to be scheduled and multiple first nodes is achieved. Therefore, the problem that Kubernetes cannot achieve fine-grained scheduling management of heterogeneous resources in the prior art can be solved. It avoids unreasonable resource allocation caused by resource competition and improves the utilization rate of Kubernetes cluster resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a hardware structure block diagram of a computer terminal for executing a method for determining a node according to an embodiment of the present application;
[0027] Figure 2 is a flowchart of a method for determining an execution node according to an embodiment of the present application;
[0028] Figure 3 is another flow chart of a method for determining an execution node according to an embodiment of the present application;
[0029] Figure 4 It is a structural block diagram of a device for determining an execution node according to an embodiment of the present application. DETAILED DESCRIPTION
[0030] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0032] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure block diagram of a computer terminal for executing a method for determining a node in an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 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) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0033] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for allocating load resources in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. 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 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0034] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0035] Figure 2 is a flowchart of a method for determining an execution node according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0036] Step S202, obtaining first information of the pod to be scheduled, and obtaining second information of each first node among a plurality of first nodes that are allowed to execute the pod to be scheduled, wherein the first information at least includes: a first instruction set type and a resource requirement vector of a central processing unit instruction set for executing the pod to be scheduled, and the second information at least includes: an idle resource vector; wherein the first information is used to indicate the requirement of the pod to be scheduled;
[0037] It can be understood that the pod to be scheduled is a pod that applies for computing resources, the multiple first nodes are nodes that provide computing resources, and the multiple first nodes may be determined as execution nodes of the pod to be scheduled.
[0038] It should be noted that Pod (container group) is the smallest scheduling unit in Kubernetes. Its essence is a collection of container processes and resources including containerized applications. Kubernetes is an open source, one-stop, complete distributed system development and support platform for managing containerized applications on multiple hosts in a cloud platform.
[0039] The central processing unit instruction set, or CPU instruction set, is the bridge between computer hardware and software. It is a series of low-level commands understood and executed by the CPU to control the computer to perform various operations, such as mathematical operations, logical judgments, data movement, control flow control, etc. Instruction sets are broadly divided into two categories: Complex instruction set (CISC): provides a large number of multi-functional instructions, a single instruction completes complex operations, is conducive to coding, but has a long execution cycle. Such as the Intel x86 architecture. Reduced instruction set (RICS): Each instruction is simple and executes quickly. Multiple instructions complete complex tasks, which is conducive to parallelization and low power consumption. It is widely used by modern processors such as ARM, Intel's Atom, AMD's Zen, etc.
[0040] The instruction set types in the embodiments of the present application include: a complex instruction set (CISC) and a reduced instruction set (RICS). The first instruction set type may be a complex instruction set (CISC) or a reduced instruction set (RICS).
[0041] Step S204: screening the multiple first nodes by using the first instruction set type and the idle resource vector to obtain a first queue, wherein the first queue includes multiple second nodes that meet the requirements of the pod to be scheduled;
[0042] Step S206, determining first scores respectively corresponding to a plurality of second nodes in the first queue by using the resource demand vector and the idle resource vector;
[0043] Step S208: Determine a second node corresponding to the highest first score among the plurality of first scores as an execution node of the pod to be scheduled.
[0044] Through the above steps, the first information of the pod to be scheduled is obtained, and the second information of each first node among the multiple first nodes that are allowed to execute the pod to be scheduled is obtained, wherein the first information at least includes: a first instruction set type and a resource requirement vector of a central processing unit instruction set for executing the pod to be scheduled, and the second information at least includes: an idle resource vector; wherein the first information is used to indicate the requirements of the pod to be scheduled; the multiple first nodes are screened by the first instruction set type and the idle resource vector to obtain a first queue, wherein the first queue includes multiple second nodes that meet the requirements of the pod to be scheduled; the first scores corresponding to the multiple second nodes in the first queue are determined by the resource requirement vector and the idle resource vector; and the second node corresponding to the highest first score among the multiple first scores is determined as the execution node of the pod to be scheduled. That is, by screening the multiple first nodes, multiple second nodes that meet the requirements of the pod to be scheduled (including the requirements of the pod to be scheduled for the first instruction set type) are obtained; and by scoring the multiple second pods, the second node whose idle resource vector best matches the resource requirement vector of the pod to be scheduled (i.e., has the highest first score) is determined as the execution node of the pod to be scheduled. The technical effect of fine-grained resource (such as idle resource vectors, central processing unit instruction sets, i.e., complex instruction sets) scheduling management between the pod to be scheduled and multiple first nodes is achieved. Therefore, the problem that Kubernetes cannot achieve fine-grained scheduling management of heterogeneous resources in the prior art can be solved. It avoids unreasonable resource allocation caused by resource competition and improves the utilization rate of Kubernetes cluster resources.
[0045] In an exemplary embodiment, the multiple first nodes are screened by the first instruction set type and the idle resource vector to obtain a first queue, including: determining a second instruction set type of a central processing unit instruction set supported by each of the first nodes, wherein the second information also includes: the second instruction set type; determining a third instruction set type that is the same as the first instruction set type among the multiple second instruction set types; determining a second queue through a third node corresponding to the third instruction set type among the multiple first nodes; and filtering out the first queue from the second queue through the resource demand vector and the idle resource vector.
[0046] Further, the first queue is filtered out from the second queue through the resource demand vector and the idle resource vector, including: determining the multiple second nodes in the second queue whose idle resource vectors meet the resource demand vector; and determining the multiple second nodes as the first queue.
[0047] It is understandable that the second queue can be screened out by matching the multiple second instruction set types supported by the multiple first nodes with the first instruction set type. For example, the multiple second instruction set types supported by the multiple first nodes include complex instruction set (CISC) and reduced instruction set (RICS); if the first instruction set type required to execute the pod to be scheduled is a complex instruction set (CISC), then the third node among the multiple first nodes that supports the complex instruction set (CISC) is the node that matches the pod to be scheduled in terms of instruction set type. Furthermore, in the second queue, multiple second nodes whose idle resource vectors meet the resource demand vectors of the pod to be scheduled are continuously screened out to obtain the first queue.
[0048] Therefore, the embodiment of the present application can discard nodes that do not support the first instruction set type required by the pod to be scheduled from the multiple first nodes by matching the instruction set type of the pod to be scheduled with the multiple first nodes. In the subsequent resource scheduling process, it can be ensured that the pod to be scheduled will only be scheduled to the node that supports the first instruction set type for execution. Thus, the technical effect of reasonably scheduling computing resources for the pod to be scheduled is achieved at the instruction set type level.
[0049] Optionally, the first information obtained may also include first specific information of computing resources (i.e., resource demand vector) required by the pod to be scheduled; the second information obtained may also include: second specific information of idle resource vectors on each first node. It should be noted that the first specific information and the second specific information both include at least one of the following: CPU, GPU model, version, feature difference, etc.
[0050] Then, the first queue is selected from the second queue by using the resource demand vector and the idle resource vector, and further includes:
[0051] Determine a plurality of fifth nodes in the second queue whose idle resource vectors satisfy the resource demand vector;
[0052] A plurality of second nodes whose second specific information is consistent with the first specific information of the pod to be scheduled are screened out from the plurality of fifth nodes to obtain a first queue.
[0053] Therefore, in the embodiment of the present application, the first specific information of the computing resources required by the pod to be scheduled is added during the screening process, so that the screening granularity of the screening process is finer, thereby making the screened multiple second nodes more compatible with the pod to be scheduled.
[0054] In an exemplary embodiment, the multiple first nodes are screened by the first instruction set type and the idle resource vector to obtain a first queue, including: a judgment step: extracting a fourth node from the multiple first nodes, and judging whether the fourth node meets the requirements of the pod to be scheduled by the first instruction set type and the idle resource vector, wherein the fourth node is any node among the multiple first nodes; a adding step: if the fourth node meets the requirements of the pod to be scheduled, adding the fourth node to a preset queue; an updating step: updating the multiple first nodes by extracting multiple first nodes after the fourth node; and looping the judging step, the adding step and the updating step until the multiple first nodes are all judged to obtain the first queue.
[0055] It can be understood that, in the process of screening multiple first nodes, for any node among the multiple first nodes, if the node meets the requirements of the pod to be scheduled, the node is added to the preset queue and discarded from the multiple first nodes; if the node does not meet the requirements of the pod to be scheduled, the node is discarded from the multiple first nodes. This process continues until all the multiple first nodes are judged and the first queue is obtained.
[0056] In an exemplary embodiment, the first scores respectively corresponding to multiple second nodes in the first queue are determined by the resource requirement vector and the free resource vector, including: obtaining the second score corresponding to each second node, and obtaining the third score and the fourth score corresponding to each second node through the resource requirement vector and the free resource vector, wherein the second score is used to indicate the computing power performance score of each second node, the third score is used to indicate the resource matching score of each second node, and the fourth score is used to indicate the free resource ratio score of each second node; the first score corresponding to each second node is calculated by the second score, the third score and the fourth score.
[0057] In an embodiment of the present application, the computing power performance score of each second node is calculated, and the resource matching score corresponding to each second node and the idle resource ratio score are calculated by the resource demand vector of the pod to be scheduled and the idle resource vector of each second node. Thus, the comprehensive score of each second node, i.e., the first score, is calculated by the computing power performance score, the resource matching score, and the idle resource ratio score. The first score is a score used to measure the matching degree of each second node domain with the pod to be scheduled. The higher the first score, the greater the possibility that the second node will be used as the execution node of the pod to be scheduled.
[0058] Therefore, the embodiment of the present application comprehensively determines the first score of each second node through the example performance score, resource matching score, and idle resource ratio score of each second node, and adopts a scoring strategy that comprehensively considers multiple aspects for each second node, so that the scoring of the second node is more accurate.
[0059] In an optional embodiment, obtaining the second score corresponding to each second node includes: obtaining a first computing speed of each second node, wherein the first computing speed includes at least one of the following: a second computing speed of a central processing unit on each second node, a third computing speed of a graphics processing unit on each second node, and a data reading and writing speed of each second node; and determining the second score by the first computing speed.
[0060] Further, determining the second score through the first computing speed includes: determining a first weight assigned to the first computing speed, wherein the first weight includes at least one of the following: a second weight assigned to the second computing speed, a third weight assigned to the third computing speed, and a fourth weight assigned to the data reading and writing speed, wherein the sum of the first weights is equal to a first value; determining the sum of a first product of the first computing speed and the first weight as the second score, wherein the first product includes at least one of the following: a second product of the second computing speed and the second weight, a third product of the third computing speed and the third weight, and a fourth product of the data reading and writing speed and the fourth weight.
[0061] It is understandable that the computing power performance score of each second node needs to be calculated by the second computing speed, the third computing speed corresponding to the central processing unit and the graphics processing unit on each second node, and the data reading and writing speed of each second node. During the calculation process, weights are assigned to the first computing speed, the second computing speed, and the data reading and writing speed. The second score is calculated by weighted summation. It should be noted that the sum of the second weight, the third weight, and the fourth weight is equal to the first value, and the first value can be equal to 1. Optionally, if there is no graphics processing unit in each second node, the third computing speed is equal to 0.
[0062] Further, determining the sum of the first product of the first calculation speed and the first weight as the second score includes: determining the sum of the first product of the first calculation speed and the first weight as a third score; and performing a normalization operation on the third score to obtain the second score.
[0063] Optionally, the normalization operation includes: determining the third scores corresponding to multiple second nodes respectively to obtain multiple third scores; determining the maximum score and the minimum score among the multiple third scores; determining a first difference between the maximum score and the minimum score; determining a second difference between the third score and the minimum score of each second node; and taking the quotient of the second difference and the first difference as the normalization result, i.e., the second score.
[0064] In an optional embodiment, obtaining the third score corresponding to each second node through the resource requirement vector and the idle resource vector includes: determining the cosine similarity between the resource requirement vector and the idle resource vector; and determining the cosine similarity as the third score.
[0065] In an optional embodiment, obtaining the fourth score corresponding to each second node through the resource demand vector and the idle resource vector includes: obtaining the total resource vector of each second node; and determining the fourth score through the idle resource vector and the total resource vector.
[0066] Specifically, the quotient of the idle resource vector and the total resource vector is determined as the fourth score shown.
[0067] In an exemplary embodiment, calculating the first score corresponding to each second node by using the second score, the third score and the fourth score includes: determining whether the amount of graphics processor resources possessed by each second node is equal to a second value; when the amount of resources is not equal to the second value, calculating a fifth score by using a first functional relationship to obtain the first score, wherein the fifth score includes: the second score, the third score and the fourth score; when the amount of resources is equal to the second value, calculating the fifth score by using a second functional relationship to obtain the first score.
[0068] In the embodiment of the present application, in the process of calculating the first score for each second node, different calculation methods of the first score are adopted according to whether each second node has image processor resources. The calculation method includes: a first functional relationship and a second functional relationship. Wherein, the second value is equal to 0.
[0069] Further, calculating the fifth score through the first functional relationship to obtain the first score includes: determining a fifth product of the second score, the third score and the fourth score; and determining the fifth product as the first score.
[0070] Further, calculating the fifth score through a second functional relationship to obtain the first score includes: determining a fifth product of the second score, the third score and the fourth score; and performing an exponential operation on the fifth product and a third value to obtain the first score.
[0071] Specifically, the second functional relationship may adopt an exponential function. The third value is used as the base of the exponential function, and the third value may be equal to 2. The fifth product is used as the exponent.
[0072] Therefore, the embodiment of the present application adopts different functional relationships to calculate the first score of each second node based on whether the GPU resources of each second node are 0, thereby ensuring that when the CPU node resources are sufficient, the CPU node is determined to have a higher priority than the GPU node as the execution node. It should be noted that the multiple second nodes include CPU nodes and GPU nodes. A CPU node refers to a node with a CPU, and the CPU node does not have GPU resources; a GPU node refers to a node with a GPU, and a CPU card may be inserted into the GPU node.
[0073] In an exemplary embodiment, obtaining second information of each first node among a plurality of first nodes that are allowed to execute the pod to be scheduled includes: when the second information is the idle resource vector, determining idle central processing unit resources of each first node, determining idle graphics processing unit resources of each first node, and determining idle memory resources of each first node; and establishing the idle resource vector by using the idle central processing unit resources, the idle graphics processing unit resources, and the idle memory resources.
[0074] In an exemplary embodiment, obtaining first information of the pod to be scheduled includes: when the first information is a resource requirement vector, determining a central processing unit resource required by the pod to be scheduled, determining a graphics processing unit resource required by the pod to be scheduled, and determining a memory resource required by the pod to be scheduled; and constructing the resource requirement vector by using the central processing unit resources, the graphics processing unit resources, and the memory resources.
[0075] The embodiment of the present application constructs the corresponding idle resource vector and the resource demand vector, which is beneficial to the subsequent calculation of the matching degree between the resource demand of the pod to be scheduled and the idle resources of the first node, thereby improving the balance of cluster node resource usage.
[0076] In an exemplary embodiment, obtaining first information of the pod to be scheduled includes: when the first information is the first instruction set type, obtaining a custom annotation of the pod to be scheduled; obtaining an instruction set supported by the pod to be scheduled from the custom annotation; and determining the first instruction set type according to the instruction set.
[0077] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0078] In order to better understand the process of the above-mentioned execution node determination method, the implementation process of the above-mentioned execution node determination method is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.
[0079] As the preferred tool for container orchestration in cloud platforms, Kubernetes plays an important role in automating the deployment, management, and expansion of containerized applications. However, Kubernetes still faces challenges in handling heterogeneous resources, especially in fine-grained scheduling and management of complex instruction sets and high-performance computing resources such as GPUs.
[0080] Specifically, cluster computing resource management systems in related technologies mainly use centralized or distributed resource management models for CPU and memory. Yet Another Resource Negotiator (YARN) on the open source distributed computing platform Apache Hadoop adopts centralized management and provides three resource scheduling methods: First In, First Out (FIFO), capacity, and fair allocation. The resources it schedules only include CPU cores and memory, and cannot manage GPU resources. Mesos is an open source distributed system kernel that provides an efficient and flexible way to manage and schedule cluster resources. Mesos allows multiple computing frameworks (such as Apache Hadoop, Apache Spark, etc.) to coexist on the same cluster while ensuring the reasonable allocation and utilization of resources. Mesos uses the Dominant Resource Fairness (DRF) algorithm to achieve fair allocation of resources in different computing frameworks. The disadvantage of the algorithm is that it only considers CPU and memory resources, and GPU resources are allocated in a coarse-grained manner, which is not conducive to the sharing of GPU resources. In addition, the algorithm allocates resources in a serial manner, which causes delays. Omega solves the shortcomings of Mesos' serial allocation, but it needs to deal with allocation conflicts, and no GPU resource management has been found. Although Kubernetes has implemented GPU resource management, GPU resources are also exclusive. Borg uses a centralized model and has not yet found GPU resource management. In short, existing resource management systems such as Mesos and Kubernetes only manage GPUs in a coarse-grained manner and do not consider the comprehensive needs of the business for resources such as CPU / GPU, so it is difficult to achieve fine-grained computing resource management.
[0081] Based on the above defects, the optional embodiment of the present application proposes a Kubernetes-based multi-heterogeneous computing resource computing power balanced scheduling strategy (equivalent to the method for determining the execution node in the above embodiment) for the situation where the heterogeneous resource requirements of pods in interactive computing depend on user applications. The strategy comprehensively schedules the CPU / GPU and other multi-heterogeneous computing power resource information to meet the fine-grained resource requirements of the pods to be scheduled (equivalent to the requirements of the pods to be scheduled in the above embodiment), and realizes resource scheduling in the case of mixed deployment of multi-heterogeneous resources by optimizing the filtering and scoring strategies of the default scheduler, so as to avoid unreasonable resource allocation caused by resource competition and improve the utilization of cluster resources.
[0082] In a Kubernetes cluster, the default scheduler is the Kube-scheduler component, which provides a scheduling framework. Its task is to filter nodes based on the resources expected by the pod (such as CPU, memory, GPU, etc.) and schedule them to specific nodes in the cluster. It can filter and score based on a variety of built-in algorithms, and supports developers to expand custom scheduling algorithms. It should be noted that Kube-scheduler: the full name is Kubernetes Scheduler, which is one of the core components of the Kubernetes project and is responsible for deciding which node (Node) to schedule the newly created Pod (containerized application instance) to run on.
[0083] The optional embodiment of the present application is based on the expansion of the Kube-scheduler component and proposes a fine-grained multi-heterogeneous resource scheduling strategy (equivalent to the requirements of the pod to be scheduled in the above embodiment). Under the multi-heterogeneous hybrid deployment of the cluster, the nodes that provide computing resources and the pods that apply for computing resources are divided into types according to the resource differentiation of the application and the differentiated resource types of the nodes: the nodes are divided into reduced instruction set computing (RISC) nodes and complex instruction set computing (CISC) nodes according to the supported CPU instruction set types; the pods to be scheduled are divided into reduced instruction set computing (RISC) and complex instruction set computing (CISC) pods according to the instruction set types corresponding to the pods to be scheduled.
[0084] Optionally, the steps for implementing the multi-heterogeneous computing power balanced scheduling algorithm in the embodiment of the present application are as follows:
[0085] Step 1: Build a list to save the following information of the pod to be scheduled (equivalent to the first information): CPU instruction set information of the pod to be scheduled (equivalent to the first instruction set type), resource requirement vector . And save the second information of each node (equivalent to multiple first nodes): the computing power performance of each node i (including ), the total resource vector and idle resource vector .
[0086] Step 2: According to the CPU instruction set and idle resource vector of the pod to be scheduled, call the filtering algorithm to screen each node, obtain the queue of nodes to be sorted (equivalent to the first queue in the above embodiment), and update the list.
[0087] Step 3: Call the scoring algorithm, traverse the nodes in the queue of nodes to be sorted, and calculate the scores of all nodes in the queue (equivalent to multiple second nodes) (equivalent to first score).
[0088] Step 4: Sort all node scores (equivalent to multiple first scores) and select the node with the highest score as the execution node for the pod to be scheduled.
[0089] Step 5: Repeat the above steps until all pods are scheduled to the execution nodes and the scheduler ends.
[0090] In the scheduler filtering stage, in addition to filtering the CPU resources, memory resources, etc. of the first node according to the requirements of the pod to be scheduled, the optional embodiment of the present application will also check the custom annotations of the pod to be scheduled to obtain the application of the pod to be scheduled for the CPU instruction type and GPU fine-grained resources, and perform node filtering by comparing the resources applied for by the pod (equivalent to the resource requirement vector in the requirements of the pod to be scheduled in the above embodiment) with the current available resources of the node (equivalent to the idle resource vector), and add the node that meets the user's requirements (i.e., the second node) to the schedulable list (i.e., the first queue).
[0091] The specific steps of implementing the filtering algorithm are as follows Figure 3 As shown, including:
[0092] Step S31: Record the CPU instruction set of the pod according to the custom annotation of the pod, and determine whether the pod is a reduced instruction set computing (RISC) or complex instruction set computing (CISC) node pod.
[0093] Step S32: Using the improved filtering strategy, based on NodeResourceFit, check whether the node CPU instruction set (i.e., the second instruction set type of the first node) meets the requirements of the pod, and whether the idle resources such as CPU, memory, GPU, etc. meet the requirements of the pod to be scheduled. If so, jump to step S33; if not, jump to step S34.
[0094] Step S33: the node satisfies the request of the pod to be scheduled, the current node is added to the available list, and the current filtering of the pod to be scheduled is completed.
[0095] Step S34: the node does not satisfy the request of the pod to be scheduled, the current node is ignored, and the current filtering of the pod to be scheduled ends.
[0096] Furthermore, in order to select the most suitable node according to the type of computing resources required by the pod (equivalent to the pod to be scheduled), the scheduler will further score the nodes that meet the requirements after filtering, and select the node with the highest score to bind to the pod. Due to the scarcity of GPU resources, scheduling is performed under the deployment of mixed computing resources. The main idea of the scoring strategy of the optional embodiment of the present application is to set priorities for nodes of multiple heterogeneous resources, and give priority to ensuring that CPU-type pods are scheduled to CPU nodes: when CPU node resources are insufficient, they can be scheduled to the idle CPU of the GPU node to improve cluster resource utilization; at the same time, it ensures that GPU applications give priority to the use of GPU nodes. In addition, the scoring strategy also takes into account the matching degree between application resource requirements and node resource characteristics, as well as the balance of cluster node resource usage.
[0097] Specifically, the specific execution steps of the scoring algorithm include:
[0098] Step S41: Define the score of the pod corresponding to node i (equivalent to each second node) Scored by node computing power performance , node and pod resource matching score , Node free resource ratio score The product of is obtained, see formula (1):
[0099] (1).
[0100] Step S42: Perform a preliminary weighted calculation on the performance of the second node example. First, calculate the third score of the i-th node (equivalent to the second node): ,in They represent the second computing speed of the node CPU, GPU (if node i does not have a GPU, then is 0) and the third computing speed and IO speed (equivalent to data reading and writing speed); it should be noted that The value is taken after normalization. is the weight, which can be set according to the pod application requirements and More specifically, They are the second weight, the third weight, and the fourth weight. The third score is normalized to get the first score ,therefore The value range is (0,1). See formula (2) for details:
[0101] ; (2).
[0102] Step S43: Calculate the matching score between the node and the pod resource to be scheduled based on the cosine similarity theory . Calculate the idle CPU resources on each node i , free memory resources , idle GPU resources , then the node idle resource vector . Calculate the CPU resources required for the pod to be scheduled , the memory resources required , the GPU resources required , then the pod resource demand vector Thus, we get the resource matching degree The score calculation formula is (3). Among them, The value range is (0,1). Ensure that the application and node resource types are highly matched.
[0103] ; (3).
[0104] Step S44: Calculate the free resource ratio score of node i , calculate the total CPU resources on each node i , total memory resources , total GPU resources , then the total resource vector of the node The calculation formula for the spare resource ratio score is shown in formula (4). , The value range is (0,1). Ensure that applications are scheduled to nodes with more idle resources first.
[0105] ; (4).
[0106] Step S45: Calculate the node score according to formula (1) .because The values are all (0, 1), so the product value is (0, 1). When the node GPU resources are not 0, The value is (0, 1); when the node GPU resource is 0, and according to Function properties, inference The value range is (1, 2). When the CPU node resources are sufficient, the priority of the CPU node is higher than that of the GPU node, that is, the CPU node score must be higher than the GPU node score.
[0107] Optionally, since the method of measuring the computing power of CPU, GPU, etc. in the optional embodiment of the present application has a large granularity, the application of the resource labeling system can be further deepened in the future to establish a more complete resource feature + model, so that the labeling system can more flexibly reflect resource characteristics and constraints, such as GPU models, versions, and feature differences, to help the scheduler make more fine-grained decisions.
[0108] In summary, the optional embodiments of the present application are aimed at the situation where the demand for multiple heterogeneous resources in complex computing scenarios of cloud computing depends on user applications, and propose a balanced scheduling strategy for multiple heterogeneous computing power. By optimizing the filtering and scoring strategies of the default scheduler, resource scheduling is achieved in the case of mixed deployment of multiple heterogeneous resources, so as to avoid unreasonable resource allocation caused by resource competition and improve the utilization rate of cluster resources. Specifically, the fine-grained scheduling strategy for CPU / GPU heterogeneous resources in the Kubernetes environment can carefully consider the distribution and hardware status of heterogeneous resources on the nodes, and meet the user's fine-grained requirements for CPU and GPU resources with different instruction sets. The strategy collects the CPU / GPU detailed information of each node through the device plug-in mechanism, and incorporates this information into the improved scheduling algorithm, thereby realizing refined management of resources.
[0109] Among them, the filtering and scoring strategies for the default scheduler include: 1) Added CPU and GPU resource information expansion and filtering mechanisms. On the basis of the original CPU and memory resource filtering, a custom CPU instruction set filtering mechanism and GPU information filtering mechanism are added to screen out nodes that meet user-specific needs. This ensures accurate matching of CPU types and GPU resources during the scheduling process and avoids resource waste. 2) Scheduling optimization under hybrid deployment. For CPU / GPU hybrid deployment scenarios, the scoring algorithm of the scheduler is improved. The innovation of the algorithm is to adjust the scoring formula to a resource matching algorithm based on cosine similarity and a performance product form, realizing dynamic perception of application types. This mechanism effectively utilizes the fragmented resources of GPU nodes when CPU resources are tight, improving the overall utilization of the cluster.
[0110] In this embodiment, a device for determining an execution node is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0111] Figure 4 is a structural block diagram of a device for determining an execution node according to an embodiment of the present application, such as Figure 4 As shown, the device comprises:
[0112] The acquisition module 42 is used to acquire first information of the pod to be scheduled, and to acquire second information of each first node among the multiple first nodes that are allowed to execute the pod to be scheduled, wherein the first information at least includes: a first instruction set type and a resource requirement vector of a central processing unit instruction set for executing the pod to be scheduled, and the second information at least includes: an idle resource vector; wherein the first information is used to indicate the requirement of the pod to be scheduled;
[0113] It can be understood that the pod to be scheduled is a pod that applies for computing resources, the multiple first nodes are nodes that provide computing resources, and the multiple first nodes may be determined as execution nodes of the pod to be scheduled.
[0114] The central processing unit instruction set, or CPU instruction set, is the bridge between computer hardware and software. It is a series of low-level commands understood and executed by the CPU to control the computer to perform various operations, such as mathematical operations, logical judgments, data movement, control flow control, etc. Instruction sets are broadly divided into two categories: Complex instruction set (CISC): provides a large number of multi-functional instructions, a single instruction completes complex operations, is conducive to coding, but has a long execution cycle. Such as the Intel x86 architecture. Reduced instruction set (RICS): Each instruction is simple and executes quickly. Multiple instructions complete complex tasks, which is conducive to parallelization and low power consumption. It is widely used by modern processors such as ARM, Intel's Atom, AMD's Zen, etc.
[0115] The instruction set types in the embodiments of the present application include: a complex instruction set (CISC) and a reduced instruction set (RICS). The first instruction set type may be a complex instruction set (CISC) or a reduced instruction set (RICS).
[0116] A screening module 44 is used to screen the multiple first nodes according to the first instruction set type and the idle resource vector to obtain a first queue, wherein the first queue includes multiple second nodes that meet the requirements of the pod to be scheduled;
[0117] A first determination module 46, configured to determine first scores respectively corresponding to a plurality of second nodes in the first queue according to the resource demand vector and the idle resource vector;
[0118] The second determination module 48 is configured to determine a second node corresponding to a highest first score among the plurality of first scores as an execution node of the pod to be scheduled.
[0119] Through the above device, the first information of the pod to be scheduled is obtained, and the second information of each first node among the multiple first nodes that are allowed to execute the pod to be scheduled is obtained, wherein the first information at least includes: a first instruction set type and a resource requirement vector of a central processing unit instruction set for executing the pod to be scheduled, and the second information at least includes: an idle resource vector; wherein the first information is used to indicate the requirements of the pod to be scheduled; the multiple first nodes are screened by the first instruction set type and the idle resource vector to obtain a first queue, wherein the first queue includes multiple second nodes that meet the requirements of the pod to be scheduled; the first scores corresponding to the multiple second nodes in the first queue are determined by the resource requirement vector and the idle resource vector; and the second node corresponding to the highest first score among the multiple first scores is determined as the execution node of the pod to be scheduled. That is, by screening the multiple first nodes, multiple second nodes that meet the requirements of the pod to be scheduled (including the requirements of the pod to be scheduled for the first instruction set type) are obtained; and by scoring the multiple second pods, the second node whose idle resource vector best matches the resource requirement vector of the pod to be scheduled (i.e., has the highest first score) is determined as the execution node of the pod to be scheduled. The technical effect of fine-grained resource (such as idle resource vectors, central processing unit instruction sets, i.e., complex instruction sets) scheduling management between the pod to be scheduled and multiple first nodes is achieved. Therefore, the problem that Kubernetes cannot achieve fine-grained scheduling management of heterogeneous resources in the prior art can be solved. It avoids unreasonable resource allocation caused by resource competition and improves the utilization rate of Kubernetes cluster resources.
[0120] In an exemplary embodiment, the screening module 44 is also used to: determine the second instruction set type of the central processing unit instruction set supported by each first node, wherein the second information also includes: the second instruction set type; determine a third instruction set type that is the same as the first instruction set type among multiple second instruction set types; determine a second queue through a third node corresponding to the third instruction set type among the multiple first nodes; and filter out the first queue from the second queue through the resource demand vector and the idle resource vector.
[0121] In an exemplary embodiment, the screening module 44 is further configured to: determine the plurality of second nodes in the second queue whose idle resource vectors satisfy the resource demand vector; and determine the plurality of second nodes as the first queue.
[0122] It is understandable that the second queue can be screened out by matching the multiple second instruction set types supported by the multiple first nodes with the first instruction set type. For example, the multiple second instruction set types supported by the multiple first nodes include complex instruction set (CISC) and reduced instruction set (RICS); if the first instruction set type required to execute the pod to be scheduled is a complex instruction set (CISC), then the third node among the multiple first nodes that supports the complex instruction set (CISC) is the node that matches the pod to be scheduled in terms of instruction set type. Furthermore, in the second queue, multiple second nodes whose idle resource vectors meet the resource demand vectors of the pod to be scheduled are continuously screened out to obtain the first queue.
[0123] Therefore, the embodiment of the present application can discard nodes that do not support the first instruction set type required by the pod to be scheduled from the multiple first nodes by matching the instruction set type of the pod to be scheduled with the multiple first nodes. In the subsequent resource scheduling process, it can be ensured that the pod to be scheduled will only be scheduled to the node that supports the first instruction set type for execution. Thus, the technical effect of reasonably scheduling computing resources for the pod to be scheduled is achieved at the instruction set type level.
[0124] Optionally, the first information obtained may also include first specific information of computing resources (i.e., resource demand vector) required by the pod to be scheduled; the second information obtained may also include: second specific information of idle resource vectors on each first node. It should be noted that the first specific information and the second specific information both include at least one of the following: CPU, GPU model, version, feature difference, etc.
[0125] Then, the first queue is selected from the second queue by using the resource demand vector and the idle resource vector, which can also be implemented by the following scheme:
[0126] Determine a plurality of fifth nodes in the second queue whose idle resource vectors satisfy the resource demand vector;
[0127] A plurality of second nodes whose second specific information is consistent with the first specific information of the pod to be scheduled are screened out from the plurality of fifth nodes to obtain a first queue.
[0128] Therefore, in the embodiment of the present application, the first specific information of the computing resources required by the pod to be scheduled is added during the screening process, so that the screening granularity of the screening process is finer, thereby making the screened multiple second nodes more compatible with the pod to be scheduled.
[0129] In an exemplary embodiment, the screening module 44 is further used for: a judgment step: extracting a fourth node from the multiple first nodes, and judging whether the fourth node meets the requirements of the pod to be scheduled through the first instruction set type and the idle resource vector, wherein the fourth node is any node among the multiple first nodes; a adding step: adding the fourth node to a preset queue when the fourth node meets the requirements of the pod to be scheduled; an updating step: updating the multiple first nodes by extracting multiple first nodes after the fourth node; and looping the judgment step, the adding step and the updating step until the multiple first nodes are all judged to obtain the first queue.
[0130] It can be understood that, in the process of screening multiple first nodes, for any node among the multiple first nodes, if the node meets the requirements of the pod to be scheduled, the node is added to the preset queue and discarded from the multiple first nodes; if the node does not meet the requirements of the pod to be scheduled, the node is discarded from the multiple first nodes. This process continues until all the multiple first nodes are judged and the first queue is obtained.
[0131] In an exemplary embodiment, the first determination module 46 is also used to: obtain a second score corresponding to each second node, and obtain a third score and a fourth score corresponding to each second node through the resource demand vector and the idle resource vector, wherein the second score is used to indicate the computing power performance score of each second node, the third score is used to indicate the resource matching score of each second node, and the fourth score is used to indicate the idle resource ratio score of each second node; the first score corresponding to each second node is calculated using the second score, the third score and the fourth score.
[0132] In an embodiment of the present application, the computing power performance score of each second node is calculated, and the resource matching score corresponding to each second node and the idle resource ratio score are calculated by the resource demand vector of the pod to be scheduled and the idle resource vector of each second node. Thus, the comprehensive score of each second node, i.e., the first score, is calculated by the computing power performance score, the resource matching score, and the idle resource ratio score. The first score is a score used to measure the matching degree of each second node domain with the pod to be scheduled. The higher the first score, the greater the possibility that the second node will be used as the execution node of the pod to be scheduled.
[0133] Therefore, the embodiment of the present application comprehensively determines the first score of each second node through the example performance score, resource matching score, and idle resource ratio score of each second node, and adopts a scoring strategy that comprehensively considers multiple aspects for each second node, so that the scoring of the second node is more accurate.
[0134] In an exemplary embodiment, the first determination module 46 is further used to: obtain a first computing speed of each second node, wherein the first computing speed includes at least one of the following: a second computing speed of a central processing unit on each second node, a third computing speed of a graphics processing unit on each second node, and a data reading and writing speed of each second node; and determine the second score by the first computing speed.
[0135] In an exemplary embodiment, the first determination module 46 is also used to: determine a first weight assigned to the first computing speed, wherein the first weight includes at least one of: a second weight assigned to the second computing speed, a third weight assigned to the third computing speed, and a fourth weight assigned to the data reading and writing speed, wherein the sum of the first weights is equal to the first value; determine the sum of the first product of the first computing speed and the first weight as the second score, wherein the first product includes at least one of: a second product of the second computing speed and the second weight, a third product of the third computing speed and the third weight, and a fourth product of the data reading and writing speed and the fourth weight.
[0136] In an exemplary embodiment, the first determination module 46 is further configured to: determine the sum of the first calculation speed and the first product of the first weight as a third score; and perform a normalization operation on the third score to obtain the second score.
[0137] In an exemplary embodiment, the first determination module 46 is further configured to: determine a cosine similarity between the resource demand vector and the idle resource vector; and determine the cosine similarity as the third score.
[0138] In an exemplary embodiment, the first determining module 46 is further configured to: obtain a total resource vector of each second node; and determine the fourth score by using the idle resource vector and the total resource vector.
[0139] In an exemplary embodiment, the first determination module 46 is further used to: determine whether the amount of graphics processor resources possessed by each second node is equal to a second value; when the amount of resources is not equal to the second value, calculate the fifth score through a first functional relationship to obtain the first score, wherein the fifth score includes: the second score, the third score and the fourth score; when the amount of resources is equal to the second value, calculate the fifth score through a second functional relationship to obtain the first score.
[0140] In an exemplary embodiment, the first determination module 46 is further configured to: determine a fifth product of the second score, the third score and the fourth score; and determine the fifth product as the first score.
[0141] In an exemplary embodiment, the first determination module 46 is further configured to: determine a fifth product of the second score, the third score and the fourth score; and perform an exponential operation on the fifth product and the third value to obtain the first score.
[0142] In an exemplary embodiment, the acquisition module 42 is further used to: when the second information is the idle resource vector, determine the idle central processing unit resources of each first node, determine the idle graphics processing unit resources of each first node, and determine the idle memory resources of each first node; and establish the idle resource vector through the idle central processing unit resources, the idle graphics processing unit resources, and the idle memory resources.
[0143] In an exemplary embodiment, the acquisition module 42 is further used to: when the first information is a resource requirement vector, determine the central processing unit resources required by the pod to be scheduled, determine the graphics processing unit resources required by the pod to be scheduled, and determine the memory resources required by the pod to be scheduled; and construct the resource requirement vector through the central processing unit resources, the graphics processing unit resources, and the memory resources.
[0144] In an exemplary embodiment, the acquisition module 42 is further used to: when the first information is the first instruction set type, obtain a custom annotation of the pod to be scheduled; obtain the instruction set supported by the pod to be scheduled from the custom annotation; and determine the first instruction set type through the instruction set situation.
[0145] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0146] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0147] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0148] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0149] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0150] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0151] An embodiment of the present application also provides a computer program, which includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the above method embodiments.
[0152] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0153] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0154] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for determining an execution node, characterized in that: include: Acquire first information of a pod to be scheduled, and acquire second information of each first node among a plurality of first nodes that are allowed to execute the pod to be scheduled, wherein the first information at least includes: a first instruction set type and a resource requirement vector of a central processing unit instruction set for executing the pod to be scheduled, and the second information at least includes: an idle resource vector; wherein the first information is used to indicate the requirement of the pod to be scheduled; The plurality of first nodes are screened by using the first instruction set type and the idle resource vector to obtain a first queue, wherein the first queue includes a plurality of second nodes that meet the requirements of the pod to be scheduled; Determine first scores respectively corresponding to a plurality of second nodes in the first queue by using the resource demand vector and the idle resource vector; The second node corresponding to the highest first score among the plurality of first scores is determined as the execution node of the pod to be scheduled, wherein: Determining first scores corresponding to multiple second nodes in the first queue respectively through the resource requirement vector and the idle resource vector, including: obtaining a second score corresponding to each second node, and obtaining a third score and a fourth score corresponding to each second node through the resource requirement vector and the idle resource vector, wherein the second score is used to indicate a computing power performance score of each second node, the third score is used to indicate a resource matching score of each second node, and the fourth score is used to indicate a free resource ratio score of each second node; calculating the first score corresponding to each second node through the second score, the third score and the fourth score, wherein, Obtaining a second score corresponding to each second node includes: obtaining a first computing speed of each second node, wherein the first computing speed includes at least one of the following: a second computing speed of a central processing unit on each second node, a third computing speed of a graphics processing unit on each second node, and a data reading and writing speed of each second node; determining the second score by the first computing speed, wherein, Obtaining the third score corresponding to each second node through the resource demand vector and the idle resource vector includes: determining the cosine similarity between the resource demand vector and the idle resource vector; and determining the cosine similarity as the third score, wherein: Obtaining the fourth score corresponding to each second node through the resource demand vector and the idle resource vector includes: obtaining the total resource vector of each second node; determining the fourth score through the idle resource vector and the total resource vector, wherein: Calculating the first score corresponding to each second node by using the second score, the third score and the fourth score includes: determining whether the resource amount of the graphics processor resources of each second node is equal to a second value; when the resource amount is not equal to the second value, calculating the fifth score by using a first functional relationship to obtain the first score, wherein the fifth score includes: the second score, the third score and the fourth score; when the resource amount is equal to the second value, calculating the fifth score by using a second functional relationship to obtain the first score.
2. The method according to claim 1, characterized in that: The plurality of first nodes are screened by using the first instruction set type and the idle resource vector to obtain a first queue, including: Determine a second instruction set type of a central processing unit instruction set supported by each first node, wherein the second information further includes: the second instruction set type; determining a third instruction set type that is the same as the first instruction set type among the plurality of the second instruction set types; Determine a second queue by using a third node corresponding to the third instruction set type among the plurality of first nodes; The first queue is selected from the second queue by using the resource demand vector and the idle resource vector.
3. The method according to claim 2, characterized in that Filtering the first queue from the second queue by using the resource requirement vector and the idle resource vector includes: Determine the plurality of second nodes in the second queue whose idle resource vectors satisfy the resource demand vector; The plurality of second nodes are determined as the first queue.
4. The method according to claim 1, characterized in that: The plurality of first nodes are screened by using the first instruction set type and the idle resource vector to obtain a first queue, including: Determination step: extracting a fourth node from the multiple first nodes, and determining whether the fourth node meets the requirements of the pod to be scheduled through the first instruction set type and the idle resource vector, wherein the fourth node is any node among the multiple first nodes; Adding step: when the fourth node meets the requirements of the pod to be scheduled, adding the fourth node to a preset queue; Updating step: updating the plurality of first nodes by extracting the plurality of first nodes after the fourth node; The judging step, the adding step and the updating step are executed in a loop until all the multiple first nodes are judged, thereby obtaining the first queue.
5. The method according to claim 1, characterized in that Determining the second score according to the first calculation speed includes: Determine a first weight assigned to the first computing speed, wherein the first weight includes at least one of the following: a second weight assigned to the second computing speed, a third weight assigned to the third computing speed, and a fourth weight assigned to the data reading and writing speed, wherein the sum of the first weights is equal to the first value; The sum of a first product of the first computing speed and the first weight is determined as the second score, wherein the first product includes at least one of: a second product of the second computing speed and the second weight, a third product of the third computing speed and the third weight, and a fourth product of the data reading and writing speed and the fourth weight.
6. The method according to claim 5, characterized in that Determining a sum of a first product of the first calculation speed and the first weight as the second score includes: A normalization operation is performed on the sum of the first calculation speed and the first product of the first weight to obtain the second score.
7. The method according to claim 1, characterized in that Calculating the fifth score by using a first functional relationship to obtain the first score includes: determining a fifth product of the second score, the third score, and the fourth score; The fifth product is determined as the first score.
8. The method according to claim 1, characterized in that Calculating the fifth score by using a second functional relationship to obtain the first score includes: determining a fifth product of the second score, the third score, and the fourth score; An exponential operation is performed on the fifth product and the third value to obtain the first score.
9. The method according to claim 1, characterized in that: Obtaining second information of each first node among a plurality of first nodes that are allowed to execute the pod to be scheduled, including: In the case where the second information is the idle resource vector, determining the idle central processing unit resources of each of the first nodes, determining the idle graphics processing unit resources of each of the first nodes, and determining the idle memory resources of each of the first nodes; The idle resource vector is established by the idle CPU resources, the idle GPU resources, and the idle memory resources.
10. The method according to claim 1, characterized in that Obtaining first information of the pod to be scheduled includes: In the case where the first information is a resource requirement vector, determining the central processing unit resources required by the pod to be scheduled, determining the graphics processing unit resources required by the pod to be scheduled, and determining the memory resources required by the pod to be scheduled; The resource requirement vector is constructed by using the central processing unit resources, the graphics processing unit resources, and the memory resources.
11. The method according to claim 1, characterized in that: Obtaining first information of the pod to be scheduled includes: When the first information is the first instruction set type, obtaining a custom annotation of the pod to be scheduled; Obtaining the instruction set supported by the pod to be scheduled from the custom annotation; The first instruction set type is determined according to the instruction set situation.
12. A device for determining an execution node, characterized in that: include: an acquisition module, configured to acquire first information of a pod to be scheduled, and to acquire second information of each first node among a plurality of first nodes that are allowed to execute the pod to be scheduled, wherein the first information at least includes: a first instruction set type and a resource requirement vector of a central processing unit instruction set for executing the pod to be scheduled, and the second information at least includes: an idle resource vector; wherein the first information is used to indicate the requirement of the pod to be scheduled; A screening module, configured to screen the plurality of first nodes by using the first instruction set type and the idle resource vector to obtain a first queue, wherein the first queue includes a plurality of second nodes that meet the requirements of the pod to be scheduled; A first determination module, configured to determine first scores respectively corresponding to a plurality of second nodes in the first queue according to the resource demand vector and the idle resource vector; The second determination module is used to determine the second node corresponding to the highest first score among the multiple first scores as the execution node of the pod to be scheduled, wherein: The first determination module is further used to obtain a second score corresponding to each second node, and to obtain a third score and a fourth score corresponding to each second node through the resource demand vector and the idle resource vector, wherein the second score is used to indicate the computing power performance score of each second node, the third score is used to indicate the resource matching score of each second node, and the fourth score is used to indicate the idle resource ratio score of each second node; the first score corresponding to each second node is calculated through the second score, the third score and the fourth score, wherein, The first determination module is further used to obtain a first computing speed of each second node, wherein the first computing speed includes at least one of the following: a second computing speed of a central processing unit on each second node, a third computing speed of a graphics processing unit on each second node, and a data reading and writing speed of each second node; the second score is determined by the first computing speed, wherein, The first determination module is further used to determine the cosine similarity between the resource demand vector and the idle resource vector; determine the cosine similarity as the third score, wherein the first determination module is further used to obtain the total resource vector of each second node; determine the fourth score by the idle resource vector and the total resource vector, wherein, The first determination module is further used to determine whether the resource amount of the graphics processor resources possessed by each second node is equal to a second value; when the resource amount is not equal to the second value, the fifth score is calculated through a first functional relationship to obtain the first score, wherein the fifth score includes: the second score, the third score and the fourth score; when the resource amount is equal to the second value, the fifth score is calculated through a second functional relationship to obtain the first score.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 11 when executed by a processor.
14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 11 are implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 11 are implemented.
Citation Information
Patent Citations
Heterogeneous CPU scheduling method, device, equipment and medium
CN114756374A
Traffic distribution method and device, computer equipment and storage medium
CN116708303A