Method, device, equipment, medium and program product for cross-cluster task scheduling

By using a multilayer perceptron neural network structure with high-level and low-level agents, sub-clusters and sub-nodes are dynamically selected, solving the problem of uneven resource allocation in cross-cluster task scheduling and achieving efficient resource utilization and reduced network latency.

CN123157346APending Publication Date: 2026-11-24CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510679890.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Traditional cross-cluster task scheduling methods lack comprehensive consideration of sub-cluster load and node status, making it difficult to adapt to dynamic and ever-changing workloads, resulting in poor cross-cluster resource allocation and utilization.

Method used

A multilayer perceptron neural network structure with high-level and low-level agents is adopted. By acquiring the state set and resource indicators, the selection probability is calculated using the maximum value function, and sub-clusters and sub-nodes are dynamically selected as task allocation targets. The agent parameters are optimized by combining the experience replay area and gradient descent algorithm to achieve resource balance and dynamic scheduling.

Benefits of technology

It improves the overall utilization of cross-cluster resources, reduces network latency, and enhances the adaptability and efficiency of scheduling through agent training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123157346A_ABST
    Figure CN123157346A_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, device, medium, and program product for cross-cluster task scheduling. The process involves inputting a scheduling task, obtaining the state set of a high-level agent based on the task and converting it into a first input vector; inputting this first input vector into the high-level agent to obtain the selection score of the sub-clusters in the cluster; calculating the selection probability of the sub-clusters using a maximum value function based on the selection scores; determining the first maximum selection probability and using the corresponding sub-cluster as the task's assigned sub-cluster; determining the state set of a low-level agent based on the assigned sub-cluster and converting it into a second input vector; inputting this second input vector into the low-level agent to obtain the selection score of the child nodes in the sub-clusters; calculating the selection probability of the child nodes using a maximum value function based on their selection scores; determining the second maximum selection probability and using the corresponding child node as the running node assigned to the scheduling task; and executing the scheduling task using this running node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence, and in particular to a method, apparatus, device, medium, and program product for cross-cluster task scheduling. Background Technology

[0002] With the rapid development of big data and the ever-increasing scale of data across industries, effectively storing, managing, and processing this data has become a significant challenge for enterprises. Distributed computing frameworks, with their high reliability, scalability, and fault tolerance, provide a powerful data processing environment, laying the foundation for the storage and computation of massive amounts of data. Enterprises and organizations typically require multiple distributed framework clusters to meet their distributed data storage and computation needs. However, due to the wide distribution of resources and the diversity of application requirements, achieving efficient task scheduling across multiple resource management system clusters is challenging.

[0003] Currently, traditional scheduling methods, such as rule-based static scheduling or simple priority scheduling, lack comprehensive consideration of sub-cluster load and node status in scheduling scenarios across multiple resource management system clusters, making it difficult to adapt to dynamically changing workloads. This results in poor allocation and utilization of cross-cluster resources. Summary of the Invention

[0004] This application provides a method, apparatus, device, medium, and program product for cross-cluster task scheduling, in order to improve the allocation and utilization of cross-cluster resources.

[0005] In a first aspect, embodiments of this application provide a method for cross-cluster task scheduling, comprising: inputting a scheduling task; obtaining a state set of high-level agents based on the scheduling task; converting the state set of high-level agents into a first input vector; inputting the first input vector into the high-level agents to obtain selection scores for sub-clusters in the cluster; calculating the selection probability of any sub-cluster in the cluster based on the selection score of the sub-cluster using a maximum value function; determining a first maximum selection probability based on the selection probability of the sub-cluster; and selecting the sub-cluster corresponding to the first maximum selection probability as the sub-cluster to which the task is assigned; determining a state set of low-level agents based on the assigned sub-cluster; converting the state set of low-level agents into a second input vector; inputting the second input vector into the low-level agents to obtain selection scores for child nodes in the sub-cluster; calculating the selection probability of any child node in the sub-cluster based on the selection score of the child node using a maximum value function; determining a second maximum selection probability based on the selection probability of the child node; and selecting the child node corresponding to the second maximum selection probability as the running node to which the scheduling task is assigned; and executing the scheduling task using the assigned running node.

[0006] In one possible implementation, before inputting a scheduling task and obtaining the state set of high-level agents based on the scheduling task, the method further includes: obtaining cross-cluster cluster parameter information and real-time resource indicators of the cluster; constructing an action set for the agents based on the cross-cluster cluster parameter information and real-time resource indicators of the cluster; defining a scheduling task set; constructing the state set of the agents based on the cross-cluster cluster parameter information, real-time resource indicators of the cluster, and the scheduling task set; and constructing an experience replay area based on the storage capacity of the agents. The agents include high-level agents and low-level agents, and the experience replay area represents the storage location of the execution results of the scheduling tasks.

[0007] In one possible implementation, after executing the task using the assigned running node, the method further includes: obtaining task execution metrics, calculating the agent's reward value based on the task execution metrics, and storing the agent's reward value in an experience replay area; using the action set corresponding to the assigned sub-cluster in the high-level agent as the action set of the high-level agent during task execution, and storing it in the experience replay area of ​​the high-level agent; determining the action set of the low-level agent based on the assigned sub-cluster; using the action set of the low-level agent as the action set of the low-level agent during task execution and storing it in the experience replay area of ​​the low-level agent; using the current state set of the high-level agent as the next state set of the high-level agent; storing the state set and the next state set of the high-level agent in the experience replay area of ​​the high-level agent; using the current state set of the low-level agent as the next state set of the low-level agent; and storing the state set and the next state set of the low-level agent in the experience replay area of ​​the low-level agent.

