Task scheduling method and device, readable storage medium and computer program product

By classifying storage by task type and combining queue priority and response ratio for task scheduling, the problem of "hunger" of low-priority tasks is solved, the flexibility and system efficiency of task scheduling are improved, and the efficient execution of tasks is achieved.

CN120407122APending Publication Date: 2025-08-01CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510669765.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

In the existing task scheduling methods, low-priority tasks are prone to falling into a "hungry" state, resulting in system load imbalance and task timeout failure, and insufficient scheduling flexibility, making it impossible to adapt to real-time changes in complex task scenarios.

Method used

By obtaining the queue priority and task response ratio of multiple scheduling queues corresponding to the set of tasks to be scheduled, the tasks to be scheduled are stored according to the task type, and task scheduling is scheduled in combination with the queue priority and response ratio to prioritize tasks with high priority and high response ratio.

Benefits of technology

It reduces task waiting time, improves task scheduling flexibility and system performance, and ensures fairness and efficient execution of tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407122A_ABST
    Figure CN120407122A_ABST
Patent Text Reader

Abstract

The invention discloses a task scheduling method and device, a readable storage medium and a computer program product, and relates to the technical field of computers.The method comprises the steps that queue priorities of a plurality of scheduling queues corresponding to a to-be-scheduled task set are obtained, the to-be-scheduled task set is a set of to-be-scheduled tasks, and the queue priorities of the scheduling queues correspond to the to-be-scheduled tasks; all the to-be-scheduled tasks are classified and stored in all the scheduling queues; according to the queue priority of each scheduling queue and the response ratio of each task to be scheduled, task scheduling is carried out on the task set to be scheduled, and the response ratio is in positive correlation with the task waiting time. According to the task scheduling method and device, the technical problems that the task is prone to being hungry and the task scheduling flexibility is low are solved, and the effects of reducing the task hungry and improving the task scheduling flexibility are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a task scheduling method, device, readable storage medium, and computer program product. Background Art

[0002] Task scheduling is a core mechanism in computer systems that coordinates the execution order of multiple tasks and resource allocation. It plays a crucial role in complex scenarios such as distributed systems and cloud computing platforms. The core goal of task scheduling is to optimize overall system performance by rationally allocating computing resources and dynamically adjusting the execution order of scheduled tasks.

[0003] Traditional task scheduling methods usually adopt a static priority-based scheduling strategy, which pre-assigns a fixed priority to each task and schedules and executes tasks strictly in order of priority.

[0004] However, priority-based scheduling methods have at least the following problems: First, low-priority tasks are prone to "starvation." Because high-priority tasks continuously preempt resources, low-priority tasks may be unable to obtain execution opportunities for a long time and become backlogged, leading to problems such as system load imbalance and task timeouts. Second, task scheduling has low flexibility. In complex task scenarios, the urgency of tasks may change with business needs or system status (such as sudden traffic leading to resource shortages), and traditional methods cannot adjust priorities according to real-time conditions, resulting in rigid scheduling strategies. For example, when the system load surges, if low-priority tasks include critical dependent operations (such as resource release), their long waiting time may indirectly affect the execution efficiency of high-priority tasks.

[0005] Therefore, how to reduce the task "hunger" phenomenon and improve the flexibility of task scheduling is a technical problem that needs to be solved urgently in this technical field. Summary of the Invention

[0006] The main purpose of this application is to provide a task scheduling method, device, readable storage medium and computer program product, aiming to solve the technical problem of how to reduce the task "hunger" phenomenon and improve the flexibility of task scheduling.

[0007] To achieve the above objectives, the present application provides a task scheduling method, which includes the following steps:

[0008] Obtaining queue priorities of multiple scheduling queues corresponding to a set of tasks to be scheduled, wherein the set of tasks to be scheduled is a collection of tasks to be scheduled, and all the tasks to be scheduled are classified and stored in each of the scheduling queues;

[0009] Task scheduling is performed on the set of tasks to be scheduled according to the queue priorities of the respective scheduling queues and the response ratios of the respective tasks to be scheduled, where the response ratio is positively correlated with the task waiting time.

[0010] Select a target queue according to the queue priorities of the respective scheduling queues, and obtain or determine the response ratios of the respective target tasks to be scheduled in the target queue, where the target queue is the scheduling queue with the highest queue priority and a non-empty queue among the respective scheduling queues, and the target task to be scheduled is part or all of the tasks to be scheduled stored in the target queue;

[0011] Task scheduling is performed on the respective target tasks to be scheduled in the set of tasks to be scheduled according to the response ratios of the respective target tasks to be scheduled in the target queue.

[0012] In one embodiment, the step of obtaining or determining the response ratios of the respective target tasks to be scheduled in the target queue includes:

[0013] If the selected target queue is the pre-task queue, obtain preset task dependency data, where the pre-task queue is a queue for storing pre-dependency preparation tasks;

[0014] For any task to be scheduled stored in the target queue, if the preset task dependency data finds a post-task that depends on the task to be scheduled and the post-task exists in the set of tasks to be scheduled, mark the task to be scheduled as a target task to be scheduled;

[0015] Obtain or determine the response ratios of the respective tasks marked as target tasks to be scheduled in the target queue.

[0016] In one embodiment, the step of obtaining or determining the response ratios of the respective target tasks to be scheduled in the target queue includes:

[0017] For each target task to be scheduled in the target queue, obtain the task waiting time and the task processing time of the target task to be scheduled;

[0018] Calculate the sum value between the task waiting time and the task processing time, and divide the sum value by the task processing time to obtain a time ratio;

[0019] Determine the response ratio of the target task to be scheduled based on the time ratio, where the response ratio is positively correlated with the time ratio.

[0020] In one embodiment, the step of determining the response ratio of the target task to be scheduled based on the time ratio includes:

[0021] Determine the time ratio as the response ratio of the target task to be scheduled; or,

[0022] Obtain the urgency factor corresponding to the target task to be scheduled, and perform a weighted summation calculation on the time ratio and the urgency factor to obtain the response ratio of the target task to be scheduled.

[0023] In one embodiment, after the step of obtaining the queue priorities of multiple scheduling queues corresponding to the task set to be scheduled, the method further includes:

[0024] For each of the scheduling queues, obtain the response ratio threshold corresponding to the scheduling queue, and obtain or determine the response ratio of each task in the scheduling queue;

[0025] If there is an urgent task in the scheduling queue whose response ratio is greater than or equal to the response ratio threshold, schedule the urgent task in the task set to be scheduled for execution, or wait for a preset duration and then schedule the urgent task in the task set to be scheduled for execution.

[0026] In one embodiment, the scheduling queue includes a basic task queue, a pre-task queue, and a general task queue. The basic task queue is used to store tasks for ensuring the core functions of the system, the pre-task queue is used to store pre-dependency preparation tasks, and the general task queue is used to store regular business execution tasks;

[0027] The queue priority of the basic task queue is greater than the queue priority of the pre-task queue, and the queue priority of the pre-task queue is greater than the queue priority of the general task queue.

[0028] In addition, to achieve the above object, the present application further provides a task scheduling device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor. The computer program is configured to implement the steps of the task scheduling method as described above.

[0029] In addition, to achieve the above object, the present application further provides a readable storage medium, which is a computer-readable storage medium. A computer program is stored on the computer-readable storage medium, and the computer program is executed by a processor to implement the steps of the task scheduling method as described above.

[0030] The present application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the steps of the task scheduling method as described above.

[0031] One or more technical solutions proposed by the present application have at least the following technical effects:

[0032] This application obtains the queue priorities of multiple scheduling queues corresponding to a set of tasks to be scheduled. Herein, the set of tasks to be scheduled is a collection of tasks to be scheduled, and all the tasks to be scheduled are classified and stored in each of the scheduling queues. According to the queue priorities of each of the scheduling queues and the response ratios of each of the tasks to be scheduled, task scheduling is performed on the set of tasks to be scheduled, where the response ratio is positively correlated with the task waiting time. Thus, in the embodiments of this application, the tasks to be scheduled are classified and stored in the corresponding scheduling queues according to the task types of the tasks to be scheduled, that is, the tasks to be scheduled are classified and stored according to task types, and task scheduling is performed in combination with the queue priorities of each scheduling queue and the response ratios of the scheduling tasks, so that tasks with high response ratios in high-priority scheduling queues can be preferentially scheduled. It can be understood that the response ratio is positively correlated with the task waiting time, so that tasks to be scheduled with long waiting times can be preferentially scheduled and executed, reducing the waiting time of the tasks to be scheduled, thereby reducing the phenomenon of task "starvation". And each scheduling queue stores the tasks to be scheduled in a classified manner, and the queue priority of the scheduling queue can thus reflect the priorities of different types of tasks. Performing task scheduling in combination with the queue priority and the response ratio can be understood as performing task scheduling in combination with the task type and the task response ratio, rather than simply scheduling based on a single fixed priority, thereby improving the flexibility of task scheduling. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with this application and, together with the specification, are used to explain the principles of this application.

[0034] In order to more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.

[0035] Figure 1 It is a schematic flowchart of the first embodiment of the task scheduling method of this application;

[0036] Figure 2 It is a schematic flowchart of the second embodiment of the task scheduling method of this application;

[0037] Figure 3 It is a schematic flowchart of the task scheduling process involved in an embodiment of the task scheduling method of this application;

[0038] Figure 4 It is a schematic structural diagram of the task scheduling device of this application;

[0039] Figure 5 It is a schematic structural diagram of the device of the hardware operating environment involved in the task scheduling method device in the embodiments of this application.

[0040] The realization of the purpose, functional features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. Detailed implementation manners

[0041] To make the above objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0042] Task scheduling is the core mechanism for coordinating the execution order of multiple tasks and resource allocation in a computer system. Especially in complex scenarios such as distributed systems and cloud computing platforms, its role is crucial. The core goal of task scheduling is to optimize the overall system performance by reasonably allocating computing resources and dynamically adjusting the execution order of task scheduling. In large-scale and high-concurrency business scenarios such as China Mobile's "Panji Project", the system needs to process a large number of heterogeneous tasks (such as data processing, real-time communication, security monitoring, etc.) simultaneously, and different tasks have significant differences in resource occupancy, execution timeliness, and priority requirements. Therefore, an efficient task scheduling algorithm needs to take into account the differences in task characteristics, resource utilization rate, and system stability, which has become a key technical challenge for improving node performance and service response capabilities.

[0043] Traditional task scheduling methods, such as priority-based scheduling methods, although they can ensure that critical tasks are processed in a timely manner, may lead to uneven resource allocation, long waiting times for low-priority tasks, and even the phenomenon of "starvation". While round-robin scheduling achieves fair execution among tasks, in the case of diverse task types and different execution times, frequent context switches will reduce system efficiency. These technical defects may all affect task scheduling efficiency and system performance. When dealing with tasks that require fine management and efficient scheduling like the Panji Project, traditional task scheduling methods may seem inadequate and unable to meet the high requirements of the project for task execution efficiency and overall node performance.

[0044] Based on this, the main solution of this application is: obtaining the queue priorities of multiple scheduling queues corresponding to the set of tasks to be scheduled, where the set of tasks to be scheduled is a set of tasks to be scheduled, and all the tasks to be scheduled are classified and stored in each of the scheduling queues; performing task scheduling on the set of tasks to be scheduled according to the queue priorities of each of the scheduling queues and the response ratios of each of the tasks to be scheduled, where the response ratio is positively correlated with the task waiting time.

[0045] This application classifies and stores the to-be-scheduled tasks into corresponding scheduling queues according to the task types of the to-be-scheduled tasks, that is, classifies and stores the to-be-scheduled tasks according to the task types, and combines the queue priorities of each scheduling queue and the response ratio of the scheduling tasks to perform task scheduling, so that tasks with a high response ratio in the high-priority scheduling queue can be preferentially scheduled. It can be understood that the response ratio is positively correlated with the task waiting time, so that the to-be-scheduled tasks with a long waiting time can be preferentially scheduled and executed, reducing the waiting time of the to-be-scheduled tasks, thereby reducing the phenomenon of task "starvation"; and each scheduling queue stores the to-be-scheduled tasks classified, and the queue priority of the scheduling queue can reflect the priorities of different types of tasks. Combining the queue priority and the response ratio for task scheduling can be understood as combining the task type and the task response ratio for task scheduling, rather than simply scheduling based on a single fixed priority, thereby improving the flexibility of task scheduling.

[0046] It should be noted that the execution subject of each embodiment of the task scheduling method of this application can be a computing service device with data processing, network communication, and program running functions, such as a server, a tablet computer, a personal computer, a mobile phone, etc., or a task scheduling device capable of implementing the above functions. Each embodiment of the task scheduling method of this application does not make specific restrictions on this.

[0047] Based on this, this application proposes a task scheduling method for the first embodiment. Please refer to Figure 1 as shown, the task scheduling method includes the following steps S10 to S20:

[0048] Step S10, obtain the queue priorities of multiple scheduling queues corresponding to the to-be-scheduled task set, where the to-be-scheduled task set is a set of to-be-scheduled tasks, and all the to-be-scheduled tasks are classified and stored in each of the scheduling queues;

[0049] The to-be-scheduled task set is a set of to-be-scheduled tasks. The to-be-scheduled task refers to a task that has not been scheduled yet. For example, in a computer system (such as a distributed system, a cloud computing platform), a task that has been submitted to the scheduler but has not been allocated execution resources or had its execution order determined.

[0050] When a to-be-scheduled task is received, the received to-be-scheduled task can be analyzed and classified. According to factors such as the nature of the task, the possible subsequent invocation method, the priority, and the execution time, the to-be-scheduled task can be accurately allocated to different scheduling queues for storage. Each scheduling queue has a preset queue priority, and the queue priority of each scheduling queue can be flexibly configured according to the actual application scenario.

[0051] Each scheduling queue is used to store different types of tasks, that is, the tasks to be scheduled can be classified according to their types. For example, in a specific embodiment, the tasks to be scheduled can be divided into core function guarantee tasks (also called basic tasks), pre - dependency preparation tasks (also called pre - order tasks), and regular business execution tasks (also called ordinary services). The corresponding scheduling queues can be divided into a basic task queue for storing core function guarantee tasks of the system, a pre - order task queue for storing pre - dependency preparation tasks, and an ordinary task queue for storing regular business execution tasks. Among them, the core function guarantee tasks refer to the tasks that affect the stability, security, or core functions of the system. These tasks usually need to be executed preferentially when the system starts or under specific conditions to ensure the normal operation of the basic functions of the system; the pre - dependency preparation tasks refer to the pre - preparation or dependent tasks, which may include data pre - processing, environment configuration, or the start of dependent services, etc. The completion of these tasks is a prerequisite for the smooth execution of ordinary tasks; the regular business execution tasks refer to the regular ordinary tasks, which are executed according to the regular priority and scheduling strategy to meet the daily business needs and system operation and maintenance work. Correspondingly, the queue priority of the basic task queue is greater than the queue priority of the pre - order task queue, and the queue priority of the pre - order task queue is greater than the queue priority of the ordinary task queue, so as to ensure that the core function guarantee tasks are executed with the highest priority, thus ensuring the normal operation of the basic functions of the system, and the pre - dependency preparation tasks are executed with the second - highest priority, thus preparing for the execution of ordinary tasks.

[0052] After the task classification is completed, the queue priority corresponding to each scheduling queue can be obtained by querying the database or configuration file that stores the queue priorities. The queue priority information can be in numerical form, such as integers from 1 to 10. The larger the value, the higher the priority; it can also be in other forms, such as letter grades (A, B, C, etc.), where A represents the highest priority. This embodiment does not make specific restrictions on this.

[0053] Step S20: Perform task scheduling on the set of tasks to be scheduled according to the queue priorities of the respective scheduling queues and the response ratios of the respective tasks to be scheduled, where the response ratio is positively correlated with the task waiting time.

[0054] After obtaining the queue priorities of each scheduling queue, task scheduling is performed on the set of tasks to be scheduled (that is, the tasks to be scheduled in the set of tasks to be scheduled are scheduled and executed) according to the queue priorities of each scheduling queue and the response ratios of the tasks to be scheduled. It should be noted that the tasks to be scheduled with high response ratios in the high queue priority can be preferentially scheduled. For example, assuming there are 3 scheduling queues A, B, and C respectively, and the queue priority order is A > B > C, then the tasks to be scheduled in the A scheduling queue can be preferentially scheduled, and specifically, the tasks to be scheduled in the A scheduling queue can be scheduled in sequence according to the response ratio order, that is, the tasks to be scheduled with high response ratios in the A scheduling queue can be preferentially scheduled. After all the tasks to be scheduled in the A scheduling queue are scheduled, the tasks to be scheduled in the B scheduling queue are scheduled in sequence according to the response ratio order. After all the tasks to be scheduled in the B scheduling queue are scheduled, the tasks to be scheduled in the C scheduling queue are scheduled according to the response ratio order until the set of tasks to be scheduled is empty.

[0055] The response ratio of the task to be scheduled is positively correlated with the task waiting time. It should be noted that for each task to be scheduled, the response ratio of the task to be scheduled is positively correlated with the task waiting time of the task to be scheduled. Among them, the task waiting time refers to the time that the task to be scheduled has waited since the task was successfully submitted. Further, the response ratio can also be negatively correlated with the task processing time, so that tasks with low task processing time can be preferentially scheduled, and the phenomenon that tasks with high task processing time occupy scheduling resources for a long time can be reduced. Among them, the task processing time refers to the execution time required to execute the task to be scheduled.

[0056] Further, during the task scheduling process, the tasks to be scheduled that have been scheduled and executed can be removed from the corresponding scheduling queue, and the response ratios of the tasks to be scheduled can be updated in real time or periodically or based on a preset rule (such as updating the response ratio once after each scheduled task to be scheduled is executed), and task scheduling can be re-performed based on the updated response ratios to ensure that the response ratios can more accurately reflect the actual waiting time of the tasks to be scheduled and reduce the task "starvation" phenomenon.

