CN112148427A - Cloud platform resource allocation method and device and computer readable storage medium - Google Patents

Cloud platform resource allocation method and device and computer readable storage medium Download PDF

Info

Publication number
CN112148427A
CN112148427A CN202010922862.5A CN202010922862A CN112148427A CN 112148427 A CN112148427 A CN 112148427A CN 202010922862 A CN202010922862 A CN 202010922862A CN 112148427 A CN112148427 A CN 112148427A
Authority
CN
China
Prior art keywords
cloud platform
resource allocation
utilization rate
processed
platform resources
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.)
Pending
Application number
CN202010922862.5A
Other languages
Chinese (zh)
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.)
Beijing Inspur Data Technology Co Ltd
Original Assignee
Beijing Inspur Data Technology 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 Beijing Inspur Data Technology Co Ltd filed Critical Beijing Inspur Data Technology Co Ltd
Priority to CN202010922862.5A priority Critical patent/CN112148427A/en
Publication of CN112148427A publication Critical patent/CN112148427A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation

Landscapes

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

Abstract

The embodiment of the invention discloses a cloud platform resource allocation method, a cloud platform resource allocation device and a cloud platform resource allocation medium. And analyzing the received to-be-processed task by using the trained resource allocation model, and outputting a resource allocation result, so that the analysis process is associated with the historical allocation result, and a more reliable resource allocation result can be obtained. The cloud platform resources are distributed to the tasks to be processed according to the resource distribution result, the demands of the tasks to be processed on the resources can be changed at different time intervals, in order to better fit the current actual resource demands of the tasks to be processed, the utilization rate of the cloud platform resources when the tasks to be processed are executed can be monitored, the cloud platform resources corresponding to the tasks to be processed currently are dynamically adjusted according to the utilization rate, the purpose of automatically and dynamically controlling resource distribution is achieved, and the resources are distributed more reasonably.

Description

