Resource allocation method and device based on dynamic programming solution

Through the resource allocation method based on dynamic programming, the problem of unreasonable resource allocation in the existing technology is solved, and the reasonable allocation and rapid response of resources are achieved, ensuring that all BMC applications can obtain the required resources in a timely manner.

CN119806842APending Publication Date: 2025-04-11ZHONGCHENG HUALONG COMPUTER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510037349.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-09
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In the prior art, the resource allocation method has problems such as unreasonable priority settings, the order of application time is determined, and the short-time priority scheduling algorithm, which makes it difficult for applications with high real-time requirements to obtain resources in a timely manner.

Method used

The resource allocation method based on dynamic programming solutions is adopted, by determining the resource application information during the planning cycle, building revenue functions and constraints, and using the inverse thrust solution method to maximize the revenue target, ensuring that each BMC application is reasonably allocated to resources.

Benefits of technology

It realizes reasonable allocation of resources, ensures that all BMC applications can obtain the required resources in a timely manner, and improves resource utilization and response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806842A_ABST
    Figure CN119806842A_ABST
Patent Text Reader

Abstract

The invention discloses a resource allocation method and device based on dynamic programming solution, and belongs to the technical field of resource allocation. The method comprises the following steps: determining resource application information initiated by a BMC application to a server in a current planning period; the resource application information comprises a resource type and an application quantity of an applied resource; according to the server type and the resource application information, constructing a revenue function and a constraint condition for the BMC application applying for the resources in the current planning period; and maximizing the revenue of the corresponding revenue function in the current planning period as a revenue target, and solving the resource allocation quantity of each BMC application in the current planning period by using the constraint condition and the revenue target of the revenue function through an inverse solution method. According to the resource allocation method, the resource can be reasonably allocated according to the benefit maximization as the benefit target, and the allocation scheme meeting the requirement can be quickly obtained through the inverse solution method, so that all BMC applications initiating the resource application can be allocated to the resource.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of resource allocation, and in particular to a resource allocation method and device based on dynamic programming solution. Background Art

[0002] In a server, multiple BMC applications may apply for resources such as CPU and memory from the server. In related technologies, there are several resource allocation methods and their technical problems:

[0003] The first resource allocation method: assign priorities to applications. Applications with higher priorities receive faster resource allocation responses. However, if the priority setting is unreasonable, applications with high resource real-time requirements may not be able to obtain resources for a long time.

[0004] The second resource allocation method: According to the first-come, first-served algorithm, resource allocation responses are determined based on the order of application time. However, this method will increase the probability that applications that apply later will not be able to apply for resources.

[0005] The third resource allocation method is the short job priority scheduling algorithm. Applications with short resource application time receive faster resource allocation response. However, this method will increase the probability that long jobs will not be able to apply for resources.

[0006] Based on the technical problems existing in the above three resource allocation methods, it is urgent to provide a method that can quickly and reasonably allocate resources to all applications that initiate resource applications. Summary of the invention

[0007] The present invention provides a resource allocation method and device based on dynamic programming solution. The technical solution is as follows:

[0008] In one aspect, a resource allocation method based on dynamic programming is provided, the method comprising:

[0009] Determine resource application information initiated by the BMC application to the server within the current planning period; the resource application information includes the resource type and application amount of the applied resource;

[0010] According to the server type and the resource application information, a benefit function and constraint conditions are constructed for the BMC application applying for resources in the current planning period;

[0011] The benefit maximization of the benefit function corresponding to the current planning period is taken as the benefit target, and the resource allocation amount of each BMC application in the current planning period is obtained by using the constraint conditions and the benefit target of the benefit function through the reverse solution method.

[0012] On the other hand, a resource allocation device based on dynamic programming solution is provided, the device comprising:

[0013] A determination unit, used to determine resource application information initiated by the BMC application to the server within the current planning period; the resource application information includes the resource type and application amount of the applied resource;

[0014] A construction unit, configured to construct a benefit function and constraint conditions for a BMC application applying for resources in a current planning period according to the server type and the resource application information;

[0015] The planning unit is used to maximize the benefit of the benefit function corresponding to the current planning period as the benefit target, so as to use the constraint conditions and the benefit target of the benefit function to obtain the resource allocation amount of each BMC application in the current planning period through a reverse solution method.

[0016] On the other hand, a computer device is provided, which includes a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the steps of the resource allocation method based on dynamic programming solution described above.

[0017] On the other hand, a computer-readable storage medium is provided, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor, the steps of the resource allocation method based on dynamic programming solution are implemented.

