CN111767134A - Multitask dynamic resource scheduling method - Google Patents

Multitask dynamic resource scheduling method Download PDF

Info

Publication number
CN111767134A
CN111767134A CN202010419223.7A CN202010419223A CN111767134A CN 111767134 A CN111767134 A CN 111767134A CN 202010419223 A CN202010419223 A CN 202010419223A CN 111767134 A CN111767134 A CN 111767134A
Authority
CN
China
Prior art keywords
task
priority
candidate
resources
running
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
CN202010419223.7A
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.)
Southwest University of Science and Technology
Peng Cheng Laboratory
Southern University of Science and Technology
Original Assignee
Southwest University of Science and Technology
Peng Cheng Laboratory
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 Southwest University of Science and Technology, Peng Cheng Laboratory filed Critical Southwest University of Science and Technology
Priority to CN202010419223.7A priority Critical patent/CN111767134A/en
Publication of CN111767134A publication Critical patent/CN111767134A/en
Priority to PCT/CN2021/094170 priority patent/WO2021233261A1/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/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
    • 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 invention discloses a multi-task dynamic resource scheduling method, when a new task is received, a candidate task corresponding to the new task is selected from all running tasks, and the priority corresponding to each running task is determined based on the running duration of each running task; determining an adjustment resource corresponding to each candidate task according to the system allocation resource corresponding to the new task; and adjusting the distributed resources corresponding to each candidate task according to the adjusted resources of each candidate task, and distributing the adjusted system resources to the new task. In the embodiment, a dynamic resource scheduling mechanism based on the executed time of the task is realized by using a containerized resource isolation mode, so that the time required by the task to run does not need to be predicted in advance, dynamic priorities are set for different tasks according to the executed time of the task, more resources are allocated to the tasks with higher priorities, otherwise, the allocated resources are reduced, the completion of the long task is ensured on the premise of reducing the completion time of the short task, and the overall resource utilization rate is improved.

Description

Multitask dynamic resource scheduling method
Technical Field
The invention relates to the technical field of data processing, in particular to a multi-task dynamic resource scheduling method.
Background
One computing requirement in a large data processing platform is generally decomposed into a plurality of computing tasks, and the results of the plurality of computing tasks jointly form a final processing result. The completion time of the calculation requirement and the resource utilization efficiency of the whole big data processing platform are determined by the scheduling modes of different calculation tasks in two dimensions of time and resources. In order to meet the demand of calculating demand on time scheduling, a method for predicting task duration is generally adopted at present, so that although a scheduling algorithm based on the predicted task duration can ensure the completion time of a short task, the scheduling algorithm depends on the advance prediction of the task, and the prediction readiness cannot be ensured, thereby causing the failure of the time scheduling algorithm; in addition, the algorithm based on prediction is complex to implement and brings large overhead.
Thus, the prior art has yet to be improved and enhanced.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method for scheduling multi-task dynamic resources, aiming at the defects of the prior art.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows:
a method of multitasking dynamic resource scheduling, the method comprising:
when a new task is received, selecting a candidate task corresponding to the new task from all running tasks, wherein the priority corresponding to the candidate task is in a preset priority interval, and the priority corresponding to each running task is determined based on the running duration of each running task;
determining adjustment resources corresponding to the candidate tasks according to system allocation resources corresponding to the new task;
and respectively adjusting the distributed resources corresponding to the candidate tasks according to the respective adjusted resources corresponding to the candidate tasks, and distributing the adjusted system resources to the new tasks.
In one implementation, when a new task is received, the method specifically includes, according to all candidate tasks corresponding to the new task:
when a new task is received, acquiring idle resources of the system;
if the idle resources do not meet the system allocation resources, all candidate tasks corresponding to the new task are determined;
and if the idle resources meet the system allocation resources, allocating resources for the new task based on the idle resources.
In one implementation manner, the priority corresponding to the lower limit value of the preset priority interval is lower than the preset highest priority, and the priority corresponding to the upper limit value is equal to the preset lowest priority.
In one implementation, the determining, according to the system allocation resource corresponding to the new task, the adjustment resource corresponding to each candidate task specifically includes:
determining candidate resources corresponding to each candidate priority in a preset priority interval according to system allocation resources corresponding to the new task;
and for each candidate priority, determining the adjustment resource corresponding to each candidate task corresponding to the candidate priority according to the candidate resource corresponding to the candidate priority.
In one implementation, for each candidate priority, the candidate resource corresponding to the candidate priority is equal to a product of a target value and the system allocation resource, where the target value is a ratio of the candidate level to a sum of candidate priorities in a preset priority interval.
In one implementation, the priority level corresponding to the new task is the highest priority level.
In one implementation, the method further comprises:
every preset time interval, acquiring all running tasks corresponding to each comparison priority, wherein the comparison priority is other than the lowest priority in all priorities;
and for each comparison priority, reducing the priority corresponding to each running task corresponding to the comparison priority by one level.
In one implementation, the method further comprises:
and for the lowest priority, keeping the priority corresponding to each running task corresponding to the lowest priority unchanged.
A computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to perform the steps in the method for multitasking dynamic resource scheduling as described in any above.
A server, comprising: a processor, a memory, and a communication bus; the memory has stored thereon a computer readable program executable by the processor;
the communication bus realizes connection communication between the processor and the memory;
the processor, when executing the computer readable program, implements the steps in the method for multitasking dynamic resource scheduling as described in any of the above.
Has the advantages that: compared with the prior art, the invention provides a multi-task dynamic resource scheduling method, when a new task is received, a candidate task corresponding to the new task is selected from all running tasks, and the priority corresponding to each running task is determined based on the running duration of each running task; determining adjustment resources corresponding to the candidate tasks according to system allocation resources corresponding to the new task; the distributed resources corresponding to the candidate tasks are respectively regulated according to the regulated resources corresponding to the candidate tasks, and the regulated system resources are distributed to the new tasks by utilizing a containerized resource isolation mode, so that a dynamic resource scheduling mechanism based on the executed time of the tasks is realized, the time required by the running of the tasks does not need to be predicted in advance, dynamic priorities are set for different tasks according to the executed time of the tasks, more resources are distributed to the tasks with high priorities, otherwise, the distributed resources are reduced, the completion of the long tasks is ensured on the premise of reducing the completion time of the short tasks, and the overall resource utilization rate is improved.
Drawings
Fig. 1 is a flowchart of a method for scheduling multi-task dynamic resources according to the present invention.
Fig. 2 is a schematic flow chart of a multi-task dynamic resource scheduling method provided by the present invention.
Fig. 3 is a schematic diagram illustrating a correspondence between priorities and running durations in the multi-task dynamic resource scheduling method provided by the present invention.
Fig. 4 is a schematic structural diagram of a server according to the present invention.
Detailed Description
The present invention provides a method for scheduling multi-task dynamic resources, which is described in further detail below with reference to the accompanying drawings and examples in order to make the objects, technical schemes, and effects of the present invention clearer and clearer. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The inventor finds that the computing requirement in a large data processing platform can be generally decomposed into a plurality of computing tasks, and the results of the plurality of computing tasks jointly form a final processing result. Therefore, the completion time of the calculation requirement and the resource utilization efficiency of the whole big data processing platform are determined by the scheduling modes of different calculation tasks on two dimensions of time and resources. In the aspect of time scheduling, most task scheduling algorithms predict the completion time of a certain task in advance, a long task with longer completion time and a short task with shorter completion time, and the completion time of the short task and the long task is reduced as far as possible. Therefore, this brings with it the scheduling requirements for multitasking in big data processing: the number of tasks scheduled in unit time is large, short tasks can be scheduled more quickly than long tasks, and the overhead of a scheduling algorithm is as small as possible.
In order to meet the requirement of scheduling multiple tasks in big data processing, execute a short task first and ensure the completion time of the short task, currently, a method for predicting the task duration and a least service priority (LAS) algorithm are commonly used. The method for predicting the task duration mainly comprises the steps that although the scheduling algorithm based on the task duration prediction can guarantee the completion time of a short task, the scheduling algorithm depends on the advance prediction of the task, the prediction preparation degree cannot be guaranteed, and once the prediction is inaccurate, the time scheduling algorithm is often disabled; in addition, the algorithm based on prediction is complex to implement and brings large overhead.
The least service priority (LAS) algorithm acquires the least resources for the new task, has the highest priority, and schedules the new task preferentially. The LAS does not need to predict the completion time of the task, defaults that the latest task has the highest priority and schedules preferentially; and when the resources are insufficient, stopping running the task with the longest completion time, and giving up the resources to a new task. The LAS algorithm can better guarantee the short task completion time without predicting the task completion time in advance. The problems with the LAS algorithm are: the distributed resources are not scheduled, and each task is distributed with fixed resources in the execution process, so that the resource use of long tasks cannot be guaranteed.
In addition, in terms of resource scheduling, specific computing and storage resources need to be allocated to different tasks, and execution of the tasks is guaranteed. The container is a light-weight resource isolation mechanism, and programs running in the container can only use allocated priority resources. The task is executed in a container in a containerization mode, the execution period of the whole task is in the container, and the allocated computing and storage resources are used. The containerized operation mode makes it possible to allocate different tasks with specific resource and to regulate the allocated resource dynamically based on the operation condition. However, the current resource scheduling method based on the container is also based on the prediction of task completion time, so that the scheduling complexity and the failure risk are improved, the resources are not flexibly adjusted and allocated according to the real-time state of task operation, and the resource utilization rate is low.
In order to solve the above problem, in the embodiment of the present invention, when a new task is received, a candidate task corresponding to the new task is selected from all running tasks, where a priority corresponding to the candidate task is within a preset priority interval, and the priority corresponding to each running task is determined based on a running duration of each running task; determining adjustment resources corresponding to the candidate tasks according to system allocation resources corresponding to the new task; and respectively adjusting the distributed resources corresponding to the candidate tasks according to the respective adjusted resources corresponding to the candidate tasks, and distributing the adjusted system resources to the new tasks. Therefore, in the embodiment of the invention, a dynamic resource scheduling mechanism based on the executed time of the task is realized by utilizing a containerization resource isolation mode, so that the time required by the task operation does not need to be predicted in advance, dynamic priorities are set for different tasks according to the executed time of the task, more resources are allocated to the tasks with high priorities, otherwise, the allocated resources are reduced, the completion of the long task is ensured on the premise of reducing the completion time of the short task, and the overall resource utilization rate is improved.
The multitask dynamic resource scheduling method provided by the embodiment can be executed by multitask dynamic resource scheduling, and the device can be implemented by software and applied to an intelligent terminal such as a server, a PC, a personal digital assistant and the like which is provided with an operating system. Referring to fig. 1 and fig. 2, the method for scheduling a multi-task dynamic resource provided in this embodiment specifically includes:
and S10, when a new task is received, selecting a candidate task corresponding to the new task from all running tasks.
Specifically, the new task is a task without system resource allocation, the running task is a task which has system resource allocation and runs in the system, the candidate task is a part of the running task, and the priority corresponding to the candidate task is included in a preset priority interval. For example, the preset priority interval is 3-8, the priority corresponding to the running task a is 2, and the priority corresponding to the running task B is 4, so that the running task B is a candidate task corresponding to the new task, and the running task a is not a candidate task corresponding to the new task.
Further, as shown in fig. 3, each running task is configured with a priority in advance, the priority corresponding to each running task is determined according to the running time length corresponding to each running task, and the priority corresponding to each running task changes according to the change of the running time length of the running task. Thus, for each new task that has not yet been run in the system, the run time of the new task is 0, thereby setting the priority corresponding to the new task to the highest priority. In addition, the corresponding relation between the priority and the running time length is as follows: the priority decreases as the length of the run increases. That is, the longer the running time corresponding to the running task is, the lower the priority corresponding to the running task is. For example, when the running time of the running task a is 1 hour and the running time of the running task B is 3 hours, the priority corresponding to the running task B is lower than the priority corresponding to the running task a.
Further, the priority represents the preferred running degree of the running task, and the higher the priority of the running task is, the higher the preferred running degree of the running task is; conversely, the lower the priority of the running task, the lower the preferred running degree of the running task. In an implementation manner of this embodiment, the priority may be limited by a priority level, and the priority level have an inverse relationship, that is, the higher the priority level of the running task is, the lower the priority level corresponding to the running task is; conversely, the smaller the priority of the running task is, the higher the priority level corresponding to the running task is. In a specific implementation manner, the priority levels may be divided into 8 levels, which are respectively denoted as level 1, level 2, level 3, level 4, level 5, level 6, level 7 and level 8, where the priority levels corresponding to the 8 priority levels decrease with the increase of the priority levels, so that the priority level corresponding to the level 1 is the highest, and the priority level corresponding to the level 8 is the lowest. In addition, the preset priority interval is set according to a preset priority level, wherein an upper limit value and a lower limit value of the preset priority interval are both one of the preset priority levels, the priority corresponding to the lower limit value of the preset priority interval is lower than the preset highest priority level, and the priority corresponding to the upper limit value is equal to the preset lowest priority level. For example, the priority corresponding to the lower limit value of the preset priority interval is lower than the priority corresponding to the third priority, and the upper limit value is the priority corresponding to the preset lowest priority, that is, the preset priority interval is [3,8 ].
Further, in an implementation manner of this embodiment, the priority is dynamically adjusted according to the running duration, and the dynamic adjustment process may be:
a10, acquiring all running tasks corresponding to each comparison priority every preset time, wherein the comparison priorities are other priorities except the lowest priority in all priorities;
a20, for each comparison priority, reducing the priority corresponding to each running task corresponding to the comparison priority by one level;
and A30, keeping the priority corresponding to each running task corresponding to the lowest priority unchanged for the lowest priority.
Specifically, the preset time is used for determining the starting time of the dynamic priority adjustment. The preset time may be preset according to an actual use condition (e.g., 1 hour, etc.), or may be an interval time (e.g., an average value of the interval times, etc.) of a new task arriving within a preset time period, where the preset time period is preset (e.g., 1 month, etc.). In an implementation manner of this embodiment, the preset time is an interval time of arrival of a new task within a preset time period, and if an arrival interval of the new task is small, the priority adjustment interval is also small, otherwise, if the arrival interval of the new task is large, the priority adjustment interval is also small and large. Therefore, the time interval of reaching the new task in the preset time period is associated with the dynamic regulation time of the priority, if the incoming frequency of the new task is faster, the smaller the preset time is, the faster the priority of the task is, and more resources can be adjusted to the new task. In addition, the preset time is determined according to the time interval of the arrival of the new task in the preset time period, so that the problems that the resource adjustment frequency is insufficient due to overlarge preset time, the priority setting effect is small, the task priority changes rapidly due to the overlong preset time, the task quickly reaches the lowest priority, and the scientific distribution of the task on the priority is not facilitated are solved.
Further, after the preset time is determined, the preset time is stored in the system, when the priority of the running task needs to be dynamically adjusted, the system can directly read the preset time, the preset time is set as the activation time of the dynamic adjustment priority, and when the time interval between the current time and the previous dynamic adjustment time reaches the preset time, the priority corresponding to the running task is adjusted. In an implementation manner of this embodiment, the preset time may be 1 hour or the like. Certainly, in practical application, a timer may be set, the timer is configured with the preset time, when the initial working time of the timer is the system starting time, then when the timer times out, all running tasks corresponding to each comparison priority are acquired, and when the dynamic adjustment of the priority is completed, the timer is cleared, so as to record the adjustment interval time.
All the priorities are divided into comparison priorities and lowest priorities, wherein the comparison priorities are the rest of the priorities except the lowest priority. For example, in the above implementation, 8-level priority levels are set, and then the lowest priority level is the eighth priority level; the comparison priority is the first to seventh priority levels. For each comparison priority, the priority of all running tasks corresponding to the comparison priority is reduced by one level, namely the priority of all running tasks corresponding to the comparison priority is increased by 1. For example, for each running task corresponding to the third priority level, the priority level corresponding to the running task is adjusted to the fourth mailbox level. In addition, it should be noted that, in one dynamic adjustment process, the priorities of the running tasks corresponding to the respective priorities are synchronously adjusted, and the priority of each running task is adjusted only once. For example, in the one-time dynamic adjustment process, for the running task a adjusted from the third priority level to the fourth priority level, when the running task corresponding to the fourth priority level is adjusted, the priority level corresponding to the running task a is kept unchanged.
Further, in an implementation manner of this embodiment, when adjusting the running tasks corresponding to each comparison priority, the priority of all the running tasks corresponding to each comparison priority may be reduced by one level, so that the speed of dynamic priority adjustment and the required system resources may be increased. Of course, the priorities of all the running tasks corresponding to the rest of the contrast priorities except the highest priority can be reduced by one level, and for the running task corresponding to the highest priority, whether the running time of each running task reaches the preset time or not can be detected; for the running task reaching the preset duration, reducing the priority corresponding to the running task by one level; for the running task which does not reach the preset time length, the corresponding priority of the running task is kept unchanged, so that the problem that the running speed of a new task is influenced because the priority of the task which runs for a time length shorter than the preset time length is reduced to the next priority can be avoided.
Further, the receiving of the new task is a trigger instruction for triggering resource adjustment, that is, only when the new task is received, whether the corresponding allocation of each running task needs to be adjusted is determined; when the priority corresponding to each running task is adjusted, the distributed resources corresponding to each running task are unchanged, so that the dynamic adjustment of the priority is separately adjusted from the distributed resources, the distributed resources corresponding to each running task can be better determined, and the waste of system resources is avoided.
Furthermore, upon receiving a new task, it needs to be determined whether the free resources of the system can meet the requirements of the new task. Thus, in an implementation manner of the present embodiment, when a new task is received, all candidate tasks corresponding to the new task specifically include:
s21, when a new task is received, acquiring idle resources of the system;
s22, if the free resources do not meet the system allocation resources, all candidate tasks corresponding to the new task are determined;
and S23, if the idle resources meet the system allocation resources, allocating resources for the new task based on the idle resources.
Specifically, the idle resource refers to a resource that is not used in the system, and the system allocation resource is resource information that is preset by the system and allocated to a new task, for example, the preset allocation resource of the system is 4-core CPU and 2MB memory. After receiving the new task, detecting whether the CPU and the memory in the idle resource both meet the system allocation resource, if both meet the system allocation resource, directly allocating a part of resources in the idle resource to the new task so as to allocate the new task to the corresponding system allocation resource amount; and if the resources which do not meet the system allocation resources exist, all candidate tasks corresponding to the new task are determined.
And S20, determining the adjustment resources corresponding to the candidate tasks according to the system allocation resources corresponding to the new task.
Specifically, the adjusted resource is a system resource that needs to be reduced for each candidate task, and it can be understood that the resource allocation corresponding to the candidate task needs to reduce the resource quantity corresponding to the adjusted resource, so that the resource quantity released by each candidate task can meet the requirement of a new task. In addition, the adjustment resources corresponding to the acquired candidate tasks may be determined according to the priorities corresponding to the candidate tasks, for example, the lower the priority of the candidate task is, the more the adjustment resources are corresponding to. Correspondingly, in an implementation manner of this embodiment, the determining, according to the system allocation resource corresponding to the new task, the adjustment resource corresponding to each candidate task specifically includes:
s21, determining candidate resources corresponding to each candidate priority in a preset priority interval according to system allocation resources corresponding to the new task;
and S22, for each candidate priority, determining the adjustment resource corresponding to each candidate task corresponding to the candidate priority according to the candidate resource corresponding to the candidate priority.
Specifically, the candidate resource is the number of resources that need to be allocated for each candidate priority, where the candidate resources corresponding to each candidate priority may be the same or different. In an implementation manner of this embodiment, the candidate resources corresponding to each candidate priority are different, and each candidate resource is determined according to the system allocation resource corresponding to the new task and the candidate priority, where in each candidate priority, the candidate resource corresponding to the candidate priority is equal to a product of a target value and the system allocation resource, and the target value is a ratio of the candidate level to a sum of the candidate priorities in a preset priority interval. Thus, the calculation formula of the candidate resource may be:
Figure BDA0002496289880000101
wherein S is the number of candidate resources, M is the number of resources allocated to the system corresponding to the new task, a is a lower limit value of a preset priority interval, a is a positive integer (e.g., 3, etc.), n is an upper limit value of the preset priority interval (e.g., 8, etc.), i is a positive integer from a to n, and X represents a priority level corresponding to one candidate priority in the preset priority interval.
Of course, it is noted that the calculation formula of the candidate resource is to perform a separate operation on each allocated resource in the system allocated resources, for example, the system allocated resources include a CPU and a memory, and then the candidate resource corresponding to the CPU and the candidate resource corresponding to the memory are calculated respectively.
Further, after the candidate resources corresponding to the candidate priorities are obtained, the adjustment resources corresponding to the candidate tasks corresponding to the candidate priorities are determined, wherein the number of the adjustment resources corresponding to the candidate tasks corresponding to the same candidate priority is the same. Thus, for each candidate priority, the calculation formula of the adjustment resource corresponding to each candidate task corresponding to the candidate priority may be:
Figure BDA0002496289880000102
wherein S is the number of candidate resources, M is the number of system allocation resources corresponding to the new task, a is a lower limit value of a preset priority interval, a is a positive integer (e.g., 3, etc.), n is an upper limit value of the preset priority interval (e.g., 8, etc.), i is a positive integer from a to n, X represents the priority level corresponding to the candidate priority, and Y is the number of tasks of the candidate task corresponding to the candidate priority.
Based on the above method for acquiring the adjusted resources, the total resources obtained by the adjustment just meet the system allocation resources M required to be allocated by the new task, and the task with the later priority needs to make up more resources, so that the task with the later priority can enjoy the adjustment principle of less resources.
And S30, respectively adjusting the distributed resources corresponding to the candidate tasks according to the adjusted resources corresponding to the candidate tasks, and distributing the adjusted system resources to the new tasks.
Specifically, after the adjustment resources corresponding to each candidate task are obtained, the use parameters of the resources in the preset container are adjusted, the allocation resources corresponding to each candidate task are adjusted to form idle resources, the idle resources obtained through adjustment are allocated to the new task, and the new task is executed through the system resources allocated to the new task.
To further illustrate the multitask allocation method in the present embodiment, a specific example is given below for explanation.
For example, the following steps are carried out: firstly, after a new task a arrives, the priority level corresponding to the priority level of the new task is set to be 1, and the new task is scheduled to determine that the computing resource needing to be allocated to the new task is a 2-core CPU. Secondly, judging whether idle resources of the 2-core CPU exist at present or not, and if so, judging whether idle resources of the 2-core CPU existScheduling is performed immediately, if the computing resources of the existing task are not adjusted. Wherein, the adjustment process of the computing resources is that a company is calculated according to the adjusted resources, assuming that the number of tasks with the priority level of 8 is 4
Figure BDA0002496289880000111
It can be seen that for a task with a priority level of 8, X is 8, n is 8, M is 2, Y is 4, then 4/33 should be decremented for each task with a priority level of 8; assuming that the number of tasks with the priority level of 7 is 4, for the tasks with the priority level of 7, X is 7, n is 8, M is 2, Y is 4, and each task with the priority level of 7 should be reduced by 3.5/33; assuming that the number of tasks with a priority level of 6 is 4, for a task with a priority level of 6, X is 6, n is 8, M is 2, Y is 4, each task with a priority level of 6 should be decreased 3/33. In turn, the number of resources that should be reduced for tasks with task priorities of 5, 4, and 3 can be computed, and all of the reduced resources should be 2-core CPUs. And after each task releases the corresponding resource, scheduling the task a.
Based on the above multitasking dynamic resource scheduling method, the embodiment provides a computer readable storage medium, where one or more programs are stored, and the one or more programs may be executed by one or more processors to implement the steps in the multitasking dynamic resource scheduling method according to the above embodiment.
Based on the above multi-task dynamic resource scheduling method, the present invention further provides a server, as shown in fig. 4, which includes at least one processor (processor) 20; a display screen 21; and a memory (memory)22, and may further include a communication Interface (Communications Interface)23 and a bus 24. The processor 20, the display 21, the memory 22 and the communication interface 23 can communicate with each other through the bus 24. The display screen 21 is configured to display a user guidance interface preset in the initial setting mode. The communication interface 23 may transmit information. The processor 20 may call logic instructions in the memory 22 to perform the methods in the embodiments described above.
Furthermore, the logic instructions in the memory 22 may be implemented in software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product.
The memory 22, which is a computer-readable storage medium, may be configured to store a software program, a computer-executable program, such as program instructions or modules corresponding to the methods in the embodiments of the present disclosure. The processor 20 executes the functional application and data processing, i.e. implements the method in the above-described embodiments, by executing the software program, instructions or modules stored in the memory 22.
The memory 22 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the server, and the like. Further, the memory 22 may include a high speed random access memory and may also include a non-volatile memory. For example, a variety of media that can store program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, may also be transient storage media.
In addition, the specific processes loaded and executed by the instruction processors in the storage medium and the server are described in detail in the method, and are not stated herein.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A multitask dynamic resource scheduling method, characterized in that the method comprises:
when a new task is received, selecting a candidate task corresponding to the new task from all running tasks, wherein the priority corresponding to the candidate task is in a preset priority interval, and the priority corresponding to each running task is determined based on the running duration of each running task;
determining adjustment resources corresponding to the candidate tasks according to system allocation resources corresponding to the new task;
and respectively adjusting the distributed resources corresponding to the candidate tasks according to the respective adjusted resources corresponding to the candidate tasks, and distributing the adjusted system resources to the new tasks.
2. The multitask dynamic resource scheduling method according to claim 1, wherein when a new task is received, the method specifically includes, according to all candidate tasks corresponding to the new task:
when a new task is received, acquiring idle resources of the system;
if the idle resources do not meet the system allocation resources, all candidate tasks corresponding to the new task are determined;
and if the idle resources meet the system allocation resources, allocating resources for the new task based on the idle resources.
3. The multitask dynamic resource scheduling method according to claim 1, wherein the priority corresponding to the lower limit value of the preset priority interval is lower than a preset highest priority, and the priority corresponding to the upper limit value is equal to a preset lowest priority.
4. The method of claim 1, wherein the determining the adjusted resources corresponding to each candidate task according to the system allocation resources corresponding to the new task specifically comprises:
determining candidate resources corresponding to each candidate priority in a preset priority interval according to system allocation resources corresponding to the new task;
and for each candidate priority, determining the adjustment resource corresponding to each candidate task corresponding to the candidate priority according to the candidate resource corresponding to the candidate priority.
5. The multitask dynamic resource scheduling method according to claim 4, wherein for each candidate priority, the candidate resource corresponding to the candidate priority is equal to the product of a target value and the system allocation resource, wherein the target value is the ratio of the candidate level and the sum of the candidate priorities in a preset priority interval.
6. The method according to any of claims 1-5, wherein the priority level corresponding to the new task is the highest priority level.
7. The multitask dynamic resource scheduling method according to claim 6, wherein the method further comprises:
every preset time interval, acquiring all running tasks corresponding to each comparison priority, wherein the comparison priority is other than the lowest priority in all priorities;
and for each comparison priority, reducing the priority corresponding to each running task corresponding to the comparison priority by one level.
8. The multitask dynamic resource scheduling method according to claim 7, wherein the method further comprises:
and for the lowest priority, keeping the priority corresponding to each running task corresponding to the lowest priority unchanged.
9. A computer readable storage medium, storing one or more programs, which are executable by one or more processors, for performing the steps in the method of multitasking dynamic resource scheduling according to any one of claims 1-8.
10. A server, comprising: a processor, a memory, and a communication bus; the memory has stored thereon a computer readable program executable by the processor;
the communication bus realizes connection communication between the processor and the memory;
the processor, when executing the computer readable program, implements the steps in the method for multitasking dynamic resource scheduling according to any one of claims 1-8.
CN202010419223.7A 2020-05-18 2020-05-18 Multitask dynamic resource scheduling method Pending CN111767134A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010419223.7A CN111767134A (en) 2020-05-18 2020-05-18 Multitask dynamic resource scheduling method
PCT/CN2021/094170 WO2021233261A1 (en) 2020-05-18 2021-05-17 Multi-task dynamic resource scheduling method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010419223.7A CN111767134A (en) 2020-05-18 2020-05-18 Multitask dynamic resource scheduling method