Cloud platform resource allocation method and device and computer readable storage medium
Technical Field
The invention relates to the technical field of cloud computing, in particular to a cloud platform resource allocation method and device and a computer readable storage medium.
Background
In the field of cloud computing, resources are integrated, distributed and efficiently utilized, and are reasonably distributed and shared through a virtualization technology, so that huge expenses can be saved for enterprises and personal users, and the problem of reasonable resource distribution in the cloud computing process has important research value.
The traditional resource allocation mode mainly realizes the optimization problem of resource allocation by optimizing a file system and a programming model, and is suitable for scenes with less resource quantity. Along with the problems of great promotion of cloud platform resource demands, great demand variation in different periods and the like, the traditional resource allocation mode is difficult to meet the demands, and the problem of resource allocation imbalance is easily caused.
Therefore, how to achieve reasonable allocation of resources is a problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The embodiment of the invention aims to provide a cloud platform resource allocation method, a cloud platform resource allocation device and a computer readable storage medium, which can realize reasonable allocation of resources.
In order to solve the above technical problem, an embodiment of the present invention provides a cloud platform resource allocation method, including:
training a pre-established resource allocation model based on the long-term and short-term memory network according to the acquired historical data of resource allocation to obtain a trained resource allocation model;
analyzing the received task to be processed by utilizing the trained resource allocation model, and outputting a resource allocation result;
distributing cloud platform resources to the tasks to be processed according to the resource distribution result;
monitoring the utilization rate of the cloud platform resources when the tasks to be processed are executed; and dynamically adjusting the cloud platform resources currently corresponding to the tasks to be processed according to the utilization rate.
Optionally, the training a pre-established resource allocation model based on a long-term and short-term memory network according to the acquired historical data of resource allocation to obtain a trained resource allocation model includes:
acquiring historical data of resource allocation; the resource allocation historical data comprises historical tasks and corresponding resource allocation information thereof;
dividing the resource allocation historical data into a first historical data sample and a second historical data sample;
training a pre-established resource allocation model based on a long-term and short-term memory network according to the first historical data sample to obtain an initial resource allocation model;
analyzing the second historical data sample by using the initial resource allocation model, and outputting a resource allocation prediction result;
and adjusting the network weight of the initial resource allocation model according to the difference value between the resource allocation prediction result and the actual resource allocation result contained in the second historical data sample to obtain a trained resource allocation model.
Optionally, the dynamically adjusting, according to the utilization ratio, the cloud platform resource currently corresponding to the task to be processed includes:
when the utilization rate of the cloud platform resources meets the increasing condition within a preset time period, expanding the capacity of the cloud platform resources corresponding to the task to be processed currently;
and when the utilization rate of the cloud platform resources meets the decreasing condition within a preset time period, contracting the cloud platform resources currently corresponding to the task to be processed.
Optionally, when the utilization rate of the cloud platform resource meets an incremental condition within a preset time period, performing capacity expansion on the cloud platform resource currently corresponding to the task to be processed includes:
judging whether the increase value of the utilization rate of the cloud platform resources exceeds a first preset threshold value in a first time period; wherein the value of the first time period is less than the value of the preset time period;
if the increase value of the utilization rate of the cloud platform resources exceeds a first preset threshold value in a first time period, expanding the capacity of the cloud platform resources currently corresponding to the task to be processed according to the proportion corresponding to the increase value;
if the increase value of the utilization rate of the cloud platform resources does not exceed a first preset threshold value in a first time period, judging whether the utilization rate of the cloud platform resources is in an increase state all the time in a preset time period;
and if the utilization rate of the cloud platform resources is in an increasing state all the time within a preset time period, expanding the capacity of the cloud platform resources currently corresponding to the task to be processed according to a preset proportion.
Optionally, when the utilization rate of the cloud platform resource meets a decreasing condition within a preset time period, the contracting the cloud platform resource currently corresponding to the task to be processed includes:
judging whether the utilization rate of the cloud platform resources is always in a decreasing state within a preset time period;
if the utilization rate of the cloud platform resources is in a decreasing state all the time within a preset time period, judging whether the decreasing value of the utilization rate of the cloud platform resources exceeds a second preset threshold value within the preset time period;
if the decrement value of the utilization rate of the cloud platform resources exceeds a second preset threshold value within a preset time period, shrinking the cloud platform resources currently corresponding to the tasks to be processed according to a preset first shrinkage proportion;
and if the decrement value of the utilization rate of the cloud platform resources does not exceed a second preset threshold value within a preset time period, contracting the cloud platform resources currently corresponding to the task to be processed according to a preset second contraction proportion.
Optionally, after dynamically adjusting the cloud platform resource currently corresponding to the task to be processed according to the utilization ratio, the method further includes:
judging whether cloud platform resources which are not called exist all the time in the period time;
and if the cloud platform resources which are not called all the time exist in the period time, releasing the cloud platform resources which are not called all the time.
The embodiment of the invention also provides a cloud platform resource allocation device, which comprises a training unit, an analysis unit, an allocation unit, a monitoring unit and an adjustment unit;
the training unit is used for training a pre-established resource allocation model based on the long-term and short-term memory network according to the acquired historical data of resource allocation so as to obtain the trained resource allocation model;
the analysis unit is used for analyzing the received task to be processed by utilizing the trained resource allocation model and outputting a resource allocation result;
the allocation unit is used for allocating cloud platform resources to the tasks to be processed according to the resource allocation result;
the monitoring unit is used for monitoring the utilization rate of the cloud platform resources when the to-be-processed task is executed;
and the adjusting unit is used for dynamically adjusting the cloud platform resources currently corresponding to the tasks to be processed according to the utilization rate.
Optionally, the training unit includes an obtaining subunit, a dividing subunit, an initial training subunit, an analyzing subunit, and an adjusting subunit;
the acquiring subunit is configured to acquire resource allocation history data; the resource allocation historical data comprises historical tasks and corresponding resource allocation information thereof;
the dividing subunit is configured to divide the resource allocation historical data into a first historical data sample and a second historical data sample;
the initial training subunit is configured to train a pre-established resource allocation model based on a long-term and short-term memory network according to the first historical data sample to obtain an initial resource allocation model;
the analysis subunit is configured to analyze the second historical data sample by using the initial resource allocation model, and output a resource allocation prediction result;
and the adjusting subunit is configured to adjust the network weight of the initial resource allocation model according to a difference between the resource allocation prediction result and an actual resource allocation result included in the second historical data sample, so as to obtain a trained resource allocation model.
Optionally, the adjusting unit includes an expansion subunit and a contraction subunit;
the capacity expansion subunit is configured to, when the utilization rate of the cloud platform resource meets an increasing condition within a preset time period, perform capacity expansion on the cloud platform resource currently corresponding to the task to be processed;
and the contraction subunit is configured to, when the utilization rate of the cloud platform resource meets a decreasing condition within a preset time period, contract the cloud platform resource currently corresponding to the task to be processed.
Optionally, the capacity expansion subunit is specifically configured to determine whether an increase value of the utilization rate of the cloud platform resource exceeds a first preset threshold in a first time period; wherein the value of the first time period is less than the value of the preset time period; if the increase value of the utilization rate of the cloud platform resources exceeds a first preset threshold value in a first time period, expanding the capacity of the cloud platform resources currently corresponding to the task to be processed according to the proportion corresponding to the increase value; if the increase value of the utilization rate of the cloud platform resources does not exceed a first preset threshold value in a first time period, judging whether the utilization rate of the cloud platform resources is in an increase state all the time in a preset time period; and if the utilization rate of the cloud platform resources is in an increasing state all the time within a preset time period, expanding the capacity of the cloud platform resources currently corresponding to the task to be processed according to a preset proportion.
Optionally, the contraction subunit is specifically configured to determine whether the utilization rate of the cloud platform resource is always in a decreasing state within a preset time period; if the utilization rate of the cloud platform resources is in a decreasing state all the time within a preset time period, judging whether the decreasing value of the utilization rate of the cloud platform resources exceeds a second preset threshold value within the preset time period; if the decrement value of the utilization rate of the cloud platform resources exceeds a second preset threshold value within a preset time period, shrinking the cloud platform resources currently corresponding to the tasks to be processed according to a preset first shrinkage proportion; and if the decrement value of the utilization rate of the cloud platform resources does not exceed a second preset threshold value within a preset time period, contracting the cloud platform resources currently corresponding to the task to be processed according to a preset second contraction proportion.
Optionally, the system further comprises a judging unit and a releasing unit;
the judging unit is used for judging whether cloud platform resources which are not called all the time exist in the period time;
the releasing unit is configured to release the cloud platform resources that have not been called if the cloud platform resources that have not been called exist within the cycle time.
An embodiment of the present invention further provides a cloud platform resource allocation apparatus, including:
a memory for storing a computer program;
a processor configured to execute the computer program to implement the steps of the cloud platform resource allocation method as in any one of the above.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the cloud platform resource allocation method according to any one of the above-mentioned embodiments are implemented.
According to the technical scheme, the pre-established resource allocation model based on the long-term and short-term memory network is trained according to the acquired resource allocation historical data, so that the trained resource allocation model is obtained. And learning the historical resource allocation data to obtain a resource allocation model, analyzing the received task to be processed by using the trained resource allocation model, and outputting a resource allocation result, so that the analysis process is associated with the historical allocation result, and a more reliable resource allocation result can be obtained. The cloud platform resources are distributed to the tasks to be processed according to the resource distribution result, the demands of the tasks to be processed on the resources can be changed at different time intervals, in order to better fit the current actual resource demands of the tasks to be processed, the utilization rate of the cloud platform resources when the tasks to be processed are executed can be monitored, the cloud platform resources corresponding to the tasks to be processed currently are dynamically adjusted according to the utilization rate, the purpose of automatically and dynamically controlling resource distribution is achieved, and the resources are distributed more reasonably.
Drawings
In order to illustrate the embodiments of the present invention more clearly, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a cloud platform resource allocation method according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for cloud platform resource expansion according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for shrinking resources of a cloud platform according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a cloud platform resource allocation apparatus according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a hardware structure of a cloud platform resource allocation apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without any creative work belong to the protection scope of the present invention.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Next, a method for allocating resources of a cloud platform according to an embodiment of the present invention is described in detail. Fig. 1 is a flowchart of a cloud platform resource allocation method provided in an embodiment of the present invention, where the method includes:
s101: and training a pre-established resource allocation model based on the long-term and short-term memory network according to the acquired historical data of the resource allocation to obtain the trained resource allocation model.
In the embodiment of the invention, a resource allocation model is constructed based on a Long Short-Term Memory network (LSTM).
In practical applications, the resource allocation model may be trained using the resource allocation history data. The resource allocation history data may include historical tasks and corresponding resource allocation information thereof. The resource allocation information may include resource demand of resources such as CPU and memory required for executing the task, and resource call time.
In order to improve the prediction accuracy of the resource allocation model, the acquired resource allocation historical data may be divided into a first historical data sample and a second historical data sample. Training a pre-established resource allocation model based on a long-term and short-term memory network according to the first historical data sample to obtain an initial resource allocation model; analyzing the second historical data sample by using the initial resource allocation model, and outputting a resource allocation prediction result; and adjusting the network weight of the initial resource allocation model according to the difference value between the resource allocation prediction result and the actual resource allocation result contained in the second historical data sample to obtain the trained resource allocation model.
In the embodiment of the present invention, the division ratio of the resource allocation history data is not limited, for example, 75% of the resource allocation history data may be used as the first history data sample, and the remaining 25% of the resource allocation history data may be used as the second history data sample.
The resource allocation model constructed based on the LSTM comprises a plurality of layers, each layer has a corresponding network weight, and the accuracy of the resource allocation model prediction can be improved by adjusting the network weights. The principles for training the resource allocation model and adjusting the network weight are similar to the training principles of the long and short term memory network model in the prior art, and are not described herein again.
S102: and analyzing the received task to be processed by using the trained resource allocation model, and outputting a resource allocation result.
When the task to be processed is acquired, the resource required for executing the task to be processed needs to be determined.
S103: and distributing cloud platform resources to the tasks to be processed according to the resource distribution result.
The resource allocation result includes the amount of resources required for executing the task to be processed, such as the number of CPUs and the memory capacity required. And distributing corresponding cloud platform resources for the tasks to be processed from the resources contained in the cloud platform according to the resource distribution result.
S104: and monitoring the utilization rate of cloud platform resources when the to-be-processed task is executed.
The task to be processed generally has a longer time span, for example, the task to be processed may be an entertainment video playing application, and generally, the usage rate of the entertainment video playing application is lower in daytime, and accordingly, the cloud platform resources required by the entertainment video playing application are fewer; the playing pressure of the entertainment video playing application is increased at night off-duty time, and more cloud platform resources are needed to support the normal operation of the entertainment video playing application.
Considering that the requirements for resources at different time intervals are changed when the to-be-processed task is executed, in order to better fit the current actual resource requirements of the to-be-processed task, the utilization rate of the cloud platform resources when the to-be-processed task is executed can be monitored.
S105: and dynamically adjusting the current corresponding cloud platform resource of the task to be processed according to the utilization rate.
The utilization rate reflects the demand on resources when executing the task to be processed. The higher the utilization rate is, the higher the demand on resources is when executing the task to be processed; the lower the utilization, the lower the demand for resources when executing the pending task.
In the embodiment of the present invention, the adjustment of the cloud platform resources corresponding to the task to be processed may include expansion or contraction of the cloud platform resources. In practical application, when the utilization rate of the cloud platform resource meets the increasing condition within a preset time period, the capacity of the cloud platform resource corresponding to the task to be processed currently is expanded; and when the utilization rate of the cloud platform resources meets the decreasing condition within the preset time period, contracting the cloud platform resources corresponding to the task to be processed currently.
As shown in fig. 2, a flowchart of a method for cloud platform resource expansion according to an embodiment of the present invention is shown, where the method includes:
s201: and judging whether the increase value of the utilization rate of the cloud platform resources exceeds a first preset threshold value in a first time period.
And the value of the first time period is less than that of the preset time period.
If the increase value of the utilization rate of the cloud platform resources exceeds the first preset threshold value in the first time period, it indicates that the demand of the to-be-processed task on the resources is greatly increased in a short time, and in order to ensure that enough resources support the execution of the to-be-processed task, when the increase value of the utilization rate of the cloud platform resources exceeds the first preset threshold value in the first time period, the capacity of the cloud platform resources may be expanded, that is, S202 is executed.
If the increase value of the utilization rate of the cloud platform resource does not exceed the first preset threshold value in the first time period, it indicates that the demand of the to-be-processed task for the resource does not fluctuate greatly in a short time, and at this time, S203 may be executed.
S202: and according to the proportion corresponding to the growth value, carrying out capacity expansion on the cloud platform resources currently corresponding to the task to be processed.
In practical application, a list including proportions corresponding to different growth ranges may be established in advance, the proportion corresponding to the growth value may be determined by searching the list, and the current cloud platform resource is expanded according to the proportion.
Taking the entertainment video playing application as an example, assuming that the cloud platform resources allocated to the entertainment video playing application are 4 CPUs and 16G memories, and when the proportion corresponding to the growth value is 25%, the capacity expansion of the CPUs in the cloud platform resources is 4+4 × 25%, which is 5, and the capacity expansion of the memories is 16+16 × 25%, which is 20G.
S203: and judging whether the utilization rate of the cloud platform resources is in an increasing state all the time within a preset time period.
If the utilization rate of the cloud platform resources is in an increasing state all the time within the preset time period, it indicates that the demand of the to-be-processed task on the cloud platform resources is in an increasing trend along with the lapse of time, and in order to ensure the smooth execution of the to-be-processed task, S204 may be executed at this time.
S204: according to a preset proportion, carrying out capacity expansion on the cloud platform resources corresponding to the task to be processed currently.
The value of the preset proportion can be set according to actual requirements, for example, can be set to 10%. Considering that the number of CPUs is an integer, when the capacity expansion is performed according to a preset proportion, the decimal part can be directly taken as 1.
The specific implementation manner of shrinking the cloud platform resources may be various, and as shown in fig. 3, the method for shrinking the cloud platform resources provided in the embodiment of the present invention is a flowchart, and the method includes:
s301: and judging whether the utilization rate of the cloud platform resources is always in a decreasing state in a preset time period.
If the utilization rate of the cloud platform resources is always in a decreasing state within the preset time period, it indicates that the demand of the task to be processed on the cloud platform resources is in a decreasing trend along with the lapse of time, and in order to improve the utilization rate of the cloud platform resources, S302 may be executed at this time.
S302: and judging whether the decrement value of the utilization rate of the cloud platform resources exceeds a second preset threshold value in a preset time period.
The value of the second preset threshold may be set according to actual requirements, and is not limited herein.
And if the decrement of the utilization rate of the cloud platform resources exceeds a second preset threshold value within a preset time period, executing S303. And if the decrement of the utilization rate of the cloud platform resources does not exceed the second preset threshold value within the preset time period, executing S304.
S303: and according to a preset first contraction proportion, contracting the cloud platform resources currently corresponding to the tasks to be processed.
When the decrement value of the utilization rate of the cloud platform resources exceeds a second preset threshold value within a preset time period, it indicates that the current demand of the to-be-processed task on the resources is low, and in order to avoid the idleness of the cloud platform resources, the cloud platform resources corresponding to the to-be-processed task at present can be contracted according to a preset first contraction proportion.
In the embodiment of the invention, the contraction of the cloud platform resources may be to temporarily use the idle cloud platform resources for executing other services, and when the resource demand of the task to be processed increases, the idle resources may be directly called back for executing the task to be processed.
The value of the first contraction ratio may be set according to actual requirements, and is not limited herein. For example, the value of the first contraction ratio may be set to 50%.
Taking an entertainment video playing application as an example, assuming that cloud platform resources allocated to the entertainment video playing application are 4 CPUs and 16G memories, when cloud platform resources currently corresponding to a task to be processed are contracted according to a preset first contraction proportion of 50%, the CPUs in the cloud platform resources can be contracted to 4-4 × 50% to 2, and the memories are contracted to 16-16 × 50% to 8G.
S304: and according to a preset second contraction proportion, contracting the cloud platform resources currently corresponding to the tasks to be processed.
Wherein, the value of the first contraction ratio may be larger than the value of the second contraction ratio. It is assumed that the first contraction ratio is set to 50% and the second contraction ratio may be set to 25%.
By means of the method and the device, the cloud platform resources corresponding to the tasks to be processed at present are dynamically adjusted according to the change condition of the cloud platform resource demand when the tasks to be processed are executed within the preset time period, the cloud platform resource allocation can be more suitable for actual requirements, and the utilization rate of the cloud platform resources is improved.
According to the technical scheme, the pre-established resource allocation model based on the long-term and short-term memory network is trained according to the acquired resource allocation historical data, so that the trained resource allocation model is obtained. And learning the historical resource allocation data to obtain a resource allocation model, analyzing the received task to be processed by using the trained resource allocation model, and outputting a resource allocation result, so that the analysis process is associated with the historical allocation result, and a more reliable resource allocation result can be obtained. The cloud platform resources are distributed to the tasks to be processed according to the resource distribution result, the demands of the tasks to be processed on the resources can be changed at different time intervals, in order to better fit the current actual resource demands of the tasks to be processed, the utilization rate of the cloud platform resources when the tasks to be processed are executed can be monitored, the cloud platform resources corresponding to the tasks to be processed currently are dynamically adjusted according to the utilization rate, the purpose of automatically and dynamically controlling resource distribution is achieved, and the resources are distributed more reasonably.
In consideration of the fact that in practical application, part of resources of the cloud platform resources allocated to the task to be processed may not be called all the time, and in order to avoid resource waste, in the embodiment of the present invention, after the cloud platform resources currently corresponding to the task to be processed are dynamically adjusted according to the utilization rate, whether the cloud platform resources that have not been called all the time exist within the cycle time may be further judged; and if the cloud platform resources which are not called all the time exist in the period time, releasing the cloud platform resources which are not called all the time.
By releasing the cloud platform resources which are not called all the time, the cloud platform resources can be prevented from being idle for a long time, the utilization rate of the cloud platform resources is improved, and the allocation of the cloud platform resources is more reasonable.
Fig. 4 is a schematic structural diagram of a cloud platform resource allocation apparatus provided in an embodiment of the present invention, including a training unit 41, an analysis unit 42, an allocation unit 43, a monitoring unit 44, and an adjustment unit 45;
a training unit 41, configured to train a pre-established resource allocation model based on a long-term and short-term memory network according to the acquired historical data of resource allocation, so as to obtain a trained resource allocation model;
the analysis unit 42 is configured to analyze the received to-be-processed task by using the trained resource allocation model, and output a resource allocation result;
the allocating unit 43 is configured to allocate cloud platform resources to the task to be processed according to the resource allocation result;
the monitoring unit 44 is used for monitoring the utilization rate of cloud platform resources when the tasks to be processed are executed;
and the adjusting unit 45 is configured to dynamically adjust the cloud platform resource currently corresponding to the task to be processed according to the utilization rate.
Optionally, the training unit includes an obtaining subunit, a dividing subunit, an initial training subunit, an analyzing subunit, and an adjusting subunit;
the acquisition subunit is used for acquiring resource allocation historical data; the resource allocation historical data comprises historical tasks and corresponding resource allocation information thereof;
the dividing subunit is used for dividing the resource allocation historical data into a first historical data sample and a second historical data sample;
the initial training subunit is used for training a pre-established resource allocation model based on the long-term and short-term memory network according to the first historical data sample to obtain an initial resource allocation model;
the analysis subunit is used for analyzing the second historical data sample by using the initial resource allocation model and outputting a resource allocation prediction result;
and the adjusting subunit is used for adjusting the network weight of the initial resource allocation model according to the difference value between the resource allocation prediction result and the actual resource allocation result contained in the second historical data sample so as to obtain the trained resource allocation model.
Optionally, the adjusting unit includes an expansion subunit and a contraction subunit;
the capacity expansion subunit is used for expanding the capacity of the cloud platform resource currently corresponding to the task to be processed when the utilization rate of the cloud platform resource meets the increasing condition within a preset time period;
and the contraction subunit is used for contracting the cloud platform resource currently corresponding to the task to be processed when the utilization rate of the cloud platform resource meets the decreasing condition within the preset time period.
Optionally, the capacity expansion subunit is specifically configured to determine whether an increase value of the utilization rate of the cloud platform resource exceeds a first preset threshold in a first time period; the value of the first time period is less than that of the preset time period; if the increase value of the utilization rate of the cloud platform resources exceeds a first preset threshold value in a first time period, expanding the capacity of the cloud platform resources currently corresponding to the task to be processed according to the proportion corresponding to the increase value; if the increase value of the utilization rate of the cloud platform resources does not exceed the first preset threshold value in the first time period, judging whether the utilization rate of the cloud platform resources is in an increase state all the time in the preset time period; and if the utilization rate of the cloud platform resources is in an increasing state all the time within a preset time period, expanding the capacity of the cloud platform resources corresponding to the task to be processed at present according to a preset proportion.
Optionally, the contraction subunit is specifically configured to determine whether the utilization rate of the cloud platform resource is always in a decreasing state within a preset time period; if the utilization rate of the cloud platform resources is in a decreasing state all the time within the preset time period, judging whether the decreasing value of the utilization rate of the cloud platform resources exceeds a second preset threshold value within the preset time period; if the decrement value of the utilization rate of the cloud platform resources exceeds a second preset threshold value within a preset time period, shrinking the cloud platform resources currently corresponding to the tasks to be processed according to a preset first shrinkage proportion; and if the decrement value of the utilization rate of the cloud platform resources does not exceed the second preset threshold value within the preset time period, contracting the cloud platform resources currently corresponding to the task to be processed according to a preset second contraction proportion.
Optionally, the system further comprises a judging unit and a releasing unit;
the system comprises a judging unit, a processing unit and a processing unit, wherein the judging unit is used for judging whether cloud platform resources which are not called all the time exist in the period time;
and the releasing unit is used for releasing the cloud platform resources which are not called all the time if the cloud platform resources which are not called all the time exist in the period time.
For the description of the features in the embodiment corresponding to fig. 4, reference may be made to the related description of the embodiments corresponding to fig. 1 to fig. 3, which is not repeated here.
According to the technical scheme, the pre-established resource allocation model based on the long-term and short-term memory network is trained according to the acquired resource allocation historical data, so that the trained resource allocation model is obtained. And learning the historical resource allocation data to obtain a resource allocation model, analyzing the received task to be processed by using the trained resource allocation model, and outputting a resource allocation result, so that the analysis process is associated with the historical allocation result, and a more reliable resource allocation result can be obtained. The cloud platform resources are distributed to the tasks to be processed according to the resource distribution result, the demands of the tasks to be processed on the resources can be changed at different time intervals, in order to better fit the current actual resource demands of the tasks to be processed, the utilization rate of the cloud platform resources when the tasks to be processed are executed can be monitored, the cloud platform resources corresponding to the tasks to be processed currently are dynamically adjusted according to the utilization rate, the purpose of automatically and dynamically controlling resource distribution is achieved, and the resources are distributed more reasonably.
Fig. 5 is a schematic diagram of a hardware structure of a cloud platform resource allocation apparatus 50 according to an embodiment of the present invention, including:
a memory 51 for storing a computer program;
a processor 52 configured to execute a computer program to implement the steps of any one of the cloud platform resource allocation methods described above.
The embodiment of the invention also provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when being executed by a processor, the computer program realizes the steps of the cloud platform resource allocation method.
The cloud platform resource allocation method, the cloud platform resource allocation device and the computer-readable storage medium provided by the embodiments of the present invention are described in detail above. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

