Task scheduling method and device, program product and electronic equipment

By detecting and reselecting ready subtasks in the task queue through the main task, the waiting problem of system tasks in blocked situations is solved and the execution efficiency is improved.

CN118550666APending Publication Date: 2024-08-27INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410682729.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

In the existing technology, system tasks need to wait for recovery when blocked, resulting in low execution efficiency. In particular, long time-consuming tasks will cause a waste of time and resources.

Method used

Obtain the target subtask from the task queue through the main task and detect its status. If it is blocked, reselect a subtask until it is ready, thereby avoiding long waiting.

Benefits of technology

It shortens the waiting time of system tasks, improves the overall execution efficiency, and solves the problem of low execution efficiency caused by waiting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550666A
    Figure CN118550666A
Patent Text Reader

Abstract

The invention discloses a task scheduling method and device, a program product and electronic equipment, and relates to the field of operation and maintenance science and technology, the field of financial science and technology and other related technical fields, and the method comprises the steps: obtaining a target sub-task from a task queue through a main task under the condition that at least one sub-task exists in the task queue of a system, the task state of a target sub-task is detected through the main task, the task state at least comprises a ready state and a blocking state, under the condition that the task state is the blocking state, one sub-task is selected again from the task queue to serve as the target sub-task, and the task state of the reselected target sub-task is detected. And executing the target sub-task of which the task state is the ready state through the main task. According to the method and the device, the technical problem of low system task execution efficiency caused by waiting for system task recovery in the prior art under the condition of system task blockage is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of operation and maintenance technology, financial technology and other related technical fields, and specifically, to a task scheduling method, device, program product and electronic device. Background Art

[0002] In the operation and maintenance system, the calling and execution of system tasks in the prior art are synchronously blocked. When the execution of the current system task is blocked, the current system task needs to stop running, switch to a paused state, wait until the system task is resumed, and then continue to execute the system task to obtain the execution result. For system tasks that take a short time, blocking and waiting will not significantly reduce the execution efficiency of the system task. However, for long-time tasks that take several hours or even several days to wait, blocking and waiting will cause a waste of time resources, thereby causing the technical problem of low execution efficiency of system tasks in the prior art.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The present application provides a task scheduling method, device, program product and electronic device to at least solve the technical problem of low system task execution efficiency caused by the need to wait for system task recovery in the prior art when the system task is blocked.

[0005] According to one aspect of the present application, a task scheduling method is provided, comprising: when there is at least one subtask in a task queue of a system, obtaining a target subtask from the task queue through a main task, wherein the target subtask is the first subtask in the task queue, and the main task is used to manage the execution process of the subtask; detecting the task state of the target subtask through the main task, wherein the task state includes at least a ready state and a blocked state, the ready state is used to indicate that the system resources required for the target subtask to run are ready, and the blocked state is used to indicate that the system resources required for the target subtask to run are not ready; when the task state is a blocked state, reselecting a subtask from the task queue as the target subtask, and detecting the task state of the reselected target subtask; and executing the target subtask with a ready state through the main task.

[0006] Optionally, the task scheduling method also includes: determining whether the task queue is an empty queue through the main task; if the task queue is an empty queue, generating first information, wherein the first information is used to prompt the user that all subtasks that need to be executed in the system have been scheduled; if the task queue is not an empty queue, obtaining the target subtask from the task queue through the main task.

[0007] Optionally, the task scheduling method also includes: real-time monitoring of the system resources required to execute the target subtask in the blocked state through the main task; updating the task state of the target subtask in the blocked state to the ready state when all the system resources required to execute the target subtask in the blocked state are ready; and adding the target subtask with the task state updated to the ready state back to the task queue.

[0008] Optionally, the task scheduling method also includes: determining the first priority of each subtask based on the generation time of each subtask in the L subtasks in the system, where L is an integer; determining the second priority of each subtask based on the task type of each subtask, where different task types correspond to different second priorities; taking a weighted sum of the first priority and the second priority of each subtask to obtain a target priority of the subtask; and sorting the L subtasks according to the target priority of each subtask to obtain a task queue.

[0009] Optionally, the task scheduling method further includes: when the task status is a completed status, obtaining the execution result of the target subtask through the main task, and updating the task queue according to the execution result.

[0010] Optionally, the task scheduling method also includes: detecting the execution time of the target subtask through the main task, wherein the execution time is the interval between the current moment and the moment when the target subtask starts to execute; judging whether the execution time is greater than a preset time; if the execution time is less than or equal to the preset time, after the target subtask is executed, determining the execution result of the target subtask based on the execution log of the target subtask; if the execution time is greater than the preset time, determining that the execution time of the target subtask has timed out.

[0011] Optionally, the task scheduling method also includes: determining whether the execution log includes second information, wherein the second information is used to characterize that parameters that do not meet expected results are generated during the execution of the target subtask; if the execution log does not include the second information, determining that the target subtask is executed successfully; if the execution log includes the second information, determining that the target subtask has failed to execute this time, and obtaining the total number of execution failures of the target subtask within a preset time period after the current execution failure; determining whether the total number is greater than the preset number; if the total number is greater than or equal to the preset number, determining that the target subtask has failed to execute.

[0012] Optionally, the task scheduling method further includes: when the total number of times is less than a preset number of times, updating the task status of the target subtask to a ready state; and adding the target subtask whose task status is updated to a ready state back to the task queue.

[0013] Optionally, the task scheduling method also includes: updating the target priority of the target subtask to obtain an updated priority of the target subtask, wherein the updated priority is lower than the target priority; updating the task status of the target subtask to a ready state; and adding the target subtask whose task status is updated to a ready state back to the task queue based on the updated priority.

[0014] According to another aspect of the present application, a task scheduling device is also provided, including: a first acquisition unit, used to acquire a target subtask from a task queue through a main task when there is at least one subtask in a task queue of a system, wherein the target subtask is the first subtask in the task queue, and the main task is used to manage the execution process of the subtask; a first detection unit, used to detect the task state of the target subtask through the main task, wherein the task state includes at least a ready state and a blocked state, the ready state is used to indicate that the system resources required for the target subtask to run are ready, and the blocked state is used to indicate that the system resources required for the target subtask to run are not ready; a second detection unit, used to reselect a subtask from the task queue as the target subtask when the task state is a blocked state, and detect the task state of the reselected target subtask; a first execution unit, used to execute the target subtask with a ready state through the main task.

[0015] According to another aspect of the present application, a computer program product is provided, in which a computer program is stored, wherein when the computer program is running, the computer program product is controlled to execute any one of the above-mentioned task scheduling methods.

[0016] According to another aspect of the present application, an electronic device is also provided, wherein the electronic device includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement any one of the above-mentioned task scheduling methods.

[0017] In the present application, when there is at least one subtask in the task queue of the system, the target subtask is first obtained from the task queue through the main task, wherein the target subtask is the first subtask in the task queue, and the main task is used to manage the execution process of the subtask. Afterwards, the task status of the target subtask is detected by the main task, wherein the task status includes at least a ready state and a blocked state, the ready state is used to indicate that the system resources required for the target subtask to run are ready, and the blocked state is used to indicate that the system resources required for the target subtask to run are not ready. Then, when the task status is a blocked state, a subtask is reselected from the task queue as the target subtask, and the task status of the reselected target subtask is detected. Finally, the target subtask with a ready state is executed by the main task.

[0018] From the above content, it can be seen that the present application decouples the execution process and management process of the system task to obtain multiple subtasks and a main task. Afterwards, the present application obtains a subtask as the target subtask from the task queue through the main task, and detects the task status of the target subtask. When the target subtask is in a blocked state, since the target subtask in the blocked state cannot be executed at the current moment, the present application re-obtains a new target subtask from the task queue through the main task, and detects the task status of the re-selected target subtask. Finally, the target subtask in the ready state is executed through the main task, thereby achieving the purpose of enabling the system to process other subtasks in the ready state when some subtasks in the system are in a blocked state, thereby avoiding the system from falling into a long waiting state.

[0019] It can be seen that the technical solution of the present application achieves the purpose of shortening the waiting time for the execution of system tasks by detecting the task status of the target subtask through the main task, and controlling the execution process of the target subtask in the ready state through the main task, thereby achieving the technical effect of improving the overall execution efficiency of the system tasks, and further solving the technical problem of low system task execution efficiency caused by the need to wait for the system task to resume when the system task is blocked in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0021] Figure 1 is a flowchart of an optional task scheduling method according to an embodiment of the present application;

[0022] Figure 2 is a flowchart of another optional task scheduling method according to an embodiment of the present application;

[0023] Figure 3 is a schematic diagram of an optional task scheduling device according to an embodiment of the present application;

[0024] Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] It should also be noted that the relevant information (including information on system tasks) and data (including but not limited to data for display and analysis) involved in this application are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set up between this system and the relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.

[0028] In addition, the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant information and data involved in this application comply with the relevant laws, regulations and standards of the relevant regions, and necessary confidentiality measures have been taken and do not violate public order and good morals. In addition, this application provides corresponding operation entrances for users to choose to agree to authorization or refuse authorization. If the user chooses to refuse authorization, he / she will enter the corresponding expert decision-making process.

[0029] According to an embodiment of the present application, an embodiment of a task scheduling method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0030] The present application provides a task scheduling system for executing the task scheduling method in the present application. Figure 1 is a flowchart of an optional task scheduling method according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:

[0031] Step S101, when there is at least one subtask in the task queue of the system, the target subtask is obtained from the task queue by the main task.

[0032] In step S101 , the target subtask is the first subtask in the task queue, and the main task is used to manage the execution process of the subtask.

[0033] Optionally, the task queue includes L subtasks, where L is a positive integer, and each subtask in the task queue has a corresponding target priority, which is used to determine the storage position of the subtask in the task queue and to determine the order in which each subtask is dequeued.

[0034] Optionally, the subtask is used to complete at least one of the following operations: data calculation operations, data reading and writing operations in the software system, and interactive operations between the software system and other systems.

[0035] From the above content, it can be seen that the task scheduling system completes the specific execution process of the system tasks of the software system through sub-tasks, and manages the execution process of the sub-tasks through the main task, that is, the execution process of the system tasks is scheduled through the main task, thereby achieving the purpose of decoupling the execution process and management process of the system tasks that need to be executed in the software system, thereby improving the flexibility of the system task execution process, and achieving the technical effect of reducing the complexity of executing system tasks through the execution of a single sub-task.

[0036] Step S102: Detect the task status of the target subtask through the main task.

[0037] In step S102, the task status includes at least a ready status and a blocked status. The ready status is used to indicate that the system resources required for the target subtask to run are ready, and the blocked status is used to indicate that the system resources required for the target subtask to run are not ready.

[0038] Optionally, the task scheduling system first obtains the identification of the target subtask, and then determines the type of system resources required for the target subtask to run according to the identification of the target subtask. Then, the task scheduling system obtains the data volume of the system resources required for the target subtask to run and the remaining amount of system resources of this type in the current software system, and then determines whether the remaining amount of system resources of this type in the current software system can meet the running requirements of the target subtask. When the remaining amount of system resources of the corresponding type can meet the running requirements of the target subtask, the task state of the target subtask is determined to be ready.

[0039] Optionally, the task scheduling system can avoid errors or abnormal situations caused by executing the target subtask in a non-ready state by pre-determining whether the target subtask is in a ready state, thereby ensuring that the target subtask to be executed can achieve the expected results, thereby achieving the technical effect of improving the reliability of the software system.

[0040] Step S103 , when the task state is in a blocked state, reselect a subtask from the task queue as a target subtask, and detect the task state of the reselected target subtask.

[0041] Step S104: executing the target subtask whose task status is ready through the main task.

[0042] Optionally, when the target subtask selected by the main task at the current moment is in a non-ready state (i.e., a blocked state), the task scheduling system will not execute the target subtask in a non-ready state, but will reselect a subtask as the target subtask and detect the task state of the reselected target subtask. Finally, the main task will execute the target subtask with a ready state. Therefore, the task scheduling system will not suspend the overall operation of the system tasks of the software system, thereby causing the software system to fall into an empty wait.

[0043] From the above content, it can be seen that the present application decouples the execution process and management process of the system task to obtain multiple subtasks and a main task. Afterwards, the present application obtains a subtask as the target subtask from the task queue through the main task, and detects the task status of the target subtask. When the target subtask is in a blocked state, since the target subtask in the blocked state cannot be executed at the current moment, the present application re-obtains a new target subtask from the task queue through the main task, and detects the task status of the re-selected target subtask. Finally, the target subtask in the ready state is executed through the main task, thereby achieving the purpose of enabling the system to process other subtasks in the ready state when some subtasks in the system are in a blocked state, thereby avoiding the system from falling into a long waiting state.

[0044] It can be seen that the technical solution of the present application achieves the purpose of shortening the waiting time for the execution of system tasks by detecting the task status of the target subtask through the main task, and controlling the execution process of the target subtask in the ready state through the main task, thereby achieving the technical effect of improving the overall execution efficiency of the system tasks, and further solving the technical problem of low system task execution efficiency caused by the need to wait for the system task to resume when the system task is blocked in the prior art.

[0045] In an optional embodiment, before the task scheduling system detects the task status of the target subtask, first, the main task is used to determine whether the task queue is an empty queue. If the task queue is an empty queue, the task scheduling system generates a first message, wherein the first message is used to prompt the user that all subtasks that need to be executed in the system have been scheduled. In addition, if the task queue is not an empty queue, the task scheduling system obtains the target subtask from the task queue through the main task.

[0046] Optionally, if the task queue is empty, the task scheduling system still continuously attempts to obtain the target subtask, which will lead to unnecessary waste of resources, such as database connection, network bandwidth and system scheduling overhead, which will cause the system to fall into an idling state, thereby consuming a large amount of CPU resources and network bandwidth, thereby reducing the performance and efficiency of the system. In addition, if the task scheduling system attempts to obtain the target subtask without determining whether the task queue is empty, it may also cause the scheduling thread to fall into a blocked state, thereby causing the task scheduling system to be unable to respond to other events or tasks. Therefore, the task scheduling system in the present application can avoid the scheduling thread from waiting unnecessarily because there is no task to execute by determining whether the task queue is empty, and can ensure the normal operation of the system and avoid unnecessary waste of resources.

[0047] In an optional embodiment, before reselecting a subtask as the target subtask from the task queue, the task scheduling system first monitors the system resources required to execute the target subtask in the blocked state in real time through the main task. Thereafter, when all the system resources required to execute the target subtask in the blocked state are ready, the task scheduling system updates the task state of the target subtask in the blocked state to the ready state, and the task scheduling system adds the target subtask with the task state updated to the ready state back to the task queue.

[0048] Optionally, the task scheduling system can promptly detect resource competition problems between subtasks in the software system by monitoring the system resources required by the target subtask, promptly detect resource competition problems and take measures to resolve them, so as to avoid problems such as system performance degradation, system crash or deadlock caused by resource competition.

[0049] Optionally, the above-mentioned measures taken to solve the problem of resource competition include: adjusting resource allocation, optimizing resource utilization, and limiting resource use strategies. The main task of the task scheduling system monitors the system resources required for the operation of the target subtask. The main task can have a more comprehensive understanding of the operation status and resource utilization of the software system, thereby providing more information and basis for performance tuning, troubleshooting and resource capacity planning of the software system.

[0050] In an optional embodiment, the task scheduling system first determines the first priority of each subtask based on the generation time of each subtask in the L subtasks in the system, where L is an integer. Then, the task scheduling system determines the second priority of each subtask based on the task type of each subtask, where different task types correspond to different second priorities. In addition, the task scheduling system performs a weighted summation of the first priority and the second priority of each subtask to obtain the target priority of the subtask. Finally, the task scheduling system sorts the L subtasks according to the target priority of each subtask to obtain a task queue.

[0051] Optionally, after determining the second priority of each subtask, the task scheduling system can also obtain the predicted execution time corresponding to each subtask, and determine the third priority of each subtask based on the predicted execution time corresponding to each subtask, wherein the longer the predicted execution time of the subtask, the lower the third priority corresponding to the subtask. Then, the task scheduling system can obtain the target priority of each subtask by taking the weighted sum of the first priority, second priority and third priority of each subtask.

[0052] Optionally, the higher the target priority of a subtask, the front position of the subtask in the task queue, so that the task scheduling system can give priority to executing the subtask with the highest target priority among L subtasks. High-priority subtasks usually represent the importance and urgency of the business. Prioritizing high-priority subtasks can ensure that key business needs are met, thereby ensuring the normal operation of the software system and the sustainable development of the system business.

[0053] In an optional embodiment, the task status also includes a completion status, wherein the completion status is used to indicate that the target subtask has been executed. When the task status is the completion status, the task scheduling system obtains the execution result of the target subtask through the main task, and updates the task queue based on the execution result.

[0054] Optionally, the execution result of the target subtask includes situations such as successful execution of the target subtask and failed execution of the target subtask.

[0055] Optionally, when the execution result of the target subtask is that the target subtask is successfully executed, the task scheduling system can delete the successfully executed target subtask from the task queue, and control the main task to reacquire a subtask as the target subtask.

[0056] Optionally, when the execution result of the target subtask is the failure of the target subtask to execute, the task scheduling system can count the total number of execution failures of the target subtask within a preset time period after this execution failure, and retry to execute the target subtask if the total number does not exceed the preset number, thereby improving the fault tolerance rate of the system's task execution and further improving the success rate of the overall execution of the system's tasks.

[0057] In an optional embodiment, the task scheduling system first detects the execution time of the target subtask through the main task, wherein the execution time is the interval between the current moment and the moment when the target subtask starts to execute. Secondly, the task scheduling system determines whether the execution time is greater than the preset time. Then, when the execution time is less than or equal to the preset time, after the target subtask is executed, the task scheduling system determines the execution result of the target subtask based on the execution log of the target subtask. In addition, when the execution time is greater than the preset time, the task scheduling system determines that the execution time of the target subtask has timed out.

[0058] Optionally, the task scheduling system determines whether the execution time of the target subtask has exceeded the time limit, which can achieve the following technical effects, including:

[0059] (1) Improving system performance and stability: By setting a timeout mechanism for execution duration, it is possible to prevent certain subtasks from occupying system resources for a long time, which would cause system performance to deteriorate, thereby ensuring the overall performance and stability of the system.

[0060] (2) Avoid resource waste: By promptly terminating the target subtask that has exceeded its execution time, it is possible to avoid the unfinished target subtask from consuming system resources, thereby improving the utilization of system resources.

[0061] (3) Protect the system from malicious attacks: Some malicious behaviors may attempt to exhaust system resources or slow down the system's response speed by performing time-consuming operations. Setting a timeout mechanism for task execution duration can effectively prevent such attacks.

[0062] (4) Improving the response speed of the system: Timely termination of the target subtask that has timed out can release system resources in a timely manner, allowing the system to respond to resource requests from other subtasks more quickly, thereby improving the overall response speed of the system.

[0063] (5) Ensure user experience: Preventing task execution timeout can avoid the user's experience being reduced due to long waiting time, thereby improving user experience and user satisfaction.

[0064] (6) Preventing deadlock and system crash: In some cases, a system task that waits for a long time can cause a deadlock or system crash. Setting a timeout mechanism for task execution can interrupt such potential risks in a timely manner.

[0065] In an optional embodiment, in the process of determining the execution result of the target subtask based on the execution log of the target subtask, the task scheduling system first determines whether the execution log includes second information, wherein the second information is used to characterize that parameters that do not meet the expected results are generated during the execution of the target subtask. Secondly, if the execution log does not include the second information, the task scheduling system determines that the target subtask is executed successfully. In addition, if the execution log includes the second information, the task scheduling system determines that the target subtask has failed to execute this time, and obtains the total number of execution failures of the target subtask within a preset time period after the current execution failure. Then, the task scheduling system determines whether the total number is greater than the preset number. If the total number is greater than or equal to the preset number, the task scheduling system determines that the target subtask has failed to execute.

[0066] In addition, when the total number of times is less than the preset number of times, the task scheduling system updates the task status of the target subtask to the ready state, and then the task scheduling system adds the target subtask whose task status is updated to the ready state back to the task queue.

[0067] It can be seen from the above content that, when the total number of failures of the target subtask within the preset time period does not exceed the preset number, the task scheduling system in the present application attempts to successfully execute the target subtask, and retrying the target subtask after failure can achieve the following technical effects, including:

[0068] (1) Improving task completion rate: By retrying the failed target subtask, the task scheduling system has a chance to successfully complete the target subtask in a later time period, thereby improving the completion rate and success rate of the target subtask.

[0069] (2) Enhance system robustness: The failure of target subtask execution may be caused by temporary network interruption, insufficient resources, or other temporary reasons. By retrying the failed target subtask, the software system can respond to temporary failures, thereby enhancing the robustness and stability of the system.

[0070] (3) Reduce the cost of manual intervention: Automatically retrying failed target subtasks can reduce the number of manual interventions required by operation and maintenance personnel, thereby improving the automation level and operation and maintenance efficiency of the software system.

[0071] (4) Ensure timely completion of tasks: Certain target subtasks may have high requirements for the continuity and real-time performance of business processes. Automatically retrying failed target subtasks can ensure the timely completion of such target subtasks, thereby ensuring the normal operation of system tasks.

[0072] In an optional embodiment, after determining that the execution time of the target subtask has timed out, the task scheduling system first updates the target priority of the target subtask to obtain an updated priority of the target subtask, wherein the updated priority is lower than the target priority. Thereafter, the task scheduling system updates the task status of the target subtask to a ready state. Then, based on the updated priority, the task scheduling system adds the target subtask whose task status is updated to a ready state back to the task queue.

[0073] Optionally, after the target subtask is timed out, the task scheduling system in the present application reduces the target priority corresponding to the timed-out target subtask and re-adds it to the task queue, so as to achieve the purpose of waiting for the subsequent main task to reschedule the target subtask and achieve the following technical effects, including:

[0074] (1) Optimizing resource utilization: By lowering the target priority of the target subtask that has timed out, the task scheduling system can give priority to other subtasks, thereby better utilizing system resources and improving the overall efficiency of the system.

[0075] (2) Preventing system overload: A target subtask that has timed out may consume a large amount of system resources and cause system overload. By lowering its target priority, the consumption of system resources by the target subtask can be slowed down, thereby preventing the system from being overloaded.

[0076] (3) Improving system robustness: Re-adding the timed-out target subtask to the task queue can provide it with an opportunity to re-execute, thereby enhancing the robustness and stability of the system and preventing the execution process of the entire system task from being affected by a single execution failure.

[0077] In an optional embodiment, Figure 2 is a flowchart of another optional task scheduling method according to an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:

[0078] Step S201, initialize the task queue:

[0079] First, create a subtask to be executed, obtain L subtasks in different task states, and fill the L subtasks into the task queue.

[0080] Step S202, polling task queue:

[0081] First, the main task determines whether the task queue is empty. If the task queue is empty, it means that all subtasks have been executed and the system operation is ended. If the task queue is not empty, the main task is controlled to select a subtask from the task queue as the target subtask.

[0082] Afterwards, the task status of the target subtask is judged by the main task. If the target subtask is in the ready state (i.e., the target subtask is ready), the execution of the target subtask is controlled by the main task. After the allocation, the main task returns immediately and proceeds to the next cycle (i.e., the main task reselects the target subtask); if the target subtask is completed, the execution result of the target subtask is obtained through the main task, and then the main task continues the next cycle (i.e., the main task reselects the target subtask); if the target subtask execution times out or fails, it is determined that the execution of the target subtask is completed.

[0083] Step S203, executing the target subtask:

[0084] The target subtask runs independently of the main task as a subprocess or thread. During the execution of the target subtask, it is first determined whether the execution time of the target subtask has timed out. If the target subtask has timed out, the result of the target subtask timeout is updated to the task queue; if the target subtask has not timed out, it is determined whether the execution of the target subtask is successful.

[0085] If the target subtask is executed successfully, it is determined that the target subtask is executed successfully and the target subtask execution is completed; if the target subtask is executed unsuccessfully, it is determined that after the target subtask fails to execute this time, the total number of target subtask execution failures is obtained, and it is determined whether the total number of failures exceeds the failure number threshold (i.e. the preset number of times).

[0086] If the total number of failures exceeds the failure threshold, it is determined that the target subtask has failed to execute; if the total number of failures does not exceed the failure threshold, the target subtask is switched to the ready state, and the target subtask switched to the ready state is added back to the task queue.

[0087] Step S204, loop execution:

[0088] Steps S202 and S203 are executed in a loop until the task queue is empty and the main task is finished.

[0089] In the present application, when there is at least one subtask in the task queue of the system, the target subtask is first obtained from the task queue through the main task, wherein the target subtask is the first subtask in the task queue, and the main task is used to manage the execution process of the subtask. Afterwards, the task status of the target subtask is detected by the main task, wherein the task status includes at least a ready state and a blocked state, the ready state is used to indicate that the system resources required for the target subtask to run are ready, and the blocked state is used to indicate that the system resources required for the target subtask to run are not ready. Then, when the task status is a blocked state, a subtask is reselected from the task queue as the target subtask, and the task status of the reselected target subtask is detected. Finally, the target subtask with a ready state is executed by the main task.

[0090] From the above content, it can be seen that the present application decouples the execution process and management process of the system task to obtain multiple subtasks and a main task. Afterwards, the present application obtains a subtask as the target subtask from the task queue through the main task, and detects the task status of the target subtask. When the target subtask is in a blocked state, since the target subtask in the blocked state cannot be executed at the current moment, the present application re-obtains a new target subtask from the task queue through the main task, and detects the task status of the re-selected target subtask. Finally, the target subtask in the ready state is executed through the main task, thereby achieving the purpose of enabling the system to process other subtasks in the ready state when some subtasks in the system are in a blocked state, thereby avoiding the system from falling into a long waiting state.

[0091] It can be seen that the technical solution of the present application achieves the purpose of shortening the waiting time for the execution of system tasks by detecting the task status of the target subtask through the main task, and controlling the execution process of the target subtask in the ready state through the main task, thereby achieving the technical effect of improving the overall execution efficiency of the system tasks, and further solving the technical problem of low system task execution efficiency caused by the need to wait for the system task to resume when the system task is blocked in the prior art.

[0092] According to another aspect of the embodiment of the present application, a task scheduling device is also provided. Figure 3 is a schematic diagram of an optional task scheduling device according to an embodiment of the present application, such as Figure 3 As shown, the task scheduling device includes: a first acquisition unit 301 , a first detection unit 302 , a second detection unit 303 and a first execution unit 304 .

[0093] Optionally, a first acquisition unit is used to acquire a target subtask from the task queue through a main task when there is at least one subtask in the task queue of the system, wherein the target subtask is the first subtask in the task queue and the main task is used to manage the execution process of the subtask; a first detection unit is used to detect the task status of the target subtask through the main task, wherein the task status includes at least a ready state and a blocked state, the ready state is used to indicate that the system resources required for the target subtask to run are ready, and the blocked state is used to indicate that the system resources required for the target subtask to run are not ready; a second detection unit is used to reselect a subtask from the task queue as the target subtask when the task status is a blocked state, and detect the task status of the reselected target subtask; a first execution unit is used to execute the target subtask with a ready state through the main task.

