Resource scheduling method, node, device, medium, and program product

The virtual node receives computing tasks in the container cluster and formats resource indication information, which solves the problem of reusing Kubernetes cluster resources in the existing technology, achieves efficient utilization of idle resources, and avoids intrusive modifications to the control node code. .

WO2024222204A1PCT designated stage expired Publication Date: 2024-10-31TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/079856
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-28
Filing Date
2024-03-04
Publication Date
2024-10-31

AI Technical Summary

Technical Problem

When existing technology reuses idle resources in the container cluster management system Kubernetes, it is necessary to modify the native code of the control node, which makes the code more intrusive and makes it difficult to effectively utilize idle resources.

Method used

Through the cooperation of virtual nodes and scheduling nodes, the virtual nodes are used to receive computing tasks and format the resource indication information according to the field format of the idle resources to generate second computing tasks that can be used for scheduling, avoiding modification of the native code of the control node, and realizing Reuse of idle resources.

Benefits of technology

Without modifying the native code of the control node, the utilization of cluster resources is improved and efficient reuse of idle resources is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024079856_31102024_PF_FP_ABST
    Figure CN2024079856_31102024_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses a resource scheduling method, a node, a device, a medium, and a program product. The configurable resources of a virtual node are determined from the idle resources of at least one computing node. The method comprises: receiving a first computing task from a scheduling node, the first computing task comprising resource indication information; if in accordance with configurable resources it is determined that at least one computing node comprises a target computing node satisfying the resource indication information, then according to the field format of an idle resource, converting the format of the resource indication information in the first computing task, obtaining a second computing task; and sending the second computing task to the scheduling node, the second computing task being used for instructing the scheduling node to execute a second computing task on the basis of the target computing node.
Need to check novelty before this filing date? Find Prior Art

Description

Resource scheduling method, node, device, medium and program product

[0001] This application claims priority to Chinese patent application number "202310488044.2", filed on April 28, 2023, entitled "Resource Scheduling Method, Node, Device, Medium and Program Product", and the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of computer technology, and in particular to a resource scheduling method, node, device, medium and program product. Background Art

[0003] Kubernetes (K8s) is a container-based cluster management platform. Multiple computing nodes are deployed in the cluster managed by K8s. However, computing nodes always have some idle resources due to fragmentation and low load. Therefore, how to reuse these idle resources has become an urgent problem to be solved.

[0004] Since most businesses require a control node Operator to start computing tasks, existing technologies require modifying the native code of the control node when reusing idle resources to convert the data format of native resources in business computing tasks to the data format of idle resources, resulting in a high degree of intrusion into the code.

[0005] Summary of the Invention

[0006] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a resource scheduling method, node, device, medium and program product that can avoid invasive modifications to the native code of the control node.

[0007] In the first aspect, the present application provides a resource scheduling method, which is applied to a virtual node, and the configurable resources of the virtual node are determined by the idle resources of at least one computing node. The method includes: receiving a first computing task from a scheduling node, the first computing task including resource indication information, and the resource indication information is used to characterize the amount of computing resources required to execute the first computing task; if, based on the configurable resources, it is determined that there is a target computing node in at least one computing node that meets the resource indication information, then the resource indication information in the first computing task is formatted according to the field format of the idle resources to obtain a second computing task; and the second computing task is sent to the scheduling node, and the second computing task is used to instruct the scheduling node to execute the second computing task based on the target computing node.

[0008] In a second aspect, the present application provides another resource scheduling method, which is applied to a scheduling node, and the method includes: sending a first computing task to a virtual node; the first computing task includes resource indication information, and the resource indication information is used to characterize the amount of computing resources required to execute the first computing task; the first computing task is used to instruct the virtual node to determine, based on configurable resources, that there is a target computing node in at least one computing node that meets the resource indication information, and convert the resource indication information in the first computing task according to the resource format of idle resources to obtain a second computing task; the configurable resources of the virtual node are determined by the idle resources of at least one computing node; receiving the second computing task from the virtual node; and executing the second computing task based on the target computing node.

[0009] In a third aspect, the present application provides a virtual node, wherein configurable resources of the virtual node are determined by idle resources of at least one computing node, and the virtual node includes:

[0010] The receiving module is used to receive a first computing task from a scheduling node, where the first computing task includes resource indication information, and the resource indication information is used to represent the amount of computing resources required to execute the first computing task.

[0011] The format conversion module is used to convert the resource indication information in the first computing task according to the field format of the idle resources to obtain the second computing task if it is determined based on the configurable resources that there is a target computing node in at least one computing node that meets the resource indication information.

[0012] The sending module is used to send the second computing task to the scheduling node, where the second computing task is used to instruct the scheduling node to execute the second computing task based on the target computing node.

[0013] In a fourth aspect, the present application provides a scheduling node, which includes:

[0014] A sending module is used to send a first computing task to a virtual node; the first computing task includes resource indication information, and the resource indication information is used to represent the amount of computing resources required to execute the first computing task; the first computing task is used to instruct the virtual node to determine, based on configurable resources, that there is a target computing node in at least one computing node that meets the resource indication information, and to convert the resource indication information in the first computing task into a format according to the resource format of idle resources to obtain a second computing task; the configurable resources of the virtual node are determined by the idle resources of at least one computing node.

[0015] The receiving module is used to receive the second computing task from the virtual node.

[0016] The scheduling module is used to execute the second computing task based on the target computing node.

[0017] In a fifth aspect, an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the embodiment of the present application when executing the program.

[0018] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, which, when executed by a processor, implements the method described in the embodiment of the present application.

[0019] In a seventh aspect, an embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed, the method described in the embodiment of the present application is executed.

[0020] The resource scheduling method, node, device, medium, and program product proposed in this application can be applied to virtual nodes. The configurable resources in a virtual node are determined based on the idle resources of at least one computing node, thereby aggregating the idle resources of at least one computing node. The configurable resources of a virtual node can represent all the idle computing power of these computing nodes. Once a virtual node has configurable resources, it can receive computing tasks, such as a first computing task, under these configurable resources. After receiving the first computing task, the virtual node can determine, based on the configurable resources, whether a target computing node that meets the resource indication information exists in at least one computing node, since the first computing task includes resource indication information representing the amount of computing resources required to execute the first computing task. If so, since the data format of the idle resources differs from the data format of the resource indication information in the first computing task, the data format of the resource indication information needs to be converted to obtain the idle resources in the computing node. Specifically, the resource indication information in the first computing task is converted to obtain the second computing task based on the field format of the idle resources. Therefore, when determining that at least one computing node has resource indication information that satisfies the requirements, the present application does not require a control node to convert the format of the resource indication information in the computing task. Instead, it utilizes a virtual node to implement this, thus avoiding intrusive modifications to the native code of the control node. Subsequently, the generated second computing task is sent to the scheduling node, instructing the scheduling node to execute the second computing task based on the target computing node. This allows for the reuse of idle resources without intrusive modifications to the native code, thereby improving cluster resource utilization at a lower cost.

[0021] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Other features, objects and advantages of the present application will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0023] FIG1 is a schematic diagram of the structure of a resource scheduling system provided in an embodiment of the present application;

[0024] FIG2 is a schematic diagram of a flow chart of a resource scheduling method provided in an embodiment of the present application;

[0025] FIG3 is a schematic diagram of the structure of a virtual node provided in an embodiment of the present application;

[0026] FIG4 is a schematic diagram of the distribution of total resources of a computing node provided in an embodiment of the present application;

[0027] FIG5 is a schematic diagram showing the effect of a virtual node deployment scenario provided by an embodiment of the present application;

[0028] FIG6 is a flow chart of another resource scheduling method provided in an embodiment of the present application;

[0029] FIG7 is a flow chart of another resource scheduling method provided in an embodiment of the present application;

[0030] FIG8 is a schematic diagram of the structure of a virtual node provided in an embodiment of the present application;

[0031] FIG9 is a schematic diagram of the structure of a scheduling node provided in an embodiment of the present application;

[0032] FIG10 is a schematic structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] The present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the relevant invention and are not intended to limit the invention. It should also be noted that, for ease of description, only portions relevant to the invention are shown in the accompanying drawings.

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

[0035] The following is an introduction to some concepts involved in the embodiments of this application.

[0036] 1. Application Programming Interface Services

