Task scheduling method and device, equipment, medium and program product

By calculating the creation time, initial priority, and complexity of tasks in the task queue and combining the evidence theory fusion algorithm to determine the execution priority, the problem of low resource utilization and decreased system stability caused by the single scheduling standard in the existing technology is solved, and efficient task scheduling and system performance improvement are achieved.

CN118916137APending Publication Date: 2024-11-08CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411021756.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

Existing technologies, when handling real-time and asynchronous tasks, suffer from low resource utilization, response latency, and decreased system stability due to the reliance on a single scheduling standard.

Method used

By obtaining the creation time, initial priority, and complexity information of tasks from the task queue, three types of probability values ​​are calculated (the first type of probability value is based on the waiting time, the second type of probability value is based on the initial priority, and the third type of probability value is based on the complexity). These probability values ​​are then fused using an evidence theory fusion algorithm to determine the execution priority of the tasks and execute them in order of priority.

Benefits of technology

It improves the efficiency of task scheduling, reduces resource waste and response time, and enhances the stability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916137A_ABST
    Figure CN118916137A_ABST
Patent Text Reader

Abstract

The invention discloses a task scheduling method and device, equipment, a medium and a program product, and is applied to the technical field of task scheduling. Obtaining task information of each task in the task queue; determining a first class probability value of each task according to the waiting duration of each task and the total waiting duration of all the tasks; determining a second class probability value of each task according to the initial priority of each task and the sum of the priorities of all the tasks; determining a third class probability value of each task according to the target complexity level matched with the complexity of each task and the total complexity level of all the tasks; fusing the first-class probability value, the second-class probability value and the third-class probability value of the same task to obtain an execution priority and an execution sequence; and sequentially executing the tasks according to the execution sequence. According to the task scheduling method and device, the urgency, importance and processing difficulty of the tasks can be effectively balanced, it is ensured that the tasks can be processed according to the optimal execution sequence, and the task scheduling efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the growing demand for distributed systems, cloud computing, and big data processing, how to efficiently schedule and execute a large number of concurrent tasks has become an important research topic. Existing task management solutions usually include task queues and scheduling mechanisms to store pending tasks and determine their execution order.

[0003] In some existing technologies, different machines are assigned to process real-time tasks and asynchronous tasks. Although specialized parallel processing of asynchronous tasks is achieved to a certain extent, it also leads to too many program versions of the machine, which is inconvenient for deployment and later operation and maintenance. Based on this, in some other existing technologies, multi-threading technology is used on a single machine to process real-time tasks and asynchronous tasks. However, due to the overly single scheduling standard, in high-concurrency and complex environments, simple scheduling strategies will lead to low resource utilization and prolonged response time, affecting the stability and reliability of the system.

[0004] Therefore, when processing real-time tasks and asynchronous tasks, the existing technology faces the problem of low resource utilization, response delay and reduced system stability due to a single scheduling standard. Summary of the invention

[0005] The embodiments of the present application provide a task monitoring method, apparatus, device, medium and program product, which solve the problems of low resource utilization, response delay and reduced system stability caused by a single scheduling standard when processing real-time tasks and asynchronous tasks in the prior art.

[0006] In a first aspect, an embodiment of the present application provides a method for scheduling a task, including:

[0007] In the task queue, obtain the task information of each task, including the creation time, initial priority and complexity;

[0008] According to the waiting time of each task and the total waiting time of all tasks, the first-class probability value corresponding to each task is determined. The waiting time and the total waiting time are obtained based on the creation time; according to the initial priority of each task and the sum of the priorities of all tasks, the second-class probability value corresponding to each task is determined; according to the target complexity level matched by the complexity of each task and the total complexity level of all tasks, the third-class probability value corresponding to each task is determined;

[0009] The first-category probability value, the second-category probability value, and the third-category probability value corresponding to the same task are integrated to obtain the execution priority of each task;

[0010] Sort the execution priority of each task from high to low to obtain the execution order information;

[0011] Execute the tasks in order.

[0012] In a possible embodiment of the first aspect, determining the first type of probability value corresponding to each task according to the waiting time of each task and the total waiting time of all tasks includes:

[0013] Calculate the time difference between the creation time of each task and the current system time to get the waiting time of each task;

[0014] Add up the waiting time of each task to get the total waiting time;

[0015] Divide the waiting time of each task by the total waiting time to obtain the first-category probability value corresponding to each task.

[0016] In a possible embodiment of the first aspect, the initial priority includes an initial priority value; and determining the second type of probability value corresponding to each task according to the initial priority of each task and the sum of the priorities of all tasks includes:

[0017] Add the initial priority values ​​of each task to get the total initial priority value;

[0018] Divide the initial priority value of each task by the sum of the initial priority values ​​to obtain the second-category probability value corresponding to each task.

[0019] In a possible embodiment of the first aspect, determining the third type probability value corresponding to each task according to the target complexity level matched by the complexity of each task and the total complexity level of all tasks includes:

[0020] Matching the complexity of each task with a plurality of preset complexity levels respectively, and obtaining a target complexity level matching the complexity of each task;

[0021] Add up the target complexity level matched by each task to get the total complexity level;

[0022] Subtract the target complexity level matched by a single task from the total complexity level and divide it by the total complexity level to obtain the third-category probability value corresponding to each task.

[0023] In a possible embodiment of the first aspect, the first-category probability value, the second-category probability value, and the third-category probability value corresponding to the same task are merged to obtain the execution priority of each task, including:

[0024] According to the preset evidence theory fusion algorithm, the first-class probability value, the second-class probability value and the third-class probability value of the same task are fused to obtain the execution priority of each task;

[0025] The calculation formula of the evidence theory fusion algorithm is:

[0026]

[0027] Among them, P1 is the first category probability value, P2 is the second category probability value, P3 is the third category probability value, K is the evidence conflict degree value, and Ti represents task Ti.

[0028] In a possible embodiment of the first aspect, the present invention further includes:

[0029] Get information about the execution status of the task;

[0030] The execution status information is stored in the corresponding task queue.

[0031] Based on the same inventive concept, in a second aspect, an embodiment of the present application further provides a task scheduling device, including:

[0032] The acquisition module is used to obtain the task information of each task in the task queue, including the creation time, initial priority and complexity;

[0033] A determination module, used to determine a first type of probability value corresponding to each of the tasks according to the waiting time of each of the tasks and the total waiting time of all the tasks, wherein the waiting time and the total waiting time are obtained based on the creation time; determine a second type of probability value corresponding to each of the tasks according to the initial priority of each of the tasks and the sum of the priorities of all the tasks; determine a third type of probability value corresponding to each of the tasks according to a target complexity level matched by the complexity of each of the tasks and the total complexity level of all the tasks;

[0034] A fusion module is used to fuse the first-category probability value, the second-category probability value, and the third-category probability value corresponding to the same task to obtain the execution priority of each task;

[0035] The sorting module is used to sort the execution priority of each task from high to low to obtain the information of the execution order;

[0036] The execution module is used to execute tasks in sequence according to the execution order.

[0037] Based on the same inventive concept, in the third aspect, an embodiment of the present application also provides a task scheduling device, which includes a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the first aspect, or the task scheduling method in any embodiment of the first aspect.

[0038] Based on the same inventive concept, in the fourth aspect, an embodiment of the present application also provides a computer storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the first aspect or the method for scheduling tasks in any embodiment of the first aspect is implemented.

[0039] Based on the same inventive concept, in the fifth aspect, an embodiment of the present application also provides a computer program product. When the instructions in the computer program product are executed by the processor of the device, the device can execute the first aspect, or the scheduling method of tasks in any embodiment of the first aspect.

[0040] The scheduling method, device, equipment, medium and program product of the task of the embodiment of the present application, by first obtaining the information of each task in the task queue, including its creation time, initial priority and complexity. Then, according to the waiting time of each task (calculated based on the creation time) and the total waiting time of all tasks (calculated based on the creation time), a first-class probability value is assigned to each task. At the same time, the proportion of the initial priority of each task to the sum of all task priorities is also considered to determine its second-class probability value. In addition, by matching the target complexity level to which the complexity of each task belongs, and combining the total complexity level of all tasks, a third-class probability value is calculated for each task. Subsequently, these three types of probability values ​​are merged to obtain the execution priority of each task. Finally, the tasks are sorted in order from high to low according to the execution priority, the execution order of the tasks is obtained, and each task is executed in sequence, which effectively balances the urgency, importance and processing difficulty of the tasks, thereby ensuring that the tasks can be processed in the optimal execution order, improving the efficiency of task scheduling and the overall performance of the system, reducing resource waste and response time, and enhancing the stability and reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Other features, objects and advantages of the present application will become more apparent by reading the following detailed description of non-limiting embodiments with reference to the accompanying drawings, in which the same or similar reference numerals represent the same or similar features and the accompanying drawings are not drawn to scale.

[0042] Figure 1 It is a flowchart of a method for scheduling tasks provided in an embodiment of the present application;

[0043] Figure 2This is another flowchart of the task scheduling method provided in the embodiment of the present application;

[0044] Figure 3 This is another flowchart of a method for scheduling tasks provided in an embodiment of the present application;

[0045] Figure 4 This is a flowchart of a task scheduling system provided in an embodiment of the present application for performing task scheduling;

[0046] Figure 5 It is a structural schematic diagram of a task scheduling device provided in an embodiment of the present application;

[0047] Figure 6 It is a structural diagram of a task scheduling device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only configured to explain the present application and are not configured to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0049] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0050] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0051] It is obvious to those skilled in the art that various modifications and changes can be made in the present application without departing from the spirit or scope of the present application. Therefore, the present application is intended to cover modifications and changes of the present application that fall within the scope of the corresponding claims (technical solutions for protection) and their equivalents. It should be noted that the implementation methods provided in the embodiments of the present application can be combined with each other without contradiction.

[0052] It should be noted that the acquisition, storage, use and processing of data in the embodiments of the present application are in compliance with the relevant provisions of national laws and regulations.

[0053] It should also be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0054] Before describing the technical solutions provided by the embodiments of the present application, in order to facilitate the understanding of the embodiments of the present application, the present application first specifically describes the problems existing in the related art:

[0055] With the growing demand for distributed systems, cloud computing, and big data processing, how to efficiently schedule and execute a large number of concurrent tasks has become an important research topic. Existing task management solutions usually include task queues and scheduling mechanisms to store pending tasks and determine their execution order.

[0056] In some related technologies, when processing real-time tasks and asynchronous tasks, different machines are assigned to process them. Although specialized parallel processing of asynchronous tasks is achieved to a certain extent, it also leads to too many program versions of the machine, which is inconvenient for deployment and later operation and maintenance. Based on this, in some other related technologies, multi-threading technology is used on a single machine to process real-time tasks and asynchronous tasks. However, due to the fact that the scheduling standard is too single, such as scheduling only according to the arrival time of the task or only according to the preset priority, in high concurrency and complex environments, simple scheduling strategies will lead to low resource utilization and prolonged response time, affecting the stability and reliability of the system. Therefore, when processing real-time tasks and asynchronous tasks, the existing technology faces the problem of low resource utilization, response delay and decreased system stability due to the single scheduling standard.

[0057] Based on this, the embodiments of the present application provide a task scheduling method, device, equipment, medium and program product, which can solve the problems of low resource utilization, response delay and reduced system stability due to a single scheduling standard when related technologies process real-time tasks and asynchronous tasks.

[0058] The task scheduling method provided in the embodiment of the present application is described in detail below with reference to the accompanying drawings.

[0059] Figure 1 is a flowchart of a task scheduling method provided in an embodiment of the present application, such as Figure 1 As shown, the method may include steps S110 to S150.

[0060] S110, obtaining task information of each task in the task queue, the task information including creation time, initial priority and complexity.

[0061] Among them, the task queue is the place where tasks to be executed are stored.

[0062] The creation time is the specific time when the task is added to the task queue. The creation time helps to understand the timeliness or freshness of the task.

[0063] Initial priority is the initial ordering given to tasks when they are added to the queue based on their importance, urgency, or other relevant factors.

[0064] Complexity is a comprehensive measure of the knowledge, skills, resources, time, and other inputs required to complete a task. Complexity affects the difficulty and cost of executing a task. More complex tasks may require more expertise, longer processing time, or more resource input. Understanding the complexity of a task helps to formulate a reasonable execution plan.

[0065] Specifically, we can traverse each task in the task queue and extract three key information from each task: the creation time of the task, the initial priority set when the task was created, and the complexity of the task. This information is crucial for understanding the situation of the task and evaluating the urgency and complexity of the task.

[0066] S120, determine the first type of probability value corresponding to each task according to the waiting time of each task and the total waiting time of all tasks, and the waiting time and the total waiting time are obtained based on the creation time; determine the second type of probability value corresponding to each task according to the initial priority of each task and the sum of the priorities of all tasks; determine the third type of probability value corresponding to each task according to the target complexity level matched by the complexity of each task and the total complexity level of all tasks.

[0067] Specifically, the three key attributes of each task: creation time, initial priority, and complexity are used to calculate three different categories of probability values ​​for each task. The creation time is used to determine the waiting time of each task and the total waiting time of all tasks, so as to determine the first category of probability value for each task, which is related to the timeliness or freshness of the task; the initial priority of each task and the sum of the priorities of all tasks are used to calculate the second category of probability value, which reflects the importance or urgency given to the task at the beginning; the target complexity level matched by the complexity of each task and the total complexity level of all tasks determine the third category of probability value, which is related to the resources, time or skill level required to complete the task. Through the calculation of these probability values, the multi-dimensional characteristics of the task can be evaluated more comprehensively, and further analysis, sorting or decision-making can be carried out accordingly.

[0068] S130, the first-category probability value, the second-category probability value, and the third-category probability value corresponding to the same task are integrated to obtain the execution priority of each task.

[0069] Among them, the execution priority reflects the urgency and importance of the task being executed under the current environment or conditions.

[0070] Specifically, by comprehensively considering the probability values ​​calculated from the three different dimensions of each task (creation time, initial priority, and complexity), these probability values ​​can be combined through a preset fusion method to obtain a comprehensive value that can reflect the overall importance and urgency of the task, that is, the execution priority of each task. The execution priority can be used as a basis for determining the order in which tasks are executed. The information of multiple dimensions is integrated into an easy-to-understand and comparable indicator (execution priority) so that it can be quickly determined which tasks should be executed first.

[0071] S140, sorting the execution priority of each task from high to low to obtain execution order information.

[0072] Specifically, according to the calculated execution priority of each task, all execution priorities are arranged in descending order according to the numerical values, and the arrangement result reflects the order in which the tasks should be executed.

[0073] S150, executing the tasks in sequence according to the execution order.