[0094] In an optional embodiment, the first acquisition unit includes: a first judgment subunit, a first generation subunit and a first acquisition subunit.

[0095] Optionally, the first judgment subunit is used to judge whether the task queue is an empty queue through the main task; the first generation subunit is used to generate first information when the task queue is an empty queue, wherein the first information is used to prompt the user that all subtasks that need to be executed in the system have been scheduled; the first acquisition subunit is used to acquire the target subtask from the task queue through the main task when the task queue is not an empty queue.

[0096] In an optional embodiment, the task scheduling device further includes: a monitoring unit, a first updating unit and a first adding unit.

[0097] Optionally, a monitoring unit is used to monitor the system resources required to execute the target subtask in the blocked state in real time through the main task; a first updating unit is used to update the task state of the target subtask in the blocked state to the ready state when all the system resources required to execute the target subtask in the blocked state are ready; and a first adding unit is used to add the target subtask whose task state is updated to the ready state back to the task queue.

[0098] In an optional embodiment, the task scheduling device further includes: a first determining unit, a second determining unit, a summing unit, and a sorting unit.

[0099] Optionally, a first determination unit is used to determine the first priority of each subtask based on the generation time of each subtask in the L subtasks in the system, where L is an integer; a second determination unit is used to determine the second priority of each subtask based on the task type of each subtask, where different task types correspond to different second priorities; a summation unit is used to perform weighted summation of the first priority and the second priority of each subtask to obtain a target priority of the subtask; and a sorting unit is used to sort the L subtasks according to the target priority of each subtask to obtain a task queue.

[0100] In an optional embodiment, the task status further includes a completion status, wherein the completion status is used to indicate that the target subtask has been completed, and the task scheduling device further includes: a second acquisition unit.

[0101] Optionally, the second acquisition unit is used to acquire the execution result of the target subtask through the main task when the task status is a completed status, and update the task queue according to the execution result.

[0102] In an optional embodiment, the first execution unit includes: a detection subunit, a second judgment subunit, a first determination subunit and a second determination subunit.

[0103] Optionally, a detection subunit is used to detect the execution duration of the target subtask through the main task, wherein the execution duration is the interval between the current moment and the moment when the target subtask starts to execute; a second judgment subunit is used to judge whether the execution duration is greater than a preset duration; a first determination subunit is used to determine the execution result of the target subtask based on the execution log of the target subtask after the target subtask is executed if the execution duration is less than or equal to the preset duration; and a second determination subunit is used to determine that the execution duration of the target subtask has exceeded the preset duration.

[0104] In an optional embodiment, the first determining subunit includes: a first judging module, a first determining module, a second determining module, a second judging module and a third determining module.

[0105] Optionally, a first judgment module is used to determine whether the execution log includes second information, wherein the second information is used to characterize that parameters that do not meet expected results are generated during the execution of the target subtask; a first determination module is used to determine that the target subtask is executed successfully when the execution log does not include the second information; a second determination module is used to determine that the target subtask has failed to execute this time when the execution log includes the second information, and obtain the total number of execution failures of the target subtask within a preset time period after the current execution failure; the second judgment module is used to determine whether the total number is greater than the preset number; and a third determination module is used to determine that the target subtask has failed to execute when the total number is greater than or equal to the preset number.

[0106] In an optional embodiment, the task scheduling device further includes: a second updating unit and a second adding unit.

[0107] Optionally, the second updating unit is used to update the task status of the target subtask to a ready state when the total number of times is less than a preset number; the second adding unit is used to add the target subtask whose task status is updated to a ready state back to the task queue.

[0108] In an optional embodiment, the task scheduling device further includes: a third updating unit, a fourth updating unit and a third adding unit.

[0109] Optionally, a third update unit is used to update the target priority of the target subtask to obtain an updated priority of the target subtask, wherein the updated priority is lower than the target priority; a fourth update unit is used to update the task status of the target subtask to a ready state; and a third adding unit is used to add the target subtask whose task status is updated to a ready state back to the task queue based on the updated priority.

[0110] From the above content, it can be seen that the task scheduling device decouples the execution process and management process of the system task to obtain multiple subtasks and a main task. After that, the task scheduling device obtains a subtask as the target subtask from the task queue through the main task, and detects the task status of the target subtask. When the target subtask is in a blocked state, since the target subtask in the blocked state cannot be executed at the current moment, the task scheduling device re-obtains a new target subtask from the task queue through the main task, and detects the task status of the re-selected target subtask. Finally, the target subtask in the ready state is executed through the main task, thereby achieving the purpose of processing other subtasks in the ready state when some subtasks in the system are in a blocked state, thereby avoiding the system from falling into a long waiting state.

[0111] It can be seen that the task scheduling device detects the task status of the target subtask through the main task, and controls the execution process of the target subtask in the ready state through the main task, thereby achieving the purpose of shortening the waiting time for the execution of the system task, thereby achieving the technical effect of improving the overall execution efficiency of the system task, and further solving the technical problem of low system task execution efficiency caused by the need to wait for the system task to recover in the prior art when the system task is blocked.

[0112] According to another aspect of an embodiment of the present application, a computer program product is further provided, the computer program product comprising a stored computer program, wherein when the computer program is running, the computer program product is controlled to execute any one of the above-mentioned task scheduling methods.

[0113] According to another aspect of an embodiment of the present application, an electronic device is also provided, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned task scheduling methods by executing the executable instructions.

[0114] Optionally, Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present application, such as Figure 4 As shown, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor, and implements any one of the above-mentioned task scheduling methods when the processor executes the program.

