Multi-task scheduling method and device based on heterogeneous distributed cluster
By introducing heterogeneous distributed clusters, pooling layer and scheduling layer in the multi-task scheduling method, combined with machine learning and heuristic algorithms, the problems of low resource utilization, low efficiency and lack of intelligent optimization in the traditional multi-task scheduling method are solved, and efficient and flexible task scheduling and resource management are achieved.
Patent Information
- Application Number
- CN202410377580.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-29
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2044-03-29
AI Technical Summary
When traditional multi-task scheduling methods deal with large-scale data and multiple tasks, due to the limitations of computing resources and storage resources, the resource utilization rate is low, the task scheduling efficiency is low, and the lack of intelligent optimization is lacking.
A multi-task scheduling method based on heterogeneous distributed clusters is adopted to analyze task description information in real time, evaluate resource utilization, dynamically allocate hardware resources, and use machine learning and heuristic algorithms to predict and resource adjustment.
It improves resource utilization and task scheduling efficiency, ensures that the high priority and deadline of tasks are met, realizes load balancing and minimizes task waiting time, and at the same time enhances the system's adaptability and stability.
Smart Images

Figure CN118227291B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multi-task processing, and in particular to a multi-task scheduling method and device based on a heterogeneous distributed cluster. Background Art
[0002] With the advent of the big data era, multitasking has become an important requirement for computer systems. In the fields of artificial intelligence, machine learning, scientific computing, etc., it is necessary to process large-scale data and perform multiple tasks. However, when processing these tasks, traditional multitasking scheduling methods are limited by computing resources and storage resources, making it difficult to achieve efficient task scheduling. Specifically, traditional multitasking scheduling methods have the following defects:
[0003] 1. Low resource utilization: Existing task scheduling algorithms are often based on static resource allocation strategies and cannot be dynamically adjusted according to the real-time load and processing capacity of the nodes, resulting in low resource utilization.
[0004] 2. Low task scheduling efficiency: When faced with large-scale and diverse computing tasks, existing task scheduling algorithms may not be able to make decisions quickly and accurately, resulting in low task scheduling efficiency.
[0005] 3. Lack of intelligent optimization: Traditional distributed clusters and task scheduling strategies usually lack intelligent optimization mechanisms and are unable to self-learn and adjust based on historical data and real-time information to improve the performance of task scheduling. Summary of the invention
[0006] In view of this, the present invention provides a multi-task scheduling method and device based on a heterogeneous distributed cluster to solve at least one of the above-mentioned problems.
[0007] In order to achieve the above object, the present invention adopts the following scheme:
[0008] According to a first aspect of the present invention, a multi-task scheduling method based on a heterogeneous distributed cluster is provided, the method comprising: analyzing tasks in a to-be-processed task queue to obtain corresponding task description information, the task description information including task type, priority, deadline, and type and quantity of resources required for the task; recording the task description information in a task management table of a pooling layer; performing resource utilization evaluation based on cluster resource data recorded in the resource management table of the pooling layer to obtain a resource evaluation result; and the scheduling layer allocating corresponding hardware resources for the execution of each task based on the resource evaluation result and the task description information in the task management table.
[0009] As an embodiment of the present invention, the scheduling layer in the above method allocates corresponding hardware resources for the execution of each task based on the resource evaluation results and the task description information in the task management table, including: extracting features for each task and resource combination based on the resource evaluation results and the task description information in the task management table; sorting tasks according to the priority and deadline of the tasks in the task management table to ensure that high-priority tasks and tasks close to the deadline are given priority; using a machine learning model to predict resource load conditions within a set time period in the future based on the current resource usage and historical data in the resource evaluation results; using a heuristic algorithm to dynamically select corresponding hardware resources to allocate to each corresponding task based on the predicted resource load conditions, so as to achieve the goals of load balancing and minimizing task waiting time.
[0010] As an embodiment of the present invention, after the scheduling layer in the above method allocates corresponding hardware resources for the execution of each task based on the resource evaluation results and the task description information in the task management table, the method also includes: updating the latest resource utilization status to the resource management table of the pooling layer.
[0011] As an embodiment of the present invention, the above method also includes: continuously monitoring the hardware resource status within the heterogeneous distributed cluster, and if resource utilization imbalance occurs or new tasks arrive, implementing a hardware allocation strategy to adjust the tasks to achieve load balancing and minimize task waiting time.
[0012] As an embodiment of the present invention, the above method continuously monitors the hardware resource status within the heterogeneous distributed cluster. If there is an imbalance in resource utilization or a new task arrives, the hardware allocation strategy for adjusting the task is implemented to achieve load balancing and minimize the task waiting time, including: the pooling layer continuously monitors the resource status of each hardware resource in the heterogeneous distributed cluster; when the pooling layer detects an imbalance in resource utilization, the scheduling layer transfers some tasks from high-load devices to low-load devices while taking into account task priority and device performance; when the pooling layer detects the arrival of a new task, the pooling layer determines the priority and resource requirements of the new task and provides a list of recommended execution devices. The scheduling layer dynamically adjusts the hardware resource allocation of the task based on the current hardware resource occupancy status and the current ongoing task status, combined with the priority and resource requirements of the new task and the recommended execution device list provided by the pooling layer.
[0013] As an embodiment of the present invention, the above method continuously monitors the hardware resource status within a heterogeneous distributed cluster. If there is an imbalance in resource utilization or a new task arrives, the hardware allocation strategy for adjusting the task is implemented to achieve load balancing and minimize task waiting time. It also includes: the scheduling layer continuously collects resource usage data and task execution status over a period of time; inputs the resource usage data and task execution status into a resource prediction model, and the resource prediction model is trained to predict the resource requirements of different tasks in a future period of time based on the resource usage data and task execution status in the most recent period of time; and adjusts the hardware allocation strategy for the task based on the output of the resource prediction model.
[0014] According to a second aspect of the present invention, there is provided a multi-task scheduling device based on a heterogeneous distributed cluster, the device comprising: a task analysis unit, used to analyze tasks in a pending task queue to obtain corresponding task description information, the task description information including task type, priority, deadline, and type and quantity of resources required for the task; a recording unit, used to record the task description information in a task management table of a pooling layer; a resource evaluation unit, used to perform resource utilization evaluation based on cluster resource data recorded in the resource management table of the pooling layer to obtain a resource evaluation result; a resource allocation unit, used to allocate corresponding hardware resources for the execution of each task based on the resource evaluation result and the task description information in the task management table.
[0015] As an embodiment of the present invention, the above-mentioned resource allocation unit includes: a feature extraction module, which is used to extract features for each task and resource combination based on the resource evaluation results and the task description information in the task management table; a sorting module, which is used to sort the tasks according to the priority and deadline of the tasks in the task management table to ensure that high-priority tasks and tasks close to the deadline are given priority; a resource prediction module, which is used to use a machine learning model to predict the resource load within a set time period in the future based on the current resource usage and historical data in the resource evaluation results; a resource allocation module, which is used to dynamically select corresponding hardware resources based on the predicted resource load using a heuristic algorithm to allocate to each corresponding task, so as to achieve the goal of load balancing and minimizing task waiting time.
[0016] As an embodiment of the present invention, the above-mentioned device also includes: a resource update unit, which is used to update the latest resource utilization status into the resource management table of the pooling layer after allocating corresponding hardware resources for the execution of each task based on the resource evaluation results and the task description information in the task management table.
[0017] As an embodiment of the present invention, the above-mentioned device also includes: a dynamic adjustment unit, which is used to continuously monitor the hardware resource status within the heterogeneous distributed cluster. If there is an imbalance in resource utilization or a new task arrives, a hardware allocation strategy for adjusting the task is implemented to achieve load balancing and minimize task waiting time.
[0018] As an embodiment of the present invention, the above-mentioned dynamic adjustment unit includes: a real-time monitoring module, which is used to continuously monitor the resource status of each hardware resource in a heterogeneous distributed cluster; a first load adjustment module, which is used when the pooling layer detects that resource utilization is unbalanced, and the scheduling layer transfers some tasks from high-load devices to low-load devices while taking into account task priority and device performance; a new task module, which is used when the pooling layer detects the arrival of a new task, to determine the priority and resource requirements of the new task and provide a list of recommended execution devices; a second load adjustment module, which is used to dynamically adjust the hardware resource allocation of the task based on the current hardware resource occupancy status and the current task status obtained by the new task module, combined with the priority and resource requirements of the new task and the recommended execution device list provided by the new task module.
[0019] As an embodiment of the present invention, the above-mentioned dynamic adjustment unit also includes: a resource collection module, which is used to continuously collect resource usage data and task execution status over a period of time; a resource prediction module, which is used to input the resource usage data and task execution status into a resource prediction model, and the resource prediction model is trained to be able to predict the resource requirements of different tasks in a future period of time based on the resource usage data and task execution status in a recent period of time; a third load adjustment module, which is used to adjust the hardware allocation strategy of the task based on the output of the resource prediction model.
[0020] According to a third aspect of the present invention, there is provided an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0021] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0022] It can be seen from the above technical solutions that the multi-task scheduling method and device based on heterogeneous distributed clusters provided by the present invention can more effectively utilize various computing resources, reduce idle resources, and ensure efficient use of resources. In addition, by considering the priority, deadline, and real-time status and performance of the task, the present application can assign tasks to the most suitable resources for execution, thereby shortening the completion time of the task and reducing the waiting time. It can also monitor resource usage and load status in real time, and dynamically adjust resource allocation and task scheduling strategies to cope with changes in workload. This allows the system to maintain stable operation even in the face of emergencies or load fluctuations. Finally, the present application can use machine learning algorithms to analyze historical data and predict resource requirements. The system's scheduling decisions will be optimized over time, improving the accuracy of decisions and the system's adaptability. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0024] Figure 1 This is an architecture diagram of a multi-task scheduling based on a heterogeneous distributed cluster provided in an embodiment of the present application;
[0025] Figure 2 It is a flowchart of a multi-task scheduling method based on a heterogeneous distributed cluster provided in an embodiment of the present application;
[0026] Figure 3 It is a schematic diagram of a process of dynamically allocating resources for multiple tasks at the scheduling layer provided in an embodiment of the present application;
[0027] Figure 4 It is a flowchart of a multi-task scheduling method based on a heterogeneous distributed cluster provided by another embodiment of the present application;
[0028] Figure 5 It is a flowchart of a multi-task scheduling method based on a heterogeneous distributed cluster provided by another embodiment of the present application;
[0029] Figure 6 It is a schematic diagram of the process of dynamic resource allocation in the multi-task scheduling method provided in the embodiment of the present application;
[0030] Figure 7 is a schematic diagram of a flow chart of dynamic resource allocation in a multi-task scheduling method provided by another embodiment of the present application;
[0031] Figure 8 It is a schematic diagram of the steps of multi-task scheduling provided in an embodiment of the present application;
[0032] Fig. 9 This is an architecture diagram of multi-task scheduling provided by an embodiment of the present application;
[0033] Fig.10 It is a structural schematic diagram of a multi-task scheduling device based on a heterogeneous distributed cluster provided in an embodiment of the present application;
[0034] Fig.11 is a schematic diagram of the structure of a resource allocation unit provided in an embodiment of the present application;
[0035] Fig.12 It is a structural schematic diagram of a multi-task scheduling device based on a heterogeneous distributed cluster provided by another embodiment of the present application;
[0036] Fig.13 is a structural diagram of a dynamic adjustment unit provided in an embodiment of the present application;
[0037] Fig.14 is a structural schematic diagram of a dynamic adjustment unit provided in another embodiment of the present application;
[0038] Fig.15 It is a schematic block diagram of the system structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0040] The following is a brief description of the technical terms involved in this application:
[0041] The term "heterogeneous distributed cluster" refers to a computing system that uses heterogeneous computing resources (i.e., different types of computing units, such as CPU, GPU, FPGA, etc.) to work together in a distributed architecture. Such a system is designed to combine the efficient information processing capabilities of the human brain and the high performance of modern computing technology to solve complex computing tasks.
[0042] The term "pooling" refers to a strategy for centrally managing resources. By centralizing scattered resources (such as computing resources, storage resources, etc.) into a shared resource pool, the system can allocate and utilize these resources more flexibly and efficiently.
[0043] like Figure 1 The figure shows an architecture diagram of a multi-task scheduling based on a heterogeneous distributed cluster provided by an embodiment of the present application, which is composed of Figure 1It can be seen that the multi-task scheduling architecture of the present application includes a pooling layer and a scheduling layer, wherein the pooling layer includes a task management table and a resource management table, and the scheduling layer has a specific scheduling strategy. The task management table records the types, priorities, deadlines, and required resource types and quantities of all pending tasks, so that the characteristics and requirements of each task are fully considered. The resource management table records the resource scale and the real-time status of each hardware device in the heterogeneous distributed cluster, which provides a scheduling basis for the decision-making of the scheduling layer. The scheduling layer can obtain the actual needs of multiple tasks and the status of cluster resources from the pooling layer, comprehensively analyze and derive the most appropriate scheduling actions to ensure the efficient execution of multiple tasks. At the same time, each time the scheduling layer performs a scheduling adjustment, it will dynamically adjust the information in the resource management table in the pooling layer for query at any time.
[0044] It can be seen that the present application integrates the pooling idea and the scheduling strategy to form a pooling layer and a scheduling layer, which work together to complete the multi-task scheduling function. The pooling idea is a resource management strategy, the core of which is to integrate scattered resources into a shared resource pool for unified management and scheduling. The scheduling strategy involves the problem of how to decide which resources to allocate to which tasks, and the main goal is to optimize task execution efficiency and resource utilization. In the present invention, the integration of the pooling idea and the scheduling strategy means that all resources are managed through a unified pooling layer, while the scheduling layer is responsible for efficiently allocating these resources to each task according to specific strategies. This integration realizes efficient management of resources and intelligent scheduling of tasks, improving the overall performance of the system and its ability to cope with complex scenarios.
[0045] Based on the above multi-task scheduling architecture, this application proposes a multi-task scheduling method, such as Figure 2 The figure is a flow chart of a multi-task scheduling method based on a heterogeneous distributed cluster provided in an embodiment of the present application, the method comprising the following steps:
[0046] Step S201: Analyze the tasks in the pending task queue to obtain corresponding task description information, wherein the task description information includes task type, priority, deadline, and type and quantity of resources required for the task.
[0047] Task types can be classified according to their main workload characteristics and requirements, such as compute-intensive tasks, I / O-intensive tasks, memory-intensive tasks, network-intensive tasks, data-intensive tasks, GPU-intensive tasks, etc. Of course, these classifications are not mutually exclusive. A task may have multiple classification labels at the same time. For example, a deep learning training task may be both compute-intensive, memory-intensive, and data-intensive.
[0048] The priority of a task determines the order in which tasks are processed during scheduling. High-priority tasks are allocated resources and executed before low-priority tasks. Priority is usually set based on the importance, urgency, or contribution of the task to the business goal. In a multi-tasking environment, reasonable priority setting can ensure that key tasks are completed in a timely manner and optimize the overall performance of the system.
[0049] The deadline of a task is the deadline by which the task needs to be completed. This is an important scheduling parameter that is important to ensure that tasks are completed in a timely manner. When scheduling tasks, the system will consider the deadline of the task to avoid overdue. For tasks with strict deadlines, the system may need to take priority or allocate more resources to ensure that they are completed on time.
[0050] The types of resources required for task execution include computing resources (such as CPU, GPU), storage resources (such as memory, hard disk space), and network resources. Different types of tasks have different resource requirements based on their characteristics. For example, computing-intensive tasks may require more CPU resources, while I / O-intensive tasks may rely more on storage and network bandwidth. The system takes these requirements into account when scheduling tasks to ensure that each task can obtain the required resource types. In addition to the resource type, a certain amount of resources is required to complete a task, such as the required number of CPU cores, memory size, storage space, etc. The system allocates resources based on the resource requirements declared by the task to ensure that the task has enough resources to execute. The quantity of resource requirements will also affect the scheduling strategy of the task. The system needs to balance the supply and demand of resources to avoid insufficient or over-allocation of resources.
[0051] By clarifying the above information of the task, the scheduling layer can comprehensively consider the various attributes and requirements of the task, realize efficient allocation of resources and optimize the execution efficiency of the task, ensure that the system can meet the needs of various tasks, and at the same time improve resource utilization and the overall performance of the system.
[0052] Step S202: Record the task description information in the task management table of the pooling layer.
[0053] The task management table of the pooling layer is a data structure used to record and manage various information of pending tasks. This table is the basis for the scheduling layer to make task scheduling and resource allocation decisions. In practical applications, the task management table can be stored in a database or memory so that the pooling layer can quickly access and update task information.
[0054] The following Table 1 is a schematic diagram of a task management table provided in this embodiment. Of course, the table may also have other representation forms depending on the recorded content:
[0055] Table 1
[0056] Task ID Task Type Priority Deadline Resource Type Resource Quantity 001 Computationally intensive high 2024-03-01 CPU 8 cores 002 I / O intensive middle 2024-03-05 Disk space 500GB 003 Data Intensive Low 2024-03-10 Memory 32GB
[0057] As can be seen from Table 1, the task management table includes the following types of information: task identification (Task ID), task type (Task Type), task priority (Priority), deadline (Deadline), required resource type (ResourceType) and required resource quantity (Resource Quantity).
[0058] Step S203: performing resource utilization evaluation based on the cluster resource data recorded in the resource management table of the pooling layer to obtain a resource evaluation result.
[0059] The resource management table is a data structure used by the pooling layer to record the status and attributes of all resources in the cluster. It is crucial for resource utilization evaluation. The following is similar to Table 1, giving the field information that a resource management table can include: resource ID, resource type, total quantity, available quantity, utilization rate, status, etc.
[0060] Preferably, the entire resource utilization evaluation process may include: collecting the current usage and status data of all resources from the resource management table; calculating key resource evaluation indicators based on the collected data, such as average utilization rate, resource bottleneck detection, resource idle rate, etc.; analyzing the calculated indicators to identify hot spots and cold spots of resource utilization, that is, places where resource utilization is high and places where resources are idle; based on the results of performance analysis, making resource optimization suggestions, such as increasing the investment in specific types of resources, adjusting resource allocation strategies, releasing resources that have been idle for a long time, etc., and the suggestions can be used as a reference by the scheduling layer; finally, forming a resource evaluation result and storing it in the database.
[0061] Step S204: the scheduling layer allocates corresponding hardware resources for the execution of each task based on the resource evaluation result and the task description information in the task management table.
[0062] The scheduling layer uses an intelligent scheduling algorithm to allocate tasks to the most appropriate hardware resources, taking into account factors such as task priority, resource utilization, and device performance. This process involves dynamic optimization and allocation of tasks, taking resource utilization and load balancing into full consideration during allocation to avoid situations where some computing units are idle while others are still busy, ensuring maximum overall resource utilization while meeting task priorities and deadlines.
[0063] Preferably, Figure 3As shown, this step may further include the following sub-steps:
[0064] Step S2041: extracting features for each task and resource combination based on the resource evaluation result and the task description information in the task management table.
[0065] This step is to generate quantifiable evaluation indicators for each task and resource combination through feature extraction. These indicators directly affect the matching and selection decisions between tasks and resources in subsequent steps. Evaluation indicators can be task-resource matching, resource utilization prediction, task urgency, etc.
[0066] Step S2042: sorting the tasks according to their priorities and deadlines in the task management table to ensure that tasks with high priorities and tasks approaching deadlines are processed first.
[0067] This step further processes the features extracted in step S2041, taking into account the priority and deadline of the task, to ensure that urgent and important tasks are given priority. This is a key link in the scheduling algorithm to ensure service quality, which directly affects the user experience and system performance.
[0068] Step S2043: Use a machine learning model to predict resource load conditions within a future set time period based on current resource usage and historical data in the resource assessment results.
[0069] In this step, the machine learning model may adopt a simple linear regression, decision tree or other model, which integrates the results of the previous steps to predict the future load of the resource.
[0070] Step S2044: Use a heuristic algorithm to dynamically select corresponding hardware resources to allocate to each corresponding task according to the predicted resource load conditions, so as to achieve the goals of load balancing and minimizing task waiting time.
[0071] The heuristic algorithm in this step can be used, for example, to dynamically select the most appropriate resources for task allocation by minimizing the maximum delay, the best adaptation algorithm, etc. After the task is completed, the application can continue to collect execution results and performance indicators for optimizing the machine learning model and adjusting the heuristic rules.
[0072] The above steps S2041-S2044 combine heuristic methods and machine learning techniques to design an intelligent scheduling algorithm. Through real-time monitoring and load prediction, the algorithm can adapt to changes in system load and dynamically adjust resource allocation. The algorithm not only considers the current state of resources and load balancing, but also fully considers the priority and deadline of tasks to ensure that important tasks are given priority. The feedback data of task execution is used to continuously optimize the scheduling strategy and improve the accuracy and efficiency of scheduling decisions.
[0073] Preferably, Figure 4 As shown, the above step S204 may further include:
[0074] Step S205: Update the latest resource utilization status to the resource management table of the pooling layer.
[0075] Through this step, the resource management table of the pooling layer can accurately reflect the real-time resource utilization of the cluster, provide accurate data support for intelligent scheduling, and ensure the efficiency and fairness of resource allocation. This dynamic update mechanism is the basis for realizing resource management and scheduling optimization.
[0076] Further preferably, Figure 5 As shown, the multi-task scheduling method based on heterogeneous distributed clusters of the present application may also include:
[0077] Step S206: Continuously monitor the hardware resource status in the heterogeneous distributed cluster. If resource utilization is unbalanced or a new task arrives, implement a hardware allocation strategy to adjust the task to achieve load balancing and minimize task waiting time.
[0078] Specifically, if Figure 6 As shown, this step may further include:
[0079] Step S2061: The pooling layer continuously monitors the resource status of each hardware resource in the heterogeneous distributed cluster. That is, the pooling layer is responsible for real-time monitoring of the load of all devices in the cluster, including CPU usage, memory usage, network traffic, etc., to identify imbalanced resource utilization.
[0080] Step S2062: When the pooling layer detects an imbalance in resource utilization, the scheduling layer transfers some tasks from high-load devices to low-load devices while taking into account task priority and device performance. The imbalance judgment criteria here can be judged by threshold judgment or a specific algorithm to identify devices with excessive current loads and devices with low loads. Consider the characteristics of each task (such as task type, required resources, execution status) and priority, and determine which tasks are suitable for migration from high-load devices to low-load devices. And evaluate the performance of the target device to ensure that it has sufficient capacity to receive and execute the migrated tasks. Then, according to the priority of the task and the performance of the target device, a detailed task migration plan is formulated. The selected tasks can be safely migrated from high-load devices to low-load devices while minimizing task execution interruptions. After completing the task migration, update the information in the resource management table to reflect the latest resource allocation status.
[0081] Step S2063: When the pooling layer detects the arrival of a new task, the pooling layer determines the priority and resource requirements of the new task and gives a list of recommended execution devices. The scheduling layer dynamically adjusts the hardware resource allocation of the task based on the current hardware resource occupancy status and the current task status, combined with the priority and resource requirements of the new task and the list of recommended execution devices given by the pooling layer.
[0082] The pooling layer first evaluates the priority and resource requirements of the new task. This includes determining what type of resources (such as CPU, memory, storage, etc.) the task requires and the specific amount required. Then based on the resource requirements and priority of the new task, the pooling layer generates a list of recommended execution devices. This list takes into account the current load, resource type, and available resource amount of each device, aiming to find the device that is most suitable for executing the new task. The scheduling layer then evaluates the current hardware resource usage and the status of ongoing tasks, including which resources are in use and which resources are idle. The scheduling layer makes a decision based on the priority of the new task, the resource requirements, and the recommended execution device list given by the pooling layer. During this process, the scheduling layer needs to consider whether the current ongoing tasks can be adjusted to free up the required resources for the new task. Based on the decision of the scheduling layer, the hardware resource allocation of the task is dynamically adjusted, which will involve migrating some tasks from one device to another, or adjusting the allocation ratio of resources to ensure that the new task can obtain the required resources. After the resource allocation adjustment is completed, the resource management table is updated to reflect the latest resource allocation status. Through this process, the application can flexibly respond to the arrival of new tasks and adjust resource allocation in a timely manner to meet the needs of new tasks while maintaining the efficient operation of the system as a whole. This dynamic adjustment mechanism enhances the adaptability and robustness of the system, improves resource utilization and task processing capabilities.
[0083] Further preferably, Figure 7 As shown, the above step S206 also includes:
[0084] Step S2064: The scheduling layer continuously collects resource usage data and task execution status over a period of time, including but not limited to CPU utilization, memory usage, storage space usage, network bandwidth usage, as well as task start time, execution time, resource consumption, etc.
[0085] Step S2065: input the resource usage data and task execution status into a resource prediction model, wherein the resource prediction model is trained to predict the resource demand of different tasks in a future period of time based on the resource usage data and task execution status in a recent period of time.
[0086] Step S2066: Adjust the hardware allocation strategy of the task based on the output of the resource prediction model. The scheduling layer dynamically adjusts the hardware resource allocation strategy of the task based on the output of the resource prediction model, i.e., the predicted resource demand in the future. This may include increasing or decreasing the allocation of certain resources, reallocating tasks to different hardware resources, or reserving resources to cope with the upcoming increase in demand.
[0087] Through the above steps, the present application can ensure that cluster resources can meet the needs of future tasks, optimize the overall utilization of cluster resources, avoid task delays caused by resource shortages, and reduce idle resource waste.
[0088] In this embodiment, the execution results and actual resource usage can also be used as feedback to continuously optimize the resource prediction model and improve the accuracy of the prediction and the effectiveness of the resource allocation strategy.
[0089] Finally, after the task is completed, the scheduling method of the present application will also feedback the task results to the user and update the status of the task queue. At the same time, the hardware resources occupied by the task are released to prepare for the allocation of the next task. In this process, the pooling layer generates a task completion report, statistical data, and other relevant information for user reference or further analysis.
[0090] The steps of multi-task scheduling provided in this embodiment can also be seen in Figure 8 As shown, multiple tasks, such as Task 1, Task 2...Task n, simultaneously perform task analysis, resource evaluation, task scheduling and resource allocation processes, and dynamic adjustments are made during the entire process, and finally a feedback process for completing the task is executed.
[0091] It can be seen from the above technical solutions that the multi-task scheduling method based on heterogeneous distributed clusters provided by the present invention can more effectively utilize various computing resources, reduce idle resources, and ensure efficient use of resources. In addition, by considering the priority, deadline, and real-time status and performance of the task, the present application can assign tasks to the most suitable resources for execution, thereby shortening the completion time of the task and reducing the waiting time. It can also monitor resource usage and load status in real time, and dynamically adjust resource allocation and task scheduling strategies to cope with changes in workload. This allows the system to maintain stable operation even in the face of emergencies or load fluctuations. Finally, the present application can use machine learning algorithms to analyze historical data and predict resource requirements. The system's scheduling decisions will be optimized over time, improving the accuracy of decisions and the system's adaptability.
[0092] The above multi-task scheduling method of the present application can be implemented by referring to Fig. 9As shown, it can include two parts, the front end and the bottom layer. The front end mainly faces the multi-user task requirements, and the bottom layer interacts with the device resources. This dual-end design enables the device to fully handle multi-task requirements and effectively utilize device resources.
[0093] The front-end part is set up with an interface for multi-user task requirements, and it is responsible for receiving task requests from different users. In order to better meet the needs of multiple users, the front-end is equipped with a self-developed communication interface, which is highly flexible and scalable, and can quickly and accurately obtain task requirement information. At the same time, the front-end is also responsible for the preliminary processing of the obtained task requirements, including format conversion, priority sorting, etc., to ensure the smooth progress of subsequent scheduling.
[0094] The bottom layer is equipped with an interface with device resources. It is responsible for interacting with various computing devices, storage devices, communication topologies, etc. in the cluster to achieve reasonable allocation and efficient use of resources. The bottom layer is also equipped with a self-developed communication interface, which can quickly and stably control the state and transmit data with various devices to ensure that tasks can be distributed to the corresponding devices for processing in a timely manner. At the same time, the bottom layer is also responsible for real-time monitoring of the status of the device in order to promptly detect and handle device failures and ensure the reliability and stability of the task.
[0095] At the same time, the embodiment of the present application also provides a multi-task scheduling device based on a heterogeneous distributed cluster, such as Fig.10 As shown, the device includes: a task analyzing unit 1100, a recording unit 1200, a resource evaluating unit 1300 and a resource allocating unit 1400, which are sequentially connected.
[0096] The task analysis unit 1100 is used to analyze the tasks in the pending task queue to obtain corresponding task description information, wherein the task description information includes task type, priority, deadline, and type and quantity of resources required for the task.
[0097] The recording unit 1200 is used to record the task description information in the task management table of the pooling layer.
[0098] The resource evaluation unit 1300 is configured to perform resource utilization evaluation based on the cluster resource data recorded in the resource management table of the pooling layer to obtain a resource evaluation result.
[0099] The resource allocation unit 1400 is used to allocate corresponding hardware resources for the execution of each task based on the resource evaluation result and the task description information in the task management table.
[0100] Preferably, Fig.11As shown, the resource allocation unit 1400 includes: a feature extraction module 1410, a sorting module 1420, a resource prediction module 1430 and a resource allocation module 1440, wherein
[0101] The feature extraction module 1410 is used to extract features for each task and resource combination based on the resource evaluation result and the task description information in the task management table.
[0102] The sorting module 1420 is used to sort the tasks according to the priorities and deadlines of the tasks in the task management table to ensure that the tasks with high priorities and tasks approaching the deadlines are processed first.
[0103] The resource prediction module 1430 is used to use a machine learning model to predict the resource load within a future set time period based on the current resource usage and historical data in the resource evaluation results.
[0104] The resource allocation module 1440 is used to dynamically select corresponding hardware resources to allocate to each corresponding task using a heuristic algorithm according to the predicted resource load conditions, so as to achieve the goals of load balancing and minimizing task waiting time.
[0105] Preferably, Fig.12 As shown, the above-mentioned device also includes: a resource update unit 1500, which is used to update the latest resource utilization status to the resource management table of the pooling layer after allocating corresponding hardware resources for the execution of each task based on the resource evaluation results and the task description information in the task management table.
[0106] Preferably, Fig.12 As shown, the above-mentioned device also includes: a dynamic adjustment unit 1600, which is used to continuously monitor the hardware resource status in the heterogeneous distributed cluster. If there is an imbalance in resource utilization or a new task arrives, the hardware allocation strategy of the task is implemented to adjust the load balancing and minimize the task waiting time.
[0107] Preferably, Fig.13 As shown, the dynamic adjustment unit 1600 includes a real-time monitoring module 1610, a first load adjustment module 1620, a new task module 1630 and a second load adjustment module 1640, wherein:
[0108] The real-time monitoring module 1610 is used to continuously monitor the resource status of each hardware resource in the heterogeneous distributed cluster.
[0109] The first load adjustment module 1620 is used for the scheduling layer to transfer some tasks from high-load devices to low-load devices while taking into account task priority and device performance when the pooling layer detects imbalance in resource utilization.
[0110] The new task module 1630 is used to determine the priority and resource requirements of the new task and provide a list of recommended execution devices when the pooling layer detects the arrival of a new task.
[0111] The second load adjustment module 1640 is used to dynamically adjust the hardware resource allocation of the task according to the current hardware resource occupancy status and the current task status obtained by the new task module, combined with the priority and resource requirements of the new task and the recommended execution device list provided by the new task module.
[0112] Preferably, Fig.14 As shown, the dynamic adjustment unit 1600 further includes:
[0113] The resource collection module 1650 is used to continuously collect resource usage data and task execution status over a period of time.
[0114] The resource prediction module 1660 is used to input the resource usage data and task execution status into a resource prediction model, and the resource prediction model is trained to predict the resource demand of different tasks in the future period based on the resource usage data and task execution status in the recent period.
[0115] The third load adjustment module 1670 is used to adjust the hardware allocation strategy of the task based on the output of the resource prediction model.
[0116] The detailed description of each of the above units and modules can be found in the corresponding description in the aforementioned method embodiment, which will not be further elaborated here.
[0117] It can be seen from the above technical solutions that the multi-task scheduling device based on heterogeneous distributed clusters provided by the present invention can more effectively utilize various computing resources, reduce idle resources, and ensure efficient use of resources. In addition, by considering the priority, deadline, and real-time status and performance of the task, the present application can assign tasks to the most suitable resources for execution, thereby shortening the completion time of the task and reducing the waiting time. It can also monitor resource usage and load status in real time, and dynamically adjust resource allocation and task scheduling strategies to cope with changes in workload. This allows the system to maintain stable operation even in the face of emergencies or load fluctuations. Finally, the present application can use machine learning algorithms to analyze historical data and predict resource requirements. The system's scheduling decisions will be optimized over time, improving the accuracy of decisions and the system's adaptability.
[0118] An embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the above method is implemented when the processor executes the program.
[0119] An embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program for executing the above method.
[0120] like Fig.15 As shown, the electronic device 600 may further include: a communication module 110, an input unit 120, an audio processor 130, a display 160, and a power supply 170. It is worth noting that the electronic device 600 does not necessarily have to include Fig.15 In addition, the electronic device 600 may also include Fig.15 For components not shown, reference may be made to the prior art.
[0121] like Fig.15 As shown, the central processor 100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor devices and / or logic devices. The central processor 100 receives inputs and controls the operations of various components of the electronic device 600.
[0122] The memory 140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 100 may execute the program stored in the memory 140 to implement information storage or processing.
[0123] The input unit 120 provides input to the CPU 100. The input unit 120 is, for example, a key or a touch input device. The power supply 170 is used to provide power to the electronic device 600. The display 160 is used to display display objects such as images and text. The display may be, for example, an LCD display, but is not limited thereto.
[0124] The memory 140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 140 may also be some other type of device. The memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application / function storage unit 142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 600 through the central processor 100.
[0125] The memory 140 may also include a data storage unit 143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 144 of the memory 140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0126] The communication module 110 is a transmitter / receiver 110 that transmits and receives signals via an antenna 111. The communication module (transmitter / receiver) 110 is coupled to the central processor 100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
[0127] Based on different communication technologies, multiple communication modules 110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module. The communication module (transmitter / receiver) 110 is also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide an audio output via the speaker 131 and receive an audio input from the microphone 132, thereby realizing a common telecommunication function. The audio processor 130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 130 is also coupled to the central processor 100, so that the sound can be recorded on the local machine through the microphone 132, and the sound stored on the local machine can be played through the speaker 131.
[0128] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented 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.
[0129] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.
[0130] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0132] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A multi-task scheduling method based on heterogeneous distributed clusters, characterized in that: The method comprises: Analyze the tasks in the pending task queue to obtain corresponding task description information, wherein the task description information includes task type, priority, deadline, type and quantity of resources required for the task; Recording the task description information in the task management table of the pooling layer; Perform resource utilization evaluation based on the cluster resource data recorded in the resource management table of the pooling layer to obtain a resource evaluation result; The scheduling layer allocates corresponding hardware resources for the execution of each task based on the resource evaluation result and the task description information in the task management table; Continuously monitor the hardware resource status in the heterogeneous distributed cluster. If there is an imbalance in resource utilization or a new task arrives, adjust the hardware allocation strategy of the task to achieve load balancing and minimize task waiting time. The scheduling layer allocates corresponding hardware resources for each task based on the resource evaluation result and the task description information in the task management table, including: Based on the resource evaluation results and the task description information in the task management table, features are extracted for each task and resource combination to generate quantifiable evaluation indicators for each task and resource combination, wherein the evaluation indicators include task-resource matching, resource utilization prediction, and task urgency; Sort the tasks according to their priorities and deadlines in the task management table to ensure that high-priority tasks and tasks approaching deadlines are processed first; Using a machine learning model to predict resource load conditions within a future set time period based on current resource usage and historical data in the resource assessment results, the machine learning model including a linear regression or decision tree model; Based on the predicted resource load, a heuristic algorithm is used to dynamically select the corresponding hardware resources to allocate to each corresponding task, so as to achieve the goal of load balancing and minimizing task waiting time; The continuous monitoring of the hardware resource status in the heterogeneous distributed cluster and the implementation of the hardware allocation strategy for adjusting the task if resource utilization is unbalanced or a new task arrives to achieve load balancing and minimize task waiting time also include: The scheduling layer continuously collects resource usage data and task execution status over a period of time; Inputting the resource usage data and task execution status into a resource prediction model, wherein the resource prediction model is trained to predict the resource demand of different tasks in a future period of time based on the resource usage data and task execution status in a recent period of time; The hardware allocation strategy of the task is adjusted based on the output of the resource prediction model.
2. The multi-task scheduling method based on heterogeneous distributed clusters according to claim 1, characterized in that: After the scheduling layer allocates corresponding hardware resources for the execution of each task based on the resource evaluation result and the task description information in the task management table, the method further includes: The latest resource utilization status is updated to the resource management table of the pooling layer.
3. The multi-task scheduling method based on heterogeneous distributed clusters according to claim 1, characterized in that: The continuous monitoring of the hardware resource status in the heterogeneous distributed cluster and the implementation of the hardware allocation strategy for adjusting the task if resource utilization is unbalanced or a new task arrives to achieve load balancing and minimize task waiting time include: The pooling layer continuously monitors the resource status of each hardware resource in the heterogeneous distributed cluster; When the pooling layer detects an imbalance in resource utilization, the scheduling layer will transfer some tasks from high-load devices to low-load devices while taking into account task priority and device performance; When the pooling layer detects the arrival of a new task, it determines the priority and resource requirements of the new task and gives a list of recommended execution devices. The scheduling layer dynamically adjusts the hardware resource allocation of the task based on the current hardware resource occupancy and the status of the current task in progress, combined with the priority and resource requirements of the new task and the list of recommended execution devices given by the pooling layer.
4. A multi-task scheduling device based on a heterogeneous distributed cluster, characterized in that: The device comprises: A task analysis unit, used to analyze the tasks in the pending task queue to obtain corresponding task description information, wherein the task description information includes task type, priority, deadline, and type and quantity of resources required for the task; A recording unit, used to record the task description information in a task management table of a pooling layer; A resource evaluation unit, configured to perform resource utilization evaluation based on the cluster resource data recorded in the resource management table of the pooling layer to obtain a resource evaluation result; A resource allocation unit, configured to allocate corresponding hardware resources for the execution of each task based on the resource evaluation result and the task description information in the task management table; The dynamic adjustment unit is used to continuously monitor the hardware resource status in the heterogeneous distributed cluster. If there is an imbalance in resource utilization or a new task arrives, the hardware allocation strategy for the task is adjusted to achieve load balancing and minimize task waiting time. The resource allocation unit comprises: A feature extraction module, for extracting features for each task and resource combination based on the resource evaluation result and the task description information in the task management table, so as to generate quantifiable evaluation indicators for each task and resource combination, wherein the evaluation indicators include task-resource matching degree, resource utilization prediction and task urgency; A sorting module, used to sort the tasks according to the priorities and deadlines of the tasks in the task management table, so as to ensure that the tasks with high priorities and tasks approaching the deadline are processed first; A resource prediction module, used to use a machine learning model to predict resource load conditions within a future set time period based on current resource usage and historical data in the resource evaluation results, wherein the machine learning model includes a linear regression or a decision tree model; The resource allocation module is used to dynamically select the corresponding hardware resources and allocate them to each corresponding task using a heuristic algorithm according to the predicted resource load, so as to achieve the goal of load balancing and minimizing task waiting time; The dynamic adjustment unit also includes: Resource collection module, used to continuously collect resource usage data and task execution status over a period of time; A resource prediction module, used to input the resource usage data and task execution status into a resource prediction model, wherein the resource prediction model is trained to predict the resource demand of different tasks in the future period based on the resource usage data and task execution status in the recent period; The third load adjustment module is used to adjust the hardware allocation strategy of the task based on the output of the resource prediction model.
5. The multi-task scheduling device based on heterogeneous distributed clusters according to claim 4, characterized in that: The device also includes: A resource updating unit is used to update the latest resource utilization status into the resource management table of the pooling layer after allocating corresponding hardware resources for the execution of each task based on the resource evaluation result and the task description information in the task management table.
6. The multi-task scheduling device based on heterogeneous distributed clusters according to claim 4, characterized in that: The dynamic adjustment unit comprises: Real-time monitoring module, used to continuously monitor the resource status of each hardware resource in a heterogeneous distributed cluster; The first load adjustment module is used for transferring some tasks from high-load devices to low-load devices while taking into account task priority and device performance when the pooling layer detects resource utilization imbalance; The new task module is used to determine the priority and resource requirements of new tasks and provide a list of recommended execution devices when the pooling layer detects the arrival of new tasks. The second load adjustment module is used to dynamically adjust the hardware resource allocation of the task based on the current hardware resource occupancy status and the current task status obtained by the new task module, combined with the priority and resource requirements of the new task and the recommended execution device list given by the new task module.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Computing power scheduling method based on deep learning
CN116974768A