Micro-service and low-code platform application autonomous extension method

By deploying a distributed monitoring agent and a multi-layered cross-attention LSTM neural network in a microservice cluster, combined with an improved genetic algorithm and cache synchronization technology, the problem of autonomous scaling up and down of the microservice cluster under dynamic load changes is solved. This achieves accurate load prediction and optimized resource scheduling, improving the system's response speed and stability.

CN121233339AActive Publication Date: 2025-12-30BEIJING NANCAL RUIYUAN DIGITAL TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202511767268.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2025-12-30
Estimated Expiration
2045-11-28

AI Technical Summary

Technical Problem

Microservice clusters cannot achieve accurate prediction and autonomous scaling optimization in environments with dynamic load changes, resulting in system response delays and unreasonable resource allocation.

Method used

By deploying a distributed monitoring agent, load prediction values ​​are generated using the STL decomposition algorithm and a multi-level cross-attention LSTM neural network. An improved genetic algorithm is combined to optimize container scheduling. Vector clocks and Merkle trees are used to maintain cache consistency. Information is synchronized using the gossip protocol. Rapid deployment is achieved through service warm-up pools and copy-on-write technology.

Benefits of technology

It achieves accurate prediction of load for the next 30 minutes, optimizes container scheduling strategies, improves the system's autonomous resource management and performance, reduces scaling latency, and ensures the system's real-time response and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121233339A_ABST
    Figure CN121233339A_ABST
Patent Text Reader

Abstract

The invention provides a micro-service and low-code platform application autonomous extension method, and belongs to the technical field of micro-services. Performing three-dimensional decomposition on the time series data by using an STL decomposition algorithm, inputting the decomposed time series data into a multi-level cross attention LSTM neural network to generate a load prediction value in the future 30 minutes, calculating a capacity expansion and contraction demand according to a difference value between a prediction result and a current resource utilization rate, and generating a scheduling instruction; a pre-constructed layered mirror image cache, a copy-on-write technology and a service preheating pool are utilized to realize quick start deployment of a container, and a self-adaptive optimization closed loop is formed by monitoring a capacity expansion and contraction effect in real time and adjusting neural network parameters. The technical problem that a micro-service cluster cannot realize accurate prediction and autonomous capacity expansion and contraction optimization in a dynamic load change environment is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of microservice technology, and more specifically, relates to a method for autonomously extending microservices and low-code platform applications. Background Technology

[0002] In the rapid development of microservice architectures and low-code platforms, traditional scaling technologies primarily rely on threshold-triggered passive response mechanisms. These mechanisms trigger scaling operations by setting fixed thresholds such as CPU utilization and memory usage, while employing static load balancing algorithms for resource allocation and container scheduling. This approach has been widely adopted in cloud-native application deployments. However, traditional threshold-triggered scaling methods lack the ability to predict future load changes, only making passive adjustments after resource bottlenecks occur, leading to system lag and an inability to prepare resources in advance. Furthermore, existing static scheduling algorithms cannot dynamically optimize container allocation strategies based on real-time load characteristics, easily resulting in unreasonable resource configuration when facing complex and ever-changing business loads. In other words, existing technologies suffer from the technical challenge of preventing microservice clusters from achieving accurate prediction and autonomous scaling optimization in dynamic load environments. Summary of the Invention

[0003] In view of this, the present invention provides a method for autonomous scaling of microservices and low-code platform applications, which can solve the technical problem in the prior art that microservice clusters cannot achieve accurate prediction and autonomous scaling optimization under dynamic load change environments.

[0004] This invention is implemented as follows: It provides a method for autonomous scaling of microservices and low-code platform applications, including deploying a distributed monitoring agent on each node of the microservice cluster to collect data such as CPU utilization, memory usage, network throughput, disk I / O rate, request response time, concurrent connections, and queue length. The monitoring agent stores this data in a time-series database. The collected time-series data is decomposed in three dimensions using an STL decomposition algorithm. The decomposition results are input into a pre-trained multi-layered cross-attention LSTM neural network to generate load prediction values. Scaling / scaling requirements are calculated based on the difference between the load prediction values ​​and the current resource utilization, generating scaling / scaling instructions. An improved genetic algorithm is initiated to optimize the container scheduling scheme and calculate the optimal scheduling strategy. A vector clock mechanism is used to track changes in the hierarchical cache state, and a Merkle tree structure is constructed to detect cache data consistency. When inconsistency is detected, gossip protocol is used to propagate update information, and a read repair mechanism is initiated to maintain distributed cache synchronization. When starting container instances, a pre-built hierarchical image cache is used, employing copy-on-write technology to select hot standby instances from the service preheating pool for deployment. The execution effect of scaling / scaling operations is monitored in real time, forming an adaptive optimization closed loop.

[0005] The STL decomposition algorithm performs three-dimensional decomposition on the collected time series data, specifically a three-dimensional decomposition of trend components, periodic components, and random components. The STL decomposition algorithm is a time series decomposition algorithm that decomposes time series data into three components: trend components, periodic components, and random components, and is used to analyze the long-term trend and periodic change patterns of the data.

[0006] The multi-level cross-attention LSTM neural network learns time-dependent relationships and determines the weight parameters of the multi-head cross-attention mechanism based on the CPU utilization rate change, peak memory usage, and network throughput variance to generate load prediction values ​​for the next 30 minutes. Specifically, the input layer receives the trend component, periodic component, and random component output by the STL decomposition algorithm, which are processed through 3 layers of LSTM hidden layers, each containing 128 neuron units. The multi-head cross-attention mechanism sets up 8 attention heads, and the attention heads exchange information through a linear transformation matrix.

[0007] In this multi-level cross-attention LSTM neural network, weight sharing is achieved through a weight sharing matrix. In the hierarchical attention propagation mechanism, the lower-level attention output is used as the bias parameter for the upper-level attention calculation. In the multi-head cross-attention mechanism, information exchange between attention heads is achieved by performing a dot product operation between the query vector of the i-th attention head and the key vector of the j-th attention head. Weight sharing is achieved by all attention heads sharing the same linear transformation parameter matrix. In the hierarchical attention propagation mechanism, the weighted sum of the attention weight outputs of the l-th layer is used as the input of the bias term of the (l+1)-th layer.

[0008] Specifically, when calculating the scaling up or down requirement based on the difference between the load forecast and the current resource utilization, a scaling up decision is triggered when the load forecast exceeds 80% of the current capacity, and a scaling down decision is triggered when the load forecast is less than 30% of the current capacity, generating scaling up or down instructions that include the required number of instances and resource specifications.

[0009] The improved genetic algorithm uses a three-layer encoding structure to represent node allocation, resource allocation, and service configuration. It employs an adaptive crossover mutation strategy and an elite retention mechanism, combined with a simulated annealing algorithm. The steps for establishing the training dataset for the multi-level cross-attention LSTM neural network are as follows: collect CPU utilization, memory usage, network throughput, disk I / O rate, request response time, concurrent connections, and queue length data of the microservice cluster over the past 6 months, and construct training samples according to a time window size of 60 minutes and a sliding step size of 5 minutes.