[0018] On the other hand, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the resource allocation method based on dynamic programming solution are implemented.

[0019] The technical solution provided by the present invention can at least bring the following beneficial effects:

[0020] By setting the planning cycle, the resource application information initiated by the BMC application to the server is determined in each current planning cycle, so as to construct the benefit function and constraint conditions for the BMC application that applies for resources in the current planning cycle according to the server type and resource application information, and take the benefit maximization as the benefit goal, so as to obtain the resource allocation for each BMC application in the current planning cycle through the reverse solution method. This solution takes the benefit maximization as the benefit goal, can reasonably allocate resources, and can quickly obtain the allocation plan that meets the needs through the reverse solution method, so that all BMC applications that initiate resource applications can be allocated resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0022] Figure 1 It is a flow chart of a resource allocation method based on dynamic programming solution provided by an embodiment of the present invention;

[0023] Figure 2 It is a structural diagram of a resource allocation device based on dynamic programming solution provided by an embodiment of the present invention;

[0024] Figure 3 It is a hardware architecture diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0026] Please refer to Figure 1 , an embodiment of the present invention provides a resource allocation method based on dynamic programming solution, the method comprising:

[0027] Step 100, determining resource application information initiated by the BMC application to the server within the current planning period; the resource application information includes the resource type and application amount of the applied resource;

[0028] Step 102, constructing a benefit function and constraint conditions for the BMC application applying for resources in the current planning period according to the server type and the resource application information;

[0029] Step 104 , taking the benefit maximization of the benefit function corresponding to the current planning period as the benefit target, and using the constraint conditions and the benefit target of the benefit function to obtain the resource allocation of each BMC application in the current planning period through a reverse solution method.

[0030] In the embodiment of the present invention, by setting a planning cycle, the resource application information initiated by the BMC application to the server is determined in each current planning cycle, so as to construct a benefit function and constraint conditions for the BMC application that applies for resources in the current planning cycle according to the server type and resource application information, and take the benefit maximization as the benefit goal, so as to obtain the resource allocation amount for each BMC application in the current planning cycle by solving the inverse solution method. This scheme takes the benefit maximization as the benefit goal, can reasonably allocate resources, and can quickly obtain an allocation scheme that meets the needs through the inverse solution method, so that all BMC applications can be allocated resources.

[0031] Described below Figure 1 How the various steps are performed.

[0032] First, step 100, "determining the resource application information initiated by the BMC application to the server in the current planning period" and step 102, "building a benefit function and constraints for the BMC application applying for resources in the current planning period according to the server type and the resource application information" are explained at the same time.

[0033] In the embodiment of the present invention, in order to avoid the situation where an application initiating a resource application cannot obtain allocated resources, a planning cycle can be set in advance to allocate resources for the BMC application initiating a resource application in the corresponding planning cycle in each planning cycle.

[0034] The resource application information initiated by the BMC (Baseboard Management Controller) application includes the resource type and application amount of the requested resources. Among them, BMC is a dedicated subsystem on the hardware server, which allows administrators to monitor and manage the hardware status of the server through remote management tools independent of the main operating system, CPU and main memory. When BMC applies for resources from the server, it mainly involves the monitoring and management of the server hardware resources. The types of resources applied for may include: CPU resources, memory resources, storage resources, network resources, other hardware resources, etc. In addition, the resource application information initiated also includes the application amount corresponding to the resource type, thereby requesting the server to allocate the corresponding application amount of resources for its business needs.

[0035] One or more BMC applications may initiate resource applications in a planning cycle. In order to allocate resources to all BMC applications that initiate resource applications, in an embodiment of the present invention, resources may be allocated to all BMC applications with the goal of maximizing benefits.

[0036] As for the revenue of the server, how to construct the revenue function?

[0037] In one implementation, a revenue function may be constructed according to the amount of resources applied for.

[0038] In another implementation, considering that different server types have different strong resources, the server is more inclined to allow BMC applications to apply for the server's strong resources, so that its strong resources can fully play their functions and improve resource utilization. Based on this, in the embodiment of the present invention, the method for constructing the profit function is:

[0039] Step 1020: The server pre-sets a benefit function for its own server type; the benefit function includes parameters for characterizing resource types; different server types correspond to different strong resources, and the strong resources in the benefit function contribute more to the benefit value of the benefit function than the non-strong resources;

