Cloud resource allocation method and system based on user levels
By establishing a cloud resource allocation model based on user levels, optimizing resource allocation to meet the needs of different levels of users, and improving efficiency through resource recycling, we solve the problems of lack of differentiation in resource allocation and resource waste in the existing technology, and achieve high efficiency, Differentiated resource allocation and low-loss system operation.
Patent Information
- Application Number
- CN202411365311.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-21
AI Technical Summary
The existing cloud resource allocation method fails to effectively perform priority resource scheduling based on user level, resulting in a lack of differentiation in resource allocation, unable to fully meet the service needs of users at different levels, and lack of dynamic management of resource recycling, resulting in waste of resources.
The user level vector is formed by obtaining the user level, the user resource demand matrix is collected in real time, a resource allocation model is established based on the user level vector, the Lagrangian function is used to calculate the maximum resource utilization under user priority constraints, and resources are allocated based on the results. Also monitor resource usage and reclaim unused resources.
It achieves maximum resource utilization under user priority constraints, improves the efficiency and differentiation of resource allocation, ensures that high-level users receive priority resource allocation when resources are tight, and reduces system losses by recycling unused resources.
Smart Images

Figure CN119336496A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud computing, and in particular to a method and system for allocating cloud resources based on user levels. Background Art
[0002] As a flexible and scalable way to provide computing resources, cloud computing has become the first choice for enterprises and individual users. With the diversification and personalization of user needs, cloud service providers provide differentiated resource allocation strategies based on user levels. User levels are usually divided according to factors such as user service needs, usage frequency, and payment ability. For example, free users may only be able to obtain basic cloud services, while paid users can enjoy more resources and more advanced services. Resource allocation strategies need to reasonably allocate limited cloud resources while ensuring service quality to meet the needs of different user levels. User level-based resource allocation mechanism is the core of realizing user level-based resource allocation.
[0003] However, existing cloud resource allocation methods often only consider maximizing the overall utilization of system resources, while ignoring resource scheduling based on user level priorities, resulting in a lack of differentiation in resource allocation and the inability to provide different levels of services (such as bandwidth, response time, etc.) according to different levels of users. In addition, the previous resource allocation methods lack dynamic management of resource recovery, resulting in resource waste.
[0004] Therefore, it is necessary to start from the priority of user level, comprehensively consider the differentiation of resource allocation, cost control and technical implementation, and establish a cloud resource allocation method based on user level so that users of different levels can be reasonably allocated corresponding resources and achieve a balance between efficiency and cost. Summary of the invention
[0005] The purpose of the present invention is to overcome the defects of the prior art and provide a method and system for allocating cloud resources based on user level.
[0006] In order to achieve the above objectives and other objectives, the present invention is implemented by including the following technical solutions: As a first aspect, the present invention proposes a cloud resource allocation method based on user level, comprising the steps of:
[0007] S1. Obtain user level and form a user level vector;
[0008] S2. Collect user resource demand matrix in real time, and establish resource allocation model in combination with the user level vector;
[0009] S3. According to the resource allocation model, the maximum resource utilization under the user priority constraint is calculated using the Lagrangian function;
[0010] S4. Allocate corresponding resources to each user according to the maximum resource utilization and user priority.
[0011] In one embodiment, the resource allocation model includes resource demand constraints, utilization constraints, task number non-negative constraints, and user priority constraints.
[0012] In one embodiment, in step S3, an optimization benchmark of the number of tasks is obtained through the user priority constraint.
[0013] In one embodiment, step S3 includes determining whether the user's demand for each resource is the same. If so, the full load optimization and minimum load optimization in the resource allocation model are used to calculate the first resource utilization rate and the second resource utilization rate respectively; if not, further determining whether there is a resource utilization rate of 1. If so, calculating the resource utilization rate of each resource when the utilization rate is 1 in turn and obtaining the maximum value as the third resource utilization rate; comparing the first resource utilization rate, the second resource utilization rate and the third resource utilization rate to obtain the maximum resource utilization rate.
[0014] In one embodiment, the full load optimization means that the resource utilization of the system reaches a maximum.
[0015] In one embodiment, the minimum load optimization means that the resource utilization of the system is minimized.
[0016] In one embodiment, in step S4, the resource usage of each user is monitored and unused resources are recycled.
[0017] As a second aspect, the present invention proposes a user-level-based cloud resource allocation system, the system is applied to the method described in any one of the first aspects, the system comprising
[0018] User level module, used to obtain user level;
[0019] Real-time acquisition module, used to obtain user resource demand matrix and establish resource allocation model;
[0020] A calculation module, used to calculate the maximum resource utilization under the user priority constraint;
[0021] The resource allocation module is used to obtain the resource allocation number for each user corresponding to the maximum resource utilization rate, release resources to users according to the user priority sequence, monitor user dynamics, and recycle unused resources.
[0022] As a third aspect, the present invention proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements any method described in the first aspect when loaded into the processor.
[0023] As a fourth aspect, the present invention proposes a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any method described in the first aspect.
[0024] One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:
[0025] 1. Under the constraint of user priority, the present invention uses the user resource demand matrix and the user level vector to establish a resource allocation model, optimize the number of allocated tasks, maximize resource utilization, and improve the efficiency and differentiation of resource allocation; at the same time, the user levels are prioritized to ensure that high-level users can obtain priority resource allocation when resources are tight;
[0026] 2. The present invention performs real-time monitoring after resource allocation and recycles unused resources, thereby further improving the efficiency of resource allocation and reducing system losses;
[0027] 3. The present invention can be applied to fields such as big data analysis, network services, and real-time systems, and can effectively improve resource utilization and enhance the performance and stability of the overall system. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 Shown is a flow chart of a method for allocating cloud resources based on user levels according to the present invention.
[0029] Figure 2 It is a schematic diagram showing resource distribution of multiple users in a specific embodiment of the present invention. DETAILED DESCRIPTION
[0030] The embodiment of the present invention provides a cloud resource allocation method based on user level, which solves the problems existing in the prior art of resource allocation on cloud platforms, such as unreasonable resources allocated to users of different levels, imbalance between efficiency and cost, low resource utilization, and large system resource consumption.
[0031] Below, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments of the present invention. It should be understood that the present invention is not limited to the example embodiments described herein. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. It should also be noted that, for the convenience of description, only the parts related to the present invention are shown in the accompanying drawings, rather than all of them.
[0032] Embodiment 1
[0033] Please refer to the attached Figure 1 , an embodiment of the present invention provides a method for allocating cloud resources based on user level, the method comprising the steps of:
[0034] S1. Obtain user level and form a user level vector;
[0035] Specifically, set the user set U = {u 1 ,u 2 ,…,u n}, user level vector w = [w 1 ,w 2 ,…w n ] T , obtain user level information and ensure that high-level users have priority in using resources.
[0036] S2. Collect user resource demand matrix in real time, and establish resource allocation model in combination with the user level vector;
[0037] Specifically, set the resource set R = {r 1 ,r 2 ,…r m}, the user resource demand matrix is collected as A = [a ji ],1≤i≤n,1≤j≤m, where a ji represents the normalized demand of user i for resource j. Assuming the resource utilization rate is η, a resource allocation model is established, which is expressed as
[0038]
[0039] Where x = [x 1 ,x 2 ,…x n ] T is the task vector, p=[p 1 ,p 2 ,…p n ] Tis the price vector of resources, Ax≤1 is the resource demand constraint, η≤Ax is the utilization constraint, x≥0 is the non-negative constraint on the number of tasks, and a i =[a 1,i ,a 2,i ,…,a m,i ] T is the resource demand vector of the ith user, It is the user priority constraint.
[0040] S3, using Lagrangian function to calculate the maximum resource utilization under user level constraints;
[0041] Furthermore, the step S3 includes: determining whether the user's demand for each resource is the same, and if so, using the full load optimization and minimum load optimization in the resource allocation model to respectively calculate the first resource utilization rate and the second resource utilization rate; if not, further determining whether there is a resource utilization rate of 1, and if so, calculating the resource utilization rate of each resource when the utilization rate is 1 in turn and obtaining the maximum value as the third resource utilization rate; comparing the first resource utilization rate, the second resource utilization rate and the third resource utilization rate to obtain the maximum resource utilization rate.
[0042] Specifically, using user level constraints The task can be represented as
[0043] x i =x 1 β i ,1≤i≤n;
[0044] Among them, β i Optimize the benchmark for the number of tasks, expressed as
[0045] Furthermore, using the KKT conditions corresponding to the Lagrangian function of this optimization model, three feasible situations can be obtained:
[0046] (1) When Ax = 1, that is, Then there is Available
[0047]
[0048] At this time, if and only if the user's demand for each resource is the same, that is, a is satisfied ji =a ki ,1≤j,k≤m,1≤i≤n, it can be expressed that the resource utilization rate is
[0049] (2) When Ax = η, that is,
[0050] If and only if the user's demand for each resource is the same, then a is satisfied. ji =a ki ,1≤j,k≤m,1≤i≤n, it can be expressed that the resource utilization rate is
[0051] (3) Satisfaction hour,
[0052] use Available
[0053] At this time, the resource utilization is 1≤j≤m,j≠j*,
[0054] For j*, visit each case in turn to obtain m resource utilization rates, find the maximum value, and the resource utilization rate is
[0055] In summary, the maximum resource utilization rate can be obtained through three feasible situations:
[0056] S4. Allocate corresponding resources to each user according to the maximum resource utilization and user priority.
[0057] Specifically, the maximum resource utilization rate obtained in step S3 is used to obtain the corresponding number of assigned tasks, and resources are allocated to ensure the priority of high-level users and the fairness of resource allocation.
[0058] Furthermore, the resource usage of each user is monitored, and unused resources are recycled.
[0059] Please combine Figure 2 , Figure 2 The final resource allocation distribution diagram formed by applying the user-level-based cloud resource allocation method in a specific embodiment. Assume that the user levels of a cloud platform are divided into four levels: senior member, member, ordinary user and trial user, and the corresponding levels are represented by 1, 2, 3 and 4 (the smaller the number, the higher the level). Taking the total number of existing resource types as 3 and the total number of users as 10 as an example, the implementation process of the user-level-based cloud resource allocation method is described in detail.
[0060] Assume that the user resource demand matrix is The prices of the three resources are p = [0.2, 0.8, 1] T , randomly generate level information of 10 users.
[0061] S1. Get user level information. Assume that the user level vector is w = [4,4,1,4,3,1,2,3,4,4] T ;
[0062] S2. Collect the user resource demand matrix A in real time. Assuming the resource utilization rate is η, create a resource allocation model, expressed as
[0063]
[0064] S3, using user priority constraints, the task is represented as x i =x 1 β i ,1≤i≤10,
[0065] Users have different needs for each resource, so
[0066] Furthermore,
[0067] When * =1 and j * =3, there is a situation where the resource utilization rate is greater than 1, which conflicts with the resource demand constraint, so it is discarded;
[0068] When * =2, η 3 =0.81;
[0069] Therefore, the maximum resource utilization is η 3 =0.81. At this time, the number of resources allocated to 10 users is as follows: Figure 2 shown.
[0070] Embodiment 2
[0071] Based on the same inventive concept as the method for allocating cloud resources based on user level in the aforementioned embodiment, the present invention further provides a system for allocating cloud resources based on user level, including:
[0072] User level module, used to obtain user level;
[0073] Real-time acquisition module, used to obtain user resource demand matrix and establish resource allocation model;
[0074] A calculation module, used to calculate the maximum resource utilization under the user priority constraint;
[0075] The resource allocation module is used to obtain the resource allocation number for each user corresponding to the maximum resource utilization rate, release resources to users according to the user priority sequence, monitor user dynamics, and recycle unused resources.
[0076] The foregoing Figure 1The various variations and specific examples of a user-level-based cloud resource allocation method in Example 1 are also applicable to a user-level-based cloud resource allocation system in this embodiment. Through the above detailed description of a user-level-based cloud resource allocation method, those skilled in the art can clearly know the implementation method of a user-level-based cloud resource allocation system in this embodiment, so for the sake of brevity of the specification, it will not be described in detail here.
[0077] Embodiment 3
[0078] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the method of the first embodiment when loaded into the processor.
[0079] Embodiment 4
[0080] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method of the first embodiment is implemented.
[0081] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention belong to the scope of the same technology of the present invention, the present invention is also intended to include these modifications and variations.
Claims
1. A method for allocating cloud resources based on user level, characterized in that: Includes steps: S1. Obtain user level and form a user level vector; S2. Collect user resource demand matrix in real time, and establish resource allocation model in combination with the user level vector; S3. According to the resource allocation model, the maximum resource utilization under the user priority constraint is calculated using the Lagrangian function; S4. Allocate corresponding resources to each user according to the maximum resource utilization and user priority.
2. The method according to claim 1, characterized in that The resource allocation model includes resource demand constraints, utilization constraints, task number non-negative constraints and user priority constraints.
3. The method according to claim 2, characterized in that In step S3, the optimization benchmark of the number of tasks is obtained through the user priority constraint.
4. The method according to claim 3, characterized in that The step S3 includes Determine whether the user's demand for each resource is the same. If so, use the full load optimization and minimum load optimization in the resource allocation model to respectively calculate the first resource utilization rate and the second resource utilization rate; if not, further determine whether a resource utilization rate is 1. If so, calculate the resource utilization rate of each resource when the utilization rate is 1 in turn and obtain the maximum value as the third resource utilization rate; The first resource utilization rate, the second resource utilization rate and the third resource utilization rate are compared to obtain a maximum resource utilization rate.
5. The method according to claim 4, characterized in that The full load optimization means that the resource utilization of the system is maximized.
6. The method according to claim 4, characterized in that The minimum load optimization means that the resource utilization of the system is minimized.
7. The method according to claim 1, characterized in that In step S4, the resource usage of each user is monitored, and unused resources are recycled.
8. A cloud resource allocation system based on user level, characterized in that: The system is applied to the method according to any one of claims 1 to 7, and the system comprises User level module, used to obtain user level; Real-time acquisition module, used to obtain user resource demand matrix and establish resource allocation model; A calculation module, used to calculate the maximum resource utilization under the user priority constraint; The resource allocation module is used to obtain the resource allocation number for each user corresponding to the maximum resource utilization rate, release resources to users according to the user priority sequence, monitor user dynamics, and recycle unused resources.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the computer program is loaded into the processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.