[0008] In one possible implementation, it is determined whether the amount of data in the experience replay area is greater than the amount of data required to train the agent; if it is greater than the amount of data required to train the agent, experience data is obtained from the experience replay area as training data, and the agent is trained based on the training data; if it is not greater than the amount of data required to train the agent, the process returns to the step of starting the input scheduling task.

[0009] In one possible implementation, training the agent based on training data specifically includes: calculating the agent's loss value based on empirical data; updating the agent's parameters using a gradient descent algorithm based on the loss value; determining whether the number of times the scheduled task is executed has reached a first preset threshold; if the first preset threshold is reached, summing the reward values ​​of all agents within the first preset threshold to obtain the agent's cumulative reward value, and determining whether the change in the agent's cumulative reward value is less than a second preset threshold; if it is less than the second preset threshold, training ends; if the first preset threshold is not reached, returning to the step of starting the input scheduled task.

[0010] In one possible implementation, if the reward value is not less than the second preset threshold, the process returns to the step of starting the input scheduling task until the agent's cumulative reward value is less than the second preset threshold.

[0011] Secondly, embodiments of this application provide an apparatus for cross-cluster task scheduling, comprising: an acquisition module, configured to input a scheduling task, acquire a state set of high-level agents based on the scheduling task, and convert the state set of high-level agents into a first input vector; input the first input vector into the high-level agents to obtain selection scores of sub-clusters in the cluster; a processing module, configured to calculate the selection probability of any sub-cluster in the cluster based on the selection score of the sub-cluster using a maximum value function; determine a first maximum selection probability based on the selection probability of the sub-cluster, and use the sub-cluster corresponding to the first maximum selection probability as the sub-cluster to which the task is assigned; the acquisition module is further configured to determine a state set of low-level agents based on the assigned sub-cluster, and convert the state set of low-level agents into a second input vector; input the second input vector into the low-level agents to obtain selection scores of child nodes in the sub-cluster; the processing module is further configured to calculate the selection probability of any child node in the sub-cluster based on the selection score of the child node using a maximum value function; determine a second maximum selection probability based on the selection probability of the child node, and use the child node corresponding to the second maximum selection probability as the running node to which the scheduling task is assigned; and execute the scheduling task using the assigned running node.

[0012] In one possible implementation, the processing module is further configured to: acquire cross-cluster cluster parameter information and real-time resource indicators of the clusters; construct an action set for the agent based on the cross-cluster cluster parameter information and real-time resource indicators of the clusters; define a scheduling task set; construct a state set for the agent based on the cross-cluster cluster parameter information, real-time resource indicators of the clusters, and the scheduling task set; and construct an experience replay area based on the storage capacity of the agent; wherein the agent includes high-level agents and low-level agents, and the experience replay area represents the storage location of the execution results of the scheduling tasks.

[0013] In one possible implementation, the acquisition module is further configured to: acquire task execution metrics, calculate the agent's reward value based on the task execution metrics, and store the agent's reward value in the experience replay area; use the action set corresponding to the assigned sub-cluster in the high-level agent as the action set of the high-level agent in the scheduling task execution; and store it in the experience replay area of ​​the high-level agent; determine the action set of the low-level agent based on the assigned sub-cluster; use the action set of the low-level agent as the action set of the low-level agent in the scheduling task execution and store it in the experience replay area of ​​the low-level agent; use the current state set of the high-level agent as the next state set of the high-level agent; store the state set and the next state set of the high-level agent in the experience replay area of ​​the high-level agent; use the current state set of the low-level agent as the next state set of the low-level agent; and store the state set and the next state set of the low-level agent in the experience replay area of ​​the low-level agent.

[0014] In one possible implementation, the processing module is further configured to: determine whether the amount of data in the experience replay area is greater than the amount of data required to train the agent; if it is greater than the amount of data required to train the agent, obtain experience data from the experience replay area as training data and train the agent based on the training data; if it is not greater than the amount of data required to train the agent, return to the step of starting the input scheduling task.

[0015] In one possible implementation, the processing module is further configured to: calculate the loss value of the agent based on empirical data; update the agent parameters using a gradient descent algorithm based on the loss value; determine whether the number of times the scheduling task is executed has reached a first preset threshold; if the first preset threshold is reached, sum the reward values ​​of all agents within the first preset threshold to obtain the cumulative reward value of the agent, and determine whether the change in the cumulative reward value of the agent is less than a second preset threshold; if it is less than the second preset threshold, the training ends; if the first preset threshold is not reached, the process returns to the step of starting the input scheduling task.

[0016] In one possible implementation, the processing module is further configured to: if the value is not less than a second preset threshold, return to the step of starting the input scheduling task until the agent's cumulative reward value is less than the second preset threshold.

[0017] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;

[0018] The memory stores instructions that the computer executes;

[0019] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.

[0020] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.

[0021] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.