[0040] Step 1022, according to the resource type of the resource applied for by the BMC application, the parameters corresponding to the resource type of the applied resource are retained, and the parameters corresponding to the unapplied resource type are assigned values ​​according to the set method, so as to eliminate the parameters corresponding to the unapplied resource type from the benefit function, and obtain the benefit function corresponding to each BMC application, and add the benefit function corresponding to each BMC application to obtain the benefit function of the current planning period.

[0041] It should be noted that the benefit function can be a multivariate linear equation or a multivariate multivariate equation. However, no matter how the benefit function is set, the benefit function needs to include parameters for characterizing resource types, and the benefit function needs to ensure that strong resources contribute more to the benefit value of the benefit function than non-strong resources.

[0042] Taking a multivariate linear equation as an example, the profit function can be G k =A 1 *h 1 +A 2 *h 2 +A 3 *h 3 +A 4 *h 4 Among them, G k is the profit value of the profit function corresponding to the kth BMC application, A 1 , A 2 , A 3 and A 4 is the coefficient, h 1 、h 2 、h 3 and h 4 Parameters used to characterize resource types, h 1 As the server's strong resource, h 2 、h 3 and h 4If a BMC application applies for a resource type of h in the current planning cycle, 1 and h 2 , then the unapplied resource type can be assigned a value of 0 according to the assignment method adapted to the benefit function, that is, the benefit function of the BMC application is: G k =A 1 *h 1 +A 2 *h 2 Since strong resources contribute more to the benefit value of the benefit function than non-strong resources, the coefficient A 1 The value is greater than the coefficient A 2 The value of .

[0043] After obtaining the benefit function of each BMC application, the benefit values ​​of multiple BMC applications are added together to obtain the benefit function in the current planning period. The benefit function is: G = G 1 +G 2 +…+G n Where n is the total number of BMC applications that initiate resource requests in the current planning period, and n is a positive integer.

[0044] In the embodiment of the present invention, g k (x 1k, ,x 2k …,x mk ) is used as the revenue function of the kth BMC application. mk The resource allocation of the mth resource type requested by the kth BMC application from the server, m is a positive integer. Then, the profit function is:

[0045] G = g 1 (x 11 ,x 21 …,x m1 )+g 2 (x 12 ,x 22 …,x m2 )+…+g n (x 1n ,x 2n …,x mn ).

[0047] It should be noted that the above benefit function is constructed based on the example that the resource type of the resources applied for by the BMC application is m. Since the resource types of resources applied for by different BMC applications may not be exactly the same, in the above benefit function, the resource allocation amount corresponding to the unapplied resource type is 0.

[0048] In one embodiment of the present invention, the server types and their strong resources may include at least the following:

[0049] When the server type is a computing server, the strong resource is the computing resource;

[0050] When the server type is a storage server, the strong resource is the storage resource;

[0051] When the server type is a memory-based server, the strong resource is the memory resource;

[0052] When the server type is a network server, the strong resource is the network resource.

[0053] It can be seen that the benefit function in the embodiment of the present invention is related to the resource type applied for by the BMC application and the server type itself. By setting the benefit function in this way, the server can give full play to its strong resources and enable each BMC application to obtain reasonably allocated resources.

[0054] After obtaining the benefit function of the current planning period, in order to solve the benefit function to obtain the maximum benefit value, it is necessary to constrain various parameters. In one embodiment of the present invention, the constraint conditions may include:

[0055] The sum of resource allocations of the same resource type shall not be greater than the total remaining resources of the corresponding resource type;

[0056] For each resource type requested by an application, the corresponding resource allocation is greater than 0;

[0057] The resource type requested by each application has a resource allocation amount that is no greater than its application amount. In other words, the constraint condition is expressed by the formula:

[0058] x 11 +x 12 +…+x 1n ≤H 1

[0059] x 21 +x 22 +…+x 2n ≤H 2

[0060] …

[0061] x m1 +x m2 +…+x mn ≤H m

[0062] x 1i ,x 2i ,…x mi >0,(i=1,2,…n)

[0063] x 1i ≤x 1i '

[0064] x 2i ≤x 2i '

[0065] …

[0066] x m i≤x mi '

[0067] Among them, H m is the total amount of remaining resources of resource type m; x mi represents the resource allocation amount of resource type m allocated to the i-th BMC application; x mi ′ represents the application quantity of resource type m applied by the i-th BMC application.

[0068] In this way, the benefit function is analyzed according to the constraint conditions, so that a reasonable resource allocation plan can be obtained.

[0069] Furthermore, when the BMC application applies to the server for the application amount of different resource types, it is based on its own business needs. Assume that the BMC application applies for 10 CPU resources and 8 memory resources. If, during resource allocation, the CPU resource allocation is 10 and the memory resource application is 6, then even if 10 CPU resources are allocated to it, the memory resources allocated to it may be reduced, resulting in the memory resources being unable to meet the memory storage required after the CPU resources are quickly calculated when performing business processing. Therefore, in one embodiment of the present invention, the constraint condition also includes: when the resources applied for by the BMC application correspond to multiple resource types, the proportional relationship between the resource allocation amounts for the multiple resource types is the same as the proportional relationship between the application amounts.

[0070] That is to say, the BMC application applies for 10 CPU resources and 8 memory resources, that is, the ratio of CPU resources to memory resources is 5:4, so the CPU resources and memory resources should also be allocated in a ratio of 5:4. This is the only way to meet the needs of business processing and avoid wasting more resources due to unequal ratios.

[0071] Then, for step 104, the benefit maximization of the benefit function corresponding to the current planning period is taken as the benefit target, and the resource allocation amount of each BMC application in the current planning period is obtained by using the constraint conditions and the benefit target of the benefit function through the reverse solution method.

[0072] In the embodiment of the present invention, the maximization of the benefit function is taken as the goal, and the reverse solution method is combined to quickly solve a reasonable resource allocation plan to ensure that each BMC application can be allocated resources of the requested resource type.

[0073] In one embodiment of the present invention, the resource allocation amount of each BMC application in the current planning period is obtained by using a reverse solution method, which may specifically include:

[0074] Step 1040, numbering n BMC applications that initiate resource application information in the current planning period in sequence from 1 to n;

[0075] Step 1042, the sum of the benefit values ​​from the kth application to the nth application is equal to the sum of the benefit values ​​from the k+1th application to the nth application plus the benefit value of the kth application, thereby ensuring that the total benefit value is maximized when the constraint conditions are met; wherein the benefit value from the k+1th application to the nth application is calculated by deducting the resource allocation amount of the kth application from the allocation amount from the kth application to the nth application.

[0076] Assume that the maximum benefit function corresponding to the resources allocated to multiple BMC applications is f k (s 1,k ,s 2,k ,…,s m,k ). The state variables and decision variables in the maximum benefit function are:

[0077] State variables:

[0078] s 1,k The resource allocation amount of resource type 1 from the kth BMC application to the nth BMC application;

[0079] s 2,k The resource allocation amount of resource type 2 from the kth BMC application to the nth BMC application;

[0080] s m,k The resource allocation amount of resource type m from the kth BMC application to the nth BMC application;

[0081] Decision variables:

[0082] x 1k The resource allocation amount of resource type 1 applied by the kth BMC;

[0083] x 2k The resource allocation amount of resource type 2 applied by the kth BMC;

[0084] x mk The resource allocation amount of resource type m applied by the kth BMC.

[0085] The state transition equation of the allocated resources corresponding to each resource type is:

[0086] s 1,k+1 =s 1,k -x 1k

[0087] s 2,k+1 =s 2,k -x 2k

[0088] s m,k+1 =s m,k -x mk

[0089] Then the inverse relationship of resource allocation is:

[0090] f k (s 1,k ,s 2, k,…,s m,k )

[0091] =max{g k (x 1k ,x 2k …,x mk )

[0092] +f k+1 (s 1,k -x 1k ,s 2,k -x 2k ,s m,k -x mk )};k=n-1,…1

[0093] f n (s 1,n ,s 2, n,…,s m,n ) = g n (s 1,n ,s 2,n ,…,s m,n )

[0094] According to the above reverse relationship, the reverse reasoning idea is that if you want to ensure that the benefit brought by the resource allocation from the 1st application to the nth application is the maximum, then you need to ensure that the benefit brought by the resource allocation from the 1st application is the maximum and the benefit brought by the resource allocation from the 2nd application to the nth application is the maximum; if you want to ensure that the benefit brought by the resource allocation from the 2nd application to the nth application is the maximum, then you need to ensure that the benefit brought by the resource allocation from the 2nd application to the nth application is the maximum and the benefit brought by the resource allocation from the 3rd application to the nth application is the maximum; ...; if you need to ensure that the benefit brought by the resource allocation from the n-1th application to the nth application is the maximum, then you need to ensure that the benefit brought by the resource allocation from the n-1th application to the nth application is the maximum and the benefit brought by the resource allocation from the n-1th application is the maximum.

