Cloud resource management method, system and device and storage medium
By combining the business indicators and resource usage data of the cloud platform, and using prediction models to predict future cloud resource demand and dynamically adjust, the problem of inaccurate prediction of cloud resource demand is solved, and the optimization of resource utilization and service quality is achieved.
Patent Information
- Application Number
- CN202510553566.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-08-01
AI Technical Summary
The existing technology cannot effectively and accurately predict the demand for cloud resource in the future, resulting in waste of resources and degradation of service performance.
By obtaining the current business indicator data and resource usage data of the cloud platform, combining prediction models such as the Transformer architecture, predicting the cloud resource requirements in the future preset time window, and generating dynamic adjustment strategies based on the prediction results, dynamically adjusting cloud resources to adapt to demand.
It improves the accuracy of cloud resource demand forecasting, ensures that resources are accurately adapted within the future time window, avoids cost waste and service performance decline, and achieves dual optimization of resource utilization and service quality.
Smart Images

Figure CN120407185A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cloud computing, and particularly to a cloud resource management method, system, device, and storage medium. Background Art
[0002] With the development of Internet technology, cloud computing, as an important information technology service model, encapsulates computing resources, storage resources, and network resources into services through virtualization technology and provides them to users on demand, greatly improving the utilization rate and flexibility of resources. However, the dynamic expansion of business scale and load fluctuations lead to strong time-varying characteristics of cloud resource requirements. Therefore, how to effectively predict cloud resource requirements at future moments and dynamically adjust cloud resources is a problem that those skilled in the art need to solve currently. Summary of the Invention
[0003] The present invention provides a cloud resource management method, system, device, and storage medium, relating to the technical field of cloud computing, to at least solve the problem in the related art that the cloud resource requirements at future moments cannot be effectively and accurately predicted.
[0004] The present invention provides a cloud resource management method, including:
[0005] Obtaining current business metric data and current resource usage data of a cloud platform; the current business metric data is used to represent the change trend of the business requirements of the cloud platform, and the current resource usage data is used to represent the usage situation of cloud resources in the cloud platform;
[0006] Predicting the cloud resource requirements of the cloud platform within a future preset time window based on the current business metric data and the current resource usage data;
[0007] Sending a resource adjustment request to the cloud platform according to the adjustment strategy corresponding to the cloud resource requirements, so that the cloud resources adjusted by the cloud platform in response to the resource adjustment request are adapted to the cloud resource requirements within the future preset time window.
[0008] The present invention also provides a cloud resource management system, including:
[0009] An obtaining module, configured to obtain current business metric data and current resource usage data of a cloud platform; the current business metric data is used to represent the change trend of the business requirements of the cloud platform, and the current resource usage data is used to represent the usage situation of cloud resources in the cloud platform;
[0010] A predicting module, configured to predict the cloud resource requirements of the cloud platform within a future preset time window based on the current business metric data and the current resource usage data;
[0011] An adjustment module, configured to send a resource adjustment request to the cloud platform according to an adjustment policy corresponding to the cloud resource requirement, so that the cloud resources adjusted by the cloud platform in response to the resource adjustment request are adapted to the cloud resource requirement within the future preset time window.
[0012] The present invention also provides an electronic device, including: a memory, configured to store a computer program; a processor, configured to implement the steps of any one of the above cloud resource management methods when executing the computer program.
[0013] The present invention also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the above cloud resource management methods are implemented.
[0014] Through the present invention, since the cloud resource requirement of the cloud platform within the future preset time window is predicted based on the current service metric data and current resource usage data of the cloud platform, where the service metric data and resource usage data are used to determine the coupling relationship between the service load and resource consumption, the prediction deviation caused by isolated data analysis is avoided, the prediction accuracy of the cloud resource requirement with strong time-varying characteristics is improved, and finally a dynamic adjustment policy is generated according to the predicted cloud resource requirement and a resource adjustment request is sent to the cloud platform to ensure that the adjusted cloud resources are accurately adapted to the requirement within the future preset time window, avoiding cost waste and service performance degradation. The technical problem of being unable to effectively and accurately predict the cloud resource requirement at a future moment is solved, and the technical effect of achieving double optimization of resource utilization rate and service quality in a dynamic load scenario is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.
[0016] Figure 1 It is a flowchart of the steps of the first cloud resource management method provided by an embodiment of the present invention;
[0017] Figure 2 It is a flowchart of the steps of the second cloud resource management method provided by an embodiment of the present invention;
[0018] Figure 3 It is a flowchart of the steps of the third cloud resource management method provided by an embodiment of the present invention;
[0019] Figure 4 It is a schematic structural diagram of a cloud resource management system provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0020] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the protection scope of the present invention.
[0021] It should be noted that in the description of the present invention, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present invention are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0022] In order to enable those skilled in the art of this technology to better understand the solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0023] The embodiments of the present invention provide a cloud resource management method. With reference to the execution process of the cloud resource management method, the method will be described in detail. Please refer to Figure 1 The cloud resource management method includes:
[0024] S101: Obtain the current business metric data and the current resource usage data of the cloud platform; the current business metric data is used to characterize the change trend of the business requirements of the cloud platform, and the current resource usage data is used to characterize the usage situation of the cloud resources in the cloud platform;
[0025] In this embodiment, the cloud platform refers to a computing resource pooling system built based on virtualization technology. By uniformly managing a physical server cluster, computing resources (such as virtual CPUs (Central Processing Units), containers), storage resources (such as block storage, object storage), and network resources (such as virtual switches, load balancers) are abstracted into service instances that can be elastically allocated, provided to users on demand, and support dynamic scaling and resource monitoring.
[0026] Among them, the current business metric data includes, but is not limited to, user traffic, access times, transaction quantities, etc. These data can reflect the changing trends of business demands. The current resource usage data includes, but is not limited to, CPU usage rate, memory occupancy rate, disk I / O (Input / Output) rate, network bandwidth, etc. These data can reflect the actual usage conditions of cloud resources. The above data can be obtained in real time from the business system and the cloud platform through means such as API interfaces or database connections, where the business system is a business system running on the cloud platform.
[0027] Specifically, the business metric data (including user concurrency, request volume, transaction success rate) and resource usage data (including CPU utilization rate, memory occupancy, disk IOPS (Input / Output Operations Per Second), network bandwidth, etc.) can be collected at fixed time intervals (such as every minute) through the monitoring agents built into the cloud platform (such as Prometheus Exporter) or service bus interfaces (such as RESTful API (Application Programming Interface)). It is also possible to immediately trigger high-frequency data scraping (such as collecting once per second) when detecting sudden changes in business load (such as the instantaneous increase in request volume exceeding the corresponding preset threshold) or resource anomaly alerts (such as the CPU usage rate continuously exceeding the corresponding preset threshold, such as ) to capture transient load characteristics. The obtained data can be stored in a database for subsequent processing and analysis.
[0028] As an alternative embodiment, after obtaining the current business metric data and current resource usage data of the cloud platform, it is necessary to perform data preprocessing on both the current business metric data and current resource usage data of the cloud platform. The data preprocessing includes operations such as data cleaning, normalization, and missing value filling to ensure the quality and consistency of the data. Among them, data cleaning is used to remove duplicate data, handle outliers, etc.; data normalization converts the data into the same magnitude for subsequent processing; missing value filling is processed using methods such as interpolation, mean filling, or nearest neighbor filling.
[0029] S102: Predict the cloud resource requirements of the cloud platform within a preset time window in the future based on the current business metric data and current resource usage data;
[0030] In this embodiment, the cloud resource requirements can be the types, quantities, and configuration requirements of computing, storage, network, and other resources to be allocated by the cloud platform within a specific future time period (such as the number of virtual machine instances, memory capacity, peak bandwidth, etc.). The prediction goal is to determine the optimal cloud resource supply plan to match the expected changes in the business load. The future preset time window refers to a pre-defined continuous time period (such as the next 1 hour, 6 hours, or 24 hours), and its length can be dynamically adjusted according to the business scenario (such as shortened to 15 minutes during peak e-commerce promotion periods and extended to 12 hours during low-load periods), which is used to define the effective period of the prediction result.
[0031] It can be understood that the current business metric data can reflect the changing trends of business demands (such as sudden traffic growth, periodic task startup), directly reflecting the potential driving factors of future resource requirements, while the current resource usage data (such as CPU utilization, memory occupancy, disk throughput) quantifies the actual consumption of resources in real time and can characterize the coupling relationship between business demands and resource occupancy. By combining the two to predict cloud resource requirements, prediction blind spots can be eliminated, the limitations of a single data source can be complementarily covered, and the prediction robustness can be improved. Exemplarily, if the current business metrics show that the number of user login requests increases per minute, and the resource data shows that the CPU utilization has reached , then it can be predicted that more computing resources need to be added within the next 30 minutes to avoid overload. The prediction scheme in this embodiment combines the demand growth driven by business (metric data) with the real-time status of resource consumption (usage data), achieving a comprehensive prediction of cloud resource requirements. This method can more accurately capture the changing trends of business demands and the characteristics of resource requirements, improving prediction accuracy. At the same time, integrating multiple data sources can also improve the generalization ability and robustness of the model.
[0032] S103: Send a resource adjustment request to the cloud platform according to the adjustment strategy corresponding to the cloud resource requirements, so that the cloud resources adjusted by the cloud platform in response to the resource adjustment request can adapt to the cloud resource requirements within the future preset time window.
[0033] In this embodiment, the adjustment strategy may include resource scaling rules dynamically generated according to the difference between the predicted cloud resource requirements and the current resource status, and may also include execution time sequence planning. It can be understood that under different cloud resource requirements, the adjustment strategies are different. Correspondingly, the resource adjustment requests generated based on the adjustment strategies are also different. The resource adjustment requests are sent to the cloud platform, and the cloud platform adjusts the cloud resources it uses according to the resource adjustment requests, so that the adjusted cloud resources can dynamically adapt to the cloud resource requirements within a preset future time window. It can be understood that the resource adjustment in this embodiment is a kind of pre-adjustment, such as expanding capacity 10 minutes in advance and scaling down in stages, etc., to ensure that the adjusted resources are ready at the start time of the preset future time window and continuously match the dynamic changes of the requirements throughout the window period. It can be understood that this embodiment interacts with the cloud platform through the API interface to realize the automated application, release, and adjustment of resources.
[0034] Through the solution of this embodiment, since the cloud resource requirements of the cloud platform in a preset future time window are predicted based on the current business metric data and the current resource usage data of the cloud platform, where the business metric data and the resource usage data are used to determine the coupling relationship between the business load and the resource consumption, the prediction deviation caused by isolated data analysis is avoided, the prediction accuracy of the cloud resource requirements with strong time-varying characteristics is improved, and finally a dynamic adjustment strategy is generated according to the predicted cloud resource requirements and a resource adjustment request is sent to the cloud platform to ensure that the adjusted cloud resources accurately adapt to the requirements within the preset future time window, avoiding cost waste and service performance degradation. It solves the technical problem of being unable to effectively and accurately predict the cloud resource requirements at future moments, and achieves the technical effect of double optimization of resource utilization rate and service quality in a dynamic load scenario.
[0035] Based on the above embodiments:
[0036] In an exemplary embodiment, the process of predicting the cloud resource requirements of the cloud platform in a preset future time window based on the current business metric data and the current resource usage data includes:
[0037] Convert the current business metric data and the current resource usage data into time series data sequences respectively;
[0038] Input the time series data sequences into the prediction model to obtain the cloud resource requirements of the cloud platform in a preset future time window; the prediction model is a model trained based on the historical business metric data and the historical resource usage data of the cloud platform and with its model parameters optimized based on the correlation relationship between the business demand characteristics and the resource usage characteristics;
[0039] Among them, the prediction model includes an input layer, an encoder, a decoder, and an output layer;
[0040] Receive a time series data sequence through an input layer; process the time series data sequence through a self-attention mechanism in an encoder to obtain a weighted sequence and output it; process the weighted sequence through a self-attention mechanism in a decoder to obtain a cloud resource demand sequence within a preset future time window; the cloud resource demand sequence includes predicted values of cloud resource demands at each time point within the preset future time window; output the cloud resource demand sequence through an output layer.
[0041] Before performing this step, it also includes a process of training a prediction model. In this embodiment, a time series prediction model is constructed based on the Transformer architecture. The model includes an input layer, an encoder, a decoder, and an output layer. Preprocess the historical business metric data and historical resource usage data of the cloud platform, and generate a data sequence based on the preprocessed data. The data sequence serves as the input data for the prediction model. The input layer receives the data sequence. The encoder consists of multiple self-attention mechanisms and a feed-forward neural network, and is used to capture the time series dependencies and features in the data; the decoder also consists of multiple self-attention mechanisms and a feed-forward neural network, and also includes an additional encoder-decoder attention mechanism. The decoder is used to generate the cloud resource demand sequence, and the output layer outputs the predicted cloud resource demand sequence. During the training process, methods such as cross-validation are used to verify and optimize the model to improve prediction accuracy. At the same time, optimize the model parameters according to the correlation between the business demand characteristics and resource usage characteristics to obtain a prediction model that meets the prediction conditions, so as to improve the generalization ability and prediction performance of the model. The trained model will be used for subsequent resource demand prediction and intelligent dynamic adjustment.
[0042] Specifically, during subsequent use, convert the current business metric data and current resource usage data into time series data sequences respectively, and the cloud resource demands of the cloud platform within a preset future time window can be obtained, which improves the response speed and can capture the complex time series dependencies in the data, improving the prediction performance.
[0043] Exemplarily, input the preprocessed time series data sequence into the trained prediction model, and output the predicted values of cloud resource demands at each time point within a preset future time window to form a cloud resource demand sequence. This sequence accurately quantifies the demand quantities and change trends of different resource types (such as computing, storage, network). For example, the time window definition: within the next 1 hour, predict at a 5-minute granularity; prediction output example: Minute: 100 CPU cores and 200 GB of memory need to be allocated, Minute: Increase to 150 CPU cores and 300 GB of memory, Minute: Start to downsize to 80 CPU cores and 160 GB of memory.
[0044] In an exemplary embodiment, the self-attention mechanism calculates the attention weights using a first relational expression;
[0045] The first relational expression is ;
[0046] where Q is the current query vector, K is the current key vector, is the penalty factor, is the i-th query vector, is the i-th key vector, is the attention weight between the current query vector and the current key vector.
[0047] Explanation of the first relational expression: Among them, is a regulation factor used to adjust the degree of distance penalty. It is a non-negative real number used to adjust the degree of distance penalty. The degree of distance penalty refers to controlling the penalty size for the difference between the Query and Key vectors through the regulation factor Its main purpose is to enhance the attention ability of the prediction model to different input features and avoid over-focusing on those features irrelevant to the current task. Value range: Minimum value: When it means there is no distance penalty, that is, it completely depends on the original cosine similarity calculation method. Maximum value: The maximum value of has no specific upper limit, but in practical applications, a value less than 1 (such as 0.1 to 0.5) is usually selected to avoid the model performance degradation caused by over-punishing the distance difference. It can be understood that a smaller value will make the influence of the distance penalty smaller, while a larger value will increase the penalty for the distance difference, which may cause the model to pay more attention to local details rather than global patterns. Suppose there is a query vector and a key vector in a certain data sequence, and
[0048] ;
[0049] Explanation of the encoder and decoder respectively: The encoder consists of multiple self-attention mechanisms and a feed-forward neural network. The self-attention mechanism adopts the enhanced cosine similarity attention weight calculation (refer to the first relational expression). By adjusting the penalty factor the similarity and difference penalty between the query vector and the key vector can be dynamically balanced, and the ability to capture the non-linear association between business fluctuations and resource consumption can be strengthened. The feed-forward neural network further extracts the time-series dependence features and outputs the encoded weighted sequence.
[0050] The decoder can receive the initial prediction sequence (such as a vector of all zeros) for future time steps and the encoder output, and process the internal dependencies within the prediction sequence through a multi-layer self-attention mechanism; the encoder-decoder attention mechanism fuses the historical features output by the encoder with the prediction sequence information of the decoder to generate the hidden state representation for the future time window, and the feed-forward neural network performs a non-linear mapping on the hidden state to convert it into a cloud resource demand sequence.
[0051] In this embodiment, through the enhanced attention mechanism of the encoder, the dynamic coupling relationship between business metrics and resource consumption is modeled, overcoming the one-sidedness of traditional single-data-source prediction. Through the encoder-decoder attention mechanism of the decoder, the cross-time correlation between historical rules and future predictions is realized, effectively solving the long-term dependence problem, etc.
[0052] In addition, the Transformer model also has the advantages of strong parallel computing ability and fast training speed, and is suitable for large-scale data processing and real-time prediction scenarios.
[0053] In an exemplary embodiment, the resource adjustment request includes a resource application request and a resource release request;
[0054] The process of sending a resource adjustment request to the cloud platform according to the adjustment strategy corresponding to the cloud resource demand includes:
[0055] Determine the cloud resource adjustment trend according to the cloud resource demand;
[0056] When the cloud resource adjustment trend is an upward trend and meets the warning condition, determine the adjustment strategy as the first adjustment strategy, and send a resource application request to the cloud platform based on the first adjustment strategy;
[0057] When the cloud resource adjustment trend is a downward trend and meets the release condition, determine the adjustment strategy as the second adjustment strategy, and send a resource release request to the cloud platform based on the second adjustment strategy.
[0058] In this embodiment, the adjustment strategy takes into account the balance between cost and performance, and applies for or releases cloud resources in advance according to the predicted resource demand trend. In this embodiment, the cloud resource adjustment trend can be determined based on the cloud resource demand at a future moment and the cloud resource usage at the current moment, or can be determined according to the change in cloud resource demand within a preset future time window. For example, the average change rate of resource demand within a preset future time window can be calculated by a sliding window difference algorithm. When the change rate is greater than a preset upward threshold, it is determined as an upward trend, and when it is less than a preset downward threshold, it is determined as a downward trend. When the difference between the predicted demand and the current resource capacity exceeds the corresponding preset threshold and the trend is upward, it is determined that the warning condition is met. When the warning condition is met, the adjustment strategy is determined as the first adjustment strategy, that is, the expansion adjustment strategy, and a resource application request is sent to the cloud platform. When the cloud resource adjustment trend is a downward trend and the release condition is met, the adjustment strategy is determined as the second adjustment strategy, that is, the contraction adjustment strategy, and a resource release request is sent to the cloud platform.
[0059] As an alternative embodiment, the resource application request may include a target resource type (such as a GPU (Graphics Processing Unit) instance), a quantity, and a time constraint (such as the instance needs to be ready within minutes); the resource release request includes a list of IDs (Identifications) of the resources to be released and a release time window (such as releasing in two stages, with an interval of 10 minutes each time). After receiving the corresponding resource adjustment request, the cloud platform dynamically adjusts the cloud resources it uses.
[0060] As another alternative embodiment, when expanding, a stepped expansion plan is generated according to the predicted demand gap (predicted value - current capacity), and the execution time point of the expansion operation is set. When contracting, batch contraction rules can be generated according to the resource idle degree (current capacity - predicted value). For example, instances with an idle rate exceeding 90% are preferentially released, and a batch release operation is performed during the off-peak period of the service (such as 2 am) to avoid affecting service availability.
[0061] In this embodiment, through the dynamic coupling of trend determination and condition triggering, it is ensured that the resource adjustment operation takes effect at the critical time point of demand change. The stepped expansion and batch contraction strategies take into account both resource utilization rate and cost efficiency. At the same time, an expansion safety margin and a contraction buffer mechanism are introduced, which can effectively cope with prediction errors or sudden load fluctuations.
[0062] In an exemplary embodiment, the process of sending a resource adjustment request to the cloud platform according to the adjustment strategy corresponding to the cloud resource demand, so that the cloud resources adjusted by the cloud platform in response to the resource adjustment request are adapted to the cloud resource demand within a preset future time window includes:
[0063] Determine the cloud resource adjustment trend according to the cloud resource requirements;
[0064] Determine the scaling ratio of cloud resources based on the cloud resource adjustment trend;
[0065] Send a resource adjustment request including the scaling ratio to the cloud platform according to the adjustment strategy corresponding to the cloud resource requirements, so that the cloud platform can adjust the cloud resources according to the scaling ratio to adapt to the cloud resource requirements within a preset future time window.
[0066] In this embodiment, dynamic resource adjustment is performed using the scaling ratio. First, the preset future time window is divided into multiple consecutive sub-stages, and then the scaling ratio of each sub-stage is determined according to the cloud resource adjustment trend and the gap. For example, at time T, 100 CPU cores are required, and there are 60 CPU cores at the current time, and the total gap is 40 CPU cores. In the first sub-stage, the expansion can be performed first according to the first scaling ratio. In the second sub-stage, the expansion can be performed first according to the second scaling ratio. In the third sub-stage, the expansion can be performed first according to the third scaling ratio, and so on, until at time T, the cloud resource requirements are met, reaching 100 CPU cores. Among them, the scaling ratios of each sub-stage can be the same or different, and can be selected according to actual engineering needs.
[0067] In this embodiment, through phased and progressive allocation, the pressure on the cloud platform caused by sudden resource increase at one time (such as network congestion and virtualization delay) is avoided, and at the same time, the resource idle cost is reduced.
[0068] As an alternative embodiment, it further includes a fault recovery mechanism for considering the fault recovery ability during the resource adjustment process to ensure business continuity.
[0069] Referring to the above, the intelligent dynamic adjustment strategy in this embodiment that considers the balance between cost and performance can apply for or release cloud resources in advance according to the predicted resource demand trend, ensuring the stability of business performance and reducing the resource usage cost. The intelligent dynamic adjustment strategy includes a resource warning mechanism, a resource release mechanism, an elastic scaling mechanism, a fault recovery mechanism, etc., and can achieve a comprehensive optimization configuration of cloud resources. At the same time, the design of the intelligent dynamic adjustment strategy is also customized according to the business requirements and resource usage characteristics to achieve the best resource configuration effect.
[0070] In an exemplary embodiment, after sending a resource adjustment request to the cloud platform according to the adjustment strategy corresponding to the cloud resource requirements so that the cloud resources adjusted by the cloud platform in response to the resource adjustment request can adapt to the cloud resource requirements within a preset future time window, the cloud resource management method further includes:
[0071] Monitor the resource usage situation and business performance indicators of the cloud platform;
[0072] When the resource usage and / or business performance metrics meet the warning conditions, perform an alarm operation.
[0073] In this embodiment, during the resource adjustment process, the resource usage and business performance metrics are monitored in real time to ensure the accuracy of resource adjustment and the stability of business performance. When anomalies are detected in resource usage or business performance metrics, the alarm mechanism is triggered to notify relevant personnel for processing in a timely manner. At the same time, the Transformer prediction model is continuously optimized and adjusted based on the monitoring results to improve the prediction accuracy and the accuracy of resource adjustment.
[0074] As another alternative embodiment, a user feedback interface is provided to collect user feedback on the resource adjustment effect, so as to further optimize the adjustment strategy and improve user satisfaction. The realization of monitoring and feedback optimization requires ensuring the real-time and accuracy of data, as well as the stability and reliability of the system.
[0075] Refer to Figure 2 and Figure 3 , the present invention provides a cloud resource time series prediction and intelligent dynamic adjustment system and method based on the Transformer model. By integrating business metrics and resource usage data, high-precision time series prediction is achieved, and cloud resources are intelligently adjusted according to the prediction results to optimize resource allocation, balance costs and performance, and improve the utilization efficiency of cloud resources and the economic benefits of enterprises.
[0076] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.
[0077] Please refer to Figure 4 , the embodiments of the present invention also provide a cloud resource management system, including:
[0078] An acquisition module 11, configured to acquire the current business metric data and the current resource usage data of the cloud platform; the current business metric data is used to characterize the change trend of the business requirements of the cloud platform, and the current resource usage data is used to characterize the usage situation of the cloud resources in the cloud platform;
[0079] A prediction module 12, configured to predict the cloud resource requirements of the cloud platform within a future preset time window based on the current business metric data and the current resource usage data;
[0080] An adjustment module 13, configured to send a resource adjustment request to the cloud platform according to the adjustment strategy corresponding to the cloud resource requirements, so that the cloud resources adjusted by the cloud platform in response to the resource adjustment request are adapted to the cloud resource requirements within a future preset time window.
[0081] In an exemplary embodiment, a process of predicting cloud resource demand of a cloud platform within a future preset time window based on current business indicator data and current resource usage data includes:
[0082] Convert current business indicator data and current resource usage data into time series data sequences respectively;
[0083] The time series data sequence is input into the prediction model to obtain the cloud resource demand of the cloud platform within a preset time window in the future; the prediction model is trained based on the historical business indicator data and historical resource usage data of the cloud platform, and the model parameters are optimized based on the correlation between business demand characteristics and resource usage characteristics.
[0084] In an exemplary embodiment, the prediction model includes an input layer, an encoder, a decoder, and an output layer;
[0085] The process of inputting time series data into the prediction model to obtain the cloud resource demand of the cloud platform within a preset time window in the future includes:
[0086] Receive time series data sequences through the input layer;
[0087] The time series data sequence is processed through the self-attention mechanism in the encoder to obtain a weighted sequence and output it;
[0088] The weighted sequence is processed through the self-attention mechanism in the decoder to obtain a cloud resource demand sequence within a future preset time window; the cloud resource demand sequence includes the predicted value of cloud resource demand at each time point within the future preset time window;
[0089] The cloud resource requirement sequence is output through the output layer.
[0090] In an exemplary embodiment, the self-attention mechanism calculates the attention weight using the first relation:
[0091] The first relation is ;
[0092] Among them, Q is the current query vector, K is the current key vector, is the penalty factor, is the i-th query vector, is the i-th key vector, is the attention weight between the current query vector and the current key vector.
[0093] In an exemplary embodiment, the resource adjustment request includes a resource application request and a resource release request;
[0094] The process of sending a resource adjustment request to the cloud platform according to the adjustment policy corresponding to cloud resource requirements includes:
[0095] Determine the cloud resource adjustment trend according to the cloud resource requirements;
[0096] When the cloud resource adjustment trend is an upward trend and meets the warning conditions, determine the adjustment strategy as the first adjustment strategy, and send a resource application request to the cloud platform based on the first adjustment strategy;
[0097] When the cloud resource adjustment trend is a downward trend and meets the release conditions, determine the adjustment strategy as the second adjustment strategy, and send a resource release request to the cloud platform based on the second adjustment strategy.
[0098] In an exemplary embodiment, the process of sending a resource adjustment request to the cloud platform according to the adjustment strategy corresponding to the cloud resource requirements, so that the cloud resources adjusted by the cloud platform in response to the resource adjustment request are adapted to the cloud resource requirements within a future preset time window includes:
[0099] Determine the cloud resource adjustment trend according to the cloud resource requirements;
[0100] Determine the scaling ratio of the cloud resources based on the cloud resource adjustment trend;
[0101] Send a resource adjustment request including the scaling ratio to the cloud platform according to the adjustment strategy corresponding to the cloud resource requirements, so that the cloud resources adjusted by the cloud platform according to the scaling ratio are adapted to the cloud resource requirements within a future preset time window.
[0102] In an exemplary embodiment, the cloud resource management system further includes:
[0103] A monitoring module, which is used to monitor the resource usage and business performance indicators of the cloud platform after sending a resource adjustment request to the cloud platform according to the adjustment strategy corresponding to the cloud resource requirements, so that the cloud resources adjusted by the cloud platform in response to the resource adjustment request are adapted to the cloud resource requirements within a future preset time window. When the resource usage and / or business performance indicators meet the warning conditions, perform an alarm operation.
[0104] Among them, for the description of the features in the embodiments corresponding to the cloud resource management system, reference can be made to the relevant descriptions in the embodiments corresponding to the cloud resource management method, which will not be elaborated here one by one.
[0105] An embodiment of the present invention also provides an electronic device, including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above embodiments of the cloud resource management method.
[0106] An embodiment of the present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps in any one of the above embodiments of the cloud resource management method when running.
[0107] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to: various media that can store computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), mobile hard disks, magnetic disks, or optical discs.
[0108] An embodiment of the present invention also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above-described embodiments of the cloud resource management method.
[0109] An embodiment of the present invention also provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above-described embodiments of the cloud resource management method.
[0110] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0111] The above has introduced in detail a cloud resource management method, system, device, and storage medium provided by the present invention. Specific examples are used herein to elaborate on the principles and implementation manners of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
Claims
1. A cloud resource management method, characterized in that, Including: Obtain the current business metric data and current resource usage data of the cloud platform; the current business metric data is used to characterize the change trend of the business requirements of the cloud platform, and the current resource usage data is used to characterize the usage situation of cloud resources in the cloud platform; Predict the cloud resource requirements of the cloud platform within a preset future time window based on the current business metric data and the current resource usage data; Send a resource adjustment request to the cloud platform according to the adjustment strategy corresponding to the cloud resource requirements, so that the cloud resources adjusted by the cloud platform in response to the resource adjustment request are adapted to the cloud resource requirements within the preset future time window.
2. The cloud resource management method according to claim 1, wherein The process of predicting the cloud resource requirements of the cloud platform within a preset future time window based on the current business metric data and the current resource usage data includes: Convert the current business metric data and the current resource usage data into time series data sequences respectively; Input the time series data sequence into a prediction model to obtain the cloud resource requirements of the cloud platform within a preset future time window; the prediction model is a model trained based on the historical business metric data and historical resource usage data of the cloud platform and with its model parameters optimized based on the correlation relationship between business requirement characteristics and resource usage characteristics.
3. The cloud resource management method according to claim 2, characterized in that, The prediction model includes an input layer, an encoder, a decoder, and an output layer; The process of inputting the time series data sequence into the prediction model to obtain the cloud resource requirements of the cloud platform within a preset future time window includes: Receive the time series data sequence through the input layer; Process the time series data sequence through the self-attention mechanism in the encoder to obtain a weighted sequence and output it; Process the weighted sequence through the self-attention mechanism in the decoder to obtain the cloud resource requirement sequence within the preset future time window; the cloud resource requirement sequence includes the predicted values of the cloud resource requirements at each time point within the preset future time window; Output the cloud resource requirement sequence through the output layer.
4. The cloud resource management method according to claim 3, wherein, The self-attention mechanism calculates the attention weights using a first relational expression; The first relational expression is ; Among them, Q is the current query vector, and K is the current key vector. is the penalty factor. is the i-th query vector. is the i-th key vector. is the attention weight between the current query vector and the current key vector.
5. The cloud resource management method according to claim 1, characterized in that, The resource adjustment request includes the resource application request and the resource release request; The process of sending a resource adjustment request to the cloud platform according to the adjustment strategy corresponding to the cloud resource requirements includes: Determine the cloud resource adjustment trend according to the cloud resource requirements; When the cloud resource adjustment trend is an upward trend and meets the warning condition, determine the adjustment strategy as the first adjustment strategy, and send the resource application request to the cloud platform based on the first adjustment strategy; When the cloud resource adjustment trend is a downward trend and meets the release condition, determine the adjustment strategy as the second adjustment strategy, and send the resource release request to the cloud platform based on the second adjustment strategy.
6. The cloud resource management method according to claim 5, wherein The process of sending a resource adjustment request to the cloud platform according to the adjustment strategy corresponding to the cloud resource requirements, so that the cloud resources adjusted by the cloud platform in response to the resource adjustment request are adapted to the cloud resource requirements within the preset future time window includes: Determine the cloud resource adjustment trend according to the cloud resource requirements; Determine the scaling ratio of the cloud resources based on the cloud resource adjustment trend; Send a resource adjustment request including the scaling ratio to the cloud platform according to the adjustment strategy corresponding to the cloud resource requirement, so that the cloud resources adjusted by the cloud platform according to the scaling ratio can adapt to the cloud resource requirement within the future preset time window.
7. The cloud resource management method according to any one of claims 1-6, characterized in that, After sending a resource adjustment request to the cloud platform according to the adjustment strategy corresponding to the cloud resource requirement, so that the cloud resources adjusted by the cloud platform in response to the resource adjustment request can adapt to the cloud resource requirement within the future preset time window, the cloud resource management method further includes: Monitor the resource usage and business performance indicators of the cloud platform; When the resource usage and / or the business performance indicators meet the warning conditions, perform an alarm operation.
8. A cloud resource management system, characterized in that, Include: An acquisition module, configured to acquire the current business metric data and the current resource usage data of the cloud platform; the current business metric data is used to characterize the change trend of the business requirements of the cloud platform, and the current resource usage data is used to characterize the usage of the cloud resources in the cloud platform; A prediction module, configured to predict the cloud resource requirement of the cloud platform within a future preset time window based on the current business metric data and the current resource usage data; An adjustment module, configured to send a resource adjustment request to the cloud platform according to the adjustment strategy corresponding to the cloud resource requirement, so that the cloud resources adjusted by the cloud platform in response to the resource adjustment request can adapt to the cloud resource requirement within the future preset time window.
9. An electronic device, characterized in that, Include: A memory, configured to store a computer program; A processor, configured to implement the steps of the cloud resource management method according to any one of claims 1-7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, 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 resource management method according to any one of claims 1-7 are implemented.
Citation Information
Cited By
Cloud desktop resource pool dynamic prediction method, system, device, medium and product
CN120929275A
Cloud resource optimization method and device, computer equipment and storage medium
CN121125528A