[0057] Further, considering that task scheduling is usually performed in the same scheduling queue during the task scheduling process, and the scheduling queue for task scheduling is switched only when the current scheduling queue for task scheduling is empty. Based on this, each time the response ratio is updated, only the response ratios of the remaining tasks to be scheduled in the scheduling queue where the most recently scheduled task to be scheduled is located can be updated. For example, if the scheduling queue where the most recently scheduled task to be scheduled is located is scheduling queue A, then only the response ratios of each task to be scheduled in scheduling queue A can be updated, and the response ratios of each task to be scheduled in other scheduling queues do not need to be updated this time to reduce the calculation amount. And each time the scheduling queue for task scheduling is switched, the response ratios of each task to be scheduled in the newly scheduled scheduling queue can be calculated or updated. It should be noted that task scheduling for a scheduling queue means taking out the tasks to be scheduled from the scheduling queue for scheduling.

[0058] In this embodiment, the tasks to be scheduled are classified and stored in the corresponding scheduling queues according to the task types of the tasks to be scheduled, that is, the tasks to be scheduled are classified and stored according to the task types, and task scheduling is performed in combination with the queue priorities of each scheduling queue and the response ratios of the scheduling tasks, so that tasks with high response ratios in high-priority scheduling queues can be scheduled preferentially. It can be understood that the response ratio is positively correlated with the task waiting time, so that tasks to be scheduled with long waiting times can be preferentially scheduled and executed, reducing the waiting time of the tasks to be scheduled, and thus reducing the phenomenon of task "starvation"; and each scheduling queue stores the tasks to be scheduled in a classified manner, and the queue priority of the scheduling queue can reflect the priorities of different types of tasks. Performing task scheduling in combination with the queue priority and the response ratio can be understood as performing task scheduling in combination with the task type and the task response ratio, rather than simply scheduling based on a single fixed priority, thereby improving the flexibility of task scheduling.

[0059] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar content as the above-mentioned embodiment 1 can be referred to the above introduction and will not be repeated hereinafter. On this basis, the step of performing task scheduling on the set of tasks to be scheduled according to the queue priorities of each scheduling queue and the response ratios of each task includes:

[0060] Step A10, select a target queue according to the queue priorities of each scheduling queue, and obtain or determine the response ratios of each target task to be scheduled in the target queue, where the target queue is the scheduling queue with the highest queue priority and non-empty queue among each scheduling queue, and the target task to be scheduled is part or all of the tasks to be scheduled stored in the target queue;

[0061] It should be noted that the target task to be scheduled refers to part or all of the tasks to be scheduled stored in the target queue. For each target task to be scheduled, its corresponding response ratio can be obtained or determined.

[0062] Step A20. Schedule each of the target tasks to be scheduled in the task set to be scheduled according to the response ratio of each of the target tasks to be scheduled in the target queue.

[0063] It should be noted that after all the target tasks to be scheduled in the target queue are scheduled, if the target queue is still not empty, the response ratio of the remaining tasks to be scheduled in the target queue can be obtained or determined, and the tasks to be scheduled in the task set to be scheduled are scheduled according to the response ratio of each task to be scheduled in the target queue until the target queue is empty, and then return to execute step A10 until the task set to be scheduled is empty; if the target queue is empty, return to execute step A10 until the task set to be scheduled is empty.

[0064] In a possible implementation, referring to Figure 2 As shown, the step of scheduling each of the target tasks to be scheduled in the task set to be scheduled according to the response ratio of each of the target tasks to be scheduled in the target queue includes:

[0065] Step A201. Schedule the target task to be scheduled with the highest response ratio to execute according to the response ratio of each of the target tasks to be scheduled in the target queue;

[0066] Step A202. After detecting that the scheduled target task to be scheduled has ended, remove the ended target task to be scheduled from the target queue;

[0067] Step A203. Update the response ratio of each target task to be scheduled in the target queue, and based on the updated response ratio, return to execute the step of scheduling the target task to be scheduled with the highest response ratio to execute according to the response ratio of each of the target tasks to be scheduled in the target queue until all the target tasks to be scheduled in the target queue are scheduled.

[0068] After the scheduled target task to be scheduled ends, remove the target task to be scheduled from the target queue to release the storage resources of the queue in a timely manner, and it can be understood that the waiting time accumulates during the waiting process of the task. Therefore, after each scheduled task to be scheduled is completed, the task waiting time of the remaining unscheduled tasks to be scheduled can be updated, and then the response ratio of the remaining target tasks to be scheduled in the target queue can be updated accordingly, so as to facilitate the next round of scheduling and ensure that the task response ratio can reflect its current execution status and requirements in real time.

[0069] In a possible implementation, the step of obtaining or determining the response ratio of each target task to be scheduled in the target queue includes:

[0070] Step B10, if the selected target queue is the pre - task queue, obtain preset task dependency data, where the pre - task queue is a queue for storing pre - dependency preparation tasks;

[0071] It should be noted that the preset task dependency data can specifically be a task dependency graph or a task dependency table, which is used to record the dependency relationships between each task (for the sake of distinction, hereinafter referred to as the target task) and its pre - tasks and post - tasks. Such dependency relationships can be automatically set by the user or the system when the task is submitted to the scheduling system. When it is necessary to determine whether the result of a pre - task will be called by a specific subsequent task, the preset task dependency data can be queried to check whether there is a dependency path from the pre - task to the specific subsequent task. Among them, the pre - task of the target task refers to that the target task requires the processing result of the pre - task as input, and the post - task of the target task refers to the task that depends on the processing result of the target task.

[0072] Step B20, for any task to be scheduled stored in the target queue, if the preset task dependency data finds that there is a post - task that depends on the task to be scheduled, and the post - task exists in the set of tasks to be scheduled, then mark the task to be scheduled as the target task to be scheduled;

[0073] Step B30, obtain or determine the response ratios of the tasks marked as target tasks to be scheduled in the target queue.

[0074] When it is detected that there is a post - task that depends on a certain task to be scheduled, it indicates that there is a post - task that depends on the output of the task to be scheduled, and the post - task exists in the set of tasks to be scheduled, indicating that the post - task has appeared and needs to be scheduled for execution. At this time, mark this task to be scheduled as the target task to be scheduled, so that the pre - tasks of the post - task can be preferentially scheduled for execution, thereby improving the execution efficiency of the task and the response ability of the node.

[0075] Based on the first embodiment and / or the second embodiment of the present application, in the third embodiment of the present application, the same or similar content as in the above - mentioned first and second embodiments can be referred to the above introduction and will not be repeated hereinafter. On this basis, the step of obtaining or determining the response ratios of the target tasks to be scheduled in the target queue includes:

[0076] Step C10, for each target task to be scheduled in the target queue, obtain the task waiting time and the task processing time of the target task to be scheduled;

[0077] Step C20, calculate the sum value between the task waiting time and the task processing time, and divide the sum value by the task processing time to obtain the time ratio;

[0078] Step C30, determine the response ratio of the target task to be scheduled based on the time ratio, where the response ratio is positively correlated with the time ratio.

[0079] For each target task to be scheduled, the response ratio of the target task to be scheduled is positively correlated with the time ratio, that is, positively correlated with the task waiting time, and negatively correlated with the task processing time. This enables the tasks to be scheduled for execution in priority order according to their waiting time, thus ensuring fairness among tasks, giving each task an equal chance to be processed, reducing the "starvation" phenomenon of tasks. At the same time, tasks with shorter processing times can be scheduled for execution in priority, enabling more efficient use of resources, avoiding long-term occupation and idleness of resources, so that when task scheduling is based on the response ratio subsequently, it is ensured that tasks can be scheduled in an orderly manner according to the ratio of their waiting time and processing time, effectively reducing the waiting time of tasks, improving the execution efficiency of tasks, enabling faster response and processing of tasks, and thus enhancing the overall performance.

[0080] In a possible implementation manner, the step of determining the response ratio of the target task to be scheduled based on the time ratio includes:

[0081] Step D10, determine that the time ratio is the response ratio of the target task to be scheduled; or,

[0082] Step D20, obtain the urgency factor corresponding to the target task to be scheduled, and perform a weighted sum calculation on the time ratio and the urgency factor to obtain the response ratio of the target task to be scheduled.

[0083] Determine that the time ratio is the response ratio of the target task to be scheduled, that is, the response ratio can be expressed as: response ratio = (task waiting time + task processing time) / task processing time = 1 + (task waiting time / task processing time).

[0084] Furthermore, an urgency factor can be introduced. The urgency factor is used to represent the urgency of a task. For example, the larger the urgency factor, the more urgent the task. The urgency factor can be specifically set to any value according to actual needs, and this embodiment does not make specific limitations on this. For example, it can be a value between 0 and a positive number (not necessarily 1). Another example is that for the sake of simplifying calculations and maintaining consistency, the urgency factor can be normalized to a value between 0 and 1.

[0085] After obtaining the urgency factor corresponding to the target task to be scheduled, a weighted sum calculation is performed on the time ratio and the urgency factor to obtain the response ratio of the target task to be scheduled. That is, the response ratio can be expressed as: Response Ratio = α × (Task Waiting Time + Task Processing Time) / Task Processing Time + (1 - α) × Urgency Factor = α × (1 + Task Waiting Time / Task Processing Time) + (1 - α) × Urgency Factor, where α is a weight factor, and α is greater than or equal to zero and less than or equal to 1.

[0086] The response ratio is calculated based on the urgency factor, task waiting time, and task processing time. It can be understood that the task waiting time and task processing time are inherent attribute value data. Therefore, by setting the variable attribute value of the urgency factor, the task processing time and task waiting time can be balanced by adjusting the urgency factor, so that urgent tasks can be scheduled and executed first, thereby further improving the flexibility of task scheduling.

[0087] Based on the first embodiment, the second embodiment, and / or the third embodiment of the present application, in the fourth embodiment of the present application, the same or similar content as in the above-mentioned first embodiment, second embodiment, and third embodiment can be referred to the above introduction and will not be repeated hereinafter. On this basis, after the step of obtaining the queue priorities of multiple scheduling queues corresponding to the task set to be scheduled, the method further includes:

[0088] Step E10, for each of the scheduling queues, obtain the response ratio threshold corresponding to the scheduling queue, and obtain or determine the response ratio of each task in the scheduling queue;

[0089] It should be noted that for each scheduling queue, its corresponding response ratio threshold can be preset to reflect the priorities and importance of different scheduling queues. The response ratio thresholds corresponding to each scheduling queue can be the same or different, and this embodiment does not make specific restrictions on this.

[0090] During the task scheduling process, the response ratios of each task to be scheduled can be dynamically monitored periodically. For example, based on a preset time interval, data such as the task waiting time of each task to be scheduled can be collected regularly, and the response ratio of each task to be scheduled can be calculated accordingly.

[0091] Step E20, if there is an urgent task in the scheduling queue whose response ratio is greater than or equal to the response ratio threshold, then schedule the urgent task in the task set to be scheduled for execution, or wait for a preset duration and then schedule the urgent task in the task set to be scheduled for execution.

[0092] After obtaining the response ratios of the tasks to be scheduled in the scheduling queue, compare the obtained response ratios with the corresponding response ratio thresholds. If the response ratio of a task is greater than or equal to the corresponding response ratio threshold, it indicates that the task is relatively urgent. At this time, schedule this urgent task for execution or schedule the urgent task for execution after waiting for a preset duration. Such a dynamic adjustment scheduling strategy can ensure that tasks with high response ratios are preferentially executed, thereby improving the execution efficiency of tasks and the response ability of nodes, and further improving the overall efficiency and response speed of the system.

[0093] It should be noted that the response ratio thresholds corresponding to each scheduling queue can also be dynamically adjusted during the task scheduling process to intelligently optimize each response ratio threshold. For example, if problems such as too long waiting time for a certain type of task or a decrease in the response ability of the node are detected, the response ratio threshold can be dynamically adjusted to make the task scheduling more flexible and adaptable, and can effectively meet the task scheduling requirements in different scenarios, further improving the execution efficiency of tasks and the stability of the system.

[0094] Furthermore, if problems such as too long waiting time for a certain type of task or a decrease in the response ability of the node are found, the urgency factor of the task can also be dynamically adjusted, the response ratio of the task can be recalculated, the scheduling strategy of the queue can be adjusted, etc. Through these dynamic adjustments and optimizations, problems or abnormal situations that occur during the task execution process can be solved in real time, and the overall efficiency and performance of the node can be improved.

[0095] In addition, further, the task scheduling and execution situation of the node can also be evaluated and analyzed regularly. Through regular evaluation and analysis operations, in-depth understanding of the execution situation and effect of the task scheduling and execution strategy of the node can be obtained, and further adjustments and optimizations can be made according to the analysis results. Such a continuous improvement process can ensure that the task scheduling and execution strategy of the node always remains in the best state, thereby improving the overall performance and stability of the node. At the same time, it can also provide useful reference and reference for future task scheduling and execution strategies.