[0022] This application provides a method, apparatus, device, medium, and program product for cross-cluster task scheduling. The method involves inputting a scheduling task, obtaining a state set of high-level agents based on the task and converting it into a first input vector; inputting this first input vector into the high-level agents to obtain selection scores for sub-clusters within the cluster; calculating the selection probability of a sub-cluster using a maximum value function based on the selection scores; determining the first maximum selection probability and assigning its corresponding sub-cluster as the task's assigned sub-cluster; determining a state set of low-level agents based on the assigned sub-clusters and converting it into a second input vector; inputting this second input vector into the low-level agents to obtain selection scores for child nodes within the sub-clusters; calculating the selection probability of a child node using a maximum value function based on its selection score; determining the second maximum selection probability and assigning its corresponding child node as the running node for the scheduled task; and executing the scheduling task using this running node. This solution achieves resource balancing and dynamic scheduling in a cross-cluster environment by utilizing high-level agents to select sub-clusters and low-level agents to select running nodes, thereby improving overall resource utilization and reducing network latency in cross-cluster scheduling. Attached Figure Description

[0023] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0024] Figure 1 A flowchart illustrating a cross-cluster task scheduling method provided in this application. Figure 1 ;

[0025] Figure 2 A flowchart illustrating a cross-cluster task scheduling method provided in this application. Figure 2 ;

[0026] Figure 3 A schematic diagram of an agent training process provided in this application;

[0027] Figure 4 This application provides a flowchart illustrating a cross-cluster task scheduling process. Figure 3 ;

[0028] Figure 5 A schematic diagram of the structure of a cross-cluster task scheduling device provided in this application;

[0029] Figure 6 This is a schematic diagram of the structure of an electronic device provided in this application.

[0030] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0031] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0032] With the rapid development of big data and the ever-increasing scale of data across industries, effectively storing, managing, and processing this data has become a significant challenge for enterprises. Distributed computing frameworks, with their high reliability, scalability, and fault tolerance, provide a powerful data processing environment, laying the foundation for the storage and computation of massive amounts of data. Enterprises and organizations typically require multiple distributed framework clusters to meet their distributed data storage and computation needs. However, due to the wide distribution of resources and the diversity of application requirements, achieving efficient task scheduling across multiple resource management system clusters is challenging.

[0033] Currently, traditional scheduling methods, such as rule-based static scheduling or simple priority scheduling, lack comprehensive consideration of sub-cluster load and node status in scheduling scenarios across multiple resource management system clusters, making it difficult to adapt to dynamically changing workloads. This results in poor allocation and utilization of cross-cluster resources.

[0034] This application provides a method for cross-cluster task scheduling. The method involves inputting a scheduling task, obtaining a state set of high-level agents based on the task, and converting the state set of high-level agents into a first input vector. The first input vector is then input into the high-level agents to obtain selection scores for sub-clusters within the cluster. For any sub-cluster, the selection probability of the sub-cluster is calculated using a maximum value function based on its selection score. A first maximum selection probability is determined based on the sub-cluster selection probability, and the sub-cluster corresponding to the first maximum selection probability is selected as the sub-cluster to which the task is assigned. A state set of low-level agents is determined based on the assigned sub-clusters, and the state set of the low-level agents is converted into a second input vector. The second input vector is then input into the low-level agents to obtain selection scores for child nodes within the sub-clusters. For any child node within the sub-cluster, the selection probability of the child node is calculated using a maximum value function based on its selection score. A second maximum selection probability is determined based on the child node selection probability, and the child node corresponding to the second maximum selection probability is selected as the running node to which the scheduling task is assigned. The scheduling task is then executed using the assigned running node. This solution utilizes high-level agents to select sub-clusters and low-level agents to select running nodes, thereby achieving resource balancing and dynamic scheduling in cross-cluster environments. This not only improves overall resource utilization but also reduces network latency in cross-cluster scheduling.

[0035] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0036] Example 1

[0037] Figure 1 A flowchart illustrating a cross-cluster task scheduling method provided in this application. Figure 1 ,like Figure 1 As shown, the method includes:

[0038] S101, Input the scheduling task, obtain the state set of the high-level agent according to the scheduling task, convert the state set of the high-level agent into the first input vector; input the first input vector into the high-level agent to obtain the selection score of the sub-cluster in the cluster;

[0039] S102, for any sub-cluster in the cluster, calculate the selection probability of the sub-cluster using the maximum value function based on the selection score of the sub-cluster; determine the first maximum selection probability based on the selection probability of the sub-cluster, and take the sub-cluster corresponding to the first maximum selection probability as the sub-cluster to which the task is assigned.

[0040] S103, determine the state set of the low-level agent based on the assigned sub-cluster, convert the state set of the low-level agent into a second input vector; input the second input vector into the low-level agent to obtain the selection score of the child node in the sub-cluster;

[0041] S104, for any child node in the sub-cluster, calculate the selection probability of the child node using the maximum value function based on the selection score of the child node; determine the second maximum selection probability based on the selection probability of the child node, and use the child node corresponding to the second maximum selection probability as the running node to which the scheduling task is assigned; execute the scheduling task using the assigned running node.

[0042] In this context, an intelligent agent is an entity capable of autonomously perceiving information within its environment and making decisions based on that information to achieve specific goals or tasks. Specifically, higher-level intelligent agents are primarily responsible for high-level planning and decision-making. They typically have a more macroscopic perspective, understanding complex task objectives and breaking them down into a series of sub-objectives or sub-tasks. Lower-level intelligent agents are mainly responsible for executing specific actions and tasks, usually possessing more specific and specialized functions. They interact directly with the environment, using actuators to complete the sub-tasks assigned by the higher-level intelligent agents.