[0074] Specifically, each task is executed one by one and in an orderly manner, following the previously determined execution order. The execution order is determined according to the execution priority of each task, which can ensure the efficiency and quality of task execution while avoiding resource waste or delays caused by arbitrary or disorderly execution or single scheduling standard execution.

[0075] According to the monitoring method of the task provided by the embodiment of the present application, by in the task queue, first obtain the information of each task, including its creation time, initial priority and complexity. Then, according to the waiting time of each task (calculated based on the creation time) and the total waiting time of all tasks (calculated based on the creation time), a first-class probability value is assigned to each task. At the same time, the proportion of the initial priority of each task to the sum of all task priorities is also considered to determine its second-class probability value. In addition, by matching the target complexity level to which the complexity of each task belongs, and combining the total complexity level of all tasks, a third-class probability value is calculated for each task. Subsequently, these three types of probability values ​​are merged to obtain the execution priority of each task. Finally, the tasks are sorted in order from high to low according to the execution priority, the execution order of the tasks is obtained, and each task is executed in sequence, effectively balancing the urgency, importance and processing difficulty of the tasks, thereby ensuring that the tasks can be processed according to the optimal execution order, improving the efficiency of task scheduling and the overall performance of the system, reducing resource waste and response time, and enhancing the stability and reliability of the system.

[0076] Combine the following Figure 2 and Figure 3 The specific process of how step S120 determines the first probability value, the second probability value and the third probability value corresponding to each task according to the creation time, the initial priority and the complexity is introduced in detail.

[0077] Figure 2 This is another flowchart of the task scheduling method provided in the embodiment of the present application.

[0078] In some embodiments, Figure 2 As shown, in step S120, determining the first type probability value corresponding to each task according to the waiting time of each task and the total waiting time of all tasks may include steps S121 to S123.

[0079] S121, respectively calculating the time difference between the creation time of each task and the current time of the system to obtain the waiting time of each task.

[0080] Specifically, by calculating the difference between the creation time of each task and the current system time, the waiting time of each task in the task queue can be determined.

[0081] S122, adding up the waiting time of each task to obtain the total waiting time.

[0082] Specifically, the waiting time of all tasks is accumulated to obtain the total waiting time.

[0083] S123, dividing the waiting time of each task by the total waiting time, to obtain a first-category probability value corresponding to each task.

[0084] Specifically, the waiting time of each task is divided by the total waiting time to calculate the first-category probability value corresponding to each task.

[0085] In the embodiment of the present application, the waiting time of each task is determined according to its creation time, and then these time periods are accumulated to obtain the overall total waiting time. Then, by dividing the waiting time of each task by the total waiting time, the first-class probability value of each task can be accurately calculated, and the first-class probability value effectively reflects the relative urgency and importance of the task based on its waiting time.

[0086] In some embodiments, you may continue to refer to Figure 2 , the initial priority includes an initial priority value; in step S120, determining the second type probability value corresponding to each task according to the initial priority of each task and the sum of the priorities of all tasks may include steps S124 and S125.

[0087] S124, adding the initial priority values ​​of each task to obtain the total initial priority value.

[0088] S125, dividing the initial priority value of each task by the total of the initial priority values, to obtain a second type probability value corresponding to each task.

[0089] In an embodiment of the present application, the initial priority values ​​of all tasks are summarized to obtain a sum of the initial priority values. Subsequently, by dividing the initial priority value of each task by the sum of the initial priority values, the second-class probability value corresponding to each task can be accurately calculated, which can effectively reflect the relative urgency and importance of the task based on its initial priority value.

[0090] In some embodiments, you may continue to refer to Figure 2 In step S120, the third type probability value corresponding to each task is determined according to the target complexity level matched by the complexity of each task and the total complexity level of all tasks, which may include steps S126 to S128.

[0091] S126, matching the complexity of each task with a plurality of preset complexity levels respectively, to obtain a target complexity level matching the complexity of each task.

[0092] Specifically, the complexity of each task is compared with a plurality of preset complexity levels one by one to determine a target complexity level that matches the complexity of each task. For example, the preset complexity levels can be divided into 5 levels, 1, 2, 3, 4, and 5, wherein the number of preset complexity levels can be set according to demand, and this is not limited in the embodiments of the present application.

[0093] S127, adding up the target complexity levels matched by each task to obtain a total complexity level.

[0094] Specifically, the target complexity level matched to each task is accumulated to obtain the total complexity level.

[0095] S128, subtract the target complexity level matched by a single task from the total complexity level and divide the result by the total complexity level to obtain a third-category probability value corresponding to each task.

[0096] Specifically, the difference between the total complexity level and the target complexity level matched by a single task is calculated first, and then the difference is divided by the total complexity level, so that the third type probability value corresponding to the single task can be obtained.

[0097] In an embodiment of the present application, a target complexity level can be assigned to each task based on a preset complexity level as a standard, and then the target complexity levels of all tasks are added together to obtain a total complexity level. Based on the total complexity level and the target complexity level of each task, the third-type probability value corresponding to each task can be calculated, which can effectively reflect the relative urgency and importance of the task based on its complexity, and tasks with lower complexity can be executed first.

[0098] It should be noted that the inventor has found that if the first-class probability value, the second-class probability value and the third-class probability value are directly multiplied by a preset coefficient (such as the coefficient of the first-class probability value and the second-class probability value is a positive number, and the coefficient of the third-class probability value is a negative number, so that the size of the execution priority is correlated with the creation time, positively correlated with the initial priority, and negatively correlated with the complexity) and then added together to obtain the execution priority, it is impossible to fully consider the dynamics in the actual operating environment, such as resource competition, dependencies between tasks, and the impact of the task's own characteristics (such as complexity, expected execution time, etc.) on the overall system performance. Therefore, it is easier to have conflicts with the same execution priority of different tasks. Therefore, after calculating the first-class probability value P1 (based on waiting time), the second-class probability value P2 (based on initial priority) and the third-class probability value P3 (based on complexity) of each task, the Dempster-Shafer Theory of Evidence (DS) fusion algorithm can be used to fuse the first-class probability value P1, the second-class probability value P2 and the third-class probability value P3.

[0099] The Dempster-Shafer Theory of Evidence (DS) is an algorithm for dealing with uncertainty and multi-source information fusion. Applying the Dempster-Shafer Theory of Evidence (DS) to task scheduling can effectively integrate feature information (evidence) from different sources or dimensions, such as the creation time, initial priority, and execution complexity of the task, to generate a more reasonable execution priority.

[0100] The following introduces the specific process of fusing the first-category probability value, the second-category probability value, and the third-category probability value using the Dempster-Shafer Theory of Evidence (DS) fusion algorithm.

[0101] Figure 3 This is another flowchart of the task scheduling method provided in the embodiment of the present application.

[0102] In some embodiments, Figure 3 As shown, step S130 combines the first-category probability value, the second-category probability value, and the third-category probability value corresponding to the same task to obtain the execution priority of each task, which may include step S131.

[0103] S131, according to the preset evidence theory fusion algorithm, the first-category probability value, the second-category probability value and the third-category probability value of the same task are fused to obtain the execution priority of each task.

[0104] The calculation formula of the evidence theory fusion algorithm is:

[0105]

[0106] Among them, P1 is the first category probability value, P2 is the second category probability value, P3 is the third category probability value, K is the evidence conflict degree value, and Ti represents task Ti.

[0107] For example, there are n asynchronous tasks T={T1, T2, T3, ...Tn} in the task queue, and the first-category probability value (P1), the second-category probability value (P2) and the third-category probability value (P3) of each task are shown in Table 1.

[0108] Table 1

[0109] Task T1 Task T2 Task T3 Mission Tn P1 0.8 0.1 0.1 ... P2 0.2 0.4 0.4 ... P3 0.4 0.4 0.2 ...

[0110] Taking n=3 as an example, task T1 is fused and task T1 is substituted into formula (1). The total formula for the fused probability value (execution priority value) of fused task T1 is as follows:

[0111]

[0112] Specifically, 1) first fuse P1 and P2 of task T1.

[0113]

[0114] Among them, the evidence conflict degree value K1 is:

[0115]

[0116] Substituting K1 into the fusion formula of P1 and P2, we get

[0117]

[0118] 2) Similarly, by fusing the probability values ​​of P1 and P2 with P3, we can get the execution priority of task T1.

[0119] In the embodiment of the present application, by introducing the Dempster-Shafer Theory of Evidence (DS), the multi-dimensional feature information of the task such as the waiting time, initial priority and complexity is effectively integrated, that is, the first-class probability value (based on the waiting time), the second-class probability value (based on the initial priority) and the third-class probability value (based on the complexity) of each task are integrated, and a more comprehensive and accurate execution priority can be generated, thereby optimizing the task scheduling strategy and overcoming the limitations of traditional methods in dealing with dynamic environments and multi-factor task scheduling. In addition, the algorithm is scalable, and those skilled in the art can consider other factors that affect the execution priority, and calculate the fourth-class probability value, the fifth-class probability value, etc., and then fuse them through the Dempster-Shafer Theory of Evidence (DS) to further generate a more comprehensive and accurate execution priority.

[0120] In some embodiments, you may continue to refer to Figure 3 The task scheduling method may further include steps S160 and S170.

[0121] S160, obtaining information on the execution status of the task.

[0122] S170, storing the execution status information in the corresponding task queue.

[0123] In the embodiments of the present application, by acquiring and storing the task execution status in real time, it is ensured that the task queue can dynamically reflect the latest status of the task, and the task scheduling system is provided with more accurate and timely task status information, which helps to optimize the task execution order and resource allocation, and improve the overall operation efficiency and response speed of the system. For example, administrators or developers can quickly view which tasks are being executed, which tasks have been completed, and which tasks have errors or are waiting, so as to take corresponding measures in time, which is conducive to accurately and quickly diagnosing problems, tracking task execution processes, and performing performance analysis.

[0124] Figure 4 It is a flowchart of task scheduling performed by the task scheduling system provided in an embodiment of the present application.

[0125] In one example, if Figure 4 As shown in the figure, the task scheduling system is mainly composed of modules such as task queue, task scheduler and task executor.

[0126] Among them, the task queue is used to save the task information of the tasks to be executed, which may include the creation time of the task, the initial priority, the complexity of the task execution, and may also include the task status, the task execution priority and other information.

[0127] Task scheduler: It is used to calculate the execution priority of task execution and determine the execution order based on the creation time, initial priority, and complexity of each task using the Dempster-Shafer Theory of Evidence (DS) algorithm.

[0128] Task executor: used to execute tasks according to their execution priority.

[0129] The specific process of the task scheduling system performing task scheduling may include steps S01 to S08.

[0130] S01, the task queue obtains the task information of the task, including the creation time, initial priority and complexity of the task.

[0131] It should be noted that using the task creation time, initial priority, and complexity to calculate the first, second, and third probability values ​​is merely an example, and using other features that affect the execution priority to calculate probability values ​​is within the scope of protection of this application.

[0132] S02, the task queue stores the task information of the task.

[0133] S03, the task scheduler obtains task information from the task queue.

[0134] S04, the task scheduler calculates the execution priority of the task.

[0135] For example, the process of evidence quantification is as follows:

[0136] S041, Task creation time dimension: The longer the task has been waiting, the earlier it will be executed.

[0137] Calculation formula: The first type probability value P1 = waiting time of the current task / total waiting time of all tasks.

[0138] S042, task initial priority dimension: the higher the initial priority of a task, the earlier it will be executed.

[0139] Calculation formula: Second category probability value P2 = initial priority value of current task / sum of initial priority values ​​of all tasks.

[0140] S043, Task complexity dimension: The lower the task complexity, the earlier it is executed. Complexity can be divided into 5 levels, with level 1 representing the least complexity and level 5 representing the most complexity.

[0141] Calculation formula: The third type of probability value P3 = the complexity level of the current task / the sum of the complexity levels of all tasks

[0142] S044, evidence fusion: Use the combination rule of the Dempster-Shafer Theory of Evidence (DS) to integrate the probabilities P1, P2 and P3 from different sources to obtain consistent evidence probabilities, and then obtain the execution priority. For example, the weights of the three dimensions are consistent, and the basic distribution probability of the evidence theory is 1 / 3.

[0143] S05, the task scheduler sends the execution priority to the task executor.

[0144] S06, the task executor executes the task according to the execution priority.

[0145] For example, based on the fused consistency evidence probability, the order is re-arranged according to the consistency evidence probability. The larger the consistency evidence probability, the higher the execution priority.

[0146] S07, the task executor sends the task execution status to the task queue.

[0147] S08, the task queue updates the task execution status.

[0148] In the embodiment of this application, the Dempster-Shafer Theory of Evidence (DS) is applied to task scheduling to build a decentralized asynchronous task processing framework, which not only ensures the consistency of application versions for easy deployment, but also achieves efficient asynchronous processing under limited resource conditions. This framework significantly improves the flexibility, performance and scalability of task execution through intelligent task scheduling strategies, which perfectly meets the requirements of modern computing environments for efficiency, flexibility and scalability.

[0149] In another example, after the task scheduler obtains the task information, it can allocate the waiting probability (first type of probability value) by creating a time allocator, allocate the initial priority probability value (second type of probability value) by the initial priority allocator, and allocate the complexity probability value (third type of probability value) by the complexity allocator. Then, according to the Dempster-Shafer Theory of Evidence (DS), the first type of probability value, the second type of probability value and the third type of probability value are fused to obtain the execution priority of the task. In the embodiment of the present application, different probability values ​​are assigned to the tasks by creating three allocators of time, initial priority and complexity, and these probability values ​​are fused using the evidence theory fusion algorithm (DS), so as to effectively determine the execution priority of the task. And it is also possible to adjust or increase the probability allocator and the fusion algorithm by adding or adjusting the factors affecting the execution priority, and it can be easily expanded to support the evaluation and optimization of the execution priority of tasks in more dimensions.

[0150] Based on the same inventive concept, the embodiment of the present application also provides a task scheduling device, such as Figure 5 As shown, the device 500 may include an acquisition module 510 , a determination module 520 , a fusion module 530 , a sorting module 540 and an execution module 550 .

[0151] The acquisition module 510 is used to acquire task information of each task in the task queue, where the task information includes creation time, initial priority and complexity;

[0152] The determination module 520 is used to determine the first type probability value corresponding to each task according to the waiting time of each task and the total waiting time of all tasks, wherein the waiting time and the total waiting time are obtained based on the creation time; determine the second type probability value corresponding to each task according to the initial priority of each task and the sum of the priorities of all tasks; determine the third type probability value corresponding to each task according to the target complexity level matched by the complexity of each task and the total complexity level of all tasks;

[0153] A fusion module 530 is used to fuse the first-category probability value, the second-category probability value, and the third-category probability value corresponding to the same task to obtain the execution priority of each task;

