CN115168023A - Resource allocation method and device - Google Patents

Resource allocation method and device Download PDF

Info

Publication number
CN115168023A
CN115168023A CN202210530923.2A CN202210530923A CN115168023A CN 115168023 A CN115168023 A CN 115168023A CN 202210530923 A CN202210530923 A CN 202210530923A CN 115168023 A CN115168023 A CN 115168023A
Authority
CN
China
Prior art keywords
resource
task
combination
resources
target
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.)
Granted
Application number
CN202210530923.2A
Other languages
Chinese (zh)
Other versions
CN115168023B (en
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.)
Alibaba China Co Ltd
Original Assignee
Alibaba China 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 Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202210530923.2A priority Critical patent/CN115168023B/en
Publication of CN115168023A publication Critical patent/CN115168023A/en
Application granted granted Critical
Publication of CN115168023B publication Critical patent/CN115168023B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

An embodiment of the present specification provides a resource allocation method and a device, where the resource allocation method includes: receiving a resource allocation request, wherein the resource allocation request carries a resource allocation increment; determining a target total resource amount based on the resource allocation increment and the current resource amount of each task; acquiring resource use information corresponding to a plurality of initial resource combinations under the total amount of the target resources, wherein the initial resource combinations are obtained by performing resource allocation on each task according to the total amount of the target resources; and determining a target resource combination according to the resource use information, and allocating the resources of each task according to the target resource combination and the current resource quantity of each task. The method can improve the allocation efficiency of the resources, thereby improving the use efficiency of the resources.

Description