[0037] The API Server provides a Resource Representational State Transfer (HTTP REST) ​​interface for adding, deleting, modifying, querying, and retrieving various Kubernetes resource objects. It serves as the data bus and data center for the entire system. The API Server's functions include: (1) providing a RestAPI (Application Programming Interface) interface for cluster management (including authentication and authorization, data validation, and cluster state changes); (2) providing a hub for data interaction and communication between other modules (other modules query or modify data through the API Server); (3) serving as the entry point for resource quota control; and (4) possessing a comprehensive cluster security mechanism.

[0038] 2. Application Controller

[0039] The application controller (Operator), also known as the control node in the embodiments of this application, is used to extend the Kubernetes API and create, configure, and manage complex stateful applications such as databases and caches. Operators are built on Kubernetes' resource and controller concepts, but also incorporate application-specific domain knowledge.

[0040] 3. pod

[0041] Pod is equivalent to a logical host, and each pod has its own IP address. The containers in the pod share the same IP and port space. By default, the file system of each container is completely isolated from other containers. Therefore, pod can also be understood as: a container group, and at the same time, pod is equivalent to a logical host. A pod contains a group of containers, and a pod will not span multiple working nodes. The purpose of Pod is to provide process isolation for the service. The container mapped to the Service can be run in an independent Pod. Each Pod runs a basic container (that is, the Pause container), and the other containers are business containers. These business containers share the network stack and volume mount volume of the Pause container. The container in a Pod can communicate directly with the Pod container on another host. In order to establish an association between the Service and the Pod, Kubernetes attaches a label (Label) to each Pod, and the Service also defines a label selector (Label elector) to find the Pod with the corresponding label through the Service's label selector.

[0042] 4. Compute Node

[0043] A compute node is a container runtime environment, typically Docker (an alternative to Docker is rkt), and runs a Kubernetes agent (kubelet) for communication with the master. Compute nodes also run additional components, such as logging and service discovery. Compute nodes are the actual working nodes in a Kubernetes cluster.

[0044] At present, most businesses require control nodes to start computing tasks. When the existing technology reuses idle resources, the field format of the resource indication information in the computing task is different from the field format used by the idle resources in the computing node. If the idle resources in the computing node need to be used, the field format of the resource indication information in the computing task needs to be modified to the field format used by the idle resources. However, using the control node to modify the field format requires modifying the native code of the control node, which is more invasive to the code.

[0045] Based on this, the embodiment of the present application provides a resource scheduling method, node, device, medium and program product, which realizes the reuse of idle resources of computing nodes in a cluster by coordinating scheduling between scheduling nodes and virtual nodes. First, the virtual node obtains the idle resources of at least one computing node and converts the field format of the idle resources according to the field format of the configurable resources to obtain the configurable resources of the virtual node. The configurable resources are reported to the scheduling node so that the scheduling node can include the virtual node in the schedulable nodes when it needs to schedule the computing task later. Afterwards, when it is necessary to schedule the computing task (such as the first computing task), the computing task is scheduled to the virtual node based on the configurable resources. The virtual node determines whether there is a target computing node in the at least one computing node that meets the resource indication information based on the resource indication information and configurable resources included in the computing task for characterizing the amount of computing resources required to execute it. If so, the resource indication information in the computing task is formatted according to the field format of the idle resources, and the converted computing task is sent to the scheduling node so that the scheduling node can execute the second computing task based on the target computing node.

[0046] The solution provided in the embodiment of the present application can be applied to a multi-cluster platform with a mixed online and offline deployment, and can also be applied to a single-cluster platform with a separate online or offline deployment.

[0047] Refer to Figure 1, which is a schematic diagram of an application scenario of a resource scheduling system provided in an embodiment of the present application. In this scenario, it includes a terminal device 101, a scheduling node 102, a computing node 103, and a virtual node 104. Generally speaking, the number of computing nodes 103 is relatively large, see computing nodes 103-1 to computing nodes 103-n shown in Figure 1. Virtual nodes 104 and computing nodes 103 can be deployed in the same cluster or in different clusters. It should be noted that Figure 1 shows that virtual nodes 104 and computing nodes 103 are deployed in the same cluster.

[0048] It can be understood that the cluster where the virtual node 104 is deployed is determined by the cluster where the business that the virtual node 104 needs to execute is located and the cluster where the acquired computing node 103 is located.

[0049] Generally, in a single-cluster scenario, virtual node 104 and compute node 103 are deployed in the same cluster. However, in a multi-cluster scenario with a hybrid online and offline deployment, based on the existing online and offline business computing workload, the offline business computing workload is often greater than the online business computing workload. Therefore, virtual node 104 is generally deployed in an offline cluster to count the idle resources of the online cluster that virtual node 104 can access and enable offline business to use the idle resources in the online cluster.

[0050] The terminal device 101 may be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited thereto. The terminal device 101 may open a page of a multi-cluster platform or a single-cluster platform corresponding to the scheduling node 102, for example, by opening the corresponding page through a browser or client. The user may submit their own computing task (i.e., computing task) on the page. The computing task may be an online computing task or an offline computing task.

[0051] The scheduling node 102 can be the management end of a multi-cluster platform or a single-cluster platform, and the computing node 103 is the task execution end of a multi-cluster platform or a single-cluster platform. The scheduling node 102, the computing node 103 and the virtual node 104 can all be implemented by a server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDNs), and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application does not limit this.

[0052] Exemplarily, the virtual node 104 counts the idle resources of at least one computing node 103 and converts the format of the idle resources to obtain configurable resources. The configurable resources are reported to the scheduling node 102. Afterwards, when the user submits a computing task (i.e., pod) on the terminal device 101, the scheduling node 102 can determine the corresponding computing node 103 for the computing task based on the load balancing strategy. If there is no corresponding computing node 103 that can execute the computing task, and the configurable resources in the virtual node 104 meet the computing resource requirements of the computing task, the scheduling node 102 schedules the computing task to the virtual node 104. When the virtual node 104 determines that there is a target computing node that meets the resource indication information in at least one computing node 103 based on the resource indication information and configurable resources in the computing task, it converts the resource indication information in the computing task into a format according to the field format of the restricted resources, and sends the converted computing task to the scheduling node 102, which executes the second computing task based on the target computing node.

[0053] In a possible application scenario, the cluster platform in the embodiment of the present application can generally adopt the form of a cloud platform, which is an architecture platform built based on cloud technology. Cloud technology (Cloudtethnology) refers to a hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to realize the calculation, storage, processing and sharing of data. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. applied in the cloud computing (cloud computing) business model. It can form a resource pool that can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.

[0054] The following will be combined with Figure 1 to describe in detail the technical solution of this application and how the technical solution of this application solves the above technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0055] As shown in FIG2 , an embodiment of the present application provides a resource scheduling method, which can be applied to the virtual node 104 shown in FIG1 . The configurable resources of the virtual node are determined by the idle resources of at least one computing node. The method specifically includes the following steps:

[0056] 201. Receive a first computing task from a scheduling node, where the first computing task includes resource indication information, where the resource indication information is used to represent an amount of computing resources required to execute the first computing task.

[0057] Optionally, idle resources on a compute node include both unallocated compute resources and allocated but unused compute resources. Computing tasks submitted to the Kubernetes cluster platform are called pods. Unallocated compute resources are resources that have not been declared in a pod, while allocated but unused compute resources are resources that have been declared in a pod but are not actually used.

[0058] In this embodiment, the resource indication information includes but is not limited to: a central processing unit (CPU) requirement, a memory (Mem) requirement, and the like.

[0059] Optionally, the amount of computing resources required to execute the first computing task is within the range of configurable resources of the virtual node. The configurable resources of the virtual node are the total amount of idle resources of at least one computing node. Specifically, the virtual node obtains the idle resources of each of the at least one computing node and sums the idle resources of each computing node to obtain the configurable resources of the virtual node.

[0060] It can be understood that the first computing task may be an online computing task or an offline computing task, and the corresponding virtual node is used to receive the online computing task or the offline computing task.

[0061] In the embodiments of the present application, both online and offline computing tasks are submitted through the cluster platform. Therefore, it is necessary to distinguish between online and offline computing tasks. To do so, users can be provided with the option of online or offline computing tasks. Based on the user's selection, the computing tasks submitted by the user are assigned corresponding type tags. Specifically, when a user selects an offline computing task, the submitted computing task is assigned the type tag corresponding to the offline computing task; and when a user selects an online computing task, the submitted computing task is assigned the type tag corresponding to the online computing task.

[0062] In a possible implementation, since task attributes generally include only online computing tasks and offline computing tasks, only offline computing tasks may be marked, and when no type tag is added, the task is an online computing task.

