CN111798113A - Resource allocation method, device, storage medium and electronic equipment - Google Patents

Resource allocation method, device, storage medium and electronic equipment Download PDF

Info

Publication number
CN111798113A
CN111798113A CN202010601511.4A CN202010601511A CN111798113A CN 111798113 A CN111798113 A CN 111798113A CN 202010601511 A CN202010601511 A CN 202010601511A CN 111798113 A CN111798113 A CN 111798113A
Authority
CN
China
Prior art keywords
resource
priority
quota
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.)
Pending
Application number
CN202010601511.4A
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.)
Beijing Xiaomi Pinecone Electronic Co Ltd
Original Assignee
Beijing Xiaomi Pinecone Electronic Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Pinecone Electronic Co Ltd filed Critical Beijing Xiaomi Pinecone Electronic Co Ltd
Priority to CN202010601511.4A priority Critical patent/CN111798113A/en
Publication of CN111798113A publication Critical patent/CN111798113A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06315Needs-based resource requirements planning or analysis

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: within a time period, distributing computing resources for each task according to the resource quota information and the priority information of each task; the resource quota information includes: the resource quota of each priority in the multiple priorities, and the reserved quota which is not allowed to be preempted by the task with the higher priority in the resource quota of each priority; updating the reserved quota according to the task volumes of the 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 tasks with lower priorities, and the resource quota is adjusted in real time, so that the reasonable supply of computing resources required by the tasks with the priorities is ensured, and the balance of the resource allocation process is improved.

Description

