Task scheduling methods, apparatus, computer-readable storage media and electronic devices
By acquiring node runtime data and task information from the cloud container cluster to calculate a comprehensive score, and combining this with directed acyclic graph management of task dependencies, the problem of poor resource utilization in task scheduling schemes is solved, achieving more efficient resource matching and task execution. In particular, it significantly improves resource utilization and throughput in GPU-scarce environments.
Patent Information
- Application Number
- CN202611541312.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-30
- Publication Date
- 2026-11-17
AI Technical Summary
Existing task scheduling solutions suffer from poor resource utilization in cloud container clusters, especially when heterogeneous resources (such as GPUs) are scarce and expensive. They cannot be used efficiently and cannot handle resource contention and mutual interference between heterogeneous tasks. In complex business processes, the non-strict execution order of tasks leads to errors.
By acquiring the runtime data of each load node in the cloud container cluster, including resource status, network quality, and GPU data, and combining it with task information to calculate a comprehensive score, the system dynamically determines the target load node for task scheduling and manages task dependencies based on a directed acyclic graph to ensure that tasks are executed in sequence.
It improves the intelligence level and resource utilization efficiency of distributed task scheduling, avoids task failures due to insufficient resources or network congestion, and achieves more refined resource matching and efficient task execution. In particular, it significantly improves the utilization rate of GPU resources and the overall throughput in clusters with abundant GPUs.
Smart Images

Figure CN123123352A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of task scheduling technology, and more specifically, to a task scheduling method, apparatus, computer-readable storage medium, and electronic device. Background Technology
[0002] With the popularization of cloud computing technology, enterprise IT infrastructure is gradually evolving from traditional physical servers towards virtualization and containerization. Container technology, with its advantages of lightweight design, fast startup, and environmental consistency, has become the mainstream method for modern application deployment. Container orchestration platforms, as the de facto standard in the field of container orchestration, are widely used in production environments to manage large-scale container clusters. In cloud container clusters, computing tasks are typically encapsulated into container groups for scheduling and execution. However, the native scheduler of cloud container orchestration platforms mainly focuses on matching the resource requests of container groups with the available resources of nodes. Its scheduling strategy is based on static resource requests and node affinity, and cannot perceive real-time load changes of nodes, which limits its ability to handle complex business task scheduling scenarios.
[0003] With the rapid development of artificial intelligence technology, the proportion of heterogeneous computing resources such as GPUs in data centers is constantly increasing. AI model training, inference, and other tasks are highly dependent on GPU resources. However, GPU resources are scarcer and more expensive than CPUs, making efficient utilization of GPU resources and avoiding idle GPU waste a significant technical challenge. Traditional task scheduling systems often lack the ability to manage GPU resources in a granular way.
[0004] Within the same cluster, different types of tasks have vastly different resource requirements. For example, network diagnostic tasks are typically I / O intensive, with low CPU and memory requirements; AI training tasks are GPU intensive, requiring dedicated GPU resources; and script tasks may require privileged execution. How to handle these heterogeneous requirements within a unified scheduling framework while avoiding resource contention and interference between tasks is a technical challenge. Traditional task scheduling is usually based on simple round-robin or static resource reservation. However, this approach is inadequate when facing such heterogeneous mixed loads. For example, scheduling a diagnostic task requiring low-latency networks to a congested node, or scheduling an AI task to a node with insufficient GPU memory, will lead to task failure or severe performance degradation. Furthermore, complex business processes often involve multiple dependent tasks (e.g., data preprocessing, model training, and model evaluation), and the execution order of these tasks must strictly adhere to their dependencies; otherwise, erroneous results may occur.
[0005] In summary, the relevant task scheduling schemes suffer from poor resource utilization. Summary of the Invention
[0006] The main objective of this application is to provide a task scheduling method, apparatus, computer-readable storage medium, and electronic device to at least solve the problem of poor resource utilization in related task scheduling schemes.
[0007] To achieve the above objectives, according to one aspect of this application, a task scheduling method is provided, comprising: acquiring the running data of each load node in a cloud container cluster, wherein the running data includes resource status data, network quality data, GPU data, and heartbeat data packets; upon receiving a task request, determining the task information corresponding to the task request, and determining a comprehensive score for each load node based on the running data and the task information; and scheduling the current task corresponding to the task request to the target load node based on the comprehensive score and a determined target load node, so that the current task can be processed by the target load node.
[0008] Optionally, determining the comprehensive score of each load node based on the running data and task information of each load node includes: when the task information indicates that GPU resources are required, calculating the load score, network score, GPU score, and health score corresponding to each load node based on the running data and task information of each load node; and determining the comprehensive score of each load node based on the load score, network score, GPU score, and health score.
[0009] Optionally, scheduling the current task corresponding to the task request to the target load node includes: constructing a directed acyclic graph based on the dependencies between tasks, wherein the nodes of the directed acyclic graph are each task, and the edges are the dependencies between each task; determining whether the current task has a preceding dependent task based on the task information and the directed acyclic graph; and scheduling the current task to the target load node if there is no preceding dependent task.
[0010] Optionally, after determining whether the current task has any prerequisite tasks based on the task information and the directed acyclic graph, the method further includes: scheduling the prerequisite tasks to the target load node for processing, and scheduling the current task to the target load node for processing after all the prerequisite tasks have been processed.
[0011] Optionally, based on the running data and task information of each load node, calculate the load score, network score, GPU score, and health score corresponding to each load node, including: calculating the load score corresponding to each load node based on the resource status data, wherein the resource status data includes CPU utilization, memory utilization, number of tasks being executed, and maximum number of concurrent tasks; calculating the network score corresponding to each load node based on the network quality data, wherein the network quality data includes network latency, packet loss rate, and available network bandwidth; calculating the GPU score corresponding to each load node based on the GPU data and task information, wherein the GPU data includes GPU computing unit utilization, GPU used memory, and total memory, and the task information includes the number of GPUs required by the task and the memory required by the task; and calculating the health score corresponding to each load node based on the heartbeat data packet, wherein the heartbeat data packet includes the time interval between the current time and the last successful receipt of a heartbeat packet, the number of successful tasks, and the total number of tasks.
[0012] Optionally, based on the operating data and task information of each load node, a load score, network score, GPU score, and health score are calculated for each load node, including:
[0013] According to the first formula: The load score is calculated, where LoadScore is the load score, CPUUtil is the CPU utilization, MemUtil is the memory utilization, CurrentTasks is the number of tasks currently executing, and MaxTasks is the maximum number of concurrent tasks. , , These are the weighting coefficients;
[0014] According to the second formula: Calculate the network score, where NetworkScore is the network score, Latency is the network latency, PacketLoss is the packet loss rate, and Bandwidth is the available network bandwidth. , , These are the weighting coefficients;
[0015] According to the third formula: The GPU score is calculated, where GPUScore is the GPU score, GPUUtil is the GPU computing unit utilization, GPUMemUsed and GPUMemTotal are the GPU's used video memory and total video memory, respectively, TaskGPU is the number of GPUs required for the task, NodeGPU is the number of GPUs on the node, TaskGPUMem is the video memory required for the task, and AvailableGPUMem is the GPU's available video memory. , , , These are the weighting coefficients;
[0016] According to the fourth formula: The health score is calculated, where HealthScore is the health score, SuccessTasks is the number of successfully executed tasks, TotalTasks is the total number of tasks scheduled to the load node, α is the penalty coefficient, Δt is the time interval between the current time and the last successfully received heartbeat packet, and T is the expected heartbeat time interval.
[0017] Optionally, determining the comprehensive score of each load node based on the running data and task information of each load node includes: when the task information indicates that GPU resources are not required, calculating the load score, network score, and health score corresponding to each load node based on the running data and task information of each load node; and determining the comprehensive score of each load node based on the load score, the network score, and the health score.
[0018] According to another aspect of this application, a task scheduling apparatus is provided, comprising: an acquisition unit, configured to acquire running data of each load node in a cloud container cluster, wherein the running data includes resource status data, network quality data, GPU data, and heartbeat data packets; a determination unit, configured to, upon receiving a task request, determine task information corresponding to the task request, and determine a comprehensive score for each load node based on the running data and the task information; and a scheduling unit, configured to, based on the comprehensive score and a determined target load node, schedule the current task corresponding to the task request to the target load node, so that the current task can be processed by the target load node.
[0019] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform any of the described task scheduling methods.
[0020] According to another aspect of this application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including methods for performing any of the described task scheduling methods.
[0021] By applying the technical solution of this application, the runtime data (including resource status, network quality, GPU data, and heartbeat packets) of each load node in the cloud container cluster is acquired, and a comprehensive score is calculated in conjunction with task information to dynamically determine the target load node for task scheduling. This improves the intelligence level and resource utilization efficiency of distributed task scheduling. First, by introducing multi-dimensional real-time runtime data, the scheduler can accurately perceive the actual load, network status, and hardware health of nodes, avoiding task failures or performance degradation due to insufficient resources or network congestion. This is especially true in clusters rich in heterogeneous resources (such as GPUs), achieving more refined resource matching. Second, dynamically calculating the comprehensive score and selecting the optimal node improves the overall throughput and response speed of the cluster. This solves the problem of poor resource utilization in related task scheduling schemes. Attached Figure Description
[0022] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0023] Figure 1 A hardware structure block diagram of a mobile terminal for performing a task scheduling method according to an embodiment of this application is shown;
[0024] Figure 2 A flowchart illustrating a task scheduling method according to an embodiment of this application is shown;
[0025] Figure 3 An architecture diagram of a task scheduling system provided according to an embodiment of this application is shown;
[0026] Figure 4 A schematic diagram of a dependency scheduling process provided according to an embodiment of this application is shown;
[0027] Figure 5 A structural block diagram of a task scheduling apparatus provided according to an embodiment of this application is shown. Detailed Implementation
[0028] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0029] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0031] For ease of description, the following explains some of the nouns or terms used in the embodiments of this application:
[0032] Container: A container is a standard software packaging unit that packages an application and all its dependencies (code, libraries, configuration files) together to ensure that the application runs in the same way in any environment.
[0033] Cloud Container Orchestration Platform: An open-source container orchestration platform for automating the deployment, scaling, and management of containerized applications.
[0034] Container group: The smallest deployable computing unit in a cloud container network, containing one or more containers with shared storage and network resources.
[0035] Node: A node is a working machine in a cloud container cluster, that is, the host machine where the container group actually runs.
[0036] HTTP: HTTP defines the syntax and semantic rules for data transmission between clients and servers, including request methods (such as GET, POST, PUT, DELETE), status code classification, message header fields, and entity body format. It is used for requests and responses to hypertext resources in distributed information systems. It is usually based on TCP connections and runs on the default port 80 (unencrypted) or 443 (HTTPS / SSL encrypted). It adopts a request-response model and the protocol itself does not retain any state information of previous requests.
[0037] API: An API defines a set of callable functions, data exchange formats, communication protocols, authentication and authorization mechanisms, and error handling standards. By encapsulating internal implementation details, it exposes specific endpoints or service methods, enabling systems to achieve data transmission, function calls, and business logic integration without needing to understand each other's underlying architecture.
[0038] Sidecar containers: Sidecar containers are auxiliary containers that run in the same container group as the main application container. These containers enhance or extend the functionality of the main application container by providing additional services or features, such as logging, monitoring, security, or data synchronization, without directly modifying the main application code.
[0039] DAG (Directed Acyclic Graph): A graph data structure consisting of nodes (representing data, tasks, or states) and directed edges (representing dependencies between nodes or data flow). Its core characteristic is that there are no loops (i.e., it is impossible to start from a node and return to the original node along a directed edge), ensuring that the data flow or task execution order is deterministic.
[0040] Topological sorting is a linear sorting algorithm for DAGs (Directed Acyclic Graphs). Its core objective is to sort all nodes in the graph such that for each directed edge (u, v) (indicating that u is a prerequisite of v, i.e., u must be executed or processed before v), node u always appears before node v in the sorted result, thus satisfying the dependency constraint. In task scheduling systems, the sequence generated by topological sorting guides the executor to trigger tasks in the correct logical order, ensuring that dependency conditions are strictly adhered to and avoiding runtime errors caused by missing dependencies.
[0041] GPU (Graphics Processing Unit): A processor specifically designed for graphics rendering and parallel computing, offering significant computational acceleration capabilities in AI training and inference tasks. In the cloud-native and AI fields, GPUs have become the most scarce and critical acceleration hardware resource.
[0042] Heartbeat mechanism: The core communication mechanism used in distributed systems to ensure the availability of nodes or services. It is usually a fixed-format "heartbeat packet" (containing client identifier, status information, timestamp, etc.) sent periodically by the client (such as worker nodes or service instances in a cluster) to the server (such as cluster controller or registry center) to indicate that it is in a normal operating state.
[0043] Scheduler: The core component in a distributed system or computing platform responsible for resource allocation and task distribution. Its core function is to allocate tasks to be executed (or computing units such as container groups or containers) to appropriate execution nodes in the cluster according to preset scheduling strategies (such as resource utilization, task priority, node affinity, load balancing, etc.) so as to achieve efficient resource utilization and orderly task execution.
[0044] As described in the background section, the relevant task scheduling schemes have poor resource utilization. To address the problem of poor resource utilization in the relevant task scheduling schemes, embodiments of this application provide a task scheduling method, apparatus, computer-readable storage medium, and electronic device.
[0045] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0046] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a task scheduling method according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0047] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the task scheduling method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the aforementioned networks may include wireless networks provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0048] This embodiment provides a task scheduling method that runs on a mobile terminal, computer terminal, or similar computing device. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0049] Figure 2 This is a flowchart of a task scheduling method according to an embodiment of this application. For example... Figure 2 As shown, the method includes the following steps:
[0050] Step S201: Obtain the running data of each load node in the cloud container cluster, wherein the running data includes resource status data, network quality data, GPU data and heartbeat data packets;
[0051] Step S202: Upon receiving a task request, determine the task information corresponding to the task request, and determine the comprehensive score of each load node based on the running data of each load node and the task information.
[0052] Step S203: Based on the above comprehensive score and the determined target load node, schedule the current task corresponding to the above task request to the above target load node so that the above current task can be processed through the above target load node.
[0053] This embodiment utilizes steps S201, S202, and S203 to acquire operational data (including resource status, network quality, GPU data, and heartbeat packets) from each load node in the cloud container cluster. This data, combined with task information, is used to calculate a comprehensive score, dynamically determining the target load node for task scheduling. This improves the intelligence level and resource utilization efficiency of distributed task scheduling. First, by introducing multi-dimensional real-time operational data, the scheduler can accurately perceive the actual load, network status, and hardware health of nodes, avoiding task failures or performance degradation due to insufficient resources or network congestion. This is particularly beneficial in clusters rich in heterogeneous resources (such as GPUs), enabling more refined resource matching. Second, dynamically calculating the comprehensive score and selecting the optimal node improves the overall throughput and response speed of the cluster. This solves the problem of poor resource utilization in related task scheduling schemes.
[0054] In the specific implementation process, based on the above-mentioned operating data and task information of each load node, the comprehensive score of each load node is determined, including: when the task information indicates that GPU resources are required, calculating the load score, network score, GPU score and health score of each load node based on the above-mentioned operating data and task information of each load node; and determining the comprehensive score of each load node based on the above-mentioned load score, network score, GPU score and health score.
[0055] In this embodiment, when a task requires GPU resources, a comprehensive score is determined based on scores across four dimensions: computational load, network, GPU, and health. This addresses the pain points in scheduling scarce heterogeneous resources like GPUs, enabling refined and intelligent GPU resource management. Traditional scheduling often struggles to balance GPU computing power, memory usage, and task matching. This solution, through an independent GPU scoring model, considers not only the current idle state of the GPU but also the specific requirements of the task for the number of GPUs and memory, improving GPU resource utilization. Furthermore, by incorporating load, network, and health scores into a unified evaluation system, it ensures that when allocating high-value GPU resources, nodes must possess sufficient computing power, robust network communication capabilities, and stable operational status. This guarantees efficient and reliable execution of tasks with extremely high latency and stability requirements, such as AI training and inference. This multi-dimensional collaborative evaluation mechanism enables the system to find the most suitable and stable execution environment for GPU-intensive tasks in complex mixed load environments, significantly reducing task failure rates and improving the overall return on investment for the computing cluster.
[0056] Specifically, scheduling the current task corresponding to the above task request to the above target load node includes: constructing a directed acyclic graph based on the dependency relationship between each task, wherein the nodes of the directed acyclic graph are each of the above tasks, and the edges are the above dependency relationships between each of the above tasks; determining whether the above current task has a preceding dependent task based on the above task information and the above directed acyclic graph; and scheduling the above current task to the above target load node if there is no preceding dependent task.
[0057] This embodiment introduces dependency management based on a Directed Acyclic Graph (DAG). It determines whether to schedule a current task to the target load node by checking if there are any preceding dependent tasks. This automates and deterministically orchestrates complex business processes, reducing the complexity and error probability of business logic orchestration. By embedding a DAG resolver on the server, users only need to declare the dependencies between tasks, and the system automatically parses and maintains the dependency graph. A current task is added to the schedulable queue only when all preceding dependent tasks are completed, ensuring strict task execution order and data consistency. This mechanism is particularly suitable for AI workflows with strong dependencies, such as data preprocessing, model training, and model evaluation. It eliminates the risks of manual dependency management, improves the reliability and maintainability of workflow execution, and makes the implementation of complex business logic simpler and more intuitive.
[0058] More specifically, after determining whether the current task has any prerequisite tasks based on the task information and the directed acyclic graph, the method further includes: scheduling the prerequisite tasks to the target load node for processing, and after all the prerequisite tasks have been processed, scheduling the current task to the target load node for processing.
[0059] In this embodiment, it is further clarified that when there are prerequisite tasks, the prerequisite tasks must be scheduled and processed first, and the current task is scheduled only after the prerequisite tasks are completed. This ensures the complete execution and state synchronization of the multi-stage task chain, guaranteeing the correctness of task flow in a distributed environment. In multi-task dependency scenarios, there are strict temporal sequences and data transfer dependencies between tasks. If subsequent tasks are scheduled without waiting for the prerequisite tasks to complete, data loss or logical errors may occur. This solution dynamically monitors the execution status of prerequisite tasks, and only triggers the scheduling of the current task after confirming that all prerequisite tasks have been successfully processed, realizing event-driven automated task flow. This mechanism not only simplifies the user's workflow orchestration operations, but also ensures, through centralized state tracking on the server side, that the system can accurately determine task dependencies even in abnormal situations such as node failures or network fluctuations, avoiding deadlocks or infinite waiting, improving the fault tolerance and execution efficiency of the distributed task system, and ensuring the end-to-end correct execution of complex business logic.
[0060] Further, based on the aforementioned operational data and task information of each load node, the load score, network score, GPU score, and health score corresponding to each load node are calculated, including: calculating the load score corresponding to each load node based on the aforementioned resource status data, wherein the aforementioned resource status data includes CPU utilization, memory utilization, number of tasks being executed, and maximum number of concurrent tasks; calculating the network score corresponding to each load node based on the aforementioned network quality data, wherein the aforementioned network quality data includes network latency, packet loss rate, and available network bandwidth; calculating the GPU score corresponding to each load node based on the aforementioned GPU data and the aforementioned task information, wherein the aforementioned GPU data includes GPU computing unit utilization, GPU used memory, and total memory, and the aforementioned task information includes the number of GPUs required by the task and the memory required by the task; and calculating the health score corresponding to each load node based on the aforementioned heartbeat data packet, wherein the aforementioned heartbeat data packet includes the time interval between the current time and the last successfully received heartbeat packet, the number of successful tasks, and the total number of tasks.
[0061] This embodiment defines specific scoring calculation schemes and corresponding input data for four dimensions: load, network, GPU, and health. It provides quantifiable and interpretable scheduling decision-making criteria, making the scheduling process more scientific and transparent. By transforming abstract resource states into concrete numerical scores, the scheduler can eliminate subjective judgment biases and achieve objective resource allocation. For example, the load score integrates CPU, memory, and task slots, avoiding decision blind spots caused by single indicators; the network score, through a comprehensive consideration of latency, packet loss rate, and bandwidth, ensures the best network experience for low-latency sensitive tasks; the GPU score combines computational utilization and memory matching, achieving fine-grained allocation of heterogeneous resources; and the health score, based on heartbeat stability and task success rate, effectively eliminates potentially unstable nodes. This fine-grained quantitative evaluation mechanism not only improves scheduling accuracy but also allows system administrators to adjust weight parameters to adapt to different business scenario requirements (such as prioritizing low latency or high throughput), enhancing the system's flexibility and adaptability, and providing customized optimal scheduling strategies for different types of loads.
[0062] Furthermore, based on the aforementioned operational data and task information of each load node, the load score, network score, GPU score, and health score corresponding to each load node are calculated, including:
[0063] According to the first formula: The above load score is calculated, where LoadScore is the load score, CPUUtil is the CPU utilization, MemUtil is the memory utilization, CurrentTasks is the number of tasks currently executing, and MaxTasks is the maximum number of concurrent tasks. , , These are the weighting coefficients;
[0064] According to the second formula: Calculate the network score mentioned above, where NetworkScore is the network score, Latency is the network latency, PacketLoss is the packet loss rate, and Bandwidth is the available network bandwidth. , , These are the weighting coefficients;
[0065] According to the third formula: The above GPU score is calculated, where GPUScore is the GPU score, GPUUtil is the GPU computing unit utilization, GPUMemUsed and GPUMemTotal are the GPU's used and total video memory, respectively, TaskGPU is the number of GPUs required for the task, NodeGPU is the number of GPUs on the node, TaskGPUMem is the video memory required for the task, and AvailableGPUMem is the GPU's available video memory. , , , These are the weighting coefficients;
[0066] According to the fourth formula: Calculate the above health score, where HealthScore is the health score, SuccessTasks is the number of successfully executed tasks, TotalTasks is the total number of tasks scheduled to the above load nodes, α is the penalty coefficient, Δt is the time interval between the current time and the last successfully received heartbeat packet, and T is the expected heartbeat time interval.
[0067] This embodiment provides specific mathematical formulas for load, network, GPU, and health scores, thus clarifying the reproducibility, configurability, and optimization space of the scheduling algorithm. Specific mathematical models (such as linear weighting in load scoring, the exponential decay function in network scoring, and the penalty mechanism in health scoring) ensure the determinism and consistency of score calculations, avoiding unpredictable scheduling results due to algorithmic ambiguity. In particular, the use of an exponential decay function to handle latency indicators in network scoring can keenly reflect the advantages of low-latency nodes while maintaining a certain tolerance for high-latency nodes, consistent with the nonlinear characteristics of real-world network environments. The dynamic penalty mechanism in health scoring effectively identifies and avoids nodes that, while currently having sufficient resources, have historically poor performance or unstable heartbeats, improving the overall stability of the system.
[0068] Specifically, based on the above-mentioned operating data and task information of each of the above-mentioned load nodes, the comprehensive score of each of the above-mentioned load nodes is determined, including: when the task information indicates that GPU resources are not required, calculating the load score, network score and health score of each of the above-mentioned load nodes based on the above-mentioned operating data and task information of each of the above-mentioned load nodes; and determining the comprehensive score of each of the above-mentioned load nodes based on the above-mentioned load score, network score and health score.
[0069] In this embodiment, when a task does not require GPU resources, only load, network, and health scores are calculated to determine the overall score. This achieves dynamic adaptation of scheduling resources and optimization of computational overhead, improving the overall execution efficiency of the system. Not all tasks require GPU resources. For CPU-intensive or I / O-intensive tasks, forcibly calculating GPU scores not only wastes computational resources but may also increase the complexity of the scoring model. This solution dynamically adjusts the scoring dimensions based on task type, avoiding unnecessary computational overhead and improving the scheduler's response speed. Simultaneously, for non-GPU tasks, the focus is on load, network, and health dimensions, ensuring that these tasks can execute in an environment with the lowest load, optimal network, and most stable nodes, further improving the scheduling quality of general-purpose tasks. This on-demand scoring mechanism allows the scheduler to flexibly handle mixed load scenarios, ensuring efficient scheduling of GPU tasks while also considering the economy and efficiency of ordinary tasks, achieving optimal global resource utilization.
[0070] To enable those skilled in the art to better understand the technical solution of this application, the implementation process of the task scheduling method of this application will be described in detail below with reference to specific embodiments.
[0071] This embodiment relates to a task scheduling system. The system adopts a classic client-server distributed architecture, mainly consisting of two parts: the server side and the client side. Figure 3 As shown, it specifically includes the following:
[0072] The server is the control center of the entire system and mainly consists of the following modules:
[0073] API Routing Layer: An HTTP service implemented based on a lightweight web service framework, responsible for request routing, parameter validation, and response encapsulation. APIs are divided into two categories: External APIs and Internal APIs. External APIs are for users or upper-layer systems to call, while internal APIs are for clients to call.
[0074] Scheduler: The core component of the system, implementing dependency scheduling based on DAG and intelligent scheduling based on multi-dimensional scoring. The scheduler maintains a client state table and a queue of tasks to be scheduled, and periodically executes a scheduling loop.
[0075] Data Access Layer: A database access layer implemented based on an object-relational mapping framework, which encapsulates all database operations, including client information management and task information management.
[0076] The Client is an execution agent distributed across nodes in the cluster, and mainly consists of the following modules:
[0077] Executors: An executor framework with a plug-in design manages various types of executors through a registry model. Each executor implements a unified interface, including task verification, capability checking, and task execution.
[0078] Metrics Collector: Responsible for collecting system metrics of nodes, including CPU utilization, memory utilization, disk utilization, GPU status, and network latency.
[0079] Heartbeat Management: Responsible for periodically sending heartbeats to the server and reporting node status and resource information.
[0080] Task retrieval: Responsible for periodically retrieving tasks assigned to this node from the server and submitting them to the executor for execution.
[0081] The scheduler is the core component of the system, responsible for maintaining the resource status of each client, including CPU utilization, total and used memory, number of GPUs and video memory, and the number of currently executing tasks. During scheduling, the scheduler checks whether the target node meets the resource requirements of the task to avoid task failure due to insufficient resources. When the scheduler needs to select an execution node for a task, it scores all available nodes based on the following four dimensions:
[0082] 1. Load rating:
[0083] Load awareness score reflects the current resource usage of a node, and the calculation formula is as follows: ;
[0084] Here, CPUUtil represents the current CPU utilization percentage, MemUtil represents the current memory utilization percentage, CurrentTasks represents the number of currently executing tasks, and MaxTasks represents the maximum number of concurrent tasks configured for the node. , , The weights for each factor are defined. Nodes with lower loads score higher, taking into account CPU, memory, and task slots to avoid decision-making biases caused by a single metric.
[0085] 2. Online rating:
[0086] Network awareness score reflects the network communication quality of a node, and the calculation formula is as follows: ;
[0087] Where Latency is the network latency from the node to the server (milliseconds), PacketLoss is the percentage of packet loss, and Bandwidth is the available network bandwidth (Mbps). , , The weights for each factor are denoted by . The latency scoring uses an exponential decay function, ensuring that low-latency nodes receive significantly higher scores while maintaining a certain tolerance for high-latency nodes.
[0088] 3. GPU score:
[0089] For tasks that require GPU resources, the GPU's perception score will be included in the overall score, calculated using the following formula: ;
[0090] Where GPUUtil represents the percentage of GPU computing unit utilization, GPUMemUsed and GPUMemTotal represent used and total video memory, respectively, TaskGPU and NodeGPU represent the number of GPUs required for the task and the number of GPUs on the node, respectively, TaskGPUMem and AvailGPUMem represent the video memory required for the task and the available video memory, respectively, and weights... 3, , , 2. It considers both the current idle level of the GPU and the matching degree of resource demand to avoid wasting resources by scheduling small tasks to large GPU nodes.
[0091] 4. Health Score:
[0092] A health score is calculated based on the stability of the client's historical heartbeats and the task success rate, using the following formula:
[0093] ;
[0094] Where SuccessTasks represents the number of tasks that were successfully executed, and TotalTasks represents the total number of tasks that have been scheduled to this node. The penalty coefficient is... The current time is the time interval since the last successful receipt of a heartbeat packet, and T is the expected heartbeat interval.
[0095] 5. Overall Score:
[0096] The final overall score is obtained by weighted summation and normalization: ;
[0097] The weights for each dimension can be configured independently, and the scheduler selects the node with the highest overall score as the execution node for the task.
[0098] For tasks with dependencies, the scheduler implements a DAG (Directed Acyclic Graph) scheduling algorithm. When a task is created, it can specify a list of dependent task IDs. The scheduler maintains a dependency graph between tasks, using in-degree counting to track the number of incomplete dependencies for each task. The scheduler uses topological sorting to check for dependency cycles between tasks. When a task completes, the system iterates through all tasks that depend on it, decrementing their in-degrees by one. Only when all of a task's prerequisites are completed is the task added to the schedulable queue.
[0099] For example, for an AI training task, such as Figure 4 As shown, the first step is to prepare the dataset and related environment configuration. Before model training begins, the dataset needs to be preprocessed to convert the data into a format that matches the model's input. After training, the model needs to be evaluated. Therefore, in the task chain described above, the data preprocessing task depends on the data download task, the model training task depends on both the configuration preparation and data preprocessing tasks, and the model evaluation task depends on the model training task. Each task can only begin after all its dependent tasks are completed.
[0100] The system employs a pluggable executor framework, decoupling executors through interface abstraction and a registry pattern. Each executor needs to implement a unified interface, including methods for returning the executor name, a list of supported task types, parameter validation, capability checks, and task execution.
[0101] The new executor only needs to implement the interface and register it to the global registry during initialization to be automatically recognized and used by the system. This design makes the system easily extensible and allows for the convenient addition of support for new task types.
[0102] The Server is deployed as the centralized control plane of the scheduling system. The Server container exposes an HTTP port and provides a stable access point through the cloud container network service. This service provides a fixed DNS domain name, through which all Client instances communicate with the Server, thus decoupling the Client's dependency on the Server container group's temporary IP address. The system is also configured with a liveness probe that periodically probes health check endpoints, enabling the cloud container orchestration platform to automatically detect and restart unresponsive Server container groups.
[0103] The server relies on a database for persistent storage, saving client registration records and task metadata. The database can be deployed as a container group within a cluster or used as an externally hosted database service. In the latter case, by creating a cloud container service and manually defining endpoint resources, the database address is mapped to the cluster service discovery mechanism, enabling the server to access the database via the cluster's internal DNS name.
[0104] The Client component acts as a distributed proxy, responsible for heartbeat reporting, task retrieval, and task execution. Unlike a centralized Server, Client instances are deployed in a distributed manner across the entire cluster to achieve node-level coverage and workload-oriented functionality. Client instances are deployed using a cloud container daemon set, which ensures that exactly one Client runs on each node that meets the specified node selector or tolerance rules.
[0105] In scenarios where the client needs to run within the context of existing user workloads, the system supports a sidecar deployment mode. In this mode, the client container resides within the same container group as the main application container, sharing the container group's network namespace and optionally mounting shared storage volumes. This approach enables the client to monitor the main container's resource usage and execute tasks within the same network context.
[0106] The system initialization process is as follows:
[0107] 1. Basic service activation:
[0108] The cloud container network cluster needs to be fully deployed and operational, with all worker nodes in a ready state. On GPU nodes, the GPU device plugin daemon set must be deployed and confirmed to be functioning correctly so that GPU resources can report to the scheduler. The database instance starts and initializes the necessary table structures, while creating the corresponding cloud container network services and endpoint resources, enabling the database to be accessed through the cluster's internal DNS.
[0109] 2. Server startup:
[0110] After deploying the Server application into the cluster and creating the container group, the Server container loads its configuration file, reads the database connection string from environment variables, and establishes a connection to the database. The system creates a scheduler instance, loads the configured scoring weights (load weight, network weight, GPU weight, health weight) and scheduling policies. Background jobs begin periodic scheduling loops and start monitoring expired client registration records. Finally, the Server starts listening, the liveness probe becomes responsive, and at this point, the cloud container network service routes external traffic to the Server container.
[0111] 3. Client Registration:
[0112] Once the Server service is available, the Client daemon set is deployed. Each Client container, upon startup, first initializes its service context, reads the container group's metadata from environment variables, and checks local hardware capabilities (CPU utilization, memory, disk, etc.). The Client then enters the main loop, and the heartbeat sending job immediately sends its first heartbeat to the Server. This heartbeat carries a complete node profile, including hardware parameters, resource utilization, supported task types, deployment mode, tags, and health score. Upon receiving the heartbeat, the Server modifies the Client registry, updating existing records with the latest metrics if they already exist. Simultaneously, the scheduler updates the Client status table, making the node eligible to accept task scheduling. Once both the Server and Client are ready, the system enters a steady-state running loop.
[0113] The execution flow of the task scheduling system is as follows:
[0114] 1. Task creation process:
[0115] 1) The user sends an HTTP request to the external interface provided by the server, and the request body contains a list of tasks.
[0116] 2) The server parses the request parameters and verifies their validity. For each task, it parses information such as the task type, task parameters, and metadata.
[0117] 3) The server populates the task model based on task information (category, whether GPU is required, executor type, etc.) and persists the task model to the database, with the initial status set to "created".
[0118] 4) If the task has dependencies, the server will parse the dependency list, initialize the dependency count, and set the task status to "waiting for dependencies".
[0119] 5) The server returns a response indicating that the task has been successfully created, including a list of task IDs.
[0120] 2. Task scheduling process:
[0121] 1) The scheduler is triggered in two ways: timed triggering, which executes the scheduling in the background at fixed time intervals; and event triggering, which is triggered by events such as new task creation or task completion.
[0122] 2) The scheduler will add tasks that have been created and whose prerequisite tasks have been completed to the scheduling queue.
[0123] 3) The scheduler obtains the latest status of all clients.
[0124] 4) For each task to be scheduled, the scheduler first filters out clients capable of executing the task (checking task type support and resource availability). For tasks requiring GPUs, only clients with GPUs and sufficient resources are retained. Next, a score is calculated for the remaining clients, and the client with the highest score is assigned to the task, while the task record is updated.
[0125] 3. Task execution process:
[0126] 1) Task retrieval is triggered periodically, with the Client sending requests to the Server's internal interface.
[0127] 2) The server returns a list of tasks assigned to the client.
[0128] 3) The Client iterates through the task list. For each task, it parses the task parameters, extracts the task's metadata, and then retrieves the corresponding executor from the executor registry based on the task type.
[0129] 4) The executor verifies the validity of the task parameters and checks whether the node has the execution capability (e.g., GPU check). If the task parameters are valid and the node meets the task resource requirements, the executor constructs and executes the command.
[0130] 5) After execution, the executor encapsulates the results, including output content, execution status, and execution time. The client then reports the results to the server.
[0131] 4. Result Processing Flow:
[0132] 1) The server receives the result reporting request and parses the task ID and execution result.
[0133] 2) The server updates the task record, sets the task status to "completed" or "failed", saves the results, and records the completion time.
[0134] 3) If the task fails to execute and the number of retries has not exceeded, the server can reset the task status to "created" and wait for rescheduling.
[0135] 4) The server checks if any other tasks depend on this task. If so, it updates the dependency counts of these tasks. When a task's dependency count reaches zero, that task becomes schedulable.
[0136] This embodiment specifically achieves the following technical effects:
[0137] 1. This solution introduces a lightweight scheduling framework. The control plane consists of only one server, eliminating the need for complex components. Users create tasks through the HTTP API provided by the server. Developers do not need to use specific development frameworks or declare task flows and dependencies through complex coding methods, reducing the developer burden. Meanwhile, the resident client is responsible for task retrieval, execution, and reporting. When executing tasks, it is not necessary to start a new container group for each task, making task execution more lightweight and resulting in lower startup latency.
[0138] 2. The scheduling decision of this solution is based on real-time collected multi-dimensional load indicators such as CPU, memory, network, and GPU, rather than static declarations. This allows the scheduler to perceive the real load status of nodes and allocate the optimal execution node to the task, thereby improving the overall throughput and resource utilization of the cluster.
[0139] 3. A DAG dependency resolver is built into the server, so users do not need to hardcode the task order in the business code. They only need to declare the dependency fields when creating tasks, which greatly reduces the orchestration cost and error probability of complex business logic.
[0140] 4. The client side adopts a pluggable executor framework. To add a new task type (such as big data processing), you only need to implement the standard Executor interface and register it. There is no need to modify the core scheduling logic, which enables the system to quickly adapt to constantly changing task requirements.
[0141] This application also provides a task scheduling device. It should be noted that the task scheduling device of this application can be used to execute the task scheduling method provided in this application. This device is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0142] The task scheduling device provided in the embodiments of this application will be described below.
[0143] Figure 5 This is a schematic diagram of a task scheduling device according to an embodiment of this application. Figure 5 As shown, the device includes:
[0144] The acquisition unit 51 is used to acquire the running data of each load node in the cloud container cluster, wherein the above-mentioned running data includes resource status data, network quality data, GPU data and heartbeat data packets;
[0145] The determining unit 52 is used to determine the task information corresponding to the task request when a task request is received, and to determine the comprehensive score of each load node based on the running data of each load node and the task information.
[0146] The scheduling unit 53 is used to schedule the current task corresponding to the task request to the target load node based on the comprehensive score and the target load node, so that the current task can be processed by the target load node.
[0147] In this embodiment, by acquiring the operational data (including resource status, network quality, GPU data, and heartbeat packets) of each load node in the cloud container cluster and combining it with task information to calculate a comprehensive score, the target load node is dynamically determined for task scheduling. This improves the intelligence level and resource utilization efficiency of distributed task scheduling. First, by introducing multi-dimensional real-time operational data, the scheduler can accurately perceive the actual load, network status, and hardware health of nodes, avoiding task failures or performance degradation due to insufficient resources or network congestion. This is especially true in clusters rich in heterogeneous resources (such as GPUs), achieving more refined resource matching. Second, dynamically calculating the comprehensive score and selecting the optimal node improves the overall throughput and response speed of the cluster. This solves the problem of poor resource utilization in related task scheduling schemes.
[0148] As an optional solution, the determining unit includes a first calculation module and a first determining module; the first calculation module is used to calculate the load score, network score, GPU score and health score corresponding to each of the above-mentioned load nodes based on the above-mentioned running data and the above-mentioned task information when the above-mentioned task information indicates that GPU resources are required; the first determining module is used to determine the above-mentioned comprehensive score of each of the above-mentioned load nodes based on the above-mentioned load score, the above-mentioned network score, the above-mentioned GPU score and the above-mentioned health score.
[0149] In one optional scheme, the scheduling unit includes a construction module and a first scheduling module; the construction module is used to construct a directed acyclic graph based on the dependencies between tasks, wherein the nodes of the directed acyclic graph are the tasks and the edges are the dependencies between the tasks; the first scheduling module is used to determine whether the current task has any prerequisite tasks based on the task information and the directed acyclic graph, and if there are no prerequisite tasks, to schedule the current task to the target load node.
[0150] In an optional scheme, the scheduling unit further includes a second scheduling module, which, after determining whether the current task has any prerequisite tasks based on the task information and the directed acyclic graph, schedules the prerequisite tasks to the target load node for processing, and, after all the prerequisite tasks have been processed, schedules the current task to the target load node for processing through the target load node.
[0151] An optional scheme, the first computing module includes a first computing submodule, a second computing submodule, a third computing submodule, and a fourth computing submodule; the first computing submodule is used to calculate the load score corresponding to each of the aforementioned load nodes based on the aforementioned resource status data, wherein the aforementioned resource status data includes CPU utilization, memory utilization, the number of tasks being executed, and the maximum number of concurrent tasks; the second computing submodule is used to calculate the network score corresponding to each of the aforementioned load nodes based on the aforementioned network quality data, wherein the aforementioned network quality data includes network latency, packet loss rate, and available network bandwidth; the third computing submodule is used to calculate the GPU score corresponding to each of the aforementioned load nodes based on the aforementioned GPU data and the aforementioned task information, wherein the aforementioned GPU data includes GPU computing unit utilization, GPU used memory and total memory, and the aforementioned task information includes the number of GPUs required by the task and the memory required by the task; the fourth computing submodule is used to calculate the health score corresponding to each of the aforementioned load nodes based on the aforementioned heartbeat data packet, wherein the aforementioned heartbeat data packet includes the time interval between the current time and the last successfully received heartbeat packet, the number of successful tasks, and the total number of tasks.
[0152] In one alternative, the first calculation module further includes a fifth calculation submodule, a sixth calculation submodule, a seventh calculation submodule, and an eighth calculation submodule;
[0153] The fifth calculation submodule is used to calculate based on the first formula: The above load score is calculated, where LoadScore is the load score, CPUUtil is the CPU utilization, MemUtil is the memory utilization, CurrentTasks is the number of tasks currently executing, and MaxTasks is the maximum number of concurrent tasks. , , These are the weighting coefficients;
[0154] The sixth calculation submodule is used to calculate based on the second formula: Calculate the network score mentioned above, where NetworkScore is the network score, Latency is the network latency, PacketLoss is the packet loss rate, and Bandwidth is the available network bandwidth. , , These are the weighting coefficients;
[0155] The seventh calculation submodule is used to calculate based on the third formula: The above GPU score is calculated, where GPUScore is the GPU score, GPUUtil is the GPU computing unit utilization, GPUMemUsed and GPUMemTotal are the GPU's used and total video memory, respectively, TaskGPU is the number of GPUs required for the task, NodeGPU is the number of GPUs on the node, TaskGPUMem is the video memory required for the task, and AvailableGPUMem is the GPU's available video memory. , , , These are the weighting coefficients;
[0156] The eighth calculation submodule is used based on the fourth formula: Calculate the above health score, where HealthScore is the health score, SuccessTasks is the number of successfully executed tasks, TotalTasks is the total number of tasks scheduled to the above load nodes, α is the penalty coefficient, Δt is the time interval between the current time and the last successfully received heartbeat packet, and T is the expected heartbeat time interval.
[0157] In one optional scheme, the determining unit includes a second calculation module and a second determining module; the second calculation module is used to calculate the load score, network score and health score corresponding to each of the above-mentioned load nodes based on the above-mentioned running data and the above-mentioned task information when the above-mentioned task information does not require the use of GPU resources; the second determining module is used to determine the above-mentioned comprehensive score of each of the above-mentioned load nodes based on the above-mentioned load score, the above-mentioned network score and the above-mentioned health score.
[0158] The aforementioned task scheduling device includes a processor and a memory. The acquisition unit, determination unit, scheduling unit, etc., are all stored as program units in the memory, and the processor executes the program units stored in the memory to achieve the corresponding functions. All of the above modules are located in the same processor; alternatively, the above modules may be located in different processors in any combination.
[0159] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured; adjusting kernel parameters can address issues with poor resource utilization in task scheduling schemes.
[0160] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0161] This invention provides a computer-readable storage medium including a stored program, wherein the program, when running, controls the device where the computer-readable storage medium is located to execute the task scheduling method.
[0162] Specifically, task scheduling methods include:
[0163] Step S201: Obtain the running data of each load node in the cloud container cluster, wherein the running data includes resource status data, network quality data, GPU data and heartbeat data packets;
[0164] Step S202: Upon receiving a task request, determine the task information corresponding to the task request, and determine the comprehensive score of each load node based on the running data of each load node and the task information.
[0165] Step S203: Based on the above comprehensive score and the determined target load node, schedule the current task corresponding to the above task request to the above target load node so that the above current task can be processed through the above target load node.
[0166] This invention provides a processor for running a program, wherein the program executes the task scheduling method described above.
[0167] Specifically, task scheduling methods include:
[0168] Step S201: Obtain the running data of each load node in the cloud container cluster, wherein the running data includes resource status data, network quality data, GPU data and heartbeat data packets;
[0169] Step S202: Upon receiving a task request, determine the task information corresponding to the task request, and determine the comprehensive score of each load node based on the running data of each load node and the task information.
[0170] Step S203: Based on the above comprehensive score and the determined target load node, schedule the current task corresponding to the above task request to the above target load node so that the above current task can be processed through the above target load node.
[0171] This invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps:
[0172] Step S201: Obtain the running data of each load node in the cloud container cluster, wherein the running data includes resource status data, network quality data, GPU data and heartbeat data packets;
[0173] Step S202: Upon receiving a task request, determine the task information corresponding to the task request, and determine the comprehensive score of each load node based on the running data of each load node and the task information.
[0174] Step S203: Based on the above comprehensive score and the determined target load node, schedule the current task corresponding to the above task request to the above target load node so that the above current task can be processed through the above target load node.
[0175] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.
[0176] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having at least the following method steps:
[0177] Step S201: Obtain the running data of each load node in the cloud container cluster, wherein the running data includes resource status data, network quality data, GPU data and heartbeat data packets;
[0178] Step S202: Upon receiving a task request, determine the task information corresponding to the task request, and determine the comprehensive score of each load node based on the running data of each load node and the task information.
[0179] Step S203: Based on the above comprehensive score and the determined target load node, schedule the current task corresponding to the above task request to the above target load node so that the above current task can be processed through the above target load node.
[0180] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0181] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0182] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0183] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0184] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0185] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0186] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0187] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0188] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0189] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0190] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A task scheduling method, characterized in that, include: Obtain the running data of each load node in the cloud container cluster, wherein the running data includes resource status data, network quality data, GPU data and heartbeat data packets; Upon receiving a task request, the task information corresponding to the task request is determined, and a comprehensive score for each load node is determined based on the running data of each load node and the task information. Based on the comprehensive score and the determined target load node, the current task corresponding to the task request is scheduled to the target load node so that the current task can be processed by the target load node.
2. The method according to claim 1, characterized in that, Based on the operating data and task information of each load node, a comprehensive score is determined for each load node, including: When the task information indicates that GPU resources are required, the load score, network score, GPU score and health score corresponding to each load node are calculated based on the running data of each load node and the task information. The comprehensive score of each load node is determined based on the load score, the network score, the GPU score, and the health score.
3. The method according to claim 1, characterized in that, Scheduling the current task corresponding to the task request to the target load node includes: A directed acyclic graph is constructed based on the dependencies between tasks, wherein the nodes of the directed acyclic graph are the tasks, and the edges are the dependencies between the tasks. Based on the task information and the directed acyclic graph, determine whether the current task has any prerequisite tasks. If there are no prerequisite tasks, schedule the current task to the target load node.
4. The method according to claim 3, characterized in that, After determining whether the current task has a preceding dependent task based on the task information and the directed acyclic graph, the method further includes: The preceding dependent tasks are scheduled to the target load node for processing. Once all the preceding dependent tasks have been processed, the current task is scheduled to the target load node for processing.
5. The method according to claim 2, characterized in that, Based on the operational data and task information of each load node, calculate the load score, network score, GPU score, and health score corresponding to each load node, including: Based on the resource status data, the load score corresponding to each load node is calculated, wherein the resource status data includes CPU utilization, memory utilization, number of tasks being executed, and maximum number of concurrent tasks; Based on the network quality data, calculate the network score corresponding to each load node, wherein the network quality data includes network latency, packet loss rate, and available network bandwidth; Based on the GPU data and the task information, the GPU score corresponding to each load node is calculated, wherein the GPU data includes GPU computing unit utilization, GPU used video memory and total video memory, and the task information includes the number of GPUs required for the task and the video memory required for the task. Based on the heartbeat data packet, calculate the health score corresponding to each load node, wherein the heartbeat data packet includes the time interval between the current time and the last successful receipt of the heartbeat packet, the number of successful tasks, and the total number of tasks.
6. The method according to claim 5, characterized in that, Based on the operational data and task information of each load node, calculate the load score, network score, GPU score, and health score corresponding to each load node, including: According to the first formula: The load score is calculated, where LoadScore is the load score, CPUUtil is the CPU utilization, MemUtil is the memory utilization, CurrentTasks is the number of tasks currently executing, and MaxTasks is the maximum number of concurrent tasks. , , These are the weighting coefficients; According to the second formula: Calculate the network score, where NetworkScore is the network score, Latency is the network latency, PacketLoss is the packet loss rate, and Bandwidth is the available network bandwidth. , , These are the weighting coefficients; According to the third formula: The GPU score is calculated, where GPUScore is the GPU score, GPUUtil is the GPU computing unit utilization, GPUMemUsed and GPUMemTotal are the GPU's used video memory and total video memory, respectively, TaskGPU is the number of GPUs required for the task, NodeGPU is the number of GPUs on the node, TaskGPUMem is the video memory required for the task, and AvailableGPUMem is the GPU's available video memory. , , , These are the weighting coefficients; According to the fourth formula: The health score is calculated, where HealthScore is the health score, SuccessTasks is the number of successfully executed tasks, TotalTasks is the total number of tasks scheduled to the load node, α is the penalty coefficient, Δt is the time interval between the current time and the last successfully received heartbeat packet, and T is the expected heartbeat time interval.
7. The method according to claim 1, characterized in that, Based on the operating data and task information of each load node, a comprehensive score is determined for each load node, including: When the task information representation does not require the use of GPU resources, the load score, network score and health score corresponding to each load node are calculated based on the running data of each load node and the task information. The comprehensive score of each load node is determined based on the load score, the network score, and the health score.
8. A task scheduling device, characterized in that, include: The acquisition unit is used to acquire the running data of each load node in the cloud container cluster, wherein the running data includes resource status data, network quality data, GPU data and heartbeat data packets; The determining unit is configured to, upon receiving a task request, determine the task information corresponding to the task request, and determine the comprehensive score of each load node based on the running data of each load node and the task information. The scheduling unit is used to schedule the current task corresponding to the task request to the target load node based on the comprehensive score and the determined target load node, so that the current task can be processed by the target load node.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the task scheduling method according to any one of claims 1 to 7.
10. An electronic device, characterized in that, include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including a task scheduling method according to any one of claims 1 to 7.
