Elastic capacity expansion and contraction method and device, electronic equipment and storage medium

By collecting multi-dimensional data in a microservice architecture and using the LSTM model for load prediction and cost optimization, the problem of response lag and accuracy in scaling up and down in a microservice architecture is solved, and dynamic resource scheduling and business stability are achieved.

CN121705006APending Publication Date: 2026-03-20FENGLING CHUANGJING (BEIJING) TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-29
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

In existing microservice architectures, scaling operations suffer from slow response times and low accuracy, making it difficult to effectively handle sudden traffic surges and causing business disruptions.

Method used

By collecting data from infrastructure, business, and cloud platforms, multi-level load prediction is performed using a pre-trained LSTM time series model to generate scaling recommendations, and resource combination schemes are generated based on a cost database for dynamic resource scheduling.

Benefits of technology

It improves the accuracy and foresight of scaling up and down, achieves a balance between resource utilization and cost expenditure, and ensures service stability and flexible response to sudden traffic surges.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121705006A_ABST
    Figure CN121705006A_ABST
Patent Text Reader

Abstract

The invention provides an elastic capacity expansion and contraction method and device, electronic equipment and a storage medium, and the method comprises the steps: collecting target index data, including an infrastructure index, a business index and cloud platform data, outputting load prediction results in different durations for the target index data through employing a target time sequence model, and generating a target capacity expansion and contraction suggestion based on the load prediction results in the different time lengths, and generating a target resource combination scheme meeting the target capacity expansion and contraction suggestion according to a cost database so as to schedule resources according to the target resource combination scheme. The dynamic load prediction model is constructed by fusing infrastructure indexes, business indexes and cloud platform real-time data, the limitation of traditional single-index monitoring is broken through, load prediction results of different time lengths are generated through a target time sequence model, an accurate basis is provided for elastic scaling decision, and the perspectiveness and accuracy of resource capacity expansion and contraction are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of capacity expansion and contraction technology, and in particular to a flexible capacity expansion and contraction method, apparatus, electronic device, and storage medium. Background Technology

[0002] Currently, microservice architecture is widely used. Microservice architecture is an architectural pattern that breaks down a monolithic application into multiple independently deployed, loosely coupled small services (such as payment services and user services), each of which can be scaled independently. Currently, scaling operations for services in a microservice architecture are typically triggered based on resource thresholds or by performing simple time-series predictions (such as ARIIMA) based on service resource usage to trigger the scaling process.

[0003] However, the method of triggering scaling up or down based on resource thresholds has a response lag problem, that is, it only triggers scaling up after the monitored indicators exceed the limit, which cannot cope with sudden traffic and cause business damage; the method of triggering scaling up or down based on simple time-series prediction of service resource usage (such as ARIIMA) is usually less accurate. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a method, apparatus, electronic device, and storage medium for flexible scaling to improve the accuracy of flexible scaling and thus improve the stability of service operation.

[0005] According to one aspect of the present invention, a method for flexible expansion and contraction is provided, characterized in that the method comprises: Based on preset indicator information, target indicator data for the target business are collected, wherein the preset indicator information includes infrastructure indicators, business indicators, and cloud platform data. The target index data is output to a pre-trained target time series model, and the target prediction results output by the target time series model are obtained, wherein the target prediction results include load prediction results for at least two different time periods. Based on the target prediction results, a target scaling recommendation is generated, wherein the target scaling recommendation includes the target scaling type and the target scaling capacity; Based on the cost database, a target resource combination scheme that meets the target scaling recommendation is generated, wherein the cost database includes instance cost, network cost, and license cost; Resource scheduling is performed according to the target resource combination scheme.

[0006] In one possible embodiment, the method further includes: Based on the correlation between the traffic peak of the target service and each of the preset indicator information, the weight of each of the target indicator data is set; The target index data, weighted according to the weights, is input into the target time series model.

[0007] In one possible embodiment, the target time series model is constructed based on an LSTM model. The target time series model includes multiple output heads, each output head being used to output load prediction results for different durations. The target time series model outputs the target prediction results through the following steps: The load prediction result within a first preset time period is output through the first output head; The load prediction result within a second preset time period is output through the second output head; The load prediction results within the third preset time period are output through the third output head.

[0008] In one possible embodiment, generating target scaling recommendations based on the target prediction results includes: Based on the historical scaling records of the target service, determine the correspondence between the load change trend of the target service and the scaling step size; Based on the correspondence between the load change trend and the scaling step size, the target scaling recommendation is generated according to the target prediction result.