[0043] In this example, the agent is a neural network structure consisting of several layers of multilayer perceptrons, including high-level agents and low-level agents. The input layer dimension of the high-level neural network is the length of its state set, and the output layer dimension is the number of sub-clusters. The network structure of the low-level agent is similar to that of the high-level agent, but its input is the state of the nodes in the assigned sub-clusters, and the output layer dimension is the number of nodes in the assigned sub-clusters.

[0044] In practical applications, the input scheduling task includes resource requirements, priority, and estimated execution time. Based on the scheduling task, real-time resource metrics of the cluster are collected to obtain the state set of the high-level agent. This state set is converted into a vector form and used as the first input vector. The first input vector is input into the neural network of the high-level agent for processing. Through forward propagation, the selection score of each sub-cluster in the cluster is calculated. For each sub-cluster, based on its selection score, a maximum value function, such as the softmax function, is used to calculate the selection probability of that sub-cluster. After calculating the selection probabilities of all sub-clusters in the cluster, the sub-cluster corresponding to the first maximum selection probability is selected as the sub-cluster to which the task is assigned. Based on this assigned sub-cluster, the node states of the assigned sub-cluster are collected, including the CPU utilization and memory utilization of each node. Combined with the scheduling task, this results in the state set of the low-level agent, which is converted into a vector form to obtain the second input vector. The second input vector is input into the neural network of the low-level agent to calculate the selection score of each child node. A maximum value function is used to calculate the selection probability of each child node. From all the child node selection probabilities, the child node corresponding to the second maximum selection probability is selected as the running node of the scheduling task.

[0045] Based on the selected running node, the ApplicationMaster process is launched. The ApplicationMaster requests resources from the ResourceManager of the assigned sub-cluster and the NodeManager of the running node, initiates the job execution process, and enters the formal execution phase of the task. The ApplicationMaster is responsible for managing task execution and resource scheduling.

[0046] In some examples, before inputting the scheduling task and obtaining the state set of the higher-level agent based on the scheduling task, the process includes:

[0047] Obtain cluster parameter information and real-time resource indicators across clusters, and construct an action set for the agent based on the cluster parameter information and real-time resource indicators across clusters.

[0048] Define a set of scheduling tasks, and construct the state set of the agent based on the cluster parameter information across clusters, the real-time resource indicators of the clusters, and the set of scheduling tasks.

[0049] An experience replay area is constructed based on the storage capacity of the agents; where agents include high-level agents and low-level agents, and the experience replay area represents the storage location of the execution results of the scheduled tasks.

[0050] The cross-cluster cluster parameter information includes the number M of sub-clusters in the cross-cluster environment, and the information for each sub-cluster. Number of nodes The real-time resource metrics of the cluster represent the real-time resource usage of the entire cluster, including the overall utilization rate of resources such as CPU, memory, and storage.

[0051] Based on the obtained cross-cluster cluster parameter information and real-time resource indicators of the cluster, the action set of the high-level intelligent agent is defined as the sub-cluster set. Define the action set of the low-level agent as the set of nodes within the assigned sub-cluster. , where c represents the corresponding assigned sub-cluster; for example, when the high-level agent selects Then, the set of actions of the lower-level agent is .

[0052] Define a set of scheduled tasks Define the set of states of a high-level intelligent agent. Global resource status for each sub-cluster and the scheduling tasks submitted by users in the usage scenario This allows the agent to select the assigned sub-cluster based on the overall state of the sub-cluster. The state of each sub-cluster is as follows: Each element represents the CPU utilization, memory utilization, latency, and bandwidth of a sub-cluster. The states of each sub-cluster are combined to form the overall global resource situation.

[0053]

[0054] Define the set of states of the low-level agent. Resource usage of each node within the assigned sub-cluster and the scheduling tasks submitted by the user For example, when the sub-cluster Selected by the higher-level intelligent agent, the input state of the lower-level intelligent agent For sub-cluster The state vectors of each node and the scheduling task information submitted by the user. Each node's state vector includes its CPU utilization and memory utilization; that is... The resource usage is as follows: .

[0055] Based on the previous example, we can see that the input scheduling task includes resource requirements, priority, and estimated execution time; specifically, it includes resource requirements (number of CPU cores). ,Memory Storage requirements ), priority Expected execution time ; Therefore, the first input vector is:

[0056]

[0057] The second input vector is:

[0058]

[0059] After inputting the first vector into the high-level agent, the selection score for each sub-cluster is calculated as follows: ,in, A neural network representing a high-level intelligent agent. The parameters represent the high-level agent. The selection probability, calculated using the maximum value function, is...

[0060]

[0061] from Choose the one with the highest probability of selection. The corresponding sub-cluster is used as the assigned sub-cluster. .

[0062] After inputting the first vector into the low-level agent, the selection score for each sub-cluster is calculated as follows: ,in, Parameters representing low-level intelligent agents; This indicates that the job is assigned to a node. The priority. The selection probability calculated using the maximum value function is:

[0063]

[0064] in, Indicates the total number of child nodes; from Choose the one with the highest probability of selection. The corresponding sub-cluster is used as the assigned running node. .

[0065] In this example, the experience replay area is built based on storage capacity; specifically, a capacity of [capacity missing] is built for the high-level agent. The experience replay area stores a quadruple of state, action, reward value, and next state for each scheduling process. ; To build a capacity of low-level intelligent agents The experience replay area stores the scheduling information within the sub-cluster, namely the quadruple of state, action, reward value, and next state. .

[0066] By constructing an action set for the agent, it becomes easier for the agent to quickly select the optimal action to execute the scheduled task; by constructing a state set, the agent can clearly understand the current resource usage, facilitating rapid decision-making and task strategy selection; and by constructing an experience replay area, a large number of experience samples collected by the agent in historical scheduled tasks can be stored. These samples can be used to train the agent, increasing the diversity and quantity of training data, thereby improving the agent's generalization ability.

[0067] In some examples, after executing the task using the assigned running node, the process also includes:

[0068] Obtain task execution metrics, calculate the agent's reward value based on the task execution metrics, and store the agent's reward value in the experience replay area;

[0069] The set of actions corresponding to the assigned sub-clusters in the high-level agent is used as the set of actions of the high-level agent in the execution of the scheduling task; and stored in the experience replay area of ​​the high-level agent.

[0070] The action set of the low-level agent is determined based on the assigned sub-cluster; the action set of the low-level agent is used as the action set of the low-level agent in the execution of the scheduled task and stored in the experience replay area of ​​the low-level agent;

[0071] Use the current state set of the high-level agent as the next state set of the high-level agent; store the state set and the next state set of the high-level agent in the experience replay area of ​​the high-level agent;

[0072] Use the current state set of the low-level agent as the next state set of the low-level agent; store the state set and the next state set of the low-level agent in the experience playback area of ​​the low-level agent.

[0073] Based on the above example, after the scheduled task is completed, task execution metrics are collected, the agent's reward value is calculated based on the task execution metrics, and the agent's reward value is stored in the experience replay area.

[0074] Specifically, for high-level intelligent agents, the collected task execution metrics include the resource utilization balance among the assigned sub-clusters. Network latency penalty items Task priority reward items The resource utilization balance among sub-clusters is measured by calculating the variance of CPU and memory utilization among sub-clusters.

[0075]

[0076] in, and M represents the average resource utilization of all sub-clusters, where M is the total number of sub-clusters in the cluster.

[0077] Network latency penalty If there is high latency between sub-clusters, the reward value will be reduced; ;in This represents the average network latency between the target sub-cluster and other sub-clusters. Higher-priority jobs will receive additional rewards when assigned to suitable sub-clusters to ensure that high-priority jobs are scheduled first. .

[0078] Therefore, the reward value of a high-level intelligent agent is calculated as follows: ;

[0079] in, , , This represents the weight of each reward; the weight value is preset based on historical experience.

[0080] For low-level agents, the collected task execution metrics include the average CPU utilization and memory utilization of the running nodes. Task delay penalty items Localized task reward items Node health Among them, the task delay penalty item If the task has a longer delay, the reward will be lower, encouraging assignment to nodes with shorter delays. For task localization rewards, the reward is higher if the task is assigned to a node that stores the data, in order to improve data locality and reduce data transmission overhead.

[0081]

[0082] Regarding node health: If the target node is in good condition (no faults or performance bottlenecks), the reward is higher; otherwise, the reward is lower.

[0083]

[0084] Specifically, regarding task localization rewards... Selection, node health The decision-making process, based on the assigned running node and its execution, can be determined as follows: for example, after executing the task on the assigned running node, if the scheduled task is executed on the assigned running node and the node is healthy, then... , .

[0085] Therefore, the reward value of the low-level agent is calculated as follows:

[0086]

[0087] in, , , , The weighting of each reward.

[0088] In this example, for instance, when the higher-level agent selects... Then, the action output of the high-level intelligent agent is The set of actions for the low-level intelligent agent is The state set of the high-level intelligent agent is The state set of the low-level agent is After determining the maximum selection probability, for example, the state sets of the high-level and low-level agents used to execute the scheduling task, i.e., the allocated sub-cluster state set, is... The set of states of the assigned running nodes is Then the next state sets of the high-level intelligent agent and the low-level intelligent agent are respectively , ;in and This is not the original value, but the state of the cluster executing the task in this instance. Subtract scheduling tasks The difference in the status of the resources occupied, and the execution task nodes. Subtract scheduling tasks The difference in the state of the occupied resources. Simultaneously, if a previously scheduled task is completed in the current time step, the resources occupied on the sub-cluster and nodes that executed that task will be released accordingly. The aforementioned agent state set, agent actions, agent reward value, and agent next state set are stored in the experience replay area.

[0089] For example, the agent's state at time t records the cluster's resource usage at time t. For instance, how many CPU cores were used. After a task is scheduled to a node, that node's CPU will be further utilized. For example, if the node previously used 5 CPU cores, meaning the agent's state set is 5 cores; if the scheduled task requires 2 cores, then at time t+1, the node's CPU usage will be 7 cores. Furthermore, if a scheduled task is completed at time t, the resources used by that task will be released. If the next scheduled task is still on this node, its CPU usage will be 7 cores after task allocation, but simultaneously another task is completed on this node, and this completed task previously used 1 core, then the node's final CPU usage will be 6 cores. Therefore, the node's next state set will be 6 cores. After the states of all nodes within the sub-cluster are updated, the sub-cluster's state will also be updated accordingly.

[0090] In some examples, Figure 2 A flowchart illustrating a cross-cluster task scheduling method provided in this application. Figure 2 ,like Figure 2 As shown, it also includes:

[0091] S201, Determine whether the amount of data in the experience replay area is greater than the amount of data required to train the agent;

[0092] S202, If the amount of data exceeds the amount required to train the agent, then obtain the experience data from the experience replay area as training data, and train the agent based on the training data;

[0093] S203, if the amount of data is not greater than the amount of data required to train the agent, return to the step of starting the input scheduling task.

[0094] The amount of data required to train the agent is preset according to demand. If the amount of data stored in the experience replay area exceeds the preset value, the agent will be trained using the data in the experience replay area to optimize and update the agent's parameters, thereby improving the agent's scheduling capability. Based on the above example, the data stored in the experience replay area is... Quadruple form.

[0095] In practical applications, for example, if the preset training data volume is 100, and the experience replay area stores 102 quadruplet data, then 100 quadruplet data are selected from the experience replay area to train the agent; if the experience replay area stores 92 quadruplet data, then the agent is not trained, and the input is returned to the starting step of the task, until the stored quadruplet data volume is greater than the preset data volume before the agent is trained.

[0096] The experience replay area stores the agent's experiences at different times, including information on state, action, reward, and next state. By using the data in the experience replay area to train the agent, it can be exposed to various different scenarios and states. During training, the agent is prevented from over-relying on the small amount of current real-time data. Instead, it takes into account a large amount of historical experience, thereby reducing overfitting to the current specific data distribution and enhancing the agent's generalization ability, enabling it to make better decisions when facing new and unseen environmental situations.

[0097] In some examples, Figure 3 This application provides a flowchart illustrating the training process of an intelligent agent, as shown below. Figure 3 As shown, training the agent based on the training data specifically includes:

[0098] S301, Calculate the loss value of the agent based on empirical data; update the agent parameters using the gradient descent algorithm based on the loss value;

[0099] S302, determine whether the number of times the scheduled task has been executed has reached the first preset threshold;

[0100] S303, if the first preset threshold is reached, the reward values ​​of all agents within the first preset threshold are summed to obtain the cumulative reward value of the agent, and it is determined whether the change in the cumulative reward value of the agent is less than the second preset threshold; if it is less than the second preset threshold, the training ends.

[0101] S304, if the first preset threshold is not reached, return to the step of starting the input scheduling task.

[0102] The first and second preset thresholds can be customized according to requirements; for example, the first preset threshold is set to 20 and the second preset threshold is set to 88.

[0103] In practical applications, for example, empirical data is... The loss value of the high-level intelligent agent is calculated as follows: The loss value of the low-level agent is calculated as follows: ;in, This is a discount factor, which represents the weight of future rewards; This represents the expected value. Based on the calculated loss value, the gradient descent algorithm is used to update the parameters of the high-level agent network. and low-level agent network parameters . ; ;in: This is the learning rate.

[0104] For example, if the scheduling task is executed 22 times, the cumulative reward value of the agent is calculated by summing the reward values ​​of the agent obtained from the 22 scheduling task executions. The calculated cumulative reward value is 198, while the cumulative reward value calculated in the last agent training was 100. The change is 98, which is greater than the second preset threshold of 88, indicating that the agent has converged, the training is over, and there is no need to train the agent again. If the scheduling task is executed 17 times, then return to the step of starting the input scheduling task.

[0105] In some examples, it also includes:

[0106] If the reward value is not less than the second preset threshold, return to the step of starting the input scheduling task until the agent's cumulative reward value is less than the second preset threshold.

[0107] The cumulative reward value of the agent is calculated by summing the reward values ​​of the agent obtained during the 22 scheduling tasks. The cumulative reward value calculated in the previous training of the agent is 168, and its change is 68, which is less than the second preset threshold of 88. Then, the process returns to the step of starting the input scheduling task.

[0108] Building on the previous example, by determining whether to continue training based on the number of times the scheduled task has been executed and the accumulated reward value, training can be stopped automatically without manual intervention, improving the automation and efficiency of training and saving significant manpower and time costs.

[0109] This embodiment provides a method for cross-cluster task scheduling. The method involves inputting a scheduling task, obtaining a state set of high-level agents based on the task, and converting the state set of high-level agents into a first input vector. The first input vector is then input into the high-level agents to obtain selection scores for sub-clusters within the cluster. For any sub-cluster in the cluster, the selection probability of the sub-cluster is calculated using a maximum value function based on the selection score. A first maximum selection probability is determined based on the sub-cluster selection probability, and the sub-cluster corresponding to the first maximum selection probability is selected as the sub-cluster to which the task is assigned. A state set of low-level agents is determined based on the assigned sub-clusters, and the state set of the low-level agents is converted into a second input vector. The second input vector is then input into the low-level agents to obtain selection scores for child nodes within the sub-clusters. For any child node in the sub-cluster, the selection probability of the child node is calculated using a maximum value function based on the child node's selection score. A second maximum selection probability is determined based on the child node's selection probability, and the child node corresponding to the second maximum selection probability is selected as the running node to which the scheduling task is assigned. The scheduling task is then executed using the assigned running node. This solution utilizes high-level agents to select sub-clusters and low-level agents to select running nodes, thereby achieving resource balancing and dynamic scheduling in cross-cluster environments. This not only improves overall resource utilization but also reduces network latency in cross-cluster scheduling.

