Micro-service and low-code platform application autonomous expansion 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 intelligent resource scheduling, improving the system's response speed and resource utilization efficiency.

CN121233339BActive Publication Date: 2026-03-20BEIJING NANCAL RUIYUAN DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

In existing technologies, microservice clusters cannot achieve accurate prediction and autonomous scaling optimization in dynamic load change environments, 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 real-time system response and resource utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121233339B_ABST
    Figure CN121233339B_ABST
Patent Text Reader

Abstract

The application provides a micro-service and low-code platform application autonomous expansion method, and belongs to the technical field of micro-service.The application collects multi-dimensional resources and business index data through deployment of a distributed monitoring agent, uses an STL decomposition algorithm to perform three-dimensional decomposition on time series data, and then inputs the three-dimensional decomposition into a multi-level cross-attention LSTM neural network to generate a 30-minute future load prediction value.According to a difference between the prediction result and current resource utilization, expansion and contraction requirements are calculated, and a scheduling instruction is generated.The application uses a pre-constructed hierarchical image cache, a copy-on-write technology and a service warm-up pool to realize rapid startup and deployment of a container, and through real-time monitoring of expansion and contraction effects and adjustment of neural network parameters, an adaptive optimization closed loop is formed, thereby solving the technical problem that a micro-service cluster cannot realize precise prediction and autonomous expansion and contraction optimization in a dynamic load change environment.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of microservices, and in particular, relates to a microservice and low-code platform application autonomous expansion method. BACKGROUND

[0002] In the rapid development of microservice architecture and low-code platforms, traditional scaling techniques mainly rely on passive response mechanisms triggered based on threshold values, triggering scaling operations by setting fixed thresholds such as CPU usage and memory occupancy, and using static load balancing algorithms for resource allocation and container scheduling. This approach has been widely used in cloud-native application deployment. However, the traditional scaling method based on threshold triggering lacks the ability to predict future load changes and can only make passive adjustments after resource bottlenecks occur, resulting in system response lag and inability to prepare resources in advance. In addition, existing static scheduling algorithms cannot dynamically optimize container allocation strategies based on real-time load characteristics, and may lead to unreasonable resource allocation when facing complex and variable business loads. That is, there is a technical problem in the prior art that microservice clusters cannot achieve accurate prediction and autonomous scaling optimization under dynamic load changes. SUMMARY

[0003] Therefore, the present application provides a microservice and low-code platform application autonomous expansion method, which can solve the technical problem in the prior art that microservice clusters cannot achieve accurate prediction and autonomous scaling optimization under dynamic load changes.

[0004] The present application is implemented as follows: The present application provides a microservice and low-code platform application autonomous expansion method, which includes deploying a distributed monitoring agent on each node of the microservice cluster, collecting 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; using an STL decomposition algorithm to perform three-dimensional decomposition on the collected time series data, inputting the decomposition results into a pre-trained multi-level cross-attention LSTM neural network to generate load prediction values; calculating the scaling demand based on the difference between the load prediction values and the current resource utilization, and generating scaling instructions; starting an improved genetic algorithm to optimize the container scheduling scheme and calculate the optimal scheduling strategy; tracking the changes in the hierarchical cache state based on the vector clock mechanism, constructing a Merkle tree structure to detect cache data consistency, and using the gossip protocol to propagate update information when inconsistencies are detected, starting the read repair mechanism to maintain distributed cache synchronization; using a pre-built hierarchical image cache when starting a container instance, and selecting a hot standby instance from the service warm-up pool for deployment using the copy-on-write technology; monitoring the execution effect of the scaling operation in real time to form an adaptive optimization closed loop.

[0005] The STL decomposition algorithm is a time series decomposition algorithm that decomposes time series data into trend component, periodic component and random component three components, which is used to analyze the long-term trend and periodic variation law of data.

[0006] The multi-level cross attention LSTM neural network learns time dependence and determines the multi-head cross attention mechanism weight parameter according to the CPU usage rate change amplitude, memory occupancy rate peak value and network throughput variance to generate a future 30-minute load prediction value. Specifically, the input layer receives the trend component, periodic component and random component output by the STL decomposition algorithm, and is processed through 3 layers of LSTM hidden layer, each layer containing 128 neuron units. The multi-head cross attention mechanism sets 8 attention heads, and the information exchange between the attention heads is realized through a linear transformation matrix.

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

[0008] 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. The difference between the load prediction value and the current resource utilization is used to calculate the expansion and contraction demand, and an expansion and contraction instruction containing the required instance number and resource specification is generated.

[0009] The improved genetic algorithm adopts 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. The steps of training the data set of the multi-level cross attention LSTM neural network include collecting the CPU usage rate, memory occupancy rate, 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.

[0010] The deviation rate of the actual load and the load prediction value is calculated when monitoring the execution effect of the scale-in and scale-out operation in real time, the multi-level cross attention LSTM neural network weight parameter is adjusted when the deviation rate exceeds 15%, the scheduling strategy is recalculated when the resource utilization rate deviates from the target range by more than 10%, the multi-level cross attention LSTM neural network is trained using the Adam optimizer for back propagation training, the learning rate is set to 0.001, the batch size is set to 32, the training round is set to 200 rounds, and the loss function adopts the mean square error loss.

[0011] The periodic component, specifically refers to the component with fixed periodicity in the time series data, reflects the regularity of the system within a fixed time interval.

[0012] The three-layer encoding structure, specifically 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.

[0013] The adaptive crossover mutation strategy, specifically adjusts the crossover probability and mutation probability according to the evolution degree of the population, uses a higher crossover probability to promote global search in the early evolution stage, and uses a higher mutation probability for local optimization in the later evolution stage.

[0014] The elite reservation mechanism, specifically retains a number of individuals with the highest fitness in each generation of genetic algorithm iteration to directly enter the next generation, accelerating the convergence of the algorithm to the optimal solution.

[0015] The simulated annealing algorithm, specifically controls the acceptance probability of the solution by introducing a temperature parameter, accepts poor solutions at high initial temperature to increase search diversity, and gradually reduces the probability of accepting poor solutions as the temperature decreases.

[0016] The vector clock, specifically a logical clock mechanism used to determine the order of event occurrence in a distributed system, each node maintains a vector recording its own and other nodes' logical time, used to detect the causality of events.

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

[0018] The gossip protocol, specifically a distributed communication protocol, nodes randomly select other nodes to propagate information, has high reliability and fault tolerance, and information is eventually propagated to all nodes to achieve network synchronization.

[0019] The read repair mechanism is specifically a repair process triggered when inconsistent conditions are detected during reading data, the latest version is selected by comparing multiple copy data, and the latest data is synchronized to other copy nodes; the write-time replication technology is specifically an in-memory management optimization technology, multiple processes share the same memory page, and only the page content is copied when writing; the service warm-up pool is specifically a set of container instances that are pre-started and initialized, and the container instances have completed application loading and dependency initialization.

[0020] The application solves the technical problem that the micro-service cluster cannot realize accurate prediction and autonomous expansion and contraction optimization under the dynamic load change environment by constructing a load prediction model based on STL decomposition and a multi-level cross-attention LSTM neural network, combining a container scheduling mechanism optimized by an improved genetic algorithm, and a distributed cache synchronization and service warm-up pool technology. The STL decomposition algorithm is used to decompose the time series data into trend, period and random components, the multi-level cross-attention LSTM neural network is used to learn the complex time dependence, and the accurate prediction of the future 30-minute load is realized, overcoming the hysteresis problem of the traditional passive response mechanism. At the same time, the improved genetic algorithm is combined with the simulated annealing technology to optimize the container scheduling strategy, avoiding the limitations of static algorithms in dynamic environments. The cooperative action of predictive expansion and contraction and intelligent scheduling optimization solves the fundamental defect that the traditional method cannot actively adapt to load changes from the technical principle, realizes autonomous resource management and performance optimization of the micro-service cluster. BRIEF DESCRIPTION OF DRAWINGS

[0021] Figure 1 The flowchart of the method of the application.

[0022] Figure 2 The distributed cache state vector clock change diagram in the embodiment.

[0023] Figure 3 The micro-service cluster load and response time change diagram in the embodiment, including two sub-diagrams: (A) is a time change diagram of the load, and (B) is a time change diagram of the response time. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical scheme and advantages of the embodiments of the application clearer, the technical scheme in the embodiments of the application will be described clearly and completely with reference to the drawings in the embodiments of the application.

[0025] As Figure 1 shown is a flowchart of a micro-service and low-code platform application autonomous expansion method provided by the application, the method includes the following steps:

[0026] S01, deploy distributed monitoring agents on each node of the microservice cluster to collect resource indicators such as CPU usage, memory occupancy, network throughput, and disk IO rate, and business indicators such as request response time, concurrent connection number, and queue length. The monitoring agent collects data every second and stores it in a time series database;

[0027] S02, use STL decomposition algorithm to decompose the collected time series data into trend component, periodic component and random component, then input the decomposition result into the pre-trained multi-level cross attention LSTM neural network for time dependence relationship learning. The multi-level cross attention LSTM neural network determines the multi-head cross attention mechanism weight parameter according to the CPU usage change amplitude, memory occupancy peak value and network throughput variance, and generates the load prediction value in the next 30 minutes;

[0028] S03, calculate the scaling demand according to the difference between the load prediction value and the current resource utilization rate. Trigger the scaling decision when the load prediction value exceeds 80% of the current capacity, and trigger the scaling decision when the load prediction value is less than 30% of the current capacity. Generate the scaling instruction containing the required instance number and resource specification;