[0009] In one possible embodiment, generating a target resource combination scheme that satisfies the target scaling recommendation based on a cost database includes: Based on the cost database and the attributes of the target business, multiple candidate resource combination schemes that meet the target scaling recommendations are generated; wherein, the attributes of the target business include whether it is a core business; Based on the operational strategy of the target business, candidate resource combinations that conform to the operational strategy are determined as the target resource solutions, wherein the operational strategy includes cost priority or performance priority.

[0010] In one possible embodiment, the method further includes: Monitor system resource status, and in the event of a node-level failure of the system resources, migrate each service instance in the failed node to other nodes within the system; In the event of an abnormal overall cluster load in the system, the resource allocation priority of each service is determined based on the priority of each service, and resources are allocated to each service according to the resource allocation priority. In the event of a regional failure in the system, services in the affected region will be migrated across the cloud.

[0011] According to another aspect of the present invention, a flexible expansion / contraction device is provided, the device comprising: The data acquisition module is used to collect target indicator data of the target business based on preset indicator information, wherein the preset indicator information includes infrastructure indicators, business indicators and cloud platform data. The prediction module is used to output the target indicator data to a pre-trained target time series model and obtain the target prediction result output by the target time series model, wherein the target prediction result includes at least two load prediction results within two different time periods. The suggestion module is used to generate target scaling suggestions based on the target prediction results, wherein the target scaling suggestions include target scaling type and target scaling capacity; The generation module is used to generate a target resource combination scheme that meets the target scaling recommendation based on a cost database, wherein the cost database includes instance cost, network cost, and license cost; The scheduling module is used to schedule resources according to the target resource combination scheme.

[0012] In one possible embodiment, the device further includes: The weighting module is used to set the weights of each target indicator data based on the correlation between the traffic peak of the target service and each preset indicator information; and to input the target indicator data weighted according to the weights into the target time series model. The target time series model is constructed based on an LSTM model and contains multiple output heads, each of which outputs load prediction results for different time periods. The target time series model outputs the target prediction results through the following steps: The load prediction result within a first preset time period is output through the first output head; The load prediction result within a second preset time period is output through the second output head; The load prediction results within a third preset time period are output through the third output head; The step of generating target scaling recommendations based on the target prediction results includes: Based on the historical scaling records of the target service, determine the correspondence between the load change trend of the target service and the scaling step size; Based on the correspondence between the load change trend and the scaling step size, and the target prediction results, a target scaling suggestion is generated. The step of generating a target resource combination scheme that satisfies the target scaling recommendation based on the cost database includes: Based on the cost database and the attributes of the target business, multiple candidate resource combination schemes that meet the target scaling recommendations are generated; wherein, the attributes of the target business include whether it is a core business; Based on the operational strategy of the target business, candidate resource combinations that conform to the operational strategy are determined as the target resource solution, wherein the operational strategy includes cost priority or performance priority; The device further includes: a monitoring module, used to monitor the status of system resources, and in the event of a node-level failure of the system resources, to migrate each service instance in the node that failed to the system to other nodes in the system; In the event of an abnormal overall cluster load in the system, the resource allocation priority of each service is determined based on the priority of each service, and resources are allocated to each service according to the resource allocation priority. In the event of a regional failure in the system, services in the affected region will be migrated across the cloud.

[0013] According to another aspect of the present invention, an electronic device is provided, comprising: Processor; and Stored program memory, The program includes instructions that, when executed by the processor, cause the processor to perform any of the above-described flexible scaling methods.

[0014] According to another aspect of the present invention, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to perform any of the above-described flexible scaling methods.

[0015] One or more technical solutions provided in this invention collect target indicator data for target businesses based on preset indicator information, including infrastructure indicators, business indicators, and cloud platform data. The target indicator data is input into a pre-trained target time-series model. The target time-series model can output load prediction results for different time periods based on the target indicator data. Based on these load prediction results, corresponding target scaling recommendations are generated. Furthermore, a target resource combination scheme that meets the target scaling recommendations is generated based on a cost database, and resources are scheduled according to this target resource combination scheme. By applying this invention, a dynamic load prediction model is constructed by integrating infrastructure indicators, business indicators, and real-time cloud platform data, overcoming the limitations of traditional single-indicator monitoring. The generation of load prediction results for different time periods through the target time-series model provides accurate basis for elastic scaling decisions, significantly improving the foresight and accuracy of resource scaling. Moreover, by generating a target resource combination scheme that meets the target scaling recommendations based on a preset cost database, the target resource combination scheme takes resource costs into account, thereby achieving a balance between resource utilization and cost expenditure. Attached Figure Description

[0016] Further details, features, and advantages of the invention are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which: Figure 1 A schematic flowchart of a flexible expansion and contraction method provided in an embodiment of the present invention; Figure 2 A schematic diagram of a process for generating expansion / shrinkage suggestions in the flexible expansion / shrinkage method provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of a process for generating resource combinations in the flexible scaling method provided in an embodiment of the present invention. Figure 4 A schematic diagram of a system status monitoring process provided in the flexible scaling method of the present invention; Figure 5 A schematic diagram of a flexible expansion and contraction device provided in an embodiment of the present invention; Figure 6 A structural block diagram of an exemplary electronic device that can be used to implement embodiments of the present invention is shown. Detailed Implementation

[0017] Embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While some embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the invention. It should be understood that the accompanying drawings and embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the invention.

[0018] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.

[0019] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc., mentioned in this invention are used only to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.

[0020] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0021] The names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.

[0022] In related technologies, capacity elastic scaling is typically achieved through the following methods: 1. Static threshold elastic scaling (such as Kubernetes HPA) primarily triggers scaling up or down based on preset CPU / memory thresholds, for example, automatically adding nodes when CPU utilization exceeds 80%. However, this method only triggers scaling after the monitored metric exceeds the limit, resulting in a delayed response and inability to handle sudden traffic surges, leading to business disruption. Furthermore, the strategy is simplistic and does not differentiate between CPU-intensive and I / O-intensive loads, potentially leading to resource waste or insufficient performance.

[0023] 2. Simple time series forecasting schemes, which rely on historical CPU / memory data for linear or time series forecasting (such as ARIMA). This approach has a single input data type and a fixed forecast period, resulting in low accuracy of the forecast results.

[0024] 3. Cloud vendor-native solutions (such as AWS Auto Scaling Group) rely on the auto-scaling service provided by the cloud platform to support on-demand / reserved instance scheduling. Due to vendor lock-in, they typically cannot achieve unified scheduling across clouds or hybrid clouds, resulting in high migration costs. Furthermore, because they only target a single cluster or single cloud resource, they lack a global view and cannot optimize cross-region / cross-cloud resource allocation.

[0025] 4. Open-source combined solutions (such as Prometheus + Keda): This approach combines a monitoring system (Prometheus) with an elastic scaling component (Keda) to achieve dynamic scaling. This method requires the independent deployment of multiple components, resulting in high configuration and optimization costs, complex maintenance, and frequent scaling can easily cause resource fluctuations, affecting service stability and offering weak resilience against system shocks.

[0026] Based on this, the present invention provides a method, apparatus, electronic device, and storage medium for flexible scaling. The flexible scaling method provided by the present invention can be applied to any electronic device with flexible scaling function, such as a server, computer, or mobile terminal. The following describes the solution of the present invention with reference to the accompanying drawings: Figure 1 A flowchart illustrating the flexible expansion and contraction method provided in this embodiment of the invention may include the following steps: S101. Based on preset indicator information, collect target indicator data for the target business, wherein the preset indicator information includes infrastructure indicators, business indicators, and cloud platform data. S102. Output the target index data to the pre-trained target time series model and obtain the target prediction result output by the target time series model, wherein the target prediction result includes at least two load prediction results within two different time periods. S103. Generate target scaling recommendations based on the target prediction results, wherein the target scaling recommendations include target scaling type and target scaling capacity; S104. Generate a target resource combination scheme that meets the target scaling recommendation based on the cost database, wherein the cost database includes instance cost, network fee and license cost; S105. Perform resource scheduling according to the target resource combination scheme.

[0027] In this embodiment of the invention, target indicator data for the target business is collected based on preset indicator information, including infrastructure indicators, business indicators, and cloud platform data. The target indicator data is input into a pre-trained target time-series model. The target time-series model can output load prediction results for different time periods based on the target indicator data. Based on these load prediction results, corresponding target scaling recommendations are generated. Furthermore, a target resource combination scheme that meets the target scaling recommendations is generated based on a cost database, and resources are scheduled according to this target resource combination scheme. By integrating infrastructure indicators, business indicators, and real-time cloud platform data, this embodiment of the invention constructs a dynamic load prediction model, overcoming the limitations of traditional single-indicator monitoring. The generation of load prediction results for different time periods through the target time-series model provides accurate basis for elastic scaling decisions, significantly improving the foresight and accuracy of resource scaling. Moreover, by generating a target resource combination scheme that meets the target scaling recommendations based on a preset cost database, the target resource combination scheme takes resource costs into account, thereby achieving a balance between resource utilization and cost expenditure.

