A resource allocation method, apparatus, equipment and medium
By allocating quotas to tenants and users in the cloud platform, combining exponential smoothing to calculate priorities, and adopting a "filling" strategy, the problem of unfair resource allocation in multi-tenant cloud platforms is solved, achieving more efficient resource utilization and tenant-level fairness.
Patent Information
- Application Number
- CN202310680183.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-07
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2043-06-07
AI Technical Summary
In multi-tenant cloud computing platforms, the existing resource allocation mechanism fails to effectively consider the fairness of resource allocation at the tenant level, resulting in insufficient fairness and efficiency in resource allocation.
By allocating tenant quotas to each tenant and user quotas to users based on these quotas, and combining the actual resource usage of users and tenants, user priority is calculated using the exponential smoothing method. Resources are allocated using a "filling" strategy, and effective resource usage is calculated through quotas, resource adjustments, and weights, thus achieving fair and efficient resource allocation.
It enables fairer, more flexible and efficient resource allocation in a multi-tenant environment, reduces resource waste, improves resource utilization, and takes into account the fairness of resource allocation at the tenant level.
Smart Images

Figure CN116546020B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of resource allocation, and more particularly to a resource allocation method, apparatus, device, and medium. Background Technology
[0002] Cloud computing refers to a new computing model that uses virtualization to share IT resources based on internet-related services. Its core idea is to unify the management and scheduling of computing, storage, network, and software resources through a network, achieving resource integration and configuration optimization. This allows for service-based access to and expansion by different users, on-demand usage and payment, and minimized costs. In cloud computing platforms, especially in multi-tenant scenarios, how to fairly and efficiently allocate resources among multiple tenants is a crucial issue.
[0003] Currently, Dominant Resource Fairness (DRF) is widely used in various cloud computing systems. The DRF mechanism calculates the ratio of the cumulative allocation of various resources to users in a cloud platform to the total amount of that type of resource in the system. The resource with the largest ratio is the dominant resource, and its corresponding ratio is the dominant share. The basic idea of the max-min fairness model is that the user with the smallest resource share can be allocated the most resources. The DRF mechanism extends the max-min fairness model, with the guiding principle that a user's dominant resource share determines resource allocation. However, the traditional DRF mechanism only considers the user's resource usage and quota. In actual cloud platforms, there are not only users but also tenants, requiring metering and billing not only for users but also for tenants. Summary of the Invention
[0004] In view of this, in order to solve the problem of how to allocate resources fairly and efficiently in cloud platforms, especially in private cloud platforms, and in multi-tenant scenarios, this invention provides a resource allocation method, apparatus, device, and medium.
[0005] According to a first aspect of the present invention, a resource allocation method is provided, the method comprising:
[0006] Assign tenant quotas to each tenant in a multi-tenant cloud platform, and assign user quotas to each user within the tenant based on each tenant's tenant quota;
[0007] The system acquires the actual resource usage of each user and the actual resource usage of each group of users at preset time intervals.
[0008] The actual resource usage of each user is adjusted based on the tenant quota, the user quota, and the actual resource usage of the tenant to obtain the effective resource usage of each user.
[0009] Based on the preset number of cycles, the effective resource usage, and the decay factor, the user's exponentially smoothed resource usage is calculated for each user.
[0010] Calculate user priority for each user based on the user index smoothing resource usage and the user quota corresponding to each user.
[0011] Resources are allocated to users in the cloud platform based on the user priority.
[0012] In some embodiments, the method further comprises:
[0013] Based on the formula, the user quota is normalized to obtain the normalized user quota;
[0014] Formula 1: Normalized user quota = user quota ÷ sum of quotas of all tenants on the cloud platform;
[0015] Calculate the normalized user quota for all users under each tenant to obtain the normalized tenant quota.
[0016] In some embodiments, the step of obtaining the actual resource usage of each user and the actual resource usage of each group of users at preset time intervals includes:
[0017] The usage of each user for different types of resources, and the weight of each resource type, are obtained at preset time intervals.
[0018] Calculate the user's actual resource usage according to Formula 2;
[0019] Formula 2: Actual resource usage by user = (Weight 1 * Usage of resource 1 + ... * Weight N * Usage of resource N) * Usage duration, where N equals the number of resource types;
[0020] The actual resource usage of the tenant is calculated according to Formula 3:
[0021] Formula 3: Actual resource usage of tenant = Actual resource usage of user 1 + Actual resource usage of user M, where user 1...user M are all users belonging to the same tenant.
[0022] In some embodiments, the effective resource usage is calculated according to Formula 4:
[0023] Formula 4: Effective resource usage = User's actual resource usage + ((Tenant's actual resource usage - User's actual resource usage) * Normalized user quota ÷ (Tenant's normalized tenant quota - Normalized user quota)).
[0024] In some embodiments, the user index smoothing resource usage is calculated according to Formula 5;
[0025] Formula 5: User Exponential Smoothing Resource Usage = Current Period Effective Resource Usage + (Decrease Factor * Previous Period Effective Resource Usage) + (Decrease Factor 2 * Previous Two Periods Effective Resource Usage) + ... + (Decrease Factor Preset Period Number * Previous Preset Period Number of Periods Effective Resource Usage), where the decrease factor is a number between 0 and 1.
[0026] In some embodiments, the step of calculating user priority for each user based on the user index smoothing resource usage and the user quota corresponding to each user includes:
[0027] Calculate the cluster exponential smoothing resource usage according to Formula 6;
[0028] Formula 6: Cluster Exponential Smoothing Resource Usage = Sum of Effective Resource Usage of All Users in the Cloud Platform in the Current Period + (Attenuation Factor * Sum of Effective Resource Usage of All Users in the Cloud Platform in the Previous Period) + (Attenuation Factor 2 * Sum of Effective Resource Usage of All Users in the Cloud Platform in the Previous Two Periods) + ... + (Attenuation Factor Preset Period Number * Sum of Effective Resource Usage of All Users in the Cloud Platform in the Previous Preset Period Number of Periods);
[0029] The user exponential smoothed resource usage is normalized according to Formula 7 to obtain the normalized user exponential smoothed resource usage.
[0030] Formula 7: Normalized User Exponentially Smoothed Resource Usage = User Exponentially Smoothed Resource Usage ÷ Cluster Exponentially Smoothed Resource Usage;
[0031] Calculate user priority according to Formula 8;
[0032] Formula 8: User Priority = 2^((-1) * Normalized User Exponential Smoothing Resource Usage ÷ Normalized User Quota).
[0033] In some embodiments, the step of allocating resources to users in the cloud platform according to the user priority includes:
[0034] Sort all users in the cloud platform according to their priority from highest to lowest.
[0035] Resources are allocated based on user order.
[0036] In response to the situation where there are insufficient remaining resources to allocate to the next user when a user is assigned in the user sorting, it is determined whether there are any users whose required resources are less than or equal to the remaining resources after the next user in the user sorting.
[0037] If such resources exist, the remaining resources will be allocated preferentially to users whose required resources are less than or equal to the remaining resources.
[0038] According to a second aspect of the present invention, a resource allocation apparatus is provided, the apparatus comprising:
[0039] The quota allocation module is used to allocate tenant quotas to each tenant in a multi-tenant cloud platform, and to allocate user quotas to each user in the tenant based on each tenant's tenant quota;
[0040] The acquisition module is used to acquire the actual resource usage of each user and the actual resource usage of each group of users at preset time intervals.
[0041] The correction module is used to correct the actual resource usage of the user based on the tenant quota, the user quota, and the actual resource usage of the tenant to obtain the effective resource usage of each user;
[0042] The first calculation module is used to calculate the user exponentially smoothed resource usage for each user based on a preset number of cycles, the effective resource usage, and the decay factor.
[0043] The second calculation module is used to calculate user priority for each user based on the user index smoothing resource usage and the user quota corresponding to each user.
[0044] The resource allocation module is used to allocate resources to users in the cloud platform according to the user priority.
[0045] According to a third aspect of the present invention, a computer device is also provided, the computer device comprising:
[0046] At least one processor; and
[0047] The memory stores computer programs that can run on the processor, which executes the aforementioned resource allocation method when executing the program.
[0048] According to a fourth aspect of the present invention, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, performs the aforementioned resource allocation method.
[0049] The resource allocation method described above uses parameters such as the historical resource usage of tenants and users, tenant / user quotas, and configured attenuation factors to calculate the priority of each user and allocate resources according to priority. This enables more fair, flexible, and efficient resource allocation in a multi-account, multi-tenant environment on the cloud platform.
[0050] In addition, the present invention also provides a resource allocation device, a computer device, and a computer-readable storage medium, which can achieve the above-mentioned technical effects, and will not be described in detail here. Attached Figure Description
[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying any creative work.
[0052] Figure 1 A flowchart illustrating a resource allocation method provided in one embodiment of the present invention;
[0053] Figure 2 This is a schematic diagram of a multi-tenant scenario in a cloud platform provided in another embodiment of the present invention;
[0054] Figure 3 A schematic diagram of a resource allocation device provided in another embodiment of the present invention;
[0055] Figure 4 This is an internal structural diagram of a computer device according to another embodiment of the present invention. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to specific examples and the accompanying drawings.
[0057] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. Subsequent embodiments will not explain this one by one.
[0058] In one embodiment, please refer to Figure 1 As shown, the present invention provides a resource allocation method 100, specifically, the method includes the following steps:
[0059] Step 101: Assign tenant quotas to each tenant in the multi-tenant cloud platform, and assign user quotas to each user in the tenant based on each tenant's tenant quota;
[0060] In this embodiment, the cloud platform, also known as a cloud computing platform, refers to a system in a cloud data center that provides computing, networking, and storage capabilities based on various hardware resources (including servers, storage, etc.) and software resources (application software, etc.). Through a series of technologies such as virtualization and distributed computing, user-submitted tasks can be allocated to a resource pool composed of data center server clusters, and corresponding computing power, storage space, or various software services can be provided according to user needs.
[0061] In a cloud platform, a tenant is a logical concept. Once an individual or enterprise registers an account on the cloud platform, the platform considers them a tenant and allocates resources based on the tenant as the basic unit. A tenant refers to a user who uses system or computing resources. This includes all data within the system that can be identified as a specific user, such as accounts and accounting data created in the system, various data settings within the system, and customized application environments configured by users. A tenant includes at least one user, and users in different tenants are independent of each other.
[0062] Step 102: Obtain the actual resource usage of each user and the actual resource usage of each group of users at preset time intervals.
[0063] In this embodiment, resources refer to the services that the cloud platform can provide. For example, resources can be at least one or a combination of CPU resources, memory resources, storage resources, and GPU resources.
[0064] Step 103: Based on the tenant quota, the user quota, and the tenant's actual resource usage, the user's actual resource usage is adjusted to obtain the effective resource usage for each user;
[0065] Step 104: Calculate the user exponentially smoothed resource usage for each user based on the preset number of cycles, the effective resource usage, and the decay factor;
[0066] Step 105: Calculate user priority for each user based on the user index smoothing resource usage and the user quota corresponding to each user;
[0067] Step 106: Allocate resources to users in the cloud platform according to the user priority.
[0068] In this embodiment, user priority is represented by a numerical value. The magnitude of the value can represent the level of priority. Specifically, the larger the user priority value, the higher the priority. Users with higher priority are allocated resources before users with lower priority.
[0069] The resource allocation method described above uses parameters such as the historical resource usage of tenants and users, tenant / user quotas, and configured attenuation factors to calculate the priority of each user and allocate resources according to priority. This enables more fair, flexible, and efficient resource allocation in a multi-account, multi-tenant environment on the cloud platform.
[0070] In some embodiments, the method further comprises:
[0071] Based on the formula, the user quota is normalized to obtain the normalized user quota;
[0072] Formula 1: Normalized user quota = user quota ÷ sum of quotas of all tenants on the cloud platform;
[0073] Calculate the normalized user quota for all users under each tenant to obtain the normalized tenant quota.
[0074] In some embodiments, the step of obtaining the actual resource usage of each user and the actual resource usage of each group of users at preset time intervals includes:
[0075] The usage of each user for different types of resources, and the weight of each resource type, are obtained at preset time intervals.
[0076] Calculate the user's actual resource usage according to Formula 2;
[0077] Formula 2: Actual resource usage by user = (Weight 1 * Usage of resource 1 + ... * Weight N * Usage of resource N) * Usage duration, where N equals the number of resource types;
[0078] The actual resource usage of the tenant is calculated according to Formula 3:
[0079] Formula 3: Actual resource usage of tenant = Actual resource usage of user 1 + Actual resource usage of user M, where user 1...user M are all users belonging to the same tenant.
[0080] In some embodiments, the effective resource usage is calculated according to Formula 4:
[0081] Formula 4: Effective resource usage = User's actual resource usage + ((Tenant's actual resource usage - User's actual resource usage) * Normalized user quota ÷ (Tenant's normalized tenant quota - Normalized user quota)).
[0082] In some embodiments, the user index smoothing resource usage is calculated according to Formula 5;
[0083] Formula 5: User Exponential Smoothing Resource Usage = Current Period Effective Resource Usage + (Decrease Factor * Previous Period Effective Resource Usage) + (Decrease Factor 2 * Previous Two Periods Effective Resource Usage) + ... + (Decrease Factor Preset Period Number * Previous Preset Period Number of Periods Effective Resource Usage), where the decrease factor is a number between 0 and 1.
[0084] In some embodiments, the step of calculating user priority for each user based on the user index smoothing resource usage and the user quota corresponding to each user includes:
[0085] Calculate the cluster exponential smoothing resource usage according to Formula 6;
[0086] Formula 6: Cluster Exponential Smoothing Resource Usage = Sum of Effective Resource Usage of All Users in the Cloud Platform in the Current Period + (Attenuation Factor * Sum of Effective Resource Usage of All Users in the Cloud Platform in the Previous Period) + (Attenuation Factor 2 * Sum of Effective Resource Usage of All Users in the Cloud Platform in the Previous Two Periods) + ... + (Attenuation Factor Preset Period Number * Sum of Effective Resource Usage of All Users in the Cloud Platform in the Previous Preset Period Number of Periods);
[0087] The user exponential smoothed resource usage is normalized according to Formula 7 to obtain the normalized user exponential smoothed resource usage.
[0088] Formula 7: Normalized User Exponentially Smoothed Resource Usage = User Exponentially Smoothed Resource Usage ÷ Cluster Exponentially Smoothed Resource Usage;
[0089] Calculate user priority according to Formula 8;
[0090] Formula 8: User Priority = 2^((-1) * Normalized User Exponential Smoothing Resource Usage ÷ Normalized User Quota).
[0091] In some embodiments, the step of allocating resources to users in the cloud platform according to the user priority includes:
[0092] Sort all users in the cloud platform according to their priority from highest to lowest.
[0093] Resources are allocated based on user order.
[0094] In response to the situation where there are insufficient remaining resources to allocate to the next user when a user is assigned in the user sorting, it is determined whether there are any users whose required resources are less than or equal to the remaining resources after the next user in the user sorting.
[0095] If such resources exist, the remaining resources will be allocated preferentially to users whose required resources are less than or equal to the remaining resources.
[0096] In yet another embodiment, to facilitate understanding of the present invention, please refer to the following... Figure 2 As shown, let's assume a cloud platform has three tenants, denoted as tenant 1 to tenant 3. Tenant 1 has user A, tenant 2 has user B, and tenant 3 has user C. It should be noted that this example uses one user per tenant for ease of understanding; in actual implementation, each tenant can have multiple users, and the number of users under different tenants can be the same or different. The following will explain in detail the use of... Figure 2 The specific implementation process of a resource allocation method for the cloud platform shown is as follows:
[0097] Step 1: Allocate quotas to tenants and users on the cloud platform. Users under a tenant share the tenant's quota. For example, if a tenant uses a quota of x (x is an integer) of resources across the entire platform, and there are several users under that tenant, these users share that quota, and the sum of their quotas cannot exceed x. Normalize the user quotas: Normalized user quota = User quota ÷ Sum of quotas for all tenants on the platform. After normalization, the user quota will be less than 1.
[0098] Step two: Calculate the historical resource usage of tenants and users. Since users may use multiple resources (such as CPU, memory, storage, etc.), users can assign different weights to different resources based on factors such as the price of different resources, and then sum the resource usage using a weighted average.
[0099] For example, if the CPU weight is set to 1 and the memory weight to 0.5, and a user uses 10 CPU and 20 memory, then the user's actual resource usage = (10*1 + 20*0.5) * usage time. The tenant's actual resource usage is the sum of the actual resource usage of all users under the tenant.
[0100] Step 3: Step 2 only considered the actual resource usage of the user and did not consider the resource usage of other users under the same tenant. The following step considers the resource usage of other users under the same tenant, corrects the user usage, and proposes the concept of effective resource usage.
[0101] User A's effective resource usage = User A's actual resource usage + ((User A's tenant's actual resource usage - User A's actual resource usage) * User A's quota ÷ (User A's tenant's quota - User A's quota))
[0102] The formula above converts the usage of other users in tenant A into the effective resource usage of user A according to the quota ratio. The effective resource usage of a user is the user's actual usage plus the usage of other users in the tenant converted according to the ratio.
[0103] Step four: The cloud platform calculates the effective resource usage for each user at fixed time intervals. By summing the user resource usage across all time intervals, the user's exponentially smoothed resource usage can be obtained.
[0104] Because user resource usage is not constant, referencing the exponential smoothing method commonly used in time series forecasting, resource usage over each statistical period is weighted and summed using a decay factor. The calculation method is as follows:
[0105] User index smoothed resource usage = current period effective resource usage + (decay factor * previous period effective resource usage) + (decay factor * decay factor * previous period effective resource usage) + ... and so on.
[0106] For ease of calculation, the user exponentially smoothed resource usage is normalized: Normalized user exponentially smoothed resource usage = User exponentially smoothed resource usage ÷ Cluster exponentially smoothed resource usage, where Cluster exponentially smoothed resource usage = Effective resource usage of the cluster in the current period + (decay factor * Effective resource usage of the cluster in the previous period) + (decay factor * decay factor * Effective resource usage of the cluster in the period before last) + ..., where the decay factor is a number between 0 and 1. The effective resource usage of the cluster refers to the sum of the effective resource usage of all users in the cloud platform.
[0107] Step 4: Calculate the priority of each user = 2^((-1) * normalized user exponential smoothed resource usage ÷ user quota).
[0108] Step 5: Sort users according to their priority from highest to lowest, and allocate resources to users with higher priority in order of priority.
[0109] Step six: Consider a scenario with three users, A, B, and C, with priorities from highest to lowest. Resources are allocated to user A first, then to user B. At this point, the remaining resources are insufficient, and user B must wait for other users to release resources. However, user C may require fewer resources, and the remaining resources in the system can meet user C's needs. In this case, resources can be allocated to user C, even though user C's priority is lower than user B's. This strategy is called the "filling" strategy.
[0110] The resource allocation scheme of this embodiment has at least the following beneficial technical effects:
[0111] (1) Regarding the calculation of resource usage, the common dominant resource fair allocation mechanism only calculates the usage of the resources occupied by the user, without calculating the usage of other non-dominant resources of the user; while the method of the present invention includes the various resources used by the user in the calculation of the user's resource usage, and performs a weighted summation of the usage of various resources, which better reflects the actual usage of various resources by the user, and the cloud platform administrator can set different weights for different resources according to factors such as the price of resources.
[0112] (2) A "filling" strategy was adopted. If resources are allocated strictly according to priority, some high-priority users will not be allocated resources, and some low-priority users will not be allocated resources either. This may lead to idle and wasted resources. By adopting the "filling" strategy, this situation of resource waste is avoided and the utilization rate of resources is improved.
[0113] (3) Exponential smoothing method, which uses exponential weighting based on historical periodic data for forecasting. This method is essentially derived from the weighted moving average method. Its advantage is that as long as the actual value and the forecast value of the previous period are available, the forecast value of the next period can be calculated. This saves a lot of data and processing time, reduces data storage, and is a simple and widely used short-term forecasting method. In this invention, the method does not simply add up the user's usage, but uses exponential smoothing to calculate the usage, which can more effectively reflect the trend of user resource usage.
[0114] (4) The traditional DRF mechanism only considers the user's resource usage and user quota. However, in actual cloud platforms, there are not only users but also tenants. It is necessary to meter and bill not only users but also tenants. The method of this invention also proposes the concept of effective resource usage, which considers resource allocation from the tenant level. This can not only ensure the fairness of resource allocation at the user level but also take into account the fairness of resource allocation at the tenant level.
[0115] In some embodiments, please refer to Figure 3 As shown, the present invention also provides a resource allocation device 200, the device comprising:
[0116] Quota allocation module 201 is used to allocate tenant quotas to each tenant in a multi-tenant cloud platform, and to allocate user quotas to each user in the tenant based on each tenant's tenant quota;
[0117] The acquisition module 202 is used to acquire the actual resource usage of each user and the actual resource usage of each group of users at a preset time interval.
[0118] The correction module 203 is used to correct the actual resource usage of the user based on the tenant quota, the user quota and the actual resource usage of the tenant to obtain the effective resource usage of each user.
[0119] The first calculation module 204 is used to calculate the user exponentially smoothed resource usage for each user based on a preset number of cycles, the effective resource usage, and the decay factor.
[0120] The second calculation module 205 is used to calculate the user priority for each user based on the user index smoothing resource usage and the user quota corresponding to each user.
[0121] Resource allocation module 206 is used to allocate resources to users in the cloud platform according to the user priority.
[0122] The aforementioned resource allocation device uses the historical resource usage of tenants and users, tenant / user quotas, and configured attenuation factors to calculate the priority of each user and allocate resources according to priority, thereby achieving a more fair, flexible, and efficient allocation of resources in a multi-account, multi-tenant environment in the cloud platform.
[0123] It should be noted that specific limitations regarding the resource allocation device can be found in the limitations of the resource allocation method described above, and will not be repeated here. Each module in the aforementioned resource allocation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0124] According to another aspect of the present invention, a computer device is provided, which may be a server, and its internal structure diagram is shown below. Figure 4 As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements the resource allocation method described above. Specifically, the method includes the following steps:
[0125] Assign tenant quotas to each tenant in a multi-tenant cloud platform, and assign user quotas to each user within the tenant based on each tenant's tenant quota;
[0126] The system acquires the actual resource usage of each user and the actual resource usage of each group of users at preset time intervals.
[0127] The actual resource usage of each user is adjusted based on the tenant quota, the user quota, and the actual resource usage of the tenant to obtain the effective resource usage of each user.
[0128] Based on the preset number of cycles, the effective resource usage, and the decay factor, the user's exponentially smoothed resource usage is calculated for each user.
[0129] Calculate user priority for each user based on the user index smoothing resource usage and the user quota corresponding to each user.
[0130] Resources are allocated to users in the cloud platform based on the user priority.
[0131] According to another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, it implements the resource allocation method described above, specifically including the following steps:
[0132] Assign tenant quotas to each tenant in a multi-tenant cloud platform, and assign user quotas to each user within the tenant based on each tenant's tenant quota;
[0133] The system acquires the actual resource usage of each user and the actual resource usage of each group of users at preset time intervals.
[0134] The actual resource usage of each user is adjusted based on the tenant quota, the user quota, and the actual resource usage of the tenant to obtain the effective resource usage of each user.
[0135] Based on the preset number of cycles, the effective resource usage, and the decay factor, the user's exponentially smoothed resource usage is calculated for each user.
[0136] Calculate user priority for each user based on the user index smoothing resource usage and the user quota corresponding to each user.
[0137] Resources are allocated to users in the cloud platform based on the user priority.
[0138] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0139] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0140] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A resource allocation method, characterized in that, The method includes: Assign tenant quotas to each tenant in a multi-tenant cloud platform, and assign user quotas to each user within the tenant based on each tenant's tenant quota; The system acquires the actual resource usage of each user and the actual resource usage of each group of users at preset time intervals. The actual resource usage of each user is adjusted based on the tenant quota, the user quota, and the actual resource usage of the tenant to obtain the effective resource usage of each user. Based on the preset number of cycles, the effective resource usage, and the decay factor, the user's exponentially smoothed resource usage is calculated for each user. Calculate user priority for each user based on the user index smoothing resource usage and the user quota corresponding to each user. Resources are allocated to users in the cloud platform based on the user priority.
2. The resource allocation method according to claim 1, characterized in that, The method further includes: Based on the formula, the user quota is normalized to obtain the normalized user quota; Formula 1: Normalized user quota = user quota ÷ sum of quotas of all tenants on the cloud platform; Calculate the normalized user quota for all users under each tenant to obtain the normalized tenant quota.
3. The resource allocation method according to claim 2, characterized in that, The step of obtaining the actual resource usage of each user and the actual resource usage of each group of users at preset time intervals includes: The usage of each user for different types of resources is obtained at preset time intervals, as well as the weight of each resource type. Calculate the user's actual resource usage according to Formula 2; Formula 2: Actual resource usage by user = (Weight 1 * Usage of resource 1 + ... * Weight N * Usage of resource N) * Usage duration, where N equals the number of resource types; The actual resource usage of the tenant is calculated according to Formula 3: Formula 3: Actual resource usage of tenant = Actual resource usage of user 1 + Actual resource usage of user M, where user 1...user M are all users belonging to the same tenant.
4. The resource allocation method according to claim 3, characterized in that, The effective resource utilization amount is calculated according to Formula 4: Formula 4: Effective resource usage = User's actual resource usage + ((Tenant's actual resource usage - User's actual resource usage) * Normalized user quota ÷ (Tenant's normalized tenant quota - Normalized user quota)).
5. The resource allocation method according to claim 4, characterized in that, The user index smoothing resource usage is calculated according to Formula 5; Formula 5: User Exponentially Smoothed Resource Usage = Current Period Effective Resource Usage + (Decrease Factor * Previous Period Effective Resource Usage) + (Decrease Factor) 2 *Effective resource usage in the first two cycles) + ... + (decay factor) 预设周期数 *The number of pre-set effective resource usage periods), where the decay factor is a number between 0 and 1.
6. The resource allocation method according to claim 5, characterized in that, The step of calculating user priority for each user based on the user index smoothing resource usage and the user quota corresponding to each user includes: Calculate the cluster exponential smoothing resource usage according to Formula 6; Formula 6: Cluster Exponentially Smoothed Resource Usage = Sum of Effective Resource Usage of All Users in the Cloud Platform in the Current Period + (Decrease Factor * Sum of Effective Resource Usage of All Users in the Cloud Platform in the Previous Period) + (Decrease Factor) 2 *Sum of effective resource usage by all users on the cloud platform in the first two cycles) + ... + (decay factor) 预设周期数 *The sum of the effective resource usage of all users on the cloud platform for several pre-set periods; The user exponential smoothed resource usage is normalized according to Formula 7 to obtain the normalized user exponential smoothed resource usage. Formula 7: Normalized User Exponentially Smoothed Resource Usage = User Exponentially Smoothed Resource Usage ÷ Cluster Exponentially Smoothed Resource Usage; Calculate user priority according to Formula 8; Formula 8: User Priority = 2^((-1) * Normalized User Exponential Smoothing Resource Usage ÷ Normalized User Quota).
7. The resource allocation method according to claim 6, characterized in that, The step of allocating resources to users in the cloud platform according to the user priority includes: Sort all users in the cloud platform according to their priority from highest to lowest. Resources are allocated based on user order. In response to the situation where there are insufficient remaining resources to allocate to the next user when a user is assigned in the user sorting, it is determined whether there are any users whose required resources are less than or equal to the remaining resources after the next user in the user sorting. If such resources exist, the remaining resources will be allocated preferentially to users whose required resources are less than or equal to the remaining resources.
8. A resource allocation device, characterized in that, The device includes: The quota allocation module is used to allocate tenant quotas to each tenant in a multi-tenant cloud platform, and to allocate user quotas to each user in the tenant based on each tenant's tenant quota. The acquisition module is used to acquire the actual resource usage of each user and the actual resource usage of each group of users at preset time intervals. The correction module is used to correct the actual resource usage of the user based on the tenant quota, the user quota, and the actual resource usage of the tenant to obtain the effective resource usage of each user; The first calculation module is used to calculate the user exponentially smoothed resource usage for each user based on a preset number of cycles, the effective resource usage, and the decay factor. The second calculation module is used to calculate user priority for each user based on the user index smoothing resource usage and the user quota corresponding to each user. The resource allocation module is used to allocate resources to users in the cloud platform according to the user priority.
9. A computer device, characterized in that, include: At least one processor; as well as A memory storing a computer program executable in the processor, wherein the processor executes the program to perform the method according to any one of claims 1-7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it performs the method described in any one of claims 1-7.
Citation Information
Patent Citations
Systems and / or methods for resource use limitation in a cloud environment
US20160142323A1
Systems and methods for resource management for multi-tenant applications in a hadoop cluster
US20190205173A1