CN113282381A - Task scheduling method and device, computer equipment and storage medium - Google Patents

Task scheduling method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113282381A
CN113282381A CN202010101962.1A CN202010101962A CN113282381A CN 113282381 A CN113282381 A CN 113282381A CN 202010101962 A CN202010101962 A CN 202010101962A CN 113282381 A CN113282381 A CN 113282381A
Authority
CN
China
Prior art keywords
scheduling
task
channel
priority
scheduling channel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010101962.1A
Other languages
Chinese (zh)
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Cambricon Technologies Corp Ltd
Original Assignee
Cambricon Technologies Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Cambricon Technologies Corp Ltd filed Critical Cambricon Technologies Corp Ltd
Priority to CN202010101962.1A priority Critical patent/CN113282381A/en
Publication of CN113282381A publication Critical patent/CN113282381A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/484Precedence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5021Priority

Abstract

The present disclosure relates to a task scheduling method, apparatus, computer device, and storage medium, which can implement relatively fair scheduling of tasks by obtaining the waiting time of each task, evaluating each task by the waiting time of each task, and scheduling the tasks according to the evaluation result.

Description

Task scheduling method and device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a task scheduling method and apparatus, a computer device, and a storage medium.
Background
Different tasks processed by the artificial intelligence processor are sensitive to delay and need to be responded within a certain time; some tasks, such as training tasks, are not sensitive to delay, mainly seek throughput, are not sensitive to delay, but are not sensitive to delay and cannot starve.
Therefore, a scheduling algorithm is needed, which can ensure that delay-sensitive tasks can be responded to in time and certain fairness is ensured through reasonable resource scheduling, so that delay-insensitive applications are not starved.
Disclosure of Invention
In view of the above, it is desirable to provide a task scheduling method, device, computer apparatus, and storage medium capable of relatively fairly performing scheduling.
A method of task scheduling, the method comprising:
if the average scheduling waiting time of the current channel of the common scheduling channel is greater than the current time threshold, the target task in the common scheduling channel is scheduled into a priority scheduling channel from the common scheduling channel;
if the dynamic priority of the task of the common scheduling channel reaches a preset value, the task of which the dynamic priority reaches the preset value is called into a priority scheduling channel by the common scheduling channel;
and scheduling all tasks in the priority scheduling channel after the tasks in the common scheduling channel are scheduled.
In one embodiment, the method further comprises: and determining the current time threshold according to the current scheduling waiting time of all tasks in the common scheduling channel.
In one embodiment, determining the current time threshold according to the current scheduling waiting time of all tasks in the common scheduling channel includes:
calculating the current channel average scheduling waiting time of each common scheduling channel according to the current scheduling waiting time of the tasks in each common scheduling channel;
and obtaining the current time threshold according to the average value of the current channel average scheduling waiting time of at least one common scheduling channel.
In one embodiment, the method further comprises: and determining the dynamic priority of each task in the ordinary scheduling channel according to the static priority of each task in the ordinary scheduling channel and the current scheduling waiting time of the task.
In one embodiment, the determining the dynamic priority of each task in the ordinary scheduling channel according to the static priority of each task in the ordinary scheduling channel and the current scheduling waiting time of the task, where the dynamic priority is 0, includes:
acquiring a scheduling waiting time threshold, a static priority coefficient, a scheduling waiting time coefficient and a preset duration;
calculating the ratio of the scheduling waiting time of each task in the common scheduling channel to the preset time length to obtain a first operation result;
calculating the product of the scheduling waiting time coefficient and the first operation result to obtain a second operation result;
calculating the product of the static priority coefficient and the static priority to obtain a third operation result;
calculating the sum of the scheduling waiting time threshold and the third operation result to obtain a fourth operation result;
and taking the difference value of the fourth operation result and the second operation result as the dynamic priority of each task in the corresponding common scheduling channel.
In one embodiment, the method further comprises:
acquiring a task linked list of the priority scheduling channel, and scheduling tasks of the priority scheduling channel in sequence according to the task linked list of the priority scheduling channel;
and after all the tasks of the priority scheduling channel are scheduled, acquiring a task chain table of a common scheduling channel, and scheduling the tasks of the common scheduling channel according to the task chain table of the common scheduling channel and the state of equipment corresponding to the tasks in the common scheduling channel.
In one embodiment, each static priority corresponds to one task linked list, each task linked list corresponds to one scheduling channel, and the scheduling channels include a common scheduling channel and a priority scheduling channel, and the method further includes:
and after all the tasks in the priority scheduling channel are scheduled, scheduling the tasks of the common scheduling channel according to the static priority.
In one embodiment, the method further comprises:
receiving a task; acquiring the task priority of the task according to the type and the affinity of the task; and adding the task to the tail of the corresponding task linked list according to the task priority of the task.
In one embodiment, the method further comprises:
and if the current processor resource cannot meet the current task of the priority scheduling channel, performing blocking processing on the task of the common scheduling channel so as to enable the computing resource to meet the current task of the priority scheduling channel.
A method of task scheduling, the method comprising:
if the average scheduling waiting time of the current channel of the ordinary scheduling channel is larger than the current time threshold, the dynamic priority of each task in the ordinary scheduling channel is obtained,
if the dynamic priority of the target task in the common scheduling channel reaches a preset value, the target task is called into a priority scheduling channel from the common scheduling channel;
and scheduling all tasks in the priority scheduling channel after the tasks in the common scheduling channel are scheduled.
A method of task scheduling, the method comprising:
if the dynamic priority of the task in the common scheduling channel reaches a preset value, acquiring the current channel average scheduling waiting time of the common scheduling channel where the task with the dynamic priority reaching the preset value is located;
if the average scheduling waiting time of the current channel is greater than the current time threshold, the task with the dynamic priority reaching the preset value is called into a priority scheduling channel by the common scheduling channel;
and scheduling all tasks in the priority scheduling channel after the tasks in the common scheduling channel are scheduled.
A task scheduling apparatus, the apparatus comprising:
the device comprises a memory, a priority scheduling channel and a control unit, wherein the memory is used for providing a storage space for a common scheduling channel and the priority scheduling channel, and tasks in the common scheduling channel are scheduled after all tasks in the priority scheduling channel are scheduled;
the equalizing circuit is used for transferring the target task in the ordinary scheduling channel from the ordinary scheduling channel to a priority scheduling channel if the average scheduling waiting time of the current channel of the ordinary scheduling channel is greater than the current time threshold; and if the dynamic priority of the tasks of the common scheduling channel reaches a preset value, the tasks with the dynamic priority reaching the preset value are called into a priority scheduling channel by the common scheduling channel.
A task scheduling apparatus, the apparatus comprising:
the device comprises a memory, a priority scheduling channel and a control unit, wherein the memory is used for providing a storage space for a common scheduling channel and the priority scheduling channel, and tasks in the common scheduling channel are scheduled after all tasks in the priority scheduling channel are scheduled;
and the equalizing circuit is used for acquiring the dynamic priority of each task in the ordinary scheduling channel if the average scheduling waiting time of the current channel of the ordinary scheduling channel is greater than the current time threshold, and scheduling the target task into a priority scheduling channel from the ordinary scheduling channel if the dynamic priority of the target task reaches a target task with a preset value in the ordinary scheduling channel.
A task scheduling apparatus, the apparatus comprising:
the device comprises a memory, a priority scheduling channel and a control unit, wherein the memory is used for providing a storage space for a common scheduling channel and the priority scheduling channel, and tasks in the common scheduling channel are scheduled after all tasks in the priority scheduling channel are scheduled;
the equalization circuit is used for acquiring the current channel average scheduling waiting time of the common scheduling channel where the tasks with the dynamic priorities reaching the preset values are located if the dynamic priorities of the tasks in the common scheduling channel reach the preset values; and if the average scheduling waiting time of the current channel is greater than the current time threshold, the task is transferred from the common scheduling channel to a priority scheduling channel.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method in the embodiments of the disclosure when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method in the embodiments of the disclosure.
According to the task scheduling method, the task scheduling device, the computer equipment and the storage medium, the current waiting time is obtained by obtaining the updated waiting time of each task, the average value of the current channel average scheduling waiting time of each channel is used as the current time threshold, and the current time threshold obtained by the method is obtained based on the current scheduling waiting time of the tasks in all the common channels, so that whether the waiting scheduling time of the tasks in the task list is too long or not can be integrally and accurately evaluated by the current time threshold.
Drawings
FIG. 1 is a diagram of an application environment of a task scheduling method in one embodiment;
FIG. 2 is a flowchart illustrating a task scheduling method according to an embodiment;
FIG. 3 is a flowchart illustrating additional steps of a task scheduling method according to one embodiment;
FIG. 4 is a flowchart illustrating additional steps of a task scheduling method in accordance with another embodiment;
FIG. 5 is a flowchart illustrating a task scheduling method according to an embodiment;
FIG. 6 is a block diagram showing the structure of a task scheduler in one embodiment;
FIG. 7 is a block diagram showing the construction of a task scheduling apparatus according to another embodiment;
FIG. 8 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the disclosure and are not intended to limit the disclosure.
The task scheduling method provided by the present disclosure can be applied to the application environment shown in fig. 1. The task scheduling device 100 is connected to the task processing system 200. The task scheduling device can schedule the tasks to obtain scheduling information of the tasks. The task scheduling device 100 includes a memory (not shown) for providing a storage space. The task processing system 200 includes a plurality of devices 210, and the task processing system 200 distributes the task to the devices 210 according to the scheduling information of the task, where each device 210 is configured to execute a corresponding task to obtain a processing result of the task.
Optionally, before being issued to the device for execution, the task is issued from the channel to the software queue and the hardware queue in sequence, and then issued from the hardware queue to the corresponding device for execution. Alternatively, these tasks, the time the task was dispatched to the start of the software queue, the time the task was dispatched to the hardware queue, and the scheduling latency may be recorded in the task list. The scheduling latency may be the time that a task waits from being dispatched to a software queue to being dispatched to a hardware queue.
Optionally, the channels in this embodiment of the present application may include a normal scheduling channel and a priority scheduling channel, and the task scheduling device 100 may schedule the tasks with different priorities to the priority scheduling channel or the normal scheduling channel according to the priorities of the tasks. The priority of the task in the priority scheduling channel is higher than that of the task in the ordinary scheduling channel, that is, the task in the priority scheduling channel is scheduled to be executed before the task in the ordinary scheduling channel. Further optionally, after all the tasks in the priority scheduling channel are scheduled, the tasks in the normal scheduling channel are scheduled to be executed. Optionally, the number of the common scheduling channels may be one or more, and is not limited herein.
Alternatively, the device 210 may be a chip, a processor, or a processor core. If the device is a processor, the processor may be an artificial Intelligence Processor (IPU), and the artificial intelligence processor includes, but is not limited to, an accelerated Processing unit (apu), a graphics Processing unit (gpu), a neural Network Processing Unit (NPU), and other artificial intelligence processors.
In an embodiment, as shown in fig. 2, a task scheduling method is provided, which is described by taking the method as an example applied to the task scheduling apparatus in fig. 1, and the method may include the following steps:
step 210, if the average scheduling waiting time of the current channel of the ordinary scheduling channel is greater than or equal to the current time threshold, the target task in the ordinary scheduling channel is scheduled to the priority scheduling channel from the ordinary scheduling channel.
Where the channel may be put into the task to be scheduled. The task scheduler 100 takes out a task from a channel and schedules the task. The channels may be divided into a general scheduling channel and a priority scheduling channel. Alternatively, the memory of the task scheduler 100 may provide storage space for the channels. And scheduling all tasks in the priority scheduling channel after the tasks in the common scheduling channel are scheduled. The task scheduling apparatus 100 may take out the corresponding task from the normal scheduling channel to perform scheduling according to the scale of the task in the normal scheduling channel and the resource status. The size of a task is the resource required for executing the task, and the resource can be a processor or a processor core, a memory and the like. The resource states may include idle and occupied. The task scheduler 100 fetches the tasks from the priority scheduling path in the order of first-in first-out to perform scheduling.
Alternatively, the task scheduling device 100 may obtain the current scheduling waiting time of each task by updating the scheduling waiting time of each task in the task list. Specifically, when traversing the task list of the tasks in the general scheduling path, the task scheduling device 100 first updates the scheduling waiting time of each task in the task list to obtain the current scheduling waiting time of each task in the task list. In the embodiment of the application, the current scheduling waiting time of each task is updated and determined in real time. Further, the average scheduling latency of the current channel and the current time threshold may both be determined according to the current scheduling latency of the task in the current channel, and the specific determination manner may be as described below.
Specifically, the task scheduling device 100 traverses a task list of tasks in the ordinary scheduling path to obtain the current scheduling waiting time of each task in the task list; and obtaining the average scheduling waiting time of the current channel of each common scheduling channel and the current time threshold according to the current scheduling waiting time of each task. The task scheduling device 100 compares the current average scheduling waiting time of the common scheduling channel with the current time threshold, and if the current average scheduling waiting time of the common scheduling channel is greater than or equal to the current time threshold, the target task in the common scheduling channel is scheduled to the priority scheduling channel from the common scheduling channel. Optionally, the target task may be a task determined by the current scheduling waiting time of each task in the common scheduling channel and the size of the task scale. For example, the target task may be a task with the longest current scheduling latency in the normal scheduling path. And then, the target task can be a task with a task scale meeting the current resource requirement in the common scheduling channel, and the current resource requirement can be the difference between the total resource and the resource required by the task scale of the task in the priority scheduling channel. For another example, the target task may be a task whose current scheduling latency is longest in the normal scheduling channel, and the target task may be a task whose task size meets the current resource requirement in the normal scheduling channel.
In the task scheduling method of this embodiment, the tasks to be scheduled with different priorities are first distinguished by using the common scheduling channel and the priority scheduling channel, and are respectively placed in the common scheduling channel and the priority scheduling channel. Then, by traversing the task list of the tasks in the ordinary scheduling channel, the tasks with too long waiting time (starvation) are scheduled in the priority scheduling channel, and the embodiment adopts the current time threshold to evaluate whether the scheduling waiting time of the tasks in the ordinary scheduling channel is too long, which can accurately evaluate the current relative state of each task to be scheduled, so that the task scheduling method of the embodiment can realize relatively fair scheduling in the scheduling process.
In one embodiment, as shown in fig. 3, the task scheduling method further includes:
step S220, calculating the average scheduling waiting time of the current channel of each common scheduling channel according to the current scheduling waiting time of the task in each common scheduling channel.
Specifically, after acquiring the current scheduling waiting time of each task in the ordinary scheduling channel, the task scheduling device 100 calculates the current channel average scheduling waiting time of each ordinary scheduling channel according to the current scheduling waiting time of the task in each ordinary scheduling channel. The current channel average scheduling latency may be an average of the current scheduling latencies of all tasks in the current channel.
Step S230, determining the current time threshold according to the average of the current channel average scheduling waiting time of at least one of the ordinary scheduling channels.
Specifically, the task scheduling device 100 obtains the current time threshold according to an average of the current channel average scheduling waiting time of at least one of the ordinary scheduling channels. Optionally, the task scheduling device 100 obtains the current time threshold according to an average of current channel average scheduling waiting times of all the common scheduling channels. Specifically, the task scheduling device 100 obtains the current time threshold according to a mean value of the current channel average scheduling waiting times of all the common scheduling channels and a preset value.
In other embodiments, the current time threshold may also be determined according to the current scheduling latency of each task in at least one common scheduling channel. For example, the task scheduler 100 may obtain the current scheduling waiting time of all tasks in at least one common scheduling channel, and use the average value of the current scheduling waiting time of all tasks in the at least one common scheduling channel and a preset value as the current time threshold. Of course, in other alternative embodiments, the current time threshold may also be a preset value, and the preset value may be a constant value or a variable value determined according to the current scheduling waiting time of the task, which is not specifically limited herein.
According to the method, after the current scheduling waiting time of the task is obtained, the average value of the current channel average scheduling waiting time of each channel is used as the current time threshold, and the current time threshold obtained by the method is a dynamic time threshold obtained based on the current scheduling waiting time of the tasks in all the common channels, so that whether the waiting scheduling time of the tasks in the task list is too long or not can be integrally and accurately evaluated by the current time threshold, and the task scheduling efficiency can be improved according to the dynamic adjustment of the current scheduling waiting time of the tasks.
In one embodiment, the user may define the priority of each task, and the task scheduling device may schedule the tasks into the normal scheduling channel or the priority scheduling channel according to the priority of each task. For example, the priorities of the tasks may include 0-15 priorities, where 0 represents the highest priority of the task and 15 represents the lowest priority of the task. Further optionally, the common scheduling channel may include a plurality of channels, and each common scheduling channel corresponds to a task linked list of a priority level. Optionally, the number of the common scheduling channels may also be one, and the common scheduling channel may include a plurality of task linked lists, and each task linked list may correspond to a task of a priority level. Alternatively, the priority scheduling channel may be one, which may include a task chain table for storing the task with the highest priority. The tasks in the priority scheduling channel can be scheduled and executed in sequence according to the principle of first-in first-out, and the task scheduling device can schedule the tasks in the common scheduling channel after the tasks in the priority scheduling channel are all scheduled.
Further, the tasks in the ordinary scheduling path may be determined according to their task priorities and/or current scheduling latencies. The above description refers to an embodiment in which the tasks in the ordinary scheduling channel are scheduled according to the current scheduling waiting time of the tasks. For an embodiment in which the task in the ordinary scheduling channel is scheduled according to the priority of the task, or in a manner that the priority of the task is combined with the current scheduling waiting time of the task, reference may be specifically made to the following description.
As shown in fig. 4, an embodiment of the present application provides another task scheduling method, which is described by taking the application of the method to the task scheduling apparatus in fig. 1 as an example, and includes the following steps:
step S310, if the dynamic priority of the task of the ordinary scheduling channel reaches a preset value, the task of which the dynamic priority reaches the preset value is called into a priority scheduling channel by the ordinary scheduling channel.
The common scheduling channel in this embodiment has the same meaning as that in the above embodiment. Optionally, the static priority of each task may be obtained according to the type of the task, the task size, the affinity, and the like, and the static priority of each task may also be specified by the user. The task scheduling device 100 issues the task to the normal scheduling channel or the priority scheduling channel according to the static priority of the task. The task scheduling device 100 preferentially schedules all tasks in the preferential scheduling channel, and only after all tasks in the preferential scheduling channel are scheduled, the tasks in the ordinary scheduling channel are scheduled.
Alternatively, the preset value may be set according to a static priority of the priority scheduling channel. For example, when the static priority of the priority scheduling channel is 0, the preset value may be set to 0. Optionally, each channel may be correspondingly provided with one task linked list, and each channel is put into one task, and the put task may be added at the end of the corresponding task linked list. Optionally, if the dynamic priority of the task of the ordinary scheduling channel reaches a preset value, the task scheduling device 100 schedules the task whose dynamic priority reaches the preset value from the ordinary scheduling channel to the priority scheduling channel.
After the task is called into the priority scheduling channel, the task is added at the tail end of the task chain table of the priority scheduling channel. If the dynamic priority of the task does not reach the preset value, the task is continuously left in the original common scheduling channel to wait for being scheduled.
Optionally, the task scheduling device 100 obtains a task chain table of a priority scheduling channel, and sequentially schedules the tasks of the priority scheduling channel according to the task chain table of the priority scheduling channel; and after all the tasks of the priority scheduling channel are scheduled, acquiring a task chain table of a common scheduling channel, and scheduling the tasks of the common scheduling channel according to the task chain table of the common scheduling channel and the state of equipment corresponding to the tasks in the common scheduling channel. Optionally, the state of the device comprises an occupied state of the device.
Alternatively, the number of the common scheduling channels may be plural. Optionally, each static priority corresponds to one task linked list, each task linked list corresponds to one scheduling channel, and the scheduling channels include a common scheduling channel and a priority scheduling channel. Alternatively, the static priority of the task which needs to be scheduled most urgently can be set to 0, and the rest of the tasks can be further divided according to the scheduling urgency degree. Optionally, the task with the static priority level of 0 is placed into the priority scheduling channel, and the tasks placed into the priority scheduling channel are sequentially added to the corresponding task linked list. The tasks except the task with the static priority of 0 are put into the corresponding ordinary scheduling channels according to the static priorities of the tasks, and correspondingly, the tasks are sequentially added to the corresponding task linked lists after being put into the ordinary scheduling channels.
Further, as the static priority of the task increases, the scheduling urgency of the task decreases. Specifically, the task scheduling device 100 receives a task (a task to be scheduled) and confirms a static task priority of the task, and then adds the task to the end of a task chain table of a corresponding channel according to the static task priority of the task. After all the tasks in the priority scheduling channel are scheduled, the task scheduling device 100 schedules the tasks in the common scheduling channel according to the static priority.
Optionally, the task scheduling device 100 determines the dynamic priority of each task in the ordinary scheduling channel according to the static priority of each task in the ordinary scheduling channel and the scheduling waiting time of the task. Specifically, when the dynamic priority is 0, the task scheduling device 100 first obtains a scheduling waiting time threshold, a static priority coefficient, a scheduling waiting time coefficient, and a preset duration; then calculating the ratio of the scheduling waiting time of each task in the common scheduling channel to the preset time length to obtain a first operation result; then calculating the product of the scheduling waiting time coefficient and the first operation result to obtain a second operation result; then, calculating the product of the static priority coefficient and the static priority to obtain a third operation result; then calculating the sum of the scheduling waiting time threshold and the third operation result to obtain a fourth operation result; and finally, the difference value of the fourth operation result and the second operation result corresponds to the dynamic priority of each task in the common scheduling channel.
Specifically, the dynamic priority of each task may be calculated according to the following formula:
dynamic_priority=wait_threshold+a*static_priority-b*wait_jiffies/n,
wherein, dynamic _ priority is dynamic priority, wait _ threshold is scheduling waiting time threshold, a is static priority coefficient, b is scheduling waiting time coefficient, wait _ jfets is scheduling waiting time of each task in the common scheduling channel, and n is a dimension parameter of wait _ jfets. Alternatively, n may be 4 s.
In the task scheduling method of this embodiment, to-be-scheduled tasks with different priorities are first distinguished and are respectively placed in a common scheduling channel and a priority scheduling channel. And then, according to the dynamic priority of the tasks, scheduling the tasks with too long waiting time into a priority scheduling channel, wherein the dynamic priority is adopted to evaluate whether the scheduling waiting time of the tasks in the common scheduling channel is too long (starved), so that the current relative state of each task to be scheduled can be accurately evaluated, and therefore, the task scheduling method of the embodiment can realize relatively fair scheduling in the scheduling process.
Based on the same inventive concept, in one embodiment, as shown in fig. 6, the method includes:
step S410, if the average scheduling waiting time of the current channel of the ordinary scheduling channel is larger than the current time threshold, the dynamic priority of each task in the ordinary scheduling channel is obtained. The determination method of the average scheduling waiting time of the current channel and the current time threshold of the ordinary scheduling channel is substantially the same as the determination method of step S220 and step S230, which may be specifically described above.
Step S420, if the dynamic priority of the target task in the ordinary scheduling channel reaches a preset value, the target task is scheduled from the ordinary scheduling channel to a priority scheduling channel. And scheduling all tasks in the priority scheduling channel after the tasks in the common scheduling channel are scheduled.
The obtaining method of the average scheduling waiting time of the current channel, the current time threshold and the dynamic priority related in this embodiment may refer to the description of the related content above, and is not described herein again.
According to the method, the priority scheduling channel can be called only when the common scheduling channel where the task is located meets the condition that the average scheduling waiting time of the current channel is greater than the current time threshold and the dynamic priority of the task reaches the preset value, and the two conditions are met. The method of this embodiment may enable relatively fair scheduling.
Based on the same inventive concept, in one embodiment, as shown in fig. 7, the present disclosure proposes another task scheduling method, which includes:
step S510, if the dynamic priority of the task of the ordinary scheduling channel reaches a preset value, obtaining the current channel average scheduling waiting time of the ordinary scheduling channel where the task whose dynamic priority reaches the preset value is located.
Step S520, if the average scheduling waiting time of the current channel is greater than the current time threshold, the task with the dynamic priority reaching the preset value is scheduled to the priority scheduling channel from the ordinary scheduling channel. And scheduling all tasks in the priority scheduling channel after the tasks in the common scheduling channel are scheduled.
The obtaining method of the average scheduling waiting time of the current channel, the current time threshold and the dynamic priority related in this embodiment may refer to the description of the related content above, and is not described herein again.
According to the method, the priority scheduling channel can be called only when the dynamic priority of the task reaches the preset value and the two conditions that the average scheduling waiting time of the current channel is greater than the current time threshold are met, and the method can accurately evaluate the scheduling waiting time of the task from two dimensions (the current time threshold and the dynamic priority) and call the task with overlong scheduling waiting time into the priority scheduling channel for priority scheduling. The method of this embodiment may enable relatively fair scheduling.
In one embodiment, each of the task scheduling methods described above may include: and if the current processor resource cannot meet the current task of the priority scheduling channel, performing blocking processing on the task of the common scheduling channel so as to enable the computing resource to meet the current task of the priority scheduling channel.
The present embodiment ensures that the task of the priority scheduling channel can be scheduled preferentially by blocking the task of the normal scheduling channel so that the current processor resource can satisfy the current task of the priority scheduling channel.
It should be noted that the task scheduling method in the present disclosure may be applied to task scheduling of an artificial intelligence processor, so that the artificial intelligence processor can reasonably and evenly process each task. The task scheduling method in the disclosure overcomes the problem that fair scheduling is difficult to realize due to too many reference scheduling factors (affinity, task scale and the like) when an artificial intelligent processor performs task scheduling in the prior art.
It should be understood that although the various steps in the flow charts of fig. 2-6 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-6 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 7, there is provided a task scheduling apparatus including:
a memory 710, configured to provide a storage space for a common scheduling channel and a priority scheduling channel, where a task in the common scheduling channel is scheduled after all tasks in the priority scheduling channel are scheduled;
the equalizing circuit 720 is configured to, if the average scheduling waiting time of the current channel of the ordinary scheduling channel is greater than the current time threshold, call the target task in the ordinary scheduling channel from the ordinary scheduling channel to the priority scheduling channel; and if the dynamic priority of the tasks of the common scheduling channel reaches a preset value, the tasks with the dynamic priority reaching the preset value are called into a priority scheduling channel by the common scheduling channel.
In one embodiment, the equalization circuit 720 is configured to determine the current time threshold according to the current scheduling latency of all tasks in the normal scheduling channel.
In one embodiment, the equalizing circuit 720 is configured to calculate, according to the current scheduling waiting time of the task in each of the ordinary scheduling channels, an average scheduling waiting time of the current channel of each of the ordinary scheduling channels; and obtaining the current time threshold according to the average value of the current channel average scheduling waiting time of at least one common scheduling channel.
In one embodiment, the equalizing circuit 720 is configured to determine the dynamic priority of each task in the normal scheduling channel according to the static priority of each task in the normal scheduling channel and the current scheduling latency of the task.
In one embodiment, the dynamic priority is 0, and the equalizing circuit 720 is configured to obtain a scheduling waiting time threshold, a static priority coefficient, a scheduling waiting time coefficient, and a preset duration; calculating the ratio of the scheduling waiting time of each task in the common scheduling channel to the preset time length to obtain a first operation result; calculating the product of the scheduling waiting time coefficient and the first operation result to obtain a second operation result; calculating the product of the static priority coefficient and the static priority to obtain a third operation result; calculating the sum of the scheduling waiting time threshold and the third operation result to obtain a fourth operation result; and taking the difference value of the fourth operation result and the second operation result as the dynamic priority of each task in the corresponding common scheduling channel.
In one embodiment, the equalizing circuit 720 is configured to obtain a task chain table of a priority scheduling channel, and sequentially schedule tasks of the priority scheduling channel according to the task chain table of the priority scheduling channel; and after all the tasks of the priority scheduling channel are scheduled, acquiring a task chain table of a common scheduling channel, and scheduling the tasks of the common scheduling channel according to the task chain table of the common scheduling channel and the state of equipment corresponding to the tasks in the common scheduling channel.
In one embodiment, each static priority corresponds to one task linked list, each task linked list corresponds to one scheduling channel, the scheduling channels include a common scheduling channel and a priority scheduling channel, and the equalizing circuit 620 is configured to schedule tasks of the common scheduling channel in order according to the static priority after all tasks in the priority scheduling channel are scheduled.
An equalization circuit 820 for receiving tasks; acquiring the task priority of the task according to the type and the affinity of the task; and adding the task to the tail of the corresponding task linked list according to the task priority of the task.
And an equalizing circuit 820, configured to perform blocking processing on the task of the ordinary scheduling channel if the current processor resource cannot meet the current task of the priority scheduling channel, so that the computing resource meets the current task of the priority scheduling channel.
In one embodiment, another task scheduling apparatus is provided, including:
the device comprises a memory, a priority scheduling channel and a control unit, wherein the memory is used for providing a storage space for a common scheduling channel and the priority scheduling channel, and tasks in the common scheduling channel are scheduled after all tasks in the priority scheduling channel are scheduled;
and the equalizing circuit is used for acquiring the dynamic priority of each task in the ordinary scheduling channel if the average scheduling waiting time of the current channel of the ordinary scheduling channel is greater than the current time threshold, and scheduling the target task into a priority scheduling channel from the ordinary scheduling channel if the dynamic priority of the target task reaches a target task with a preset value in the ordinary scheduling channel.
In one embodiment, another task scheduling apparatus is provided, including:
the device comprises a memory, a priority scheduling channel and a control unit, wherein the memory is used for providing a storage space for a common scheduling channel and the priority scheduling channel, and tasks in the common scheduling channel are scheduled after all tasks in the priority scheduling channel are scheduled;
the equalization circuit is used for acquiring the current channel average scheduling waiting time of the common scheduling channel where the tasks with the dynamic priorities reaching the preset values are located if the dynamic priorities of the tasks in the common scheduling channel reach the preset values; and if the average scheduling waiting time of the current channel is greater than the current time threshold, the task with the dynamic priority reaching the preset value is called into a priority scheduling channel from the common scheduling channel.
For specific limitations of the task scheduling device, reference may be made to the above limitations of the task scheduling method, which is not described herein again. The modules in the task scheduling device can be implemented in whole or in part by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 8. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of task scheduling. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 8 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program: if the average scheduling waiting time of the current channel of a certain common scheduling channel is greater than the current time threshold, the target task in the certain common scheduling channel is scheduled to a priority scheduling channel from the common scheduling channel; and/or if the dynamic priority of the task of the common scheduling channel reaches a preset value, the task of which the dynamic priority reaches the preset value is called into a priority scheduling channel by the common scheduling channel; and scheduling all tasks in the priority scheduling channel after the tasks in the common scheduling channel are scheduled.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and determining the current time threshold according to the current scheduling waiting time of all tasks in the common scheduling channel.
In one embodiment, the processor, when executing the computer program, further performs the steps of: calculating the current channel average scheduling waiting time of each common scheduling channel according to the current scheduling waiting time of the tasks in each common scheduling channel; and obtaining the current time threshold according to the average value of the current channel average scheduling waiting time of at least one common scheduling channel.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and determining the dynamic priority of each task in the ordinary scheduling channel according to the static priority of each task in the ordinary scheduling channel and the current scheduling waiting time of the task.
In one embodiment, the dynamic priority is 0, and the processor executes the computer program to specifically implement the following steps: acquiring a scheduling waiting time threshold, a static priority coefficient, a scheduling waiting time coefficient and a preset duration; calculating the ratio of the scheduling waiting time of each task in the common scheduling channel to the preset time length to obtain a first operation result; calculating the product of the scheduling waiting time coefficient and the first operation result to obtain a second operation result; calculating the product of the static priority coefficient and the static priority to obtain a third operation result; calculating the sum of the scheduling waiting time threshold and the third operation result to obtain a fourth operation result; and taking the difference value of the fourth operation result and the second operation result as the dynamic priority of each task in the corresponding common scheduling channel.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring a task linked list of a priority scheduling channel, and scheduling tasks of the priority scheduling channel in sequence according to the task linked list of the priority scheduling channel; and after all the tasks of the priority scheduling channel are scheduled, acquiring a task chain table of a common scheduling channel, and scheduling the tasks of the common scheduling channel according to the task chain table of the common scheduling channel and the state of equipment corresponding to the tasks in the common scheduling channel.
In one embodiment, each static priority corresponds to a task linked list, each task linked list corresponds to a scheduling channel, the scheduling channels include a common scheduling channel and a priority scheduling channel, and the processor further implements the following steps when executing the computer program: and after all the tasks in the priority scheduling channel are scheduled, scheduling the tasks of the common scheduling channel according to the static priority.
In one embodiment, the processor, when executing the computer program, further performs the steps of: receiving a task; acquiring the task priority of the task according to the type and the affinity of the task; and adding the task to the tail of the corresponding task linked list according to the task priority of the task.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and if the current processor resource cannot meet the current task of the priority scheduling channel, performing blocking processing on the task of the common scheduling channel so as to enable the computing resource to meet the current task of the priority scheduling channel.
In one embodiment, another computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program: if the average scheduling waiting time of the current channel of a common scheduling channel is greater than the current time threshold, acquiring the dynamic priority of each task in the common scheduling channel, and if the dynamic priority of the target task in the common scheduling channel reaches a preset value, scheduling the target task from the common scheduling channel into a priority scheduling channel; and scheduling all tasks in the priority scheduling channel after the tasks in the common scheduling channel are scheduled.
In one embodiment, another computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program: if the dynamic priority of the task in the common scheduling channel reaches a preset value, acquiring the current channel average scheduling waiting time of the common scheduling channel where the task with the dynamic priority reaching the preset value is located; if the average scheduling waiting time of the current channel is greater than the current time threshold, the task with the dynamic priority reaching the preset value is called into a priority scheduling channel by the common scheduling channel; and scheduling all tasks in the priority scheduling channel after the tasks in the common scheduling channel are scheduled.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: if the average scheduling waiting time of the current channel of a certain common scheduling channel is greater than the current time threshold, the target task in the certain common scheduling channel is scheduled to a priority scheduling channel from the common scheduling channel; if the dynamic priority of the task of the common scheduling channel reaches a preset value, the task of which the dynamic priority reaches the preset value is called into a priority scheduling channel by the common scheduling channel; and scheduling all tasks in the priority scheduling channel after the tasks in the common scheduling channel are scheduled.
In one embodiment, the computer program when executed by the processor further performs the steps of: and determining the current time threshold according to the current scheduling waiting time of all tasks in the common scheduling channel.
In one embodiment, the computer program when executed by the processor further performs the steps of: calculating the current channel average scheduling waiting time of each common scheduling channel according to the current scheduling waiting time of the tasks in each common scheduling channel; and obtaining the current time threshold according to the average value of the current channel average scheduling waiting time of at least one common scheduling channel.
In one embodiment, the computer program when executed by the processor further performs the steps of: and determining the dynamic priority of each task in the ordinary scheduling channel according to the static priority of each task in the ordinary scheduling channel and the current scheduling waiting time of the task.
In an embodiment, the dynamic priority is 0, and the computer program when executed by the processor performs the steps of: acquiring a scheduling waiting time threshold, a static priority coefficient, a scheduling waiting time coefficient and a preset duration; calculating the ratio of the scheduling waiting time of each task in the common scheduling channel to the preset time length to obtain a first operation result; calculating the product of the scheduling waiting time coefficient and the first operation result to obtain a second operation result; calculating the product of the static priority coefficient and the static priority to obtain a third operation result; calculating the sum of the scheduling waiting time threshold and the third operation result to obtain a fourth operation result; and taking the difference value of the fourth operation result and the second operation result as the dynamic priority of each task in the corresponding common scheduling channel.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring a task linked list of a priority scheduling channel, and scheduling tasks of the priority scheduling channel in sequence according to the task linked list of the priority scheduling channel; and after all the tasks of the priority scheduling channel are scheduled, acquiring a task chain table of a common scheduling channel, and scheduling the tasks of the common scheduling channel according to the task chain table of the common scheduling channel and the state of equipment corresponding to the tasks in the common scheduling channel.
In one embodiment, each static priority corresponds to a task linked list, each task linked list corresponds to a scheduling channel, the scheduling channels include a normal scheduling channel and a priority scheduling channel, and the computer program when executed by the processor further implements the following steps: and after all the tasks in the priority scheduling channel are scheduled, scheduling the tasks of the common scheduling channel according to the static priority.
In one embodiment, the computer program when executed by the processor further performs the steps of: receiving a task; acquiring the task priority of the task according to the type and the affinity of the task; and adding the task to the tail of the corresponding task linked list according to the task priority of the task.
In one embodiment, the computer program when executed by the processor further performs the steps of: and if the current processor resource cannot meet the current task of the priority scheduling channel, performing blocking processing on the task of the common scheduling channel so as to enable the computing resource to meet the current task of the priority scheduling channel.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: if the average scheduling waiting time of the current channel of a common scheduling channel is greater than the current time threshold, acquiring the dynamic priority of each task in the common scheduling channel, and if the dynamic priority of the target task in the common scheduling channel reaches a preset value, scheduling the target task from the common scheduling channel into a priority scheduling channel; and scheduling all tasks in the priority scheduling channel after the tasks in the common scheduling channel are scheduled.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: if the dynamic priority of the task in the common scheduling channel reaches a preset value, acquiring the current channel average scheduling waiting time of the common scheduling channel where the task with the dynamic priority reaching the preset value is located; if the average scheduling waiting time of the current channel is greater than the current time threshold, the task with the dynamic priority reaching the preset value is called into a priority scheduling channel by the common scheduling channel; and scheduling all tasks in the priority scheduling channel after the tasks in the common scheduling channel are scheduled.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided by the present disclosure may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present disclosure, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for those skilled in the art, various changes and modifications can be made without departing from the concept of the present disclosure, and these changes and modifications are all within the scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the appended claims.