[0110] In practical applications, Figure 4 This application provides a flowchart illustrating a cross-cluster task scheduling process. Figure 3 ,like Figure 4As shown, the system acquires cross-cluster cluster parameter information and real-time resource indicators of the clusters, and constructs the agent's state set, action set, and experience replay area. It inputs a scheduling task, obtains the state set of the high-level agent based on the scheduling task, and converts it into a first input vector. This first input vector is then input into the high-level agent to obtain the selection score for each sub-cluster. Based on the selection score, a maximum value function is used to calculate the selection probability, and the sub-cluster corresponding to the maximum selection probability is selected as the assigned sub-cluster. Based on the assigned sub-cluster, the system obtains the state set of the low-level agent and converts it into a second input vector. This first input vector is then input into the low-level agent to obtain the selection score for each child node. Based on the selection score, a maximum value function is used to calculate the selection probability, and the child node corresponding to the maximum selection probability is selected as the assigned running node. The scheduling task is executed on this running node. Task execution indicators are collected, and reward values ​​are calculated. The scheduling task execution indicators are stored in the experience replay area. If the amount of data stored in the experience replay area is greater than the preset value required for training, a batch of experience data is randomly selected from the experience replay area to train the agent. Specifically, the loss value of the agent is calculated, and the agent parameters are updated using gradient descent based on the loss value. If the number of job executions reaches the first preset threshold, the cumulative reward value is calculated. If the change in the cumulative reward value is less than the second preset threshold, the algorithm converges and training ends.

[0111] Example 2

[0112] Figure 5 A schematic diagram of a cross-cluster task scheduling device provided in this application is shown below. Figure 5 As shown, it includes:

[0113] The acquisition module 10 is used to input the scheduling task, obtain the state set of the high-level agent based on the scheduling task, and convert the state set of the high-level agent into a first input vector; the first input vector is input into the high-level agent to obtain the selection score of the sub-cluster in the cluster.

[0114] Processing module 20 is used to calculate the selection probability of any sub-cluster in the cluster based on the selection score of the sub-cluster using a maximum value function; determine the first maximum selection probability based on the selection probability of the sub-cluster; and use the sub-cluster corresponding to the first maximum selection probability as the sub-cluster to which the task is assigned.

[0115] The acquisition module 10 is also used to determine the state set of the low-level agent based on the assigned sub-cluster, convert the state set of the low-level agent into a second input vector, and input the second input vector into the low-level agent to obtain the selection score of the child node in the sub-cluster.

[0116] The processing module 20 is also used to calculate the selection probability of any child node in the sub-cluster based on the selection score of the child node using the maximum value function; determine the second maximum selection probability based on the selection probability of the child node; use the child node corresponding to the second maximum selection probability as the running node to which the scheduling task is assigned; and use the assigned running node to execute the scheduling task.

[0117] In some examples, the processing module 20 is also used to: obtain cluster parameter information across clusters and real-time resource indicators of the clusters, and construct an action set for the agent based on the cluster parameter information across clusters and real-time resource indicators of the clusters.

[0118] Define a set of scheduling tasks, and construct the state set of the agent based on the cluster parameter information across clusters, the real-time resource indicators of the clusters, and the set of scheduling tasks.

[0119] An experience replay area is constructed based on the storage capacity of the agents; where agents include high-level agents and low-level agents, and the experience replay area represents the storage location of the execution results of the scheduled tasks.

[0120] In some examples, the acquisition module 10 is also used to: acquire task execution metrics, calculate the agent's reward value based on the task execution metrics, and store the agent's reward value in the experience replay area;

[0121] The set of actions corresponding to the assigned sub-clusters in the high-level agent is used as the set of actions of the high-level agent in the execution of the scheduling task; and stored in the experience replay area of ​​the high-level agent.

[0122] The action set of the low-level agent is determined based on the assigned sub-cluster; the action set of the low-level agent is used as the action set of the low-level agent in the execution of the scheduled task and stored in the experience replay area of ​​the low-level agent;

[0123] Use the current state set of the high-level agent as the next state set of the high-level agent; store the state set and the next state set of the high-level agent in the experience replay area of ​​the high-level agent;

[0124] Use the current state set of the low-level agent as the next state set of the low-level agent; store the state set and the next state set of the low-level agent in the experience playback area of ​​the low-level agent.

[0125] In some examples, the processing module 20 is also used to: determine whether the amount of data in the experience replay area is greater than the amount of data required to train the agent;

[0126] If the amount of data exceeds the amount required to train the agent, then obtain the experience data from the experience replay area as training data, and train the agent based on the training data;

[0127] If the amount of data is not greater than the amount required to train the agent, return to the step where the input scheduling task begins.

[0128] In some examples, the processing module 20 is also used to: calculate the loss value of the agent based on empirical data; and update the agent parameters using a gradient descent algorithm based on the loss value.

[0129] Determine whether the number of times the scheduled task has been executed has reached the first preset threshold;

[0130] If the first preset threshold is reached, the reward values ​​of all agents within the first preset threshold are summed to obtain the cumulative reward value of the agent, and it is determined whether the change in the cumulative reward value of the agent is less than the second preset threshold; if it is less than the second preset threshold, the training ends.

[0131] If the first preset threshold is not reached, return to the step of starting the input scheduling task.

[0132] In some examples, the processing module 20 is also configured to: if the value is not less than a second preset threshold, return to the step of starting the input scheduling task until the agent's cumulative reward value is less than the second preset threshold.

[0133] This embodiment provides a cross-cluster task scheduling device that can execute the methods provided in the above-described method embodiments. Its implementation principle and technical effects are similar, and will not be described in detail here.

[0134] Figure 6 This is a schematic diagram of the structure of an electronic device provided in this application. Figure 6 As shown, the electronic device 50 provided in this embodiment includes at least one processor 501 and a memory 502. Optionally, the device 50 further includes a communication component 503. The processor 501, memory 502, and communication component 503 are connected via a bus 504.