Resource allocation method, device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computing resource management, and in particular, to a resource allocation method, an apparatus, a storage medium, and an electronic device.
Background
With the development of artificial intelligence technology, the data volume and the calculation volume involved in the development and reference process related to artificial intelligence are larger and larger, 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 need 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 guaranteed to be stable and usable.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides a resource allocation method, apparatus, storage medium, and electronic device.
According to a first aspect of the 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 resource quota of each priority in a plurality of preset priorities in the resource platform, and the resource reservation quota which is not allowed to be preempted by the task with the second priority in the resource quota corresponding to each first priority, wherein the first priority is any priority except the highest priority in the priorities, the second priority is included in the priorities, and the second priority is higher than the first priority;
updating the resource reservation quota according to the task volumes of the 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 to 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 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 under the condition that a first remaining quota in the first resource quota is smaller than a resource demand of the third task and the third priority is not the lowest priority among the plurality of priorities, wherein 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 for an occupied resource quota in the first resource quota;
allocating computing resources to the third task from a second remaining quota of a second resource quota corresponding to at least one fourth priority and the first remaining quota, where the second remaining quota is a resource quota of the second resource quota except for an occupied resource quota and a resource reservation quota corresponding to the fourth priority; alternatively, the first and second electrodes may be,
stopping allocating computing resources for the third task when a first remaining quota of the first resource quotas is less than a resource demand of the third task and the third priority is the lowest priority; alternatively, the first and second electrodes may be,
and under the condition that the first remaining quota is larger than or equal to the resource demand, allocating computing resources for the third task from the first remaining quota.
Optionally, the task amount includes: the updating the resource reservation quota according to the task volumes of the plurality of first tasks received in the ith time period to obtain 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 to acquire the updated resource quota information under the condition that the second task amount is larger than a first preset threshold; and the number of the first and second groups,
when the first task volume is greater than a second preset threshold, the first priority is not the lowest priority among the multiple priorities, and the second task volume is less than or equal to the first preset threshold, while increasing the resource reservation quota corresponding to the first priority, reducing the resource reservation quota corresponding to at least one fifth priority to obtain the updated resource quota information, where the fifth priority is included in the multiple priorities and is lower than the first priority.
Optionally, the resource platform includes a first computing resource in a closed state, where 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 method further includes:
in a target process of allocating 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 that the target process is continuously executed by replacing the second computing resource with the first computing resource.
According to a second aspect of the 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 to 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 resource quota of each priority in a plurality of preset priorities in the resource platform, and the resource reservation quota which is not allowed to be preempted by the task with the second priority in the resource quota corresponding to each first priority, wherein the first priority is any priority except the highest priority in the priorities, the second priority is included in the priorities, and the second priority is higher than the first priority;
a quota updating module configured to update the resource reservation quota according to the task volume of the plurality of first tasks received in the ith time period, so as to obtain updated resource quota information;
and the second resource allocation module is configured to allocate computing resources to 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 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 under the condition that a first remaining quota in the first resource quota is smaller than a resource demand of the third task and the third priority is not the lowest priority among the plurality of priorities, wherein 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 for an occupied resource quota in the first resource quota;
allocating computing resources to the third task from a second remaining quota of a second resource quota corresponding to at least one fourth priority and the first remaining quota, where the second remaining quota is a resource quota of the second resource quota except for an occupied resource quota and a resource reservation quota corresponding to the fourth priority; alternatively, the first and second electrodes may be,
stopping allocating computing resources for the third task when a first remaining quota of the first resource quotas is less than a resource demand of the third task and the third priority is the lowest priority; alternatively, the first and second electrodes may be,
and under the condition that the first remaining quota is larger 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 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 to acquire the updated resource quota information under the condition that the second task amount is larger than a first preset threshold; and the number of the first and second groups,
when the first task volume is greater than a second preset threshold, the first priority is not the lowest priority among the multiple priorities, and the second task volume is less than or equal to the first preset threshold, while increasing the resource reservation quota corresponding to the first priority, reducing the resource reservation quota corresponding to at least one fifth priority to obtain the updated resource quota information, where the fifth priority is included in the multiple priorities and is lower than the first priority.
Optionally, the resource platform includes a first computing resource in a closed state, where 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 further includes:
a resource starting module configured to, in a target process of allocating computing resources for each first task or each second task, start the first computing resource if a second computing resource in the resource platform fails, so as to continue to execute the target process by replacing the second computing resource with the first computing resource.
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 the embodiments of the present disclosure, there is provided an electronic apparatus including: the resource allocation apparatus provided by the second aspect of the present disclosure.
According to the technical scheme provided by the embodiment of the 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: a preset resource quota of each priority in the multiple priorities in the resource platform, and a resource reservation quota which is not allowed to be preempted by a task with a second priority in a resource quota corresponding to each first priority, where the first priority is any priority except for a highest priority in the multiple priorities, the second priority is included in the multiple priorities, and the second priority is higher than the first priority; updating the resource reservation quota according to the task volumes of the 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 resource quota which can not be preempted is reserved for the task with the lower priority while the computing resources of the task with the highest priority are sufficient, the resource quota of the task with the lower priority is adjusted in real time, the reasonable supply of the computing resources required by the task with each priority by the resource platform is guaranteed, the balance of the resource allocation process is improved, and the overall resource utilization rate of the resource platform is further improved.
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 present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow diagram illustrating a method of resource allocation in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram of a method of allocating computing resources according to the one shown in FIG. 1;
FIG. 3 is a flow diagram of a method of updating a resource reservation quota in accordance with the method shown in FIG. 1;
FIG. 4 is a flow chart of another resource allocation method according to that shown in FIG. 1;
FIG. 5 is a block diagram illustrating a resource allocation apparatus in accordance with an example embodiment;
FIG. 6 is a block diagram of another resource allocation apparatus according to that shown in FIG. 5;
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
In the related art of resource allocation, resource allocation for multiple users (or called service ends) or user groups is usually implemented by task priority policy. In the task priority policy, a plurality of task priorities arranged from high to low may be set. When the user issues the tasks, a high priority can be set for more important tasks, and a low priority can be set for less important tasks. After the priority of each task is determined, the computing resource allocation process of the task can be executed by combining the task priority strategy and the resource quota concept. Specifically, in the process of allocating computing resources, each priority level corresponds to its own resource quota, and a task with a high priority level can occupy the resource quota of a task lower than its priority level without limitation. The resource allocation mode completely inclines all the computing resources in the resource platform to the task with the highest priority, the supply condition of the computing resources of the tasks with other priorities except the task with the highest priority is not considered, the balance of the whole resource allocation process is poor, and the resource utilization rate of the whole resource platform is insufficient.
To this end, the present disclosure provides a resource allocation method, which specifically includes:
before introducing the resource allocation method provided by the present disclosure, a target application scenario related to each embodiment in the present disclosure is first introduced, where the target application scenario includes a resource platform, the resource platform is a cloud computing platform, the cloud computing platform includes at least one scheduler provided with a resource scheduling system, and a plurality of resource servers, and the resource servers are cloud servers that have computing resources such as GPU (Graphics Processing Unit) computing resources, CPU (Central Processing Unit) computing resources, and memory resources, and can provide cloud data acquisition and cloud computing services for received computing tasks.
Fig. 1 is a flowchart illustrating a resource allocation method according to an exemplary embodiment, where the method is applied to the cloud computing platform described in the foregoing application scenario, as shown in fig. 1, and 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 resource quota of each priority in the preset multiple priorities in the resource platform, and the resource reservation quota which is not allowed to be preempted by the task with the second priority in the resource quota corresponding to each first priority, where the first priority is any priority except the highest priority in the multiple priorities, the second priority is included in the multiple 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 amount" related thereto may represent the number of entity devices that calculate the resource, or the capacity or the computing capacity of the resource device. For example, the resource quota corresponding to the priority a is 80 GPU computing resources, which actually means that GPU computing resources can be allocated to the task with the priority a from 80 (with the same computing power) video cards. Alternatively, 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 having the priority a from the storage capacity of 20 capacity units, where the capacity unit may be mb (mbyte), gb (gigabyte), or a larger storage capacity unit.
For example, in the basic task priority policy, a task with a higher priority may preempt a resource quota corresponding to a lower priority, and a task with a lower priority may not occupy 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, and the resource quota corresponding to the priority a is 100 computing resources, it actually indicates that computing resources can be allocated to the task B from the 80 computing resources, computing resources can be allocated to the task a from the 100 computing resources, and the task a can preempt 80 computing resources that are originally belonging to the task B for use, but the task B cannot occupy 100 computing resources that are belonging to the task a. In the embodiment of the present disclosure, besides the basic task priority policy, a certain resource quota that cannot be preempted (i.e., the resource reservation quota) is reserved for other priorities except the highest priority. For example, for a priority a and a priority B ordered from high to low, the resource quotas corresponding to the two priorities are: 80 and 40 (computing resources), where the resource reservation quotas corresponding to the priority B (the first priority) are: 10 (computing resources). If 80 computing resources are used up by a task with priority a, the newly received task with priority a may preempt computing resources in the resource quota of 40-10 to 30 computing resources corresponding to priority B, but may not 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 volumes of the first tasks received in the ith time period, so as to obtain updated resource quota information.
For example, the ith time period and the following (i + 1) th time period may have 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 volume of the plurality of first tasks with different priorities received in one week, and the updated resource reservation quota replaces the resource reservation quota in the original resource quota information, so as to obtain the updated resource quota information. The task volume includes: the task volume of the first task with different priorities. Still taking priority a and priority B as examples above, the task volume may include: the number of first tasks with priority a, and the number of first tasks with priority B. Alternatively, the task volume may include: the amount of computing resources ever occupied by the first task with priority a during the ith time period, and the amount of computing resources ever occupied by the first task with priority B during the ith time period.
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 is not described here again.
In summary, according to the technical solution provided by the embodiment 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: a preset resource quota of each priority in the multiple priorities in the resource platform, and a resource reservation quota which is not allowed to be preempted by a task with a second priority in a resource quota corresponding to each first priority, where the first priority is any priority except for a highest priority in the multiple priorities, the second priority is included in the multiple priorities, and the second priority is higher than the first priority; updating the resource reservation quota according to the task volumes of the 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 resource quota which can not be preempted is reserved for the task with the lower priority while the computing resources of the task with the highest priority are sufficient, the resource quota of the task with the lower priority is adjusted in real time, the reasonable supply of the computing resources required by the task with each priority by the resource platform is guaranteed, the balance of the resource allocation process is improved, and the overall resource utilization rate of the resource platform is further improved.
FIG. 2 is a flow chart of a method of allocating computing resources according to the method shown in FIG. 1, and as shown in FIG. 2, this step 101 may include: step 1011 and 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 according to 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 a first remaining quota of the first resource quota is less than the resource demand of the third task and the third priority is not the lowest priority among the multiple priorities, a resource reservation quota corresponding to each fourth priority is determined according to the resource quota information.
The fourth priority is included in the multiple priorities and is lower than the third priority, and the first remaining quota is a resource quota of the first resource quota except for an occupied resource quota.
In step 1014, a computing resource is allocated to the third task from a second remaining quota of the second resource quotas corresponding to the at least one fourth priority and the first remaining quota.
The second remaining quota is a resource quota of the second resource quota except for the occupied resource quota and the resource reservation quota corresponding to the fourth priority.
Illustratively, priority a, priority B, priority C, and priority D are ordered from high to low. If it is determined that the third priority is priority B, in step 1012, it may be determined that the resource quota corresponding to priority B is: 80 (computing resources). If 30 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, it is determined in step 1013 that the first remaining quota is smaller than the resource demand of the third task, and then resource reservation quotas corresponding to the priority C and the priority D (both of which are fourth priorities) are determined according to the resource quota information. If the resource quota corresponding to the priority C is 20 computing resources, the occupied resource quota of the 20 computing resources is 8, the resource reservation quota corresponding to the priority C is 2, the resource quota corresponding to the priority D is 10 computing resources, the occupied resource quota of the 10 computing resources is 4, the resource reservation quota for priority D is 1, then in step 1014, from the first remaining quota (50 computing resources), and, a second remaining quota (20-8-2 ═ 10 computing resources) of the second resource quota corresponding to the priority C, or, and allocating computing resources for the third task from among a second remaining quota ((20-8-2) + (10-4-1) ═ 15 computing resources) in a second resource quota corresponding to both the priority C and the priority D.
In step 1015, if the first remaining quota of the first resource quota is smaller than the resource demand of the third task and the third priority is the lowest priority, stopping allocating the computing resource to the third task.
Still taking the priority a, the priority B, the priority C, and the priority D as an example, if the third priority is the priority D, the first remaining quota is 50 computing resources, and the resource demand of the third task is 60 computing resources, it is determined that the first remaining quota corresponding to the third priority is not enough to execute the third task, and no resource quota corresponding to a lower priority can be preempted, and at this time, no computing resource is allocated to the third task.
In step 1016, if the first remaining quota is greater than or equal to the resource demand, the computing resource is allocated for the third task from the first remaining quota.
Still taking the priority a, the priority B, the priority C, and the priority D as an example, 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 it is not necessary to preempt 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 flowchart of a method for updating resource reservation quotas according to fig. 1, where the task volume may include: a first task amount of the first task with the first priority and a second task amount of the first task with the highest priority, as shown in fig. 3, the step 102 may include:
in step 1021, the first task volume and the second task volume are determined.
For example, the first task amount and the second task amount may be the number of tasks or the total amount of computing resources once occupied by the tasks, and in the embodiment of the present disclosure, the step 1021 and the step 1023 are described by 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 to obtain the updated resource quota information.
Illustratively, priority a, priority B, priority C, and priority D 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 large, and resource reservation quotas corresponding to other priorities need to be reduced, so as to vacate more idle computing resources for the first task with the priority a. In addition, another situation of reducing the resource reservation quotas of other priorities is that, for other priorities except for the priority a (highest priority), for example, the priority B, if the task volume of the first task with the priority B received in the ith time period is extremely small, the resource reservation quotas corresponding to the priority B can be reduced in a targeted manner.
In step 1023, when the first task volume is greater than a second preset threshold, the first priority is not the lowest priority among the multiple priorities, and the second task volume 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 a fifth priority is reduced to obtain the updated resource quota information.
Wherein the fifth priority is included in the plurality of priorities and the fifth priority is lower than the first priority.
Still taking the priority a, the priority B, the priority C, and the priority D as an example, if the task volume of the first task with the priority B is large (larger than the second preset threshold), the priority B is not the lowest priority (not the priority D), and the task volume of the first task with the priority a does not exceed the expectation (smaller than or equal to the first preset threshold), at this time, the resource reservation quotas of the priority B, the priority C, and the priority D may be "internally adjusted". Specifically, while 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/is 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 resource allocation method shown in 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, the method may further include:
in step 104, in a target process of allocating computing resources for each first task or each second task, if a second computing resource in the resource platform fails, the first computing resource is turned on, so that the target process is continuously executed by replacing the second computing resource with the first computing resource.
Exemplarily, in the embodiment of the present disclosure, the quota management concept adopted in the resource allocation process further includes 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 the computing resource, but the part of the resource device is in a closed state in a normal state, which may be referred to as a redundant resource device. If a second computing resource in the resource platform fails or the amount of the task 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 resource device corresponding to the first computing resource may be turned on to continue executing the target process by replacing the second computing resource with the first computing resource.
Therefore, in the embodiment of the present disclosure, a certain static resource reservation quota may be set for the resource platform, and the static resource reservation quota is enabled when the computing resource fails, so that a situation of computing resource shortage caused by a reduction of computing resource devices is avoided, and the overall stability of the resource platform is improved.
In summary, according to the technical solution provided by the embodiment 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: a preset resource quota of each priority in the multiple priorities in the resource platform, and a resource reservation quota which is not allowed to be preempted by a task with a second priority in a resource quota corresponding to each first priority, where the first priority is any priority except for a highest priority in the multiple priorities, the second priority is included in the multiple priorities, and the second priority is higher than the first priority; updating the resource reservation quota according to the task volumes of the 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 resource quota which can not be preempted is reserved for the task with the lower priority while the computing resources of the task with the highest priority are sufficient, the resource quota of the task with the lower priority is adjusted in real time, the reasonable supply of the computing resources required by the task with each priority by the resource platform is guaranteed, the balance of the resource allocation process is improved, and the overall resource utilization rate of the resource platform is further improved.
Fig. 5 is a block diagram illustrating a resource allocation apparatus according to an exemplary embodiment, as shown in fig. 5, applied to the cloud computing platform described in the foregoing application scenario, where the apparatus 500 includes:
a first resource allocation module 510, configured to allocate, in an ith time period, a computing resource 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: a preset resource quota of each priority in the multiple priorities in the resource platform, and a resource reservation quota which is not allowed to be preempted by a task with a second priority in a resource quota corresponding to each first priority, where the first priority is any priority except for a highest priority in the multiple priorities, the second priority is included in the multiple priorities, and the second priority is higher than the first priority;
a quota updating module 520, configured to update the resource reservation quota according to the task volume of the 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, in an i +1 th time period, a computing resource to each second task according to the updated resource quota information and the received priority information of each second task.
Optionally, the first resource allocation module 510 is configured to:
determining a third priority corresponding to a third task according to 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 under the condition that a 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 among the multiple priorities, wherein the fourth priority is included in the multiple priorities and is lower than the third priority, and the first remaining quota is a resource quota except for an occupied resource quota in the first resource quota;
allocating computing resources to the third task from a second remaining quota of a second resource quota corresponding to at least one fourth priority and the first remaining quota, where the second remaining quota is a resource quota of the second resource quota except an occupied resource quota and a resource reservation quota corresponding to the fourth priority; alternatively, the first and second electrodes may be,
stopping allocating computing resources for the third task when a 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; alternatively, the first and second electrodes may be,
and under the condition that the first residual quota is larger 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 with the first priority and a second task volume of the first task with the highest priority, wherein the quota updating module 520 is configured to:
determining the first task amount and the second task amount;
reducing the resource reservation quota corresponding to the first priority to acquire the updated resource quota information under the condition that the second task amount is larger than a first preset threshold; and the number of the first and second groups,
when the first task volume is greater than a second preset threshold, the first priority is not the lowest priority among the multiple priorities, and the second task volume is less than or equal to the first preset threshold, while increasing the resource reservation quota corresponding to the first priority, reducing the resource reservation quota corresponding to at least one fifth priority to obtain the updated resource quota information, where the fifth priority is included in the multiple priorities and is lower than the first priority.
Fig. 6 is a block diagram of another resource allocation apparatus shown in 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, the apparatus 500 may further include:
the resource starting module 540 is configured to, in a target process of allocating the computing resource for each first task or each second task, start the first computing resource if a second computing resource in the resource platform fails, so as to continue to execute the target process by replacing the second computing resource with the first computing resource.
In summary, according to the technical solution provided by the embodiment 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: a preset resource quota of each priority in the multiple priorities in the resource platform, and a resource reservation quota which is not allowed to be preempted by a task with a second priority in a resource quota corresponding to each first priority, where the first priority is any priority except for a highest priority in the multiple priorities, the second priority is included in the multiple priorities, and the second priority is higher than the first priority; updating the resource reservation quota according to the task volumes of the 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 resource quota which can not be preempted is reserved for the task with the lower priority while the computing resources of the task with the highest priority are sufficient, the resource quota of the task with the lower priority is adjusted in real time, the reasonable supply of the computing resources required by the task with each priority by the resource platform is guaranteed, the balance of the resource allocation process is improved, and the overall resource utilization rate of the resource platform is further improved.
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment. For example, the electronic device 700 may be a scheduler or a 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 applications, that are 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 methods illustrated in fig. 1-4.
The electronic device 700 may also include a power 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, such as a Windows Server, stored in memory 732TM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTMOr the like.
The electronic device provided by the embodiment of the disclosure can reserve the resource quota which can not be preempted for the task with the lower priority while ensuring that the computing resources of the task with the highest priority are sufficient, and adjust the resource quota of the task with the lower priority in real time, so as to 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.
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 variations, 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 will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A resource allocation method is applied to a cloud computing platform and is characterized by comprising the following steps:
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 resource quota of each priority in a plurality of preset priorities in the resource platform, and the resource reservation quota which is not allowed to be preempted by the task with the second priority in the resource quota corresponding to each first priority, wherein the first priority is any priority except the highest priority in the priorities, the second priority is included in the priorities, and the second priority is higher than the first priority;
updating the resource reservation quota according to the task volumes of the 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.
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 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 under the condition that a first remaining quota in the first resource quota is smaller than a resource demand of the third task and the third priority is not the lowest priority among the plurality of priorities, wherein 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 for an occupied resource quota in the first resource quota;
allocating computing resources to the third task from a second remaining quota of a second resource quota corresponding to at least one fourth priority and the first remaining quota, where the second remaining quota is a resource quota of the second resource quota except for an occupied resource quota and a resource reservation quota corresponding to the fourth priority; alternatively, the first and second electrodes may be,
stopping allocating computing resources for the third task when a first remaining quota of the first resource quotas is less than a resource demand of the third task and the third priority is the lowest priority; alternatively, the first and second electrodes may be,
and under the condition that the first remaining quota is larger than or equal to the resource demand, allocating computing resources for the third task from the first remaining quota.
3. The method of claim 1, wherein the task volume comprises: the updating the resource reservation quota according to the task volumes of the plurality of first tasks received in the ith time period to obtain 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 to acquire the updated resource quota information under the condition that the second task amount is larger than a first preset threshold; and the number of the first and second groups,
when the first task volume is greater than a second preset threshold, the first priority is not the lowest priority among the multiple priorities, and the second task volume is less than or equal to the first preset threshold, while increasing the resource reservation quota corresponding to the first priority, reducing the resource reservation quota corresponding to at least one fifth priority to obtain the updated resource quota information, where the fifth priority is included in the multiple priorities and is lower than the first priority.
4. The method of claim 1, 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 a first computing resource corresponding to the static resource reservation quota in the resource platform is in a closed state, and the method further includes:
in a target process of allocating 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 that the target process is continuously executed by replacing the second computing resource with the first computing resource.
5. A resource allocation device applied to a cloud computing platform is characterized by comprising:
the first resource allocation module is configured to allocate computing resources to 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 resource quota of each priority in a plurality of preset priorities in the resource platform, and the resource reservation quota which is not allowed to be preempted by the task with the second priority in the resource quota corresponding to each first priority, wherein the first priority is any priority except the highest priority in the priorities, the second priority is included in the priorities, and the second priority is higher than the first priority;
a quota updating module configured to update the resource reservation quota according to the task volume of the plurality of first tasks received in the ith time period, so as to obtain updated resource quota information;
and the second resource allocation module is configured to allocate computing resources to 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.
6. The apparatus of claim 5, wherein the first resource allocation module is configured to:
determining a third priority corresponding to a third task according to 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 under the condition that a first remaining quota in the first resource quota is smaller than a resource demand of the third task and the third priority is not the lowest priority among the plurality of priorities, wherein 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 for an occupied resource quota in the first resource quota;
allocating computing resources to the third task from a second remaining quota of a second resource quota corresponding to at least one fourth priority and the first remaining quota, where the second remaining quota is a resource quota of the second resource quota except for an occupied resource quota and a resource reservation quota corresponding to the fourth priority; alternatively, the first and second electrodes may be,
stopping allocating computing resources for the third task when a first remaining quota of the first resource quotas is less than a resource demand of the third task and the third priority is the lowest priority; alternatively, the first and second electrodes may be,
and under the condition that the first remaining quota is larger than or equal to the resource demand, allocating computing resources for the third task from the first remaining quota.
7. The apparatus of claim 5, wherein the task volume comprises: 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 to acquire the updated resource quota information under the condition that the second task amount is larger than a first preset threshold; and the number of the first and second groups,
when the first task volume is greater than a second preset threshold, the first priority is not the lowest priority among the multiple priorities, and the second task volume is less than or equal to the first preset threshold, while increasing the resource reservation quota corresponding to the first priority, reducing the resource reservation quota corresponding to at least one fifth priority to obtain the updated resource quota information, where the fifth priority is included in the multiple priorities and is lower than the first priority.
8. The apparatus of claim 5, 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 a first computing resource corresponding to the static resource reservation quota in the resource platform is in a closed state, the apparatus further comprising:
a resource starting module configured to, in a target process of allocating computing resources for each first task or each second task, start the first computing resource if a second computing resource in the resource platform fails, so as to continue to execute the target process by replacing the second computing resource with the first computing resource.
9. A computer-readable storage medium, on which computer program instructions are stored, which program instructions, when executed by a processor, carry out the steps of the method according to any one of claims 1 to 4.
10. An electronic device, comprising: the resource allocation arrangement of any one of claims 5-8.
CN202010601511.4A 2020-06-28 2020-06-28 Resource allocation method, device, storage medium and electronic equipment Pending CN111798113A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010601511.4A CN111798113A (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 CN111798113A (en) 2020-06-28 2020-06-28 Resource allocation method, device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN111798113A true CN111798113A (en) 2020-10-20

Family

ID=72804733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010601511.4A Pending CN111798113A (en) 2020-06-28 2020-06-28 Resource allocation method, device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111798113A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988363A (en) * 2021-05-17 2021-06-18 阿里云计算有限公司 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
CN115033392A (en) * 2022-08-10 2022-09-09 北京网藤科技有限公司 Method and system for self-adaptively allocating computing resources
US20220318061A1 (en) * 2021-03-31 2022-10-06 Mcafee, Llc Dynamic process criticality scoring
CN115209166A (en) * 2021-04-12 2022-10-18 北京字节跳动网络技术有限公司 Message sending method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030061260A1 (en) * 2001-09-25 2003-03-27 Timesys Corporation Resource reservation and priority management
CN106911592A (en) * 2016-06-01 2017-06-30 阿里巴巴集团控股有限公司 A kind of adaptive resource allocation method and device
CN107291545A (en) * 2017-08-07 2017-10-24 星环信息科技(上海)有限公司 The method for scheduling task and equipment of multi-user in computing cluster
CN109542603A (en) * 2018-11-22 2019-03-29 北京航空航天大学 It is a kind of improve different priorities task between isolation multi dimensional resource shielding system
CN110837410A (en) * 2019-10-30 2020-02-25 北京奇艺世纪科技有限公司 Task scheduling method and device, electronic equipment and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030061260A1 (en) * 2001-09-25 2003-03-27 Timesys Corporation Resource reservation and priority management
CN106911592A (en) * 2016-06-01 2017-06-30 阿里巴巴集团控股有限公司 A kind of adaptive resource allocation method and device
CN107291545A (en) * 2017-08-07 2017-10-24 星环信息科技(上海)有限公司 The method for scheduling task and equipment of multi-user in computing cluster
CN109542603A (en) * 2018-11-22 2019-03-29 北京航空航天大学 It is a kind of improve different priorities task between isolation multi dimensional resource shielding system
CN110837410A (en) * 2019-10-30 2020-02-25 北京奇艺世纪科技有限公司 Task scheduling method and device, electronic equipment and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
胡嵩;熊安萍;张敏;: "光网格计算环境下基于抢占的多优先级提前资源预留机制", 重庆邮电大学学报(自然科学版), no. 06 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220318061A1 (en) * 2021-03-31 2022-10-06 Mcafee, Llc Dynamic process criticality scoring
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
CN112988363A (en) * 2021-05-17 2021-06-18 阿里云计算有限公司 Resource scheduling method, device, server 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
CN115033392A (en) * 2022-08-10 2022-09-09 北京网藤科技有限公司 Method and system for self-adaptively allocating computing resources
CN115033392B (en) * 2022-08-10 2022-11-04 北京网藤科技有限公司 Method and system for self-adaptively allocating computing resources

Similar Documents

Publication Publication Date Title
CN111798113A (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
CN108337109B (en) Resource allocation method and device and resource allocation system
US11231955B1 (en) Dynamically reallocating memory in an on-demand code execution system
JP2004021982A (en) Method and system for dynamically allocating computer system resource
CN111966500A (en) Resource scheduling method and device, electronic equipment and storage medium
CN109564528B (en) System and method for computing resource allocation in distributed computing
CN112231049A (en) Computing equipment sharing method, device, equipment and storage medium based on kubernets
CN112269641A (en) Scheduling method, scheduling device, electronic equipment and storage medium
CN115543615A (en) Resource allocation method and device, electronic equipment and storage medium
CN110162397B (en) Resource allocation method, device and system
CN113674131A (en) Hardware accelerator equipment management method and device, electronic equipment and storage medium
CN112749002A (en) Method and device for dynamically managing cluster resources
CN111796933B (en) Resource scheduling method, device, storage medium and electronic equipment
CN113010309B (en) Cluster resource scheduling method, device, storage medium, equipment and program product
CN112073532B (en) Resource allocation method and device
CN115361349B (en) Resource using method and device
CN114327862B (en) Memory allocation method and device, electronic equipment and storage medium
CN111813564B (en) Cluster resource management method and device and container cluster management system
CN111475277A (en) Resource allocation method, system, equipment and machine readable storage medium
CN110955522B (en) Resource management method and system for coordination performance isolation and data recovery optimization
CN111796934A (en) Task issuing method and device, storage medium and electronic equipment
CN110750330A (en) Virtual machine creating method, system, electronic equipment and storage medium
CN115794305B (en) Method and device for adjusting memory of virtual machine, storage medium and electronic device

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