Claims (10)

1. A cloud platform resource allocation method is characterized by comprising the following steps:
training a pre-established resource allocation model based on the long-term and short-term memory network according to the acquired historical data of resource allocation to obtain a trained resource allocation model;
analyzing the received task to be processed by utilizing the trained resource allocation model, and outputting a resource allocation result;
distributing cloud platform resources to the tasks to be processed according to the resource distribution result;
monitoring the utilization rate of the cloud platform resources when the tasks to be processed are executed; and dynamically adjusting the cloud platform resources currently corresponding to the tasks to be processed according to the utilization rate.
2. The cloud platform resource allocation method according to claim 1, wherein the training of the pre-established resource allocation model based on the long-term and short-term memory network according to the acquired resource allocation historical data to obtain the trained resource allocation model comprises:
acquiring historical data of resource allocation; the resource allocation historical data comprises historical tasks and corresponding resource allocation information thereof;
dividing the resource allocation historical data into a first historical data sample and a second historical data sample;
training a pre-established resource allocation model based on a long-term and short-term memory network according to the first historical data sample to obtain an initial resource allocation model;
analyzing the second historical data sample by using the initial resource allocation model, and outputting a resource allocation prediction result;
and adjusting the network weight of the initial resource allocation model according to the difference value between the resource allocation prediction result and the actual resource allocation result contained in the second historical data sample to obtain a trained resource allocation model.
3. The cloud platform resource allocation method according to claim 1, wherein the dynamically adjusting, according to the utilization rate, the cloud platform resource currently corresponding to the task to be processed includes:
when the utilization rate of the cloud platform resources meets the increasing condition within a preset time period, expanding the capacity of the cloud platform resources corresponding to the task to be processed currently;
and when the utilization rate of the cloud platform resources meets the decreasing condition within a preset time period, contracting the cloud platform resources currently corresponding to the task to be processed.
4. The cloud platform resource allocation method according to claim 3, wherein when the utilization rate of the cloud platform resources meets an incremental condition within a preset time period, performing capacity expansion on the cloud platform resources currently corresponding to the task to be processed includes:
judging whether the increase value of the utilization rate of the cloud platform resources exceeds a first preset threshold value in a first time period; wherein the value of the first time period is less than the value of the preset time period;
if the increase value of the utilization rate of the cloud platform resources exceeds a first preset threshold value in a first time period, expanding the capacity of the cloud platform resources currently corresponding to the task to be processed according to the proportion corresponding to the increase value;
if the increase value of the utilization rate of the cloud platform resources does not exceed a first preset threshold value in a first time period, judging whether the utilization rate of the cloud platform resources is in an increase state all the time in a preset time period;
and if the utilization rate of the cloud platform resources is in an increasing state all the time within a preset time period, expanding the capacity of the cloud platform resources currently corresponding to the task to be processed according to a preset proportion.
5. The cloud platform resource allocation method according to claim 3, wherein the contracting the cloud platform resource currently corresponding to the task to be processed when the utilization rate of the cloud platform resource meets a decreasing condition within a preset time period comprises:
judging whether the utilization rate of the cloud platform resources is always in a decreasing state within a preset time period;
if the utilization rate of the cloud platform resources is in a decreasing state all the time within a preset time period, judging whether the decreasing value of the utilization rate of the cloud platform resources exceeds a second preset threshold value within the preset time period;
if the decrement value of the utilization rate of the cloud platform resources exceeds a second preset threshold value within a preset time period, shrinking the cloud platform resources currently corresponding to the tasks to be processed according to a preset first shrinkage proportion;
and if the decrement value of the utilization rate of the cloud platform resources does not exceed a second preset threshold value within a preset time period, contracting the cloud platform resources currently corresponding to the task to be processed according to a preset second contraction proportion.
6. The cloud platform resource allocation method according to any one of claims 1 to 5, wherein after dynamically adjusting the cloud platform resource currently corresponding to the task to be processed according to the utilization rate, the method further includes:
judging whether cloud platform resources which are not called exist all the time in the period time;
and if the cloud platform resources which are not called all the time exist in the period time, releasing the cloud platform resources which are not called all the time.
7. A cloud platform resource allocation device is characterized by comprising a training unit, an analysis unit, an allocation unit, a monitoring unit and an adjustment unit;
the training unit is used for training a pre-established resource allocation model based on the long-term and short-term memory network according to the acquired historical data of resource allocation so as to obtain the trained resource allocation model;
the analysis unit is used for analyzing the received task to be processed by utilizing the trained resource allocation model and outputting a resource allocation result;
the allocation unit is used for allocating cloud platform resources to the tasks to be processed according to the resource allocation result;
the monitoring unit is used for monitoring the utilization rate of the cloud platform resources when the to-be-processed task is executed;
and the adjusting unit is used for dynamically adjusting the cloud platform resources currently corresponding to the tasks to be processed according to the utilization rate.
8. The cloud platform resource allocation apparatus of claim 7, wherein the training unit comprises an acquisition subunit, a division subunit, an initial training subunit, an analysis subunit, and an adjustment subunit;
the acquiring subunit is configured to acquire resource allocation history data; the resource allocation historical data comprises historical tasks and corresponding resource allocation information thereof;
the dividing subunit is configured to divide the resource allocation historical data into a first historical data sample and a second historical data sample;
the initial training subunit is configured to train a pre-established resource allocation model based on a long-term and short-term memory network according to the first historical data sample to obtain an initial resource allocation model;
the analysis subunit is configured to analyze the second historical data sample by using the initial resource allocation model, and output a resource allocation prediction result;
and the adjusting subunit is configured to adjust the network weight of the initial resource allocation model according to a difference between the resource allocation prediction result and an actual resource allocation result included in the second historical data sample, so as to obtain a trained resource allocation model.
9. A cloud platform resource allocation apparatus, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the cloud platform resource allocation method according to any one of claims 1 to 6.
10. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, performs the steps of the cloud platform resource allocation method according to any one of claims 1 to 6.
CN202010922862.5A 2020-09-04 2020-09-04 Cloud platform resource allocation method and device and computer readable storage medium Pending CN112148427A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010922862.5A CN112148427A (en) 2020-09-04 2020-09-04 Cloud platform resource allocation method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010922862.5A CN112148427A (en) 2020-09-04 2020-09-04 Cloud platform resource allocation method and device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN112148427A true CN112148427A (en) 2020-12-29

Family

ID=73889225

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010922862.5A Pending CN112148427A (en) 2020-09-04 2020-09-04 Cloud platform resource allocation method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112148427A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113220372A (en) * 2021-06-01 2021-08-06 深圳市中盛瑞达科技有限公司 Artificial intelligence cloud platform
CN113220452A (en) * 2021-05-10 2021-08-06 北京百度网讯科技有限公司 Resource allocation method, model training method, device and electronic equipment
CN113378498A (en) * 2021-08-12 2021-09-10 新华三半导体技术有限公司 Task allocation method and device
CN113792971A (en) * 2021-08-11 2021-12-14 邹平市供电有限公司 Regional power dispatching networking method and system
CN115237570A (en) * 2022-07-29 2022-10-25 陈魏炜 Strategy generation method based on cloud computing and cloud platform
CN115242637A (en) * 2021-04-23 2022-10-25 深圳富联富桂精密工业有限公司 Deployment method of remote desktop gateway, computer device and storage medium
CN115604276A (en) * 2022-11-28 2023-01-13 北京润尼尔网络科技有限公司(Cn) Intelligent management system based on server resource utilization

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115242637A (en) * 2021-04-23 2022-10-25 深圳富联富桂精密工业有限公司 Deployment method of remote desktop gateway, computer device and storage medium
CN115242637B (en) * 2021-04-23 2023-10-17 深圳富联富桂精密工业有限公司 Remote desktop gateway allocation method, computer device and storage medium
CN113220452A (en) * 2021-05-10 2021-08-06 北京百度网讯科技有限公司 Resource allocation method, model training method, device and electronic equipment
CN113220372A (en) * 2021-06-01 2021-08-06 深圳市中盛瑞达科技有限公司 Artificial intelligence cloud platform
CN113792971A (en) * 2021-08-11 2021-12-14 邹平市供电有限公司 Regional power dispatching networking method and system
CN113792971B (en) * 2021-08-11 2023-12-29 邹平市供电有限公司 Regional power dispatching networking method and system
CN113378498A (en) * 2021-08-12 2021-09-10 新华三半导体技术有限公司 Task allocation method and device
CN115237570A (en) * 2022-07-29 2022-10-25 陈魏炜 Strategy generation method based on cloud computing and cloud platform
CN115604276A (en) * 2022-11-28 2023-01-13 北京润尼尔网络科技有限公司(Cn) Intelligent management system based on server resource utilization
CN115604276B (en) * 2022-11-28 2023-03-10 北京润尼尔网络科技有限公司 Intelligent management system based on server resource utilization

Similar Documents

Publication Publication Date Title
CN112148427A (en) Cloud platform resource allocation method and device and computer readable storage medium
US20150295970A1 (en) Method and device for augmenting and releasing capacity of computing resources in real-time stream computing system
CN107295090B (en) Resource scheduling method and device
WO2017166643A1 (en) Method and device for quantifying task resources
CN104102543A (en) Load regulation method and load regulation device in cloud computing environment
CN111861412B (en) Completion time optimization-oriented scientific workflow scheduling method and system
CN109739627B (en) Task scheduling method, electronic device and medium
CN110990154B (en) Big data application optimization method, device and storage medium
CN111666131A (en) Load balancing distribution method and device, computer equipment and storage medium
CN104202305A (en) Transcoding processing method and device, server
CN104199724A (en) Virtual resource dispatching and optimizing method based on cost performance
CN110096339B (en) System load-based capacity expansion and contraction configuration recommendation system and method
CN107370783B (en) Scheduling method and device for cloud computing cluster resources
CN114553723A (en) Operation method, system, medium and equipment of artificial intelligence training platform
CN112948113A (en) Cluster resource management scheduling method, device, equipment and readable storage medium
US20230325082A1 (en) Method for setting up and expanding storage capacity of cloud without disruption of cloud services and electronic device employing method
CN114138453B (en) Resource optimization allocation method and system suitable for edge computing environment
CN113468442A (en) Resource bit flow distribution method, computing device and computer storage medium
CN114860449A (en) Data processing method, device, equipment and storage medium
CN114253663A (en) Virtual machine resource scheduling method and device
CN110955644A (en) IO control method, device, equipment and storage medium of storage system
US20170220291A1 (en) Memory Configuration Method and Device
CN110750330A (en) Virtual machine creating method, system, electronic equipment and storage medium
CN111580937B (en) Automatic virtual machine scheduling method for Feiteng multi-core/many-core hybrid cluster
CN117539632A (en) Yarn queue resource extension method and device, electronic equipment and storage medium

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