[0135] In a specific implementation, at least one processor 501 executes computer execution instructions stored in memory 502, causing at least one processor 501 to perform the above-described method.

[0136] The specific implementation process of processor 501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0137] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0138] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0139] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0140] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0141] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0142] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0143] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0144] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

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

[0146] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0147] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0148] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0149] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A method for cross-cluster task scheduling, characterized in that, include: Input a scheduling task, obtain the state set of the high-level intelligent agent according to the scheduling task, and convert the state set of the high-level intelligent agent into a first input vector; The first input vector is input into the high-level agent to obtain the selection score of the sub-cluster in the cluster; For any sub-cluster in the cluster, the selection probability of the sub-cluster is calculated using a maximum value function based on the selection score of the sub-cluster. The first maximum selection probability is determined based on the selection probability of the sub-cluster, and the sub-cluster corresponding to the first maximum selection probability is taken as the sub-cluster to which the task is assigned. The state set of the low-level agents is determined based on the assigned sub-clusters, and the state set of the low-level agents is converted into a second input vector; The second input vector is input into the low-level agent to obtain the selection score of the child node in the sub-cluster. For any child node in the sub-cluster, the selection probability of the child node is calculated using a maximum value function based on the selection score of the child node; a second maximum selection probability is determined based on the selection probability of the child node, and the child node corresponding to the second maximum selection probability is used as the running node to which the scheduling task is assigned; the scheduling task is executed using the assigned running node.

2. The method of claim 1, wherein, Before obtaining the state set of the high-level intelligent agent according to the input scheduling task, the input scheduling task further includes: Obtain cross-cluster cluster parameter information and real-time resource indicators of the clusters, and construct an action set for the intelligent agent based on the cross-cluster cluster parameter information and real-time resource indicators of the clusters. Define a set of scheduling tasks, and construct a set of states for the agent based on the cross-cluster cluster parameter information, the real-time resource indicators of the cluster, and the set of scheduling tasks. An experience replay area is constructed based on the storage capacity of the agents; wherein, the agents include high-level agents and low-level agents, and the experience replay area represents the storage location of the execution results of the scheduled task.

3. The method of claim 2, wherein, After executing the task using the allocated running node, the process further includes: Obtain task execution metrics, calculate the reward value of the agent based on the task execution metrics, and store the reward value of the agent in the experience replay area; The action set corresponding to the assigned sub-cluster in the high-level agent is used as the action set of the high-level agent in the execution of the scheduling task; and stored in the experience replay area of ​​the high-level agent. The action set of the low-level agent is determined according to the assigned sub-cluster; the action set of the low-level agent is used as the action set of the low-level agent in the execution of the scheduled task and stored in the experience replay area of ​​the low-level agent; The current state set of the high-level agent is used as the next state set of the high-level agent; the state set and the next state set of the high-level agent are stored in the experience replay area of ​​the high-level agent. The current state set of the low-level agent is used as the next state set of the low-level agent; the state set of the low-level agent and the next state set of the low-level agent are stored in the experience replay area of ​​the low-level agent.

4. The method according to any one of claims 1 to 3, characterized in that, Also includes: Determine whether the amount of data in the experience replay area is greater than the amount of data required to train the agent; If the amount of data exceeds the amount required to train the agent, then experience data is obtained from the experience replay area as training data, and the agent is trained based on the training data. If the amount of data is not greater than the amount required to train the agent, then return to the step of starting the input scheduling task.

5. The method of claim 4, wherein, The step of training the agent based on the training data specifically includes: Calculate the loss value of the agent based on the empirical data; update the agent parameters using the gradient descent algorithm based on the loss value; Determine whether the number of times the scheduled task has been executed has reached the first preset threshold; If the first preset threshold is reached, the reward values ​​of all agents within the first preset threshold are summed to obtain the cumulative reward value of the agent, and it is determined whether the change in the cumulative reward value of the agent is less than the second preset threshold; if it is less than the second preset threshold, the training ends. If the first preset threshold is not reached, return to the step of starting the input scheduling task.

6. The method of claim 5, wherein, The method further includes: If the value is not less than the second preset threshold, then return to the step of starting the input scheduling task until the cumulative reward value of the agent is less than the second preset threshold.

7. A device for cross-cluster task scheduling, characterized in that, include: The acquisition module is used to input the scheduling task, acquire the state set of the high-level intelligent agent according to the scheduling task, and convert the state set of the high-level intelligent agent into a first input vector. The first input vector is input into the high-level agent to obtain the selection score of the sub-cluster in the cluster; The processing module is used to calculate the selection probability of any sub-cluster in the cluster based on the selection score of the sub-cluster using a maximum value function. The first maximum selection probability is determined based on the selection probability of the sub-cluster, and the sub-cluster corresponding to the first maximum selection probability is taken as the sub-cluster to which the task is assigned. The acquisition module is further configured to determine the state set of the low-level agent based on the assigned sub-cluster, convert the state set of the low-level agent into a second input vector, and input the second input vector into the low-level agent to obtain the selection score of the child node in the sub-cluster. The processing module is further configured to calculate the selection probability of any child node in the sub-cluster based on the selection score of the child node using a maximum value function; determine a second maximum selection probability based on the selection probability of the child node; use the child node corresponding to the second maximum selection probability as the running node to which the scheduling task is assigned; and execute the scheduling task using the assigned running node.

8. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-6.

10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-6.