Claims (16)

1. A method for task scheduling, the method comprising:
if the average scheduling waiting time of the current channel of the common scheduling channel is greater than or equal to the current time threshold, the target task in the common scheduling channel is scheduled to a priority scheduling channel from the common scheduling channel; and/or
If the dynamic priority of the task of the common scheduling channel reaches a preset value, the task of which the dynamic priority reaches the preset value is called into a priority scheduling channel by the common scheduling channel;
and scheduling all tasks in the priority scheduling channel after the tasks in the common scheduling channel are scheduled.
2. The method of claim 1, further comprising:
and determining the current time threshold according to the current scheduling waiting time of all tasks in the common scheduling channel.
3. The method of claim 2, wherein determining the current time threshold based on the current scheduling latency of all tasks in the normal scheduling channel comprises:
calculating the current channel average scheduling waiting time of each common scheduling channel according to the current scheduling waiting time of the tasks in each common scheduling channel;
and determining the current time threshold according to the average value of the current channel average scheduling waiting time of at least one common scheduling channel.
4. The method of claim 1, further comprising:
and determining the dynamic priority of each task in the ordinary scheduling channel according to the static priority of each task in the ordinary scheduling channel and the current scheduling waiting time of the task.
5. The method according to claim 4, wherein the dynamic priority is 0, and determining the dynamic priority of each task in the normal scheduling channel according to the static priority of each task in the normal scheduling channel and the current scheduling latency of the task comprises:
acquiring a scheduling waiting time threshold, a static priority coefficient, a scheduling waiting time coefficient and a preset duration;
calculating the ratio of the scheduling waiting time of each task in the common scheduling channel to the preset time length to obtain a first operation result;
calculating the product of the scheduling waiting time coefficient and the first operation result to obtain a second operation result;
calculating the product of the static priority coefficient and the static priority to obtain a third operation result;
calculating the sum of the scheduling waiting time threshold and the third operation result to obtain a fourth operation result;
and taking the difference value of the fourth operation result and the second operation result as the dynamic priority of each task in the corresponding common scheduling channel.
6. The method of claim 1, further comprising:
acquiring a task linked list of the priority scheduling channel, and scheduling tasks of the priority scheduling channel in sequence according to the task linked list of the priority scheduling channel;
and after all the tasks of the priority scheduling channel are scheduled, acquiring a task chain table of a common scheduling channel, and scheduling the tasks of the common scheduling channel according to the task chain table of the common scheduling channel and the state of equipment corresponding to the tasks in the common scheduling channel.
7. The method of claim 6, wherein each static priority corresponds to a task chain table, each task chain table corresponds to a scheduling channel, and the scheduling channels include a normal scheduling channel and a priority scheduling channel, and the method further comprises:
and after all the tasks in the priority scheduling channel are scheduled, scheduling the tasks of the common scheduling channel according to the static priority.
8. The method of claim 7, further comprising:
receiving a task;
acquiring the task priority of the task according to the type and the affinity of the task;
and adding the task to the tail of the corresponding task linked list according to the task priority of the task.
9. The method of claim 1, further comprising:
and if the current processor resource cannot meet the current task of the priority scheduling channel, performing blocking processing on the task of the common scheduling channel so as to enable the computing resource to meet the current task of the priority scheduling channel.
10. A method of task scheduling, the method comprising:
if the average scheduling waiting time of the current channel of the ordinary scheduling channel is larger than the current time threshold, the dynamic priority of each task in the ordinary scheduling channel is obtained,
if the dynamic priority of the target task in the common scheduling channel reaches a preset value, the target task is called into a priority scheduling channel from the common scheduling channel;
and scheduling all tasks in the priority scheduling channel after the tasks in the common scheduling channel are scheduled.
11. A method of task scheduling, the method comprising:
if the dynamic priority of the task in the common scheduling channel reaches a preset value, acquiring the current channel average scheduling waiting time of the common scheduling channel where the task with the dynamic priority reaching the preset value is located;
if the average scheduling waiting time of the current channel is greater than the current time threshold, the task with the dynamic priority reaching the preset value is called into a priority scheduling channel by the common scheduling channel;
and scheduling all tasks in the priority scheduling channel after the tasks in the common scheduling channel are scheduled.
12. A task scheduling apparatus, characterized in that the apparatus comprises:
the device comprises a memory, a priority scheduling channel and a control unit, wherein the memory is used for providing a storage space for a common scheduling channel and the priority scheduling channel, and tasks in the common scheduling channel are scheduled after all tasks in the priority scheduling channel are scheduled;
the equalizing circuit is used for transferring the target task in the ordinary scheduling channel from the ordinary scheduling channel to a priority scheduling channel if the average scheduling waiting time of the current channel of the ordinary scheduling channel is greater than the current time threshold; and if the dynamic priority of the tasks of the common scheduling channel reaches a preset value, the tasks with the dynamic priority reaching the preset value are called into a priority scheduling channel by the common scheduling channel.
13. A task scheduling apparatus, characterized in that the apparatus comprises:
the device comprises a memory, a priority scheduling channel and a control unit, wherein the memory is used for providing a storage space for a common scheduling channel and the priority scheduling channel, and tasks in the common scheduling channel are scheduled after all tasks in the priority scheduling channel are scheduled;
and the equalizing circuit is used for acquiring the dynamic priority of each task in the ordinary scheduling channel if the average scheduling waiting time of the current channel of the ordinary scheduling channel is greater than the current time threshold, and scheduling the target task into a priority scheduling channel from the ordinary scheduling channel if the dynamic priority of the target task reaches a target task with a preset value in the ordinary scheduling channel.
14. A task scheduling apparatus, characterized in that the apparatus comprises:
the device comprises a memory, a priority scheduling channel and a control unit, wherein the memory is used for providing a storage space for a common scheduling channel and the priority scheduling channel, and tasks in the common scheduling channel are scheduled after all tasks in the priority scheduling channel are scheduled;
the equalization circuit is used for acquiring the current channel average scheduling waiting time of the common scheduling channel where the tasks with the dynamic priorities reaching the preset values are located if the dynamic priorities of the tasks in the common scheduling channel reach the preset values; and if the average scheduling waiting time of the current channel is greater than the current time threshold, the task is transferred from the common scheduling channel to a priority scheduling channel.
15. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 11 are implemented by the processor when executing the computer program.
16. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 11.
CN202010101962.1A 2020-02-19 2020-02-19 Task scheduling method and device, computer equipment and storage medium Pending CN113282381A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010101962.1A CN113282381A (en) 2020-02-19 2020-02-19 Task scheduling method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010101962.1A CN113282381A (en) 2020-02-19 2020-02-19 Task scheduling method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113282381A true CN113282381A (en) 2021-08-20