[0010] Specifically, when monitoring the execution effect of scaling up and down operations in real time, the deviation rate between the actual load and the predicted load value is calculated. When the deviation rate exceeds 15%, the weight parameters of the multi-level cross-attention LSTM neural network are adjusted. When the resource utilization rate deviates from the target range by more than 10%, the scheduling strategy is recalculated. The multi-level cross-attention LSTM neural network is trained using the Adam optimizer for backpropagation training, with a learning rate of 0.001, a batch size of 32, a training epoch of 200 epochs, and a mean squared error loss function.

[0011] The periodic component specifically refers to the component in time series data that has a fixed periodic repetition pattern, reflecting the regular changes of the system within a fixed time interval.

[0012] Specifically, the three-layer coding structure includes a node coding layer representing the physical nodes deployed in the container, a resource coding layer representing the CPU and memory resource allocation scheme, and a configuration coding layer representing the service running parameter settings.

[0013] Specifically, the adaptive crossover and mutation strategy dynamically adjusts the crossover and mutation probabilities based on the evolutionary stage of the population. In the early stages of evolution, a higher crossover probability is used to promote global search, while in the later stages of evolution, a higher mutation probability is used for local optimization.

[0014] Specifically, the elite retention mechanism involves retaining the individuals with the highest fitness in each generation of the genetic algorithm to directly enter the next generation, thereby accelerating the algorithm's convergence to the optimal solution.

[0015] Specifically, the simulated annealing algorithm controls the probability of accepting a solution by introducing a temperature parameter. Initially, at high temperatures, it accepts poorer solutions to increase search diversity, and as the temperature decreases, it gradually reduces the probability of accepting poorer solutions.

[0016] Specifically, the vector clock is a logical clock mechanism used in a distributed system to determine the order of events. Each node maintains a vector to record its own logical time and that of other nodes, which is used to detect the causal relationship of events.

[0017] The Merkle tree is specifically a binary hash tree structure, where leaf nodes store the hash value of data blocks, non-leaf nodes store the hash values ​​of child nodes, and the root node hash value is used to verify the integrity and consistency of the entire dataset.

[0018] Specifically, the gossip protocol is a distributed communication protocol in which nodes randomly select other nodes to propagate information, which has high reliability and fault tolerance, and the information is eventually propagated to all nodes to achieve network-wide synchronization.

[0019] Specifically, the read repair mechanism is a repair process triggered when inconsistencies are detected during data reading. It compares multiple replica data, selects the latest version, and synchronizes the latest data to other replica nodes. The copy-on-write technology is a memory management optimization technique in which multiple processes share the same memory page, and the page content is copied only during write operations. The service preheating pool is a set of container instances that have been pre-started and initialized, and the container instances have completed application loading and dependency initialization.

[0020] This invention addresses the technical challenge of accurate load prediction and autonomous scaling optimization in microservice clusters under dynamic load changes by constructing a load prediction model based on STL decomposition and a multi-level cross-attention LSTM neural network, combined with an improved genetic algorithm-optimized container scheduling mechanism, and distributed cache synchronization and service warm-up pool technologies. The invention uses the STL decomposition algorithm to decompose time-series data into trend, periodic, and random components. Through a multi-level cross-attention LSTM neural network learning complex time dependencies, it achieves accurate load prediction for the next 30 minutes, overcoming the lag problem of traditional passive response mechanisms. Simultaneously, it utilizes an improved genetic algorithm combined with simulated annealing technology to optimize container scheduling strategies, avoiding the limitations of static algorithms in dynamic environments. Through the synergistic effect of predictive scaling and intelligent scheduling optimization, this invention fundamentally solves the problem of traditional methods' inability to proactively adapt to load changes, achieving autonomous resource management and performance optimization for microservice clusters. Attached Figure Description

[0021] Figure 1 This is a flowchart of the method of the present invention.

[0022] Figure 2 This is a clock change diagram of the distributed cache state vector in the embodiment.

[0023] Figure 3 The diagram shows the load and response time variation of the microservice cluster in the embodiment, including two sub-diagrams: (A) is the load variation over time, and (B) is the response time variation over time. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.

[0025] like Figure 1 The diagram shown is a flowchart of a method for autonomously extending microservices and low-code platform applications provided by this invention. This method includes the following steps:

[0026] S01. Deploy a distributed monitoring agent on each node of the microservice cluster to collect resource indicators such as CPU utilization, memory usage, network throughput, and disk I / O rate, and record business indicators such as request response time, concurrent connection count, and queue length. The monitoring agent collects data once per second and stores it in a time-series database.

[0027] S02. The collected time-series data is decomposed into three dimensions, namely trend component, periodic component and random component, using the STL decomposition algorithm. Then, the decomposition results are input into a pre-trained multi-level cross-attention LSTM neural network to learn the time dependency relationship. The multi-level cross-attention LSTM neural network determines the weight parameters of the multi-head cross-attention mechanism based on the CPU utilization rate change, the peak memory usage rate and the network throughput variance, and generates the load prediction value for the next 30 minutes.

[0028] S03. Calculate the scaling up / down requirements based on the difference between the load forecast and the current resource utilization. When the load forecast exceeds 80% of the current capacity, a scaling up decision is triggered. When the load forecast is less than 30% of the current capacity, a scaling down decision is triggered. Generate scaling up / down instructions containing the required number of instances and resource specifications.

[0029] S04. Start the improved genetic algorithm to optimize the container scheduling scheme. Use a three-layer coding structure to represent node allocation, resource allocation and service configuration. Use an adaptive crossover mutation strategy and elite retention mechanism. Combine simulated annealing algorithm to avoid local optima and calculate the optimal scheduling strategy.

[0030] S05. Track the hierarchical cache state changes based on the vector clock mechanism, construct a Merkle tree structure to quickly detect cache data consistency, use the gossip protocol to propagate update information when inconsistency is detected, start the read repair mechanism to ensure eventual consistency, and maintain distributed cache synchronization.

[0031] S06. When starting a container instance, a pre-built tiered image cache is used, and copy-on-write technology is adopted to reduce disk I / O overhead. Hot standby instances are selected from the service preheating pool for rapid deployment, reducing the cold start time from the traditional 30 seconds to less than 5 seconds.

[0032] S07. Monitor the execution effect of scaling up and down operations in real time, calculate the deviation rate between the actual load and the predicted load value, adjust the weight parameters of the multi-level cross-attention LSTM neural network when the deviation rate is >15%, and recalculate the scheduling strategy when the resource utilization rate deviates from the target range by >10%, forming an adaptive optimization closed loop.

[0033] Among them, the STL decomposition algorithm is a time series decomposition algorithm used to decompose time series data into three components: trend component, periodic component, and random component, which facilitates the analysis of the long-term trend and periodic change pattern of the data.

[0034] The structure of the multi-level cross-attention LSTM neural network is as follows: the input layer receives the trend component, periodic component, and random component output by the STL decomposition algorithm, which are processed by three LSTM hidden layers, each containing 128 neuron units. The multi-head cross-attention mechanism sets up eight attention heads, which exchange information through a linear transformation matrix and share weights through a weight sharing matrix. In the hierarchical attention propagation mechanism, the lower-level attention output is used as the bias parameter for the upper-level attention calculation. The output layer generates the load prediction value for the next 30 minutes. In the multi-head cross-attention mechanism, the information exchange between attention heads is achieved by performing a dot product operation between the query vector of the i-th attention head and the key vector of the j-th attention head. Weight sharing is achieved by all attention heads sharing the same linear transformation parameter matrix. In the hierarchical attention propagation mechanism, the weighted sum of the attention weight outputs of the l-th layer is used as the input of the bias term of the (l+1)-th layer.

[0035] The steps for establishing the training dataset for the multi-level cross-attention LSTM neural network include: collecting CPU utilization, memory usage, network throughput, disk I / O rate, request response time, concurrent connections, and queue length data of the microservice cluster over the past 6 months; constructing training samples with a time window size of 60 minutes and a sliding step size of 5 minutes; using the data from the first 55 minutes as input features and the data from the last 30 minutes as prediction targets; and generating a total of 50,000 training samples and 10,000 validation samples.

[0036] The training steps of the multi-level cross-attention LSTM neural network include: backpropagation training using the Adam optimizer, with a learning rate of 0.001, a batch size of 32, a training epoch of 200 epochs, and mean squared error loss as the loss function. Training is stopped early when the validation set loss does not decrease for 10 consecutive epochs. After training, the network weight parameters are saved for load prediction.

[0037] Among them, periodic components refer to components in time series data that have a fixed periodic repetition pattern, reflecting the regular changes of the system within a fixed time interval.

[0038] The three-layer coding structure includes a node coding layer representing the physical nodes where the container is deployed, a resource coding layer representing the resource allocation scheme such as CPU and memory, and a configuration coding layer representing the service running parameter settings.

[0039] Among them, the adaptive crossover and mutation strategy dynamically adjusts the crossover and mutation probabilities according to the evolutionary stage of the population. In the early stage of evolution, a higher crossover probability is used to promote global search, and in the later stage of evolution, a higher mutation probability is used for local optimization.

[0040] Among them, the elite retention mechanism retains a number of individuals with the highest fitness in each generation of the genetic algorithm to directly enter the next generation, thus avoiding the destruction of excellent solutions and accelerating the convergence of the algorithm to the optimal solution.

[0041] Among them, the simulated annealing algorithm controls the probability of accepting a solution by introducing a temperature parameter. In the early stage, when the temperature is high, it accepts poor solutions to increase the search diversity. As the temperature decreases, it gradually reduces the probability of accepting poor solutions to avoid getting trapped in local optima.

[0042] Vector clocks are logical clock mechanisms used in distributed systems to determine the order of events. Each node maintains a vector to record its own logical time and that of other nodes, which is used to detect causal relationships between events.

[0043] Merkle trees are binary hash tree structures where leaf nodes store the hash values ​​of data blocks, non-leaf nodes store the hash values ​​of their child nodes, and the root node hash value is used to quickly verify the integrity and consistency of the entire dataset.

[0044] Among them, the gossip protocol is a distributed communication protocol in which nodes randomly select other nodes to propagate information. It has high reliability and fault tolerance, and the information will eventually be propagated to all nodes to achieve network-wide synchronization.

[0045] The read repair mechanism is a repair process triggered when inconsistencies are detected while reading data. It compares data from multiple replicas, selects the latest version, and synchronizes the latest data to other replica nodes.

[0046] Copy-on-write is a memory management optimization technique in which multiple processes share the same memory page, and the page content is copied only during write operations, thereby reducing memory usage and disk I / O overhead.

[0047] The service preheating pool is a collection of container instances that have been pre-started and initialized. These container instances have completed application loading and dependency initialization and are ready to be immediately put into service processing requests, significantly reducing service startup latency.

[0048] Optionally, the present invention is also implemented by a computer to form a self-extending system for microservices and low-code platform applications. The computer is equipped with a storage medium that stores program instructions, which execute the above-described method when the program instructions are run on the computer.

[0049] The specific implementation methods of the above steps are described in detail below.

[0050] The specific implementation of step S01 is as follows: A lightweight monitoring agent is deployed on each physical node of the microservice cluster. This agent collects the node's resource usage through the operating system's system call interface. The monitoring agent first obtains CPU usage data by reading the ` / proc / stat` file, memory usage information by parsing the ` / proc / meminfo` file, network throughput data by monitoring network interface statistics, and disk I / O rates by reading the ` / proc / diskstats` file. Simultaneously, the monitoring agent collects business metrics by embedding performance probes in the application, including HTTP request response time, the number of currently active concurrent connections, and the length of pending tasks in the message queue. The monitoring agent sets a timer to perform a data collection operation once per second, marks the collected metric data according to timestamps, and then sends it to a centralized time-series database for storage via network transmission protocols. This database supports high-concurrency writes and fast time-range query functions.

[0051] The specific implementation of step S02 is as follows: Historical monitoring data is extracted from the time-series database, and seasonality and trend decomposition algorithms are applied to perform three-dimensional decomposition of the time series. This algorithm first uses a local weighted regression smoothing method to extract the long-term trend component of the data, then identifies and separates the periodic component using moving average technology, and finally treats the remaining part as random noise. The three components obtained from the decomposition are respectively input into a multi-level cross-attention long short-term memory neural network for learning time dependencies. This neural network dynamically adjusts the weight parameters of each attention head in the multi-head cross-attention mechanism based on the input CPU utilization change magnitude, peak memory usage level, and variance statistics of network throughput. The adjustment of the weight parameters follows normalization constraints to ensure that the total weight is 1. By learning the time dependency patterns in historical data, the network outputs a predicted value of the system load within the next 30 minutes, and the prediction accuracy is evaluated using the root mean square error.

[0052] The specific implementation of step S03 is as follows: The future load value output by the load prediction module is compared with the actual resource utilization of the current system to calculate the trend indicator of load growth or decline. When the predicted load value exceeds 80% of the current total capacity, the system determines that an expansion operation is needed, and at this time, the expansion decision module is triggered to generate an instruction to add service instances. When the predicted load value is less than 30% of the current total capacity, the system determines that a shrinkage operation can be performed, and at this time, the shrinkage decision module is triggered to generate an instruction to reduce service instances. The expansion / shrinkage instruction includes resource specification parameters such as the number of instances to be adjusted, the number of CPU cores required for each instance, the memory capacity, and the storage space configuration. The decision module also considers the minimum number of instances in the system to ensure that critical services always maintain sufficient redundancy and avoid the risk of service unavailability due to excessive shrinkage.

[0053] The specific implementation of step S04 is as follows: An improved genetic algorithm is initiated to optimize the scheduling and allocation scheme of containers among cluster nodes. The algorithm employs a three-layer encoding structure to represent the complete scheduling solution. The first layer, node encoding, indicates which physical node each container will be deployed to; the second layer, resource encoding, indicates the amount of CPU, memory, and storage resources allocated to each container; and the third layer, configuration encoding, indicates the container runtime parameter settings, such as environment variables and port configurations. The algorithm uses an adaptive crossover and mutation strategy. In the early stages of population evolution, a higher crossover probability is used to promote global exploration of the solution space, while in the later stages, a higher mutation probability is used for local refinement and optimization. The elite retention mechanism ensures that the most fit individual in each generation can be directly passed on to the next generation, avoiding the loss of excellent solutions during genetic operations. To avoid the algorithm getting trapped in local optima, a probabilistic acceptance mechanism from the simulated annealing algorithm is introduced. The probability of accepting inferior solutions is controlled by a temperature parameter. In the initial high-temperature stage, a certain degree of inferior solutions can be accepted to increase search diversity.

[0054] The specific implementation of step S05 is as follows: A distributed cache consistency maintenance system based on a vector clock mechanism is established. Each cache node maintains a vector clock, recording its own and other nodes' logical timestamps. By comparing vector clocks, the causal relationship and temporal order between cache operation events can be determined. The system constructs a Merkle tree structure to quickly detect the consistency status of cached data. The leaf nodes of the tree store the hash value of cached data blocks, non-leaf nodes store the hash digest of their child node hash values, and the root node's hash value represents the integrity fingerprint of the entire cache dataset. When inconsistencies in cached data are detected between different nodes, the system initiates a rumor protocol to propagate update information. Each node randomly selects several neighbor nodes to send update messages, ensuring that information can spread exponentially throughout the cluster. Simultaneously, a read repair mechanism is activated, automatically detecting and repairing data inconsistencies during read operations. By comparing multiple replicas, the latest version of the data is selected, and the correct data is synchronized to nodes containing outdated data.

[0055] The specific implementation of step S06 is as follows: A container fast startup mechanism is established to reduce the cold start latency of service instances. The system pre-builds a layered container image cache, storing the application's basic runtime environment, dependency libraries, and application code in different image layers, leveraging the layer reuse characteristics of container images to reduce storage space consumption. Copy-on-write technology is used to manage the container's file system; multiple container instances can share the same read-only image layer, and a private writable layer is created only when a write operation is performed, significantly reducing disk I / O overhead and memory consumption. A service preheating pool mechanism is established, pre-starting a certain number of container instances and completing the application initialization process, including loading configuration files, establishing database connections, and initializing caches, putting these instances in a ready state. When expansion is needed, ready instances are directly selected from the preheating pool and put into service, reducing the traditional 30-second cold start time to less than 5 seconds, improving the system's response speed to expansion demands.

[0056] The specific implementation of step S07 is as follows: A real-time monitoring and adaptive optimization feedback mechanism for scaling up and down is established. The system continuously monitors the actual effect after the scaling up and down operation, calculating the prediction deviation rate by comparing the actual system load with the previously predicted load value. When the deviation rate exceeds a threshold of 15%, it is determined that the accuracy of the prediction model has decreased. At this time, the model parameter adjustment program is initiated, recalculating the weight parameters of each layer in the multi-level cross-attention long short-term memory neural network, and updating the model through online learning to improve the accuracy of subsequent predictions. Simultaneously, resource utilization is monitored to ensure it remains within the target range. When CPU or memory utilization deviates from the target range by more than 10%, a genetic algorithm is re-executed to calculate a better scheduling strategy, adjusting the distribution of containers among cluster nodes to achieve better load balancing. The entire system forms a complete adaptive optimization closed loop from monitoring, prediction, decision-making, execution to feedback, enabling continuous adjustment and improvement of the scaling up and down strategy based on actual operating results.

[0057] Further explanation is needed regarding the multi-layered cross-attention long short-term memory neural network, which employs a hierarchical architecture. The input layer receives three time series from the seasonality and trend decomposition algorithms: a trend component, a periodic component, and a random component. The network contains three long short-term memory hidden layers, each with 128 neurons, learning long-term dependencies in the time series through a gating mechanism. The multi-head cross-attention mechanism uses eight attention heads, each responsible for learning different aspects of the input sequence. Information is exchanged between attention heads via a linear transformation matrix. Specifically, the query vector of the i-th attention head is multiplied by the key vector of the j-th attention head to calculate the attention weight distribution. All attention heads share the same linear transformation parameter matrix, achieving a weight-sharing mechanism, reducing the number of model parameters and improving generalization ability. In the hierarchical attention propagation mechanism, the output of the lower-level attention mechanism is weighted and summed before being used as the bias parameter input for the upper-level attention calculation, forming a hierarchical transfer and fusion of information between network layers. The output layer generates a predicted value for the system load within the next 30 minutes and maps the hidden states to the final prediction result through a fully connected layer.

[0058] The training dataset was built by collecting six months of complete historical monitoring data from the microservice cluster, covering multiple metrics such as CPU utilization, memory usage, network throughput, disk I / O rate, request response time, concurrent connections, and queue length. A sliding window approach was used to construct the training samples, with a 60-minute time window and a 5-minute step size to ensure both temporal continuity and appropriate independence between the training samples. The first 55 minutes of data for each sample were used as the network's input features, and the subsequent 30 minutes of data were used as the predicted target label, thus establishing the input-output mapping relationship. The entire dataset contains 50,000 training samples for model parameter learning, and an additional 10,000 validation samples were prepared to evaluate model performance and prevent overfitting.

[0059] The training process uses the Adam optimizer to execute the backpropagation algorithm to update network weights. The learning rate is set to 0.001 to ensure stable convergence during training, and the batch size is set to 32 to balance training efficiency and memory usage. The total number of training epochs is set to 200, and the mean squared error loss function is chosen to measure the difference between the predicted and true values. To prevent overfitting, an early stopping mechanism is implemented, automatically stopping training when the loss value on the validation set does not decrease for 10 consecutive epochs. After training, the network weight parameters are saved for subsequent real-time load prediction tasks.

[0060] Multi-level cross-attention long short-term memory neural networks are particularly suitable for solving microservice load prediction problems, mainly because the load of microservice systems has complex time dependencies and multi-dimensional feature correlations. Compared with traditional autoregressive moving average models, this network can simultaneously handle trend, periodic, and stochastic components, capturing long-term time dependencies through the long short-term memory mechanism, overcoming the limitation of traditional methods that can only handle short-term dependencies. Compared with standard long short-term memory networks, the multi-head cross-attention mechanism can automatically learn the correlation weights between different monitoring indicators, identifying which indicators are more important for load prediction, avoiding the subjectivity of manual feature selection. The hierarchical attention propagation mechanism enables the network to learn feature representations at different levels of abstraction. Lower-level attention focuses on local time patterns, while higher-level attention focuses on global trend changes, forming a multi-level understanding from details to the whole, significantly improving prediction accuracy and generalization ability under complex load scenarios.

[0061] It should be noted that the first key technical idea of ​​this invention is a multi-dimensional time series preprocessing mechanism based on seasonality and trend decomposition algorithms. Traditional load forecasting methods typically use raw monitoring data directly for forecasting, ignoring the different characteristics of trend, periodic, and random components in the time series. This invention decomposes the time series into three independent components, enabling the establishment of different learning strategies for long-term trends, periodic changes, and random fluctuations. This allows the forecasting model to more accurately capture the inherent patterns of load changes and avoids prediction biases caused by interference between different time-related components.

[0062] The second key technical approach is the fusion architecture of a multi-layered cross-attention mechanism and a long short-term memory network. Existing attention mechanisms typically perform feature association learning at a single layer, while the multi-head cross-attention design of this invention enables information exchange between different attention heads, and the hierarchical propagation mechanism achieves progressive feature learning from local to global. This design allows the network to not only learn the temporal dependencies of individual monitoring indicators but also automatically discover complex association patterns between different indicators, significantly improving the accuracy and robustness of multidimensional load prediction compared to traditional methods.

[0063] The third key technological approach is an intelligent scheduling optimization mechanism based on an improved genetic algorithm. Traditional container scheduling strategies typically employ simple round-robin or least-connection algorithms, which cannot adapt to dynamically changing load environments. This invention uses a three-layer coding structure to simultaneously optimize node allocation, resource allocation, and configuration parameters. Combined with an adaptive crossover and mutation strategy and a simulated annealing mechanism, it can find the global optimum under complex multidimensional constraints, avoiding the problem of greedy algorithms easily getting trapped in local optima, and achieving more balanced and efficient resource utilization.

[0064] The fourth key technical approach is the collaborative design of distributed cache consistency maintenance and a fast startup mechanism. Traditional cache consistency protocols typically employ a strong consistency model, resulting in significant system performance overhead. This invention achieves efficient eventual consistency guarantees through the combined use of vector clocks and Merkle trees. Simultaneously, the preheating pool mechanism and copy-on-write technology significantly reduce instance startup latency. The synergistic effect of these two mechanisms enables the system to both guarantee data consistency and quickly respond to scaling requirements.

[0065] The synergistic effect of these key technological approaches forms a complete adaptive scaling system. Time series decomposition and multi-level attention networks provide a foundation for high-precision load prediction, intelligent scheduling algorithms formulate optimal resource allocation strategies based on prediction results, distributed consistency mechanisms ensure the correctness of the system state during scaling, and a fast startup mechanism guarantees the timeliness of strategy execution. Compared to traditional threshold-triggered static scaling methods, this invention forms a complete closed loop of prediction, optimization, execution, and feedback, enabling proactive adaptation to load changes rather than passive response, significantly improving the system's resource utilization efficiency and service quality stability.

[0066] It's important to note that traditional container startup involves multiple steps, including pulling the image from the image repository, uncompressing the image file, initializing the runtime environment, and loading application dependencies. This entire process typically takes 30 seconds or even longer. This prolonged cold start delay prevents scaling operations from responding promptly to sudden load requests, leading to a decline in service quality during peak load periods. This invention addresses this by constructing a service preheating pool. Pre-started and initialized container instances serve as hot-standby resources. Combined with a pre-built tiered image cache and copy-on-write memory management technology, this reduces container startup time from the traditional 30 seconds to less than 5 seconds, fundamentally solving the startup latency problem during scaling.

[0067] It's important to note that during the dynamic scaling up and down of a microservice cluster, newly added or removed service instances need to maintain data synchronization with the existing caching system. While traditional strong consistency protocols such as two-phase commit or three-phase commit can guarantee data consistency, they incur high communication overhead and latency, impacting overall system performance. This is especially true in large-scale clusters with a large number of nodes, where the complexity of consistency maintenance increases exponentially. This invention employs a vector clock mechanism to track cache state changes and uses a Merkle tree structure for rapid data consistency detection. When inconsistencies are detected, a gossip protocol is used to propagate information and initiate a read repair mechanism. This eventual consistency model significantly reduces system overhead while ensuring data correctness, achieving efficient synchronous management of distributed caches.

[0068] Specifically, the principle of this invention is as follows: This invention solves the problem of microservice clusters' inability to achieve accurate prediction and autonomous scaling optimization under dynamic load changes by organically combining multi-dimensional time-series data decomposition with a deep learning prediction model, thus realizing a technological shift from passive response to proactive prediction. The STL decomposition algorithm decomposes the collected resource and business indicator time-series data into trend components, periodic components, and random components, effectively separating long-term trends, periodic changes, and random fluctuations in the data, providing structured feature inputs for subsequent neural network learning. This decomposition method conforms to the inherent laws of microservice load changes. The multi-level cross-attention LSTM neural network captures the complex dependencies between different time scales and feature dimensions through a multi-head attention mechanism. It achieves efficient utilization of attention information through weight sharing and hierarchical propagation mechanisms, accurately modeling the nonlinear time-series characteristics of microservice load. The improved genetic algorithm adopts a three-layer encoding structure and an adaptive crossover mutation strategy, combined with an elite retention mechanism and simulated annealing algorithm, to avoid local optima while ensuring global search capabilities, achieving dynamic optimization of the container scheduling scheme. The distributed cache synchronization mechanism, through the synergy of vector clocks, Merkle trees, and the gossip protocol, ensures data consistency and system stability during scaling. Service preheating pools and write-time replication technologies, through pre-built image caching and memory optimization, significantly reduce container startup latency and improve scaling response speed. The entire technical solution forms a complete autonomous scaling closed loop from load prediction, scheduling optimization, cache synchronization to rapid deployment, demonstrating a coordinated unity of forward-looking prediction, intelligent scheduling, and efficient execution in its technical logic.

[0069] The following provides a specific embodiment 1 of the present invention, and the specific implementation of each step in this embodiment 1 is described in detail below.

[0070] The specific implementation of step S01 involves deploying a lightweight monitoring agent on each physical node of the microservice cluster. This agent collects node resource usage data through the operating system's system call interface. The monitoring agent first obtains CPU usage data by reading the ` / proc / stat` file, memory usage information by parsing the ` / proc / meminfo` file, network throughput data by monitoring network interface statistics, and disk I / O rates by reading the ` / proc / diskstats` file. Simultaneously, the monitoring agent collects business metrics by embedding performance probes within the application, including HTTP request response time, the number of currently active concurrent connections, and the length of pending tasks in the message queue. The monitoring agent sets a timer to perform a data collection operation once per second, timestamps the collected metric data, and then sends it to a centralized time-series database for storage via network transmission protocols.

[0071] The specific implementation of step S02 involves extracting historical monitoring data from the time-series database and applying seasonality and trend decomposition algorithms to perform three-dimensional decomposition of the time series. The mathematical expression of the STL decomposition algorithm is:

[0072] ;

[0073] In the formula, These are observations in a time series, expressed in requests per second. This is a trend component, measured in requests per second. For periodic components, the unit is requests per second; This is a random component, measured in requests per second. This is a time series index. The trend component is extracted using a locally weighted regression smoothing method, calculated as follows:

[0074] ;

[0075] In the formula, This is the weighting function, which has no unit. The window size, with a value ranging from 10 to 20 time points; The values ​​are the observations within the window, expressed in requests per second. This indexes the observation points within the window. The weighting function is defined using a cubic weighting function:

[0076] ;

[0077] In the formula, ; This is a bandwidth parameter, with a value ranging from 5 to 15 time units. For the first Time index of each observation point; Indexed to the current time point. Periodic components are extracted using a moving average technique:

[0078] ;

[0079] In the formula, This represents the period length, with a default value of the number of time points corresponding to 24 hours. Index within the period; This is the floor function. Random components are obtained through residual calculation:

[0080] .

[0081] The three components obtained from the decomposition are input into a multi-layered cross-attention long short-term memory neural network. This network dynamically adjusts the weight parameters of each attention head in the multi-head cross-attention mechanism based on the variation in CPU utilization, the peak level of memory usage, and the variance statistics of network throughput. The formula for adjusting the weight parameters is:

[0082] ;

[0083] In the formula, For the first The weight parameters of each attention head are unitless; The change in CPU utilization is expressed as a percentage. This represents peak memory usage as a percentage. This represents the variance of network throughput, expressed in MB² / s². These are weighting coefficients, without units, with values ​​ranging from 0.3 to 0.5, 0.2 to 0.4, and 0.1 to 0.3, respectively. For attention head index; The attention head is numbered, with a value ranging from 1 to 8. Information exchange between attention heads in the multi-head cross-attention mechanism is achieved through dot product operations:

[0084] ;

[0085] In the formula, For the first The first attention head and the first Attention weights for each attention head, without units; For the first A query vector with attention heads; For the first The key vector of each attention head; is the dimension of the key vector, with a default value of 128. The calculation formula for the hierarchical attention propagation mechanism is:

[0086] ;

[0087] In the formula, For the first Layer bias terms; These are weighting coefficients, dimensionless, and range from 0.1 to 0.2. For attention head index; For the first Layer The output of each attention head; This is the network layer number, with a value ranging from 1 to 3.

[0088] The specific implementation of step S03 involves comparing the future load value output by the load prediction module with the actual resource utilization rate of the current system to calculate the trend indicator of load growth or decline. The formula for determining scaling up or down is:

[0089] ;

[0090] In the formula, For scaling up and down decisions; The predicted load value is expressed in requests per second. This represents the current total capacity, expressed in requests per second. This indicates a capacity expansion operation; This indicates a shrinkage operation; For the predicted time, the formula for calculating the required number of instances is:

[0091] ;

[0092] In the formula, The required number of instances, unitless; This represents the processing capacity of a single instance, expressed in requests per second. This is the floor function.

[0093] The specific implementation of step S04 involves launching an improved genetic algorithm to optimize the scheduling and allocation scheme of containers among cluster nodes. The fitness function of the genetic algorithm is defined as:

[0094] ;

[0095] In the formula, For individuals The fitness value, without units; Load balancing degree, no unit; This refers to resource utilization rate, without units. This refers to network communication costs, measured in milliseconds (ms). The maximum communication cost, measured in milliseconds, is used for normalization. These are weighting coefficients, dimensionless, with values ​​ranging from 0.4 to 0.6, 0.2 to 0.4, and 0.1 to 0.3, and satisfying the following conditions: ; For each individual scheduling scheme, the load balancing degree is calculated using the following formula:

[0096] ;

[0097] In the formula, This represents the standard deviation of the load on each node, expressed in requests per second. This represents the average load across all nodes, expressed in requests per second. The adaptive adjustment formula for the crossover operation probability is:

[0098] ;

[0099] In the formula, For the first The crossover probability of a generation, unitless; This represents the maximum crossover probability, is dimensionless, and has a default value of 0.9. This represents the minimum crossover probability, is dimensionless, and has a default value of 0.6. This represents the total number of generations, with no unit and a default value of 100. This represents the current generation, which is dimensionless. The adaptive adjustment formula for the mutation operation probability is:

[0100] ;

[0101] In the formula, For the first The probability of mutation in a generation, without units; This represents the maximum mutation probability, has no unit, and has a default value of 0.3. This represents the minimum mutation probability, is dimensionless, and has a default value of 0.1. The acceptance probability formula for the simulated annealing algorithm is:

[0102] ;

[0103] In the formula, The probability of accepting an inferior solution is dimensionless. The energy difference for the solution is dimensionless and is obtained through... Calculated; This is the current temperature parameter, without units, with an initial value of 100 and a cooling coefficient of 0.95. This is a new interpretation; This is the current solution.

[0104] The specific implementation of step S05 is to establish a distributed cache consistency maintenance system based on a vector clock mechanism. The update rule of the vector clock is defined as follows:

[0105] ;

[0106] ,for ;

[0107] In the formula, For nodes Vector clock; For nodes Its own logical time, without units; For nodes Recorded nodes Logical time, without units; The received vector clock; For node indexing. The hash calculation formula for a Merkle tree is:

[0108] ;

[0109] In the formula, The hash value of the parent node, a 256-bit binary string; The hash value of the left child node, a 256-bit binary string; The hash value of the right child node, a 256-bit binary string; For connection operation; This uses the SHA-256 hash function. The formula for calculating the information propagation probability of the rumor protocol is:

[0110] ;

[0111] In the formula, The probability that information will reach all nodes, without units; This represents the probability of a single successful propagation, without units, with a default value of 0.8. The number of propagation rounds has no unit.

[0112] The specific implementation method of step S06 is the same as described above, and will not be repeated in detail here.

[0113] The specific implementation of step S07 involves establishing a real-time monitoring and adaptive optimization feedback mechanism for the scaling effect. The formula for calculating the prediction deviation rate is:

[0114] ;

[0115] In the formula, The prediction deviation rate is expressed as a percentage. This is the actual load value, expressed in requests per second. The predicted load value is expressed in requests per second. This is an absolute value operation. When the prediction bias exceeds 15%, the adjustment formula for the neural network weight parameters is:

[0116] ;

[0117] In the formula, These are the adjusted weight parameters; These are the weight parameters before adjustment; The learning rate, unitless, default value is 0.001; This represents the gradient of the loss function with respect to the weights. Let be the mean squared error loss function. The formula for calculating the deviation of resource utilization rate is:

[0118] ;

[0119] In the formula, This represents the deviation from resource utilization rate, expressed as a percentage. This represents the actual resource utilization rate, expressed as a percentage. The target resource utilization rate is expressed as a percentage, with a default value of 70%.

[0120] It should be explained that the STL decomposition algorithm's mathematical model effectively separates the long-term trend and periodic fluctuation patterns in load data by decomposing complex time series into three independent components: trend, period, and random. Compared with traditional single time series forecasting methods, this decomposition model can more accurately identify the inherent laws of system load, providing clearer feature inputs for subsequent neural network predictions and significantly improving the accuracy of load forecasting.

[0121] ;

[0122] The dynamic adjustment formula for weight parameters introduces three key factors: CPU variation, peak memory usage, and network variance. This enables adaptive weight allocation for the attention mechanism. Compared to the fixed-weight attention mechanism, this dynamic adjustment method can automatically identify the most important monitoring indicators based on the current system state, thereby improving the predictive model's adaptability to different load scenarios.

[0123] ;

[0124] The genetic algorithm's fitness function achieves a multi-objective optimization scheduling strategy by integrating three dimensions: load balancing, resource utilization, and normalized network communication cost. Compared with single-objective optimization methods, this fitness function can maximize resource utilization efficiency and minimize communication overhead while ensuring load balancing.

[0125] ;

[0126] The simulated annealing algorithm's acceptance probability formula controls the acceptance probability of inferior solutions through temperature parameters. At high temperatures, it can accept larger energy differences to increase search diversity. As the temperature decreases, it gradually reduces the probability of accepting inferior solutions, effectively avoiding the problem of genetic algorithms getting stuck in local optima and improving global search capabilities.

[0127] ;

[0128] Vector clock update rules accurately capture the causal relationships of events in a distributed environment by maintaining logical timestamps for each node. Compared to synchronization mechanisms based on physical time, this logical clock method avoids clock skew issues and ensures the accuracy of cache consistency detection.

[0129] ;

[0130] The prediction deviation rate calculation formula provides an objective evaluation standard for model parameter adjustment by quantifying the relative error between the predicted value and the actual value. Compared with the evaluation method of absolute error, this relative deviation calculation can better reflect the performance of prediction accuracy under different load levels and supports the precise adjustment of the adaptive optimization mechanism.

[0131] It should be noted that the variables involved in this invention are explained in detail in Tables 1 and 2 below.

[0132] Table 1. Variable Explanation Table (Part 1)

[0133] Table 2. Variable Explanation Table (Part Two)

[0134] To better understand and implement this invention, a specific application scenario is provided below as Example 2: An e-commerce technology team faced a service response delay problem caused by a surge in load on the microservice cluster of an online shopping platform during promotional activities. Traditional manual scaling methods could not cope with the sudden traffic surges in a timely manner. Therefore, they decided to adopt an autonomous scaling method based on STL decomposition and a multi-layered cross-attention LSTM neural network to solve this technical challenge. The platform has 12 microservice modules, including order services, payment services, inventory services, and user services, deployed in a Kubernetes cluster environment with 32 compute nodes.

[0135] The technical team first deployed a distributed monitoring agent across the 32 nodes of the cluster. Each agent was responsible for collecting system resource metrics and business performance metrics for its assigned node. The monitoring agents collected resource-level data such as CPU utilization, memory usage, network throughput, and disk I / O rate, while also recording business-level data such as request response time, concurrent connections, and queue length. The monitoring agents continuously collected data once per second, and all collected time-series data was stored in the InfluxDB time-series database, providing a data foundation for subsequent load forecasting and analysis. In actual operation, the CPU utilization of the order service node remained at 45% under normal conditions, peaking at 92% during promotional periods. Memory usage increased from the usual 60% to 85%, and network throughput surged from 200 Mbps to 1.2 Gbps.

[0136] The technical team constructed a multi-layered cross-attention LSTM neural network model to achieve load prediction. This network employs a three-layer LSTM hidden layer structure, with each layer containing 128 neurons. A multi-head cross-attention mechanism with eight attention heads enables interactive feature learning. The training dataset consists of six months of historical monitoring data from the microservice cluster. Training samples were constructed using a 60-minute time window and a 5-minute sliding step. The first 55 minutes of monitoring data were used as input features, and the load data from the last 30 minutes were used as the prediction target, ultimately generating 50,000 training samples and 10,000 validation samples. The model was trained using the Adam optimizer with a learning rate of 0.001 and a batch size of 32. After 200 training epochs, the validation set loss converged to 0.0087. When applying the STL decomposition algorithm to preprocess the time-series data, it effectively separated trend components, periodic components, and random components. The periodic component clearly reflects the load variation patterns between weekdays and weekends, and between day and night.

[0137] As shown in Table 3, the comparison of load prediction results indicates that the multi-level cross-attention LSTM neural network maintains a high level of prediction accuracy across all time periods.

[0138] Table 3 Comparison of Load Forecast Accuracy in Different Time Periods

[0139] When calculating scaling up / down requirements based on load forecasts, the technical team configured a scaling up decision to be triggered when the predicted load exceeds 80% of the current capacity, and a scaling down decision to be triggered when the predicted load is below 30% of the current capacity. Thirty minutes before a promotional event, the system predicted that the order service load would rise from the current 45% to 87%, exceeding the scaling up threshold. This automatically generated a scaling up instruction to increase the number of order service instances from the current 8 to 14, with each instance allocated 2 CPU cores and 4GB of memory. The payment service load was predicted to rise from 38% to 76%, also triggering a scaling up decision, increasing the number of instances from 6 to 10. The inventory service, with a predicted load of only 52%, did not trigger the scaling up condition and remained at its current configuration of 3 instances.

[0140] The technical team employed an improved genetic algorithm to optimize the container scheduling scheme. This algorithm uses a three-layer encoding structure to represent node allocation, resource allocation, and service configuration. The node encoding layer uses integer encoding to represent 32 physical nodes, the resource encoding layer uses real number encoding to represent the CPU and memory allocation ratios, and the configuration encoding layer uses binary encoding to represent service running parameters. An adaptive crossover and mutation strategy dynamically adjusts parameters based on the population's evolutionary progress. Initially, the crossover probability is set to 0.8 and the mutation probability to 0.1. As the number of generations increases, the crossover probability gradually decreases to 0.6, while the mutation probability increases to 0.3. An elite retention mechanism preserves the top 10% of individuals with the highest fitness in each generation, allowing them to directly enter the next generation. Combined with simulated annealing, the initial temperature is set to 100°C, and the cooling rate is 0.95, to prevent the algorithm from getting trapped in local optima. After 150 generations of evolutionary calculations, the optimal scheduling strategy was obtained, allocating newly added order service instances to the less loaded nodes 7, 12, 18, 23, 28, and 31.

[0141] like Figure 2 As shown, in terms of distributed cache synchronization, the technical team tracks the cache state changes of each node based on a vector clock mechanism. Each node maintains a 32-dimensional vector recording its own logical timestamps and those of the other 31 nodes. When user cache data on node 3 is updated, its vector clock is updated from [0, 0, 5, 0, 0, ...] to [0, 0, 6, 0, 0, ...]. The system constructs a Merkle tree structure to quickly detect cache data inconsistencies, and the root hash value changes from 0x7A3F2E1B to 0x9C5D4A2E. After detecting inconsistency, the system initiates a gossip protocol to propagate information. Node 3 randomly selects nodes 8, 15, and 22 as propagation targets, sending the updated information to these three nodes. The receiving nodes continue to propagate to other nodes, ultimately achieving data synchronization across all 32 nodes in the network. When node 17 reads the user cache and detects that the data version is outdated, the read repair mechanism automatically obtains the latest version data from other nodes and updates its local cache, ensuring eventual consistency.

[0142] The container rapid deployment mechanism significantly improves deployment efficiency by employing pre-built layered image caching and copy-on-write technology. The technical team pre-builds layered images containing the basic runtime environment, dependency libraries, and application code. Copy-on-write technology allows multiple container instances to share the same read-only layer, copying differences only during write operations. A service preheating pool maintains 20 hot-standby container instances that have completed application loading and dependency initialization. When a scaling command is issued, the corresponding hot-standby instance is directly selected from the preheating pool for deployment. During the scaling process before the promotional activity began, the deployment times for the six newly added instances in the order service were 3.2 seconds, 3.8 seconds, 2.9 seconds, 4.1 seconds, 3.5 seconds, and 3.6 seconds, respectively, with an average deployment time of 3.52 seconds, significantly shorter than the 28-35 seconds of the traditional cold start method.

[0143] Table 4 shows the statistical data on the performance of expansion and contraction operations, illustrating the actual performance of each indicator.

[0144] Table 4 Statistical Table of Expansion / Shrinkage Operation Results

[0145] The system continuously monitors the performance of scaling up and down operations, calculating the deviation rate between the actual load and the predicted load in real time. When the deviation rate of the search service reaches 23.2%, exceeding the 15% threshold, the system automatically adjusts the weight parameters of the multi-layered cross-attention LSTM neural network, shifting the weight distribution of the attention heads from a uniform distribution to a focus on network throughput and request response time metrics. When the resource utilization of a user service deviates from the target range by more than 10%, the system restarts the genetic algorithm to calculate the scheduling strategy, migrating the service instance to a more load-balanced node. Through this adaptive optimization mechanism, the system forms a closed loop of continuous learning and improvement, constantly enhancing prediction accuracy and scheduling efficiency.

[0146] like Figure 3 As shown, throughout the promotional campaign, the microservice cluster successfully handled the surge in traffic through self-scaling. The total number of system requests increased from the usual 5,000 per second to 18,000 per second, with the average response time remaining below 120 milliseconds, and 99% of requests having a response time below 500 milliseconds. The availability of each microservice remained above 99.9%, with no service interruptions due to excessive load. A total of 47 scaling operations were performed, including 28 scaling-up operations and 19 scaling-down operations. All operations were completed within the preset time window, providing strong technical support for the platform's stable operation.

[0147] Compared to traditional manual scaling methods, this invention employs an STL decomposition combined with a multi-layered cross-attention LSTM neural network prediction method that accurately captures the time dependencies and periodic patterns of load changes, significantly improving prediction accuracy. The multi-head cross-attention mechanism achieves deep fusion between different feature dimensions through information exchange and weight sharing, while the hierarchical attention propagation mechanism enables the network to learn multi-scale time dependency patterns. An improved genetic algorithm optimizes scheduling decisions through a three-layer coding structure and adaptive crossover mutation strategy, effectively avoiding local optima and generating better resource allocation schemes when combined with simulated annealing. A distributed cache synchronization mechanism based on vector clocks and Merkle trees ensures data consistency while reducing synchronization overhead, and the fault-tolerant characteristics of the gossip protocol enhance system reliability. The application of copy-on-write technology and a service warm-up pool significantly shortens container startup time and improves scaling response speed. An adaptive optimization closed-loop achieves continuous system improvement through real-time monitoring and parameter adjustment, forming intelligent operation and maintenance management capabilities.

[0148] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for microservices and low-code platform application autonomous scaling, characterized in that, The method comprises deploying a distributed monitoring agent on each node of the microservice cluster to collect CPU usage, memory occupancy, network throughput, disk IO rate, request response time, concurrent connection number, and queue length, and storing the data in a time series database by the monitoring agent; The collected time series data is decomposed in three dimensions by using an STL decomposition algorithm, and the decomposition result is input into a pre-trained multi-level cross-attention LSTM neural network to generate a load prediction value; the expansion or contraction demand is calculated according to the difference between the load prediction value and the current resource utilization, and an expansion or contraction instruction is generated; an improved genetic algorithm is started to optimize the container scheduling scheme, and an optimal scheduling strategy is calculated; The vector clock mechanism is used to track the change of the hierarchical cache state, a Merkle tree structure is constructed to detect the cache data consistency, the gossip protocol is used to propagate the update information when inconsistency is detected, and a read repair mechanism is started to maintain the synchronization of the distributed cache; a pre-built hierarchical image cache is used when starting a container instance, a hot standby instance is selected from a service warm-up pool for deployment by using the copy-on-write technology; the execution effect of the expansion or contraction operation is monitored in real time to form an adaptive optimization closed loop.

2. The method as claimed in claim 1, wherein the microservices and low code platform application autonomous scaling method is characterized by, The STL decomposition algorithm decomposes the collected time series data in three dimensions, specifically, the trend component, the periodic component and the random component, and the STL decomposition algorithm is a time series decomposition algorithm that decomposes time series data into three components: trend component, periodic component and random component, which is used to analyze the long-term trend and periodic variation of data.

3. The method of claim 2, wherein the microservices and low-code platform application autonomous scaling is characterized by, The multi-level cross-attention LSTM neural network learns the time-dependent relationship and determines the multi-head cross-attention mechanism weight parameters according to the CPU usage change amplitude, memory occupancy peak value and network throughput variance to generate a load prediction value for the next 30 minutes.

4. The microservice with low code platform application autonomous scaling method of claim 3, wherein, The multi-level cross-attention LSTM neural network realizes weight sharing through a weight sharing matrix, the output of the lower-level attention in the hierarchical attention propagation mechanism is used as the bias parameter for the calculation of the upper-level attention, weight sharing is realized by using the same linear transformation parameter matrix for all attention heads, and the weighted sum of the attention weight output of the lth layer in the hierarchical attention propagation mechanism is input as the bias term of the l+1th layer.

5. The microservice and low-code platform application autonomous scaling method according to claim 4, characterized in that, When the load prediction value exceeds 80% of the current capacity, the expansion decision is triggered, and when the load prediction value is less than 30% of the current capacity, the contraction decision is triggered, and an expansion or contraction instruction containing the required instance number and resource specification is generated.

6. The microservice and low-code platform application autonomous scaling method according to claim 5, characterized in that, The improved genetic algorithm uses a three-layer coding structure to represent node allocation, resource allocation and service configuration, uses an adaptive crossover and mutation strategy and an elite reservation mechanism, and combines a simulated annealing algorithm, and the steps of establishing a training data set by using the multi-level cross-attention LSTM neural network are collecting CPU usage, memory occupancy, network throughput, disk IO rate, request response time, concurrent connection number and queue length data of the microservice cluster for 6 months, and constructing training samples in a time window size of 60 minutes and a sliding step of 5 minutes.

7. The microservice and low-code platform application autonomous scaling method according to claim 6, characterized in that, The deviation rate of the actual load and the load prediction value is calculated when monitoring the execution effect of the real-time monitoring expansion and contraction operation, and the multi-level cross attention LSTM neural network weight parameters are adjusted when the deviation rate exceeds 15%.

8. The microservice and low-code platform application autonomous scaling method according to claim 7, characterized in that, The periodic component, in particular, refers to the component with a fixed periodicity in the time series data, reflecting the regularity of the system within a fixed time interval.

9. The microservice and low-code platform application autonomous scaling method according to claim 8, characterized in that, The three-layer encoding structure, in particular, includes a node encoding layer representing a physical node of a container deployment, a resource encoding layer representing a CPU memory resource allocation scheme, and a configuration encoding layer representing service running parameter settings.

10. The microservice and low-code platform application autonomous scaling method according to claim 9, characterized in that, The adaptive crossover and mutation strategy, in particular, dynamically adjusts the crossover probability and mutation probability according to the evolution degree of the population, uses a higher crossover probability in the early evolution stage to promote global search, and uses a higher mutation probability in the later evolution stage for local optimization.

Citation Information

Patent Citations

  • Online application dynamic capacity expansion and shrinkage method based on micro-service call dependence perception

    CN112199150A

  • Dynamic resource expansion method for electric power internet-of-things management platform

    CN113065785A

  • Container energy-saving elastic capacity expansion and contraction method and system based on time sequence prediction and medium

    CN118260021A

  • Cluster dynamic scaling method and system based on periodic data prediction

    CN118467098A

  • Micro-service capacity expansion and contraction method and device, computer equipment, readable storage medium and program product

    CN119276719A