Publications (1)

Publication Number Publication Date
CN111767134A true CN111767134A (en) 2020-10-13

Family

ID=72719268

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010419223.7A Pending CN111767134A (en) 2020-05-18 2020-05-18 Multitask dynamic resource scheduling method

Country Status (2)

Country Link
CN (1) CN111767134A (en)
WO (1) WO2021233261A1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328385A (en) * 2021-01-04 2021-02-05 鹏城实验室 Multi-scene Kubernetes task submission method based on plug-in
CN112348369A (en) * 2020-11-11 2021-02-09 博康智能信息技术有限公司 Multi-target multi-resource dynamic scheduling method for major activity security
CN112817722A (en) * 2021-02-01 2021-05-18 鹏城实验室 Time-sharing scheduling method based on priority, terminal and storage medium
US11099754B1 (en) * 2020-05-14 2021-08-24 EMC IP Holding Company LLC Storage array with dynamic cache memory configuration provisioning based on prediction of input-output operations
WO2021233261A1 (en) * 2020-05-18 2021-11-25 鹏城实验室 Multi-task dynamic resource scheduling method
CN115994023A (en) * 2023-03-23 2023-04-21 鹏城实验室 Visual intelligent system resource information scheduling method, device, terminal and medium
CN117608863B (en) * 2024-01-23 2024-04-23 聊城市洛溪信息科技有限公司 Cloud computing task tracking processing method and system based on intelligent resource allocation

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115022409A (en) * 2022-07-15 2022-09-06 中国工商银行股份有限公司 Micro-service scheduling method and device, computer equipment and storage medium thereof
CN115237604B (en) * 2022-09-19 2023-02-14 中国电子科技集团公司第十四研究所 Real-time resource scheduling method of multi-task radio frequency system
CN116739321B (en) * 2023-08-16 2023-11-14 北京斯年智驾科技有限公司 Transportation task scheduling method and system
CN116781784A (en) * 2023-08-22 2023-09-19 北京智芯微电子科技有限公司 Intelligent terminal resource scheduling method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106033371A (en) * 2015-03-13 2016-10-19 杭州海康威视数字技术股份有限公司 Method and system for dispatching video analysis task
CN109408215A (en) * 2018-11-07 2019-03-01 郑州云海信息技术有限公司 A kind of method for scheduling task and device of calculate node
CN109936604A (en) * 2017-12-18 2019-06-25 北京图森未来科技有限公司 A kind of resource regulating method, device and system
US20190303199A1 (en) * 2018-03-30 2019-10-03 Nec Corporation Information processing apparatus, control method, and program

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100571162C (en) * 2007-07-04 2009-12-16 华为技术有限公司 A kind of resource acceptance control method, system and business application system
US8429657B2 (en) * 2008-04-28 2013-04-23 Oracle International Corporation Global avoidance of hang states via priority inheritance in multi-node computing system
CN101730159B (en) * 2009-01-19 2013-03-27 中兴通讯股份有限公司 Resource admission control method and system thereof
CN108574646A (en) * 2017-03-07 2018-09-25 中兴通讯股份有限公司 A kind of tunnel bandwidth recovery method as resource and device
CN110795234A (en) * 2019-09-25 2020-02-14 苏州浪潮智能科技有限公司 Resource scheduling method and device
CN111767134A (en) * 2020-05-18 2020-10-13 鹏城实验室 Multitask dynamic resource scheduling method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106033371A (en) * 2015-03-13 2016-10-19 杭州海康威视数字技术股份有限公司 Method and system for dispatching video analysis task
CN109936604A (en) * 2017-12-18 2019-06-25 北京图森未来科技有限公司 A kind of resource regulating method, device and system
US20190303199A1 (en) * 2018-03-30 2019-10-03 Nec Corporation Information processing apparatus, control method, and program
CN109408215A (en) * 2018-11-07 2019-03-01 郑州云海信息技术有限公司 A kind of method for scheduling task and device of calculate node

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11099754B1 (en) * 2020-05-14 2021-08-24 EMC IP Holding Company LLC Storage array with dynamic cache memory configuration provisioning based on prediction of input-output operations
WO2021233261A1 (en) * 2020-05-18 2021-11-25 鹏城实验室 Multi-task dynamic resource scheduling method
CN112348369A (en) * 2020-11-11 2021-02-09 博康智能信息技术有限公司 Multi-target multi-resource dynamic scheduling method for major activity security
CN112348369B (en) * 2020-11-11 2024-03-22 博康智能信息技术有限公司 Multi-objective multi-resource dynamic scheduling method for security of major activities
CN112328385A (en) * 2021-01-04 2021-02-05 鹏城实验室 Multi-scene Kubernetes task submission method based on plug-in
CN112328385B (en) * 2021-01-04 2021-04-06 鹏城实验室 Multi-scene Kubernetes task submission method based on plug-in
CN112817722A (en) * 2021-02-01 2021-05-18 鹏城实验室 Time-sharing scheduling method based on priority, terminal and storage medium
CN115994023A (en) * 2023-03-23 2023-04-21 鹏城实验室 Visual intelligent system resource information scheduling method, device, terminal and medium
CN117608863B (en) * 2024-01-23 2024-04-23 聊城市洛溪信息科技有限公司 Cloud computing task tracking processing method and system based on intelligent resource allocation