Resource allocation method and device
Technical Field
The embodiment of the specification relates to the technical field of computers, in particular to a resource allocation method.
Background
With the continuous development of various promotion projects, the strategy of the engine system is more and more complex, which leads to the larger and larger amount of resources used by the system. The supply of resources is greatly affected due to series of problems such as global capacity and cost, and insufficient resources will be a long-term and major challenge for engineering platforms. Under such a background, how to fully utilize the current resources becomes more and more important to improve the utilization efficiency of the resources.
Disclosure of Invention
In view of this, the embodiments of the present disclosure provide a resource allocation method. One or more embodiments of the present disclosure also relate to a resource allocation apparatus, a computing device, a computer-readable storage medium, and a computer program, so as to solve the technical deficiencies of the prior art.
According to a first aspect of embodiments of the present specification, there is provided a resource allocation method, including:
receiving a resource allocation request, wherein the resource allocation request carries a resource allocation increment;
determining a target total resource amount based on the resource allocation increment and the current resource amount of each task;
acquiring resource use information corresponding to a plurality of initial resource combinations under the total amount of the target resources, wherein the initial resource combinations are obtained by performing resource allocation on each task according to the total amount of the target resources;
and determining a target resource combination according to the resource use information, and allocating the resources of each task according to the target resource combination and the current resource quantity of each task.
Optionally, the obtaining resource usage information corresponding to a plurality of initial resource combinations under the total amount of the target resource includes:
determining at least one appointed resource combination in a plurality of initial resource combinations under the total amount of the target resources according to preset combination conditions, and predicting resource use information corresponding to the at least one appointed resource combination;
and calculating resource use information corresponding to initial resource combinations except the appointed resource combinations in the initial resource combinations by utilizing a preset interpolation algorithm based on the resource use information corresponding to the appointed resource combinations.
Optionally, the predicting resource usage information corresponding to the at least one specified resource combination includes:
for any specified resource combination, determining the task quantity of a first task according to the initial resource quantity allocated to the first task in the specified resource combination, wherein the first task is any one of the tasks;
and determining resource use information corresponding to the specified resource combination based on the task amount of each task.
Optionally, the determining the task amount of the first task according to the initial resource amount allocated to the first task in the specified resource combination includes:
acquiring task response time of the first task;
and calculating according to the task response time of the first task and the initial resource quantity to obtain the task quantity of the first task.
Optionally, the determining resource usage information corresponding to the specified resource combination based on the task amount of each task includes:
determining a task gear corresponding to the first task according to the task amount of the first task;
and determining resource use information corresponding to the specified resource combination based on the task gear of each task.
Optionally, the determining, based on the task gear of each task, resource usage information corresponding to the specified resource combination includes:
combining task gears of each task to obtain at least one task gear pair;
acquiring sub-resource use information corresponding to each task gear pair;
and determining the resource use information corresponding to the specified resource combination according to the use information of each sub-resource.
Optionally, the combining task gears of each task to obtain at least one task gear pair includes:
acquiring a task execution sequence of each task;
and determining task gears of two tasks adjacent to the task execution sequence as a task gear pair to obtain at least one task gear pair.
Optionally, the allocating the resources of each task according to the target resource combination and the current resource quantity of each task includes:
determining a deployment strategy according to the target resource combination and the current resource quantity of each task;
and performing resource allocation on each task based on the allocation strategy.
According to a second aspect of embodiments herein, there is provided a resource allocating apparatus, including:
a receiving module configured to receive a resource allocation request, wherein the resource allocation request carries a resource allocation increment;
a determining module configured to determine a total amount of target resources based on the resource allocation increment and a current resource amount of each task;
an obtaining module configured to obtain resource usage information corresponding to a plurality of initial resource combinations under the target resource total amount, wherein the initial resource combinations are obtained by performing resource allocation on each task according to the target resource total amount;
and the allocation module is configured to determine a target resource combination according to the resource use information and allocate the resources of each task according to the target resource combination and the current resource quantity of each task.
Optionally, the obtaining module is further configured to:
determining at least one appointed resource combination in a plurality of initial resource combinations under the total amount of the target resources according to preset combination conditions, and predicting resource use information corresponding to the at least one appointed resource combination;
and calculating resource use information corresponding to the initial resource combinations in the initial resource combinations except the appointed resource combinations by utilizing a preset interpolation algorithm based on the resource use information corresponding to the appointed resource combinations.
Optionally, the obtaining module is further configured to:
for any specified resource combination, determining the task quantity of a first task according to the initial resource quantity allocated to the first task in the specified resource combination, wherein the first task is any one of the tasks;
and determining the resource use information corresponding to the specified resource combination based on the task amount of each task.
Optionally, the obtaining module is further configured to:
acquiring task response time of the first task;
and calculating according to the task response time of the first task and the initial resource quantity to obtain the task quantity of the first task.
Optionally, the obtaining module is further configured to:
determining a task gear corresponding to the first task according to the task amount of the first task;
and determining resource use information corresponding to the specified resource combination based on the task gear of each task.
Optionally, the obtaining module is further configured to:
combining task gears of each task to obtain at least one task gear pair;
acquiring sub-resource use information corresponding to each task gear pair;
and determining the resource use information corresponding to the specified resource combination according to the use information of each sub-resource.
Optionally, the obtaining module is further configured to:
acquiring a task execution sequence of each task;
and determining the task gear of two tasks adjacent to the task execution sequence as a task gear pair to obtain at least one task gear pair.
Optionally, the fitting module is further configured to:
determining a deployment strategy according to the target resource combination and the current resource quantity of each task;
and performing resource allocation on each task based on the allocation strategy.
According to a third aspect of embodiments herein, there is provided a computing device comprising:
a memory and a processor;
the memory is used for storing computer-executable instructions, and the processor is used for executing the computer-executable instructions, and the computer-executable instructions realize the steps of the resource allocation method when being executed by the processor.
According to a fourth aspect of the embodiments of the present specification, there is provided a computer-readable storage medium storing computer-executable instructions, which when executed by a processor, implement the steps of the resource allocation method described above.
According to a fifth aspect of the embodiments of the present specification, there is provided a computer program, wherein when the computer program is executed in a computer, the computer program causes the computer to execute the steps of the resource allocation method.
The resource allocation method provided by the present specification receives a resource allocation request, where the resource allocation request carries a resource allocation increment; determining the total amount of target resources based on the resource allocation increment and the current resource quantity of each task; acquiring resource use information corresponding to a plurality of initial resource combinations under the total amount of the target resources, wherein the initial resource combinations are obtained by performing resource allocation on each task according to the total amount of the target resources; and determining a target resource combination according to the resource use information, and allocating the resources of each task according to the target resource combination and the current resource quantity of each task. And determining a target resource combination with a larger project income by determining the target resource combination according to the resource use information, and further realizing self-adaptive resource allocation based on the target resource combination and the current resource quantity of each task. In addition, resource use information corresponding to a plurality of initial resource combinations under the total amount of target resources is acquired, the efficiency of using resources based on each task is realized, the allocation adjustment is automatically carried out, more project profits are taken under the condition of limited resources, the resources are allocated to modules with high efficiency, the modules with low efficiency can be further promoted to carry out performance optimization, the resource use efficiency of the whole system is improved, and the goal of reducing cost and improving efficiency is realized. And further, the resource allocation efficiency can be improved, the resource use efficiency is further improved, and resource allocation is systematically carried out from the concept, the theory and the framework.
Drawings
Fig. 1 is a flowchart of a resource allocation method according to an embodiment of the present disclosure;
fig. 2 is a diagram illustrating an effect of displaying resource usage information in a resource allocation method according to an embodiment of the present specification;
fig. 3 is a schematic diagram illustrating a deployment policy in a resource deployment method according to an embodiment of the present disclosure;
fig. 4 is a schematic processing diagram of a deployment policy in a resource deployment method according to an embodiment of the present disclosure;
FIG. 5 is a flowchart illustrating a processing procedure of a resource allocation method according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a resource allocation apparatus according to an embodiment of the present disclosure;
fig. 7 is a block diagram of a computing device according to an embodiment of the present disclosure.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present description. This description may be implemented in many ways other than those specifically set forth herein, and those skilled in the art will appreciate that the present description is susceptible to similar generalizations without departing from the scope of the description, and thus is not limited to the specific implementations disclosed below.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, etc. may be used herein in one or more embodiments to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first can also be referred to as a second and, similarly, a second can also be referred to as a first without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at" \8230; "or" when 8230; \8230; "or" in response to a determination ", depending on the context.
First, the noun terms to which one or more embodiments of the present specification relate are explained.
Gear: policy complexity level, a larger value indicates a more complex policy.
rpm: revenue Per Mille display harvest thousands of times.
Resource use efficiency: the project resource usage increments per resource.
Calculating the strength: i.e., the amount of computation, approximates the product of machine resources and computation time (task response time).
Task (2): a module or application, i.e. a service of the presence engine.
The resource allocation provided in this specification will then be briefly described.
As various promotion projects continue to develop, engine system strategies become more complex, which results in an increasing amount of resources being used by the system. The supply of resources is greatly affected due to series of problems such as global capacity and cost, and insufficient resources will be a long-term and major challenge for engineering platforms. Under such a background, how to fully utilize the current resources becomes more and more important to improve the utilization efficiency of the resources.
In addition, the system often faces a big clue in the scene of the e-market, the usage amount of system resources needs to be changed frequently, in order to accept more flows, the system often needs to be degraded under the condition of meeting the requirement of long response time of a front-end target, the manual implementation cost is high, and in addition, the timeliness and the effect have certain loss. It is important to fully utilize the resources of the mental effort to obtain more project profits.
The existing method mainly aims to automatically expand and contract capacity through load balancing or intelligent degradation, mainly solves the problem of insufficient capacity, supports more flows on the premise of ensuring system stability, and does not directly optimize the global resource allocation efficiency facing project income.
In view of the above problems, the present specification provides a resource allocation method, which receives a resource allocation request, where the resource allocation request carries a resource allocation increment; determining a target total resource amount based on the resource allocation increment and the current resource amount of each task; acquiring resource use information corresponding to a plurality of initial resource combinations under the total amount of the target resources, wherein the initial resource combinations are obtained by performing resource allocation on each task according to the total amount of the target resources; and determining a target resource combination according to the resource use information, and allocating the resources of each task according to the target resource combination and the current resource quantity of each task. And determining a target resource combination with a larger project income by determining the target resource combination according to the resource use information, and further realizing self-adaptive resource allocation based on the target resource combination and the current resource quantity of each task. In addition, resource use information corresponding to a plurality of initial resource combinations under the total amount of target resources is acquired, the efficiency of using resources based on each task is realized, the allocation adjustment is automatically carried out, more project profits are taken under the condition of limited resources, the resources are allocated to modules with high efficiency, the modules with low efficiency can be further promoted to carry out performance optimization, the resource use efficiency of the whole system is improved, and the goal of reducing cost and improving efficiency is realized. And further, the resource allocation efficiency can be improved, the resource utilization efficiency is further improved, and resource allocation is systematically carried out from the aspects of concept, theory and framework.
In the present specification, a resource allocating method is provided, and the present specification relates to a resource allocating apparatus, a computing device, and a computer-readable storage medium, which are described in detail in the following embodiments one by one.
Referring to fig. 1, fig. 1 shows a flowchart of a resource allocation method provided in an embodiment of the present specification, which specifically includes the following steps.
Step 102: receiving a resource allocation request, wherein the resource allocation request carries a resource allocation increment.
The executing body for implementing the resource allocation method may be a computing device with a resource allocation function, such as a server, a terminal, etc. with a resource allocation function.
Specifically, a resource refers to a unit for performing a task; resource allocation refers to adjusting resources of a task, such as increasing the number of resources, reducing the number of resources, and the like; resource allocation refers to a request or instruction for starting resource allocation; the resource allocation increment refers to an increased or decreased number of resources, and if the resource allocation increment is +5, 5 resources are represented to be increased, and if the resource allocation increment is-20, 20 resources are represented to be decreased.
In practical application, a user or a resource allocating person can input a resource allocating increment on a resource allocating interface on the intelligent device, and then an executing main body receives a resource allocating request carrying the resource allocating increment after clicking a key for confirming allocation and the like; or the execution main body automatically detects the change of the quantity of the access resources at intervals, and if the change of the quantity of the access resources is detected, the execution main body is triggered to receive a resource allocation request carrying a resource allocation increment. The manner in which the resource allocation request is received is not limited in any way in this specification.
Illustratively, after the user inputs 10 resources less on the resource allocation interface on the smart device, that is, the resource allocation increment is-10, and clicks a key for confirming allocation or the like, the execution subject will receive a resource allocation request carrying "-10".
Step 104: and determining the total amount of the target resources based on the resource allocation increment and the current resource quantity of each task.
And further, determining the total amount of the target resources according to the resource allocation increment and the current resource quantity of each task on the basis of receiving the resource allocation request carrying the resource allocation increment.
Specifically, the task may be a service, such as speech recognition, translation, merchandise sales, advertisement display, or some execution item, such as calculation, statistics, or some application, such as an online search engine, a drawing application, or the like; the current resource quantity refers to the quantity of resources used for executing a certain task currently; the target total number of resources refers to the total number of all resources that can be used to perform the respective task.
In practical application, after receiving the resource allocation request carrying the resource allocation increment, the current resource quantity of each task may be obtained, for example, the current resource quantity of each task is directly read from the cache, or the current resource quantity of each task is directly counted. And then adding the current resource quantity of each task to obtain an initial resource total quantity, namely the total quantity of the resources which are currently put into execution of all the tasks, and then adding the initial resource total quantity and the resource allocation increment to obtain a target resource total quantity. Or adding the current resource quantity of each task to the resource allocation increment to obtain the total quantity of the target resources.
Illustratively, there are two tasks currently invested, task f1 and task f2, where the current resource number of task f1 is 1000, and the current resource number of task f2 is 700. Assuming the resource allocation increment is +200, the total amount of target resources is 1000+700+200=1900.
Step 106: and acquiring resource use information corresponding to a plurality of initial resource combinations under the total amount of the target resources, wherein the initial resource combinations are obtained by performing resource allocation on each task according to the total amount of the target resources.
And further acquiring resource use information corresponding to a plurality of initial resource combinations under the total amount of the target resources on the basis of determining the total amount of the target resources based on the resource allocation increment and the current resource amount of each task.
Specifically, the initial resource combination refers to a combination of initial resource quantities for allocating resources to each task, for example, if the total number of target resources is 30, and each task has 3 tasks, 10 resources are allocated to each task, the initial resource quantity of each task is 10, the initial resource combination is [10,10 ], and if 5 resources are allocated to the first task, 10 resources are allocated to the second task, and 8 resources are allocated to the third task, the initial resource combination is [5,10,8]. The resource use information refers to the use information of resources, such as income, consumption and the like, and rpm, after the resources are allocated to each task according to the initial resource combination.
In practical application, after the total amount of the target resource is determined, a plurality of initial resource combinations under the total amount of the target resource can be directly obtained first, and then resource use information corresponding to each initial resource combination is obtained; and performing resource allocation for each task according to the total amount of the target resources to obtain a plurality of initial resource combinations, and further predicting resource use information corresponding to each initial resource combination.
Illustratively, the total amount of target resources is 5, and if there are 3 tasks, 1 resource can be allocated to each task, so as to obtain an initial resource combination [1, 1]; the first task may be allocated 2 resources, the second and third tasks 1 resource [2, 1]; the first task may be allocated 3 resources, the second and third tasks may be allocated 1 resource [3, 1], and so on, the initial resource combination is obtained as follows: [1,1,1], [2,1,1], [3,1,1], [1,2,1], [1,3,1], [1,1,2], [1,1,3], [2,2,1], [2,1,2] and [1,2,2]. I.e. 10 initial resource combinations are available. Then, the resource usage information corresponding to the 10 initial resource combinations is predicted respectively.
In one or more optional embodiments of the present disclosure, a preset prediction method may be adopted to predict resource usage information corresponding to each initial resource combination one by one. In this way, the accuracy of the predicted resource usage information can be improved. However, under the condition that the number of the initial resource combinations is large, the method can reduce the data processing amount, thereby improving the prediction rate and further improving the resource allocation rate.
In one or more alternative embodiments of the present disclosure, a prediction method may be further used to predict resource usage information of some initial resource combinations in a plurality of initial resource combinations, and then estimate resource usage information of other initial resource combinations according to the resource usage information of the initial resource combinations. That is, the resource usage information corresponding to the plurality of initial resource combinations under the total amount of the target resource is obtained, and the specific implementation process may be as follows:
determining at least one appointed resource combination in a plurality of initial resource combinations under the total amount of the target resources according to preset combination conditions, and predicting resource use information corresponding to the at least one appointed resource combination;
and calculating resource use information corresponding to initial resource combinations except the appointed resource combinations in the initial resource combinations by utilizing a preset interpolation algorithm based on the resource use information corresponding to the appointed resource combinations.
Specifically, the preset combination condition refers to a preset condition for identifying a special resource combination in a plurality of initial resource combinations, for example, the number of initial resources in an initial resource combination is only one or more of 1, 5 and 10; the appointed resource combination refers to an initial resource combination which meets a preset combination condition in a plurality of initial resource combinations; interpolation means that the function values of a plurality of points are inserted into a certain interval by using a function f (x), a proper specific function is made, known values are taken at the points, and the values of the specific function are used as approximate values of the function f (x) at other points of the interval; the interpolation algorithm is an algorithm for realizing interpolation, and can be a nearest neighbor interpolation method, bilinear interpolation, bicubic interpolation and the like; the preset interpolation algorithm refers to a certain preset interpolation algorithm.
In practical application, the preset combination condition may be obtained first, and then the designated resource combination in the multiple initial resource combinations is identified according to the preset combination condition, for example, each initial resource combination is compared with the preset combination condition one by one, and the initial resource combination meeting the preset combination condition is determined as the designated resource combination. And then, predicting the resource use information corresponding to each appointed resource combination by adopting a preset prediction method. Further, a difference algorithm is adopted to predict resource use information corresponding to other initial resource combinations, wherein the other initial resource combinations are non-specified resource combinations in the plurality of initial resource combinations, that is, initial resource combinations other than the specified resource combinations. Therefore, only the resource use information corresponding to some specified initial resource combinations is predicted, and the resource use information corresponding to other initial resource combinations is predicted by adopting a preset interpolation algorithm, so that the data processing amount is greatly reduced, the prediction rate of the resource use information is favorably improved, and the resource allocation rate is further provided.
<xnotran> , 1,10 20 , [1,1,1], [10,10,10], [20,20,20], [10,1,1], [20,1,1], [1,10,1], [1,20,1], [1,1,10], [1,1,20], [10,10,1], [10,20,1], [10,10,20], [10,20,20], [20,10,1], [20,20,1], [20,10,10] . </xnotran> And after the resource use information corresponding to the specified resource combination is obtained, the resource use information corresponding to other initial resource combinations is obtained by using a preset interpolation algorithm.
In one or more optional embodiments of this specification, the resource usage information assigned to the resource combination may be predicted according to the task amount of each task, that is, the resource usage information corresponding to the at least one assigned resource combination is predicted, and a specific implementation process may be as follows:
for any specified resource combination, determining the task quantity of a first task according to the initial resource quantity allocated to the first task in the specified resource combination, wherein the first task is any one of the tasks;
and determining the resource use information corresponding to the specified resource combination based on the task amount of each task.
Specifically, the first task refers to any one of the tasks; the task amount is also the calculation force corresponding to the task; the initial resource amount refers to an amount of resources corresponding to the first task in the specified resource combination.
In practical application, for any one specified resource combination, the initial resource quantity allocated to the first task in the specified resource combination is determined, and since the initial resource quantity is related to the task quantity of the task, the task quantity of the first task can be further determined based on the initial resource quantity of the first task. After the task amount of each task is determined for the specified resource combination, resource usage information corresponding to the specified resource combination is determined based on the task amount of each task. And then, traversing each appointed resource combination until determining the resource use information corresponding to each appointed resource combination.
In one or more optional embodiments of this specification, the task amount may be determined based on the initial resource amount and the task response time, that is, the task amount of the first task is determined according to the initial resource amount allocated to the first task in the specified resource combination, and a specific implementation process may be as follows:
acquiring task response time of the first task;
and calculating according to the task response time of the first task and the initial resource quantity to obtain the task quantity of the first task.
Specifically, the task response time refers to a response time for executing the task.
In practical applications, each task has a corresponding task response time, such as 10 ms, 1 ms, 500 μ s, and so on. In order to ensure the execution quality of the task, the task response time of the task is certain. Since the computation power, i.e., the computation amount, is approximately equal to the product of the task Response Time (RT) and the number of resources. Therefore, when the initial resource amount allocated to the first task in the designated resource combination is determined, the task response time of the first task may be obtained first, and then the task response time of the first task is multiplied by the initial resource amount to obtain the task amount of the first task. Therefore, the task quantity calculation of the tasks can be simplified, the calculation quantity is reduced, and the efficiency of determining the task quantity is improved, so that the determination of the resource use information can be greatly promoted, and the resource allocation efficiency is further improved.
In one or more optional embodiments of the present specification, the sub-resource usage information corresponding to each task may be determined based on the task amount of each task, and then the resource usage information corresponding to the specified resource combination may be determined according to the sub-resource usage information. That is, the sub-resource usage information of different tasks corresponding to different initial resource quantities in all specified resource combinations may be determined, and then when the resource usage information corresponding to a certain specified resource combination is determined, the resource usage information corresponding to the specified resource combination may be determined based on each sub-resource usage information. Therefore, the data size of the resource use information can be reduced, and the efficiency of determining the resource use information is improved.
Illustratively, the preset combination condition is that the initial resource number in the initial resource combination is only one or more of 1,10 and 20, and there are three tasks, then the sub-resource usage information of each task with the initial resource number of 1, the sub-resource usage information of each task with the initial resource number of 10, and the sub-resource usage information of each task with the initial resource number of 20 are determined. Assuming that the total amount of the target resource is 35, the resource combination is specified as [1,1,1], [1,1,10], [1,1,20], [1,10,1], [1,10,10], [1,10,20], [1,20,1], [1,20,10], [10,1,1], [10,1,10], [10,1,20], [10,10,1], [10,10,10], [10,20,1], [20,1,1], [20,1,10] and [20,10,1]. If the resource use information corresponding to the appointed resource combination [10,1,20] is determined, carrying out weighted summation on the sub-resource use information of a first task with the initial resource quantity of 1, the sub-resource use information of a second task with the initial resource quantity of 10 and the sub-resource use information of a third task with the initial resource quantity of 20 to obtain the resource use information corresponding to the appointed resource combination [10,1,20 ]; if the resource use information corresponding to the specified resource combination [10,20,1] is determined, the sub-resource use information of the first task with the initial resource number of 10, the sub-resource use information of the second task with the initial resource number of 20 and the sub-resource use information of the third task with the initial resource number of 1 are weighted and summed to obtain the resource use information corresponding to the specified resource combination [10,20, 1].
In one or more optional embodiments of the present description, the task gear may be determined first, and then the resource usage information may be determined based on the task gear. That is, the determining resource usage information corresponding to the specified resource combination based on the task amount of each task includes:
determining a task gear corresponding to the first task according to the task amount of the first task;
and determining resource use information corresponding to the specified resource combination based on the task gear of each task.
Specifically, the task gear refers to a gear for task execution, such as a difficult gear, a simple gear, e.g., 1 gear, 10 gear, 20 gear, and the like.
In practical application, since the task shift is related to the task amount, the higher the task shift, the larger the task amount, and the lower the task shift, the smaller the task amount, and vice versa. Therefore, the task gear corresponding to the first task can be obtained based on the task amount of the first task, for example, according to the task amount of the first task, the preset task amount and task gear corresponding table is queried to obtain the task amount of the first task, and the task gear corresponding to the first task is determined. Based on the association information between the resource usage information and the task gear, the resource usage information corresponding to the specified resource combination can be further determined based on the task gear of each task. Therefore, the method can be beneficial to quickly determining the resource use information corresponding to the specified resource combination.
In one or more optional embodiments of the present specification, a task gear corresponding to each task may be determined based on a task amount of each task, sub-resource usage information of each task is determined in the task gear according to each task, and then resource usage information corresponding to the specified resource combination is determined according to the sub-resource usage information.
For example, referring to fig. 2, a diagram illustrating an effect of displaying resource usage information in a resource allocation method provided by an embodiment of the present specification is shown: firstly, determining task gears of the task A, the task B and the task C according to the task quantities of the task A, the task B and the task C; and then determining the sub-resource use information of the task A, the task B and the task C according to the task gear of the task A, the task B and the task C, and further determining the resource use information corresponding to the specified resource combination based on the sub-resource use information.
In one or more alternative embodiments of the present description, the resource usage information corresponding to a given combination of resources may also be determined using a keg measurement method. That is, based on the task gear of each task, determining the resource usage information corresponding to the specified resource combination, including:
combining task gears of each task to obtain at least one task gear pair;
acquiring sub-resource use information corresponding to each task gear pair;
and determining the resource use information corresponding to the specified resource combination according to the use information of each sub-resource.
Specifically, the task gear pair refers to a combination of at least two task gears; the sub-resource use information refers to resource use information corresponding to the task gear pair.
In practical application, after the task gear of each task is determined, the task gears of each task may be combined to obtain at least one task gear pair, for example, 3 task gears L1, L2, and L3, where the task gear h1 of task L1, the task gear h2 of task L2, and the task gear h3 of task L3 are combined, the task gear h1 and the task gear h2 are combined to obtain a task gear pair h1h2, and the task gear h2 and the task gear h3 are combined to obtain a task gear pair h2h3. And then acquiring sub-resource use information corresponding to each task gear pair, namely acquiring sub-resource use information g1 corresponding to the task gear pair h1h2 and sub-resource use information g2 corresponding to the task gear pair h2h3. Then, the resource usage information corresponding to the specified resource combination, that is, the resource usage information g1 and the resource usage information g2, is obtained by calculating the usage information of each sub resource, and the resource usage information corresponding to the specified resource combination is obtained. Therefore, the efficiency and the accuracy of determining the resource use information are improved.
In one or more optional embodiments of the present description, task gears of each task may be randomly combined to obtain at least one task gear pair, and the at least one task gear pair may also be determined and obtained based on a correlation between tasks. That is, the task gear pairs of each task are combined to obtain at least one task gear pair, and the specific implementation process may be as follows:
acquiring a task execution sequence of each task;
and determining the task gear of two tasks adjacent to the task execution sequence as a task gear pair to obtain at least one task gear pair.
Specifically, the task execution sequence refers to the order of executing tasks, for example, there are 3 tasks, task O, task P, and task Q, the execution sequence of task O is 2, the execution sequence of task P is 1, and the execution sequence of task Q is 3, that is, when executing a task, task P is executed first, then task O is executed, and finally task Q is executed.
In practical application, in order to further improve the accuracy and reliability of the resource use information, the task execution sequence of each task may be obtained first, and then the task gears of two tasks adjacent to the task execution sequence are combined to obtain at least one task gear pair. According to the above example, the execution sequence of the task O is 2, the execution sequence of the task P is 1, and the execution sequence of the task Q is 3, so that the execution sequences of the task P and the task O are adjacent, and the task gears of the task P and the task O are combined into a task gear pair; and the task execution sequence of the task O is adjacent to that of the task Q, and the task gears of the task O and the task Q are combined into a task gear pair.
Exemplarily, because the initial resource combination is a cross-product relationship, for example, three tasks a, B, and C, each task corresponds to one layer, and each bucket has a flow rate of 1%, then one initial resource combination has only 100 ten thousand flows, the amount is small and uncertain, and the scalability is poor, and more tasks are added later, and the direct measurement cannot be performed. Therefore, only the effect data of the combination of two shift positions, that is, the sub-resource usage information of the task shift position pair, such as the sub-resource usage information when rpm (a =5, B = 10) indicates that the task shift position of task a is 5 and the task shift position of task B is 10, can be directly measured. And (3) deducing rpm (A, B and C) through rpm (A, B) and rpm (B, C) and correcting the calculation based on the effect data of the two upstream and downstream gear combinations, namely deducing the use information of the sub-resources of the task gear pair determined according to the task execution sequence, and combining the rpm (A, B and C) with a single-point test. The derivation core is based on the idea of conditional probability:
f(A=5|B=10)=rpm(A=5,B=10)/rpm(B=10)
rpm(A=5,B=10)=rpm(B=10)*f(A=5|B=10)
three tasks are processed in the same way:
rpm(A=5,B=10,C=8)=rpm(A=5)*f(B=10|A=5)*f(C=8|(A=5,B=10))
assuming that only the influence between the upstream and downstream tasks is considered, and indirect influence is not considered, then a and C are statistically independent, so f (C = C | (a = a, B = B)) = f (C = C | B = B) (in practice there may be some influence, so the correction is made in conjunction with a single point test).
Step 108: and determining a target resource combination according to the resource use information, and allocating the resources of each task according to the target resource combination and the current resource quantity of each task.
And further, determining a target resource combination according to the resource use information and allocating the resources of each task according to the target resource combination and the current resource quantity of each task on the basis of determining a plurality of initial resource combinations according to the total quantity of the target resources and predicting the resource use information corresponding to each initial resource combination.
Specifically, the target resource combination refers to an initial resource combination whose resource usage information meets a condition greater than a preset resource usage condition.
In practical application, the target resource combination can be determined by screening according to the preset resource use condition and the resource use information corresponding to each initial resource combination, for example, the initial resource combination with the largest resource use information is determined as the target resource combination; for another example, the initial resource combination with the resource usage information larger than the preset resource usage information is determined as the target resource combination. And then allocating the target resource quantity allocated to each task in the target resource combination and the current resource quantity of each task, and then allocating the resources of each task.
In one or more alternative embodiments of the present disclosure, the resource allocation may be performed based on the allocation policy after the allocation policy is determined. That is, the resource of each task is allocated according to the target resource combination and the current resource quantity of each task, and the specific implementation process may be as follows:
determining a deployment strategy according to the target resource combination and the current resource quantity of each task;
and performing resource allocation on each task based on the allocation strategy.
Specifically, the allocation strategy refers to a method for allocating resources.
In practical application, the target resource quantity allocated to each task in the target resource combination can be compared with the current resource quantity of each task, so as to determine a deployment strategy, and then resource deployment is performed on each task based on the deployment strategy.
Exemplarily, referring to fig. 3, fig. 3 illustrates a schematic diagram of a deployment policy in a resource deployment method according to an embodiment of the present disclosure: if three tasks, namely a, B and C exist, wherein the current resource quantity of the task a is 10, the current resource quantity of the task B is 20, the current resource quantity of the task C is 15, the target resource quantity of the task a in the target resource combination is 15, the target resource quantity of the task B is 15, and the target resource quantity of the task C is 20, the resource quantity of the task a is increased by 5, the resource quantity of the task B is decreased by 5, the resource quantity of the task C is increased by 5, and what needs to be mentioned is that the resource allocation increment is 5. The allocation strategy is to allocate 5 resources corresponding to the resource allocation increment to task a and take out 5 resources from the resources of task B to allocate to task C; or the allocation strategy is to allocate 5 resources corresponding to the resource allocation increment to the task C, and take out 5 resources from the resources of the task B to allocate to the task A. And then performing resource allocation on each task according to the allocation strategy.
It should be noted that, before resource allocation is performed on each task based on the allocation policy, resource usage information corresponding to the allocation policy and the target resource combination may also be displayed for a user to view. And then after receiving the information that the user confirms allocation, allocating resources for each task based on the allocation strategy. Or, the user adjusts the resource policy, and then performs resource allocation on each task based on the adjusted resource policy, that is, under the condition of receiving a policy adjustment instruction, the allocation policy is adjusted according to the policy adjustment instruction to obtain the adjusted allocation policy; and carrying out resource allocation on each task according to the adjusted allocation strategy.
In addition, under the condition that the resource allocation request is not received, namely under the condition that the number of the current access resources is not changed, whether the resource use information is larger than the target resource total amount of the current resource combination or not can be automatically detected under the current resource total amount, and if the resource use information is larger than the target resource total amount of the current resource combination, the resources of each task are allocated according to the target resource combination and the current resource number of each task. That is, before allocating the resources of each task according to the target resource combination and the current resource quantity of each task, the method further includes:
acquiring resource use information corresponding to a plurality of initial resource combinations under the current resource total amount, wherein the initial resource combinations are obtained by performing resource allocation on each task according to the current resource total amount;
determining a target resource combination according to the resource use information, and judging whether the resource use information corresponding to the target resource combination is larger than the resource use information corresponding to the current resource combination;
the allocating the resources of each task according to the target resource combination and the current resource quantity of each task comprises the following steps:
and if so, allocating the resources of each task according to the target resource combination and the current resource quantity of each task.
Specifically, the total current resource amount refers to the total number of all resources that can be currently used for executing each task or the number of currently accessed resources, that is, the sum of the current resource amounts of each task; the current resource combination refers to a resource combination formed by the current resource quantity of each task.
In practical application, the execution main body can directly acquire a plurality of initial resource combinations under the current resource total amount according to the current access resource amount, namely the sum of the current resource amounts of all tasks, namely the current resource total amount, and then acquire resource use information corresponding to all the initial resource combinations; and performing resource allocation for each task according to the current total resource amount to obtain a plurality of initial resource combinations, and further predicting resource use information corresponding to each initial resource combination. It should be noted that, the process of obtaining resource usage information corresponding to a plurality of initial resource combinations in the total amount of the current resource is the same as the process of "obtaining resource usage information corresponding to a plurality of initial resource combinations in the total amount of the target resource" in step 106, and details that are not described in detail may all be referred to the description in step 106.
Further, a target resource combination is determined according to the resource use information, and screening is performed according to preset resource use conditions and resource use information corresponding to each initial resource combination, so that the target resource combination is determined. It should be noted that, the target resource combination is determined according to the resource usage information, which is the same as the process of "determining the target resource combination according to the resource usage information" in step 108, and details that are not described in detail can be referred to the description of step 108.
After the target resource combination is determined, comparing the resource usage information corresponding to the target resource combination with the resource usage information corresponding to the current resource combination, and if the resource usage information corresponding to the target resource combination is greater than the resource usage information corresponding to the current resource combination, indicating that the target resource combination has better effect than the current resource combination, namely allocating the resources of each task according to the target resource combination and the current resource quantity of each task. It should be noted that, the process of allocating the resources of each task according to the target resource combination and the current resource quantity of each task is the same as the process of "allocating the resources of each task according to the target resource combination and the current resource quantity of each task" in step 108, and details that are not described in detail can be referred to the description of step 108.
In addition, if the resource usage information corresponding to the target resource combination is not greater than the resource usage information corresponding to the current resource combination, it is indicated that the current resource combination effect is better, and it is sufficient to keep the current resource quantity of each task unchanged. Therefore, under the condition that the quantity of resources is not changed, the current quantity of resources of each task is automatically distributed and adjusted, more project benefits are taken, the resources are distributed to the modules with high efficiency, the modules with low efficiency can be further promoted to perform performance optimization, the resource utilization efficiency of the whole system is improved, and the goal of reducing cost and improving efficiency is achieved.
Referring to fig. 4, fig. 4 is a schematic view illustrating a processing diagram of a deployment policy in a resource deployment method according to an embodiment of the present disclosure: the resource allocation method provided by the specification is realized based on an allen spark (AllSpark) framework, after a resource allocation request is received, a sampling log, namely current resource data of a task A, a task B and a task C is obtained first, service efficiency data calculation is carried out, the method belongs to an offline task, relation data of resource- > level- > effects are calculated based on the online request log, namely a plurality of initial resource combinations are determined based on the current resource data of the task A, the task B and the task C and resource allocation increment carried by the resource allocation request, and resource use information corresponding to each initial resource combination is predicted. And then periodically updating the resource use information corresponding to each initial resource combination to a controller, wherein the controller is responsible for generating an allocation scheme with a better effect based on efficiency data, generating a capacity expansion and contraction plan and synchronizing the capacity expansion and contraction plan to the management and control, namely determining a target resource combination based on the resource use information corresponding to each initial resource combination, determining a deployment strategy according to the target resource combination and the current resource quantity of each task, and then sending the deployment strategy to the management and control. The management and control part comprises a management controller and an intelligent instrument panel, is in charge of the management and control and view part, and is used for managing and displaying effects of the machine deployment plan, namely adjusting and displaying the deployment strategy. Information interaction of the expansion and contraction plan and state control can be performed between the control and the controller, and the controller completes resource adjustment through an Ops (Operations) platform (namely, a system control operation and maintenance platform) after receiving a specific execution plan of the control. The controller interacts with information for container adjustment through an Ops platform, the Ops platform adjusts online service resources, and limit adjustment is performed on a task A, a task B and a task C in a project engine through interrupt processing and an operation inlet respectively, namely resource allocation is performed on each task based on an allocation strategy.
That is, under the condition of limited resources, the resources are fully utilized to realize the maximization of project profit: the method realizes the optimal allocation of static resources, under the resource constraint, allocates machine resources based on the efficiency data by calculating the resource utilization efficiency of each module so as to maximize the project profit, and theoretically realizes the optimal allocation of resources. And dynamic quick response is realized, and the system is based on an Allspark framework, has second-level feedback and regulation and control, and can well deal with flow fluctuation. In addition, the system is stable and reliable, simple and easy to use, controls and supports a user to define a control strategy and a scene through a control and view part, and can take effect by modifying a release line in real time, thereby supporting two modes of automation and manual work. The automatic mode is to set an rpm threshold, and if the profit of the combination with better potential effect minus the current profit exceeds the threshold, the resource adjustment is automatically completed. For example, in the manual mode, 100 machines are taken out from the online cluster, the system automatically generates a capacity reduction scheme to minimize the influence on the effect, and in addition, if a new batch of machines exist, the system automatically generates a capacity expansion plan during capacity expansion, and the machines are preferentially served with the highest efficiency. The view has a complete perspective of the regulation state and the influence of the regulation on the effect, so that the whole regulation is observable and controllable.
Thus, the Allspark framework based on dynamic computing power has the feedback and regulation capability of the second level, and in addition, the optimal distribution problem is defined: under the resource constraint, machine resources between modules are allocated so that project revenue is maximized. And regularly solving the relation data of machine resources, gears and effects to guide the machine allocation of the online engine full link, and completing the self-adaptive allocation of the machine through the dynamic regulation and control capability of the Allspark based on the efficiency data.
It should be noted that the resource utilization efficiency of the computing service provided by the method provided by the present specification is the project profit brought by the unit resource. Namely the relation of machine resource- > rpm of the service, most of the core resource of the online service is the cpu, so the relation is converted into the relation of cpu cores- > rpm. Because the relation of the strategy gear level- > rpm of dynamic force calculation is fixed and can be obtained on line in real time, the relation is further converted into the relation of level- > cpu cores. Because measuring the cpu usage data of services at different levels requires frequent online pressure measurement and level changes directly affect daily benefits, the direct measurement operation cost is too high. Consider that: computational power = computational volume = RT computing resources, and on-line can count RT and concurrency for a visit volume (pv) at a certain service, so RT may be used as the computational power usage. Based on the deduction, the relation data of the resource- > level- > effect can be finally obtained, and the resource usage amount of each service under the combination with the better effect is selected based on the efficiency data, so that the machine allocation is guided.
The present specification provides a resource allocation method: receiving a resource allocation request, wherein the resource allocation request carries a resource allocation increment; determining the total amount of target resources based on the resource allocation increment and the current resource quantity of each task; acquiring resource use information corresponding to a plurality of initial resource combinations under the total amount of the target resources, wherein the initial resource combinations are obtained by performing resource allocation on each task according to the total amount of the target resources; and determining a target resource combination according to the resource use information, and allocating the resources of each task according to the target resource combination and the current resource quantity of each task. And determining a target resource combination with a large project profit by determining the target resource combination according to the resource use information, and further realizing self-adaptive resource allocation based on the target resource combination and the current resource quantity of each task. In addition, resource use information corresponding to a plurality of initial resource combinations under the total amount of target resources is acquired, the efficiency of using resources based on each task is realized, the allocation adjustment is automatically carried out, more project profits are taken under the condition of limited resources, the resources are allocated to modules with high efficiency, the modules with low efficiency can be further promoted to carry out performance optimization, the resource use efficiency of the whole system is improved, and the goal of reducing cost and improving efficiency is realized. And further, the resource allocation efficiency can be improved, the resource utilization efficiency is further improved, and resource allocation is systematically carried out from the aspects of concept, theory and framework.
The following description will further explain the resource allocation method by taking the application of the resource allocation method provided in the present specification in an actual scene as an example with reference to fig. 5. Fig. 5 is a flowchart illustrating a processing procedure of a resource allocation method according to an embodiment of the present disclosure, and specifically includes the following steps.
Step 502: and receiving a resource allocation request, wherein the resource allocation request carries a resource allocation increment.
Step 504: and determining the total amount of the target resources based on the resource allocation increment and the current resource quantity of each task.
Step 506: and determining a plurality of initial resource combinations according to the total amount of the target resources, wherein the initial resource combinations are obtained by performing resource allocation on each task according to the total amount of the target resources.
Step 508: and determining at least one appointed resource combination in the plurality of initial resource combinations according to a preset combination condition.
Step 510: task response time of the first task is obtained.
Step 512: and aiming at any appointed resource combination, calculating according to the initial resource quantity allocated to the first task in the appointed resource combination and the task response time of the first task to obtain the task quantity of the first task.
Step 514: and determining a task gear corresponding to the first task according to the task amount of the first task.
Step 516: and combining the task gears of all tasks to obtain at least one task gear pair.
Optionally, combining task gears of each task to obtain at least one task gear pair, including:
acquiring a task execution sequence of each task;
and determining task gears of two tasks adjacent to the task execution sequence as a task gear pair to obtain at least one task gear pair.
Step 518: and acquiring the use information of the sub-resources corresponding to each task gear pair.
Step 520: and determining the resource use information corresponding to the specified resource combination according to the use information of each sub-resource.
Step 522: and calculating the resource use information corresponding to the initial resource combinations except the appointed resource combinations in each initial resource combination by using a preset interpolation algorithm based on the resource use information corresponding to each appointed resource combination.
Step 524: and determining the target resource combination according to the resource use information.
Step 526: and determining a deployment strategy according to the target resource combination and the current resource quantity of each task.
Step 528: and performing resource allocation on each task based on the allocation strategy.
The present specification provides a resource allocation method including determining a target resource combination according to resource usage information, determining a target resource combination with a large project profit, and further implementing adaptive resource allocation based on the target resource combination and the current resource quantity of each task. In addition, a plurality of initial resource combinations are determined according to the total amount of the target resources, and the resource use information corresponding to each initial resource combination is predicted, so that the purpose of automatically allocating and adjusting resources based on the efficiency of using the resources by each task is realized, more project benefits are obtained under the condition of limited resources, the resources are allocated to modules with high efficiency, the modules with low efficiency can be further promoted to perform performance optimization, the resource use efficiency of the whole system is improved, and the purpose of reducing cost and improving efficiency is realized. And further, the resource allocation efficiency can be improved, the resource use efficiency is further improved, and resource allocation is systematically carried out from the concept, the theory and the framework.
Corresponding to the above method embodiments, this specification further provides a resource deployment device embodiment, and fig. 6 shows a schematic structural diagram of a resource deployment device provided in an embodiment of this specification. As shown in fig. 6, the apparatus includes:
a receiving module 602, configured to receive a resource allocation request, where the resource allocation request carries a resource allocation increment;
a determining module 604 configured to determine a total amount of target resources based on the resource allocation increment and the current resource amount of each task;
an obtaining module 606 configured to obtain resource usage information corresponding to a plurality of initial resource combinations under a target resource total amount, where the initial resource combinations are obtained by performing resource allocation on each task according to the target resource total amount;
the allocating module 608 is configured to determine a target resource combination according to the resource usage information, and allocate resources of each task according to the target resource combination and the current resource quantity of each task.
In one or more alternative embodiments of the present disclosure, the obtaining module 606 is further configured to:
determining at least one appointed resource combination in a plurality of initial resource combinations under the total amount of the target resources according to preset combination conditions, and predicting resource use information corresponding to the at least one appointed resource combination;
and calculating resource use information corresponding to initial resource combinations except the appointed resource combinations in the initial resource combinations by utilizing a preset interpolation algorithm based on the resource use information corresponding to the appointed resource combinations.
In one or more alternative embodiments of the present disclosure, the obtaining module 606 is further configured to:
for any specified resource combination, determining the task quantity of a first task according to the initial resource quantity allocated to the first task in the specified resource combination, wherein the first task is any one of the tasks;
and determining resource use information corresponding to the specified resource combination based on the task amount of each task.
In one or more alternative embodiments of the present disclosure, the obtaining module 606 is further configured to:
acquiring task response time of the first task;
and calculating according to the task response time of the first task and the initial resource quantity to obtain the task quantity of the first task.
In one or more alternative embodiments of the present disclosure, the obtaining module 606 is further configured to:
determining a task gear corresponding to the first task according to the task amount of the first task;
and determining resource use information corresponding to the specified resource combination based on the task gear of each task.
In one or more alternative embodiments of the present disclosure, the obtaining module 606 is further configured to:
combining task gears of each task to obtain at least one task gear pair;
acquiring sub-resource use information corresponding to each task gear pair;
and determining the resource use information corresponding to the specified resource combination according to the use information of each sub-resource.
In one or more alternative embodiments of the present disclosure, the obtaining module 606 is further configured to:
acquiring a task execution sequence of each task;
and determining the task gear of two tasks adjacent to the task execution sequence as a task gear pair to obtain at least one task gear pair.
In one or more alternative embodiments of the present disclosure, the deployment module 608 is further configured to:
determining a deployment strategy according to the target resource combination and the current resource quantity of each task;
and performing resource allocation on each task based on the allocation strategy.
The present specification provides a resource allocation device, which receives a resource allocation request, where the resource allocation request carries a resource allocation increment; determining the total amount of target resources based on the resource allocation increment and the current resource quantity of each task; acquiring resource use information corresponding to a plurality of initial resource combinations under the total amount of the target resources, wherein the initial resource combinations are obtained by performing resource allocation on each task according to the total amount of the target resources; and determining a target resource combination according to the resource use information, and allocating the resources of each task according to the target resource combination and the current resource quantity of each task. And determining a target resource combination with a larger project income by determining the target resource combination according to the resource use information, and further realizing self-adaptive resource allocation based on the target resource combination and the current resource quantity of each task. In addition, resource use information corresponding to a plurality of initial resource combinations under the total amount of target resources is acquired, the efficiency of using resources based on each task is realized, the allocation adjustment is automatically carried out, more project profits are taken under the condition of limited resources, the resources are allocated to modules with high efficiency, the modules with low efficiency can be further promoted to carry out performance optimization, the resource use efficiency of the whole system is improved, and the goal of reducing cost and improving efficiency is realized. And further, the resource allocation efficiency can be improved, the resource utilization efficiency is further improved, and resource allocation is systematically carried out from the aspects of concept, theory and framework.
The above is a schematic solution of a resource allocation apparatus in this embodiment. It should be noted that the technical solution of the resource allocation device and the technical solution of the resource allocation method belong to the same concept, and details that are not described in detail in the technical solution of the resource allocation device can be referred to the description of the technical solution of the resource allocation method.
Fig. 7 illustrates a block diagram of a computing device 700, provided in one embodiment of the present description. The components of the computing device 700 include, but are not limited to, memory 710 and a processor 720. Processor 720 is coupled to memory 710 via bus 730, and database 750 is used to store data.
Computing device 700 also includes access device 740, access device 740 enabling computing device 700 to communicate via one or more networks 760. Examples of such networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. The Access device 740 may include one or more of any type of Network Interface (e.g., a Network Interface Controller (NIC)) whether wired or Wireless, such as an IEEE802.11 Wireless Local Area Network (WLAN) Wireless Interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) Interface, an ethernet Interface, a Universal Serial Bus (USB) Interface, a cellular Network Interface, a bluetooth Interface, a Near Field Communication (NFC) Interface, and so forth.
In one embodiment of the present description, the above-described components of computing device 700, as well as other components not shown in FIG. 7, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device structure shown in FIG. 7 is for purposes of example only and is not limiting as to the scope of the description. Other components may be added or replaced as desired by those skilled in the art.
Computing device 700 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smartphone), wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 700 may also be a mobile or stationary server.
The processor 720 is configured to execute computer-executable instructions, which when executed by the processor implement the steps of the resource allocation method described above.
The above is an illustrative scheme of a computing device of the present embodiment. It should be noted that the technical solution of the computing device and the technical solution of the resource allocation method belong to the same concept, and details that are not described in detail in the technical solution of the computing device can be referred to the description of the technical solution of the resource allocation method.
An embodiment of the present specification further provides a computer-readable storage medium, which stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the resource allocation method are implemented.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the resource allocation method belong to the same concept, and details of the technical solution of the storage medium, which are not described in detail, can be referred to the description of the technical solution of the resource allocation method.
An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the resource allocation method.
The above is an illustrative scheme of a computer program of the present embodiment. It should be noted that the technical solution of the computer program and the technical solution of the resource allocation method belong to the same concept, and details that are not described in detail in the technical solution of the computer program can be referred to the description of the technical solution of the resource allocation method.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The computer instructions comprise computer program code which may be in the form of source code, object code, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like.
It should be noted that, for the sake of simplicity, the foregoing method embodiments are described as a series of acts, but those skilled in the art should understand that the present embodiment is not limited by the described acts, because some steps may be performed in other sequences or simultaneously according to the present embodiment. Further, those skilled in the art should also appreciate that the embodiments described in this specification are preferred embodiments and that acts and modules referred to are not necessarily required for an embodiment of the specification.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present specification disclosed above are intended only to aid in the description of the specification. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the embodiments and the practical application, to thereby enable others skilled in the art to best understand and utilize the embodiments. The specification is limited only by the claims and their full scope and equivalents.

Claims (11)

1. A resource allocation method comprises the following steps:
receiving a resource allocation request, wherein the resource allocation request carries a resource allocation increment;
determining the total amount of target resources based on the resource allocation increment and the current resource quantity of each task;
acquiring resource use information corresponding to a plurality of initial resource combinations under the total amount of the target resources, wherein the initial resource combinations are obtained by performing resource allocation on each task according to the total amount of the target resources;
and determining a target resource combination according to the resource use information, and allocating the resources of each task according to the target resource combination and the current resource quantity of each task.
2. The method according to claim 1, wherein the obtaining resource usage information corresponding to a plurality of initial resource combinations under the total amount of the target resource includes:
determining at least one appointed resource combination in a plurality of initial resource combinations under the total amount of the target resources according to preset combination conditions, and predicting resource use information corresponding to the at least one appointed resource combination;
and calculating resource use information corresponding to the initial resource combinations in the initial resource combinations except the appointed resource combinations by utilizing a preset interpolation algorithm based on the resource use information corresponding to the appointed resource combinations.
3. The method of claim 2, the predicting resource usage information corresponding to the at least one specified resource combination, comprising:
for any specified resource combination, determining the task quantity of a first task according to the initial resource quantity allocated to the first task in the specified resource combination, wherein the first task is any one of the tasks;
and determining the resource use information corresponding to the specified resource combination based on the task amount of each task.
4. The method of claim 3, wherein determining the task size of the first task based on the initial number of resources allocated to the first task in the specified combination of resources comprises:
acquiring task response time of the first task;
and calculating according to the task response time of the first task and the initial resource quantity to obtain the task quantity of the first task.
5. The method according to claim 3 or 4, wherein the determining resource usage information corresponding to the specified resource combination based on the task amount of each task comprises:
determining a task gear corresponding to the first task according to the task amount of the first task;
and determining resource use information corresponding to the specified resource combination based on the task gear of each task.
6. The method according to claim 5, wherein the determining resource usage information corresponding to the specified resource combination based on the task gear of each task comprises:
combining task gears of each task to obtain at least one task gear pair;
acquiring sub-resource use information corresponding to each task gear pair;
and determining the resource use information corresponding to the specified resource combination according to the use information of each sub-resource.
7. The method of claim 6, wherein combining task gears for each task to obtain at least one task gear pair comprises:
acquiring a task execution sequence of each task;
and determining task gears of two tasks adjacent to the task execution sequence as a task gear pair to obtain at least one task gear pair.
8. The method of claim 1, wherein the allocating the resources of each task according to the target resource combination and the current resource amount of each task comprises:
determining a deployment strategy according to the target resource combination and the current resource quantity of each task;
and performing resource allocation on each task based on the allocation strategy.
9. A resource allocating apparatus, comprising:
a receiving module configured to receive a resource allocation request, wherein the resource allocation request carries a resource allocation increment;
a determining module configured to determine a total amount of target resources based on the resource allocation increment and a current resource amount of each task;
an obtaining module configured to obtain resource usage information corresponding to a plurality of initial resource combinations under the target resource total amount, wherein the initial resource combinations are obtained by performing resource allocation on each task according to the target resource total amount;
and the allocation module is configured to determine a target resource combination according to the resource use information and allocate the resources of each task according to the target resource combination and the current resource quantity of each task.
10. A computing device, comprising:
a memory and a processor;
the memory is configured to store computer-executable instructions, and the processor is configured to execute the computer-executable instructions, and the computer-executable instructions when executed by the processor implement the steps of the resource allocation method according to any one of claims 1 to 8.
11. A computer-readable storage medium storing computer-executable instructions which, when executed by a processor, perform the steps of the resource allocation method of any one of claims 1 to 8.
CN202210530923.2A 2022-05-16 2022-05-16 Resource allocation method and device Active CN115168023B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210530923.2A CN115168023B (en) 2022-05-16 2022-05-16 Resource allocation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210530923.2A CN115168023B (en) 2022-05-16 2022-05-16 Resource allocation method and device

