CN111798113B - Resource allocation method, device, storage medium and electronic equipment - Google Patents
Resource allocation method, device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN111798113B CN111798113B CN202010601511.4A CN202010601511A CN111798113B CN 111798113 B CN111798113 B CN 111798113B CN 202010601511 A CN202010601511 A CN 202010601511A CN 111798113 B CN111798113 B CN 111798113B
- Authority
- CN
- China
- Prior art keywords
- resource
- quota
- priority
- task
- information
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/063—Operations research, analysis or management
- G06Q10/0631—Resource planning, allocation, distributing or scheduling for enterprises or organisations
- G06Q10/06315—Needs-based resource requirements planning or analysis
Landscapes
- Business, Economics & Management (AREA)
- Human Resources & Organizations (AREA)
- Engineering & Computer Science (AREA)
- Strategic Management (AREA)
- Entrepreneurship & Innovation (AREA)
- Economics (AREA)
- Operations Research (AREA)
- Game Theory and Decision Science (AREA)
- Development Economics (AREA)
- Marketing (AREA)
- Educational Administration (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The disclosure relates to a resource allocation method, a device, a storage medium and an electronic device, wherein the method comprises the following steps: distributing computing resources for each task according to the resource quota information and the priority information of each task in a period of time; the resource quota information includes: a resource quota for each of the plurality of priorities, and a reserve quota for each of the plurality of priorities that is not allowed to be preempted by a task having a higher priority; updating the reserved quota according to the task quantity of the plurality of tasks received in the time period to acquire updated resource quota information; and in the next time period, distributing computing resources for each task according to the updated resource quota information and the priority information of each task. The resource quota which can not be preempted can be reserved for the task with lower priority, the resource quota is adjusted in real time, reasonable supply of computing resources required by the task with each priority is guaranteed, and balance of the resource allocation process is improved.
Description
Technical Field
The present disclosure relates to the field of computing resource management, and in particular, to a resource allocation method, apparatus, storage medium, and electronic device.
Background
With the development of artificial intelligence technology, the data volume and the calculation volume involved in the development and reference processes related to artificial intelligence are also increasing, and a single resource device cannot meet the large calculation volume required by artificial intelligence calculation. Therefore, a resource platform based on a cloud computing platform needs to be built for artificial intelligent computing. When the user scale and the resource scale of the resource platform are large, reasonable resource quota management and a preset task priority strategy are needed to be adopted, so that the resource scheduling requirement under the multi-user multi-task scene is met under the condition that the whole resource platform is ensured to be stably available.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides a resource allocation method, a device, a storage medium, and an electronic apparatus.
According to a first aspect of embodiments of the present disclosure, there is provided a resource allocation method applied to a cloud computing platform, the method including:
in the ith time period, distributing computing resources for each first task according to the resource quota information and the received priority information of each first task;
Wherein i is greater than or equal to 1, and the resource quota information includes: the method comprises the steps that each priority in a plurality of preset priorities is a resource quota in a resource platform, and each resource quota corresponding to a first priority is a resource reservation quota which is not allowed to be preempted by a task with a second priority, wherein the first priority is any priority except the highest priority in the plurality of priorities, the second priority is contained in the plurality of priorities, and the second priority is higher than the first priority;
Updating the resource reservation quota according to the task amounts of the plurality of first tasks received in the ith time period to acquire updated resource quota information;
and in the (i+1) th time period, distributing computing resources for each second task according to the updated resource quota information and the received priority information of each second task.
Optionally, the allocating computing resources for each first task according to the resource quota information and the received priority information of each first task includes:
Determining a third priority corresponding to a third task according to the priority information of the third task, wherein the third task is any one of the plurality of first tasks;
determining a first resource quota corresponding to the third priority according to the resource quota information;
Determining a resource reservation quota corresponding to each fourth priority according to the resource quota information when a first residual quota in the first resource quota is smaller than the resource demand of the third task and the third priority is not the lowest priority in the plurality of priorities, wherein the fourth priority is contained in the plurality of priorities and is lower than the third priority, and the first residual quota is a resource quota except for the occupied resource quota in the first resource quota;
Computing resources are allocated to the third task from a second residual quota and the first residual quota in at least one second resource quota corresponding to the fourth priority, wherein the second residual quota is a resource quota except for an occupied resource quota and a resource reservation quota corresponding to the fourth priority in the second resource quota; or alternatively
Stopping allocating computing resources for the third task if a first remaining quota in the first resource quota is less than a resource demand of the third task and the third priority is the lowest priority; or alternatively
And in the case that the first residual quota is greater than or equal to the resource demand, allocating computing resources for the third task from the first residual quota.
Optionally, the task amount includes: the updating the resource reservation quota according to the task amounts of the plurality of first tasks received in the ith time period to acquire updated resource quota information includes:
Determining the first task amount and the second task amount;
reducing the resource reservation quota corresponding to the first priority under the condition that the second task amount is larger than a first preset threshold value so as to acquire the updated resource quota information; and
And when the first task amount is greater than a second preset threshold, the first priority is not the lowest priority among the priorities, and the second task amount is less than or equal to the first preset threshold, reducing at least one resource reservation quota corresponding to a fifth priority while increasing the resource reservation quota corresponding to the first priority so as to acquire the updated resource quota information, wherein the fifth priority is included in the priorities and is lower than the first priority.
Optionally, the resource platform includes a first computing resource in a closed state, a resource quota of the first computing resource is a preset static resource reservation quota, and the first computing resource corresponding to the static resource reservation quota in the resource platform is in the closed state, and the method further includes:
and in the target process of distributing computing resources for each first task or each second task, if a second computing resource in the resource platform fails, starting the first computing resource so as to replace the second computing resource by the first computing resource to continue executing the target process.
According to a second aspect of embodiments of the present disclosure, there is provided a resource allocation apparatus applied to a cloud computing platform, the apparatus including:
the first resource allocation module is configured to allocate computing resources for each first task according to the resource quota information and the received priority information of each first task in the ith time period;
Wherein i is greater than or equal to 1, and the resource quota information includes: the method comprises the steps that each priority in a plurality of preset priorities is a resource quota in a resource platform, and each resource quota corresponding to a first priority is a resource reservation quota which is not allowed to be preempted by a task with a second priority, wherein the first priority is any priority except the highest priority in the plurality of priorities, the second priority is contained in the plurality of priorities, and the second priority is higher than the first priority;
The quota updating module is configured to update the resource reservation quota according to the task amounts of the plurality of first tasks received in the ith time period so as to acquire updated resource quota information;
and the second resource allocation module is configured to allocate computing resources for each second task according to the updated resource quota information and the received priority information of each second task in the (i+1) th time period.
Optionally, the first resource allocation module is configured to:
Determining a third priority corresponding to a third task according to the priority information of the third task, wherein the third task is any one of the plurality of first tasks;
determining a first resource quota corresponding to the third priority according to the resource quota information;
Determining a resource reservation quota corresponding to each fourth priority according to the resource quota information when a first residual quota in the first resource quota is smaller than the resource demand of the third task and the third priority is not the lowest priority in the plurality of priorities, wherein the fourth priority is contained in the plurality of priorities and is lower than the third priority, and the first residual quota is a resource quota except for the occupied resource quota in the first resource quota;
Computing resources are allocated to the third task from a second residual quota and the first residual quota in at least one second resource quota corresponding to the fourth priority, wherein the second residual quota is a resource quota except for an occupied resource quota and a resource reservation quota corresponding to the fourth priority in the second resource quota; or alternatively
Stopping allocating computing resources for the third task if a first remaining quota in the first resource quota is less than a resource demand of the third task and the third priority is the lowest priority; or alternatively
And in the case that the first residual quota is greater than or equal to the resource demand, allocating computing resources for the third task from the first residual quota.
Optionally, the task amount includes: a first task volume of the first task having the first priority, and a second task volume of the first task having the highest priority, the quota update module configured to:
Determining the first task amount and the second task amount;
reducing the resource reservation quota corresponding to the first priority under the condition that the second task amount is larger than a first preset threshold value so as to acquire the updated resource quota information; and
And when the first task amount is greater than a second preset threshold, the first priority is not the lowest priority among the priorities, and the second task amount is less than or equal to the first preset threshold, reducing at least one resource reservation quota corresponding to a fifth priority while increasing the resource reservation quota corresponding to the first priority so as to acquire the updated resource quota information, wherein the fifth priority is included in the priorities and is lower than the first priority.
Optionally, the resource platform includes a first computing resource in a closed state, a resource quota of the first computing resource is a preset static resource reservation quota, and the first computing resource corresponding to the static resource reservation quota in the resource platform is in the closed state, and the apparatus further includes:
And the resource opening module is configured to open the first computing resource if a second computing resource in the resource platform fails in the target process of distributing the computing resource for each first task or each second task so as to replace the second computing resource by the first computing resource to continue executing the target process.
According to a third aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the steps of the resource allocation method provided by the first aspect of the present disclosure.
According to a fourth aspect of embodiments of the present disclosure, there is provided an electronic device, comprising: the second aspect of the present disclosure provides a resource allocation apparatus.
According to the technical scheme provided by the embodiment of the disclosure, in the ith time period, computing resources can be distributed to each first task according to the resource quota information and the received priority information of each first task; wherein i is greater than or equal to 1, and the resource quota information includes: the method comprises the steps that each priority in a plurality of preset priorities is a resource quota in a resource platform, and each resource quota corresponding to a first priority is a resource reservation quota which is not allowed to be preempted by a task with a second priority, wherein the first priority is any priority except the highest priority in the plurality of priorities, the second priority is contained in the plurality of priorities, and the second priority is higher than the first priority; updating the resource reservation quota according to the task amounts of the plurality of first tasks received in the ith time period to acquire updated resource quota information; and in the (i+1) th time period, distributing computing resources for each second task according to the updated resource quota information and the received priority information of each second task. The method and the device can reserve the unoccupied resource quota for the task with the lower priority while ensuring the sufficiency of the computing resources of the task with the highest priority, and adjust the resource quota of the task with the lower priority in real time, ensure the reasonable supply of the computing resources required by the task with each priority by the resource platform, improve the balance of the resource allocation process, and further improve the overall resource utilization rate of the resource platform.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart illustrating a method of resource allocation according to an exemplary embodiment;
FIG. 2 is a flow chart of a method of allocating computing resources according to the method shown in FIG. 1;
FIG. 3 is a flow chart of a method of updating a resource reservation quota in accordance with the one shown in FIG. 1;
FIG. 4 is a flow chart diagram of another resource allocation method according to the illustration of FIG. 1;
FIG. 5 is a block diagram of a resource allocation device, according to an example embodiment;
FIG. 6 is a block diagram of another resource allocation device according to the one shown in FIG. 5;
fig. 7 is a block diagram of an electronic device, according to an example embodiment.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
In the related art of resource allocation, resource allocation for multiple users (or service ends) or groups of users is typically implemented through a task priority policy. In the task priority policy, a plurality of task priorities arranged from high to low may be set. When a user issues a task, a high priority can be set for a more important task, and a low priority can be set for a less important task. After determining the priority of each task, the computing resource allocation process of the task can be performed by combining the task priority policy with the resource quota concept. Specifically, in the process of computing resource allocation, each priority corresponds to its own resource quota, while tasks with high priorities can preempt resource quotas of tasks with lower priorities without limitation. In the resource allocation method, all the computing resources in the resource platform are completely inclined to the task with the highest priority, the supply condition of the computing resources of the tasks with other priorities except the highest priority is not considered, the balance of the whole resource allocation process is poor, and the resource utilization ratio of the whole resource platform is insufficient.
In this regard, the present disclosure proposes a resource allocation method, specifically as follows:
Before introducing the resource allocation method provided by the present disclosure, first, a description is given of a target application scenario related to each embodiment in the present disclosure, where the target application scenario includes a resource platform, where the resource platform is a cloud computing platform, and the cloud computing platform includes at least one scheduler provided with a resource scheduling system, and a plurality of resource servers, where the resource servers are cloud servers that have GPU (Graphics Processing Unit, graphics processor) computing resources, CPU (Central Processing Unit ) computing resources, memory resources, and other computing resources and are capable of providing cloud data acquisition and cloud computing services for received computing tasks.
Fig. 1 is a flowchart of a resource allocation method according to an exemplary embodiment, as shown in fig. 1, applied to a cloud computing platform described in the application scenario, where the method includes the following steps:
In step 101, in the ith time period, computing resources are allocated to each first task according to the resource quota information and the received priority information of each first task.
Wherein i is greater than or equal to 1, and the resource quota information includes: the method comprises the steps of presetting resource quota of each priority in a plurality of priorities in a resource platform, and reserving resource quota which is not allowed to be preempted by a task with a second priority in the resource quota corresponding to each first priority, wherein the first priority is any priority except the highest priority in the plurality of priorities, the second priority is contained in the plurality of priorities, and the second priority is higher than the first priority.
In this embodiment, the expression "resource quota" and the "resource reservation quota" and "resource demand" related thereto may represent the number of entity devices that calculate the resource, or the capacity or the computing power of the resource devices. For example, the resource quota corresponding to the priority a is 80 GPU computing resources, which actually indicates that GPU computing resources may be allocated to the task with the priority a from 80 graphics cards (with the same computing power). Or the resource quota corresponding to the priority a is 20 memory resources, which actually means that the memory resources can be allocated to the task with the priority a from the storage capacity of 20 capacity units, and the capacity units can be MB (byte), GB (Gigabyte) or larger storage capacity units.
For example, in the underlying task priority policy, a task with a higher priority may preempt a resource quota corresponding to a lower priority, while a task with a lower priority may not preempt a resource quota corresponding to a higher priority. For example, task a has priority a, task B has priority B, and priority a is higher than priority B. If the resource quota corresponding to the priority B is set to be 80 computing resources, the resource quota corresponding to the priority a is set to be 100 computing resources, which actually indicates that the computing resources can be allocated to the task B from the 80 computing resources, the computing resources can be allocated to the task a from the 100 computing resources, the task a can preempt the 80 computing resources belonging to the task B for already use, and the task B cannot occupy the 100 computing resources belonging to the task a. In the embodiment of the disclosure, besides the above basic task priority policy, a certain resource quota (i.e. the above resource reservation quota) which can not be preempted is reserved for other priorities except the highest priority. For example, for priority a and priority B ordered from high to low, the resource quotas corresponding to these two priorities are respectively: 80 and 40 (computing resources), wherein the resource reservation quotas corresponding to the priority B (the first priority described above) are respectively: 10 (computing resources). If the task with priority a uses up 80 computing resources, the newly received task with priority a can preempt computing resources in the resource quota of 40-10=30 computing resources corresponding to priority B, but cannot preempt the resource reservation quota of 10 computing resources corresponding to priority B (the first priority described above).
In step 102, the resource reservation quota is updated according to the task amounts of the plurality of first tasks received in the ith time period, so as to obtain updated resource quota information.
For example, the i-th period and the following i+1th period may be of the same duration, for example, one week. In step 102, the resource reservation quota corresponding to each first priority may be updated according to the task amounts of the plurality of first tasks with different priorities received in a week, and the updated resource reservation quota may be used to replace the resource reservation quota in the original resource quota information, so as to obtain the updated resource quota information. The task amount includes: the task amount of the first task having different priorities. Still taking the above priority a and priority B as examples, the task amount may include: the number of first tasks with priority a and the number of first tasks with priority B. Or the task volume may include: the amount of computing resources that the first task with priority a occupied during the ith period of time and the amount of computing resources that the first task with priority B occupied during the ith period of time.
In step 103, in the (i+1) th time period, computing resources are allocated to each second task according to the updated resource quota information and the received priority information of each second task.
For example, in the (i+1) th time period, resource allocation may be performed according to the updated resource quota information and the received priority information of each second task. The task priority policy in the specific allocation manner is the same as the task priority policy described in step 101, and will not be described here again.
In summary, according to the technical solution provided by the embodiments of the present disclosure, in the ith time period, computing resources can be allocated to each first task according to the resource quota information and the received priority information of each first task; wherein i is greater than or equal to 1, and the resource quota information includes: the method comprises the steps that each priority in a plurality of preset priorities is a resource quota in a resource platform, and each resource quota corresponding to a first priority is a resource reservation quota which is not allowed to be preempted by a task with a second priority, wherein the first priority is any priority except the highest priority in the plurality of priorities, the second priority is contained in the plurality of priorities, and the second priority is higher than the first priority; updating the resource reservation quota according to the task amounts of the plurality of first tasks received in the ith time period to acquire updated resource quota information; and in the (i+1) th time period, distributing computing resources for each second task according to the updated resource quota information and the received priority information of each second task. The method and the device can reserve the unoccupied resource quota for the task with the lower priority while ensuring the sufficiency of the computing resources of the task with the highest priority, and adjust the resource quota of the task with the lower priority in real time, ensure the reasonable supply of the computing resources required by the task with each priority by the resource platform, improve the balance of the resource allocation process, and further improve the overall resource utilization rate of the resource platform.
FIG. 2 is a flow chart of a method of allocating computing resources according to the method shown in FIG. 1, as shown in FIG. 2, the step 101 may include: steps 1011-1014, or steps 1011, 1012 and 1015, or steps 1011, 1012 and 1016.
In step 1011, a third priority corresponding to the third task is determined based on the priority information of the third task.
Wherein the third task is any one of the plurality of first tasks.
In step 1012, a first resource quota corresponding to the third priority is determined according to the resource quota information.
In step 1013, when the first remaining quota in the first resource quota is smaller than the resource demand of the third task and the third priority is not the lowest priority in the plurality of priorities, determining a resource reservation quota corresponding to each fourth priority according to the resource quota information.
The fourth priority is included in the plurality of priorities and is lower than the third priority, and the first remaining quota is a resource quota except an occupied resource quota in the first resource quota.
In step 1014, computing resources are allocated for the third task from a second remaining quota of the at least one second resource quota corresponding to the fourth priority and the first remaining quota.
The second remaining quota is a resource quota except for the occupied resource quota and the resource reservation quota corresponding to the fourth priority in the second resource quota.
Illustratively, priority a, priority B, priority C, and priority D, which are ordered from high to low. If the third priority is determined to be priority B, in step 1012, it may be determined, according to the resource quota information, that the resource quota corresponding to priority B is: 80 (computing resources). If 30 computing resources of the 80 computing resources are already occupied, the first remaining quota is 50 computing resources. If the resource demand of the third task is 60 computing resources, in step 1013, it is determined that the first remaining quota is smaller than the resource demand of the third task, and then the resource reservation quota corresponding to the priority C and the priority D (both being the fourth priority) is determined according to the resource quota information. If the resource quota corresponding to the priority C is 20 computing resources, the occupied resource quota in the 20 computing resources is 8, the resource reservation quota corresponding to the priority C is 2, the occupied resource quota in the 10 computing resources is 4, the resource reservation quota corresponding to the priority D is 1, in step 1014, computing resources are allocated for the third task from the first remaining quota (50 computing resources), and the second remaining quota (20-8-2=10 computing resources) in the second resource quota corresponding to the priority C, or from the second remaining quota ((20-8-2) + (10-4-1) =15 computing resources) in the second resource quota corresponding to both the priority C and the priority D.
In step 1015, in a case where the first remaining quota in the first resource quota is less than the resource requirement of the third task and the third priority is the lowest priority, the allocation of computing resources for the third task is stopped.
Taking the priority a, the priority B, the priority C, and the priority D as examples, if the third priority is the priority D and the first remaining quota is 50 computing resources, and the resource requirement of the third task is 60 computing resources, it is determined that the first remaining quota corresponding to the third priority is insufficient for executing the third task, and no resource quota corresponding to the lower priority can be preempted, where computing resources are not allocated to the third task.
In step 1016, computing resources are allocated from the first remaining quota for the third task if the first remaining quota is greater than or equal to the resource demand.
Taking the priority a, the priority B, the priority C and the priority D as examples, if the first remaining quota is 50 computing resources and the resource demand of the third task is 40 computing resources, it is determined that the first remaining quota corresponding to the third priority is sufficient to execute the third task, and no preemption is required for the resource quota corresponding to the lower priority, and at this time, the computing resources are directly allocated to the third task from the 50 computing resources.
Fig. 3 is a flow chart of a method of updating a resource reservation quota according to the one shown in fig. 1, the task volume may include: the step 102 may include, as shown in fig. 3, a first task volume of the first task having the first priority, and a second task volume of the first task having the highest priority:
In step 1021, the first and second task amounts are determined.
Illustratively, the first task amount and the second task amount may be the number of tasks or the total amount of computing resources that the tasks have occupied, and in the embodiment of the present disclosure, the steps 1021-1023 are described taking the first task amount and the second task amount as the number of tasks as an example.
In step 1022, when the second task amount is greater than the first preset threshold, the resource reservation quota corresponding to the first priority is reduced, so as to obtain the updated resource quota information.
Illustratively, priority a, priority B, priority C, and priority D, which are ordered from high to low. If the second task amount of the first task with the priority a is greater than the first preset threshold, the second task amount is considered to be very large, and the resource reservation quota corresponding to other priorities needs to be reduced so as to make more idle computing resources for the first task with the priority a. In addition, another case of reducing the resource reservation quota of another priority is to reduce the resource reservation quota corresponding to the priority B, for example, if the task amount of the first task having the priority B received in the ith period is very small, for the priority B other than the priority a (highest priority).
In step 1023, when the first task amount is greater than the second preset threshold, the first priority is not the lowest priority among the plurality of priorities, and the second task amount is less than or equal to the first preset threshold, the resource reservation quota corresponding to the first priority is increased, and at least one resource reservation quota corresponding to the fifth priority is reduced, so as to obtain the updated resource quota information.
Wherein the fifth priority is included in the plurality of priorities and is lower than the first priority.
Taking the above priority a, priority B, priority C, and priority D as examples, if the first task with priority B has a large number of tasks (more than the second preset threshold), and the priority B is not the lowest priority (not priority D), and the number of tasks with the first task with priority a does not exceed the expectation (less than or equal to the first preset threshold), then the resource reservation quotas of the three priorities B, C, and D may be "internally adjusted". Specifically, when the resource reservation quota corresponding to the priority B is increased (for example, 2 computing resources are increased), the resource reservation quota corresponding to the priority C and/or the resource reservation quota corresponding to the priority D are reduced to a certain extent, and the total amount of reduction is preferably equal to the increase amount (2 computing resources) of the resource reservation quota corresponding to the priority B.
FIG. 4 is a flowchart of another method for allocating resources according to FIG. 1, where the resource platform includes a first computing resource in a closed state, a resource quota of the first computing resource is a preset static resource reservation quota, and a first computing resource corresponding to the static resource reservation quota in the resource platform is in a closed state, as shown in FIG. 4, where the method may further include:
In step 104, if a second computing resource in the resource platform fails during the target process of allocating computing resources for each first task or each second task, the first computing resource is started to replace the second computing resource by the first computing resource to continue executing the target process.
Illustratively, in embodiments of the present disclosure, the quota management concepts employed in the resource allocation process also include a static resource reservation quota. The static resource reservation quota corresponds to a first computing resource in the resource platform, which is also a resource device that provides computing resources, but which is in a closed state in a normal state, which may be referred to as a redundant resource device. If the second computing resource in the resource platform fails or the task amount with the highest priority is too large in the target process (including the process of executing the first task or the second task by using the computing resource in the resource platform), the part of the resource devices corresponding to the first computing resource can be started to replace the second computing resource by the first computing resource to continue to execute the target process.
Therefore, in the embodiment of the disclosure, a certain static resource reservation quota can be set for the resource platform, and the static resource reservation quota is started when the computing resource fails, so that the situation of computing resource shortage caused by the reduction of computing resource equipment is avoided, and the overall stability of the resource platform is improved.
In summary, according to the technical solution provided by the embodiments of the present disclosure, in the ith time period, computing resources can be allocated to each first task according to the resource quota information and the received priority information of each first task; wherein i is greater than or equal to 1, and the resource quota information includes: the method comprises the steps that each priority in a plurality of preset priorities is a resource quota in a resource platform, and each resource quota corresponding to a first priority is a resource reservation quota which is not allowed to be preempted by a task with a second priority, wherein the first priority is any priority except the highest priority in the plurality of priorities, the second priority is contained in the plurality of priorities, and the second priority is higher than the first priority; updating the resource reservation quota according to the task amounts of the plurality of first tasks received in the ith time period to acquire updated resource quota information; and in the (i+1) th time period, distributing computing resources for each second task according to the updated resource quota information and the received priority information of each second task. The method and the device can reserve the unoccupied resource quota for the task with the lower priority while ensuring the sufficiency of the computing resources of the task with the highest priority, and adjust the resource quota of the task with the lower priority in real time, ensure the reasonable supply of the computing resources required by the task with each priority by the resource platform, improve the balance of the resource allocation process, and further improve the overall resource utilization rate of the resource platform.
Fig. 5 is a block diagram of a resource allocation apparatus according to an exemplary embodiment, as shown in fig. 5, applied to the cloud computing platform described in the application scenario, the apparatus 500 includes:
a first resource allocation module 510 configured to allocate computing resources for each first task according to the resource quota information and the received priority information of each first task in the ith time period;
Wherein i is greater than or equal to 1, and the resource quota information includes: the method comprises the steps that each priority in a plurality of preset priorities is a resource quota in a resource platform, and each resource quota corresponding to a first priority is a resource reservation quota which is not allowed to be preempted by a task with a second priority, wherein the first priority is any priority except the highest priority in the plurality of priorities, the second priority is contained in the plurality of priorities, and the second priority is higher than the first priority;
A quota update module 520, configured to update the resource reservation quota according to the task amounts of the plurality of first tasks received in the ith time period, so as to obtain updated resource quota information;
And a second resource allocation module 530 configured to allocate computing resources for each second task according to the updated resource quota information and the received priority information of each second task in the (i+1) th time period.
Optionally, the first resource allocation module 510 is configured to:
determining a third priority corresponding to a third task according to the priority information of the third task, wherein the third task is any one of the plurality of first tasks;
determining a first resource quota corresponding to the third priority according to the resource quota information;
Determining a resource reservation quota corresponding to each fourth priority according to the resource quota information when the first residual quota in the first resource quota is smaller than the resource demand of the third task and the third priority is not the lowest priority in the plurality of priorities, wherein the fourth priority is contained in the plurality of priorities and is lower than the third priority, and the first residual quota is a resource quota except the occupied resource quota in the first resource quota;
Allocating computing resources for the third task from a second residual quota and the first residual quota in at least one second resource quota corresponding to the fourth priority, wherein the second residual quota is a resource quota except for an occupied resource quota and a resource reservation quota corresponding to the fourth priority in the second resource quota; or alternatively
Stopping allocating computing resources for the third task when the first remaining quota in the first resource quota is less than the resource demand of the third task and the third priority is the lowest priority; or alternatively
And in the case that the first remaining quota is greater than or equal to the resource demand, allocating computing resources for the third task from the first remaining quota.
Optionally, the task amount includes: a first task volume for a first task having the first priority, and a second task volume for a first task having the highest priority, the quota update module 520 configured to:
determining the first and second task amounts;
reducing the resource reservation quota corresponding to the first priority under the condition that the second task amount is larger than a first preset threshold value so as to acquire updated resource quota information; and
And when the first task amount is greater than a second preset threshold, the first priority is not the lowest priority among the priorities, and the second task amount is less than or equal to the first preset threshold, reducing the resource reservation quota corresponding to at least one fifth priority while increasing the resource reservation quota corresponding to the first priority so as to acquire the updated resource quota information, wherein the fifth priority is included in the priorities and is lower than the first priority.
Fig. 6 is a block diagram of another resource allocation apparatus according to fig. 5, where, as shown in fig. 6, the resource platform includes a first computing resource in a closed state, a resource quota of the first computing resource is a preset static resource reservation quota, and a first computing resource corresponding to the static resource reservation quota in the resource platform is in a closed state, where the apparatus 500 may further include:
the resource opening module 540 is configured to, in a target process of allocating a computing resource for each first task or each second task, if a second computing resource in the resource platform fails, open the first computing resource, so as to replace the second computing resource by the first computing resource to continue to execute the target process.
In summary, according to the technical solution provided by the embodiments of the present disclosure, in the ith time period, computing resources can be allocated to each first task according to the resource quota information and the received priority information of each first task; wherein i is greater than or equal to 1, and the resource quota information includes: the method comprises the steps that each priority in a plurality of preset priorities is a resource quota in a resource platform, and each resource quota corresponding to a first priority is a resource reservation quota which is not allowed to be preempted by a task with a second priority, wherein the first priority is any priority except the highest priority in the plurality of priorities, the second priority is contained in the plurality of priorities, and the second priority is higher than the first priority; updating the resource reservation quota according to the task amounts of the plurality of first tasks received in the ith time period to acquire updated resource quota information; and in the (i+1) th time period, distributing computing resources for each second task according to the updated resource quota information and the received priority information of each second task. The method and the device can reserve the unoccupied resource quota for the task with the lower priority while ensuring the sufficiency of the computing resources of the task with the highest priority, and adjust the resource quota of the task with the lower priority in real time, ensure the reasonable supply of the computing resources required by the task with each priority by the resource platform, improve the balance of the resource allocation process, and further improve the overall resource utilization rate of the resource platform.
Fig. 7 is a block diagram of an electronic device, according to an example embodiment. For example, the electronic device 700 may be a scheduler or server in a cloud computing platform. Referring to fig. 7, electronic device 700 includes a processing component 722 that further includes one or more processors and memory resources represented by memory 732 for storing instructions, such as application programs, executable by processing component 722. The application programs stored in memory 732 may include one or more modules that each correspond to a set of instructions. Further, the processing component 722 is configured to execute instructions to perform the resource allocation method illustrated in fig. 1-4.
The electronic device 700 may also include a power supply component 726 configured to perform power management of the electronic device 700, a wired or wireless network interface 770 configured to connect the electronic device 700 to a network, and an input/output (I/O) interface 778. The electronic device 700 may operate based on an operating system stored in memory 732, such as Windows Server TM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM or the like.
The electronic equipment provided by the embodiment of the disclosure can reserve the unoccupied resource quota for the task with the lower priority while ensuring the sufficiency of the computing resources of the task with the highest priority, and adjust the resource quota of the task with the lower priority in real time, so that the reasonable supply of the computing resources required by the tasks with the priorities by the resource platform is ensured, the balance of the resource allocation process is improved, and the overall resource utilization rate of the resource platform is further improved.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (8)
1. A resource allocation method applied to a cloud computing platform, the method comprising:
in the ith time period, distributing computing resources for each first task according to the resource quota information and the received priority information of each first task;
Wherein i is greater than or equal to 1, and the resource quota information includes: the method comprises the steps that each priority in a plurality of preset priorities is a resource quota in a resource platform, and each resource quota corresponding to a first priority is a resource reservation quota which is not allowed to be preempted by a task with a second priority, wherein the first priority is any priority except the highest priority in the plurality of priorities, the second priority is contained in the plurality of priorities, and the second priority is higher than the first priority;
Updating the resource reservation quota according to the task amounts of the plurality of first tasks received in the ith time period to acquire updated resource quota information;
In the (i+1) th time period, computing resources are distributed to each second task according to the updated resource quota information and the received priority information of each second task;
The task amount includes: the updating the resource reservation quota according to the task amounts of the plurality of first tasks received in the ith time period to acquire updated resource quota information includes:
Determining the first task amount and the second task amount;
reducing the resource reservation quota corresponding to the first priority under the condition that the second task amount is larger than a first preset threshold value so as to acquire the updated resource quota information; and
And when the first task amount is greater than a second preset threshold, the first priority is not the lowest priority among the priorities, and the second task amount is less than or equal to the first preset threshold, reducing at least one resource reservation quota corresponding to a fifth priority while increasing the resource reservation quota corresponding to the first priority so as to acquire the updated resource quota information, wherein the fifth priority is included in the priorities and is lower than the first priority.
2. The method of claim 1, wherein the allocating computing resources for each first task according to the resource quota information and the received priority information of each first task comprises:
Determining a third priority corresponding to a third task according to the priority information of the third task, wherein the third task is any one of the plurality of first tasks;
determining a first resource quota corresponding to the third priority according to the resource quota information;
Determining a resource reservation quota corresponding to each fourth priority according to the resource quota information when a first residual quota in the first resource quota is smaller than the resource demand of the third task and the third priority is not the lowest priority in the plurality of priorities, wherein the fourth priority is contained in the plurality of priorities and is lower than the third priority, and the first residual quota is a resource quota except for the occupied resource quota in the first resource quota;
Computing resources are allocated to the third task from a second residual quota and the first residual quota in at least one second resource quota corresponding to the fourth priority, wherein the second residual quota is a resource quota except for an occupied resource quota and a resource reservation quota corresponding to the fourth priority in the second resource quota; or alternatively
Stopping allocating computing resources for the third task if a first remaining quota in the first resource quota is less than a resource demand of the third task and the third priority is the lowest priority; or alternatively
And in the case that the first residual quota is greater than or equal to the resource demand, allocating computing resources for the third task from the first residual quota.
3. The method of claim 1, wherein the resource platform includes a first computing resource in a closed state, the resource quota of the first computing resource is a preset static resource reservation quota, and the first computing resource corresponding to the static resource reservation quota in the resource platform is in the closed state, the method further comprising:
and in the target process of distributing computing resources for each first task or each second task, if a second computing resource in the resource platform fails, starting the first computing resource so as to replace the second computing resource by the first computing resource to continue executing the target process.
4. A resource allocation apparatus for use with a cloud computing platform, the apparatus comprising:
the first resource allocation module is configured to allocate computing resources for each first task according to the resource quota information and the received priority information of each first task in the ith time period;
Wherein i is greater than or equal to 1, and the resource quota information includes: the method comprises the steps that each priority in a plurality of preset priorities is a resource quota in a resource platform, and each resource quota corresponding to a first priority is a resource reservation quota which is not allowed to be preempted by a task with a second priority, wherein the first priority is any priority except the highest priority in the plurality of priorities, the second priority is contained in the plurality of priorities, and the second priority is higher than the first priority;
The quota updating module is configured to update the resource reservation quota according to the task amounts of the plurality of first tasks received in the ith time period so as to acquire updated resource quota information;
the second resource allocation module is configured to allocate computing resources for each second task according to the updated resource quota information and the received priority information of each second task in the (i+1) th time period;
The task amount includes: a first task volume of the first task having the first priority, and a second task volume of the first task having the highest priority, the quota update module configured to:
Determining the first task amount and the second task amount;
reducing the resource reservation quota corresponding to the first priority under the condition that the second task amount is larger than a first preset threshold value so as to acquire the updated resource quota information; and
And when the first task amount is greater than a second preset threshold, the first priority is not the lowest priority among the priorities, and the second task amount is less than or equal to the first preset threshold, reducing at least one resource reservation quota corresponding to a fifth priority while increasing the resource reservation quota corresponding to the first priority so as to acquire the updated resource quota information, wherein the fifth priority is included in the priorities and is lower than the first priority.
5. The apparatus of claim 4, wherein the first resource allocation module is configured to:
Determining a third priority corresponding to a third task according to the priority information of the third task, wherein the third task is any one of the plurality of first tasks;
determining a first resource quota corresponding to the third priority according to the resource quota information;
Determining a resource reservation quota corresponding to each fourth priority according to the resource quota information when a first residual quota in the first resource quota is smaller than the resource demand of the third task and the third priority is not the lowest priority in the plurality of priorities, wherein the fourth priority is contained in the plurality of priorities and is lower than the third priority, and the first residual quota is a resource quota except for the occupied resource quota in the first resource quota;
Computing resources are allocated to the third task from a second residual quota and the first residual quota in at least one second resource quota corresponding to the fourth priority, wherein the second residual quota is a resource quota except for an occupied resource quota and a resource reservation quota corresponding to the fourth priority in the second resource quota; or alternatively
Stopping allocating computing resources for the third task if a first remaining quota in the first resource quota is less than a resource demand of the third task and the third priority is the lowest priority; or alternatively
And in the case that the first residual quota is greater than or equal to the resource demand, allocating computing resources for the third task from the first residual quota.
6. The apparatus of claim 4, wherein the resource platform includes a first computing resource in a closed state, a resource quota of the first computing resource is a preset static resource reservation quota, and the first computing resource corresponding to the static resource reservation quota in the resource platform is in the closed state, the apparatus further comprising:
And the resource opening module is configured to open the first computing resource if a second computing resource in the resource platform fails in the target process of distributing the computing resource for each first task or each second task so as to replace the second computing resource by the first computing resource to continue executing the target process.
7. A computer readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the steps of the method of any of claims 1-3.
8. An electronic device, comprising: the resource allocation device of any of claims 4-6.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010601511.4A CN111798113B (en) | 2020-06-28 | 2020-06-28 | Resource allocation method, device, storage medium and electronic equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010601511.4A CN111798113B (en) | 2020-06-28 | 2020-06-28 | Resource allocation method, device, storage medium and electronic equipment |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111798113A CN111798113A (en) | 2020-10-20 |
| CN111798113B true CN111798113B (en) | 2024-07-05 |
Family
ID=72804733
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010601511.4A Active CN111798113B (en) | 2020-06-28 | 2020-06-28 | Resource allocation method, device, storage medium and electronic equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111798113B (en) |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114519480A (en) * | 2020-11-20 | 2022-05-20 | 炬星科技(深圳)有限公司 | Resource allocation method, equipment and storage medium for multi-robot navigation |
| US11966787B2 (en) * | 2021-03-31 | 2024-04-23 | Mcafee Llc | Dynamic process criticality scoring |
| CN115209166A (en) * | 2021-04-12 | 2022-10-18 | 北京字节跳动网络技术有限公司 | Message sending method, device, equipment and storage medium |
| CN112988363B (en) * | 2021-05-17 | 2021-09-14 | 阿里云计算有限公司 | Resource scheduling method, device, server and storage medium |
| CN114268549A (en) * | 2021-12-10 | 2022-04-01 | 郑州云海信息技术有限公司 | Method, system, equipment and storage medium for resource preemption by cloud platform |
| CN114625505A (en) * | 2022-03-11 | 2022-06-14 | 北京京东振世信息技术有限公司 | Waybill task execution method and device, electronic equipment and computer readable medium |
| CN115033392B (en) * | 2022-08-10 | 2022-11-04 | 北京网藤科技有限公司 | Method and system for self-adaptively allocating computing resources |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106911592A (en) * | 2016-06-01 | 2017-06-30 | 阿里巴巴集团控股有限公司 | A kind of adaptive resource allocation method and device |
| CN109542603A (en) * | 2018-11-22 | 2019-03-29 | 北京航空航天大学 | It is a kind of improve different priorities task between isolation multi dimensional resource shielding system |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20030061260A1 (en) * | 2001-09-25 | 2003-03-27 | Timesys Corporation | Resource reservation and priority management |
| CN107291545B (en) * | 2017-08-07 | 2019-12-10 | 星环信息科技(上海)有限公司 | Task scheduling method and device for multiple users in computing cluster |
| CN110837410B (en) * | 2019-10-30 | 2022-05-24 | 北京奇艺世纪科技有限公司 | Task scheduling method and device, electronic equipment and computer readable storage medium |
-
2020
- 2020-06-28 CN CN202010601511.4A patent/CN111798113B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106911592A (en) * | 2016-06-01 | 2017-06-30 | 阿里巴巴集团控股有限公司 | A kind of adaptive resource allocation method and device |
| CN109542603A (en) * | 2018-11-22 | 2019-03-29 | 北京航空航天大学 | It is a kind of improve different priorities task between isolation multi dimensional resource shielding system |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111798113A (en) | 2020-10-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111798113B (en) | Resource allocation method, device, storage medium and electronic equipment | |
| CN110647394B (en) | Resource allocation method, device and equipment | |
| CN108234581B (en) | Resource scheduling method and server | |
| CN108667748B (en) | Method, device, equipment and storage medium for controlling bandwidth | |
| CN114356543B (en) | A multi-tenant machine learning task resource scheduling method based on Kubernetes | |
| US8209695B1 (en) | Reserving resources in a resource-on-demand system for user desktop utility demand | |
| CN103793272B (en) | Periodical task scheduling method and periodical task scheduling system | |
| CN111796933B (en) | Resource scheduling method, device, storage medium and electronic equipment | |
| CN112988390A (en) | Calculation power resource allocation method and device | |
| CN108845874B (en) | Dynamic resource allocation method and server | |
| CN111258745B (en) | Task processing method and device | |
| CN105718316A (en) | Job scheduling method and apparatus | |
| CN119003149B (en) | GPU task queue management method, system, and device | |
| CN111488206A (en) | Deep learning task scheduling method, system, terminal and storage medium | |
| CN117149440B (en) | Task scheduling method and device, electronic equipment and storage medium | |
| CN112860442A (en) | Resource quota adjusting method and device, computer equipment and storage medium | |
| CN113760549B (en) | Pod deployment method and device | |
| CN116302519A (en) | Micro-service workflow elastic scheduling method, system and equipment based on container cloud platform | |
| CN119376894A (en) | A distributed task resource scheduling system and method | |
| CN114265676B (en) | Cluster resource scheduling method, device, equipment and medium | |
| CN111813564B (en) | Cluster resource management method and device and container cluster management system | |
| CN111796934B (en) | Task issuing method and device, storage medium and electronic equipment | |
| CN113703945B (en) | Micro service cluster scheduling method, device, equipment and storage medium | |
| CN116166391A (en) | Task resource scheduling method, device, equipment and computer readable storage medium | |
| CN117971498B (en) | Scheduling method for GPU resources in computing cluster, electronic equipment 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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| TG01 | Patent term adjustment | ||
| TG01 | Patent term adjustment |