[0154] The sorting module 540 is used to sort the execution priority of each task from high to low to obtain execution order information;

[0155] The execution module 550 is used to execute tasks in sequence according to the execution order.

[0156] According to the monitoring device of the task provided by the embodiment of the present application, in the task queue, first obtain the information of each task, including its creation time, initial priority and complexity. Then, according to the waiting time of each task (calculated based on the creation time) and the total waiting time of all tasks (calculated based on the creation time), a first-class probability value is assigned to each task. At the same time, the proportion of the initial priority of each task to the sum of all task priorities is also considered to determine its second-class probability value. In addition, by matching the target complexity level to which the complexity of each task belongs, and combining the total complexity level of all tasks, a third-class probability value is calculated for each task. Subsequently, these three types of probability values ​​are merged to obtain the execution priority of each task. Finally, the tasks are sorted in order from high to low according to the execution priority, the execution order of the tasks is obtained, and each task is executed in sequence, effectively balancing the urgency, importance and processing difficulty of the tasks, thereby ensuring that the tasks can be processed according to the optimal execution order, improving the efficiency of task scheduling and the overall performance of the system, reducing resource waste and response time, and enhancing the stability and reliability of the system.

[0157] In some embodiments, the determination module is used to determine the first type probability value corresponding to each task according to the waiting time of each task and the total waiting time of all tasks, which can be specifically used to:

[0158] Calculate the time difference between the creation time of each task and the current system time to get the waiting time of each task;

[0159] Add up the waiting time of each task to get the total waiting time;

[0160] Divide the waiting time of each task by the total waiting time to obtain the first-category probability value corresponding to each task.

[0161] In some embodiments, the initial priority includes an initial priority value; the determination module is used to determine the second type of probability value corresponding to each task according to the initial priority of each task and the sum of the priorities of all tasks, which can be specifically used to:

[0162] Add the initial priority values ​​of each task to get the total initial priority value;

[0163] Divide the initial priority value of each task by the sum of the initial priority values ​​to obtain the second-category probability value corresponding to each task.

[0164] In some embodiments, the determination module is used to determine the third type of probability value corresponding to each task according to the target complexity level matched by the complexity of each task and the total complexity level of all tasks, which can be specifically used for:

[0165] Matching the complexity of each task with a plurality of preset complexity levels respectively, and obtaining a target complexity level matching the complexity of each task;

[0166] Add up the target complexity level matched by each task to get the total complexity level;

[0167] Subtract the target complexity level matched by a single task from the total complexity level and divide it by the total complexity level to obtain the third-category probability value corresponding to each task.

[0168] In some embodiments, the fusion module is used to fuse the first-category probability value, the second-category probability value, and the third-category probability value corresponding to the same task to obtain the execution priority of each task, which can be specifically used for:

[0169] According to the preset evidence theory fusion algorithm, the first-class probability value, the second-class probability value and the third-class probability value of the same task are fused to obtain the execution priority of each task;

[0170] The calculation formula of the evidence theory fusion algorithm is:

[0171]

[0172]

[0173] Among them, P1 is the first type probability value, P2 is the second type probability value, P3 is the third type probability value, and K is the evidence conflict degree value.

[0174] In some embodiments, the device further comprises a storage module:

[0175] The acquisition module is also used to obtain information about the execution status of the task;

[0176] The storage module is used to store the execution status information in the corresponding task queue.

[0177] Each module in the task scheduling device provided in the embodiment of the present application can realize Figures 1 to 4 The functions of each step of the provided task scheduling method and its ability to achieve corresponding technical effects are described briefly and will not be elaborated here.

[0178] Figure 6 A schematic diagram of the hardware structure of a task scheduling device provided in an embodiment of the present application is shown.

[0179] The task scheduling device may include a processor 601 and a memory 602 storing computer program instructions.

[0180] Specifically, the processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0181] The memory 602 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 602 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 602 may be inside or outside the scheduling device of the task. In a particular embodiment, the memory 602 is a non-volatile solid-state memory.

[0182] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of the present disclosure.

[0183] The processor 601 implements any one of the task scheduling methods in the above embodiments by reading and executing computer program instructions stored in the memory 602 .

[0184] In one example, the task scheduling device may further include a communication interface 603 and a bus 604. Figure 6 As shown, the processor 601, the memory 602, and the communication interface 603 are connected via a bus 604 and communicate with each other.

[0185] The communication interface 603 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0186] The bus 604 includes hardware, software or both, coupling the components of the scheduling device of the task to each other. For example and not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnection, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnection, a Linear Predictive Coding (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (Peripheral Component Interconnect-X, PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VESA Local Bus, VLB) bus or other suitable buses or a combination of two or more of these. Where appropriate, the bus 604 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.

[0187] The device can execute the task scheduling method in the embodiment of the present application based on each unit / component in the task scheduling device, thereby realizing the combination of Figures 1 to 4 Describes the scheduling method for tasks.

[0188] In addition, in combination with the task scheduling method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the task scheduling methods in the above embodiment is implemented.

[0189] The present application also provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes each process of an embodiment of a scheduling method for implementing any of the above-mentioned tasks.

[0190] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0191] The functional blocks shown in the structural block diagram described above can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), appropriate firmware, plug-in, function card, etc. When implemented in software, the elements of the present application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or communication link by a data signal carried in a carrier. "Machine-readable medium" may include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (Read-Only Memory, ROM), flash memory, erasable read-only memory (Erasable Read Only Memory, EROM), floppy disks, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical discs, hard disks, optical fiber media, radio frequency (Radio Frequency, RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0192] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0193] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box 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, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0194] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A task scheduling method, It is characterized in that include: In the task queue, task information of each task is obtained, wherein the task information includes creation time, initial priority and complexity; Determine the first type of probability value corresponding to each of the tasks according to the waiting time of each of the tasks and the total waiting time of all the tasks, wherein the waiting time and the total waiting time are obtained based on the creation time; determine the second type of probability value corresponding to each of the tasks according to the initial priority of each of the tasks and the sum of the priorities of all the tasks; determine the third type of probability value corresponding to each of the tasks according to the target complexity level matched by the complexity of each of the tasks and the total complexity level of all the tasks; The first category probability value, the second category probability value and the third category probability value corresponding to the same task are merged to obtain the execution priority of each task; Sorting the execution priority of each task from high to low to obtain execution order information; The tasks are executed sequentially according to the execution order.

2. The method according to claim 1, It is characterized in that Determining the first type probability value corresponding to each task according to the waiting time of each task and the total waiting time of all tasks includes: Calculate the time difference between the creation time of each task and the current time of the system to obtain the waiting time of each task; Add the waiting time of each task to obtain the total waiting time; The waiting time of each task is divided by the total waiting time to obtain a first-category probability value corresponding to each task.

3. The method according to claim 1, It is characterized in that The initial priority includes an initial priority value; and determining the second type probability value corresponding to each task according to the initial priority of each task and the sum of the priorities of all the tasks includes: Adding the initial priority values ​​of each task to obtain a total initial priority value; The initial priority value of each of the tasks is divided by the sum of the initial priority values ​​to obtain a second type probability value corresponding to each of the tasks.

4. The method according to claim 1, It is characterized in that Determining the third type probability value corresponding to each task according to the target complexity level matched by the complexity of each task and the total complexity level of all the tasks includes: Respectively matching the complexity of each of the tasks with a plurality of preset complexity levels to obtain a target complexity level that matches the complexity of each of the tasks; Adding the target complexity level matched by each task to obtain a total complexity level; The target complexity level matched by a single task is subtracted from the total complexity level and the resultant value is divided by the total complexity level to obtain a third-category probability value corresponding to each task.

5. The method according to claim 1, It is characterized in that The step of fusing the first probability value, the second probability value, and the third probability value corresponding to the same task to obtain the execution priority of each task includes: According to a preset evidence theory fusion algorithm, the first category probability value, the second category probability value and the third category probability value of the same task are fused to obtain the execution priority of each task; The calculation formula of the evidence theory fusion algorithm is: Among them, P1 is the first type of probability value, P2 is the second type of probability value, P3 is the third type of probability value, K is the evidence conflict degree value, and Ti represents task Ti.

6. The method according to any one of claims 1 to 5, It is characterized in that Also includes: Obtaining information on the execution status of the task; The execution status information is stored in the corresponding task queue.

7. A task scheduling device, It is characterized in that include: An acquisition module, used to acquire task information of each task in the task queue, wherein the task information includes creation time, initial priority and complexity; A determination module, used to determine a first type of probability value corresponding to each of the tasks according to the waiting time of each of the tasks and the total waiting time of all the tasks, wherein the waiting time and the total waiting time are obtained based on the creation time; determine a second type of probability value corresponding to each of the tasks according to the initial priority of each of the tasks and the sum of the priorities of all the tasks; determine a third type of probability value corresponding to each of the tasks according to a target complexity level matched by the complexity of each of the tasks and the total complexity level of all the tasks; A fusion module, used for fusing the first category probability value, the second category probability value and the third category probability value corresponding to the same task to obtain the execution priority of each task; A sorting module, used to sort the execution priority of each task from high to low to obtain execution order information; The execution module is used to execute the tasks in sequence according to the execution order.

8. A task scheduling device, It is characterized in that The device comprises: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the method for scheduling tasks as claimed in any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method for scheduling tasks according to any one of claims 1 to 6 is implemented.

10. A computer program product, It is characterized in that When the instructions in the computer program product are executed by a processor of a device, the device is enabled to execute the task scheduling method as described in any one of claims 1 to 6.

Citation Information

Cited By

  • Method for determining request execution sequence, electronic equipment and storage medium

    CN120335972A

  • Complexity-priority dual-drive intelligence processing task scheduling method and device

    CN121210073A

  • Multi-source random access dynamic arbitration method and system based on FPGA

    CN121579392A