Dynamic capacity expansion and contraction optimization method and optimization system of cluster and storage medium
By combining deep learning algorithms with multi-dimensional monitoring data, load changes are predicted and optimal scaling strategies are generated. This solves the shortcomings of traditional cluster management systems in quickly responding to business needs, realizes intelligent resource scheduling and optimization, and improves system stability and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-08
- Publication Date
- 2026-03-10
AI Technical Summary
Traditional cluster management systems have limitations in their scaling decision-making logic and execution strategies, making it difficult to respond quickly to rapid changes in business needs, resulting in insufficient or excessive resources, which affects service quality and cost-effectiveness.
By employing deep learning algorithms and utilizing multi-dimensional monitoring data, a non-linear mapping relationship between business pressure signals and system resource status is established by acquiring monitoring indicators related to load parameters and business metrics. This predicts load change trends and generates optimal scaling strategies based on multi-objective optimization algorithms, dynamically adjusting resource configuration.
It enables accurate prediction of application load, rapid response to changes in business needs, avoids system overload or resource idleness, improves system stability and resource utilization, ensures stable application performance, and enhances user experience.
Smart Images

Figure CN121636056A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of resource scheduling technology, and more specifically to a dynamic scaling optimization method, optimization system, and storage medium for clusters. Background Technology
[0002] With the rapid development of fintech, financial-grade model services are increasingly being used in financial institutions, such as risk assessment, credit scoring, and market forecasting. These services have highly dynamic demands for computing resources, often changing drastically due to sudden increases or decreases in business volume. Traditional manual resource allocation methods struggle to respond quickly to these changes, easily leading to resource shortages or service overload, impacting service quality and cost-effectiveness. Therefore, developing a device capable of automatically and flexibly adjusting computing resources according to business needs is particularly important.
[0003] For example, existing technologies in Kubernetes cluster management typically include built-in scaling mechanisms to automatically adjust the number of pod replicas based on current load. However, traditional cluster management relies primarily on basic metrics such as CPU and memory utilization, which cannot fully reflect the actual application load. Especially when dealing with complex applications or special business scenarios, its scaling performance is often less than ideal. Furthermore, the default execution strategies of such scaling mechanisms (such as cooldown delays and step-by-step scaling) may lead to service stability risks due to response delays under sudden traffic spikes or rapidly changing load conditions. It is evident that traditional scaling mechanisms also have limitations in their decision-making logic and execution strategies, making it difficult to cope with rapidly changing load demands. Summary of the Invention
[0004] The purpose of this invention is to provide a dynamic scaling optimization method, optimization system, and storage medium for clusters. By using deep learning algorithms and multi-dimensional monitoring data, intelligent dynamic scaling is achieved, which can anticipate load peaks and troughs and quickly respond to changes in business needs, thereby at least partially overcoming the aforementioned technical problems.
[0005] To achieve the above objectives, embodiments of the present invention provide a dynamic scaling optimization method for a cluster. The optimization method includes: acquiring multi-dimensional monitoring indicators related to load parameters and business metrics, wherein the business metrics include at least one business pressure signal capable of quantifying the pressure exerted on the cluster by external business requests; processing the multi-dimensional monitoring indicators based on a deep learning prediction model to output a prediction result of the application load on the cluster; dynamically generating the current optimal scaling strategy based on a multi-objective optimization algorithm according to the prediction result and preset scaling rules; and performing scaling optimization operations based on the scaling strategy.
[0006] Optionally, the load parameters include one or more of the following: CPU utilization, memory utilization, network bandwidth, disk I / O, number of Pods, application request volume; and / or the business metrics are user-defined metrics, and the business pressure signal is a service request metric with clear business semantics, and its change precedes or is synchronized with the change of system resource load. The service request metric includes one or more of the following: queries per second, transaction processing rate, number of orders per second, number of concurrent users in real time, and response time.
[0007] Optionally, the prediction results include: load change trends, peak points, and trough points.
[0008] Optionally, the training process of the deep learning prediction model includes: dividing the preprocessed multi-dimensional monitoring indicators into training set, validation set, and test set in chronological order; selecting an initial model and performing hyperparameter tuning on the learning rate, batch size, number of hidden layer nodes, and number of layers of the initial model using grid search, random search, or Bayesian optimization methods; training the model using data from the training set and determining the loss function value for each training session; and adjusting the model parameters using a backpropagation algorithm and an optimizer to determine the target model with the goal of minimizing the loss function value.
[0009] Optionally, the training process of the deep learning prediction model further includes: ending the training process when the performance of the validation set no longer improves; and / or iteratively optimizing the deep learning prediction model based on the execution feedback of the prediction service on which the target model is deployed.
[0010] Optionally, the preprocessing includes: data cleaning, normalization, and feature extraction; the initial model is used to process data with time series characteristics, including: support vector machine model, random forest model, RNN, LSTM, and GRU.
[0011] Optionally, the scaling rules include: load threshold, scaling ratio, current resource usage; and user-defined constraints, including: maximum number of Pods, minimum number of Pods, and resource limits.
[0012] Optionally, the cluster is Kubernetes, and the scaling operation based on the scaling strategy includes: dynamically adjusting the number of Pod replicas through HPA, and replacing Pod instances one by one using a rolling update method.
[0013] On the other hand, the present invention provides a dynamic scaling optimization system for a cluster, the optimization system comprising: a data acquisition module for acquiring multi-dimensional monitoring indicators related to load parameters and business metrics, wherein the business metrics include at least one business pressure signal capable of quantifying the pressure exerted on the cluster by external business requests; a deep learning prediction module for processing the multi-dimensional monitoring indicators to output a prediction result of the application load of the cluster; a dynamic strategy generator for dynamically generating the current optimal scaling strategy based on the prediction result and preset scaling rules using a multi-objective optimization algorithm; and an adaptive HPA enhancer for performing scaling optimization operations based on the scaling strategy.
[0014] On the other hand, the present invention provides a machine-readable storage medium storing instructions for causing a machine to execute: the dynamic scaling optimization method for a cluster as described above.
[0015] On the other hand, the present invention provides a processor for running a program, wherein the program is executed to perform: the dynamic scaling optimization method for clusters described above.
[0016] On the other hand, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements: the dynamic scaling optimization method for clusters as described above.
[0017] Through the above technical solutions, this invention provides a dynamic scaling optimization method, optimization system, and storage medium for clusters. By using deep learning algorithms to model and analyze multi-dimensional monitoring data, it achieves accurate prediction of application load, thereby enabling intelligent resource scheduling and optimization. This invention can quickly respond to changes in business needs, proactively address load peaks and troughs, avoid service interruptions caused by system overload or resource idleness, improve system stability and reliability, ensure stable application performance, and thus enhance user experience.
[0018] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0019] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart illustrating a dynamic scaling optimization method for a cluster according to an embodiment of the present invention. Figure 2This is a schematic diagram of the structure of a dynamic scaling and shrinking optimization system for a cluster according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the internal structure of a computer device according to an embodiment of this application.
[0020] Explanation of reference numerals in the attached figures A dynamic scaling and optimization system for 200-cluster clusters; 210 - Data Acquisition Module; 220 - Deep Learning Prediction Module; 230 - Dynamic Policy Generator; 240 - Adaptive HPA Enhancer; A01 - Processor; A02 - Network interface; A03 - Internal memory; A04 - Display screen; A05 - Input device; A06 - Non-volatile storage medium; B01 - Operating System; B02 - Computer Program. Detailed Implementation
[0021] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the scope of the present invention.
[0022] First, the present invention provides a dynamic scaling optimization method 100 for a cluster, such as Kubernetes, or K8s for short, which is a container orchestration platform that can be used to automatically deploy, scale and manage containerized applications, and can realize functions such as automated deployment, elastic scaling, load balancing and automatic recovery of containerized applications.
[0023] like Figure 1 As shown, the optimization method 100 may include steps S110-S140. It is worth noting that the acquisition, storage, use, and processing of data in this application's technical solution all comply with relevant laws and regulations.
[0024] Step S110: Obtain multi-dimensional monitoring metrics related to load parameters and business metrics.
[0025] Specifically, in the dynamic scaling implementation of a Kubernetes cluster, step S110 is responsible for acquiring multi-dimensional monitoring metrics related to load parameters and business metrics. Load parameters can include one or more of the following: CPU utilization, memory utilization, network bandwidth, disk I / O (Disk Input / Output), number of Pods, application request volume, etc. A Pod is a logical unit in Kubernetes used to encapsulate application containers, storage and computing resources, and configuration; it is also the smallest unit for management and deployment scheduling. However, the applicant's research found that existing technologies based on "large-granularity metrics" (such as CPU utilization and memory utilization) have a fundamental flaw: these metrics are essentially the "results" of business load operation, rather than the "cause" of resource demand. This inverted causal relationship leads to significant lag in scaling decisions. The system must first withstand business pressure, consume resources, and reach a threshold before triggering a response, making it unable to handle sudden traffic surges. This results in resource scheduling always being "half a beat late," severely deviating from the actual user experience (such as response time).
[0026] To overcome the aforementioned shortcomings, this invention introduces business metrics as core driving signals. These metrics are customized by the user according to the actual scenario and are business pressure signals that can quantify the pressure exerted on the cluster by external business requests. These signals have clear business semantics, and their changes usually precede or are synchronized with changes in system resource load, forming the core of the "resource dynamic scheduling method based on business pressure causality". Its principle lies in shifting the decision-making basis from resource metrics that characterize the "consequences of system state" to pressure signals that characterize the "causes of business demand".
[0027] The service request metrics include, but are not limited to, QPS (Queries Per Second), Transaction Per Second (TPS), Orders per Second, Real-time Concurrent Users, and Response Time. Taking QPS as an example, it directly reflects the real-time pressure of external requests on the cluster. Its changing trend often precedes the appearance of resource metrics such as CPU usage, enabling the system to proactively "listen" to business demands rather than passively "observing" resource consumption. Building upon this, the invention can further employ deep learning models, the core purpose of which is to learn and establish a complex nonlinear dynamic mapping relationship between "business pressure signals" (such as QPS) and "system resource status" (such as CPU utilization). Scaling decisions based on prediction results are directly bound to the Service Level Agreement (SLA), such as "ensuring 99% of requests respond within 100 milliseconds." Resource allocation no longer isolatedly satisfies a specific resource threshold but serves a clear business objective, achieving a system-level globally optimal solution across multiple dimensions such as resource cost and operational stability—that is, achieving Pareto optimality. In this way, the inventiveness of this invention can be reflected in the following three aspects: shifting from "resource relief" to "business assurance", breaking the response delay caused by the break of the causal chain in the existing technology; based on the predictive drive of leading indicators, it simultaneously improves service stability, resource utilization and system agility; the causal drive framework is universal and can be adapted to various business pressure indicators, providing a unified and refined elastic management method for differentiated business systems.
[0028] As can be seen, this solution has constructed a comprehensive monitoring indicator system, which not only includes traditional basic resource indicators such as CPU utilization and memory utilization, but also innovatively integrates system-level indicators such as network bandwidth and disk I / O. In particular, it has specially set up custom indicators such as QPS and response time to reflect the actual status of business. Compared with the large-granularity indicators in existing technologies, it is more refined and conducive to the accuracy and reliability of subsequent analysis.
[0029] In one embodiment, these multi-dimensional metrics can be collected in real time, for example, through a metrics application programming interface (such as Prometheus), and transmitted to the HPA controller in real time, thereby providing data support for intelligent scaling decisions. Alternatively, the aforementioned monitoring data can be collected in real time from the Kubernetes cluster and standardized through a unified data pipeline to ensure the consistency and reliability of the data used in subsequent analysis, thereby improving the accuracy and timeliness of automatic scaling decisions.
[0030] Step S120: Based on the deep learning prediction model, process the multi-dimensional monitoring indicators to output the prediction results of the application load of the cluster.
[0031] The core objective of this step is to optimize and upgrade intelligent decision-making logic through deep learning prediction models. In practical implementation, this invention can employ advanced machine learning algorithms such as Support Vector Machines and Random Forests to construct the prediction model architecture. These algorithms, after careful optimization and cross-validation, can perform in-depth processing and analysis of the collected multi-dimensional monitoring data. For example, the prediction model can establish accurate prediction function relationships by analyzing the temporal characteristics, periodic patterns, and abnormal fluctuation patterns in historical and real-time data, thereby predicting load change trends within a specific future time period.
[0032] Regarding the output of the prediction results, the results can include load change trends, peak points, and trough points. That is, the system can not only predict the basic load change curve, but also accurately identify key characteristic points such as potential peak and trough points, thus providing forward-looking guidance for subsequent resource scheduling decisions. In actual deployment, the trained prediction model can first be packaged into an independent prediction service. This service receives the latest data stream from the monitoring system in real time through a standardized interface, and after model inference, outputs prediction results containing key information such as future load trends, peak / trough time points, and confidence assessments. This machine learning-based intelligent prediction mechanism breaks through the limitations of traditional static thresholds, enabling the system to perceive load changes in advance and providing a more accurate and reliable basis for dynamic resource scheduling decisions.
[0033] Specifically, the training process of the deep learning prediction model in step S120 may include the following steps S121-S124: Step S121: Divide the preprocessed multi-dimensional monitoring indicators into training set, validation set and test set in chronological order.
[0034] First, the collected multi-dimensional monitoring metrics can be divided into training, validation, and test sets according to random order or the natural order of the time series. The training set is used for initial learning of model parameters, the validation set for hyperparameter tuning and model selection, and the test set is specifically used for final performance evaluation. Using time series partitioning ensures that future information leakage will not occur, guaranteeing the objectivity of the model evaluation.
[0035] Meanwhile, in the intelligent implementation of Kubernetes cluster resource scheduling, the data preprocessing stage ensures the accuracy of the predictive model, thus realizing a complete transformation process from raw monitoring data to a usable dataset for the model. Preprocessing can include data cleaning, normalization, and feature extraction. Specifically, the data cleaning stage uses an automated process to detect and handle missing and outlier values in the data, ensuring data integrity and reliability through interpolation imputation, smoothing, or appropriate deletion. Then, all features can be standardized, such as through normalization, to eliminate the influence of different units of measurement and make the data comparable across dimensions. Feature extraction requires a thorough understanding of the business scenario, leveraging business logic and domain knowledge to extract the most predictive features from the raw data. This can include calculating statistical features within a sliding time window, such as mean, standard deviation, and extreme values, as well as identifying periodicity and trend patterns in the data through time series analysis. These carefully designed feature engineering techniques provide high-quality input data for subsequent deep learning models.
[0036] In addition, one or more of the above preprocessing methods can be adopted depending on the actual situation. For example, a modular design can be used to connect each preprocessing step closely yet allow for relative independence, ensuring processing efficiency while facilitating flexible adjustments for different business scenarios. This systematic data preparation lays a solid foundation for subsequent training of intelligent prediction models, enabling the resource scheduling system to make more accurate decisions based on high-quality data.
[0037] Step S122: Select an initial model and perform hyperparameter tuning on the learning rate, batch size, number of hidden layer nodes, and number of layers of the initial model using grid search, random search, or Bayesian optimization methods.
[0038] Step S122 focuses on completing the initial model selection and hyperparameter optimization during the model building phase. For example, considering the significant time-series characteristics of Kubernetes cluster load data, the system first selects a suitable initial model architecture from the candidate model pool, especially considering its ability to process data with time-series characteristics and effectively capture the temporal dependencies in the data. Optionally, candidate models may include Support Vector Machine (SVM), Random Forest, Recurrent Neural Network (RNN) and its improved versions, Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU). In one embodiment, after comprehensive evaluation, LSTM and GRU, two special RNN variants, were ultimately selected as the base models because their unique gating mechanisms can effectively solve the gradient vanishing problem that occurs in traditional RNNs during long-sequence training, and are better at capturing long-term temporal dependencies in load data.
[0039] Furthermore, in terms of model structure design, the system can adopt a layered architecture to achieve end-to-end time series prediction, including an input layer, hidden layers, and an output layer. First, the input layer receives preprocessed feature vectors, which not only contain numerical information about the load index but also incorporate key features extracted through time series feature engineering, such as seasonality and trends. Second, the hidden layer is composed of multiple stacked LSTM or GRU units, with a Dropout regularization layer introduced between each layer to randomly shield some neurons, effectively preventing overfitting. To further improve model performance, an attention mechanism is integrated into the hidden layer, enabling the model to dynamically adjust the attention weights to inputs at different time steps, enhancing its ability to identify key time points. Finally, the output layer can be configured according to the specific regression prediction task, using a linear activation function combined with Mean Squared Error (MSE) as the loss function to ensure the model can accurately predict load values for future time periods. It is worth noting that the specific model selection and structural settings described above can be adjusted according to actual circumstances, and this invention does not limit this.
[0040] In one embodiment, model construction may further include hyperparameter tuning. For example, a systematic optimization strategy can be employed, using methods such as grid search, random search, or Bayesian optimization to fine-tune key hyperparameters affecting model performance. Target parameters for tuning include learning rate, batch size, number of nodes in each hidden layer, and network depth. Optimized combinations of these hyperparameters will significantly improve the model's prediction accuracy and generalization ability. The entire tuning process is evaluated on a validation set, using cross-validation to ensure the reliability of the results, ultimately determining the optimal hyperparameter configuration, laying the foundation for subsequent model training and online prediction. In summary, this invention, through this rigorous model selection and parameter optimization process, enables accurate prediction of future load change trends based on historical data, providing a scientific basis for dynamic resource scheduling and load optimization.
[0041] Step S123: Use the data in the training set to train the model and determine the loss function value for each training session.
[0042] The model training phase is the core of the entire model building process, and it begins with batch processing of the training data. For example, the system can divide the preprocessed training data into several smaller batches according to a set batch size, and then sequentially input them into the neural network for forward propagation. During forward propagation, the input data passes through the input layer, hidden layers, and finally the output layer. Each layer performs linear transformations and non-linear activation operations, ultimately generating the predicted output. After each training iteration, the system calculates the loss function value for the current batch. For example, MSE can be used as the loss function for regression prediction tasks. It is necessary to record the loss value for each iteration to form a training loss curve; this data is crucial for the subsequent review process of optimizing prediction data.
[0043] Step S124: Adjust the model parameters using the backpropagation algorithm and optimizer to determine the target model with the goal of minimizing the loss function value.
[0044] After obtaining multiple loss values, the target model needs to be determined with the goal of minimizing the loss function value. For example, the gradient of the loss function with respect to each model parameter can be calculated using the backpropagation algorithm. This process starts from the output layer and propagates back along the network, calculating the gradient value layer by layer using the chain rule. Taking a three-layer LSTM network as an example, the system will calculate the parameter gradients of the output layer, the second LSTM layer, and the first LSTM layer sequentially. After the gradient calculation is completed, an optimizer can be used to update the model parameters based on the gradient information, thereby accelerating the convergence process of the loss function value. For example, the following optimization algorithms can be used: Stochastic Gradient Descent (SGD), Adaptive Moment Estimation (Adam), Root Mean Square Propagation (RMSprop), etc., which are not limited in this invention. In addition, during the parameter update process, a learning rate decay strategy can be used, gradually reducing the learning rate as the training epochs increase, allowing the model to adjust the parameters more finely. Furthermore, to prevent the model from getting trapped in local optima, a momentum mechanism can be introduced in some embodiments to retain some information about the previous update direction, thereby reducing the number of training epochs and saving training resources.
[0045] As can be seen, the training process described above requires training the model based on the training set data, continuously adjusting the model parameters through the backpropagation algorithm and optimizer to minimize the loss function. Simultaneously, it's crucial to monitor the loss curve during training and the performance metrics on the validation set to adjust the training strategy accordingly.
[0046] In another embodiment, the training process of the deep learning prediction model may further include step S125 and / or step S126.
[0047] Step S125: When the performance of the validation set no longer improves, the training process ends.
[0048] In the training and optimization process of deep learning models, a complete model performance improvement system can be formed by employing intelligent training termination strategies and continuous iterative optimization mechanisms. For example, a validation set-driven intelligent early stopping strategy can be used, which stops training early when the performance on the validation set no longer improves, thus preventing overfitting. Specifically, multi-dimensional performance metrics on the validation set (including accuracy, F1 score, and other business metrics) can be continuously monitored. When these metrics do not show significant improvement within N consecutive training epochs, the system will automatically trigger the training termination process. Alternatively, this strategy can employ a dynamic threshold mechanism, calculating the improvement margin of validation metrics through a sliding window. When the average improvement rate of the most recent K evaluations falls below a set threshold (e.g., 0.1%), the termination condition is met. Simultaneously, the system saves a snapshot of the model parameters with the best performance on the validation set, ensuring that the model can recover to its optimal state upon training termination. In practical applications, this strategy not only significantly saves training time but also effectively reduces the risk of overfitting.
[0049] Step S126: Based on the execution feedback of the prediction service with the target model deployed, iteratively optimize the deep learning prediction model.
[0050] In this step, the deep learning prediction model can be iteratively optimized based on the actual execution performance of the Kubernetes cluster and new monitoring data to improve prediction accuracy and the efficiency of dynamic resource scheduling. Specifically, the execution feedback data may include, but is not limited to, the deviation analysis between predicted values and actual resource utilization (such as the percentage difference between CPU allocation and actual usage), the scaling decision latency (the time difference from the triggering condition to Pod readiness), and abnormal event logs (such as alarm records of resource over-provisioning or under-provisioning). A fine-grained performance evaluation matrix can be established based on the above indicators to iteratively optimize the deep learning prediction model.
[0051] Step S130: Based on the prediction results and the preset scaling rules, dynamically generate the current optimal scaling strategy using a multi-objective optimization algorithm.
[0052] Step S130 enables a dynamic scaling strategy generation mechanism based on multi-dimensional decision factors. These scaling rules can include load thresholds, scaling ratios, and current resource usage. Additionally, user-defined constraints can be included, such as maximum and minimum Pod counts, and resource limits. Therefore, this invention supports user-defined monitoring metrics and scaling rules to meet the needs of different applications and business scenarios. Users can flexibly configure various parameters in the Kubernetes cluster through configuration files or API interfaces.
[0053] Alternatively, this step can be implemented using a dynamic policy generator. Based on the output of the deep learning prediction module, and combined with multi-objective optimization algorithms considering resource cost, system stability, etc., the optimal scaling strategy is dynamically generated. The policy generator considers current resource usage, predicted load trends, and user-defined constraints (such as maximum / minimum Pod count, resource limits, etc.) to ensure the rationality and economy of resource scheduling. For example, based on the prediction results and preset scaling rules (such as load thresholds, scaling ratios, etc.), the Kubernetes cluster can intelligently formulate scaling decisions, ensuring that application load requirements are met while minimizing resource waste.
[0054] Step S140: Based on the scaling strategy, perform scaling optimization operations.
[0055] In a Kubernetes cluster, to achieve an intelligent scaling mechanism, this invention can dynamically adjust the number of Pod replicas using the Kubernetes built-in component HPA (Horizontal PodAutoscaler) during scaling operations. It also employs a rolling update approach to gradually replace Pod instances, minimizing service impact. Specifically, this method deeply integrates with Kubernetes' native HPA functionality, which automatically adjusts the number of application replicas based on predefined metrics, performing horizontal scaling to meet changing load demands.
[0056] In one embodiment, the strategy parameters from the generated prediction results can be transmitted to the HPA controller in real time via standardized interfaces (including REST APIs and message queues). The execution process can employ a dual-track safeguard mechanism: first, the target Pod replica count is dynamically calculated based on the predicted load curve and current resource utilization; then, the replica count of the Deployment or StatefulSet is adjusted via the HPA's elastic scaling interface. Simultaneously, to minimize service impact, a gradual instance replacement strategy is implemented, sequentially replacing Pod instances in a rolling update manner according to the user-configured batch size and minimum availability ratio parameters, ensuring a smooth migration of service traffic during the update process.
[0057] Furthermore, this invention also incorporates health checks and fault recovery mechanisms to ensure service stability and reliability during scaling up and down. For example, it can continuously monitor the running status of new and old Pod instances, automatically isolate abnormal instances, and trigger compensation creation. For resource supply and demand imbalances caused by prediction deviations, the scaling up and down rhythm can be dynamically adjusted based on real-time monitoring data. This hybrid execution mode, which integrates predictive scheduling and reactive adjustment, retains the reliability of Kubernetes' native scaling up and down mechanism while optimizing the timeliness and accuracy of resource adjustments through intelligent algorithms, ultimately achieving a dynamic balance between business load and resource supply.
[0058] In summary, this invention proposes an enhanced intelligent dynamic resource scheduling optimization method based on Kubernetes HPA, integrating a deep learning algorithm model and AI prediction, and utilizing multi-dimensional monitoring data to achieve intelligent dynamic scaling. The advantages of this technical solution are as follows: 1) Improve prediction accuracy: Based on historical data and current load conditions, multi-dimensional monitoring data is modeled and analyzed using deep learning algorithms, and machine learning algorithms are used to predict service demand in the future, thereby achieving accurate prediction of application load.
[0059] 2) Optimize resource scheduling: Based on the prediction results and the preset scaling strategy, determine whether to increase or decrease computing resources, and calculate the specific resource adjustment amount to realize intelligent scheduling and optimization of resources, improve resource utilization and reduce operating costs.
[0060] 3) Enhance system stability: Based on decision instructions, automatically adjust the quantity and configuration of computing resources such as cloud servers and virtual machine instances to anticipate load peaks and troughs, avoid service interruptions caused by system overload or idle resources, and improve system stability and reliability.
[0061] 4) Enhance user experience: Automatically adjust computing resources through API calls or cloud management platform interfaces, such as adding or reducing virtual machine instances or adjusting instance specifications, to quickly respond to changes in business needs, ensure stable application performance, and improve user experience.
[0062] On the other hand, the present invention also provides a dynamic scaling and optimization system 200 for clusters, such as... Figure 2 As shown, it may include: a data acquisition module 210, a deep learning prediction module 220, a dynamic policy generator 230, and an adaptive HPA enhancer 240.
[0063] Among them, the data acquisition module 210 is, for example, a monitoring module, used to acquire multi-dimensional monitoring indicators related to load parameters and business metrics. It can monitor and continuously collect service operation data in real time to ensure the real-time performance and accuracy of the data. The business metrics include at least one business pressure signal that can quantify the pressure generated by external business requests on the cluster.
[0064] The deep learning prediction module 220 processes multi-dimensional monitoring metrics to output predictions of application load on the cluster. Specifically, this prediction module uses collected data, based on historical data and current load conditions, combined with machine learning models and algorithms, to predict service demand and future service load trends over a given period.
[0065] The dynamic strategy generator 230, acting as a decision-making module, dynamically generates the optimal scaling strategy based on a multi-objective optimization algorithm, according to the prediction results and preset scaling rules. That is, it can determine whether to increase or decrease computing resources based on the prediction results and preset scaling strategies, and calculate the specific resource adjustment amount. Furthermore, the decision-making module can automatically calculate and generate resource adjustment schemes based on the prediction results and preset scaling strategies (such as based on CPU utilization thresholds, network traffic peaks, etc.).
[0066] The Adaptive HPA Enhancer 240 acts as an execution module, performing scaling optimization operations based on scaling strategies. That is, it automatically adjusts the quantity and configuration of computing resources such as cloud servers and virtual machine instances according to the instructions of the decision module. This execution module can also automatically adjust computing resources, such as adding or removing virtual machine instances or adjusting instance specifications, based on instructions from the decision module via API calls or cloud management platform interfaces.
[0067] In addition, the optimized system 200 may also include a security and management module: ensuring data encryption, disaster recovery backup, and overall system security. The security and management module ensures data security and system stability throughout the process, while providing flexible management configuration options.
[0068] In addition, the optimization system 200 may also include a visual monitoring and tuning platform, which provides an intuitive visual interface and a user-friendly management interface, displaying information such as application load, resource usage, scaling history, and accuracy evaluation of deep learning prediction models, facilitating monitoring and configuration. This platform also supports user-defined monitoring metrics, scaling rules, and parameter tuning of deep learning models, allowing operations personnel to flexibly configure and optimize according to actual business needs.
[0069] Other beneficial effects of the dynamic scaling optimization system 200 for clusters of the present invention can be found in the above description of the dynamic scaling optimization method 100 for clusters, and will not be repeated here.
[0070] This invention also provides a machine-readable storage medium storing instructions that cause a machine to execute: a dynamic scaling optimization method for a cluster as described above.
[0071] This invention provides a processor for running a program, wherein the program is executed to perform: a dynamic scaling optimization method for clusters as described above.
[0072] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 3 As shown in the figure, the computer device may include a processor A01, a network interface A02, a display screen A04, an input device A05, and a memory (not shown) connected via a system bus. The processor A01 provides computing and control capabilities. The memory may include internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 stored in the non-volatile storage medium A06. The network interface A02 is used for communication with external terminals via a network connection. When the computer program is executed by the processor A01, it implements the dynamic scaling optimization method for the cluster described above. The display screen A04 may be a liquid crystal display (LCD) or an e-ink display. The input device A05 may be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0073] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0074] In one embodiment, the dynamic scaling and shrinking optimization method for clusters provided in this application can be implemented as a computer program, which can be implemented in various ways, such as... Figure 3The method runs on the computer device shown. The computer device's memory can store various program modules that constitute the dynamic scaling optimization method for the cluster. The computer program, composed of these program modules, causes the processor to execute the various steps of the dynamic scaling optimization method for the cluster described in the various embodiments of this application.
[0075] In one embodiment, this application also provides a computer program product that, when executed on a data processing device, is adapted to execute a program that initializes the various steps of the above-described method.
[0076] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0077] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0078] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0079] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1The functional steps specified in one or more boxes.
[0080] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0081] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0082] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0083] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, they do not mean that the applicant has used or necessarily used the solution.
[0084] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0085] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A dynamic scaling optimization method of a cluster, characterized in that, The optimization method comprises: acquiring multi-dimensional monitoring indicators related to load parameters and service indicators, wherein the service indicators comprise at least one service pressure signal capable of quantifying the pressure generated by external service requests on the cluster; processing the multi-dimensional monitoring indicators based on a deep learning prediction model to output a prediction result of application load of the cluster; generating a current optimal scale-in / out strategy based on a multi-objective optimization algorithm according to the prediction result and a preset scale-in / out rule; and performing a scale-in / out optimization operation based on the scale-in / out strategy.
2. The optimization method according to claim 1, wherein the load parameters comprise one or more of the following: CPU usage, memory usage, network bandwidth, disk I / O, Pod quantity, and application request quantity; and / or the service indicators are user-defined indicators, and the service pressure signal is a service request metric indicator with explicit service semantics and a change that precedes or synchronizes with the change of system resource load, and the service request metric indicator comprises one or more of the following: query per second, transaction processing rate, order quantity per second, real-time concurrent user quantity, and response time.
3. The optimization method of claim 1, wherein, the prediction result comprises a change trend, a peak point, and a trough point of the load.
4. The optimization method of claim 1, wherein, The training process of the deep learning prediction model comprises: dividing the preprocessed multi-dimensional monitoring indicators into a training set, a validation set, and a test set in chronological order; selecting an initial model, and performing hyperparameter optimization on the learning rate, batch size, number of hidden layer nodes, and number of layers of the initial model by means of grid search, random search, or Bayesian optimization; training the model using data in the training set and determining a loss function value of each training; and adjusting model parameters by means of a back propagation algorithm and an optimizer to determine a target model with minimized loss function value.
5. The optimization method of claim 4, wherein, The training process of the deep learning prediction model further comprises: ending the training process when the performance of the validation set no longer improves; and / or iteratively optimizing the deep learning prediction model according to execution feedback of a prediction service in which the target model is deployed.
6. The optimization method of claim 4, wherein, The preprocessing comprises data cleaning, normalization processing, and feature extraction. The initial model is used to process data with time series characteristics, and comprises a support vector machine model, a random forest model, RNN, LSTM, and GRU.
7. The optimization method of claim 1, wherein, The scale-in / out rule comprises: load threshold, scale-in / out ratio, and current resource usage; and user-defined constraint conditions, including maximum Pod quantity, minimum Pod quantity, and resource limit.
8. The optimization method of claim 1, wherein, The cluster is a Kubernetes, and performing the scale-in / out operation based on the scale-in / out strategy comprises: dynamically adjusting the number of Pod replicas by means of HPA and replacing Pod instances one by one in a rolling update manner. 9.A dynamic scaling optimization system for clusters, characterized in that, The optimization system comprises: a data acquisition module configured to acquire multi-dimensional monitoring indicators related to load parameters and service indicators, wherein the service indicators comprise at least one service pressure signal capable of quantifying the pressure generated by external service requests on the cluster; a deep learning prediction module, configured to process the multi-dimensional monitoring indicators to output a prediction result of application load of the cluster; a dynamic strategy generator, configured to dynamically generate a current optimal scale-out / in strategy based on a multi-objective optimization algorithm according to the prediction result and a preset scale-out / in rule; and an adaptive HPA enhancer, configured to perform a scale-out / in optimization operation based on the scale-out / in strategy.
10. A machine-readable storage medium, characterized in that, The machine readable storage medium has instructions stored thereon for causing a machine to perform the dynamic scale-out / in optimization method of the cluster according to any one of claims 1-8.
11. A processor, comprising: A program for running, wherein the program is used to perform the dynamic scale-out / in optimization method of the cluster according to any one of claims 1-8 when the program is run.
12. A computer program product comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the dynamic scale-out / in optimization method of the cluster according to any one of claims 1-8.