[0095] Therefore, the reverse process of step 1042 in the embodiment of the present invention is:

[0096] Step 10420, according to the setting order of the application numbers, the resource allocation amounts allocated to the applications are equal to their application amounts. If the total amount of remaining resources can satisfy that the resource allocation amounts of n applications are all equal to the application amounts, a resource allocation plan is obtained; if the total amount of remaining resources cannot satisfy that the resource allocation amounts of n applications are all equal to the application amounts, step 10422 is executed; the setting order is from 1 to n or from n to 1;

[0097] Step 10422, according to the set decrement amount, enter this round of decrement according to the set order of application numbers. The method of this round of decrement is to subtract the decrement amount from the resource allocation amount obtained by each application in the previous round, and after each application is decremented and before the subsequent applications are decremented, determine whether the total amount of remaining resources can meet the resource allocation amount of n applications after this decrement. If so, obtain a resource allocation plan; if the resource allocation amount of n applications cannot be met after all decrements in this round, continue to execute this step to enter the next round of decrement.

[0098] Therefore, through the inverse solution method, the optimal solution can be obtained quickly, and the key factors affecting the optimal value of the function, that is, the strong resources, can be located more easily and accurately; and the inverse solution method can reversely deduce from the result (the total benefit of all applications is maximized), and gradually eliminate resource allocation plans that do not meet the constraints during the solution process, thereby ensuring that the final plan is accurate and effective; further, the inverse solution method can reduce unnecessary searches and attempts through reverse thinking, thereby improving the solution efficiency. In the resource allocation problem, it can quickly find a resource allocation plan that meets the needs, reducing the amount of calculation and time cost.

[0099] Please refer to Figure 2 The embodiment of the present invention provides a resource allocation device based on dynamic programming solution, the device comprising:

[0100] The determination unit 200 is used to determine the resource application information initiated by the BMC application to the server within the current planning period; the resource application information includes the resource type and application amount of the applied resource;

[0101] A construction unit 202 is used to construct a benefit function and constraint conditions for the BMC application that applies for resources in the current planning period according to the server type and the resource application information;

[0102] The planning unit 204 is used to maximize the benefit of the benefit function corresponding to the current planning period as the benefit target, and to obtain the resource allocation amount of each BMC application in the current planning period by using the constraint conditions and the benefit target of the benefit function through the reverse solution method.

[0103] In one embodiment of the present invention, the method for constructing the profit function is:

[0104] The server is pre-set with a profit function for its own server type; the profit function includes parameters for characterizing resource types; different server types correspond to different strong resources, and the strong resources in the profit function contribute more to the profit value of the profit function than the non-strong resources;

[0105] According to the resource type of the resources applied for by the BMC application, the parameters corresponding to the resource type of the applied resources are retained, and the parameters corresponding to the unapplied resource types are assigned values ​​according to the set method, so as to eliminate the parameters corresponding to the unapplied resource types from the benefit function, and obtain the benefit function corresponding to each BMC application. The benefit function corresponding to each BMC application is added together to obtain the benefit function of the current planning period.

[0106] In one embodiment of the present invention, when the server type is a computing server, the strong resource is a computing resource;

[0107] When the server type is a storage server, the strong resource is the storage resource;

[0108] When the server type is a memory-based server, the strong resource is the memory resource;

[0109] When the server type is a network server, the strong resource is the network resource.

[0110] In one embodiment of the present invention, the constraint conditions include:

[0111] The sum of resource allocations of the same resource type shall not be greater than the total remaining resources of the corresponding resource type;

[0112] For each resource type requested by an application, the corresponding resource allocation is greater than 0;

[0113] The resource type of each resource requested by an application has a corresponding resource allocation amount that is not greater than its application amount.

[0114] In one embodiment of the present invention, the constraint condition further includes:

[0115] When the resources applied for by the BMC application correspond to multiple resource types, the proportional relationship between the resource allocation amounts of the multiple resource types is the same as the proportional relationship between the application amounts.

[0116] In one embodiment of the present invention, when the planning unit performs the inverse solution method to obtain the resource allocation amount of each BMC application in the current planning period, the steps specifically include:

[0117] Number the n BMC applications that initiate resource application information in the current planning period from 1 to n;

[0118] The sum of the benefit values ​​from the kth application to the nth application is equal to the sum of the benefit values ​​from the k+1th application to the nth application plus the benefit value of the kth application, taking the maximum value, thereby ensuring that the total benefit value is maximized when the constraints are met; wherein, the benefit value from the k+1th application to the nth application is calculated by deducting the resource allocation amount of the kth application from the allocation amount from the kth application to the nth application.

[0119] It should be noted that the resource allocation device based on dynamic programming solution provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functional allocation can be completed by different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the resource allocation device based on dynamic programming solution provided in the above embodiment and the resource allocation method embodiment based on dynamic programming solution belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0120] The embodiment of the present application also provides a computer device, please refer to Figure 3 The computer device includes a processor and a memory, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the resource allocation method based on dynamic programming solution provided by the above-mentioned method embodiments.

[0121] An embodiment of the present application also provides a computer-readable storage medium, on which is stored at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the resource allocation method based on dynamic programming solution provided in the above-mentioned method embodiments.

[0122] An embodiment of the present application also provides a computer program product, which includes a computer program. A processor of a computer device reads the computer program from a computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the resource allocation method based on dynamic programming solution described in any of the above embodiments.

[0123] For the convenience of description, the above system or device is described by dividing it into various modules or units according to its functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0124] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0125] Finally, it should be noted that, in this article, relational terms such as first, second, third and fourth are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0126] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A resource allocation method based on dynamic programming solution, characterized in that: The method comprises: Determine resource application information initiated by the BMC application to the server within the current planning period; the resource application information includes the resource type and application amount of the applied resource; According to the server type and the resource application information, a benefit function and constraint conditions are constructed for the BMC application applying for resources in the current planning period; The benefit maximization of the benefit function corresponding to the current planning period is taken as the benefit target, and the resource allocation amount of each BMC application in the current planning period is obtained by using the constraint conditions and the benefit target of the benefit function through the reverse solution method.

2. The method according to claim 1, characterized in that The method for constructing the profit function is: The server is pre-set with a profit function for its own server type; the profit function includes parameters for characterizing resource types; different server types correspond to different strong resources, and the strong resources in the profit function contribute more to the profit value of the profit function than the non-strong resources; According to the resource type of the resources applied for by the BMC application, the parameters corresponding to the resource type of the applied resources are retained, and the parameters corresponding to the unapplied resource types are assigned values ​​according to the set method, so as to eliminate the parameters corresponding to the unapplied resource types from the benefit function, and obtain the benefit function corresponding to each BMC application. The benefit function corresponding to each BMC application is added together to obtain the benefit function of the current planning period.

3. The method according to claim 2, characterized in that When the server type is a computing server, the strong resource is the computing resource; When the server type is a storage server, the strong resource is the storage resource; When the server type is a memory-based server, the strong resource is the memory resource; When the server type is a network server, the strong resource is the network resource.

4. The method according to claim 1, characterized in that: The constraints include: The sum of resource allocations of the same resource type shall not be greater than the total remaining resources of the corresponding resource type; For each resource type requested by an application, the corresponding resource allocation is greater than 0; The resource type of each resource requested by an application has a corresponding resource allocation amount that is not greater than its application amount.

5. The method according to claim 4, characterized in that The constraints also include: When the resources applied for by the BMC application correspond to multiple resource types, the proportional relationship between the resource allocation amounts of the multiple resource types is the same as the proportional relationship between the application amounts.

6. The method according to claim 1, characterized in that The resource allocation of each BMC application in the current planning period is obtained by using the reverse solution method, including: Number the n BMC applications that initiate resource application information in the current planning period from 1 to n; The sum of the benefit values ​​from the kth application to the nth application is equal to the sum of the benefit values ​​from the k+1th application to the nth application plus the benefit value of the kth application, taking the maximum value, thereby ensuring that the total benefit value is maximized when the constraints are met; wherein, the benefit value from the k+1th application to the nth application is calculated by deducting the resource allocation amount of the kth application from the allocation amount from the kth application to the nth application.

7. A resource allocation device based on dynamic programming solution, characterized in that: The device comprises: A determination unit, used to determine resource application information initiated by the BMC application to the server within the current planning period; the resource application information includes the resource type and application amount of the applied resource; A construction unit, configured to construct a benefit function and constraint conditions for a BMC application applying for resources in a current planning period according to the server type and the resource application information; The planning unit is used to maximize the benefit of the benefit function corresponding to the current planning period as the benefit target, so as to use the constraint conditions and the benefit target of the benefit function to obtain the resource allocation amount of each BMC application in the current planning period through a reverse solution method.

8. A computer device, characterized in that: The computer device includes a memory and a processor, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the steps of any one of the methods described in claims 1-6.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The method comprises a computer program, wherein when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.