[0028] In S101, target indicator data can be obtained from multiple data sources based on various preset indicator information. For example, target indicator data can be obtained from system logs, monitoring tools such as Prometheus, business systems, and cloud platform systems. This target indicator data can include hardware indicators such as CPU and memory collected from the infrastructure layer; business indicator data collected from the business layer, such as key business indicators like QPS (queries per second) and order volume; and cloud platform data, including external factors such as resource supply latency and real-time pricing. In this way, by acquiring multi-dimensional data for load forecasting, the limitations of traditional single-indicator monitoring are overcome, and the accuracy of load forecasting is improved.

[0029] In one possible embodiment, before inputting the target indicator data into the target time series model, the weights of each target indicator data can be set based on the correlation between the traffic peak of the target service and each of the preset indicator information; the target indicator data weighted based on the weights is then input into the target time series model.

[0030] One possible implementation is to determine the peak traffic times for each service and obtain historical indicator data for the target service during those peak times. This historical indicator data can include infrastructure data, business data, and cloud platform data. Then, indicators whose historical indicator data exceeds the normal value during peak times can be identified, and these indicators can be assigned higher weights. The normal value of the indicator data can be the average, median, or other historical values. Another possible implementation is to assign weights to each indicator data point based on the ratio between each indicator data point and its corresponding normal value. For example, weights can be assigned from highest to lowest ratio, with the sum of the weights being 1. For instance, during e-commerce promotional periods, the impact of order volume on resource demand is significantly higher than during normal periods; therefore, the weight of order volume data can be set higher.

[0031] The target metric data and its weights are input into a pre-trained target time-series model, which then outputs corresponding load prediction results based on the target metric data. The target time-series model can be an LSTM model. In this invention, the target time-series model can output load prediction results for various time periods, such as short-term, medium-term, and long-term load prediction results. Short-term load prediction results can be for a period of 5-15 minutes, medium-term load prediction results can be for a period of 1-6 hours, and long-term load prediction results can be for a period of 24 hours. Each target time-series model can be pre-trained using historical metric data and load data after the corresponding time period. Training the target time-series model can be achieved using any feasible model training method; this invention does not impose specific limitations on this.

[0032] In one possible embodiment, the target time series model includes multiple output headers, each output header being used to output load prediction results for different durations; the target time series model outputs the target prediction results through the following steps: The load prediction result within a first preset time period is output through the first output head; The load prediction result within a second preset time period is output through the second output head; The load prediction results within the third preset time period are output through the third output head.

[0033] Each output head can be composed of a fully connected layer and Sofmax. Correspondingly, during the training process of the target time series model, the difference between the prediction results output by the three output heads and the actual load data within the corresponding time period can be calculated based on the preset loss function, and the parameters of the time series model can be adjusted based on the difference until all differences converge.

[0034] The above technical solutions enable short-term forecasting for rapid response to sudden traffic surges, triggering immediate capacity expansion; medium-term forecasting anticipates business peaks, guiding resource reservation; and long-term forecasting, combined with periodic patterns (such as daily / weekly traffic fluctuations), assists in resource procurement planning. This layered design satisfies both real-time requirements and strategic resource deployment, avoiding the rigidity of traditional fixed forecasting cycles.

[0035] In one possible implementation, the prediction engine incorporates an adaptive learning mechanism to continuously track the deviation between the prediction results and the actual load. When changes in business models are detected (such as new features altering traffic characteristics) or fluctuations in cloud platform conditions (such as increased resource supply latency), the model parameters can be automatically adjusted to ensure prediction accuracy. Simultaneously, a closed-loop feedback loop is formed with the downstream scheduling module, using historical scaling data to optimize the prediction logic and achieve continuous evolution of the overall system.

[0036] In one possible embodiment, the correspondence between the load change trend of the target service and the scaling step size can be determined based on the historical scaling records of the target service. Based on the correspondence between the load change trend and the scaling step size, the target scaling recommendation is generated according to the target prediction result.

[0037] In practical applications, the problem of scaling up and down oscillations can occur. This oscillation refers to an abnormal state in which the system repeatedly switches between over-scaling and over-scaling due to unreasonable scaling up / down strategies, delayed indicator feedback, or inappropriate threshold settings. Such oscillations severely waste resources, exacerbate system load fluctuations, and even trigger service availability issues. To overcome this problem, a dynamic adjustment algorithm based on reinforcement learning can be introduced. Specifically, by analyzing historical scaling records and current load trends, the step size of each scaling up / down can be intelligently adjusted: an aggressive scaling up strategy is used during periods of rapid load increase, while a gradual adjustment is adopted during periods of stable fluctuation. Simultaneously, considering the latency characteristics of cloud resource provisioning, a built-in buffering mechanism is incorporated to avoid repeated scaling up due to resource creation delays, fundamentally solving the vicious cycle of "scaling up - overload - re-scaling up".

[0038] like Figure 2 As shown, Figure 2This is another flowchart illustrating the elastic scaling method provided in this invention, which can include four stages: data acquisition, data preprocessing, an improved LSTM model, and triggering scaling recommendations. In the data acquisition stage, infrastructure metrics, business metrics, and cloud platform data can be collected. Infrastructure metrics may include CPU and memory, business metrics may include QPS and order volume, and cloud platform data may include price and supply latency. Data preprocessing may include deduplication, filtering of erroneous data, and formatting of the collected data. Based on the improved LSTM model, three time-scale predictions can be achieved: short-term prediction (5-15 minutes) for rapid response to sudden traffic surges and triggering immediate scaling; medium-term prediction (1-6 hours) for predicting business peaks and guiding resource reservation; and long-term prediction (24 hours). Scaling recommendations can then be triggered based on the prediction results output by the LSTM model. For example, the scaling type and quantity can be determined based on the difference between the prediction results and current resources.

[0039] The target scaling recommendation can include the target scaling type and the target scaling quantity. The target scaling type can specifically be the type of resource that needs to be scaled up or down, such as CPU or memory. This invention can generate corresponding target resource combinations based on the target scaling recommendation according to a preset cost database (cost model). The cost database can include the prices of on-demand instances, reserved instances, and spot instances, network transmission costs incurred in cross-availability zone deployments, and additional software licensing costs. The system continuously tracks price fluctuations and supply of resources on various cloud platforms, establishing a real-time updated cost database. On-demand instances are virtual machines provided by cloud service providers and billed by the hour or second, requiring no long-term commitment and suitable for temporary needs. Reserved instances are long-term cloud computing resources purchased in advance by users, with a lower unit price than on-demand instances, suitable for stable loads. Spot instances are low-cost computing resources provided by cloud service providers, with prices fluctuating with the market and potentially reclaimable, suitable for interruptible tasks.

[0040] In one possible implementation, cost-sensitive characteristics can be automatically identified for different business scenarios. For example, in online education, auction instances can be prioritized for handling non-real-time tasks, while financial transaction systems focus on on-demand instances to ensure stability. Simultaneously, deployment locations can be intelligently selected by analyzing real-time pricing and regional availability across different cloud platforms. For instance, core business operations can be deployed on a private cloud to safeguard data sovereignty, while public cloud burst capacity can be utilized to handle peak loads.

[0041] In one possible embodiment, generating a target resource combination scheme that satisfies the target scaling recommendation based on a cost database includes: Based on the cost database and the attributes of the target business, multiple candidate resource combination schemes that meet the target scaling recommendations are generated; wherein, the attributes of the target business include whether it is a core business; Based on the operational strategy of the target business, candidate resource combinations that conform to the operational strategy are determined as the target resource solutions, wherein the operational strategy includes cost priority or performance priority.

[0042] Based on load trends provided by the prediction engine, the algorithm intelligently matches the optimal resource combination scheme. For example, it automatically selects the most cost-effective spot instance for sudden short-term loads; automatically switches to long-term reserved instances for predictable continuous loads; and reserves on-demand instances as an elastic buffer for performance-sensitive services. It also supports administrators to preset cost / performance priority policies, automatically triggering alarms and switching to economic mode when budget overrun risks are detected, achieving precise control over resource allocation.

[0043] The proposed scaling recommendations can generate multiple resource combination schemes, such as various combinations of CPU and memory resources provided by different cloud vendors. For each of these resource combination schemes, a target resource combination scheme can be selected based on the operational strategy of the target business. For example, if the target business's operational strategy prioritizes cost, then the resource combination scheme with the lowest cost can be selected as the target resource combination scheme. Corresponding resource scheduling can then be performed according to this target resource combination scheme.

[0044] like Figure 3 As shown, Figure 3 This invention provides a cost-aware process within an elastic scaling method. Specifically, after obtaining the prediction results from the LSTM output, cost model calculations can be performed based on these results. This includes instance cost analysis, network fee calculation, and license cost assessment to optimize resource combinations and output the optimal resource combination. For example, for sudden short-term loads, the most cost-effective bidding instance is automatically selected; for predictable continuous loads, long-term reserved instances are automatically switched; and on-demand instances are reserved as elastic buffers for performance-sensitive services. Simultaneously, it supports administrators preset cost / performance priority policies, automatically triggering alarms and switching to economic modes when budget overrun risks are detected, achieving precise control over resource allocation.

[0045] In one possible embodiment, the method may further include: Monitor system resource status, and in the event of a node-level failure of the system resources, migrate each service instance in the failed node to other nodes within the system; In the event of an abnormal overall cluster load in the system, the resource allocation priority of each service is determined based on the priority of each service, and resources are allocated to each service according to the resource allocation priority. In the event of a regional failure in the system, services in the affected region will be migrated across the cloud.

[0046] This invention employs a layered protection strategy. At the node level, the health status of individual machines is monitored in real time, and service migration is triggered immediately upon detecting a fault. At the cluster level, when the overall load exceeds a safety threshold, non-core functions are automatically downgraded to ensure critical business operations. At the region level, for regional cloud service failures, cross-cloud switching contingency plans are quickly activated. This progressive protection system ensures that the system maintains a controllable downgraded operating state under each level of fault scenario, avoiding the crude, all-or-nothing approach of traditional solutions.

[0047] In one possible implementation, the system can continuously collect data on the actual effects of each scaling operation. When a protection strategy failure is detected (such as circuit breaker response delay) or a new abnormal pattern emerges, a strategy optimization process is automatically triggered to dynamically update the protection thresholds and response rules. This continuous evolution capability enables the system to adapt to long-term changes such as business growth and architectural changes, always maintaining optimal protection performance and overcoming the rigid limitations of traditional static rule configuration.

[0048] like Figure 4 As shown, Figure 4 This invention provides a resource status monitoring process within an elastic scaling method. This monitoring comprises two parts: a three-level circuit breaker mechanism and an anti-oscillation algorithm. The three-level circuit breaker mechanism includes node-level, cluster-level, and region-level circuit breakers. At the node level, the health status of individual machines is monitored in real time, and service migration is triggered immediately upon detecting a fault. At the cluster level, when the overall load exceeds a safety threshold, non-core functions are automatically downgraded to protect critical business operations. At the region level, for regional cloud service failures, cross-cloud switching contingency plans are quickly initiated. This progressive protection system ensures that the system maintains a controllable downgraded operating state under various fault scenarios, avoiding the crude, all-or-nothing approach of traditional solutions.

[0049] The anti-oscillation algorithm intelligently adjusts the step size of each expansion / shrinkage by analyzing historical scaling records and current load trends. For example, it adopts an aggressive scaling strategy during periods of rapid load increase and switches to a gradual adjustment during periods of stable fluctuation. Simultaneously, it incorporates a built-in buffering mechanism to address the latency characteristics of cloud resource provisioning, preventing repeated scaling due to resource creation delays and fundamentally resolving the vicious cycle of scaling up, overloading, and then scaling up again.

[0050] This invention provides a comprehensive architecture for a multi-dimensional intelligent prediction engine, breaking through the traditional single-indicator monitoring model. It constructs a prediction model by integrating infrastructure indicators, business indicators, and cloud platform data. Furthermore, through an improved LSTM neural network structure design and its short-, medium-, and long-term hierarchical prediction mechanism, it achieves a technological upgrade from passive response to proactive prediction.

[0051] Furthermore, this invention provides a cost-optimal elastic scheduling decision system. Through an innovative dynamic cost optimization algorithm, it establishes a comprehensive calculation model based on multi-dimensional prediction results, encompassing the costs of on-demand instances, reserved instances, spot instances, and cross-cloud network fees. It also provides decision logic for automatically selecting the optimal resource combination based on load characteristics, as well as a dynamic cost budget control method, achieving the best balance between resource utilization and cost expenditure.

[0052] Furthermore, this invention provides an intelligent anti-oscillation security scaling mechanism, including a three-level circuit breaker protection system (node / cluster / region) and a dynamic step size adjustment algorithm based on reinforcement learning. It also incorporates a buffer design that considers resource supply latency and a gradual degradation strategy in case of system anomalies, effectively solving the "scaling-down oscillation" and sudden overload problems in traditional solutions, ensuring service stability while improving resource scheduling efficiency.

[0053] Based on the same inventive concept, the present invention also provides an elastic expansion and contraction device, such as... Figure 5 As shown, the device 500 may include: The data acquisition module 501 is used to collect target indicator data of the target business based on preset indicator information, wherein the preset indicator information includes infrastructure indicators, business indicators and cloud platform data. The prediction module 502 is used to output the target index data to a pre-trained target time series model and obtain the target prediction result output by the target time series model, wherein the target prediction result includes at least two load prediction results within two different time periods. The suggestion module 503 is used to generate target scaling suggestions based on the target prediction results, wherein the target scaling suggestions include target scaling type and target scaling capacity; The generation module 504 is used to generate a target resource combination scheme that meets the target scaling recommendation based on the cost database, wherein the cost database includes instance cost, network cost and license cost; The scheduling module 505 is used to schedule resources according to the target resource combination scheme.

[0054] In one possible embodiment, the device further includes: The weighting module is used to set the weights of each target indicator data based on the correlation between the traffic peak of the target service and each preset indicator information; and to input the target indicator data weighted according to the weights into the target time series model. The target time series model is constructed based on an LSTM model and contains multiple output heads, each of which outputs load prediction results for different time periods. The target time series model outputs the target prediction results through the following steps: The load prediction result within a first preset time period is output through the first output head; The load prediction result within a second preset time period is output through the second output head; The load prediction results within a third preset time period are output through the third output head; The step of generating target scaling recommendations based on the target prediction results includes: Based on the historical scaling records of the target service, determine the correspondence between the load change trend of the target service and the scaling step size; Based on the correspondence between the load change trend and the scaling step size, and the target prediction results, a target scaling suggestion is generated. The step of generating a target resource combination scheme that satisfies the target scaling recommendation based on the cost database includes: Based on the cost database and the attributes of the target business, multiple candidate resource combination schemes that meet the target scaling recommendations are generated; wherein, the attributes of the target business include whether it is a core business; Based on the operational strategy of the target business, candidate resource combinations that conform to the operational strategy are determined as the target resource solution, wherein the operational strategy includes cost priority or performance priority; The device further includes: a monitoring module, used to monitor the status of system resources, and in the event of a node-level failure of the system resources, to migrate each service instance in the node that failed to the system to other nodes in the system; In the event of an abnormal overall cluster load in the system, the resource allocation priority of each service is determined based on the priority of each service, and resources are allocated to each service according to the resource allocation priority. In the event of a regional failure in the system, services in the affected region will be migrated across the cloud.

[0055] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in this invention comply with relevant laws and regulations and do not violate public order and good morals.

[0056] An exemplary embodiment of the present invention also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to cause the electronic device to perform a method according to an embodiment of the present invention.

[0057] An exemplary embodiment of the present invention also provides a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform a method according to an embodiment of the present invention.

[0058] An exemplary embodiment of the present invention also provides a computer program product, including a computer program, wherein, when executed by a computer's processor, the computer program is used to cause the computer to perform a method according to an embodiment of the present invention.

[0059] refer to Figure 6 The present invention will now be described in the form of a structural block diagram of an electronic device 600 that can serve as a server or client of the present invention, which is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0060] like Figure 6 As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. The RAM 603 may also store various programs and data required for the operation of the electronic device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0061] Multiple components in electronic device 600 are connected to I / O interface 605, including: input unit 606, output unit 607, storage unit 608, and communication unit 609. Input unit 606 can be any type of device capable of inputting information to electronic device 600. Input unit 606 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device. Output unit 607 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 608 may include, but is not limited to, disks and optical discs. Communication unit 609 allows electronic device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth™ devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.

[0062] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above. For example, in some embodiments, any of the flexible scaling methods described above can be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 600 via ROM 602 and / or communication unit 609. In some embodiments, the computing unit 601 can be configured to perform any of the flexible scaling methods described above by any other suitable means (e.g., by means of firmware).

[0063] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0064] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0065] As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0066] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0067] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0068] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other.

Claims

1. A method for elastic expansion and contraction, characterized in that, The method includes: Based on preset indicator information, target indicator data for the target business are collected, wherein the preset indicator information includes infrastructure indicators, business indicators, and cloud platform data. The target index data is output to a pre-trained target time series model, and the target prediction results output by the target time series model are obtained, wherein the target prediction results include load prediction results for at least two different time periods. Based on the target prediction results, a target scaling recommendation is generated, wherein the target scaling recommendation includes the target scaling type and the target scaling capacity; Based on the cost database, a target resource combination scheme that meets the target scaling recommendation is generated, wherein the cost database includes instance cost, network cost, and license cost; Resource scheduling is performed according to the target resource combination scheme.

2. The method according to claim 1, characterized in that, The method further includes: Based on the correlation between the traffic peak of the target service and each of the preset indicator information, the weight of each of the target indicator data is set; The target index data, weighted according to the weights, is input into the target time series model.

3. The method according to claim 1, characterized in that, The target time series model is constructed based on an LSTM model and contains multiple output heads, each of which outputs load prediction results for different time periods. The target time series model outputs the target prediction results through the following steps: The load prediction result within a first preset time period is output through the first output head; The load prediction result within a second preset time period is output through the second output head; The load prediction results within the third preset time period are output through the third output head.

4. The method according to claim 1, characterized in that, The step of generating target scaling recommendations based on the target prediction results includes: Based on the historical scaling records of the target service, determine the correspondence between the load change trend of the target service and the scaling step size; Based on the correspondence between the load change trend and the scaling step size, the target scaling recommendation is generated according to the target prediction result.

5. The method according to claim 1, characterized in that, The step of generating a target resource combination scheme that satisfies the target scaling recommendation based on the cost database includes: Based on the cost database and the attributes of the target business, multiple candidate resource combination schemes that meet the target scaling recommendations are generated; wherein, the attributes of the target business include whether it is a core business; Based on the operational strategy of the target business, candidate resource combinations that conform to the operational strategy are determined as the target resource solutions, wherein the operational strategy includes cost priority or performance priority.

6. The method according to claim 1, characterized in that, The method further includes: Monitor system resource status, and in the event of a node-level failure of the system resources, migrate each service instance in the failed node to other nodes within the system; In the event of an abnormal overall cluster load in the system, the resource allocation priority of each service is determined based on the priority of each service, and resources are allocated to each service according to the resource allocation priority. In the event of a regional failure in the system, services in the affected region will be migrated across the cloud.

7. A flexible expansion / contraction device, characterized in that, The device includes: The data acquisition module is used to collect target indicator data of the target business based on preset indicator information, wherein the preset indicator information includes infrastructure indicators, business indicators and cloud platform data. The prediction module is used to output the target indicator data to a pre-trained target time series model and obtain the target prediction result output by the target time series model, wherein the target prediction result includes at least two load prediction results within two different time periods. The suggestion module is used to generate target scaling suggestions based on the target prediction results, wherein the target scaling suggestions include target scaling type and target scaling capacity; The generation module is used to generate a target resource combination scheme that meets the target scaling recommendation based on a cost database, wherein the cost database includes instance cost, network cost, and license cost; The scheduling module is used to schedule resources according to the target resource combination scheme.

8. The apparatus according to claim 7, characterized in that, The device further includes: The weighting module is used to set the weights of each target indicator data based on the correlation between the traffic peak of the target service and each preset indicator information; and to input the target indicator data weighted according to the weights into the target time series model. The target time series model is constructed based on an LSTM model and contains multiple output heads, each of which outputs load prediction results for different time periods. The target time series model outputs the target prediction results through the following steps: The load prediction result within a first preset time period is output through the first output head; The load prediction result within a second preset time period is output through the second output head; The load prediction results within a third preset time period are output through the third output head; The step of generating target scaling recommendations based on the target prediction results includes: Based on the historical scaling records of the target service, determine the correspondence between the load change trend of the target service and the scaling step size; Based on the correspondence between the load change trend and the scaling step size, and the target prediction results, a target scaling suggestion is generated. The step of generating a target resource combination scheme that satisfies the target scaling recommendation based on the cost database includes: Based on the cost database and the attributes of the target business, multiple candidate resource combination schemes that meet the target scaling recommendations are generated; wherein, the attributes of the target business include whether it is a core business; Based on the operational strategy of the target business, candidate resource combinations that conform to the operational strategy are determined as the target resource solution, wherein the operational strategy includes cost priority or performance priority; The device further includes: a monitoring module, used to monitor the status of system resources, and in the event of a node-level failure of the system resources, to migrate each service instance in the node that failed to the system to other nodes in the system; In the event of an abnormal overall cluster load in the system, the resource allocation priority of each service is determined based on the priority of each service, and resources are allocated to each service according to the resource allocation priority. In the event of a regional failure in the system, services in the affected region will be migrated across the cloud.

9. An electronic device, comprising: processor; as well as Stored program memory, The program includes instructions that, when executed by the processor, cause the processor to perform the method according to any one of claims 1-6.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-6.