[0096] Exemplarily, to help understand the task scheduling process in this embodiment, a specific embodiment is now listed. In this specific embodiment, refer to Figure 3 As shown, the task scheduling process is as follows:

[0097] Step 1) Queue setting and task classification

[0098] Step 1.1: First, set three independent scheduling queues: the basic task queue, the pre-task queue, and the general task queue. These three queues will be used to manage and schedule different types of tasks in an orderly manner to ensure that they can be executed in a predetermined order and priority.

[0099] Step 1.2: Classify the tasks to be scheduled submitted to the node in detail. According to factors such as the nature of the tasks, the possible subsequent invocation methods, priorities, and execution times, accurately classify the tasks into basic tasks, pre - order tasks, or ordinary tasks. Such classification helps with subsequent scheduling and execution, ensuring that tasks can be reasonably processed according to their characteristics and requirements.

[0100] Step 1.3: Put the already classified tasks into the corresponding queues, and initialize the task waiting time for each task to 0. The task waiting time gradually accumulates as the task waits, and the task processing time is the specified execution time of the task. Such initialization operations are to facilitate the subsequent calculation of the response ratio and task scheduling, ensuring that tasks can be orderly scheduled and executed according to the ratio of their waiting time and processing time.

[0101] Step 2) Response ratio calculation

[0102] Step 2.1: For the tasks in each queue, calculate their response ratios regularly. The formula for the response ratio is: Response ratio = 1+(Task waiting time / Task processing time), or: Response ratio = α×(1 + Task waiting time / Task processing time)+(1 - α)×Urgency factor, where α is a weight factor between 0 and 1, used to balance the influence of task waiting time, task processing time, and urgency factor on the response ratio.

[0103] Step 2.2: Inside each queue, the tasks to be scheduled can be sorted according to the size of the response ratio. The purpose of sorting is to ensure that tasks with a higher response ratio can be scheduled first, which can improve the execution efficiency of tasks and the overall performance of the node. Through the sorting operation, it can be ensured that tasks can be processed orderly according to the level of their response ratios, avoiding chaos or delay in the execution order of tasks.

[0104] Step 3) Task scheduling and execution

[0105] Step 3.1: First, take out the task with the highest response ratio from the basic task queue for execution.

[0106] Step 3.2: When the basic task queue is empty, check the pre - order task queue. If there are pre - order tasks (i.e., the tasks to be scheduled in the pre - order queue) whose results will be called by specific subsequent tasks, take out the task with the highest response ratio from these tasks to be scheduled with subsequent tasks that have already appeared for execution. Such operations can ensure that pre - order tasks with subsequent tasks can be processed first, thereby improving the execution efficiency of tasks and the response ability of the node.

[0107] Step 3.3: After the preceding tasks for which subsequent tasks have already appeared are completed, select the task with the highest response ratio from the tasks to be scheduled for which subsequent tasks have not yet appeared and execute it. Such an operation can ensure that all preceding tasks can be processed in an orderly manner according to the response ratio, avoiding chaos or delay in the execution order of tasks.

[0108] Step 3.4: When the preceding task queue is empty, select the task with the highest response ratio from the normal task queue and execute it. Normal tasks are tasks for which it is temporarily uncertain whether they will be called subsequently. By selecting the task with the highest response ratio from the normal task queue for execution, it can be ensured that normal tasks can also be reasonably scheduled and executed based on their waiting time and processing time.

[0109] Step 3.5: After the task is executed, update the waiting time and response ratio of the tasks in the relevant queues. Such an update operation is to facilitate the next round of scheduling and execution, ensuring that the waiting time and response ratio of tasks can reflect their current execution status and requirements in real time.

[0110] Step 3.6: Repeat Steps 3.1 to 3.5 until all tasks are executed. Through continuous scheduling and execution operations, it can be ensured that the tasks of the node can be processed continuously and orderly, improving the overall performance and stability of the node.

[0111] Step 4) Dynamic adjustment policy setting

[0112] Step 4.1: Set different response ratio thresholds for the preceding task queue and the normal task queue respectively. For example, set the response ratio threshold for the preceding task queue to Threshold_Pre, and set the response ratio threshold for the normal task queue to Threshold_Normal. Among them, Threshold_Pre should usually be greater than Threshold_Normal to reflect the priorities and importance of different queues. Such a setting can ensure that preceding tasks can be preferentially executed when they reach a certain response ratio, thereby improving the execution efficiency of tasks and the overall performance of the node. At the same time, the thresholds can also be dynamically adjusted and optimized according to actual situations and requirements. Specifically, the response ratio thresholds can be set according to empirical parameters, which may come from the operation data of previous similar systems, industry standards, expert suggestions, etc. By referring to these empirical parameters, reasonable initial response ratio thresholds can be set for different queues.

[0113] Step 5) Dynamic adjustment and optimization

[0114] Step 5.1: During the task execution process, dynamically monitor the load situation of the nodes and the execution situation of the tasks. Through real-time monitoring operations, possible problems or abnormal situations can be discovered and processed in a timely manner to ensure the stable operation of the nodes and the orderly execution of the tasks.

[0115] Step 5.2: If the response ratio of a task in the previous task queue exceeds Threshold_Pre, or the response ratio of a task in the normal task queue exceeds Threshold_Normal, then directly execute the task without waiting. Such a dynamic adjustment strategy can ensure that tasks with high response ratios are preferentially executed, thereby improving the task execution efficiency and the node's response ability. At the same time, the thresholds and adjustment strategies can also be dynamically optimized and improved according to the actual situation and requirements.

[0116] Step 5.3: If problems such as the waiting time of a certain type of task being too long or the node's response ability decreasing are found, the task priority can be dynamically adjusted, the response ratio of the task can be recalculated, the queue scheduling strategy can be adjusted, or the response ratio threshold can be adjusted, etc. Through these dynamic adjustment and optimization operations, problems or abnormal situations occurring during the task execution process can be solved in real time, and the overall efficiency and performance of the node can be improved.