Publications (2)

Publication Number Publication Date
CN115168023A true CN115168023A (en) 2022-10-11
CN115168023B CN115168023B (en) 2023-12-12

Family

ID=83483447

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210530923.2A Active CN115168023B (en) 2022-05-16 2022-05-16 Resource allocation method and device

Country Status (1)

Country Link
CN (1) CN115168023B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109993428A (en) * 2019-03-28 2019-07-09 第四范式(北京)技术有限公司 Resource allocation methods and device
CN111190705A (en) * 2019-12-31 2020-05-22 支付宝(杭州)信息技术有限公司 Task processing method and device
CN111526058A (en) * 2020-04-30 2020-08-11 北京三快在线科技有限公司 Network resource allocation method, device and storage medium
CN111813541A (en) * 2020-06-12 2020-10-23 北京字节跳动网络技术有限公司 Task scheduling method, device, medium and equipment
US20210157644A1 (en) * 2019-11-26 2021-05-27 International Business Machines Corporation Selecting an optimal combination of cloud resources within budget constraints
CN113127160A (en) * 2019-12-30 2021-07-16 阿里巴巴集团控股有限公司 Task scheduling method, system and equipment
CN113343148A (en) * 2021-06-18 2021-09-03 上海哔哩哔哩科技有限公司 Resource processing method, client, server and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109993428A (en) * 2019-03-28 2019-07-09 第四范式(北京)技术有限公司 Resource allocation methods and device
US20210157644A1 (en) * 2019-11-26 2021-05-27 International Business Machines Corporation Selecting an optimal combination of cloud resources within budget constraints
CN113127160A (en) * 2019-12-30 2021-07-16 阿里巴巴集团控股有限公司 Task scheduling method, system and equipment
CN111190705A (en) * 2019-12-31 2020-05-22 支付宝(杭州)信息技术有限公司 Task processing method and device
CN111526058A (en) * 2020-04-30 2020-08-11 北京三快在线科技有限公司 Network resource allocation method, device and storage medium
CN111813541A (en) * 2020-06-12 2020-10-23 北京字节跳动网络技术有限公司 Task scheduling method, device, medium and equipment
CN113343148A (en) * 2021-06-18 2021-09-03 上海哔哩哔哩科技有限公司 Resource processing method, client, server and system

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
DMITRI A. DOLGOV: "Combinatorial resource scheduling for multiagent MDPs", 《PROCEEDINGS OF THE 6TH INTERNATIONAL JOINT CONFERENCE ON AUTONOMOUS AGENTS AND MULTIAGENT SYSTEMS》, pages 1 - 8 *
任琼;常君明;: "基于任务分类思维的云计算海量资源改进调度", 科学技术与工程, no. 12 *
李学锋: "基于物联网的云资源优化配置方法研究", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 *
蒋维成;李兰英;: "云计算资源动态配置策略", 电脑知识与技术, no. 26 *