[0063] Specifically, when the cluster platform is a Kubernetes cluster platform, you can use the label function of the Kubernetes cluster platform. Computing tasks submitted to the Kubernetes cluster platform are called pods, and each pod can be marked with a custom annotation to display different attributes. Therefore, you can add a special annotation to an offline computing task, and then use this annotation to distinguish whether the task is an offline computing task.

[0064] 202. If it is determined based on the configurable resources that there is a target computing node in at least one computing node that meets the resource indication information, the resource indication information in the first computing task is formatted according to the field format of the idle resources to obtain a second computing task.

[0065] Optionally, the target computing node may be a computing node executing the first computing task, that is, a scheduling target computing node for the first computing task, where the target computing node is unique and is the final execution node of the first computing task determined by the virtual node.

[0066] In actual applications, when the target computing node is the final execution node of the first computing task, the virtual node needs to add the relevant identifier of the target computing node to the second computing task, so that when instructing the scheduling node to schedule the second computing task, it can be scheduled directly according to the identifier of the target computing node carried in the second computing task.

[0067] Optionally, the target computing node may be a computing node that satisfies the requirements for executing the first computing task. The target computing node here may not be unique; any computing node that satisfies the requirements for executing the first computing task may be the target computing node. The target computing node is a computing node determined by the virtual node from at least one computing node that can execute the first computing task, and is not the final execution node for the first computing task.

[0068] In one implementation, since configurable resources are determined by the idle resources of at least one computing node, the virtual node must be aware of the idle resources of each computing node. Configurable resources may include configurable sub-resources corresponding to the idle resources of each computing node. Based on the configurable sub-resources corresponding to the idle resources of the computing node, it is determined whether the computing node meets the resource indication information; if so, the computing node can be determined as the target computing node. In this implementation, if there are multiple computing nodes in at least one computing node whose corresponding configurable sub-resources all meet the resource indication information, there can be multiple target computing nodes.

[0069] In another implementation, whether the computing node satisfies the resource indication information is determined based on the configurable sub-resources corresponding to the idle resources of the computing node, and a target computing node is determined from among the computing nodes that satisfy the resource indication information. In this implementation, the target computing node is one of the computing nodes that satisfy the resource indication information.

[0070] As an example, for the above implementation, if there is only one computing node that meets the resource indication information for at least one computing node, then the computing node is the target computing node.

[0071] As another example, if there are multiple computing nodes in at least one computing node that meet the resource indication information, one of the multiple computing nodes that meet the resource indication information can be randomly selected as the target computing node; alternatively, the ratio of idle resources to used resources of the computing nodes can be determined, and the multiple computing nodes that meet the resource indication information can be sorted according to the ratio, and the computing node with the largest ratio can be selected as the target computing node; alternatively, the computing node with the largest idle resources can be selected as the target computing node from the multiple computing nodes that meet the resource indication information. If there is more than one computing node with the largest idle resources, one of the computing nodes with the largest idle resources can be randomly selected as the target computing node.

[0072] In practice, if resources include both CPU and memory requirements, the idle resource code formats are gocrane.io / cpu and gocrane.io / mem, while the resource indication fields are in the format of cpu and mem. Therefore, in order to use the target compute node to execute the second computing task, cpu and mem need to be converted to gocrane.io / cpu and gocrane.io / mem.

[0073] It is understood that the current resource indication information may include both CPU demand and memory demand, but this embodiment of the present application does not involve this. In addition, the idle resource field format is not limited to gocrane.io / cpu and gocrane.io / mem; the resource format in the resource indication information is not limited to cpu and mem.

[0074] 203. Send a second computing task to the scheduling node, where the second computing task is used to instruct the scheduling node to execute the second computing task based on the target computing node.

[0075] Optionally, the second computing task may include the identifier of the target computing node, or may not include the identifier of the target computing node.

[0076] In one implementation, when the second computing task includes the identifier of the target computing node, there may be two cases:

[0077] Case 1: The target computing node is the computing node that ultimately executes the second computing task. The scheduling node only needs to schedule the second computing task to the target computing node according to the identifier of the target computing node.

[0078] Case 2: The target computing node is a computing node among at least one computing node that meets the resource indication information. If there is only one target computing node, the target computing node will be used as the computing node that ultimately executes the second computing task, and the scheduling node will schedule the second computing task to the target computing node according to the identifier of the target computing node; if there is more than one target computing node, the scheduling node will select one of these target computing nodes as the computing node that ultimately executes the second computing task, and schedule the second computing task to the selected target computing node.

[0079] In another implementation, when the second computing task does not include the identifier of the target computing node, for example, the field corresponding to the node identifier in the second computing task is empty, the following two situations may be included:

[0080] In the first scenario, the scheduling node obtains idle resources from at least one computing node and, based on the idle resources of each computing node, determines a computing node from the at least one computing node that satisfies the resource indication information. A target computing node for executing the second computing task is determined from among the computing nodes that satisfy the resource indication information, and the second computing task is scheduled to the target computing node.

[0081] In the second scenario, the scheduling node obtains idle resources from at least one computing node and, based on the idle resources of each computing node, determines a target computing node from the at least one computing node that satisfies the resource indication information. The scheduling node determines a computing node from the target computing node for executing the second computing task and schedules the second computing task to the computing node.

[0082] Based on the above two implementations, it can be understood that the computing node ultimately used to execute the second computing task can be determined by the virtual node, and the identifier of the computing node can be annotated in the second computing task to instruct the scheduling node to schedule the second computing task based on the identifier of the computing node in the second computing task. The scheduling node can be determined by the scheduling node, and the method of determining the scheduling node can include: if the second computing task contains the identifiers of one or more computing nodes, the scheduling node selects from the one or more computing nodes; or if the second computing task does not contain the identifier of the computing node, the scheduling node independently obtains the idle resources of at least one computing node and determines the computing node ultimately used to execute the second computing task based on the idle resources of these computing nodes.

[0083] Optionally, when the target computing node is not unique, the second computing task is specifically used to instruct the scheduling node to determine a computing node in the target computing node that executes the second computing task based on idle resources of the target computing node.

[0084] As an example, when the scheduling node receives the second computing task, if the second computing task contains node information of multiple target computing nodes, then for each target computing node, the idle resources of the target computing node are determined based on the node information of the target computing node, and based on each target computing node, a computing node for executing the second computing task is determined from multiple target computing nodes.

[0085] As another example, when the scheduling node receives the second computing task, if the second computing task does not contain any node information of the target computing node, the scheduling node obtains the idle resources of at least one computing node, and determines at least one target computing node based on the idle resources of each computing node; and then determines the computing node used to execute the second computing task among the at least one target computing node.

[0086] Optionally, when the target computing node is not unique, the second computing task is specifically used to instruct the scheduling node to determine a computing node in the target computing node that executes the second computing task based on idle resources of the computing nodes.

[0087] As an example, when the scheduling node receives the second computing task, if the second computing task does not contain any node information of the target computing node, the scheduling node obtains the idle resources of at least one computing node and directly determines the computing node used to execute the second computing task based on the idle resources of each computing node.

[0088] The resource scheduling method proposed in the embodiment of the present application can be applied to a virtual node. The configurable resources in the virtual node are determined by the idle resources of at least one computing node, thereby realizing the aggregation of the idle resources of at least one computing node. The configurable resources of a virtual node can represent all the idle computing power of these computing nodes. When the virtual node has configurable resources, it can receive computing tasks, such as the first computing task, under the configurable resources. After receiving the first computing task, since the first computing task includes resource indication information for characterizing the amount of computing resources required to execute the first computing task, the virtual node can determine whether there is a target computing node that meets the resource indication information in at least one computing node based on the configurable resources. If so, since the data format of the idle resources is different from the data format of the resource indication information in the first computing task, considering that the idle resources in the computing node are to be used, the data format of the resource indication information needs to be formatted. Specifically, the resource indication information in the first computing task is formatted according to the field format of the idle resources, thereby obtaining the second computing task. Therefore, when determining that at least one computing node has resource indication information that satisfies the requirements, the present application does not require a control node to convert the format of the resource indication information in the computing task. Instead, it utilizes a virtual node to implement this, thus avoiding intrusive modifications to the native code of the control node. Subsequently, the generated second computing task is sent to the scheduling node, instructing the scheduling node to execute the second computing task based on the target computing node. This allows for the reuse of idle resources without intrusive modifications to the native code, thereby improving cluster resource utilization at a lower cost.

[0089] In one embodiment of the present application, applied to a virtual node, the virtual node can determine a computing node for executing a second computing task in at least one computing node. Therefore, if, based on configurable resources, it is determined that there is a target computing node that meets the resource indication information in at least one computing node, then the resource indication information in the first computing task is converted into a format according to the field format of the idle resource. Specifically, it includes: if, based on configurable resources, a computing node that meets the resource indication information in at least one computing node is determined; among the computing nodes that meet the resource indication information, the target computing node is determined; the resource indication information in the first computing task is converted into a format according to the field format of the idle resource, and the node information in the first computing task is generated according to the node information of the target computing node to obtain the second computing task; the second computing task is specifically used to instruct the scheduling node to execute the second computing task based on the node information of the target computing node contained in the second computing task.

[0090] The target computing node in this embodiment is the computing node that ultimately executes the second computing task.

[0091] Optionally, the node information of the computing node is used to identify the computing node, and the node information includes an identifier of the computing node. The node information included in the second computing task is the node information of the target computing node.

[0092] In one implementation, if the second computing task includes node information for a target computing node, the target computing node is the computing node that executes the second computing task. If the second computing task includes node information for more than one target computing node, and if the node information only includes the identifier of the target computing node, the idle resources of each target computing node are determined based on the identifier of the target computing node, and the computing node that ultimately executes the second computing task is determined based on the idle resources of each target computing node. If the node information includes the idle resources of the target computing node, the computing node that ultimately executes the second computing task is determined based on the idle resources of each target computing node.

[0093] It should be noted that in the embodiments of the present application, the resources of a computing node can be divided into idle resources and used configured resources. The resources of a computing node include, but are not limited to, memory, central processing unit, etc. The total resources of a computing node include, but are not limited to, at least one of online resources, offline resources, and reserved resources.

[0094] The node agent of the compute node represents the idle resources of the compute node in the field format of gocrane.io / cpu. The node agent of the virtual node obtains the data corresponding to gocrane.io / cpu in the compute node, which is the idle resources of the compute node.

[0095] For example, the virtual node's node agent (Crane Agent) can obtain the compute node's idle resources through the compute node's node agent's resource acquisition interface. Taking the CPU as an example, assume there are online tasks 1 through 3, where the actual resource usage corresponding to tasks 1 through 3 is 1 core, 6 cores, and 3 cores, respectively. Based on the obtained actual resource usage and the compute node's total resources of 100 cores, including 10 cores of reserved resources, the compute node's current idle resources are determined to be 80 cores. The data corresponding to gocrane.io / cpu for this compute node is displayed as 80 cores.

[0096] In this embodiment, the virtual node can determine the computing node (i.e., the target computing node) that ultimately executes the second computing task based on the configurable resources and the computing nodes that meet the resource indication information. The virtual node then generates the node information in the first computing task using the node information of the determined target computing node, and obtains the second computing task containing the node information of the target computing node, so that the scheduling node can directly determine the computing node that executes the second computing task based on the node information in the second computing task, thereby saving the computing power of the scheduling node.

[0097] In one embodiment of the present application, applied to a virtual node, to determine whether a computing node is a target computing node, the determination can be made based on the configurable resources corresponding to the configured resources of the computing node. Therefore, if, based on the configurable resources, it is determined that there is a target computing node in at least one computing node that meets the resource indication information, the method includes: for each computing node, if the configurable resources corresponding to the idle resources of the computing node are greater than or equal to the amount of computing resources required to execute the first computing task, then determining the computing node as the target computing node.

[0098] In one implementation, among the configurable resources of the virtual node, the configurable resources corresponding to the idle resources of the computing node are called configurable sub-resources. When the configurable sub-resources of the computing node are not less than the amount of computing resources required to execute the first computing task, it is determined that the idle resources of the computing node meet the resource indication information, and then the computing node is determined as the target computing node.

[0099] For this embodiment, among the at least one computing node, any computing node that meets the resource indication information is determined as a target computing node. Therefore, the number of target computing nodes may be more than one, that is, the computing node ultimately used to execute the second computing task is one of these target computing nodes. In this case,

[0100] The second computing task is specifically used to instruct the scheduling node to determine a computing node in the target computing node that executes the second computing task based on the idle resources of the target computing node.

[0101] As an example, when the scheduling node receives the second computing task, if the second computing task contains node information of multiple target computing nodes, then for each target computing node, the idle resources of the target computing node are determined based on the node information of the target computing node, and based on each target computing node, a computing node for executing the second computing task is determined from multiple target computing nodes.

[0102] As another example, when the scheduling node receives the second computing task, if the second computing task does not contain any node information of the target computing node, the scheduling node obtains the idle resources of at least one computing node, and determines at least one target computing node based on the idle resources of each computing node; and then determines the computing node used to execute the second computing task among the at least one target computing node.

[0103] In a cluster scenario with mixed online and offline deployment, when multiple offline computing tasks need to use idle resources in the online cluster, each offline computing task can be sorted, and the scheduling node schedules the offline computing tasks to the virtual nodes in sequence according to the sorting, so that when the virtual node determines that there is a target computing node in the online cluster that meets the requirements of the offline computing task, it can convert the resource indication information in the offline computing task into a format.

[0104] When each offline computing task is configured, the object configuring the offline computing task can also configure the execution parameter value corresponding to the offline computing task based on the importance of the offline computing task. The execution parameter value specifies the execution order of the offline computing tasks. Offline computing tasks with lower importance have lower execution parameter values ​​and are executed later in the order. Resources can be allocated to offline computing tasks corresponding to the execution parameter values ​​in descending order. The execution parameter value can be, for example, the priority value of the offline computing task.

[0105] In this embodiment, when the configurable resources corresponding to the idle resources of the computing node are not less than the amount of computing resources required to execute the first computing task, the computing node can be determined as the target computing node, so that when the computing node executes the computing task, the problem of the computing amount of idle resources not meeting the computing resources required for the computing task is avoided, ensuring that the computing node can smoothly execute the computing task.

[0106] In one embodiment of the present application, applied to a virtual node, in order for the scheduling node to normally schedule computing tasks to the virtual node, the virtual node needs to normally report its configurable resources to the scheduling node. Since the configurable resources of the virtual node are derived from the idle resources of the computing node, the virtual node needs to convert the field format of the idle resources of the computing node obtained according to the field format of the configurable resources. Therefore, the method provided in the embodiment of the present application also includes: obtaining the idle resources of at least one computing node; converting the field format of the idle resources according to the field format of the configurable resources to obtain the configurable resources.

[0107] In actual applications, the resource indication information of the computing task transmitted from the client generally adopts the field format of cpu and mem, and the resources in this field format can be called native resources. If the computing task needs to use the native resources in the computing node, there is no need to modify the resource indication information in the computing task; if the computing task needs to use the idle resources in the computing node, it is necessary to convert the field format of the resource indication information in the computing task according to the field format of the idle resources. In order to avoid the control node converting the field format of the resource indication information in the computing task, the virtual node needs to report its configurable resources in the field format of the native resources when reporting. Therefore, the configurable resources are the native resources of the virtual node. In this way, there is no need to modify the field format of the resource indication information transmitted by the client, and the configurable resources can be matched with the resource indication information, which facilitates the subsequent determination of the target computing node.

[0108] As an example, if the resource format includes both CPU requirements and memory requirements, the virtual node obtains the idle resources of the computing node gocrane.io / cpu and gocrane.io / mem, and converts them into configurable resources with the fields cpu and mem.

[0109] In one implementation, a schematic diagram of the structure of a virtual node is provided with reference to Figure 3. The virtual node includes a Node Provider interface, a (computing task) Pod Provider interface, and a Pod Metrics Provider interface.

[0110] Among them, the responsibilities of the Node Provider include: (1) creating a Kubernetes Node; (2) completing the health check and status reporting of the virtual node; (3) since the node is virtual, there is no specific computing node corresponding to the schedulable resources in its state. Therefore, it is necessary to obtain the idle resources of at least one computing node in the corresponding cluster and give it to the virtual node. The Node Provider will obtain at least one computing node in the cluster, aggregate the undeclared resources in the computing node and the resources that have been declared in the pod but not actually used into gocrane.io / cpu, obtain the idle resources of the computing node, and complete the conversion of idle resources to configurable resources. The schedulable resources (i.e., configurable resources) of the virtual node are reported to the scheduling node in the cpu, mem field format. In this way, the scheduling node can know that the virtual node has available cpu and mem resources (i.e., configurable resources). The Node Provider can include commands such as the service status interface ping() and the node status notification NotifyNodeStatus().

[0111] (Pod)Provider is actually the lifecycle management of the Pod, and the virtual node Virtual Kubelet plays the role of the agent. The responsibilities of the (Pod)Provider include: when a Pod is scheduled to the virtual node, reading the Pod manifest and scheduling the Pod to the corresponding compute node through the scheduling node. When the scheduled Pod is deleted, the Virtual Kubelet must delete the Pod scheduled to the corresponding compute node through the scheduling node to complete resource release. The (Pod)Provider can include commands such as GetContainerLog() to get the container log; RunInContainer(), a flag that describes whether the job should run in the container; and ConfigureNode() to configure the node. Furthermore, the (Pod)Provider also includes the node.PodLifecycleHandler, which includes commands such as: CreateCreatePod(); UpdateUpdatePod(); DeleteDeletePod(); GetPod(); GetPodStatus(); and GetPods().

[0112] The Pod Metrics Provider's primary responsibility is to aggregate and report the status of all pods on a virtual node to the cluster's management platform. The Pod Metrics Provider includes commands such as GetStatsSummary() to obtain statistical summaries.

[0113] Optionally, the computing node may determine an allocation coefficient for idle resources based on the allocated and used resources and the total resources in the computing node, and further determine the idle resources of the computing node based on the allocation coefficient for idle resources. After determining the idle resources, the idle resources are transmitted to the virtual node, so that the virtual node obtains the idle resources of the computing node.

[0114] In one implementation, the configuration coefficient is used to determine a parameter of idle resources. The percentage of used resources to total resources can be used as the used ratio, the difference between 1 and the used ratio can be used as the first candidate configuration coefficient of idle resources, and the preset configuration coefficient can be used as the second candidate configuration coefficient. The smallest candidate configuration coefficient between the first candidate configuration coefficient and the second candidate configuration coefficient is selected as the configuration coefficient of idle resources.

[0115] The preset allocation coefficient is the maximum proportion to which idle resources in a computing node can be allocated. In practical applications, the preset allocation coefficient can be the preset allocation coefficient when the allocated and used resources in a computing node are 0. Generally, the preset allocation coefficient is no greater than 50%. For example, it can be 40%.

[0116] For example, taking the CPU as an example, assuming that the computing node is configured with a total resource of 100 cores, and the allocated and used resources are 30 cores, it can be concluded that the utilization ratio is 30%, and then the first candidate configuration coefficient is 70%. If the preset configuration coefficient is 50%, then the configuration coefficient of the idle resources can be obtained as the preset configuration coefficient.

[0117] Furthermore, the total resources of the computing node may also include buffer resources; specifically, if the used resources are not 0, the configuration coefficient of the idle resources is determined based on the allocated used resources, allocated unused resources, the buffer zone and the total allocable resources; if the used resources are 0, the configuration coefficient of the idle resources is determined to be the preset configuration coefficient.

[0118] Referring to Figure 4, it is a schematic diagram of the distribution of the total resources of the computing node in the embodiment of the present application. The total resources in the computing node include allocated resources and unallocated resources. The allocated resources further include allocated used resources, allocated unused resources and buffers. The unused resources and unallocated resources in the allocated resources can be used as idle resources. The buffer can provide a buffer for the normal operations currently running, that is, if there is a sudden computing task and resource avoidance is not performed, the buffer can be used to process it to ensure that all computing tasks in the computing node can proceed smoothly. When determining the current over-allocated resources, the determination is made based on the used resources, buffer and total allocable resources, that is, the determination is made based on the over-allocated resources.

[0119] When a normal job is running on a compute node, that is, when the allocated and used resources are not zero, the allocation coefficient of idle resources is determined based on the allocated and used resources, buffer, and total resources. If the allocated and used resources are large, the allocation coefficient of idle resources is small; if the allocated and used resources are small, the allocation coefficient of idle resources is large, but the maximum does not exceed the preset allocation coefficient. If the allocated and used resources are zero, the allocation coefficient of idle resources is determined to be the preset over-allocation coefficient. The preset over-allocation coefficient can prevent the problem of resource shortage caused by the sudden scheduling of a large number of computing tasks to the same compute node.

[0120] In this embodiment, the resource format of the idle resources acquired in at least one computing phase is converted according to the field format of the configurable resources to obtain the configurable resources, thereby ensuring that the virtual node can receive the computing task.

[0121] In one embodiment of the present application, to ensure that a scheduling node can properly schedule computing tasks for a virtual node, the scheduling node needs to obtain the configurable resources of the virtual node. Specifically, the configurable resources are reported to the scheduling node; the configurable resources are used by the scheduling node to schedule a first computing task to the virtual node.

[0122] Optionally, the number of virtual nodes can be determined based on the number of clusters from which the compute nodes are to be acquired. Virtual nodes can have a one-to-one correspondence with clusters, meaning one virtual node acquires the idle resources of compute nodes in one cluster; or a one-to-many correspondence with clusters, meaning one virtual node acquires the idle resources of compute nodes in multiple clusters.

[0123] For example, multiple virtual nodes can be deployed in a cluster, and each virtual node obtains the idle resources of the computing nodes of a cluster. The idle resources can be the idle resources of the computing nodes in the cluster where the virtual node is located, or the idle resources of the computing nodes in other clusters with access credentials.

[0124] For another example, a virtual node can simultaneously obtain the idle resources of computing nodes in the cluster where it is located, and can also obtain the idle resources of computing nodes in other clusters for which it has access credentials.

[0125] As an example, referring to FIG5 , taking the cluster scenario of online and offline hybrid deployment as an example, it is assumed that there are three clusters (Clusters) Cluster 1, Cluster 2 and Cluster 3, of which Cluster 1 and Cluster 2 are online clusters, and Cluster 3 is an offline cluster. Assuming that virtual nodes are deployed in Cluster 3, if the virtual nodes are deployed according to the one-to-one correspondence between the virtual nodes and the online clusters to be obtained, then virtual node 1 and virtual node 2 are deployed in Cluster 3. Virtual node 1 has the access credentials of Cluster 1 (i.e., kubeconfig). Based on the access credentials, virtual node 1 can obtain the idle resources of the computing nodes in Cluster 1; virtual node 2 has the access credentials of Cluster 2 (i.e., kubeconfig). Based on the access credentials, virtual node 2 can obtain the idle resources of the computing nodes in Cluster 2. In this way, the idle resources in the virtual nodes can be determined in Cluster 3, so that tasks can be deployed based on the idle resources in the future.

[0126] Based on the above, after virtual node 1 obtains the idle resources of the computing nodes in cluster 1, it summarizes and converts the format of the idle resources of the computing nodes in cluster 1 to obtain the configurable resources of virtual node 1. Virtual node 1 reports the configurable resources to the scheduler (i.e., scheduling node) in cluster 3. The scheduler in cluster 3 schedules the first computing task (the first computing task is an offline computing task) to virtual node 1 based on the configurable resources of virtual node 1. Afterwards, virtual node 1 determines whether there is a computing node in cluster 1 with idle resources that meets the resource indication information of the first computing task based on the configurable resources; if so, the target computing node is determined among the computing nodes that meet the resource indication information of the first computing task. The resource indication information is converted into a format according to the field format of the idle resources, and the node information of the first computing task is generated according to the node information of the target computing node, thereby obtaining the second computing task.

[0127] In combination with the above, after obtaining the second computing task, virtual node 1 can transmit the second computing task in two ways:

[0128] First, virtual node 1 sends the second computing task directly to the scheduler of cluster 1. The scheduler of cluster 1 schedules the second computing task to the computing node corresponding to the node information according to the node information in the second computing task.

[0129] Second, virtual node 1 transmits the second computing task to the scheduler of cluster 1 through the scheduler of cluster 3. The scheduler of cluster 1 schedules the second computing task to the computing node corresponding to the node information according to the node information in the second computing task.

[0130] It can be understood that the online cluster and the offline cluster are independent clusters that are not interoperable with each other. The entrance of each cluster is completely isolated, and the permissions of each cluster are also completely isolated. In the embodiment of the present application, the virtual node can be used as a bridge to connect the online cluster and the offline cluster, so that the offline cluster can use the virtual node to obtain the idle resources of the online cluster and deploy tasks, that is, the offline cluster can use the idle resources of the online cluster to perform tasks without obtaining the permissions of the online cluster. In this way, the embodiment of the present application can improve the utilization rate of the idle resources of the online cluster at a lower cost without changing the original organizational structure and permission isolation requirements.