[0117] Step 5.4: Regularly evaluate and analyze the task scheduling and execution situation of the nodes. Through regular evaluation and analysis operations, the execution situation and effects of the node's task scheduling and execution strategies can be deeply understood, and further adjustments and optimizations can be made according to the analysis results. Such a continuous improvement process can ensure that the node's task scheduling and execution strategies always remain in the best state, thereby improving the overall performance and stability of the node. At the same time, it can also provide useful references for future task scheduling and execution strategies.

[0118] It should be noted that the above examples are only used to assist in understanding this embodiment and do not constitute a limitation on the task scheduling process of this embodiment. Based on this technical concept, more forms of simple transformations are within the protection scope of this application.

[0119] In addition, the embodiment of this application also proposes a task scheduling device. Referring to Figure 4 as shown, this task scheduling device includes:

[0120] An acquisition module 10, configured to acquire the queue priorities of multiple scheduling queues corresponding to the set of tasks to be scheduled, where the set of tasks to be scheduled is a set of tasks to be scheduled, and all the tasks to be scheduled are classified and stored in each of the scheduling queues;

[0121] The scheduling module 20 is used to perform task scheduling on the set of tasks to be scheduled according to the queue priorities of the scheduling queues and the response ratios of the tasks to be scheduled, wherein the response ratio is positively correlated with the task waiting time.

[0122] In one embodiment, the scheduling module 20 is further configured to:

[0123] Select a target queue according to the queue priorities of the scheduling queues, and obtain or determine the response ratios of the target tasks to be scheduled in the target queue, wherein the target queue is the scheduling queue with the highest queue priority and a non-empty queue among the scheduling queues, and the target tasks to be scheduled are some or all of the tasks to be scheduled stored in the target queue;

[0124] Perform task scheduling on the target tasks to be scheduled in the set of tasks to be scheduled according to the response ratios of the target tasks to be scheduled in the target queue.

[0125] In one embodiment, the scheduling module 20 is further configured to:

[0126] If the selected target queue is the pre-task queue, obtain preset task dependency data, wherein the pre-task queue is a queue for storing pre-dependency preparation tasks;

[0127] For any task to be scheduled stored in the target queue, if the preset task dependency data finds that there is a post-task dependent on the task to be scheduled and the post-task exists in the set of tasks to be scheduled, mark the task to be scheduled as a target task to be scheduled;

[0128] Obtain or determine the response ratios of the tasks marked as target tasks to be scheduled in the target queue.

[0129] In one embodiment, the scheduling module 20 is further configured to:

[0130] For each target task to be scheduled in the target queue, obtain the task waiting time and the task processing time of the target task to be scheduled;

[0131] Calculate the sum value between the task waiting time and the task processing time, and divide the sum value by the task processing time to obtain a time ratio;

[0132] Determine the response ratio of the target task to be scheduled based on the time ratio, wherein the response ratio is positively correlated with the time ratio.

[0133] In one embodiment, the scheduling module 20 is further configured to:

[0134] Determine that the time ratio is the response ratio of the target task to be scheduled; or,

[0135] Obtain the urgency factor corresponding to the target task to be scheduled, and perform a weighted sum calculation on the time ratio and the urgency factor to obtain the response ratio of the target task to be scheduled.

[0136] In one embodiment, the scheduling module 20 is further configured to:

[0137] For each of the scheduling queues, obtain the response ratio threshold corresponding to the scheduling queue, and obtain or determine the response ratio of each task in the scheduling queue;

[0138] If there is an urgent task in the scheduling queue whose response ratio is greater than or equal to the response ratio threshold, schedule the urgent task in the task set to be scheduled for execution, or wait for a preset duration and then schedule the urgent task in the task set to be scheduled for execution.

[0139] In one embodiment, the scheduling queue includes a basic task queue, a pre-task queue, and a general task queue. The basic task queue is used to store system core function guarantee tasks, the pre-task queue is used to store pre-dependency preparation tasks, and the general task queue is used to store regular business execution tasks;

[0140] The queue priority of the basic task queue is greater than the queue priority of the pre-task queue, and the queue priority of the pre-task queue is greater than the queue priority of the general task queue.

[0141] In addition, an embodiment of the present application further provides a task scheduling device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor. The computer program is configured to implement the steps of the task scheduling method as described above.

[0142] Reference Figure 5 , which shows a schematic structural diagram of a task scheduling device suitable for implementing the embodiments of the present application. The task scheduling device in the embodiments of the present application may further include, but is not limited to, mobile terminals such as servers, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), etc., and fixed terminals such as digital TVs and desktop computers. Figure 5 The shown task scheduling device is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present application.

[0143] As shown Figure 5 in the figure, the task scheduling device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM: Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of the task scheduling device are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems may be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the task scheduling device to communicate with other devices wirelessly or wiredly to exchange data. Although the figure shows a task scheduling device having various systems, it should be understood that it is not required to implement or have all the shown systems. More or fewer systems may be implemented or had alternatively.

[0144] Specifically, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart may be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication device, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above functions defined in the method of the embodiments disclosed in the present application are executed.

[0145] The task scheduling device provided by the embodiments of the present application adopts the task scheduling method in the above embodiments, and can solve the technical problem of how to reduce the task "starvation" phenomenon and improve the flexibility of task scheduling. Compared with the prior art, the beneficial effects of the task scheduling device provided by the present application are the same as those of the task scheduling method provided by the above embodiments, and other technical features in the task scheduling device are the same as those disclosed in the method of the previous embodiment, and will not be elaborated here.

[0146] It should be understood that each part disclosed in this application can be implemented by hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in a suitable manner in any one or more embodiments or examples.

[0147] As described above, the above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed in this application can easily think of changes or substitutions, which should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

[0148] In addition, to achieve the above object, an embodiment of this application also provides a readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the task scheduling method in the above embodiments.

[0149] The computer-readable storage medium provided by the embodiment of this application can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this embodiment, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or combined with an instruction execution system, device, or device. The program code contained on the computer-readable storage medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0150] The above computer-readable storage medium can be included in the task scheduling device; or it can exist separately without being assembled into the task scheduling device.

[0151] The above computer-readable storage medium carries one or more programs which, when executed by a task scheduling device, cause the task scheduling device to: obtain the queue priorities of a plurality of scheduling queues corresponding to a set of tasks to be scheduled, where the set of tasks to be scheduled is a set of tasks to be scheduled, and all the tasks to be scheduled are classified and stored in the respective scheduling queues; perform task scheduling on the set of tasks to be scheduled according to the queue priorities of the respective scheduling queues and the response ratios of the respective tasks to be scheduled, where the response ratio is positively correlated with the task waiting time.

[0152] Computer program code for performing the operations of the present application may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, by connecting through an Internet service provider via the Internet).

[0153] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.

[0154] The modules described in the embodiments of the present application may be implemented in software or in hardware. In some cases, the name of the module does not constitute a limitation on the module itself.

[0155] The readable storage medium provided by this application is a computer-readable storage medium, and the computer-readable storage medium stores computer-readable program instructions (i.e., computer programs) for executing the above task scheduling method, which can solve the technical problems of how to reduce the task "starvation" phenomenon and improve the flexibility of task scheduling. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by this application are the same as those of the task scheduling method provided by the above embodiments, and will not be elaborated here.

[0156] In addition, an embodiment of this application also proposes a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the steps of the task scheduling method as described above.

[0157] The specific implementation manners of the computer program product of this application are basically the same as those of the above embodiments of the task scheduling and / or voice enhancement method, and will not be elaborated here.

[0158] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or system. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or system including that element.

[0159] The serial numbers of the above embodiments of this application are only for description and do not represent the superiority or inferiority of the embodiments.

[0160] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation manner. Based on such an understanding, the technical solution of this application, in essence, or the part that makes a contribution to the prior art can be embodied in the form of a software sensor. This computer software sensor is stored in a storage medium as described above (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions to enable a terminal device (which can be a mobile phone, computer, server or network device, etc.) to execute the methods described in various embodiments of this application.

[0161] The above are only the preferred embodiments of this application, and do not limit the patent scope of this application accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of this application, or directly or indirectly applied in other related technical fields, shall be included in the patent protection scope of this application by the same token.

Claims

1. A task scheduling method, characterized in that, The task scheduling method includes the following steps: Obtain the queue priorities of multiple scheduling queues corresponding to the set of tasks to be scheduled, where the set of tasks to be scheduled is a set of tasks to be scheduled, and all the tasks to be scheduled are classified and stored in each of the scheduling queues; Perform task scheduling on the set of tasks to be scheduled according to the queue priorities of each of the scheduling queues and the response ratios of each of the tasks to be scheduled, where the response ratio is positively correlated with the task waiting time.

2. The task scheduling method according to claim 1, wherein The step of performing task scheduling on the set of tasks to be scheduled according to the queue priorities of each of the scheduling queues and the response ratios of each of the tasks includes: Select a target queue according to the queue priorities of each of the scheduling queues, and obtain or determine the response ratios of each target task to be scheduled in the target queue, where the target queue is the scheduling queue with the highest queue priority and a non-empty queue among each of the scheduling queues, and the target task to be scheduled is some or all of the tasks to be scheduled stored in the target queue; Perform task scheduling on each of the target tasks to be scheduled in the set of tasks to be scheduled according to the response ratios of each of the target tasks to be scheduled in the target queue.

3. The task scheduling method according to claim 2, wherein The step of obtaining or determining the response ratios of each target task to be scheduled in the target queue includes: If the selected target queue is a pre-task queue, obtain preset task dependency data, where the pre-task queue is a queue for storing pre-dependency preparation tasks; For any task to be scheduled stored in the target queue, if the preset task dependency data finds that there is a post-task that depends on the task to be scheduled and the post-task exists in the set of tasks to be scheduled, mark the task to be scheduled as a target task to be scheduled; Obtain or determine the response ratios of each of the tasks marked as target tasks to be scheduled in the target queue.

4. The task scheduling method according to claim 2, characterized in that The step of obtaining or determining the response ratios of each target task to be scheduled in the target queue includes: For each target task to be scheduled in the target queue, obtain the task waiting time and the task processing time of the target task to be scheduled; Calculate the sum value between the task waiting time and the task processing time, and divide the sum value by the task processing time to obtain a time ratio; Determine the response ratio of the target task to be scheduled based on the time ratio, where the response ratio is positively correlated with the time ratio.

5. The task scheduling method according to claim 4, wherein The step of determining the response ratio of the target task to be scheduled based on the time ratio includes: Determine that the time ratio is the response ratio of the target task to be scheduled; or, Obtain the urgency factor corresponding to the target task to be scheduled, and perform a weighted sum calculation on the time ratio and the urgency factor to obtain the response ratio of the target task to be scheduled.

6. The task scheduling method according to any one of claims 1 to 5, characterized in that After the step of obtaining the queue priorities of multiple scheduling queues corresponding to the set of tasks to be scheduled, the method further includes: For each of the scheduling queues, obtain the response ratio threshold corresponding to the scheduling queue, and obtain or determine the response ratios of each task in the scheduling queue; If there is an emergency task in the scheduling queue whose response ratio is greater than or equal to the response ratio threshold, then schedule the emergency task in the to-be-scheduled task set for execution, or, after waiting for a preset duration, schedule the emergency task in the to-be-scheduled task set for execution.

7. The task scheduling method according to any one of claims 1 to 5, characterized in that, The scheduling queue includes a basic task queue, a pre-task queue, and a general task queue. The basic task queue is used to store tasks for ensuring the core functions of the system. The pre-task queue is used to store pre-dependency preparation tasks. The general task queue is used to store regular business execution tasks. The queue priority of the basic task queue is higher than that of the pre-task queue, and the queue priority of the pre-task queue is higher than that of the general task queue.

8. A task scheduling device, characterized in that, The device includes: a memory, a processor, and a task scheduling program stored on the memory and executable on the processor. The task scheduling program is configured to implement the steps of the task scheduling method according to any one of claims 1 to 7.

9. A readable storage medium, characterized in that, The readable storage medium includes a computer-readable storage medium. A task scheduling program is stored on the computer-readable storage medium. When the task scheduling program is executed by a processor, it implements the steps of the task scheduling method according to any one of claims 1 to 7.

10. A computer program product, characterized in that, The computer program product includes a task scheduling program. When the task scheduling program is executed by a processor, it implements the steps of the task scheduling method according to any one of claims 1 to 7.