[0115] Optionally, the processor can implement the following steps when executing the program: when there is at least one subtask in the system's task queue, obtain the target subtask from the task queue through the main task, wherein the target subtask is the first subtask in the task queue, and the main task is used to manage the execution process of the subtask; detect the task status of the target subtask through the main task, wherein the task status includes at least a ready state and a blocked state, the ready state is used to indicate that the system resources required for the target subtask to run are ready, and the blocked state is used to indicate that the system resources required for the target subtask to run are not ready; when the task status is a blocked state, reselect a subtask from the task queue as the target subtask, and detect the task status of the reselected target subtask; execute the target subtask with a ready state through the main task.

[0116] Optionally, the processor can implement the following steps when executing the program: determine whether the task queue is an empty queue through the main task; if the task queue is an empty queue, generate first information, wherein the first information is used to prompt the user that all subtasks that need to be executed in the system have been scheduled; if the task queue is not an empty queue, obtain the target subtask from the task queue through the main task.

[0117] Optionally, the processor can implement the following steps when executing the program: monitor the system resources required to execute the target subtask in the blocked state in real time through the main task; when all the system resources required to execute the target subtask in the blocked state are ready, update the task state of the target subtask in the blocked state to the ready state; and add the target subtask with the task state updated to the ready state back to the task queue.

[0118] Optionally, the processor can implement the following steps when executing the program: determine the first priority of each subtask based on the generation time of each subtask in the L subtasks in the system, where L is an integer; determine the second priority of each subtask based on the task type of each subtask, where different task types correspond to different second priorities; take a weighted sum of the first priority and the second priority of each subtask to obtain the target priority of the subtask; sort the L subtasks according to the target priority of each subtask to obtain a task queue.

[0119] Optionally, the task status also includes a completion status, wherein the completion status is used to indicate that the target subtask has been executed. When the processor executes the program, the following steps can be implemented: when the task status is a completion status, the execution result of the target subtask is obtained through the main task, and the task queue is updated according to the execution result.

[0120] Optionally, the processor can implement the following steps when executing the program: detect the execution time of the target subtask through the main task, where the execution time is the interval between the current moment and the moment when the target subtask starts to execute; determine whether the execution time is greater than a preset time; if the execution time is less than or equal to the preset time, after the target subtask is executed, determine the execution result of the target subtask based on the execution log of the target subtask; if the execution time is greater than the preset time, determine that the execution time of the target subtask has timed out.

[0121] Optionally, the processor can implement the following steps when executing the program: determine whether the execution log includes second information, wherein the second information is used to characterize that parameters that do not meet expected results are generated during the execution of the target subtask; if the execution log does not include the second information, determine that the target subtask is executed successfully; if the execution log includes the second information, determine that the target subtask has failed to execute this time, and obtain the total number of execution failures of the target subtask within a preset time period after the current execution failure; determine whether the total number is greater than the preset number; if the total number is greater than or equal to the preset number, determine that the target subtask has failed to execute.

[0122] Optionally, the processor can implement the following steps when executing the program: when the total number of times is less than a preset number of times, updating the task state of the target subtask to a ready state; and adding the target subtask whose task state is updated to a ready state back to the task queue.

[0123] Optionally, the processor can implement the following steps when executing the program: update the target priority of the target subtask to obtain an updated priority of the target subtask, wherein the updated priority is lower than the target priority; update the task status of the target subtask to a ready state; and add the target subtask whose task status is updated to a ready state back to the task queue based on the updated priority.

[0124] In the present application, when there is at least one subtask in the task queue of the system, the target subtask is first obtained from the task queue through the main task, wherein the target subtask is the first subtask in the task queue, and the main task is used to manage the execution process of the subtask. Afterwards, the task status of the target subtask is detected by the main task, wherein the task status includes at least a ready state and a blocked state, the ready state is used to indicate that the system resources required for the target subtask to run are ready, and the blocked state is used to indicate that the system resources required for the target subtask to run are not ready. Then, when the task status is a blocked state, a subtask is reselected from the task queue as the target subtask, and the task status of the reselected target subtask is detected. Finally, the target subtask with a ready state is executed by the main task.

[0125] From the above content, it can be seen that the present application decouples the execution process and management process of the system task to obtain multiple subtasks and a main task. Afterwards, the present application obtains a subtask as the target subtask from the task queue through the main task, and detects the task status of the target subtask. When the target subtask is in a blocked state, since the target subtask in the blocked state cannot be executed at the current moment, the present application re-obtains a new target subtask from the task queue through the main task, and detects the task status of the re-selected target subtask. Finally, the target subtask in the ready state is executed through the main task, thereby achieving the purpose of enabling the system to process other subtasks in the ready state when some subtasks in the system are in a blocked state, thereby avoiding the system from falling into a long waiting state.

[0126] It can be seen that the technical solution of the present application achieves the purpose of shortening the waiting time for the execution of system tasks by detecting the task status of the target subtask through the main task, and controlling the execution process of the target subtask in the ready state through the main task, thereby achieving the technical effect of improving the overall execution efficiency of the system tasks, and further solving the technical problem of low system task execution efficiency caused by the need to wait for the system task to resume when the system task is blocked in the prior art.

[0127] The above-mentioned embodiments or examples disclosed in the present application are not exhaustive, but are only illustrative of some embodiments or examples, and are not intended to be specific limitations on the scope of protection disclosed in the present application. In the absence of contradiction, each step in a certain embodiment or example in the present application can be implemented as an independent example, and the steps can be combined arbitrarily. For example, the scheme after removing some steps in a certain embodiment or example can also be implemented as an independent example, and the order of the steps in a certain embodiment or example can be arbitrarily exchanged. In addition, the optional methods or optional examples in a certain embodiment or example can be combined arbitrarily; in addition, the various embodiments or examples can be combined arbitrarily, for example, some or all steps of different embodiments or examples can be combined arbitrarily, and a certain embodiment or example can be combined arbitrarily with the optional methods or optional examples of other embodiments or examples.

[0128] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0129] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0130] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0132] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0133] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0134] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0135] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0136] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A task scheduling method, characterized in that: include: In the case where there is at least one subtask in the task queue of the system, a target subtask is obtained from the task queue through a main task, wherein the target subtask is the first subtask in the task queue, and the main task is used to manage the execution process of the subtask; Detecting the task state of the target subtask by the main task, wherein the task state includes at least a ready state and a blocked state, the ready state is used to indicate that the system resources required for the target subtask to run are ready, and the blocked state is used to indicate that the system resources required for the target subtask to run are not ready; When the task state is the blocked state, reselecting a subtask from the task queue as the target subtask, and detecting the task state of the reselected target subtask; The target subtask whose task status is the ready state is executed by the main task.

2. The task scheduling method according to claim 1, characterized in that: Obtaining a target subtask from the task queue through a main task includes: Determine whether the task queue is an empty queue through the main task; In the case where the task queue is the empty queue, generating first information, wherein the first information is used to prompt the user that all subtasks to be executed in the system have been scheduled; When the task queue is not the empty queue, the target subtask is obtained from the task queue by the main task.

3. The task scheduling method according to claim 1, characterized in that: Before reselecting a subtask from the task queue as the target subtask, the task scheduling method further includes: Real-time monitoring of the system resources required to execute the target subtask in the blocked state by the main task; When all system resources required to execute the target subtask in the blocked state are ready, updating the task state of the target subtask in the blocked state to a ready state; The target subtask whose task state is updated to the ready state is added back to the task queue.

4. The task scheduling method according to claim 1, characterized in that: Before obtaining the target subtask from the task queue through the main task, the task scheduling method further includes: Determine the first priority of each subtask in the system according to the generation time of each subtask in L subtasks, where L is an integer; Determining the second priority of each subtask according to the task type of each subtask, wherein different task types correspond to different second priorities; Taking a weighted sum of the first priority and the second priority of each subtask to obtain a target priority of the subtask; The L subtasks are sorted according to the target priority of each subtask to obtain the task queue.

5. The task scheduling method according to claim 1, characterized in that: The task status also includes a completion status, wherein the completion status is used to indicate that the target subtask has been completed. After the main task detects the task status of the target subtask, the task scheduling method further includes: When the task status is the completed status, the execution result of the target subtask is obtained through the main task, and the task queue is updated according to the execution result.

6. The task scheduling method according to claim 1, characterized in that: In the process of executing the target subtask whose task status is the ready state through the main task, the task scheduling method further includes: Detecting the execution time of the target subtask through the main task, wherein the execution time is the interval between the current time and the time when the target subtask starts to execute; Determine whether the execution time is greater than a preset time; In the case that the execution duration is less than or equal to the preset duration, after the target subtask is executed, determining the execution result of the target subtask according to the execution log of the target subtask; When the execution duration is greater than the preset duration, it is determined that the execution duration of the target subtask has timed out.

7. The task scheduling method according to claim 6, characterized in that: Determining the execution result of the target subtask according to the execution log of the target subtask includes: Determining whether the execution log includes second information, wherein the second information is used to indicate that a parameter that does not meet an expected result is generated during the execution of the target subtask; In a case where the execution log does not include the second information, determining that the target subtask is executed successfully; In a case where the execution log includes the second information, determining that the target subtask has failed to execute this time, and obtaining a total number of execution failures of the target subtask within a preset time period after the current execution failure; Determine whether the total number of times is greater than a preset number of times; When the total number of times is greater than or equal to the preset number of times, it is determined that the target subtask has failed to be executed.

8. The task scheduling method according to claim 7, characterized in that: After determining whether the total number of times is greater than a preset number of times, the task scheduling method further includes: When the total number of times is less than the preset number of times, updating the task state of the target subtask to the ready state; The target subtask whose task state is updated to the ready state is added back to the task queue.

9. The task scheduling method according to claim 6, characterized in that: After determining that the execution time of the target subtask has timed out, the task scheduling method further includes: Updating the target priority of the target subtask to obtain an updated priority of the target subtask, wherein the updated priority is lower than the target priority; Updating the task state of the target subtask to the ready state; The target subtask whose task state is updated to the ready state is added back to the task queue based on the updated priority.

10. A task scheduling device, characterized in that: include: A first acquisition unit, configured to acquire a target subtask from a task queue of a system through a main task when at least one subtask exists in the task queue of the system, wherein the target subtask is the first subtask in the task queue, and the main task is configured to manage the execution process of the subtask; A first detection unit is used to detect the task state of the target subtask through the main task, wherein the task state includes at least a ready state and a blocked state, the ready state is used to indicate that the system resources required for the target subtask to run are ready, and the blocked state is used to indicate that the system resources required for the target subtask to run are not ready; A second detection unit is used to reselect a subtask from the task queue as a target subtask when the task state is the blocked state, and detect the task state of the reselected target subtask; The first execution unit is configured to execute the target subtask whose task status is the ready state through the main task.

11. A computer program product, characterized in that The computer program product comprises a computer program, wherein when the computer program is run, the computer program product is controlled to execute the task scheduling method according to any one of claims 1 to 9.

12. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the task scheduling method described in any one of claims 1 to 9.