Also Published As

Publication number Publication date
CN115168023B (en) 2023-12-12

Similar Documents

Publication Publication Date Title
CN103927229A (en) Scheduling Mapreduce Jobs In A Cluster Of Dynamically Available Servers
CN102043673A (en) Calibration of resource allocation during parallel processing
CN113615137B (en) CDN optimization platform
CN107046505B (en) Service control method and service control device
CN110322169A (en) A kind of method and device of task publication
CN108683605A (en) A kind of current-limiting method and device of service call
CN112332404A (en) Intelligent management system and method for heating service
CN110909878A (en) Training method and device of neural network model for estimating resource usage share
CN109543988A (en) The method, apparatus and storage medium of optimization transaction overtime threshold
Xiao et al. Dscaler: A horizontal autoscaler of microservice based on deep reinforcement learning
CN114581119A (en) Flow prediction method and device
CN115168023A (en) Resource allocation method and device
US10764788B2 (en) Managing bandwidth in mobile telecommunications networks
CN114520773B (en) Service request response method, device, server and storage medium
Monge et al. Adaptive spot-instances aware autoscaling for scientific workflows on the cloud
CN115801804A (en) Multi-user mobile edge computing unloading method and system based on dynamic pricing
CN109301820A (en) A kind of enterprise&#39;s electrical control method and system
Sartzetakis et al. Resource allocation for distributed machine learning at the edge-cloud continuum
CN113296870B (en) Method and device for predicting Kubernetes cluster configuration
Chen et al. Razor: Scaling backend capacity for mobile applications
Na et al. An adaptive replanning mechanism for dependable service-based systems
Jiang et al. Cost-Effective Resource Configuration for Cloud Video Streaming Services
CN116260666A (en) Resource recommendation method and device
CN118195684A (en) Method and device for determining demand
CN116467527A (en) Data processing method and 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
GR01 Patent grant
GR01 Patent grant