Also Published As

Publication number Publication date
WO2021233261A1 (en) 2021-11-25

Similar Documents

Publication Publication Date Title
CN111767134A (en) Multitask dynamic resource scheduling method
US11720403B2 (en) System for commitment-aware workload scheduling based on anticipated resource consumption levels
US11582166B2 (en) Systems and methods for provision of a guaranteed batch
US10754706B1 (en) Task scheduling for multiprocessor systems
US9588809B2 (en) Resource-based scheduler
US8997107B2 (en) Elastic scaling for cloud-hosted batch applications
US8959515B2 (en) Task scheduling policy for limited memory systems
US20080086733A1 (en) Computer micro-jobs
US10467054B2 (en) Resource management method and system, and computer storage medium
CN105117285B (en) A kind of nonvolatile memory method for optimizing scheduling based on mobile virtual system
CN112905326B (en) Task processing method and device
CN105955809B (en) Thread scheduling method and system
US20120079494A1 (en) System And Method For Maximizing Data Processing Throughput Via Application Load Adaptive Scheduling And Content Switching
CN114327843A (en) Task scheduling method and device
AU2007261607B2 (en) Resource-based scheduler
CN111597044A (en) Task scheduling method and device, storage medium and electronic equipment
CN112925616A (en) Task allocation method and device, storage medium and electronic equipment
CN110795323A (en) Load statistical method, device, storage medium and electronic equipment
CN109189581B (en) Job scheduling method and device
EP2413240A1 (en) Computer micro-jobs
CN114661415A (en) Scheduling method and computer system
CN109445847B (en) Industrial server microkernel architecture implementation method
CN108268310B (en) Method and device for determining minimum scheduling granularity
CN110968418A (en) Signal-slot-based large-scale constrained concurrent task scheduling method and device
CN116501486A (en) Cluster resource scheduling method, system, terminal and storage medium

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