[0131] In this embodiment, the virtual node reports its configurable resources to the scheduling node so that the scheduling node schedules the computing task to the virtual node.

[0132] 6 , an embodiment of the present application further provides a resource scheduling method, which is applied to a scheduling node. The method includes:

[0133] 601. Send a first computing task to a virtual node.

[0134] Among them, the first computing task includes resource indication information, and the resource indication information is used to characterize the amount of computing resources required to execute the first computing task; the first computing task is used to instruct the virtual node to determine, based on the configurable resources, that there is a target computing node in at least one computing node that meets the resource indication information, and then convert the resource indication information in the first computing task into a format according to the resource format of idle resources to obtain a second computing task; the configurable resources of the virtual node are determined by the idle resources of at least one computing node.

[0135] 602. Receive a second computing task from the virtual node.

[0136] 603. Execute the second computing task based on the target computing node.

[0137] It is understandable that the steps in FIG6 are only briefly described, and the specific descriptions of the above steps 601-603 shall prevail.

[0138] The resource scheduling method proposed in the present application can be applied to a control node. When a virtual node has configurable resources, the control node sends a first computing task, such as the first computing task, to the virtual node. Since the first computing task includes resource indication information for characterizing the amount of computing resources required to execute the first computing task, the first computing task can be used to indicate that the virtual node can determine whether there is a target computing node that meets the resource indication information in at least one computing node based on the configurable resources. If so, since the data format of the idle resources is different from the data format of the resource indication information in the first computing task, considering that the idle resources in the computing node are to be used, it is necessary to convert the data format of the resource indication information. The virtual node converts the resource indication information in the first computing task according to the field format of the idle resources, thereby obtaining a second computing task. Therefore, when determining that there is at least one computing node that meets the resource indication information, the present application does not need to use the control node to convert the resource indication information in the computing task. Instead, it uses the virtual node to achieve this, avoiding invasive modifications to the native code of the control node. Afterwards, the scheduling node receives the second computing task from the virtual node and executes the second computing task based on the target computing node, thereby realizing the reuse of idle resources without intrusive modification of the native code, and improving the utilization of cluster resources at a lower cost.

[0139] In one embodiment of the present application, the second computing task includes node information of the target computing node; executing the second computing task based on the target computing node includes: determining the target computing node based on the node information; and scheduling the second computing task to the target computing node.

[0140] In one embodiment of the present application, the target computing node is the computing node that ultimately executes the second computing task or the computing node that satisfies the resource indication information; the node information of the target computing node includes the identifier of the target computing node; scheduling the second computing task to the target computing node includes: when the target computing node is the computing node that ultimately executes the second computing task, scheduling the second computing task to the target computing node according to the identifier of the target computing node; when the target computing node is the computing node that satisfies the resource indication information, and there is only one target computing node, scheduling the second computing task to the target computing node according to the identifier of the target computing node; or when the target computing node is the computing node that satisfies the resource indication information, and there are multiple target computing nodes, selecting one target computing node from multiple target computing nodes as the computing node that ultimately executes the second computing task, and scheduling the second computing task to the selected target computing node.

[0141] In one embodiment of the present application, executing a second computing task based on a target computing node includes: determining a computing node in the target computing node for executing the second computing task based on idle resources of the target computing node; and scheduling the second computing task to the computing node in the target computing node for executing the second computing task.

[0142] In one embodiment of the present application, based on the idle resources of the target computing node, a computing node for executing the second computing task is determined in the target computing node, including: when the second computing task includes node information of multiple target computing nodes, the idle resources of the target computing node are determined according to the node information of the target computing node, and based on each target computing node, a computing node for executing the second computing task is determined from multiple target computing nodes; when the second computing task does not include node information of any target computing node, the idle resources of at least one computing node are obtained, and based on the idle resources of each computing node, a target computing node that meets the resource indication information is determined; the computing node for executing the second computing task is determined in the target computing node; or when the second computing task does not include node information of any target computing node, the idle resources of at least one computing node are obtained, and a computing node that meets the resource indication information is determined based on the idle resources of each computing node; the target computing node for executing the second computing task is determined based on the computing node that meets the resource indication information.

[0143] In one embodiment of the present application, the method further includes: receiving configurable resources reported from a virtual node; sending a first computing task to the virtual node, and further includes: if the configurable resources meet the resource indication information of the first computing task, scheduling the first computing task to the virtual node.

[0144] In one embodiment of the present application, when there are multiple first computing tasks, sending the first computing tasks to the virtual node includes: sorting the first computing tasks according to a preset sorting method, and scheduling the multiple first computing tasks to the virtual node in sequence according to the sorting order. In order to better understand the resource scheduling method provided in the embodiment of the present application, with reference to FIG7, an exemplary description is given of the interaction between the virtual node, the control node, and the computing node. The computing nodes take computing node 1 and computing node 2 as examples.

[0145] 701. A virtual node receives idle resources from computing node 1 and idle resources from computing node 2.

[0146] 702. The virtual node aggregates the idle resources of computing node 1 and computing node 2, and converts the aggregated idle resources into configurable resources according to the field format of configurable resources.

[0147] 703. The virtual node sends the configurable resources to the scheduling node.

[0148] 704. The scheduling node determines that if the configurable resources of the virtual node meet the resource indication information of the first computing task, the first computing task is scheduled to the virtual node.

[0149] The first computing task includes resource indication information, and the resource indication information is used to represent the amount of computing resources required to execute the first computing task.

[0150] 705. The virtual node determines, based on the configurable resources, computing nodes 1 and 2, which are computing nodes that meet the resource indication information.

[0151] 706. If both computing node 1 and computing node 2 meet the resource indication information, the virtual node selects one of computing node 1 and computing node 2 as the target computing node.

[0152] 707. If computing node 1 is used as the target computing node, the virtual node converts the format of the resource indication information in the first computing task according to the field format of the idle resources, and generates the node information in the first computing task according to the node information of computing node 1 to obtain the second computing task.

[0153] 708. The virtual node transmits the second computing task to the scheduling node.

[0154] 709. The scheduling node schedules the second computing task to computing node 1 according to the node information included in the second computing task.

[0155] 710. Computing node 1 executes the second computing task.

[0156] Regarding steps 706-709, in another implementation, if both compute node 1 and compute node 2 meet the resource indication information, the virtual node may select both compute node 1 and compute node 2 as target compute nodes. The virtual node converts the resource indication information in the first computing task according to the field format of the idle resources, and generates the node information in the first computing task based on the node information of compute node 1 and compute node 2, thereby obtaining a second computing task. Based on the node information of compute node 1 and compute node 2 included in the second computing task, the scheduling node selects one of compute node 1 and compute node 2 as the compute node to execute the second computing task.

[0157] Regarding steps 706-709, in another implementation, at least one of compute node 1 and compute node 2 meets the resource indication information. The virtual node converts the resource indication information in the first computing task according to the idle resource field format to obtain the second computing task. The scheduling node obtains the idle resources of compute node 1 and compute node 2, and selects a compute node from compute node 1 and compute node 2 as the compute node to execute the second computing task based on the idle resources of compute node 1 and compute node 2 and the resource indication information in the second computing task.

[0158] It should be noted that although the operations of the method of the present application are described in a particular order in the drawings, this does not require or imply that these operations must be performed in this particular order, or that all illustrated operations must be performed to achieve the desired results.

[0159] FIG8 is a block diagram of a virtual node according to an embodiment of the present application.

[0160] As shown in FIG8 , the configurable resources of the virtual node are determined by the idle resources of at least one computing node. The virtual node includes: a receiving module 801 , a format conversion module 802 and a sending module 803 , wherein:

[0161] The receiving module 801 is configured to receive a first computing task from a scheduling node. The first computing task includes resource indication information, and the resource indication information is used to represent the amount of computing resources required to execute the first computing task.

[0162] The format conversion module 802 is used to convert the resource indication information in the first computing task according to the field format of the idle resources to obtain the second computing task if it is determined based on the configurable resources that there is a target computing node in at least one computing node that meets the resource indication information.

[0163] The sending module 803 is configured to send the second computing task to the scheduling node, where the second computing task is used to instruct the scheduling node to execute the second computing task based on the target computing node.

[0164] In one embodiment of the present application, the format conversion module 802 is specifically configured to:

[0165] According to the configurable resources, a computing node that meets the resource indication information is determined among the at least one computing node.

[0166] A target computing node is determined among computing nodes that meet the resource indication information.

[0167] The resource indication information in the first computing task is formatted according to the field format of the idle resources, and the node information in the first computing task is generated according to the node information of the target computing node to obtain the second computing task; the second computing task is specifically used to instruct the scheduling node to execute the second computing task based on the node information of the target computing node contained in the second computing task.

[0168] In one embodiment of the present application, the format conversion module 802 is specifically used to, for each computing node, determine the computing node as a target computing node if the configurable resources corresponding to the idle resources of the computing node are greater than or equal to the amount of computing resources required to execute the first computing task.

[0169] In one embodiment of the present application, the second computing task is specifically used to instruct the scheduling node to determine a computing node in the target computing node that executes the second computing task based on idle resources of the target computing node.

[0170] In one embodiment of the present application, the receiving module 801 is further configured to obtain idle resources of at least one computing node.

[0171] The format conversion module 802 is used to convert the field format of the idle resources according to the field format of the configurable resources to obtain the configurable resources.

[0172] In one embodiment of the present application, the sending module 803 is further used to report the configurable resources to the scheduling node; the configurable resources are used by the scheduling node to schedule the first computing task to the virtual node.

[0173] The virtual node proposed in the present application determines the configurable resources in the virtual node through the idle resources of at least one computing node, thereby realizing the aggregation of the idle resources of at least one computing node. The configurable resources of a virtual node can represent all the idle computing power of these computing nodes. When there are configurable resources in the virtual node, computing tasks, such as the first computing task, can be received under the configurable resources. After receiving the first computing task, since the first computing task includes resource indication information for characterizing the amount of computing resources required to execute the first computing task, the virtual node can determine whether there is a target computing node that meets the resource indication information in at least one computing node based on the configurable resources. If so, since the data format of the idle resources is different from the data format of the resource indication information in the first computing task, considering that the idle resources in the computing node are to be used, the data format of the resource indication information needs to be formatted. Specifically, the resource indication information in the first computing task is formatted according to the field format of the idle resources, thereby obtaining the second computing task. Therefore, when determining that at least one computing node has resource indication information that satisfies the requirements, the present application does not require a control node to convert the format of the resource indication information in the computing task. Instead, it utilizes a virtual node to implement this, thus avoiding intrusive modifications to the native code of the control node. Subsequently, the generated second computing task is sent to the scheduling node, instructing the scheduling node to execute the second computing task based on the target computing node. This allows for the reuse of idle resources without intrusive modifications to the native code, thereby improving cluster resource utilization at a lower cost.

[0174] It should be understood that the units described in the virtual node above correspond to the various steps in the method described with reference to FIG2 . Therefore, the operations and features described above for the method are also applicable to the resource scheduling device and the units contained therein, and will not be described in detail here. The virtual node can be pre-implemented in the server or loaded into the server by downloading or other means. The corresponding units in the virtual node can cooperate with the units in the computer device to implement the solution of the embodiment of the present application.

[0175] FIG9 is a block diagram of a scheduling node according to another embodiment of the present application.

[0176] As shown in FIG9 , the scheduling node includes: a receiving module 901 , a scheduling module 902 and a sending module 903 , wherein:

[0177] A sending module 903 is configured to send a first computing task to a virtual node; the first computing task includes resource indication information, the resource indication information being used to represent the amount of computing resources required to execute the first computing task; the first computing task is configured to instruct the virtual node to convert the resource indication information in the first computing task into a resource format of idle resources when determining, based on configurable resources, that there is a target computing node in at least one computing node that meets the resource indication information, to obtain a second computing task; the configurable resources of the virtual node are determined by the idle resources of the at least one computing node;

[0178] The receiving module 901 is configured to receive a second computing task from a virtual node.

[0179] The scheduling module 902 is configured to execute the second computing task based on the target computing node.

[0180] In one embodiment of the present application, the second computing task includes node information of the target computing node; the scheduling module 902 is specifically configured to determine the target computing node based on the node information; and schedule the second computing task to the target computing node.

[0181] In one embodiment of the present application, the scheduling module 902 is specifically configured to:

[0182] Based on the idle resources of the target computing node, a computing node for executing the second computing task is determined among the target computing nodes.

[0183] The second computing task is dispatched to a computing node in the target computing node for executing the second computing task.

[0184] In one embodiment of the present application, the receiving module 901 is further configured to receive configurable resources reported from a virtual node;

[0185] The sending module 903 is specifically configured to schedule the first computing task to the virtual node if the configurable resources meet the resource indication information of the first computing task.

[0186] The embodiment of the present application proposes a control node. When there are configurable resources in the virtual node, the control node sends a first computing task, such as the first computing task, to the virtual node. Since the first computing task includes resource indication information for characterizing the amount of computing resources required to execute the first computing task, the first computing task can be used to indicate that the virtual node can determine whether there is a target computing node that meets the resource indication information in at least one computing node based on the configurable resources. If so, since the data format of the idle resources is different from the data format of the resource indication information in the first computing task, considering that the idle resources in the computing node are to be used, it is necessary to perform format conversion on the data format of the resource indication information. The virtual node performs format conversion on the resource indication information in the first computing task according to the field format of the idle resources, thereby obtaining the second computing task. Therefore, when determining that there is resource indication information that meets the requirements in at least one computing node, the present application does not need to use a control node to perform format conversion on the resource indication information in the computing task, but instead uses a virtual node to achieve it, thereby avoiding invasive modifications to the native code of the control node. Afterwards, the scheduling node receives the second computing task from the virtual node and executes the second computing task based on the target computing node, thereby realizing the reuse of idle resources without intrusive modification of the native code, and improving the utilization of cluster resources at a lower cost.

[0187] It should be understood that the various units described in the above-mentioned scheduling node correspond to the various steps in the method described with reference to FIG6 . Therefore, the operations and features described above for the method are also applicable to the scheduling node and the units contained therein, and will not be repeated here. The scheduling node can be pre-implemented in the server or loaded into the server by downloading or other means. The corresponding units in the scheduling node can cooperate with the units in the computer device to implement the solution of the embodiment of the present application.

[0188] The several modules or units mentioned in the detailed description above are not necessarily divided into a single module or unit. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0189] It should be noted that for details not disclosed in the virtual nodes and scheduling nodes in the embodiments of the present application, please refer to the details disclosed in the above embodiments of the present application, and no further details will be given here.

[0190] With reference to Figure 10 below, Figure 10 shows a schematic diagram of the structure of the computer device suitable for realizing the embodiment of the present application. As shown in Figure 10, computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to the program stored in a read-only memory (ROM) 1002 or the program loaded into a random access memory (RAM) 1003 from a storage portion 1008. In RAM 1003, various programs and data required for the operating instructions of the system are also stored. CPU 1001, ROM 1002 and RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to bus 1004.

[0191] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, and the like; an output section 1007 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 1008 including a hard disk; and a communication section 1009 including a network interface card such as a LAN card or a modem. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 1010 as needed, so that computer programs read therefrom can be installed into the storage section 1008 as needed.

[0192] In particular, according to an embodiment of the present application, the process described above with reference to flowchart Figure 2 can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1009, and / or installed from a removable medium 1011. When the computer program is executed by the central processing unit (CPU) 1001, the above-mentioned functions defined in the system of the present application are executed.

[0193] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this application, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical cable, RF, or any suitable combination thereof.

[0194] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operating instructions of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the aforementioned module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than the order marked in the accompanying drawings. For example, the boxes represented by two connections can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operating instruction, or can be implemented using a combination of dedicated hardware and computer instructions.

[0195] The units or modules described in the embodiments of this application may be implemented in software or hardware. The units or modules described may also be provided in a processor. For example, a processor may be described as including an illegal person detection unit, a multimodal detection unit, and an identification unit. The names of these units or modules do not, in certain circumstances, limit the units or modules themselves.

[0196] As another aspect, the present application also provides a computer-readable storage medium, which may be included in the computer device described in the above embodiment, or may exist independently and not be assembled into the computer device. The above computer-readable storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the resource scheduling method described in the present application. For example, the various steps of the resource scheduling method shown in Figure 2 or the various steps of the resource scheduling method shown in Figure 6 may be executed.

[0197] The present invention provides a computer program product including instructions that, when executed, cause the method described in the present invention to be performed. For example, the steps of the resource scheduling method shown in FIG2 or the steps of the resource scheduling method shown in FIG6 may be performed.

[0198] The above description is merely a preferred embodiment of the present application and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this application is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the aforementioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. A resource scheduling method, It is characterized in that Applied to a virtual node, the configurable resources of the virtual node are determined by the idle resources of at least one computing node, the method comprising: Receiving a first computing task from a scheduling node, the first computing task including resource indication information, the resource indication information being used to characterize an amount of computing resources required to execute the first computing task; If it is determined according to the configurable resources that there is a target computing node in the at least one computing node that satisfies the resource indication information, the resource indication information in the first computing task is format-converted according to the field format of the idle resources to obtain a second computing task; The second computing task is sent to the scheduling node, where the second computing task is used to instruct the scheduling node to execute the second computing task based on the target computing node.

2. The resource scheduling method according to claim 1, It is characterized in that If it is determined according to the configurable resources that there is a target computing node in the at least one computing node that satisfies the resource indication information, format conversion of the resource indication information in the first computing task according to the field format of the idle resources includes: If, according to the configurable resources, a computing node satisfying the resource indication information is determined among the at least one computing node; Determine the target computing node among the computing nodes that meet the resource indication information; The resource indication information in the first computing task is formatted according to the field format of the idle resources, and the node information in the first computing task is generated according to the node information of the target computing node to obtain the second computing task; the second computing task is specifically used to instruct the scheduling node to execute the second computing task based on the node information of the target computing node contained in the second computing task.

3. The resource scheduling method according to claim 1, It is characterized in that If it is determined, according to the configurable resources, that there is a target computing node in the at least one computing node that satisfies the resource indication information, the method includes: For each computing node, if the configurable resources corresponding to the idle resources of the computing node are greater than or equal to the amount of computing resources required to execute the first computing task, the computing node is determined as the target computing node.

4. The resource scheduling method according to claim 1 or 3, It is characterized in that The second computing task is specifically used to instruct the scheduling node to determine a computing node in the target computing node that executes the second computing task based on idle resources of the target computing node.

5. The resource scheduling method according to claim 1, It is characterized in that The method further comprises: Acquire idle resources of the at least one computing node; According to the field format of the configurable resource, the field format of the idle resource is converted to obtain the configurable resource.

6. The resource scheduling method according to claim 5, It is characterized in that The obtaining of the idle resources of the at least one computing node includes: Determining the configuration coefficient of the idle resources according to the allocated and used resources and the total resources in the computing node; The idle resources of the computing resources are determined according to the configuration coefficients of the idle resources.

7. The resource scheduling method according to claim 6, It is characterized in that The total resources include allocated resources and unallocated resources, the allocated resources include allocated used resources, allocated unused resources and a buffer zone, and the idle resources include the allocated unused resources and unallocated resources.

8. The resource scheduling method according to claim 1, It is characterized in that The method further comprises: The configurable resources are reported to the scheduling node; the configurable resources are used by the scheduling node to schedule the first computing task to the virtual node.

9. A resource scheduling method, It is characterized in that Applied to a scheduling node, the method comprises: Sending a first computing task to a virtual node; the first computing task includes resource indication information, the resource indication information is used to characterize the amount of computing resources required to perform the first computing task; the first computing task is used to indicate the virtual node When the node determines, based on the configurable resources, that there is a target computing node in at least one computing node that satisfies the resource indication information, the resource indication information in the first computing task is formatted according to the resource format of the idle resources to obtain a second computing task; the configurable resources of the virtual node are determined by the idle resources of the at least one computing node; receiving a second computing task from the virtual node; The second computing task is executed based on the target computing node.

10. The resource scheduling method according to claim 9, It is characterized in that The second computing task includes node information of the target computing node; The performing the second computing task based on the target computing node includes: Determining the target computing node according to the node information; The second computing task is dispatched to the target computing node.

11. The resource scheduling method according to claim 10, It is characterized in that The target computing node is a computing node that ultimately executes the second computing task or a computing node that satisfies the resource indication information; The node information of the target computing node includes an identifier of the target computing node; The step of scheduling the second computing task to the target computing node includes: In a case where the target computing node is a computing node that ultimately executes the second computing task, scheduling the second computing task to the target computing node according to an identifier of the target computing node; When the target computing node is a computing node that satisfies the resource indication information and there is only one target computing node, scheduling the second computing task to the target computing node according to an identifier of the target computing node; or When the target computing node is a computing node that satisfies the resource indication information, and there are multiple target computing nodes, one target computing node is selected from the multiple target computing nodes as the computing node that ultimately executes the second computing task, and the second computing task is scheduled to the selected target computing node.

12. The resource scheduling method according to claim 9, It is characterized in that The performing the second computing task based on the target computing node includes: Based on the idle resources of the target computing node, determining a computing node in the target computing node for executing the second computing task; The second computing task is dispatched to a computing node in the target computing node for executing the second computing task.

13. The resource scheduling method according to claim 12, It is characterized in that The step of determining a computing node for executing the second computing task in the target computing node based on the idle resources of the target computing node includes: In the case where the second computing task includes node information of a plurality of the target computing nodes, determining idle resources of the target computing nodes according to the node information of the target computing nodes, and determining a computing node for executing the second computing task from the plurality of the target computing nodes according to each of the target computing nodes; In the case that the second computing task does not include any node information of the target computing node, obtaining idle resources of at least one of the computing nodes, and determining a target computing node that meets the resource indication information according to the idle resources of each of the computing nodes; Determine a computing node for executing a second computing task among the target computing nodes; or In the case that the second computing task does not include any node information of the target computing node, obtaining idle resources of at least one computing node, and determining a computing node that satisfies the resource indication information according to the idle resources of each computing node; The target computing node for executing the second computing task is determined according to the computing node that meets the resource indication information.

14. The resource scheduling method according to any one of claims 9 to 13, It is characterized in that The method further comprises: Receiving the configurable resources reported by the virtual node; The sending the first computing task to the virtual node includes: If the configurable resources satisfy the resource indication information of the first computing task, the first computing task Dispatching to the virtual node.

15. The resource scheduling method according to claim 9, It is characterized in that In the case where there are multiple first computing tasks, sending the first computing task to the virtual node includes: The first computing tasks are sorted according to a preset sorting method, and a plurality of the first computing tasks are sequentially scheduled to the virtual nodes according to the sorting order.

16. A virtual node, It is characterized in that The configurable resources of the virtual node are determined by the idle resources of at least one computing node, and the virtual node includes: A receiving module, configured to receive a first computing task from a scheduling node, wherein the first computing task includes resource indication information, and the resource indication information is used to characterize the amount of computing resources required to execute the first computing task; a format conversion module, configured to, if it is determined according to the configurable resources that there is a target computing node in the at least one computing node that satisfies the resource indication information, perform format conversion on the resource indication information in the first computing task according to the field format of the idle resources to obtain a second computing task; A sending module is used to send the second computing task to the scheduling node, and the second computing task is used to instruct the scheduling node to execute the second computing task based on the target computing node.

17. A scheduling node, It is characterized in that The scheduling node includes: A sending module, configured to send a first computing task to a virtual node; the first computing task includes resource indication information, and the resource indication information is used to characterize the amount of computing resources required to execute the first computing task; the first computing task is used to instruct the virtual node to determine, based on configurable resources, that there is a target computing node in at least one computing node that satisfies the resource indication information, and to convert the resource indication information in the first computing task into a second computing task according to a resource format of idle resources; the configurable resources of the virtual node are determined by the idle resources of the at least one computing node; A receiving module, configured to receive a second computing task from the virtual node; A scheduling module is used to execute the second computing task based on the target computing node.

18. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the method according to any one of claims 1 to 8 or the method according to claims 9 to 15 is implemented.

19. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 8 or the method according to claims 9 to 15 is implemented.

20. A computer program product, It is characterized in that The computer program product comprises instructions, and when the instructions are executed, the method according to any one of claims 1 to 8 or the method according to claims 9 to 15 is implemented.

Citation Information

Patent Citations

  • Server-free cloud service system, resource management method thereof and electronic equipment

    CN110837407A

  • Kubernetes-based computing device sharing method, apparatus and device and storage medium

    CN112231049A

  • Distributed task processing method and system

    CN114546633A

  • Resource scheduling method, node, device, medium and program product

    CN116974748A

  • Automated Generation of Objects for Kubernetes Services

    US20230108778A1