[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 adaptive crossover and mutation strategies and elite preservation mechanism. Combine with simulated annealing algorithm to avoid local optimal solution. Calculate the optimal scheduling strategy;

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

[0031] S06, use pre-built layered image cache when starting container instance, use copy-on-write technology to reduce disk IO overhead, select hot standby instance from service warm-up pool for fast deployment, and reduce cold start time from traditional 30 seconds to less than 5 seconds;

[0032] S07, real-time monitor the execution effect of scaling operation, calculate the deviation rate of actual load and load prediction value, adjust the multi-level cross attention LSTM neural network weight parameter when the deviation rate > 15%, and recalculate the scheduling strategy when the resource utilization rate deviates from the target range > 10%, forming an adaptive optimization closed loop.

[0033] Wherein, STL decomposition algorithm is a time series decomposition algorithm, which is used to decompose time series data into trend component, periodic component and random component three components, which is convenient for analyzing the long-term trend and periodic change rule of data.

[0034] The multi-level cross-attention LSTM neural network has a structure that an input layer receives trend components, periodic components and random components output by an STL decomposition algorithm, is processed through 3 layers of LSTM hidden layers, each layer contains 128 neuron units, a multi-head cross-attention mechanism is provided with 8 attention heads, information exchange is performed between the attention heads through a linear transformation matrix, weight sharing is realized through a weight sharing matrix, in a hierarchical attention propagation mechanism, an output of lower-level attention is used as a bias parameter for calculation of upper-level attention, and an output layer generates a load prediction value in the next 30 minutes; in the multi-head cross-attention mechanism, information exchange between the attention heads is realized by performing dot product operation on a query vector of an i-th attention head and a key vector of a j-th attention head, weight sharing is realized by using the same linear transformation parameter matrix for all the attention heads, and an attention weight output of an l-th layer in the hierarchical attention propagation mechanism is input as a bias term for an l+1-th layer after weighted summation.

[0035] The multi-level cross-attention LSTM neural network training data set is established by the following steps: collecting CPU usage, memory occupation, network throughput, disk IO rate, request response time, concurrent connection number and queue length data of the micro-service cluster in the past 6 months, constructing training samples in a manner that a time window size is 60 minutes and a sliding step size is 5 minutes, taking the first 55 minutes of data as input features and the last 30 minutes of data as prediction targets, and generating 50,000 training samples and 10,000 verification samples.

[0036] The multi-level cross-attention LSTM neural network is trained by the following steps: using an Adam optimizer to perform back propagation training, setting a learning rate to 0.001, setting a batch size to 32, setting a training round to 200 rounds, using a mean square error loss as a loss function, stopping training in advance when the verification set loss does not decrease for 10 consecutive rounds, and saving network weight parameters for load prediction after training is completed.

[0037] The periodic component refers to a component with a fixed periodic repeating mode in time series data, reflecting regularity change characteristics of the system in a fixed time interval.

[0038] The three-layer coding structure includes a node coding layer representing physical nodes of container deployment, a resource coding layer representing resource allocation schemes such as CPU and memory, and a configuration coding layer representing service running parameter settings.

[0039] The adaptive crossover mutation strategy dynamically adjusts the crossover probability and the mutation probability according to the population evolution degree, uses a higher crossover probability to promote global search in the early evolution stage, and uses a higher mutation probability for local optimization in the later evolution stage.

[0040] Among them, the elite reservation mechanism reserves the top individuals in each generation of genetic algorithm iteration to enter the next generation directly, 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 acceptance probability of the solution by introducing a temperature parameter. In the initial high temperature, it accepts poor solutions to increase search diversity. As the temperature decreases, the probability of accepting poor solutions is gradually reduced to avoid falling into local optimum.

[0042] Among them, the vector clock is a logical clock mechanism used to determine the order of event occurrence in distributed systems. Each node maintains a vector recording its own and other nodes' logical time, which is used to detect the causality of events.

[0043] Among them, the Merkle tree is a binary hash tree structure. The leaf node stores the hash value of the data block, and the non-leaf node stores the hash of the child node hash. The root node hash value is used to quickly verify the integrity and consistency of the entire data set.

[0044] Among them, the gossip protocol is a distributed communication protocol in which nodes randomly select other nodes to propagate information, with high reliability and fault tolerance. Information will eventually spread to all nodes to achieve network synchronization.

[0045] Among them, the read repair mechanism is a repair process triggered when inconsistent data is detected during read operations. By comparing multiple copy data to select the latest version, the latest data is synchronized to other copy nodes.

[0046] Among them, the write-copy technique is a memory management optimization technique in which multiple processes share the same memory page. Only when writing is performed, the page content is copied, reducing memory usage and disk IO operation overhead.

[0047] Among them, the service warm-up pool is a set of container instances that have been pre-started and initialized. The container instances have completed application loading and dependency initialization, and are ready to handle requests immediately, significantly reducing service startup delay.

[0048] Optionally, the application is also implemented by a computer to form a micro-service and low-code platform application autonomous expansion system. The computer is provided with a storage medium, and the storage medium stores program instructions. The program instructions execute the above method when running in the computer.

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

[0050] The specific implementation of step S01 is to deploy a lightweight monitoring agent on each physical node of the microservice cluster, which collects the resource usage of the node through the system call interface of the operating system. The monitoring agent first obtains CPU usage data by reading the / proc / stat file, memory occupancy information by parsing the / proc / meminfo file, network throughput data by monitoring network interface statistics, and disk input / output rate by reading the / proc / diskstats file. At the same time, 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 the message queue. The monitoring agent sets a timer to execute data collection operations every second, marks the collected metric data with a timestamp, and then sends it to a centralized time-series database for storage. The database supports high-concurrency writing and fast time range querying functions.

[0051] The specific implementation of step S02 is to extract historical monitoring data from the time-series database and apply a seasonal and trend decomposition algorithm for three-dimensional decomposition of the time series. The algorithm first uses a locally weighted regression smoothing method to extract the long-term trend component of the data, then identifies and separates the periodic component through moving average techniques, and finally takes the remaining part as the random noise component. The three components obtained by decomposition are input into a multi-level cross-attention long short-term memory neural network for time-dependent relationship learning. The neural network dynamically adjusts the weight parameters of each attention head in the multi-head cross-attention mechanism based on the input CPU usage change amplitude, memory occupancy peak level, and network throughput variance statistics. The adjustment of weight parameters follows a normalization constraint condition to ensure that the total weight is 1. The network learns the time-dependent patterns in historical data and outputs the predicted value of system load in the next 30 minutes. The prediction accuracy is evaluated by the root mean square error.

[0052] The specific implementation of step S03 is to compare and calculate the future load value output by the load prediction module with the actual resource utilization of the current system to obtain the trend index of load growth or decline. When the predicted load value exceeds 80% of the current total capacity, the system determines that it needs to perform a scaling operation, and triggers the scaling decision module to generate an instruction to increase service instances. When the predicted load value is less than 30% of the current total capacity, the system determines that it can perform a scaling operation, and triggers the scaling decision module to generate an instruction to reduce service instances. The scaling instruction includes the number of instances to be adjusted, the CPU core number required for each instance, the memory capacity size, and the storage space configuration, etc. The decision module also considers the minimum instance number limit of the system to ensure that critical services always have sufficient redundancy and avoid the risk of service unavailability due to excessive scaling.

[0053] The specific implementation of step S04 is to start the improved genetic algorithm to optimize the scheduling allocation scheme of containers among cluster nodes. The algorithm uses a three-layer coding structure to represent the complete scheduling solution, the first layer node coding represents which physical node each container will be deployed to, the second layer resource coding represents the amount of CPU, memory and storage resources allocated for each container, and the third layer configuration coding represents the parameter settings of the container runtime such as environment variables and port configuration. The algorithm uses an adaptive crossover and mutation strategy, using a higher crossover probability in the early stages of population evolution to promote global exploration of the solution space, and using a higher mutation probability in the later stages of evolution for local refinement optimization. The elite preservation mechanism ensures that the individuals with the best fitness in each generation can be directly passed to the next generation, avoiding the loss of good solutions in genetic operations. To avoid the algorithm falling into a local optimal solution, the probability acceptance mechanism of the simulated annealing algorithm is introduced, and the acceptance probability of inferior solutions is controlled by the temperature parameter. The initial high temperature stage can accept a certain degree of inferior solutions to increase the search diversity.

[0054] The specific implementation of step S05 is to establish a distributed cache consistency maintenance system based on vector clock mechanism. Each cache node maintains a vector clock to record its own and other nodes in the system logical timestamp, and by comparing the vector clock, the causal relationship and time sequence between cache operation events can be determined. The system constructs a Merkle tree structure to quickly detect the consistency state of cache data, the leaf nodes of the tree store the hash values of cache data blocks, the non-leaf nodes store the hash digest of their child node hash values, and the hash value of the root node represents the integrity fingerprint of the entire cache data set. When detecting that the cache data between different nodes is inconsistent, the system starts the gossip protocol to propagate the update information, each node randomly selects several neighbor nodes to transmit the update message, ensuring that the information can spread to the entire cluster at an exponential speed. At the same time, the read repair mechanism is activated to automatically detect and repair data inconsistency problems during read operations, select the latest version of data by comparing multiple copies, and synchronize the correct data to nodes with outdated data.

[0055] The specific implementation of step S06 is to establish a container quick start mechanism to reduce the cold start delay of service instances. The system pre-builds a hierarchical container image cache, stores the base runtime environment, dependent libraries and application code of the application in different image layers respectively, and reduces the storage space occupation by using the layer reuse feature of the container image. Write-time copy technology is used to manage the file system of the container, and multiple container instances can share the same read-only image layer. Only when a write operation is performed, a private writable layer is created, which significantly reduces the disk input / output overhead and memory occupation. A service warm-up pool mechanism is established, a certain number of container instances are pre-started and the initialization process of the application is completed, including loading configuration files, establishing database connections, initializing caches and other operations, so that these instances are ready for use. When scaling is needed, the instances that have been prepared are selected from the warm-up pool and put into service, reducing the traditional 30-second cold start time to less than 5 seconds, and improving the system's response to scaling requirements.

[0056] The specific implementation of step S07 is to establish a real-time monitoring and self-adaptive optimization feedback mechanism for the effect of scaling. The system continuously monitors the actual effect after the scaling operation is executed, calculates the prediction deviation rate by comparing the actual system load with the previously predicted load value. When the deviation rate exceeds the threshold of 15%, it is determined that the accuracy of the prediction model has decreased, and the model parameter adjustment program is started at this time to recalculate the weight parameters of each layer in the multi-level cross-attention long short-term memory neural network. The model is updated through online learning to improve the accuracy of subsequent predictions. At the same time, it is monitored whether the resource utilization rate remains within the target range. When the CPU or memory utilization rate deviates from the target range by more than 10%, the genetic algorithm is re-executed to calculate a more optimal scheduling strategy, and the distribution of containers among cluster nodes is adjusted to achieve better load balancing effect. The entire system forms a complete self-adaptive optimization closed loop from monitoring, prediction, decision-making, execution to feedback, and can continuously adjust and improve the scaling strategy according to the actual running effect.

[0057] It needs to be further explained that the multi-level cross-attention long short-term memory neural network adopts a hierarchical architecture design, and the input layer receives the trend component, periodic component and random component three time series output by the seasonal and trend decomposition algorithm. The network contains 3 layers of long short-term memory hidden layer, each layer is configured with 128 neuron units, and the long-term dependence relationship in the time series is learned through the gating mechanism. The multi-head cross-attention mechanism sets 8 attention heads, each of which is responsible for learning different aspect features of the input sequence, and the attention heads exchange information through a linear transformation matrix. The specific implementation is to perform dot product operation on the query vector of the i-th attention head and 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 to realize the weight sharing mechanism, reduce the number of model parameters and improve the generalization ability. In the hierarchical attention propagation mechanism, the output of the lower layer attention mechanism is input as the bias parameter of the upper layer attention calculation after weighted summation, forming the step-by-step transmission and fusion of information between network layers. The output layer generates the prediction value of the system load in the next 30 minutes, and maps the hidden state to the final prediction result through the fully connected layer.

[0058] The establishment process of the training data set includes collecting complete monitoring data of 6 months from the micro-service cluster, covering CPU usage, memory occupancy, network throughput, disk input / output rate, request response time, concurrent connection number and queue length and other multi-dimensional indicators. A sliding window method is used to construct training samples, with a time window size of 60 minutes and a sliding step of 5 minutes, ensuring that the training samples have both certain time continuity and appropriate independence. The first 55 minutes of data of each sample is used as the input feature of the network, and the subsequent 30 minutes of data is used as the prediction target label, and the input-output mapping relationship is constructed in this way. The entire data set contains 50,000 training samples for model parameter learning, and another 10,000 validation samples are prepared for evaluating model performance and preventing overfitting.

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

[0060] The multi-level cross-attention long short-term memory neural network is particularly suitable for solving the micro-service load prediction problem, and the main reason is that the load of the micro-service system has complex time dependence and multi-dimensional feature correlation. Compared with the traditional autoregressive moving average model, the network can simultaneously process the trend, period and random three components, capture the long-term time dependence through the long short-term memory mechanism, and overcome the limitation that the traditional method can only process short-term dependence. Compared with the standard long short-term memory network, the multi-head cross-attention mechanism can automatically learn the correlation weight between different monitoring indicators, identify which indicators are more important for load prediction, and avoid the subjectivity of manual feature selection. The hierarchical attention propagation mechanism enables the network to learn feature representation at different abstraction levels, with the bottom layer attention focusing on local time patterns and the high-level attention focusing on global trend changes, forming a multi-level understanding ability from details to the whole, and significantly improving the prediction accuracy and generalization ability in complex load scenarios.

[0061] It should be noted that the first key technical idea of the present application is a multi-dimensional time series preprocessing mechanism based on seasonal and trend decomposition algorithm. Traditional load prediction methods usually directly use the original monitoring data for prediction, ignoring the different characteristics of the trend, periodic and random components in the time series. By decomposing the time series into three independent components, the present application can establish different learning strategies for long-term trends, periodic changes and random fluctuations, enabling the prediction model to more accurately capture the internal laws of load changes and avoid prediction bias caused by the mutual interference of different time characteristics components.

[0062] The second key technical idea is the fusion architecture of the multi-level cross-attention mechanism and the long short-term memory network. Existing attention mechanisms usually only learn feature correlation at a single level, while the multi-head cross-attention designed in the present application can exchange information between different attention heads, and the hierarchical propagation mechanism realizes progressive feature learning from local to global. This design enables the network to not only learn the time dependence of a single monitoring indicator, but also automatically discover complex correlation patterns between different indicators, significantly improving the accuracy and robustness of multi-dimensional load prediction compared with traditional methods.

[0063] The third key technical idea is an intelligent scheduling optimization mechanism based on improved genetic algorithm. Traditional container scheduling strategies usually use simple polling or least connection algorithm, which cannot adapt to dynamic changing load environment. The present application uses a three-layer coding structure to optimize node allocation, resource allocation and configuration parameters, combines adaptive crossover and mutation strategies and simulated annealing mechanism, and can find the global optimal solution under complex multi-dimensional constraint conditions, avoiding the problem that the greedy algorithm is easy to fall into local optimum, and realizing more balanced and efficient resource utilization.

[0064] The fourth key technical idea is the collaborative design of distributed cache consistency maintenance and fast startup mechanism. Traditional cache consistency protocols usually use a strong consistency model, resulting in high system performance overhead. The application realizes efficient eventual consistency guarantee through the combined use of vector clocks and Merkle trees, while the pre-warm pool mechanism and write-once-copy technology significantly reduce instance startup delay. The synergistic effect of the two makes the system both guarantee data consistency and quickly respond to scaling needs.

[0065] The synergistic effect of these key technologies forms a complete self-adaptive scaling system. Time series decomposition and multi-level attention networks provide a high-precision load prediction foundation, intelligent scheduling algorithms develop optimal resource allocation strategies based on prediction results, distributed consistency mechanisms ensure the correctness of the system state during scaling, and fast startup mechanisms ensure the timeliness of policy execution. Compared to traditional static scaling methods based on threshold triggers, the application forms a complete closed loop of prediction, optimization, execution, and feedback, actively adapting to load changes rather than passively responding, significantly improving system resource utilization efficiency and service quality stability.

[0066] It should be noted that traditional container startup requires pulling images from image repositories, decompressing image files, initializing runtime environments, and loading application dependencies, among other steps. The entire process usually takes 30 seconds or even longer. This long cold start delay makes it impossible for scaling operations to respond to sudden load requests, resulting in a decline in service quality during peak loads. The application addresses this issue by building a service pre-warm pool technology, which pre-starts and completes initialized container instances as hot standby resources, combined with pre-built layered image caching and write-once-copy memory management techniques, reducing container startup time from the traditional 30 seconds to less than 5 seconds.

[0067] It should be noted that during the dynamic scaling of microservice clusters, newly added or removed service instances need to maintain data synchronization with the existing cache system. Traditional strong consistency protocols such as two-phase commit or three-phase commit can guarantee data consistency but result in high communication overhead and latency, affecting the overall system performance. In particular, in large-scale clusters with a large number of nodes, the complexity of consistency maintenance grows exponentially. The application uses vector clock mechanisms to track cache state changes, implements fast detection of data consistency through Merkle tree structures, and uses gossip protocols to propagate information and start read repair mechanisms when inconsistencies are found. This eventual consistency model significantly reduces system overhead while ensuring data correctness, enabling efficient synchronization management of distributed caches.

[0068] Specifically, the principle of the present application is that the present application can solve the technical problem that the micro-service cluster cannot realize accurate prediction and autonomous expansion and contraction optimization under dynamic load change environment. The principle is that through the organic combination of multi-dimensional time series data decomposition and deep learning prediction model, the technical transformation from passive response to active prediction is realized. The STL decomposition algorithm decomposes the collected resource and business index time series data into trend component, periodic component and random component, effectively separates the long-term trend, periodic change and random fluctuation in the data, and provides structured feature input for subsequent neural network learning. This decomposition method conforms to the internal law of micro-service load change. The multi-level cross attention LSTM neural network captures the complex dependency relationship between different time scales and feature dimensions through the multi-head attention mechanism, realizes efficient use of attention information through weight sharing and hierarchical propagation mechanism, and can accurately model the nonlinear time series characteristics of micro-service load. The improved genetic algorithm adopts a three-layer coding structure and an adaptive crossover and mutation strategy, combines the elite reservation mechanism and the simulated annealing algorithm, avoids local optimal solution while ensuring global search ability, and realizes dynamic optimization of the container scheduling scheme. The distributed cache synchronization mechanism ensures data consistency and system stability during the expansion and contraction process through the synergistic effect of vector clock, Merkle tree and gossip protocol. The service warm-up pool and copy-on-write technology significantly reduce the container startup delay and improve the response speed of expansion and contraction through pre-built image cache and memory optimization. The entire technical solution forms a complete autonomous expansion and contraction closed loop from load prediction, scheduling optimization, cache synchronization to rapid deployment, and has the coordination and unity of forward-looking prediction, intelligent scheduling and efficient execution in technical logic.

[0069] A specific embodiment 1 of the present application is provided below, and the specific implementation of each step in embodiment 1 is described in detail as follows.

[0070] The specific implementation of step S01 is to deploy a lightweight monitoring agent on each physical node of the micro-service cluster. The agent collects the resource usage of the node through the system call interface of the operating system. The monitoring agent first obtains CPU usage data by reading the / proc / stat file, obtains memory occupancy rate information by parsing the / proc / meminfo file, obtains network throughput data by monitoring network interface statistics, and obtains disk input / output rate by reading the / proc / diskstats file. At the same time, the monitoring agent collects business indicators by embedding performance probes in the application program, including HTTP request response time, current active concurrent connection quantity, and the length of the message queue. The monitoring agent sets a timer to execute data collection operations every second, marks the collected indicator data with a timestamp, and then sends it to a centralized time series database for storage through a network transmission protocol.

[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 a period; This is the floor function. Random components are obtained through residual calculation:

[0080] .

[0081] The three components obtained by decomposition are input into a multi-level cross-attention long short-term memory neural network, which dynamically adjusts the weight parameters of each attention head in the multi-head cross-attention mechanism according to the input CPU usage rate change amplitude, memory occupancy rate peak level and variance statistical value of network throughput. The adjustment formula of the weight parameter is:

[0082] ;

[0083] In the formula, is the weight parameter of the i-th attention head, unitless; is the CPU usage rate change amplitude, unit: percentage; is the memory occupancy rate peak, unit: percentage; is the network throughput variance, unit: MB² / s²; is the weight coefficient, unitless, the value range is 0.3-0.5, 0.2-0.4, 0.1-0.3 respectively; is the attention head index; is the attention head number, the value range is 1-8. The information exchange between the attention heads in the multi-head cross-attention mechanism is realized by dot product operation:

[0084] ;

[0085] In the formula, is the attention weight of the i-th attention head and the j-th attention head, unitless; is the i-th attention head; is the j-th attention head; is the key vector of the i-th attention head; is the dimension of the key vector, the default value is 128. The calculation formula of the hierarchical attention propagation mechanism is: ;

[0086] ;

[0087] In the formula, is the bias term of the i-th layer; is the weighted coefficient, unitless, the value range is 0.1-0.2; is the attention head index; is the output of the i-th attention head of the j-th layer; is the network layer number, the value range is 1-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] wherein, is the cross probability of the th generation, unitless; is the maximum cross probability, unitless, default value is 0.9; is the minimum cross probability, unitless, default value is 0.6; is the total number of generations, unitless, default value is 100; is the current number of generations, unitless. The adaptive adjustment formula of mutation operation probability is:

[0100] ;

[0101] wherein, is the mutation probability of the th generation, unitless; is the maximum mutation probability, unitless, default value is 0.3; is the minimum mutation probability, unitless, default value is 0.1. The acceptance probability formula of simulated annealing algorithm is:

[0102] ;

[0103] wherein, is the probability of accepting inferior solution, unitless; is the energy difference of solution, unitless, calculated by ; is the current temperature parameter, unitless, initial value is 100, cooling coefficient is 0.95; is the new solution; is the current solution.

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

[0105] ;

[0106] , for ;

[0107] wherein, is the vector clock of node ; is the logical time of node itself, unitless; is the logical time of node recorded by node , unitless; ​​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, is the resource utilization deviation, with a unit of percentage; is the actual resource utilization, with a unit of percentage; is the target resource utilization, with a unit of percentage, and the default value is 70%.

[0120] It needs to be explained that the mathematical model of the STL decomposition algorithm effectively separates the long-term trend and periodic fluctuation mode in the load data by decomposing the complex time series into trend, cycle, and random three independent components. Compared with the traditional single time series prediction method, this decomposition model can more accurately identify the internal law of system load and provide clearer feature input for subsequent neural network prediction, significantly improving the accuracy of load prediction.

[0121] ;

[0122] The weight parameter dynamic adjustment formula realizes the adaptive weight distribution of the attention mechanism by introducing three key factors: CPU change amplitude, memory peak value, and network variance. Compared with the fixed weight attention mechanism, this dynamic adjustment method can automatically identify the most important monitoring indicators according to the current state of the system, improving the adaptability of the prediction model to different load scenarios.

[0123] ;

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

[0125] ;

[0126] The simulated annealing algorithm acceptance probability formula controls the acceptance probability of inferior solutions through the temperature parameter. In the high-temperature stage, it can accept larger energy differences to increase search diversity. As the temperature decreases, the probability of accepting inferior solutions gradually decreases, effectively avoiding the problem of genetic algorithm falling into local optimal solutions and improving the global search ability.

[0127] ;

[0128] The vector clock update rule accurately captures the causal relationship of events in a distributed environment by maintaining the logical timestamp of each node. Compared with the synchronization mechanism based on physical time, this logical clock method avoids the problem of clock drift, ensuring 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 of the prediction value and the actual value. Compared with the evaluation method of absolute error, the relative deviation calculation can better reflect the performance of the prediction accuracy under different load levels, supporting the accurate adjustment of the adaptive optimization mechanism.

[0131] It should be noted that the variables involved in the present application are explained in detail as shown in Tables 1 and 2.

[0132] Table 1 Variable explanation table (first part)

[0133]

[0134] Table 2 Variable explanation table (second part)

[0135]

[0136] In order to better understand and implement the present application, the following provides an embodiment 2 of a specific application scenario of the present application: an e-commerce technology team is facing the problem of service response delay of the online shopping platform micro-service cluster caused by load surge during the promotion activity. The traditional manual expansion and contraction method cannot timely respond to traffic bursts, and decides to use the self-expanding method based on STL decomposition and multi-level cross-attention LSTM neural network to solve this technical challenge. The platform has 12 micro-service modules including order service, payment service, inventory service, and user service, deployed in a Kubernetes cluster environment containing 32 computing nodes.

[0137] The technical team first deploys a distributed monitoring agent on the 32 nodes of the cluster, and each agent is responsible for collecting system resource indicators and business performance indicators of the node. The monitoring agent collects resource dimension data including CPU usage, memory occupancy, network throughput, and disk IO rate, and records business dimension data such as request response time, concurrent connection number, and queue length. The monitoring agent continuously collects data at a frequency of 1 per second, and all collected time series data is stored in the InfluxDB time series database, providing a data basis for subsequent load prediction analysis. In actual operation, the CPU usage of the order service node is maintained at 45% under normal circumstances, and the peak value can reach 92% during the promotion activity. The memory occupancy rate rises from 60% to 85%, and the network throughput surges from 200 Mbps to 1.2 Gbps.

[0138] The technical team built a multi-level cross-attention LSTM neural network model to realize the load prediction function. The network adopts a three-layer LSTM hidden layer structure, each layer containing 128 neuron units, and a multi-head cross-attention mechanism with 8 attention heads to realize feature interaction learning. The training data set comes from the historical 6-month monitoring data of the micro-service cluster. According to the time window size of 60 minutes and the sliding step size of 5 minutes, the training samples are constructed. The first 55 minutes of monitoring data are used as input features, and the last 30 minutes of load data are used as prediction targets. Finally, 50,000 training samples and 10,000 validation samples are generated. The model training uses the Adam optimizer, with a learning rate of 0.001, a batch size of 32, and a training of 200 rounds. The validation set loss converges to 0.0087. When applying the STL decomposition algorithm to preprocess the time series data, the trend component, periodic component and random component can be effectively separated, and the periodic component clearly reflects the load change rule of weekdays and weekends, day and night.

[0139] The load prediction result comparison data as shown in Table 3 shows that the multi-level cross-attention LSTM neural network maintains a high level of prediction accuracy in each time period.

[0140] Table 3 Comparison of load prediction accuracy in different time periods

[0141]

[0142] When calculating the expansion and contraction requirements according to the load prediction value, the technical team sets the expansion decision to be triggered when the load prediction value exceeds 80% of the current capacity, and the contraction decision to be triggered when the load prediction value is less than 30% of the current capacity. 30 minutes before a promotion activity, the system predicts that the load of the order service will rise from the current 45% to 87%, exceeding the expansion threshold, and automatically generates an expansion instruction to increase the number of order service instances from the current 8 to 14, with each instance allocated 2-core CPU and 4GB of memory resources. The load prediction of the payment service is from 38% to 76%, which also triggers the expansion decision, and the number of instances is expanded from 6 to 10. The inventory service does not trigger the expansion condition because the predicted load is only 52%, and maintains the current 3-instance configuration.

[0143] The technical team adopts an improved genetic algorithm to optimize the container scheduling scheme. The algorithm uses a three-layer coding structure to represent node allocation, resource allocation, and service configuration. The node coding layer uses integer coding to represent 32 physical nodes, the resource coding layer uses real number coding to represent CPU and memory allocation ratios, and the configuration coding layer uses binary coding to represent service running parameters. The adaptive crossover and mutation strategy dynamically adjusts the parameters according to the evolution degree of the population. The initial crossover probability is set to 0.8, and the mutation probability is 0.1. As the evolution generation increases, the crossover probability gradually decreases to 0.6, and the mutation probability increases to 0.3. The elite preservation mechanism preserves the top 10% individuals with the highest fitness in each generation to directly enter the next generation. Combined with the simulated annealing algorithm, the initial temperature is set to 100, and the cooling rate is 0.95 to avoid the algorithm falling into a local optimal solution. After 150 generations of evolution calculation, the optimal scheduling strategy is obtained, which allocates the new order service instances to nodes 7, 12, 18, 23, 28, and 31 with lighter loads.

[0144] As shown in Figure 2 In terms of distributed cache synchronization, the technical team tracks the cache state changes of each node based on the vector clock mechanism. Each node maintains a 32-dimensional vector to record the logical timestamps of itself and the other 31 nodes. When the 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 quickly detects cache data inconsistency by building a Merkle tree structure, and the root hash value changes from the original 0x7A3F2E1B to 0x9C5D4A2E. After detecting the inconsistency, the system starts the gossip protocol for information propagation. Node 3 randomly selects nodes 8, 15, and 22 as propagation targets and sends the update information to these three nodes. The receiving nodes continue to propagate to other nodes, and finally achieve data synchronization of 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 the local cache, ensuring eventual consistency.

[0145] The container rapid deployment mechanism uses a pre-built layered image cache and copy-on-write technology to significantly improve deployment efficiency. The technical team pre-builds a layered image containing the basic runtime environment, dependent library, and application code, and uses copy-on-write technology to make multiple container instances share the same read-only layer and only copy the difference when a write operation occurs. The service warm-up pool maintains 20 hot standby container instances that have completed application loading and dependency initialization. When the scaling instruction is issued, the corresponding service hot standby instance is directly selected from the warm-up pool for deployment. During the scaling process before the promotion activity starts, the deployment time of the 6 new instances of the order service is 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, which is significantly shorter than the traditional cold start method of 28-35 seconds.

[0146] The scaling operation execution effect statistical data as shown in Table 4 shows the actual performance of each indicator.

[0147] Table 4 Scaling operation execution effect statistical table

[0148]

[0149] The system continuously monitors the execution effect of the scaling operation, and calculates the deviation rate of the actual load and the predicted load in real time. When the deviation rate of the search service reaches 23.2%, which exceeds the threshold of 15%, the system automatically adjusts the weight parameters of the multi-level cross-attention LSTM neural network, and adjusts the weight distribution of the attention head from the original uniform distribution to focus on the network throughput and request response time indicators. When the resource utilization rate of the user service deviates from the target range by more than 10%, the system restarts the genetic algorithm to calculate the scheduling strategy and migrates the service instance to a node with more balanced load. Through this adaptive optimization mechanism, the system forms a closed loop of continuous learning and improvement, continuously improving the prediction accuracy and scheduling efficiency.

[0150] As Figure 3 shown, during the entire promotion activity, the microservice cluster successfully coped with the challenge of traffic surge through the autonomous expansion method. The total request quantity of the system increased from the usual 5000 per second to 18000 per second, and the average response time was maintained within 120 milliseconds, and the response time of 99% requests was controlled below 500 milliseconds. The availability of each microservice remained above 99.9%, and there was no service interruption due to high load. The total number of scaling operations was 47, of which 28 were scaling operations and 19 were scaling operations, and all operations were completed within the preset time window, providing strong technical support for the stable operation of the platform.

[0151] Compared with the traditional manual scaling mode, the STL decomposition combined with the multi-level cross attention LSTM neural network prediction method can accurately capture the time dependence and periodicity of load changes, and significantly improve the prediction accuracy. The multi-head cross attention mechanism realizes the deep fusion between different feature dimensions through information exchange and weight sharing, and the hierarchical attention propagation mechanism enables the network to learn multi-scale time dependence patterns. The improved genetic algorithm optimizes the scheduling decision through a three-layer coding structure and an adaptive crossover and mutation strategy, and effectively avoids local optimal solutions by combining the simulated annealing algorithm to generate a better resource allocation scheme. The distributed cache synchronization mechanism based on vector clock and Merkle tree ensures data consistency while reducing synchronization overhead, and the fault tolerance feature of the gossip protocol improves system reliability. The application of copy-on-write technology and service warm-up pool significantly shortens the container startup time and improves the scaling response speed. The adaptive optimization closed loop realizes the continuous improvement of the system through real-time monitoring and parameter adjustment, forming an intelligent operation and maintenance management capability.

[0152] The above merely illustrates the specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which shall be covered within the protection scope of the present application.

Claims

1. A method for autonomously extending microservices and low-code platform applications, characterized in that, This includes 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 the data in a time-series database. The collected time-series data is decomposed into three dimensions using the STL decomposition algorithm. The decomposition results are then input into a pre-trained multi-level cross-attention LSTM neural network to generate load prediction values. The scaling requirements are calculated based on the difference between the load prediction values ​​and the current resource utilization rate, and scaling instructions are generated. An improved genetic algorithm is then initiated to optimize the container scheduling scheme and calculate the optimal scheduling strategy. The system tracks the state changes of the hierarchical cache based on a vector clock mechanism, constructs a Merkle tree structure to detect cache data consistency, and uses the gossip protocol to propagate update information when inconsistency is detected. It also initiates a read repair mechanism to maintain distributed cache synchronization. When starting a container instance, it uses a pre-built hierarchical image cache, adopts write-on-write replication technology, and selects a hot standby instance from the service preheating pool for deployment. The system monitors the execution effect of scaling up and down operations in real time to form an adaptive optimization closed loop. 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. 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 change in CPU utilization, the peak memory usage, and the variance of network throughput, thereby generating load prediction values ​​for the next 30 minutes. 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.

2. The method for autonomous expansion of microservices and low-code platform applications according to claim 1, characterized in that, The multi-level cross-attention LSTM neural network achieves weight sharing 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. 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.

3. The method for autonomous expansion of microservices and low-code platform applications according to claim 2, characterized in that, When calculating scaling up or down requirements 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.

4. The method for autonomous expansion of microservices and low-code platform applications according to claim 3, characterized in that, When monitoring the performance of scaling up and down operations in real time, the deviation rate between the actual load and the predicted load is calculated. When the deviation rate exceeds 15%, the weight parameters of the multi-level cross-attention LSTM neural network are adjusted.

5. The method for autonomous expansion of microservices and low-code platform applications according to claim 4, characterized in that, The periodic component specifically refers to the component in time series data that has a fixed periodic repetition pattern, reflecting the regular changes in the system within a fixed time interval.

6. The method for autonomous expansion of microservices and low-code platform applications according to claim 5, characterized in that, The three-layer coding structure specifically 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.

7. The method for autonomous expansion of microservices and low-code platform applications according to claim 6, characterized in that, The adaptive crossover and mutation strategy specifically adjusts the crossover and mutation probabilities dynamically 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.

Citation Information

Patent Citations

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

    CN118260021A

  • Micro-service joint deployment and capacity expansion and contraction method, device and system

    CN119621080A