Family

ID=77275213

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010101962.1A Pending CN113282381A (en) 2020-02-19 2020-02-19 Task scheduling method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113282381A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114510327A (en) * 2022-01-07 2022-05-17 中汽创智科技有限公司 Method and device for dynamically adjusting priority
CN116700913A (en) * 2022-09-13 2023-09-05 荣耀终端有限公司 Scheduling method, equipment and storage medium of embedded file system
WO2024032783A1 (en) * 2022-08-11 2024-02-15 北京有竹居网络技术有限公司 Task scheduling method and electronic device
CN117806807A (en) * 2024-02-29 2024-04-02 双一力(宁波)电池有限公司 Task scheduling method, device, electronic equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739293A (en) * 2009-12-24 2010-06-16 航天恒星科技有限公司 Method for scheduling satellite data product production tasks in parallel based on multithread
CN103400065A (en) * 2013-07-03 2013-11-20 山东省计算中心 License dynamic predicting and scheduling method based on data statistics
CN109885394A (en) * 2019-01-11 2019-06-14 中国船舶重工集团公司第七二四研究所 A kind of priority dynamic decision model of rotating phased array radar polymorphic type task
CN110427256A (en) * 2019-07-23 2019-11-08 中南民族大学 Job scheduling optimization method, equipment, storage medium and device priority-based

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739293A (en) * 2009-12-24 2010-06-16 航天恒星科技有限公司 Method for scheduling satellite data product production tasks in parallel based on multithread
CN103400065A (en) * 2013-07-03 2013-11-20 山东省计算中心 License dynamic predicting and scheduling method based on data statistics
CN109885394A (en) * 2019-01-11 2019-06-14 中国船舶重工集团公司第七二四研究所 A kind of priority dynamic decision model of rotating phased array radar polymorphic type task
CN110427256A (en) * 2019-07-23 2019-11-08 中南民族大学 Job scheduling optimization method, equipment, storage medium and device priority-based

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
李薛剑等: "一种基于动态优先级的RQ作业调度算法", 《小型微型计算机系统》, vol. 38, no. 01, pages 2 *
胡志刚等: "基于平均等待时间约束的松弛预留机制", 《计算机工程》, vol. 38, no. 10, pages 1 - 2 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114510327A (en) * 2022-01-07 2022-05-17 中汽创智科技有限公司 Method and device for dynamically adjusting priority
CN114510327B (en) * 2022-01-07 2023-12-22 中汽创智科技有限公司 Dynamic priority adjustment method and device
WO2024032783A1 (en) * 2022-08-11 2024-02-15 北京有竹居网络技术有限公司 Task scheduling method and electronic device
CN116700913A (en) * 2022-09-13 2023-09-05 荣耀终端有限公司 Scheduling method, equipment and storage medium of embedded file system
CN117806807A (en) * 2024-02-29 2024-04-02 双一力(宁波)电池有限公司 Task scheduling method, device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN113282381A (en) Task scheduling method and device, computer equipment and storage medium
US10908954B2 (en) Quality of service classes
US8020161B2 (en) Method and system for the dynamic scheduling of a stream of computing jobs based on priority and trigger threshold
CN112214319B (en) Task scheduling method for sensing computing resources
CN107193655B (en) Big data processing-oriented fair resource scheduling method based on utility function
CN111897637B (en) Job scheduling method, device, host and storage medium
US10271326B2 (en) Scheduling function calls
CN110554921A (en) Time slice distribution method and device, storage medium and computer equipment
Liu et al. Elastic job bundling: An adaptive resource request strategy for large-scale parallel applications
Yu et al. Communication-aware application mapping and scheduling for NoC-based MPSoCs
CN111488210A (en) Task scheduling method and device based on cloud computing and computer equipment
Choi et al. An enhanced data-locality-aware task scheduling algorithm for hadoop applications
CN109783236B (en) Method and apparatus for outputting information
CN113765949A (en) Resource allocation method and device
CN114327894A (en) Resource allocation method, device, electronic equipment and storage medium
US20050182747A1 (en) Method and system for executing multiple tasks at adaptively controlled resource utilization rates to achieve equal QoS levels
CN112579271A (en) Real-time task scheduling method, module, terminal and storage medium for non-real-time operating system
CN112817722A (en) Time-sharing scheduling method based on priority, terminal and storage medium
CN115309519A (en) Deterministic task scheduling and arranging method and system based on time trigger mechanism and storage medium
CN114661415A (en) Scheduling method and computer system
CN111176815B (en) Task scheduling method and device of operating system
CN109062707B (en) Electronic device, method for limiting inter-process communication thereof and storage medium
Hikmet et al. Mixed-criticality systems as a service for non-critical tasks
CN108009074B (en) Multi-core system real-time evaluation method based on model and dynamic analysis
Wu et al. Weakly hard real-time scheduling algorithm for multimedia embedded system on multiprocessor platform

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination