Self-adaptive task scheduling method and device, equipment, medium and computer program product
By introducing the concept of damped breakdown and adaptively adjusting the task flow rate, the system instability problem of computer task scheduling under high load or resource constraints is solved, the system stability and responsiveness are maintained, and the scheduling complexity is reduced.
Patent Information
- Application Number
- CN202511943902.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-22
- Publication Date
- 2026-03-31
AI Technical Summary
Existing computer task scheduling methods struggle to maintain system stability and responsiveness under high load or resource constraints, and the scheduling decisions are highly complex.
By introducing the concept of damping breakdown, the initial task flow rate is calculated based on the inverse relationship between task priority and damping coefficient. When the number of unprocessed tasks exceeds a threshold, the task flow rate is adjusted to achieve adaptive scheduling.
Under high load or resource constraints, the system automatically adjusts the task flow rate to maintain system stability and responsiveness while reducing the complexity of scheduling decisions.
Smart Images

Figure CN121764623A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to an adaptive task scheduling method, apparatus, device, medium, and computer program product. Background Technology
[0002] Current task scheduling methods in the computer field fall into two main categories. One is static priority allocation, where each task is assigned a fixed priority upon creation, which remains constant throughout its lifecycle. The system executes tasks in priority order, with higher-priority tasks being executed first, and lower-priority tasks only being processed after higher-priority tasks have completed. This static priority allocation lacks flexibility, cannot adapt to changes in task requirements or system state, and is prone to priority inversion, where a lower-priority task blocks the execution of a higher-priority task because it holds the resources required by the higher-priority task. The other method dynamically adjusts task priorities at runtime based on certain task attributes (such as deadlines, resource requirements, and execution times). This is typically implemented through algorithms, such as Earliest Deadline First (EDF) and Shortest Job First (SJF). However, while this approach improves scheduling flexibility and efficiency, it relies on complex algorithm design and implementation, introducing additional computational overhead. In highly dynamic environments, frequent priority adjustments can lead to system instability. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide an adaptive task scheduling method, apparatus, device, medium and computer program product, which introduces the concept of damping breakdown, and can automatically adjust the flow rate of tasks of different priorities when the system faces high load or resource shortage, so as to maintain the stability and responsiveness of the system; at the same time, it reduces the complexity of scheduling decisions and lowers the difficulty of implementation.
[0004] To achieve the above objectives, embodiments of the present invention provide an adaptive task scheduling method, comprising: In response to a task arrival command, the initial task flow rate for each priority is calculated based on the task's priority and the damping coefficient corresponding to that priority; wherein the damping coefficient is used to control the task flow rate. Based on the initial task flow rate, tasks of each priority are executed to generate task execution data; Based on the task execution data, determine the number of unprocessed tasks for each priority level; In response to the number of unprocessed tasks of any priority exceeding a preset damping breakdown threshold, the task flow rate of each priority is adjusted.
[0005] As an improvement to the above scheme, the priority is inversely proportional to the damping coefficient.
[0006] As an improvement to the above scheme, the damping coefficient is inversely proportional to the task flow rate.
[0007] As an improvement to the above scheme, the step of calculating the initial task flow rate for each priority based on the task priority and the damping coefficient corresponding to the priority includes: The initial task flow rate for each priority is calculated based on the maximum processing capacity, damping coefficient, and maximum system processing capacity corresponding to each priority.
[0008] As an improvement to the above scheme, the formula for calculating the initial task flow rate is: ; In the formula, Indicates the initial task flow rate of priority i; This indicates the maximum processing capacity of priority i; This represents the damping coefficient of priority i; This represents the system's maximum processing capacity; n represents the number of priorities.
[0009] As an improvement to the above scheme, the task execution data includes the task ID, priority, reception time, and completion time.
[0010] As an improvement to the above solution, determining the number of unprocessed tasks of each priority level based on the task execution data includes: Based on a preset time window and the task execution data, the number of unprocessed tasks of each priority level is determined.
[0011] As an improvement to the above scheme, the adjustment of the task flow rate for each priority level in response to the number of unprocessed tasks exceeding a preset damping breakdown threshold includes: Determine whether the number of unprocessed tasks for each priority exceeds the damping breakdown threshold corresponding to each priority; If the number of unprocessed tasks for any of the priorities exceeds the corresponding damping breakdown threshold, the task flow rate for each priority is adjusted.
[0012] As an improvement to the above scheme, the priority is inversely proportional to the damping breakdown threshold, and the damping breakdown threshold is different for different priorities.
[0013] As an improvement to the above solution, the adjustment of task flow rates for each priority level includes: Based on the preset flow rate increase ratio, calculate the priority of task flow rates that exceed the corresponding damping breakdown threshold.
[0014] As an improvement to the above scheme, the formula for calculating the priority of the task flow rate exceeding the corresponding damping breakdown threshold is as follows: ; In the formula, This indicates the priority of the task flow rate that exceeds the corresponding damping breakdown threshold. Indicates the initial task flow rate of priority i; Indicates the preset flow rate increase ratio; This indicates the system's maximum processing capacity; This indicates the initial task flow rate with a priority that has not exceeded the corresponding damping breakdown threshold.
[0015] As an improvement to the above scheme, the sum of the flow rates of all priority tasks after adjustment is less than or equal to the system's maximum processing capacity.
[0016] As an improvement to the above solution, the method further includes: If the sum of the flow rates of all priority tasks after adjustment is greater than the system's maximum processing capacity, then the flow rates of priority tasks that have not exceeded the corresponding damping breakdown threshold are calculated based on the preset flow rate reduction ratio.
[0017] As an improvement to the above scheme, the calculation formula for the priority task flow rate that does not exceed the corresponding damping breakdown threshold is as follows: ; In the formula, This indicates the priority of the task flow rate that has not exceeded the corresponding damping breakdown threshold; This indicates the initial task flow rate with a priority that has not exceeded the corresponding damping breakdown threshold. Indicates the preset flow rate reduction percentage; It is a positive number.
[0018] As an improvement to the above scheme, after adjusting the task flow rate of each priority, tasks of each priority are executed based on the adjusted task flow rate.
[0019] As an improvement to the above solution, the method further includes: Based on a preset time window, if the number of unprocessed tasks of any priority does not exceed a preset damping breakdown threshold, the corresponding task flow rate is restored to the initial task flow rate.
[0020] As an improvement to the above solution, the method further includes: If, within a preset time interval, it is determined again that the number of unprocessed tasks of any priority exceeds the corresponding damping breakdown threshold, then there is no need to adjust the task flow rate of each priority.
[0021] As an improvement to the above solution, the method further includes: If, outside of the preset time interval, it is determined again that the number of unprocessed tasks of any of the priorities exceeds the corresponding damping breakdown threshold, the task flow rate of each priority will continue to be adjusted.
[0022] This invention also provides an adaptive task scheduling device, comprising: The flow rate calculation module is used to calculate the initial flow rate of each priority task in response to the task arrival command, based on the task priority and the damping coefficient corresponding to the priority; wherein, the damping coefficient is used to control the task flow rate. The data generation module is used to execute tasks of various priorities based on the initial task flow rate and generate task execution data; The quantity determination module is used to determine the number of unprocessed tasks of each priority based on the task execution data. The flow rate adjustment module is used to adjust the flow rate of tasks of each priority when the number of unprocessed tasks of any priority exceeds a preset damping breakdown threshold.
[0023] This invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the adaptive task scheduling method described in any of the preceding claims.
[0024] This invention also provides a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute the adaptive task scheduling method described above.
[0025] This invention also provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, they implement the adaptive task scheduling method described above.
[0026] Compared to existing technologies, the beneficial effects of the adaptive task scheduling method, apparatus, device, medium, and computer program product provided by this invention are as follows: In response to a task arrival instruction, an initial task flow rate for each priority is calculated based on the task's priority and the damping coefficient corresponding to that priority; wherein the damping coefficient is used to control the task flow rate; tasks of each priority are executed based on the initial task flow rate, generating task execution data; the number of unprocessed tasks for each priority is determined based on the task execution data; and in response to the number of unprocessed tasks for any priority exceeding a preset damping breakdown threshold, the task flow rate for each priority is adjusted. This invention introduces the concept of damping breakdown, enabling automatic adjustment of the task flow rate for each priority under high load or resource constraints to maintain system stability and responsiveness; simultaneously reducing the complexity of scheduling decisions and lowering implementation difficulty. Attached Figure Description
[0027] Figure 1 This is a flowchart illustrating a preferred embodiment of an adaptive task scheduling method provided by the present invention; Figure 2 This is a schematic diagram of a preferred embodiment of an adaptive task scheduling device provided by the present invention; Figure 3 This is a schematic diagram of a preferred embodiment of a terminal device provided by the present invention. Detailed Implementation
[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0029] Please see Figure 1 , Figure 1 This is a flowchart illustrating a preferred embodiment of an adaptive task scheduling method provided by the present invention. The adaptive task scheduling method includes: S1, in response to a task arrival command, calculate the initial task flow rate for each priority based on the task priority and the damping coefficient corresponding to the priority; wherein, the damping coefficient is used to control the task flow rate. S2, Execute tasks of each priority based on the initial task flow rate to generate task execution data; S3, Based on the task execution data, determine the number of unprocessed tasks of each priority level; S4, in response to the number of unprocessed tasks of any priority exceeding a preset damping breakdown threshold, adjust the task flow rate of each priority.
[0030] Specifically, this invention provides a priority allocation execution mechanism based on damping characteristics, which can simply and effectively implement a method and mechanism for prioritizing task execution. Tasks are divided into multiple priorities, each with a damping coefficient of varying strength. Under normal circumstances, each priority is executed proportionally according to its corresponding damping coefficient. When a task of a certain priority breaks through its damping threshold, the flow rate of tasks of each priority is dynamically adjusted to adjust the task execution strategy and achieve dynamic balance. This mechanism draws on the damping principle in physical systems; when the system approaches an unstable state (i.e., damping breakdown), it can intelligently reallocate resources and priorities to prevent system crashes or service interruptions. This design avoids fixed resource allocation and reduces the complexity of dynamic resource allocation through mechanism optimization. Through a damping-based regulating valve mechanism, the flow of resources between different priorities is controlled without using complex algorithms. This design ensures that, under limited resource conditions, high-priority tasks receive more execution opportunities, and that when the number of high-priority tasks decreases, resources are smoothly released to lower-priority tasks, achieving efficient resource reallocation. This solves problems such as dynamic balancing, priority inversion, scheduling complexity, and system responsiveness in existing scheduling mechanisms, enabling more efficient and stable task scheduling and resource management.
[0031] The priority is inversely proportional to the damping coefficient. The higher the priority, the smaller the damping coefficient; the lower the priority, the larger the damping coefficient.
[0032] Furthermore, the damping coefficient is inversely proportional to the task flow rate. The smaller the damping coefficient, the faster the task flow rate; the larger the damping coefficient, the slower the task flow rate.
[0033] This invention, through the introduction of a damping coefficient, configures different damping coefficients for each priority level. This enables flexible adaptation to different application scenarios and self-adjustment without external intervention, achieving dynamic balance of system resources and preventing excessive resource consumption by a single task or priority level. The damping mechanism can prevent low-priority tasks from occupying resources for extended periods, thus blocking high-priority tasks. By dynamically adjusting the flow rate of tasks at each priority level, it ensures that urgent or critical tasks can be processed in a timely manner.
[0034] Furthermore, the step of calculating the initial task flow rate for each priority based on the task priority and the damping coefficient corresponding to the priority includes: The initial task flow rate for each priority is calculated based on the maximum processing capacity, damping coefficient, and maximum system processing capacity corresponding to each priority.
[0035] For example, the formula for calculating the initial task flow rate is: ; In the formula, Indicates the initial task flow rate of priority i; This indicates the maximum processing capacity of priority i; This represents the damping coefficient of priority i; This represents the system's maximum processing capacity, which is the sum of all priority tasks that the system can handle under ideal conditions; n represents the number of priorities.
[0036] For example, assuming there are 3 priorities, the system's maximum processing capacity... =250, maximum processing capacity for each priority level. , , Damping coefficients for each priority level =0.1, =0.2, =0.3, then the initial task flow rate is calculated as follows: ; ; .
[0037] Preferably, the task execution data includes the task ID, priority, reception time, and completion time.
[0038] Furthermore, in step S3, based on the task execution data, the number of unprocessed tasks for each priority level is determined, including: Based on a preset time window and the task execution data, the number of unprocessed tasks of each priority level is determined.
[0039] For example, in this embodiment of the invention, a fixed time window is set, such as every 5 minutes or every 10 minutes. At the end of each time window, the number of unprocessed tasks of each priority is calculated based on the task ID, priority, reception time and completion time.
[0040] In a preferred embodiment, step S4, in response to the number of unprocessed tasks of any priority exceeding a preset damping breakdown threshold, adjusts the task flow rate for each priority, including: S41, determine whether the number of unprocessed tasks for each priority exceeds the damping breakdown threshold corresponding to each priority; S42, if the number of unprocessed tasks of any priority exceeds the corresponding damping breakdown threshold, then adjust the task flow rate of each priority.
[0041] Specifically, this embodiment of the invention determines whether the number of unprocessed tasks for each priority exceeds the damping breakdown threshold corresponding to that priority. The priority is inversely proportional to the damping breakdown threshold. Higher priority results in a smaller damping breakdown threshold; lower priority results in a larger damping breakdown threshold. Furthermore, different priorities have different damping breakdown thresholds. If it is determined that the number of unprocessed tasks for any priority exceeds the corresponding damping breakdown threshold, the task flow rate for each priority is adjusted.
[0042] For example, embodiments of the present invention set a time window. =5 minutes, damping breakdown threshold of priority i Within the time window Within, the number of unprocessed tasks of priority i If the priority damping fails, it is considered that the damping has broken down.
[0043] Furthermore, adjusting the task flow rate for each priority level includes: Based on the preset flow rate increase ratio, calculate the priority of task flow rates that exceed the corresponding damping breakdown threshold.
[0044] For example, the formula for calculating the task flow rate with a priority exceeding the corresponding damping breakdown threshold is: ; In the formula, This indicates the priority of the task flow rate that exceeds the corresponding damping breakdown threshold (i.e., damping breakdown). Indicates the initial task flow rate of priority i; Indicates the preset flow rate increase ratio; This indicates the system's maximum processing capacity; This indicates the initial task flow rate with a priority that has not exceeded the corresponding damping breakdown threshold.
[0045] It should be noted that after the adjustment, the sum of the flow rates of all priority tasks is less than or equal to the system's maximum processing capacity, allowing task execution to be carried out within the system's maximum processing capacity, thus achieving flexible resource flow.
[0046] If the sum of the flow rates of all priorities after adjustment exceeds the system's maximum processing capacity, resources need to be borrowed from other priorities that have not experienced breakdown. This involves calculating the flow rates of tasks whose priorities have not exceeded the corresponding damping breakdown threshold, based on a preset flow rate reduction ratio. For example, low-priority tasks may continuously consume most of the system resources. When high-priority tasks are executing and task queuing occurs, resources are borrowed to reduce the flow rate of low-priority tasks and increase the flow rate of high-priority tasks.
[0047] For example, the formula for calculating the task flow rate of the priority that does not exceed the corresponding damping breakdown threshold is: ; In the formula, This indicates the priority of the task flow rate that has not exceeded the corresponding damping breakdown threshold; This indicates the initial task flow rate with a priority that has not exceeded the corresponding damping breakdown threshold. Indicates the preset flow rate reduction percentage; It is a positive number to ensure that the task flow rate does not drop to zero.
[0048] For example, suppose =0.2, =0.3, =20. After the priority 1 damping threshold is broken, the task flow rate is adjusted to: At this point, the total processing capacity is ,but , No adjustments are required.
[0049] Assuming the priority 1 damping threshold continues to break down, the flow rate is adjusted as follows: At this point, the total processing capacity is Then continue to adjust. , After processing + + =172+44+29=245< =250, adjustment complete.
[0050] Furthermore, after adjusting the task flow rate of each priority, tasks of each priority are executed based on the adjusted task flow rate.
[0051] Compared to complex dynamic priority scheduling algorithms, the damping mechanism in this invention provides a relatively simple adaptive strategy, reducing the complexity of scheduling decisions and lowering the implementation difficulty. By smoothing out fluctuations in task execution, the damping mechanism helps improve the system's response speed to sudden tasks while maintaining the overall stability and performance of the system.
[0052] As a preferred embodiment, the method further includes: Based on a preset time window, if the number of unprocessed tasks of any priority does not exceed a preset damping breakdown threshold, the corresponding task flow rate is restored to the initial task flow rate.
[0053] Specifically, the embodiments of the present invention also include a recovery mechanism. If, within a set fixed time window, the number of unprocessed tasks of any priority does not exceed a preset damping breakdown threshold, the corresponding task flow rate is restored to the initial task flow rate.
[0054] As a preferred embodiment, the method further includes: If, within a preset time interval, it is determined again that the number of unprocessed tasks of any priority exceeds the corresponding damping breakdown threshold, then there is no need to adjust the task flow rate of each priority.
[0055] If, outside of the preset time interval, it is determined again that the number of unprocessed tasks of any of the priorities exceeds the corresponding damping breakdown threshold, the task flow rate of each priority will continue to be adjusted.
[0056] For example, this embodiment of the invention sets a preset time interval, such as 10 minutes. If the time since the last adjustment does not exceed this 10-minute period, it is considered to still be in the cooling-off period. If it is within the cooling-off period, any adjustment requests are ignored. If it is outside the cooling-off period, the task flow rate is adjusted according to the decision, and the time window is reset to recalculate the optimization of the adjusted strategy.
[0057] Accordingly, the present invention also provides an adaptive task scheduling apparatus capable of implementing all processes of the adaptive task scheduling method in the above embodiments.
[0058] Please see Figure 2 , Figure 2 This is a schematic diagram of a preferred embodiment of an adaptive task scheduling device provided by the present invention. The adaptive task scheduling device includes: The flow rate calculation module 201 is used to calculate the initial flow rate of each priority task in response to the task arrival command, based on the task priority and the damping coefficient corresponding to the priority; wherein the damping coefficient is used to control the task flow rate. Data generation module 202 is used to execute tasks of various priorities based on the initial task flow rate and generate task execution data; The quantity determination module 203 is used to determine the number of unprocessed tasks of each priority based on the task execution data. The flow rate adjustment module 204 is used to adjust the flow rate of tasks of each priority in response to the number of unprocessed tasks of any priority exceeding a preset damping breakdown threshold.
[0059] Preferably, the priority is inversely proportional to the damping coefficient.
[0060] Preferably, the damping coefficient is inversely proportional to the task flow rate.
[0061] Preferably, the step of calculating the initial task flow rate for each priority based on the task priority and the damping coefficient corresponding to the priority includes: The initial task flow rate for each priority is calculated based on the maximum processing capacity, damping coefficient, and maximum system processing capacity corresponding to each priority.
[0062] Preferably, the formula for calculating the initial task flow rate is: ; In the formula, Indicates the initial task flow rate of priority i; This indicates the maximum processing capacity of priority i; This represents the damping coefficient of priority i; This represents the system's maximum processing capacity; n represents the number of priorities.
[0063] Preferably, the task execution data includes the task ID, priority, reception time, and completion time.
[0064] Preferably, the quantity determination module 203 is specifically used for: Based on a preset time window and the task execution data, the number of unprocessed tasks of each priority level is determined.
[0065] Preferably, the flow rate adjustment module 204 is specifically used for: Determine whether the number of unprocessed tasks for each priority exceeds the damping breakdown threshold corresponding to each priority; If the number of unprocessed tasks for any of the priorities exceeds the corresponding damping breakdown threshold, the task flow rate for each priority is adjusted.
[0066] Preferably, the priority is inversely proportional to the damping breakdown threshold, and the damping breakdown threshold is different for different priorities.
[0067] Preferably, adjusting the task flow rate of each priority level includes: Based on the preset flow rate increase ratio, calculate the priority of task flow rates that exceed the corresponding damping breakdown threshold.
[0068] Preferably, the formula for calculating the task flow rate with priority exceeding the corresponding damping breakdown threshold is: ; In the formula, This indicates the priority of the task flow rate that exceeds the corresponding damping breakdown threshold. Indicates the initial task flow rate of priority i; Indicates the preset flow rate increase ratio; This indicates the system's maximum processing capacity; This indicates the initial task flow rate with a priority that has not exceeded the corresponding damping breakdown threshold.
[0069] Preferably, the sum of the flow rates of all priority tasks after adjustment is less than or equal to the system's maximum processing capacity.
[0070] Preferably, the flow rate adjustment module 204 is further configured to: If the sum of the flow rates of all priority tasks after adjustment is greater than the system's maximum processing capacity, then the flow rates of priority tasks that have not exceeded the corresponding damping breakdown threshold are calculated based on the preset flow rate reduction ratio.
[0071] Preferably, the calculation formula for the priority task flow rate that does not exceed the corresponding damping breakdown threshold is as follows: ; In the formula, This indicates the priority of the task flow rate that has not exceeded the corresponding damping breakdown threshold; This indicates the initial task flow rate with a priority that has not exceeded the corresponding damping breakdown threshold. Indicates the preset flow rate reduction percentage; It is a positive number.
[0072] Preferably, after adjusting the task flow rate of each priority, tasks of each priority are executed based on the adjusted task flow rate.
[0073] Preferably, the device further includes a flow rate recovery module, used for: Based on a preset time window, if the number of unprocessed tasks of any priority does not exceed a preset damping breakdown threshold, the corresponding task flow rate is restored to the initial task flow rate.
[0074] Preferably, the flow rate adjustment module 204 is further configured to: If, within a preset time interval, it is determined again that the number of unprocessed tasks of any priority exceeds the corresponding damping breakdown threshold, then there is no need to adjust the task flow rate of each priority.
[0075] Preferably, the flow rate adjustment module 204 is further configured to: If, outside of the preset time interval, it is determined again that the number of unprocessed tasks of any of the priorities exceeds the corresponding damping breakdown threshold, the task flow rate of each priority will continue to be adjusted.
[0076] In specific implementation, the working principle, control process and technical effects of the adaptive task scheduling device provided in the embodiments of the present invention are the same as those of the adaptive task scheduling method in the above embodiments, and will not be repeated here.
[0077] Please see Figure 3, Figure 3 This is a schematic diagram of a preferred embodiment of a terminal device provided by the present invention. The terminal device includes a processor 301, a memory 302, and a computer program stored in the memory 302 and configured to be executed by the processor 301. When the processor 301 executes the computer program, it implements the adaptive task scheduling method described in any of the above embodiments.
[0078] Preferably, the computer program can be divided into one or more modules / units (such as computer program 1, computer program 2, ...), and the one or more modules / units are stored in the memory 302 and executed by the processor 301 to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.
[0079] The processor 301 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or the processor 301 can be any conventional processor. The processor 301 is the control center of the terminal device, connecting various parts of the terminal device through various interfaces and lines.
[0080] The memory 302 mainly includes a program storage area and a data storage area. The program storage area can store the operating system, applications required for at least one function, etc., and the data storage area can store related data, etc. In addition, the memory 302 can be a high-speed random access memory, or a non-volatile memory, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, and a flash card, etc., or the memory 302 can also be other volatile solid-state storage devices.
[0081] It should be noted that the aforementioned terminal devices may include, but are not limited to, processors and memory, as will be understood by those skilled in the art. Figure 3The structural diagram is merely an example of the terminal device described above and does not constitute a limitation on the terminal device described above. It may include more or fewer components than shown in the diagram, or combine certain components, or use different components.
[0082] This invention also provides a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute the adaptive task scheduling method described in any of the above embodiments.
[0083] This invention also provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, they implement the adaptive task scheduling method described in any of the above embodiments.
[0084] This invention provides an adaptive task scheduling method, apparatus, device, medium, and computer program product. In response to a task arrival command, it calculates an initial task flow rate for each priority based on the task's priority and a corresponding damping coefficient. The damping coefficient controls the task flow rate. Tasks of each priority are executed based on the initial task flow rate, generating task execution data. The number of unprocessed tasks for each priority is determined based on the task execution data. In response to the number of unprocessed tasks for any priority exceeding a preset damping breakdown threshold, the task flow rate for each priority is adjusted. This invention introduces the concept of damping breakdown, enabling automatic adjustment of task flow rates for each priority under high load or resource constraints to maintain system stability and responsiveness. It also reduces the complexity of scheduling decisions and lowers implementation difficulty.
[0085] It should be noted that the system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and 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 modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the system embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0086] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method of adaptive task scheduling, the method comprising: The method comprises the following steps: in response to a task arrival instruction, calculating an initial task flow rate of each priority according to the priority of the task and a damping coefficient corresponding to the priority, wherein the damping coefficient is used to control the task flow rate; executing the task of each priority based on the initial task flow rate to generate task execution data; determining the number of unprocessed tasks of each priority according to the task execution data; in response to the number of unprocessed tasks of any priority exceeding a preset damping breakdown threshold, adjusting the task flow rate of each priority.
2. The self-adapting task scheduling method of claim 1, wherein, The priority is inversely proportional to the damping coefficient.
3. The self-adapting task scheduling method of claim 1, wherein, The damping coefficient is inversely proportional to the task flow rate.
4. The self-adapting task scheduling method of claim 1, wherein, The step of calculating the initial task flow rate of each priority according to the priority of the task and the damping coefficient corresponding to the priority comprises the following steps: calculating the initial task flow rate of each priority according to the maximum processing capacity corresponding to each priority, the damping coefficient and the maximum system processing capacity.
5. The self-adapting task scheduling method of claim 4, wherein, The calculation formula of the initial task flow rate is: ; wherein represents the initial task flow rate of priority i; represents the maximum processing capacity of priority i; represents the damping coefficient of priority i; represents the system maximum processing capacity; n represents the number of priorities.
6. The self-adapting task scheduling method of claim 1, wherein, The task execution data comprises the ID, priority, receiving time and completion time of the task.
7. The self-adapting task scheduling method of claim 1, wherein, The step of determining the number of unprocessed tasks of each priority according to the task execution data comprises the following steps: determining the number of unprocessed tasks of each priority according to the task execution data based on a preset time window.
8. The self-adapting task scheduling method of claim 1, wherein, The step of adjusting the task flow rate of each priority in response to the number of unprocessed tasks of any priority exceeding a preset damping breakdown threshold comprises the following steps: determining whether the number of unprocessed tasks of each priority exceeds the damping breakdown threshold corresponding to each priority; if the number of unprocessed tasks of any priority exceeds the corresponding damping breakdown threshold, adjusting the task flow rate of each priority.
9. The self-adapting task scheduling method of claim 8, wherein, The priority is inversely proportional to the damping breakdown threshold, and the damping breakdown thresholds of different priorities are different.
10. The self-adapting task scheduling method of claim 8, wherein, The step of adjusting the task flow rate of each priority comprises the following steps: calculating the task flow rate of the priority exceeding the corresponding damping breakdown threshold according to a preset flow rate increase ratio.
11. The self-adapting task scheduling method of claim 10, wherein, The calculation formula of the task flow rate of the priority exceeding the corresponding damping breakdown threshold is: ; wherein, represents a task flow rate of a priority exceeding a corresponding damping breakdown threshold value; represents an initial task flow rate of a priority i; represents a preset flow rate increase ratio; represents a system maximum processing capacity; represents an initial task flow rate of a priority not exceeding a corresponding damping breakdown threshold value.
12. The self-adapting task scheduling method of claim 10, wherein, The sum of the task flow rates of all priorities after adjustment is less than or equal to the maximum system processing capacity.
13. The self-adapting task scheduling method of claim 12, wherein, The method further comprises the following steps: if the sum of the task flow rates of all priorities after adjustment is greater than the maximum system processing capacity, calculating the task flow rate of the priority not exceeding the corresponding damping breakdown threshold according to a preset flow rate decrease ratio.
14. The self-adapting task scheduling method of claim 13, wherein, The calculation formula of the task flow rate of the priority not exceeding the corresponding damping breakdown threshold is: ; In the formula, denotes the initial task flow rate of the priority that does not exceed the corresponding damping breakdown threshold; denotes the initial task flow rate of the priority that does not exceed the corresponding damping breakdown threshold; denotes the preset flow rate reduction ratio; is a positive number.
15. The self-adapting task scheduling method of claim 13, wherein, After adjusting the task flow rate of each priority, the task of each priority is executed based on the adjusted task flow rate.
16. The self-adapting task scheduling method of claim 15, wherein, The method further comprises the following steps: based on a preset time window, in response to the number of unprocessed tasks of any priority not exceeding the preset damping breakdown threshold, restoring the corresponding task flow rate to the initial task flow rate.
17. The self-adapting task scheduling method of claim 15, wherein, The method further comprises the following steps: within a preset time interval, if it is determined again that the number of unprocessed tasks of any priority exceeds the corresponding damping breakdown threshold, the task flow rate of each priority does not need to be adjusted.
18. The self-adapting task scheduling method of claim 17, wherein, The method further comprises the following steps: If the number of unprocessed tasks of any of the priorities is determined to exceed the corresponding damping breakdown threshold again outside the preset time interval, the task flow rate of each priority is continuously adjusted.
19. An adaptive task scheduling apparatus, characterized by comprising: The method comprises the following steps: A flow rate calculation module is configured to calculate an initial task flow rate of each priority according to the priority of a task and the damping coefficient corresponding to the priority in response to a task arrival instruction, wherein the damping coefficient is used to control the task flow rate. A data generation module is configured to generate task execution data by executing tasks of each priority based on the initial task flow rate. A number determination module is configured to determine the number of unprocessed tasks of each priority according to the task execution data. A flow rate adjustment module is configured to adjust the task flow rate of each priority in response to the number of unprocessed tasks of any priority exceeding a preset damping breakdown threshold.
20. The adaptive task scheduling apparatus of claim 19, wherein, The priority is inversely proportional to the damping coefficient.
21. The adaptive task scheduling apparatus of claim 19, wherein, The damping coefficient is inversely proportional to the task flow rate.
22. The adaptive task scheduling apparatus of claim 19, wherein, The initial task flow rate of each priority is calculated according to the priority of a task and the damping coefficient corresponding to the priority, which comprises the following steps: The initial task flow rate of each priority is calculated according to the maximum processing capacity corresponding to each priority, the damping coefficient, and the maximum system processing capacity.
23. The adaptive task scheduling apparatus of claim 22, wherein, The calculation formula of the initial task flow rate is as follows: ; wherein represents the initial task flow rate of priority i; represents the maximum processing capacity of priority i; represents the damping coefficient of priority i; represents the maximum processing capacity of the system; n represents the number of priorities.
24. A terminal device, comprising: The adaptive task scheduling method comprises a processor and a memory, wherein the memory stores a computer program, and the computer program is configured to be executed by the processor, and the processor implements the adaptive task scheduling method according to any one of claims 1 to 18 when executing the computer program.
25. A computer readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein the device where the computer readable storage medium is located implements the adaptive task scheduling method according to any one of claims 1 to 18 when executing the computer program.
26. A computer program product, characterised in that, The computer program product comprises a computer program or computer instructions, and the computer program or the computer instructions are executed by a processor to implement the adaptive task scheduling method according to any one of claims 1 to 18.
Citation Information
Cited By
Discrete task-oriented resource scheduling optimization management system
CN122114564A
