CN108667940B - Resource allocation method and device of cloud platform and computer readable storage medium - Google Patents

Resource allocation method and device of cloud platform and computer readable storage medium Download PDF

Info

Publication number
CN108667940B
CN108667940B CN201810498166.9A CN201810498166A CN108667940B CN 108667940 B CN108667940 B CN 108667940B CN 201810498166 A CN201810498166 A CN 201810498166A CN 108667940 B CN108667940 B CN 108667940B
Authority
CN
China
Prior art keywords
cloud terminal
quota
resource
cloud
resource quota
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810498166.9A
Other languages
Chinese (zh)
Other versions
CN108667940A (en
Inventor
程龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN201810498166.9A priority Critical patent/CN108667940B/en
Publication of CN108667940A publication Critical patent/CN108667940A/en
Application granted granted Critical
Publication of CN108667940B publication Critical patent/CN108667940B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • H04L41/5041Network service management, e.g. ensuring proper service fulfilment according to agreements characterised by the time relationship between creation and deployment of a service
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Abstract

The invention discloses a resource allocation method of a cloud platform, which comprises the steps of determining a cloud terminal to be allocated corresponding to a resource allocation request according to the resource allocation request; acquiring a resource quota of a superior agent of the cloud terminal and a quota coefficient of the cloud terminal, and determining the resource quota of the cloud terminal according to the resource quota of the superior agent and the quota coefficient of the cloud terminal, wherein the quota coefficient is less than 1; and configuring resources for the cloud terminal according to the resource quota of the cloud terminal. The invention also discloses a resource allocation device of the cloud platform and a computer readable storage medium. The resource quota of the cloud terminal is obtained through the method, and after the resource amount of the resource quota is distributed to the cloud terminal, the operation requirement of the cloud terminal can be met, the cloud terminal can be controlled not to use resources in a transition mode, and therefore the fact that agents distribute resources in a transition mode is avoided.

Description

Resource allocation method and device of cloud platform and computer readable storage medium
Technical Field
The present invention relates to the technical field of cloud platforms, and in particular, to a resource allocation method and apparatus for a cloud platform, and a computer-readable storage medium.
Background
With the development of computer technology, the developed cloud platform has the advantages of convenience, economy, high expansibility and the like and is widely used by users. However, in the existing cloud platform, the phenomenon that users use shared resources in transition often occurs when resources are shared and used as needed.
In the prior art, the resource usage of tenants is limited by setting the resource usage quota, so as to avoid the transitional use of common resources by a certain tenant.
The resource usage quota is set, so that the resource occupation quantity of a single tenant is limited to a certain extent, but the resource usage quantity of an agent cannot be limited. Therefore, when a multi-level agent exists, the agent can apply for the resource quantity at will and set the resource quota for the tenant or sub-agent below the agent, so that the agent is caused to distribute resources in a transition manner.
Disclosure of Invention
The invention mainly aims to provide a resource allocation method and device of a cloud platform and a computer readable storage medium, and aims to solve the technical problem of transitional allocation of resources by an agent.
In order to achieve the above object, the present invention provides a resource allocation method for a cloud platform, which comprises the following steps:
determining a cloud terminal to be allocated corresponding to the resource allocation request according to the resource allocation request;
acquiring a resource quota of a superior agent of the cloud terminal and a quota coefficient of the cloud terminal, and determining the resource quota of the cloud terminal according to the resource quota of the superior agent and the quota coefficient of the cloud terminal, wherein the quota coefficient is less than 1;
and configuring resources for the cloud terminal according to the resource quota of the cloud terminal.
Preferably, the step of obtaining the quota coefficient of the cloud terminal includes:
and acquiring a quota coefficient of the cloud terminal according to the resource allocation request.
Preferably, the step of obtaining the quota coefficient of the cloud terminal includes:
acquiring the weight of the cloud terminal and the remaining resource quota of the superior agent;
and calculating a quota coefficient of the cloud terminal according to the weight of the cloud terminal and the residual resource quota of the superior agent.
Preferably, the step of obtaining the quota coefficient of the cloud terminal includes:
judging whether a quota coefficient of the cloud terminal exists in the resource allocation request;
when the quota coefficient of the cloud terminal exists in the resource allocation request, acquiring the quota coefficient of the cloud terminal in the resource allocation request;
when the quota coefficient of the cloud terminal does not exist in the resource allocation request, acquiring the weight of the cloud terminal and the remaining resource quota of the superior agent in the resource allocation request;
and calculating a quota coefficient of the cloud terminal according to the weight of the cloud terminal and the residual resource quota of the superior agent.
Preferably, before the step of configuring resources for the cloud terminal according to the resource quota of the cloud terminal, the method further includes:
acquiring the residual resource quota of the superior agent, and judging whether the resource quota of the cloud terminal is less than or equal to the residual resource quota of the superior agent;
and when the resource quota of the cloud terminal is smaller than or equal to the remaining resource quota of the superior agent, executing the step of configuring the resources for the cloud terminal according to the resource quota of the cloud terminal.
Preferably, after the step of determining whether the resource quota of the cloud terminal is less than or equal to the remaining resource quota of the superior agent, the method further includes:
and when the resource quota of the cloud terminal is larger than the residual resource quota of the superior agent, generating first prompt information.
Preferably, before the step of generating the first prompt message, the method further includes:
and when the resource quota of the cloud terminal is larger than the residual resource quota of the superior agent, configuring resources for the cloud terminal according to the residual resource quota of the superior agent.
Preferably, after the step of determining whether the resource quota of the cloud terminal is less than or equal to the remaining resource quota of the superior agent, the method further includes:
when the resource quota of the cloud terminal is smaller than or equal to the remaining resource quota of the superior agent, acquiring a resource quota to be used by the cloud terminal;
judging whether the resource quota of the cloud terminal is larger than or equal to the resource quota to be used by the cloud terminal;
when the resource quota of the terminal is larger than or equal to the resource quota to be used by the cloud terminal, executing the step of configuring the resources for the cloud terminal according to the resource quota of the cloud terminal;
and when the resource quota of the terminal is smaller than the resource quota to be used by the cloud terminal, generating second prompt information.
Preferably, after the step of determining the cloud terminal to be allocated corresponding to the resource allocation request according to the resource allocation request, the method further includes:
judging whether the cloud terminal has a superior agent or not;
when the cloud terminal has a superior agent, executing the step of acquiring the resource quota of the superior agent of the cloud terminal and the quota coefficient of the cloud terminal, and determining the resource quota of the cloud terminal according to the resource quota of the superior agent and the quota coefficient of the cloud terminal;
when the superior agent does not exist in the cloud terminal, the resource quota of the cloud platform and the quota coefficient of the cloud terminal are obtained, and the resource quota of the cloud terminal is determined according to the resource quota of the cloud platform and the quota coefficient of the cloud terminal.
Preferably, when configuring the resource for the cloud terminal, before the step of configuring the resource for the cloud terminal according to the resource quota of the cloud terminal, the method further includes:
and locking the resource quota database, wherein the resource quota of the cloud terminal is updated in the resource quota database of the cloud platform, and the resource quota database is unlocked after the resources are configured for the cloud terminal.
In addition, to achieve the above object, the present invention also provides a resource allocation apparatus for a cloud platform, wherein the resource allocation apparatus for a cloud platform includes: the cloud platform resource allocation method comprises a memory, a processor and a resource allocation program stored on the memory and capable of running on the processor, wherein when executed by the processor, the resource quota management program realizes the steps of the resource allocation method of the cloud platform according to any one of the above items.
In addition, to achieve the above object, the present invention further provides a computer readable storage medium, wherein a resource allocation program is stored on the computer readable storage medium, and when executed by a processor, the resource allocation program implements the steps of the resource allocation method for a cloud platform according to any one of the above.
According to the resource allocation method and device for the cloud platform and the computer-readable storage medium provided by the embodiment of the invention, when the cloud platform receives the resource allocation request, the cloud platform determines the cloud terminal needing resource allocation through the resource allocation request, and acquires the resource quota of the superior agent corresponding to the cloud terminal and the quota coefficient of the cloud terminal through the database. And calculating the resource quota of the cloud terminal according to the resource quota of the superior agent and the quota coefficient of the cloud terminal, and writing the calculated resource quota of the cloud terminal into a quota database to realize the resource configuration of the cloud terminal. The resource quota of the cloud terminal is obtained through the method, and the resource amount of the resource quota is configured to the cloud terminal, so that the operation requirement of the cloud terminal can be met, the cloud terminal can be controlled not to use resources in a transitional mode, and the transitional allocation of resources by an agent is avoided.
Drawings
Fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a resource allocation method of a cloud platform according to a first embodiment of the present invention;
fig. 3 is a schematic diagram of a cloud terminal resource quota architecture according to the present invention;
fig. 4 is a flowchart illustrating a resource allocation method of a cloud platform according to a second embodiment of the present invention;
fig. 5 is a schematic flowchart of a resource allocation method of a cloud platform according to a third embodiment of the present invention;
fig. 6 is a schematic flowchart of a resource allocation method of a cloud platform according to a fourth embodiment of the present invention;
fig. 7 is a flowchart illustrating a resource allocation method for a cloud platform according to a fifth embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows:
determining a cloud terminal to be allocated corresponding to the resource allocation request according to the resource allocation request;
acquiring a resource quota of a superior agent of the cloud terminal and a quota coefficient of the cloud terminal, and determining the resource quota of the cloud terminal according to the resource quota of the superior agent and the quota coefficient of the cloud terminal, wherein the quota coefficient is less than 1;
and configuring resources for the cloud terminal according to the resource quota of the cloud terminal.
In the prior art, the service quality of the cloud platform is influenced by the fact that the agents distribute resources in a transition mode.
The invention provides a solution, when a cloud platform receives a resource allocation request, a cloud terminal needing resource allocation is determined through the resource allocation request, and a resource quota of a superior agent corresponding to the cloud terminal and a quota coefficient of the cloud terminal are obtained through a database. And calculating the resource quota of the cloud terminal according to the resource quota of the superior agent and the quota coefficient of the cloud terminal, and writing the calculated resource quota of the cloud terminal into a quota database to realize the resource configuration of the cloud terminal. The resource quota of the cloud terminal is obtained through the method, and after the resource amount of the resource quota is distributed to the cloud terminal, the operation requirement of the cloud terminal can be met, the cloud terminal can be controlled not to use resources in a transition mode, and therefore the fact that agents distribute resources in a transition mode is avoided.
As shown in fig. 1, fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention.
The terminal of the embodiment of the invention can be a cloud platform.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU, a network interface 1003, a memory 1004, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The network interface 1003 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1004 may be a high-speed RAM memory or a non-volatile memory (e.g., a disk memory). The memory 1004 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, the memory 1004, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a resource allocation program.
In the terminal shown in fig. 1, the network interface 1003 is mainly used to connect to each cloud terminal, receive a resource allocation request of the cloud terminal, and the processor 1001 may be configured to call a resource allocation program stored in the memory 1004, and perform the following operations:
determining a cloud terminal to be allocated corresponding to the resource allocation request according to the resource allocation request;
acquiring a resource quota of a superior agent of the cloud terminal and a quota coefficient of the cloud terminal, and determining the resource quota of the cloud terminal according to the resource quota of the superior agent and the quota coefficient of the cloud terminal, wherein the quota coefficient is less than 1;
and configuring resources for the cloud terminal according to the resource quota of the cloud terminal.
Further, the processor 1001 may call a resource allocation program stored in the memory 1004, and further perform the following operations:
and acquiring a quota coefficient of the cloud terminal according to the resource allocation request.
Further, the processor 1001 may call a resource allocation program stored in the memory 1004, and further perform the following operations:
acquiring the weight of the cloud terminal and the remaining resource quota of the superior agent;
and calculating a quota coefficient of the cloud terminal according to the weight of the cloud terminal and the residual resource quota of the superior agent.
Further, the processor 1001 may call a resource allocation program stored in the memory 1004, and further perform the following operations:
judging whether a quota coefficient of the cloud terminal exists in the resource allocation request;
when the quota coefficient of the cloud terminal exists in the resource allocation request, acquiring the quota coefficient of the cloud terminal in the resource allocation request;
when the quota coefficient of the cloud terminal does not exist in the resource allocation request, acquiring the weight of the cloud terminal and the remaining resource quota of the superior agent in the resource allocation request;
and calculating a quota coefficient of the cloud terminal according to the weight of the cloud terminal and the residual resource quota of the superior agent.
Further, the processor 1001 may call a resource allocation program stored in the memory 1004, and further perform the following operations:
acquiring the residual resource quota of the superior agent, and judging whether the resource quota of the cloud terminal is less than or equal to the residual resource quota of the superior agent;
and when the resource quota of the cloud terminal is smaller than or equal to the remaining resource quota of the superior agent, executing the step of configuring the resources for the cloud terminal according to the resource quota of the cloud terminal.
Further, the processor 1001 may call a resource allocation program stored in the memory 1004, and further perform the following operations:
and when the resource quota of the cloud terminal is larger than the residual resource quota of the superior agent, generating first prompt information.
Further, the processor 1001 may call a resource allocation program stored in the memory 1004, and further perform the following operations:
and when the resource quota of the cloud terminal is larger than the residual resource quota of the superior agent, configuring resources for the cloud terminal according to the residual resource quota of the superior agent.
Further, the processor 1001 may call a resource allocation program stored in the memory 1004, and further perform the following operations:
when the resource quota of the cloud terminal is smaller than or equal to the remaining resource quota of the superior agent, acquiring a resource quota to be used by the cloud terminal;
judging whether the resource quota of the cloud terminal is larger than or equal to the resource quota to be used by the cloud terminal;
when the resource quota of the terminal is larger than or equal to the resource quota to be used by the cloud terminal, executing the step of configuring the resources for the cloud terminal according to the resource quota of the cloud terminal;
and when the resource quota of the terminal is smaller than the resource quota to be used by the cloud terminal, generating second prompt information.
Further, the processor 1001 may call a resource allocation program stored in the memory 1004, and further perform the following operations:
judging whether the cloud terminal has a superior agent or not;
when the cloud terminal has a superior agent, executing the step of acquiring the resource quota of the superior agent of the cloud terminal and the quota coefficient of the cloud terminal, and determining the resource quota of the cloud terminal according to the resource quota of the superior agent and the quota coefficient of the cloud terminal;
when the superior agent does not exist in the cloud terminal, the resource quota of the cloud platform and the quota coefficient of the cloud terminal are obtained, and the resource quota of the cloud terminal is determined according to the resource quota of the cloud platform and the quota coefficient of the cloud terminal.
Further, the processor 1001 may call a resource allocation program stored in the memory 1004, and further perform the following operations:
and locking the resource quota database, wherein the resource quota of the cloud terminal is updated in the resource quota database of the cloud platform, and the resource quota database is unlocked after the resources are configured for the cloud terminal.
Referring to fig. 2, a resource allocation method of a cloud platform according to a first embodiment of the present invention includes:
step S10, determining the cloud terminal to be allocated corresponding to the resource allocation request according to the resource allocation request.
Step S20, obtaining a resource quota of a superior agent of the cloud terminal and a quota coefficient of the cloud terminal, and determining the resource quota of the cloud terminal according to the resource quota of the superior agent and the quota coefficient of the cloud terminal, where the quota coefficient is less than 1.
In the prior art, resource configuration of a lower-level agent or a tenant is responsible for the upper-level agent, and a cloud platform cannot limit allocation of resources by the agent, so that the agent cannot limit excessive use of resources of a sub-agent or the tenant under a flag, available resources of other tenants are reduced, and the agent excessively allocates resources, which affects service quality of the cloud platform.
According to the invention, a quota control system module is added in a cloud platform control system, and is responsible for controlling the management and distribution of agent resource quotas and storing the distributable resource quota values of each agent. And both the agent manager and the cloud platform manager set the resource quota through the quota system module. The configuration of each agent to the resources is strictly limited, the resource use limit of the agent is controlled, and the service quality of the cloud platform is improved.
The cloud platform can be divided into a plurality of hierarchy agents according to the service, the agents of different hierarchies have a superior-subordinate relationship, the total resource quota is uniformly distributed and managed by a cloud platform administrator, then the agent management of each hierarchy has own resource quota and is constrained by the resource quota of the superior agent, and the resource quotas of tenants or subordinate agents under the self flag can be independently managed. The resource quota of the agent or the tenant is the resource quota of the agent at the upper level multiplied by a quota coefficient, wherein the quota coefficient is set according to the attribute of the agent or the tenant, and the numerical values of the quota coefficients are both larger than 0 and smaller than 1.
Agents and tenants in the cloud platform are collectively referred to as cloud terminals. When the resources are configured for the cloud terminal, the cloud platform system receives the resource allocation request, and then the cloud terminal to be allocated with the resources is determined according to the received resource allocation request. There are various ways to determine the identity of the cloud terminal according to the resource allocation request, and a common method is to carry the identity of the cloud terminal in the resource allocation request.
According to the cloud terminal to be distributed, calling a resource quota system function interface to obtain the resource quota of the superior agent corresponding to the cloud terminal and the quota coefficient of the cloud terminal through a database. And calculating the resource quota of the cloud terminal according to the resource quota of the superior agent and the quota coefficient of the cloud terminal. The calculated resource quota of the cloud terminal can meet the operation requirement of the cloud terminal, and can control the cloud terminal not to use resources excessively, so that the waste of the resources is avoided.
For example, when configuring resources for agent C in fig. 3, a resource allocation request of agent C is sent to the cloud platform, after receiving the resource allocation request, the cloud platform obtains a resource quota of agent a (agent a is a superior agent of agent C) and a quota coefficient of agent C, and calculates the resource quota of agent C according to the resource quota of agent a and the quota coefficient of agent C. In addition, agent a allocates resources to tenant a1 in addition to allocating resources to agent C, so the remaining resource quota of agent a is the resource quota of agent a minus the resource quota allocated to tenant a 1. Similarly, resources configured by agent C will also be allocated to tenant C1 and tenant C2.
The quota coefficient acquisition method of the cloud terminal can be realized by directly acquiring a quota coefficient provided by a superior agent of the cloud terminal in a resource allocation request; the method can also be used for obtaining the weight of the cloud terminal and the residual resource quota of the superior agent of the cloud terminal, multiplying the obtained weight of the cloud terminal and the residual resource quota of the superior agent of the cloud terminal or correcting the product of the obtained weight of the cloud terminal and the residual resource quota of the superior agent of the cloud terminal by a specific coefficient to obtain a quota coefficient of the cloud terminal, wherein the weight of the cloud terminal is related to the attribute of the cloud terminal; the method can also be used for judging whether a quota coefficient of the cloud terminal exists in a received resource allocation request, directly obtaining the quota coefficient of the cloud terminal in the resource allocation request when the quota coefficient exists, obtaining the weight of the cloud terminal and the residual resource quota of a superior agent of the cloud terminal when the quota coefficient does not exist, multiplying the obtained weight of the cloud terminal and the residual resource quota of the superior agent of the cloud terminal or correcting the product of the obtained weight of the cloud terminal and the residual resource quota of the superior agent of the cloud terminal by a specific coefficient to obtain the quota coefficient of the cloud terminal; the quota coefficient of the cloud terminal may also be obtained in other manners, which is not described in detail herein.
In addition, the resource allocation of the cloud terminal is allocated by a superior agent of the cloud terminal or a resource allocation manager of the cloud platform, so that when the cloud platform receives the resource allocation request, it needs to first determine whether the user sending the resource allocation request has the right to allocate resources to the cloud terminal. When the user sending the resource allocation request has the authority of allocating resources to the cloud terminal, the following operation of allocating resources to the cloud terminal can be continuously executed; when the user sending the resource allocation request does not have the authority of allocating resources to the cloud terminal, prompt information is generated to prompt that the current resource allocation request is operated illegally, and the resource allocation of the cloud terminal fails.
Step S30, configuring resources for the cloud terminal according to the resource quota of the cloud terminal.
And according to the resource quota value of the cloud terminal, calling an interface to configure the resources of the cloud terminal, wherein the resource configuration method comprises the step of writing the resource quota of the cloud terminal into a quota database.
In this embodiment, when the cloud platform receives the resource allocation request, the cloud platform determines, through the resource allocation request, a cloud terminal that needs to perform resource allocation, and obtains, through the database, a resource quota of a superior agent corresponding to the cloud terminal and a quota coefficient of the cloud terminal. And calculating the resource quota of the cloud terminal according to the resource quota of the superior agent and the quota coefficient of the cloud terminal, and writing the calculated resource quota of the cloud terminal into a quota database to realize the resource configuration of the cloud terminal. The resource quota of the cloud terminal is obtained through the method, and the resource amount of the resource quota is configured to the cloud terminal, so that the operation requirement of the cloud terminal can be met, and the cloud terminal can be controlled not to use resources in a transitional manner, so that the transitional allocation of resources by an agent is avoided, and the service quality of a cloud platform is ensured.
Further, referring to fig. 4, a second embodiment of the resource allocation method for a cloud platform according to the present invention is based on the first embodiment, before the step S30, further including:
step S40, acquiring a remaining resource quota of the superior agent;
step S50, determining whether the resource quota of the cloud terminal is less than or equal to the remaining resource quota of the upper-level agent;
when the resource quota of the cloud terminal is less than or equal to the remaining resource quota of the superior agent, step S30 is executed, that is, resources are configured for the cloud terminal according to the resource quota of the cloud terminal.
Step S60, when the resource quota of the cloud terminal is greater than the remaining resource quota of the upper-level agent, generate a first prompt message.
And acquiring the resource quota value which is already allocated to the sub-agent under the flag and the sub-tenant by the agent, and subtracting the resource quota value which is already allocated to the sub-agent under the flag and the sub-tenant from the total resource quota value of the agent to obtain the residual resource quota of the agent.
The resource configured by the cloud terminal is from a higher-level agent of the cloud terminal, so when configuring the resource for the cloud terminal, whether the higher-level agent of the cloud terminal can give the cloud terminal the required resource amount needs to be known first.
Therefore, the resource quota value of the cloud terminal is compared with the residual resource quota value of the superior agent of the cloud terminal, and whether the resource quota of the cloud terminal is smaller than or equal to the residual resource quota of the superior agent is judged. When the resource quota of the cloud terminal is less than or equal to the remaining resource quota of the superior agent, executing step S30, and configuring resources for the cloud terminal; when the resource quota of the cloud terminal is larger than the remaining resource quota of the superior agent, it is indicated that the remaining resource quota of the superior agent is not enough for the resource allocation operation of the current time, and first prompt information of resource allocation failure is generated, so that a later-stage user can improve the resource quota of the superior agent, and the resource allocation of a subordinate cloud terminal is met. The first prompt message may prompt that the remaining resource quota of the superior agent is too low; or the resource quota of the cloud terminal is too high; or the remaining resource quota of the agent is not enough to allocate resources to the subordinate cloud terminal, or other manners may be used, which is not described herein any more.
In addition, when the resource quota of the cloud terminal is greater than the remaining resource quota of the superior agent, the remaining resources of the superior agent can be allocated to the cloud terminal while the first prompt message is generated, so that part of operation requirements of the cloud terminal can be met temporarily, and the working efficiency of the cloud terminal can be ensured.
The embodiment is only one implementation manner, and is not limited to this implementation manner.
In this embodiment, the remaining resource quota of the upper-level agent of the cloud terminal is obtained, and whether the resource quota of the cloud terminal is less than or equal to the remaining resource quota of the upper-level agent is determined. When the resource quota of the cloud terminal is smaller than or equal to the remaining resource quota of the superior agent, configuring resources for the cloud terminal according to the resource quota of the cloud terminal; when the resource quota of the cloud terminal is larger than the remaining resource quota of the superior agent, it is indicated that the remaining resource quota of the superior agent is not enough for the resource allocation operation of the current time, and first prompt information of resource allocation failure is generated, so that a later-stage user can improve the resource quota of the superior agent, the resource allocation of the subordinate cloud terminal is met, and the realizability of the resource allocation operation of the cloud platform is reflected.
Further, referring to fig. 5, a third embodiment of the resource allocation method for a cloud platform according to the present invention, based on the first or second embodiment, after the step S50, further includes:
step S70, when the resource quota of the cloud terminal is less than or equal to the remaining resource quota of the upper-level agent, obtain a resource quota to be used by the cloud terminal.
When the cloud terminal to be allocated corresponding to the resource allocation request is an agent and a subordinate agent and a tenant exist under the agent flag, the agent needs to allocate resources to the subordinate agent and the tenant, so that when the agent is configured with resources, the resource quota of the agent is greater than or equal to the sum of the resource quotas of all subordinate agents and tenants under the flag and the resource quota required by the operation of the agent. According to the historical resource allocation record in the agent, the resource allocation request of the subordinate agent or the tenant of the agent and the resource quota of the operation requirement of the agent, the resource quota to be used by the cloud terminal can be obtained. In addition, when the cloud terminal to be allocated corresponding to the resource allocation request is an agent, and a subordinate agent and a tenant do not exist under the agent flag, or the cloud terminal to be allocated is a tenant, a resource quota required by the operation of the cloud terminal itself needs to be considered, and the resource quota of the cloud terminal should be greater than or equal to the resource quota required by the operation of the cloud terminal itself.
Step S80, determining whether the resource quota of the cloud terminal is greater than or equal to the resource quota to be used by the cloud terminal.
When the resource quota of the terminal is greater than or equal to the resource quota to be used by the cloud terminal, step S30 is executed, that is, resources are configured for the cloud terminal according to the resource quota of the cloud terminal.
Step S90, when the resource quota of the terminal is smaller than the resource quota to be used by the cloud terminal, generate a second prompt message.
Comparing the resource quota of the cloud terminal with the resource quota to be used by the cloud terminal, and when the resource quota of the cloud terminal is greater than or equal to the resource quota to be used by the cloud terminal, executing the operation of the step S30 to configure resources for the cloud terminal; when the resource quota of the cloud terminal is smaller than the resource quota to be used by the cloud terminal, it is indicated that the resource quota of the cloud terminal cannot meet the use of the cloud terminal on the resource after configuration, and second prompt information of resource configuration failure is generated, so that a later-stage user can improve the quota coefficient or weight of the cloud terminal, and the resource quota of the cloud terminal is improved. The second prompt message may prompt that the resource quota of the cloud terminal of the resource configuration request is too low; or the resource quota to be used by the cloud terminal is too high; or the resource quota of the cloud terminal cannot meet the resource use requirement of the cloud terminal.
In addition, it may also be determined whether the resource quota of the cloud terminal is greater than or equal to the resource quota to be used by the cloud terminal, and when the determination result is that the resource quota of the cloud terminal is greater than or equal to the resource quota to be used by the cloud terminal, it is determined whether the resource quota of the cloud terminal is less than or equal to the remaining resource quota of the upper-level agent, that is, steps S70 to S90 are performed first, and then steps S40 to S60 are performed.
In this embodiment, a resource quota to be used by a cloud terminal is obtained, the resource quota of the cloud terminal is compared with the resource quota to be used by the cloud terminal, and when the resource quota of the cloud terminal is greater than or equal to the resource quota to be used by the cloud terminal, an operation of configuring resources for the cloud terminal is executed; when the resource quota of the cloud terminal is smaller than the resource quota to be used by the cloud terminal, it is indicated that the resource quota of the cloud terminal cannot meet the use of the cloud terminal on the resource after configuration, and second prompt information of resource configuration failure is generated so that a later-stage user can improve the quota coefficient or weight of the cloud terminal and improve the resource quota of the cloud terminal, so that the resource configured by the cloud terminal can meet the use of the cloud terminal, and the effective configuration of the resource of the cloud terminal is realized.
Further, referring to fig. 6, a fourth embodiment of the resource allocation method for a cloud platform according to the present invention is based on any one of the first to third embodiments, and after step S10, the method further includes:
step S100, judging whether a superior agent exists in the cloud terminal;
when the cloud terminal has a superior agent, step S10 is executed, that is, the resource quota of the superior agent of the cloud terminal and the quota coefficient of the cloud terminal are obtained, and the resource quota of the cloud terminal is determined according to the resource quota of the superior agent and the quota coefficient of the cloud terminal.
Step S110, when the cloud terminal does not have a superior agent, obtaining a resource quota of the cloud platform and a quota coefficient of the cloud terminal, and determining a resource quota of the cloud terminal according to the resource quota of the cloud platform and the quota coefficient of the cloud terminal.
When a resource allocation manager of the cloud platform performs resource allocation, the cloud terminal to be allocated may be a top-level agent when no upper-level agent exists in the cloud terminal, and the resource quota of the top-level agent is determined by a preset resource quota of the cloud platform and a quota coefficient of the top-level agent because the top-level agent does not have the upper-level agent, the determination mode is similar to that of other cloud terminals, and the difference is that the resource quota of the upper-level agent in other cloud terminals is changed to the resource quota of the cloud platform. The resources distributed by the top-level agent are directly from the cloud platform, so that the resource distribution is not limited by other resources, and the resources are directly configured for the top-level agent after the resource quota of the top-level agent is obtained.
In this embodiment, after the cloud platform receives the resource allocation request and determines the cloud terminal to be allocated according to the resource allocation request, it is determined whether the cloud terminal is a superior agent. When the cloud terminal has the superior agent, the step S20 is executed to determine the resource quota of the cloud terminal; when the superior agent does not exist in the cloud terminal, the resource quota of the cloud terminal is determined by the preset resource quota of the cloud platform and the quota coefficient of the top agent. The judgment of whether the superior agent exists is added, and the resource configuration scheme of the cloud terminal is improved.
Further, referring to fig. 7, a fifth embodiment of the resource allocation method for a cloud platform according to the present invention is based on any one of the first to fourth embodiments, before the step S30, further including:
step S120, locking a resource quota database, wherein when the resources are configured for the cloud terminal, the resource quota of the cloud terminal is updated in the resource quota database of the cloud platform, and the resource quota database is unlocked after the resources are configured for the cloud terminal.
When resource allocation of the cloud terminal is carried out, the resource quota of the cloud terminal is updated in the resource quota database of the cloud platform, in order to prevent errors of the cloud platform system caused by concurrent operation of multiple persons, the resource database is locked, and the resource allocation database is unlocked after the resource allocation of the cloud terminal is completed, so that resource allocation of other cloud terminals can be carried out. The locking operation of the resource quota database can be executed at any time before the resources are configured for the cloud terminal.
Further, when the resource quota database is locked, if the cloud terminal is requesting resource configuration and the resource quota database is already in a locked state, the locking fails. When the locking fails, the locking of the resource quota database can be tried again after a preset time interval, and if the locking still fails after the locking operation of the preset times is tried, the locking operation is stopped, and the resource quota data is generated to look at the locking failure information and the prompt information of the resource configuration failure.
In this embodiment, before resource configuration of the cloud terminal is performed, the resource database is locked, and after the resource configuration of the cloud terminal is completed, the resource configuration database is unlocked, so that resource configuration of other cloud terminals is performed. The method can effectively prevent the cloud platform system from generating errors caused by concurrent operation of multiple persons.
In addition, an embodiment of the present invention further provides a resource allocation apparatus for a cloud platform, where the resource allocation apparatus for the cloud platform includes: the resource quota management program is used for realizing the steps of the resource allocation method of the cloud platform according to the above embodiments when being executed by the processor.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, where a resource allocation program is stored on the computer-readable storage medium, and when the resource allocation program is executed by a processor, the steps of the resource allocation method of the cloud platform according to the above embodiments are implemented.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (12)

1. A resource allocation method of a cloud platform is characterized by comprising the following steps:
determining a cloud terminal to be allocated corresponding to the resource allocation request according to the resource allocation request;
acquiring a resource quota of a superior agent of the cloud terminal and a quota coefficient of the cloud terminal, and determining the resource quota of the cloud terminal according to the resource quota of the superior agent and the quota coefficient of the cloud terminal, wherein the quota coefficient is less than 1;
and configuring resources for the cloud terminal according to the resource quota of the cloud terminal.
2. The method for allocating resources of a cloud platform according to claim 1, wherein the step of obtaining the quota coefficient of the cloud terminal includes:
and acquiring a quota coefficient of the cloud terminal according to the resource allocation request.
3. The method for allocating resources of a cloud platform according to claim 1, wherein the step of obtaining the quota coefficient of the cloud terminal includes:
acquiring the weight of the cloud terminal and the remaining resource quota of the superior agent;
and calculating a quota coefficient of the cloud terminal according to the weight of the cloud terminal and the residual resource quota of the superior agent.
4. The method for allocating resources of a cloud platform according to claim 1, wherein the step of obtaining the quota coefficient of the cloud terminal includes:
judging whether a quota coefficient of the cloud terminal exists in the resource allocation request;
when the quota coefficient of the cloud terminal exists in the resource allocation request, acquiring the quota coefficient of the cloud terminal in the resource allocation request;
when the quota coefficient of the cloud terminal does not exist in the resource allocation request, acquiring the weight of the cloud terminal and the remaining resource quota of the superior agent in the resource allocation request;
and calculating a quota coefficient of the cloud terminal according to the weight of the cloud terminal and the residual resource quota of the superior agent.
5. The method for allocating resources of a cloud platform according to claim 1, wherein before the step of configuring resources for the cloud terminal according to the resource quota of the cloud terminal, the method further includes:
acquiring the residual resource quota of the superior agent, and judging whether the resource quota of the cloud terminal is less than or equal to the residual resource quota of the superior agent;
and when the resource quota of the cloud terminal is smaller than or equal to the remaining resource quota of the superior agent, executing the step of configuring the resources for the cloud terminal according to the resource quota of the cloud terminal.
6. The method for allocating resources of a cloud platform according to claim 5, wherein after the step of determining whether the resource quota of the cloud terminal is less than or equal to the remaining resource quota of the upper-level agent, the method further includes:
and when the resource quota of the cloud terminal is larger than the residual resource quota of the superior agent, generating first prompt information.
7. The method for allocating resources of a cloud platform of claim 6, wherein the step of generating the first hint information is preceded by:
and when the resource quota of the cloud terminal is larger than the residual resource quota of the superior agent, configuring resources for the cloud terminal according to the residual resource quota of the superior agent.
8. The method for allocating resources of a cloud platform according to claim 5, wherein after the step of determining whether the resource quota of the cloud terminal is less than or equal to the remaining resource quota of the upper-level agent, the method further includes:
when the resource quota of the cloud terminal is smaller than or equal to the remaining resource quota of the superior agent, acquiring a resource quota to be used by the cloud terminal;
judging whether the resource quota of the cloud terminal is larger than or equal to the resource quota to be used by the cloud terminal;
when the resource quota of the terminal is larger than or equal to the resource quota to be used by the cloud terminal, executing the step of configuring the resources for the cloud terminal according to the resource quota of the cloud terminal;
and when the resource quota of the terminal is smaller than the resource quota to be used by the cloud terminal, generating second prompt information.
9. The method for allocating resources of a cloud platform according to claim 1, wherein after the step of determining the cloud terminal to be allocated corresponding to the resource allocation request according to the resource allocation request, the method further comprises:
judging whether the cloud terminal has a superior agent or not;
when the cloud terminal has a superior agent, executing the step of acquiring the resource quota of the superior agent of the cloud terminal and the quota coefficient of the cloud terminal, and determining the resource quota of the cloud terminal according to the resource quota of the superior agent and the quota coefficient of the cloud terminal;
when the superior agent does not exist in the cloud terminal, the resource quota of the cloud platform and the quota coefficient of the cloud terminal are obtained, and the resource quota of the cloud terminal is determined according to the resource quota of the cloud platform and the quota coefficient of the cloud terminal.
10. The method for allocating resources of a cloud platform according to any one of claims 1 to 9, wherein before the step of configuring resources for the cloud terminal according to the resource quota of the cloud terminal, the method further includes:
and locking the resource quota database, wherein when the resources are configured for the cloud terminal, the resource quota of the cloud terminal is updated in the resource quota database of the cloud platform, and the resource quota database is unlocked after the resources are configured for the cloud terminal.
11. A resource allocation apparatus of a cloud platform, the resource allocation apparatus of the cloud platform comprising: a memory, a processor, and a resource allocation program stored on the memory and executable on the processor, the resource quota management program when executed by the processor implementing the steps of the resource allocation method of the cloud platform of any of claims 1 to 10.
12. A computer-readable storage medium, having stored thereon a resource allocation program which, when executed by a processor, implements the steps of the resource allocation method of the cloud platform of any one of claims 1 to 10.
CN201810498166.9A 2018-05-22 2018-05-22 Resource allocation method and device of cloud platform and computer readable storage medium Active CN108667940B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810498166.9A CN108667940B (en) 2018-05-22 2018-05-22 Resource allocation method and device of cloud platform and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810498166.9A CN108667940B (en) 2018-05-22 2018-05-22 Resource allocation method and device of cloud platform and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108667940A CN108667940A (en) 2018-10-16
CN108667940B true CN108667940B (en) 2021-04-09

Family

ID=63776539

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810498166.9A Active CN108667940B (en) 2018-05-22 2018-05-22 Resource allocation method and device of cloud platform and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108667940B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111064602B (en) * 2019-12-02 2022-04-05 紫光云技术有限公司 Resource quota management method under public cloud platform
CN111028931B (en) * 2019-12-11 2023-08-22 医渡云(北京)技术有限公司 Medical data processing method and device, electronic equipment and storage medium
CN111240836A (en) * 2020-01-06 2020-06-05 北京百度网讯科技有限公司 Computing resource management method and device, electronic equipment and storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103516623A (en) * 2012-06-25 2014-01-15 中兴通讯股份有限公司 Resource distribution method and system
CN102841595A (en) * 2012-09-27 2012-12-26 南京需求响应节能科技有限公司 Multi-stage resource scheduling management system
CN103888542A (en) * 2014-01-17 2014-06-25 汉柏科技有限公司 Method and system for cloud computing resource allocation
CN104639626B (en) * 2015-01-28 2018-04-17 华侨大学 A kind of multistage load estimation and cloud resource elasticity collocation method and monitoring configuration system
US9871857B2 (en) * 2015-04-29 2018-01-16 Microsoft Technology Licensing, Llc Optimal allocation of dynamic cloud computing platform resources
US10659542B2 (en) * 2016-04-27 2020-05-19 NetSuite Inc. System and methods for optimal allocation of multi-tenant platform infrastructure resources
US10482407B2 (en) * 2016-11-14 2019-11-19 Apptio, Inc. Identifying resource allocation discrepancies
CN108023836B (en) * 2017-10-31 2022-03-11 上海华为技术有限公司 Resource allocation method and access network equipment

Also Published As

Publication number Publication date
CN108667940A (en) 2018-10-16

Similar Documents

Publication Publication Date Title
CN108667940B (en) Resource allocation method and device of cloud platform and computer readable storage medium
US7032222B1 (en) Method and system for determining resource allocation to users by granting request based on user associated different limits and resource limit
US6499059B1 (en) Method of controlling a network element using a service profile and apparatus of the same
CN107659739B (en) List distribution method and device
CN114691567A (en) Multi-cloud interface adaptation method, system and storage medium based on micro-service
CN107295054A (en) The management method and device of cloud conferencing resource
CN111726241B (en) Network resource management method, system, network device and readable storage medium
CN114385370B (en) Memory allocation method, system, device and medium
CN116113923A (en) Container cluster management method and system
CN112003931B (en) Method and system for deploying scheduling controller and related components
CN110673787A (en) Volume configuration method and device
CN113225738A (en) Flow control method and device of vehicle-mounted terminal
CN107809497B (en) Number resource pool management method and system
CN107770296B (en) Method and device for allocating addresses
CN115168017B (en) Task scheduling cloud platform and task scheduling method thereof
CN115794396A (en) Resource allocation method, system and electronic equipment
CN110472406B (en) Cross-service system data authority control method and system
CN111641673A (en) Calling method and calling system of cloud resources
CN114217977B (en) Resource allocation method, device, equipment and storage medium
CN112000477A (en) Method, device, equipment and medium for load balancing in pod
CN113364611B (en) Resource ID management method, device, equipment and readable storage medium
CN110728385B (en) Shared object distribution method, server and system
CN111385422A (en) Reserved telephone traffic management method and device
CN113568708B (en) Platform creation method, device and equipment
CN109257201B (en) License sending method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20200611

Address after: Nanshan District Xueyuan Road in Shenzhen city of Guangdong province 518000 No. 1001 Nanshan Chi Park building A1 layer

Applicant after: SANGFOR TECHNOLOGIES Inc.

Address before: Nanshan District Xueyuan Road in Shenzhen city of Guangdong province 518000 No. 1001 Nanshan Chi Park A1 building five floor

Applicant before: Shenxin network technology (Shenzhen) Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant