LLM-enhanced intelligent micro-service migration method and system in cloud-side environment
By using LLM and LSTM in cloud-edge environment for microservice abnormality analysis and positioning, and combining dynamic GCN and BO for migration decisions, the problems of performance fluctuations and exception handling of microservices in cloud-edge environments are solved, and the long-term stability of system performance and reduction of operating costs are achieved.
Patent Information
- Application Number
- CN202411644819.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-02-25
AI Technical Summary
In cloud-edge environments, the performance of microservices may fluctuate over time, especially during peak loads, resulting in a degradation in service performance. In addition, abnormal situations such as node failures, resource limitations and security vulnerabilities may affect system stability, and effective anomaly analysis, root cause positioning and migration scheduling methods are needed to improve system performance and reduce operating costs.
The microservice positioning method to be migrated based on LLM and LSTM is adopted, and the multi-objective microservice migration decision-making method of dynamic GCN and BO is combined to analyze and determine whether microservice migration is needed, accurately locate the root cause microservices, and determine the appropriate migration plan based on the node resource differences and long-term performance.
By deeply analyzing the dependencies of exception events and microservices, accurately locate the microservices to be migrated, optimize the storage of exception events, predict the long-term performance of migration candidates, comprehensively consider performance and cost, realize the long-term stability of system performance and reduce operating costs.
Smart Images

Figure CN119520228A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method and system for abnormal analysis, root cause location and migration scheduling of microservice applications in a cloud edge environment, and belongs to the field of microservice technology. Background Art
[0002] With the development of technologies such as the Internet of Things, artificial intelligence, big data, and cloud native, cloud-edge collaboration integrates the advantages of cloud computing and edge computing and is gradually becoming the mainstream computing model. At the same time, with the development and popularization of microservice architecture, user-oriented applications are also gradually evolving from traditional monolithic architecture to microservice architecture. Microservice architecture decouples user-oriented applications based on monolithic architecture into large-scale, fine-grained, independently deployable and scalable microservices, making it possible to deploy user-oriented applications in a cloud-edge environment. When deploying user-oriented applications in a cloud-edge environment, different services can be flexibly deployed on edge nodes or cloud nodes according to demand, which can not only benefit from the low access latency of edge nodes, but also make full use of the high computing power of cloud nodes to meet the needs of large-scale complex computing tasks.
[0003] Although the deployment of user-oriented applications based on microservice architecture in the cloud-edge environment can effectively reduce response latency, the performance of microservices may fluctuate over time as user demand, load distribution, and resource conditions change dynamically. Especially during peak load periods, the resources within a node may not be able to meet the needs of large-scale loads, resulting in degraded service performance. In addition to the above anomalies, there may also be node failures, resource limitations, and nodes being attacked by security vulnerabilities, all of which may further affect the stability of the system and service quality. Therefore, in order to alleviate the above situation, how to effectively analyze anomalies in the cloud-edge environment, accurately locate the root cause, and determine the appropriate migration plan for microservice migration to improve system performance stability and reduce operating costs has become a key issue that needs to be solved urgently.
[0004] There are several challenges in solving the above problems: First, the types of exceptions that require microservice migration are numerous and complex, such as node failures, resource limitations, node security vulnerability attacks, etc. These exceptions may affect the stability and performance of user-oriented applications. In addition, the dependencies between microservices will cause exceptions to propagate in the system. Second, the migration space of microservices is very large. Each migration path of the microservice to be migrated to all target nodes constitutes a different microservice migration candidate. The microservice migration candidate will grow exponentially with the expansion of the system scale, and different nodes have differences in resource configuration such as computing, storage, and bandwidth, which makes it more difficult to traverse and evaluate all microservice migration candidates to determine the best migration solution. In addition, microservices have an event regression effect, which means that when a microservice is migrated, its impact may not be immediately apparent, but gradually manifested after a period of time, which increases the difficulty and uncertainty of decision-making. Therefore, how to analyze multiple anomalies and determine whether microservice migration is needed, accurately locate the root cause microservice based on microservice dependencies, and determine the appropriate migration plan based on node resource differences and long-term performance, thereby ensuring the long-term performance stability of the system and reducing system operating costs, has become a key issue that must be solved during the microservice migration process.
[0005] Existing research on microservice migration mainly focuses on migration decisions in two key scenarios: the first is the migration triggered by node resource shortage, which is usually caused by the saturation of computing, storage or network resources of some nodes, resulting in the performance degradation of the microservices running on them; the second is when the system's Quality of Service (QoS) is violated and the problem is not solved by resource adjustment (such as increasing CPU, memory, etc.). However, the migration triggering conditions considered in the above studies are not comprehensive and cannot cover all abnormalities that may require migration. For example, hardware failure of the node, such failures may include disk damage, network card failure or physical machine downtime, which often cause some or all microservices in the system to be unavailable, thereby affecting the stability of the overall service. In addition, the latest work on microservice migration scheduling in cloud-edge environments has begun to determine the migration plan and perform microservice migration based on the prediction of the potential performance gain or communication overhead in the next time step. For example, some studies have inferred the potential performance gain of microservices in the next time step based on the product of the delay percentage and the delay variation coefficient of the previous time step, and predicted the network overhead after migrating microservices based on bandwidth and round-trip delay, giving priority to migrating microservices with a larger ratio of potential performance gain to network overhead after migration. Other studies have given priority to migrating microservices with small communication increments based on the target node of each microservice migration candidate and the resource status of the microservice to be migrated. However, these methods all ignore the long-term performance of microservices after migration, which may lead to frequent microservice migrations, thereby increasing the network burden and possibly causing service interruptions or performance degradation. Summary of the invention
[0006] In view of the challenges and problems faced by microservice migration in a cloud-edge environment, the present invention proposes an intelligent microservice migration method enhanced by LLM in a cloud-edge environment. First, a method for locating microservices to be migrated based on LLM and LSTM is used to analyze and determine whether the current anomaly requires microservice migration based on historical abnormal events that need to be migrated. If migration is required, the microservice to be migrated (i.e., the root cause microservice) that causes the anomaly is accurately located. At the same time, LSTM is used to optimize the storage of abnormal events that need to be migrated to enhance decision-making capabilities. On this basis, a multi-objective microservice migration decision method based on dynamic GCN and BO is used to intelligently select appropriate nodes for each microservice to be migrated for migration, thereby ensuring the stability of the long-term performance of the system and reducing operating costs.
[0007] The present invention also proposes an LLM-enhanced intelligent microservice migration system in a cloud-edge environment.
[0008] Terminology explanation:
[0009] 1. Event Regression Effect: refers to the impact of certain historical events on future workloads in microservice workload prediction. In a microservice architecture, specific events or operations (such as peak requests, system updates, or failures) may cause workload fluctuations in the short term. The impact of these historical events is not limited to immediate load changes, but may also affect future workload patterns through complex dependencies and feedback mechanisms.
[0010] 2. Large Language Model (LLM): It is a natural language processing model based on deep learning, with a large number of parameters and training data, which can understand and generate natural language text. This type of model learns the structure, grammar, semantics and contextual relationships of the language through pre-training on massive text data, so as to have the ability to generate coherent and contextual text. LLM usually adopts the Transformer architecture, which can process long texts and achieve efficient parallel computing. It is widely used in various tasks such as text generation, machine translation, question-answering systems and dialogue generation. Due to its good language understanding and generation capabilities, LLM has attracted widespread attention and research in the field of artificial intelligence.
[0011] 3. Sentence Transformer: It is a tool based on pre-trained language models (such as BERT) that is used to convert sentences or text fragments into high-dimensional vector representations to capture their semantic information. These embedded vectors can be used to calculate the similarity between texts and are suitable for tasks such as semantic search, text classification, and clustering. Compared with traditional word frequency-based methods, Sentence Transformer can better understand context and semantics, and the generated vectors show higher accuracy in measuring text semantic similarity, which makes it widely used in application scenarios such as question-answering systems, document search, and semantic matching.
[0012] 4. FAISS (Facebook AI Similarity Search): It is an open source library developed by Facebook AI Research, which is specifically designed for efficient similarity search in large-scale vector data. The advantage of FAISS lies in its fast indexing and retrieval capabilities for high-dimensional vectors, and it can handle millions or even billions of data. It supports multiple index structures, such as inverted files and hierarchical approximate small-world graphs, and provides a solution that balances accuracy and efficiency for approximate nearest neighbor search. FAISS is widely used in scenarios that require large-scale similarity calculations, such as recommendation systems, image search, and cluster analysis.
[0013] 5. LSTM network (Long Short-Term Memory, LSTM): It is a special type of recurrent neural network (RNN) that aims to solve the gradient vanishing and gradient exploding problems faced by traditional RNN when processing long sequence data. LSTM effectively controls the flow of information in the network by introducing three main gating mechanisms - input gate, forget gate and output gate. The input gate determines the importance of the current input information, the forget gate controls the degree of retention of past information, and the output gate determines which information will be output. Through this structure, LSTM is able to maintain the memory of important information over a long span of time, while promptly forgetting irrelevant information, thereby improving the modeling ability of time series data. This makes LSTM widely used in fields such as natural language processing, speech recognition and time series prediction.
[0014] 6. Graph Neural Network (GNN): It is a deep learning model specifically designed to process graph structured data. A graph is a data structure consisting of nodes (or vertices) and edges (relationships connecting nodes), which is widely used in social networks, recommendation systems, chemical molecules and other fields. GNN can effectively capture the relationship between nodes and the global structural information of the graph by iteratively updating the features of nodes and their neighbors. Specifically, GNN adopts an information propagation mechanism, allowing nodes to exchange information with other nodes through edges, so as to learn richer feature representations. GNN can process irregular structured data and perform well in tasks such as graph classification, node classification, and link prediction.
[0015] 7. Sparsity-inducing Mechanism: It is a technique that uses specific strategies or regularization methods in machine learning models to make model parameters or features sparse (that is, most parameters are zero or close to zero). Its goal is to reduce unnecessary or unimportant parameters in the model and retain the most critical parts, thereby improving the interpretability of the model, reducing computational complexity, and reducing the risk of overfitting. Common sparsity inducing methods include L1 regularization, which achieves sparsity by increasing the penalty for non-zero parameters in the model so that some weights tend to zero. This mechanism is widely used in high-dimensional data, neural networks, compressed sensing and other fields.
[0016] 8. BO (Bayesian Optimization, BO): is a global optimization method, mainly used to optimize the objective function that is expensive or difficult to obtain in analytical form. BO approximates the objective function by constructing a probabilistic model (usually a Gaussian process), and then selects the next sampling point based on the model to maximize the expected improvement (Expected Improvement, EI) or other sampling criteria. Because BO can effectively use the acquired data to guide the subsequent sampling process, it is particularly suitable for optimizing functions with noisy, non-convex or high-dimensional characteristics. This method has been widely used in fields such as hyperparameter tuning, engineering design, and experimental science.
[0017] 9. Pareto Optimality: Also known as Pareto efficiency, it is an ideal state of resource allocation, which means that in a specific resource allocation, it is impossible to make at least one individual better off without making any individual worse off. Pareto optimality means that there is no possibility of further Pareto improvement. In other words, Pareto optimality is achieved through continuous Pareto improvement. It should be noted that Pareto optimality does not necessarily guarantee the fairness of resource allocation, and uneven resource allocation may occur. In multi-objective optimization problems, the Pareto optimal solution set represents the trade-off between different objectives, making it impossible to further improve a certain objective without sacrificing the performance of other objectives.
[0018] 10. SMSego (Single-Objective Multi-Scenario Expected Improvement): is an acquisition function designed to optimize single-objective optimization problems in multiple scenarios. It evaluates the potential superiority of candidate solutions by combining the expected improvements (EI) in different scenarios. Specifically, SMSego calculates the expected improvement in each scenario, and then weights or combines these expected improvements to obtain a comprehensive indicator for selecting the next evaluation point. This method is particularly suitable for optimization tasks that need to consider multiple uncertainties or changing scenarios. It can effectively balance the relationship between exploring new areas and utilizing existing information, thereby improving the efficiency and accuracy of global optimization.
[0019] The present invention proposes an intelligent microservice migration method enhanced by LLM in a cloud-edge environment, aiming to solve the complex challenges faced in the process of microservice migration, reduce unnecessary frequent migration, improve the long-term stability of system performance and reduce operating costs. Specifically, the present invention adopts a method for locating microservices to be migrated based on LLM and LSTM, migrates historical abnormal events of microservices as needed, and uses LLM with good performance in complex reasoning and understanding context to deeply analyze the historical abnormal events of microservices that need to be migrated and the complex dependencies of microservices, understand the potential patterns and causal relationships, thereby improving the accuracy of judging whether the current abnormality requires microservice migration and locating the microservices to be migrated that cause the abnormality. At the same time, LSTM is used to optimize the storage of abnormal events that need to be migrated to improve the accuracy of decision-making. On this basis, a multi-objective microservice migration decision method based on dynamic GCN and BO is introduced, and dynamic GCN is used to learn the dependencies between microservices and capture the spatiotemporal characteristics between microservices, so as to accurately predict the long-term performance of different migration candidates. Based on this, BO is used for efficient search and uncertainty modeling, and the long-term performance and operating costs of microservices are comprehensively considered. In the complex microservice migration space, the appropriate target node can be intelligently selected for each microservice to be migrated, thereby avoiding network congestion, service interruption, performance degradation, and unbalanced resource utilization caused by frequent microservice migration. Problems ensure the long-term stable performance of the system after migrating microservices and reduce operating costs.
[0020] The technical solution of the present invention is:
[0021] The LLM-enhanced intelligent microservice migration method in the cloud-edge environment includes:
[0022] The method for locating microservices to be migrated based on LLM and LSTM analyzes and determines whether the current anomaly requires microservice migration based on the historical abnormal events that need to be migrated. If migration is required, the microservice to be migrated that caused the abnormality is accurately located.
[0023] A multi-objective microservice migration decision method based on dynamic GCN and BO is adopted to intelligently select the appropriate node for each microservice to be migrated according to the long-term performance and operation cost of the microservice.
[0024] According to a preferred embodiment of the present invention, a method for locating microservices to be migrated based on LLM and LSTM analyzes and determines whether the current abnormality requires microservice migration according to the historical abnormal events that need to be migrated; including:
[0025] Reasoning about the microservices to be migrated based on LLM: Parse the logs, monitoring indicators, and tracking information of abnormal events, convert unstructured data into structured context information through vectorization processing, and analyze and determine whether the current abnormality requires microservice migration based on the historical abnormal events that need to be migrated. If migration is required, use LLM to determine the microservices to be migrated to support subsequent microservice migration decisions.
[0026] LSTM-based abnormal event storage optimization: By integrating short-term memory and long-term memory mechanisms, the storage of abnormal events that need to be migrated is optimized to enhance decision-making capabilities.
[0027] Preferably, according to the present invention, the reasoning of the microservice to be migrated based on LLM includes:
[0028] Make decisions based on LLM: Through vector processing, the unstructured data of historical abnormal events that need to be migrated is converted into structured context information. Based on the context information, it is determined whether the current abnormality requires microservice migration. If migration is determined to be necessary, the microservice to be migrated is located.
[0029] Evaluation based on historical comparison and similarity measurement: Verify the results of the preliminary inference by comparing the abnormal event performance that needs to be migrated with the historical event data, and use similarity measurement to determine the similarity between the current abnormal event and the historical abnormal event, so as to further verify the validity of the inference;
[0030] Dynamic adjustment based on self-feedback: Update the loss function and optimize the model to generate more accurate inference results.
[0031] Further preferably, making a decision based on LLM includes:
[0032] First, collect and annotate abnormal events that require microservice migration;
[0033] Annotate each case to ensure that the information is complete and clearly structured;
[0034] Secondly, the Sentence Transformer model is used to vectorize the logs, monitoring indicators, and tracking information related to the i-th historical abnormal event of the microservice to be migrated, and convert them into structured context information, namely context data MigraA. H Stored in the database, the conversion process is as follows:
[0035]
[0036] Among them, logs, metrics, and traces refer to the logs, monitoring indicators, and tracking information related to the i-th historical abnormal event of the microservice to be migrated, respectively; f is a data preprocessing function that converts unstructured data into contextual representation;
[0037] When an abnormal event occurs AnomN i When the FAISS library calculates the current abnormal event vector AnomN i Vector MigraA with historical abnormal events H The L2 distance between them is used to calculate the similarity between these vectors. If the L2 distance is less than the threshold, it means that the anomaly or fault needs to be migrated.
[0038] Finally, the GPT-4 model is selected as the inference model, based on the context data MigraA H Reasoning about the microservices to be migrated; current abnormal event AnomN i When microservice migration is required, set M i For the i-th microservice, the inference model represents h according to its context i To estimate the probability that the microservice is the microservice to be migrated, the calculation is as follows:
[0039] h i =Transformer(MigraA H ,M i )
[0040]
[0041] Among them, h i is the vector representation generated after contextual reasoning, W is the weight matrix, Represents microservice M i is the probability of the microservice to be migrated. The score of each microservice is converted into a probability distribution through the Softmax function. Preliminary output includes abnormal events of all potential microservices to be migrated based on the set thresholds
[0042] Preferably, according to the present invention, the evaluation based on historical comparison and similarity measurement includes:
[0043] Will include all abnormal events of potential microservices to be migrated Historical abnormal events The comparison is as follows:
[0044]
[0045] Among them, historical abnormal events It refers to the vectorized representation of historical abnormal events that need to be migrated microservices; ΔMigrA i Is the absolute value of the difference between the dimensions of the two vectors, that is, the Manhattan distance. If ΔMigrA i If it does not exceed a certain threshold ε, the rationality of the initial inference is further confirmed;
[0046] By similarity measurement To compare the similarity between the current event and the historical abnormal event to verify the validity of the inference, the calculation formula is as follows:
[0047]
[0048] If the similarity Greater than 0.85, confirming an abnormal event The microservices to be migrated in the final output are abnormal events All microservices to be migrated
[0049] Preferably, the dynamic adjustment based on self-feedback according to the present invention comprises:
[0050] Define the loss function L to measure the error between the feedback information and the current inference result; assume is the true value, and the loss function is defined as follows:
[0051]
[0052] Where N is the number of samples, and the gradient descent method is used to optimize the loss function. The calculation formula of the gradient of the loss function to the parameter is as follows:
[0053]
[0054] Among them, θ is a parameter, Represents the learning rate; generates a new inference result, the formula is as follows:
[0055]
[0056] Among them, AnomN i refers to the current abnormal event, θ' is the updated model parameter, and f is the forward propagation function of the GPT-4 model.
[0057] Preferably, according to the present invention, the abnormal event storage optimization based on LSTM includes:
[0058] At each inference, the short-term memory stores the input data in the current state and the corresponding inference results in the short-term memory, that is, the current input data AnomN i and inference results Stored in short-term memory; the storage formula of short-term memory is as follows:
[0059]
[0060] in, It is a short-term memory storage used to record recent abnormal event data and inference results;
[0061] The storage formula for long-term memory is as follows:
[0062]
[0063] in, It is a long-term memory storage that records the relevant data of the inference results with high accuracy during the inference process of the model.
[0064] AnomN i , They are respectively the input information, feedback information and true value of the microservices that need to be migrated.
[0065] Preferably, according to the present invention, a multi-objective microservice migration decision method based on dynamic GCN and BO is adopted to intelligently select a suitable node for each microservice to be migrated according to the long-term performance and operation cost of the microservice; including:
[0066] Long-term performance prediction based on dynamic GCN: Use dynamic GCN to predict the long-term performance of different microservice migration candidates and use the prediction results as input;
[0067] BO-based multi-objective microservice migration decision: Determine the final migration plan based on the long-term performance and operating cost of the microservice, and migrate the microservice to be migrated to the appropriate target node.
[0068] Further preferably, long-term performance prediction based on dynamic GCN includes:
[0069] Define the microservice spatial structure dependency graph: Represent the microservice as a spatial structure dependency graph G s =(V,E s ,A s ) and the dynamic association graph G D =(V,E D ,A D ), where V is a node set, |V|=N is the number of nodes, and each node represents a microservice instance; the spatial structure dependency graph and the dynamic association graph share the same nodes but have different edges and edge weights, E S and E D They represent the edge sets of different graphs respectively;
[0070] Defining the delay matrix: Taking the nodes in the microservice spatial structure dependency graph G as the collection points, the observations collected at time t are defined as the delay matrix X t =(x t,1 ,x t,2 ,...,x t,N )∈R N×C , where X t,v ∈R C It is defined as the feature vector of node v at time t, and C is the number of values of the collection points;
[0071] Defining microservice delay prediction: Given the historical delay matrix X of the past m time steps = (X t-m+1 ,X t-m+1 ,...,X t )∈R N×m The goal of microservice delay prediction is to learn the mapping function f from the historical delay observations, and combine the N microservices on the microservice spatial structure dependency graph G to predict the delay matrix of the next n time steps:
[0072] f t-m+1,t-m+2,...,n (G)→(X t+1 ,X t+2 ,...,X t+n )
[0073] The encoder-decoder framework embeds features on the input data. The encoder-decoder framework includes an encoder and a decoder. The encoder extracts performance features and the decoder generates future delay predictions. The encoder and decoder are stacked with multiple identical encoder and decoder layers, respectively. The temporal convolution sparse multi-head self-attention mechanism module processes the entire time series at the same time, and introduces an embedding module to add a time position embedding vector to each element of the initial sequence. The temporal convolution sparse multi-head self-attention mechanism module captures the dynamic time correlation of delays between nodes. The spatial dynamic convolution module captures the dynamic change pattern of microservice space under different microservice migration candidates.
[0074] Use the time convolution sparse multi-head self-attention mechanism to process time series in parallel rather than sequentially. The formal definition of the time convolution sparse multi-head self-attention mechanism is as follows:
[0075] SpSelfMulitHead(Q,K,V)=Concat(head1,...,head h )W O
[0076] head i =Attention(Q*W i Q ,K*W iK ,V*W i V )
[0077] Among them, h represents the number of attention modules, W i Q , W i K , W i V They refer to the projection matrices on Q, K, and V respectively, and W O Represents the projection matrix of the final output, Concat represents the concatenation operation, Q, K, and V are the query matrix, key matrix, and value matrix respectively; SpSelfMulitHead(Q,K,V) concatenates the outputs of all heads, head i is the output of each head;
[0078] The sparse processing is performed through Top-K sparsification. The attention weight is used to capture the dynamic time correlation degree of delay between services. The attention weight is calculated as follows:
[0079]
[0080] Among them, Weight(i,j) represents the dynamic time correlation degree of the delay between microservice i and microservice j, Q i is the query vector of the i-th microservice, K j is the key vector of the jth microservice. The transposition operation T transforms K j From column vector to row vector, the input of the l+1th layer encoder is X l After all nodes are operated by the inter-convolution sparse multi-head self-attention mechanism, the intermediate representation M of the sequence is obtained. l =(M l,t-n+1 ,M l,t-n+2 ,...,M l,t );
[0081] Design a spatial dynamic graph convolutional network. The spatial dynamic graph convolutional network includes a dynamic adjacency matrix construction module and a dynamic graph convolutional layer module. The dynamic adjacency matrix construction module dynamically generates an adjacency matrix based on the delay information, migration dependencies, and global structure information between microservices to capture dependencies that change over time. The dynamic graph convolutional layer module performs convolution operations on the dynamic dependency features of microservices based on the constructed dynamic adjacency matrix to extract spatiotemporal features. The dynamic adjacency matrix construction formula is as follows:
[0082] A ij (t)=αh(la(i,j,t))+βf(mi_de(i,j))+γg(gl_de(i,j))
[0083] Among them, la(i,j,t) is the delay between microservice i and microservice j at time t, h(·) is an increasing function, mi_de(i,j) is the dependency relationship between the migrated microservice i and microservice j under the current migration candidate option, f(·) is a mapping function, gl_de(i,j) is the global topology of the microservice system, that is, all microservices i and microservice j with dependencies, g(·) is a mapping function, α, β, γ are weight coefficients used to balance the influence of information from different sources; the calculation process of dynamic graph convolution is as follows:
[0084] X l+1 =σ((AΘWeight(i,j))M l W)
[0085] Among them, X l+1 is the output of the l-th convolution layer, A is the dynamic adjacency matrix, Weight(i,j) is the weight matrix of the temporal convolutional sparse multi-head self-attention mechanism, σ(·) is the activation function, Θ is the Hadamard product, and W is the learnable weight matrix;
[0086] Using the Transformer time embedding method, add a time position embedding vector to each element in the initial sequence so that adjacent elements have similar representations. Select a fixed position embedding for the input element at position t to obtain the time embedding matrix ETP(t). Using sine and cosine functions, each vector dimension 1≤d≤dmodel is as follows:
[0087]
[0088] Where i is the index of the current dimension and d is the dimension of the embedding vector;
[0089] Add the spatial embedding matrix ESP and the temporal embedding matrix ETP to the microservice performance sequence to generate a microservice performance sequence that retains the spatial heterogeneity and temporal order information of nodes;
[0090] The decoder is composed of L identical decoder layers stacked together; each decoder layer includes a temporal convolutional sparse multi-head self-attention mechanism and a spatial dynamic graph convolutional network. l+1 =(X L,t-m+1 ,X L,t-m+2 ,...,X L,t ), the decoder part uses another L decoding layers to predict the long-term delay sequence y of future microservice migration candidates L =(X L,t+1 ,X L,t+2 ,...,X L,t+m ).
[0091] Preferably, according to the present invention, a multi-objective microservice migration decision based on BO includes:
[0092] Use the SMSego acquisition function to find the microservice migration solution that can maximize the expected improvement in the microservice migration candidate space; after evaluating the performance and operating cost of the microservice migration solution, add the results to the training data, update the proxy model, and use the newly obtained data points to optimize the Gaussian process model parameters to better fit the true value of the objective function; each selected Pareto optimal microservice migration solution is executed until all microservices to be migrated have completed the migration or the maximum number of iterations has been reached.
[0093] Further preferably, the objective function is defined as follows:
[0094]
[0095] in, and are the operating cost target and the performance target, respectively. α and β are weights, reflecting the importance of performance and operating cost, and their sum is 1;
[0096] The cost objectives are defined as follows:
[0097]
[0098] in, and Execute migration candidates The overall network traffic cost and computing cost after ;
[0099] The number of nodes required at time step t is calculated as follows:
[0100]
[0101] Among them, T t is the total flow that needs to be processed at time step t, Ω cpu ,Ω mem are the number of CPU cores and memory size that each node can provide, in GB, U cpu , U mem They are the CPU core usage and memory usage required per unit flow, It is a round-up operation to ensure that the number of nodes is an integer; the cost is calculated as follows:
[0102]
[0103] Among them, Θ compute is the price per node;
[0104] The traffic cost is calculated as follows:
[0105]
[0106] in, Indicates that when microservice c i and c j When they are on different nodes, the condition is true, Θ traffic is the traffic fee per GB. is the time t from microservice c i to c j Traffic demand;
[0107] Microservice Migration Candidates Microservice performance quality indicators are used to evaluate the overall latency impact of microservice migration candidates on all microservices. The performance goals are defined as follows:
[0108]
[0109] Among them, |M| is the total number of microservices, and the overall impact of all microservices is considered by taking the average value, τ M is the weight of microservice M, which is used to reflect the importance of different microservices. Is a candidate for microservice migration Lat(M) is the new delay under, Lat(M) is the current delay;
[0110] Specify a collection function and a surrogate model in the optimization loop; the collection function uses the SMSego collection function, and for the surrogate model, a single-output Gaussian process is selected for each target;
[0111] In the process of BO, the SMSego acquisition function is used to balance exploration and utilization in the target space. The SMSego acquisition function is as follows:
[0112]
[0113] in, represents the jth objective function value of the current Pareto optimality, represents the j-th objective function value of Gaussian process prediction, and E is the expected value of uncertainty;
[0114] The Gaussian process prediction of the target function is defined as follows:
[0115]
[0116] in, Is the objective function in the microservice migration candidate The mean prediction at is the covariance function, and the proxy model is continuously adjusted through the Bayesian update mechanism.
[0117] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, steps of an LLM-enhanced intelligent microservice migration method in a cloud edge environment are implemented.
[0118] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of an LLM-enhanced intelligent microservice migration method in a cloud-edge environment.
[0119] The LLM-enhanced intelligent microservice migration system in the cloud-edge environment includes:
[0120] The microservice migration judgment module is configured as follows: based on the LLM and LSTM-based microservice location method to be migrated, it analyzes and determines whether the current anomaly requires microservice migration according to the historical abnormal events that need to be migrated. If migration is required, it accurately locates the microservice to be migrated that causes the anomaly;
[0121] The migration module is configured to: adopt a multi-objective microservice migration decision method based on dynamic GCN and BO, and intelligently select a suitable node for each microservice to be migrated according to the long-term performance and operating cost of the microservice.
[0122] Preferably, according to the present invention, the microservice migration judgment module includes a microservice reasoning module to be migrated based on LLM and an abnormal event storage optimization module based on LSTM;
[0123] The LLM-based microservice inference module to be migrated is configured to: parse the logs, monitoring indicators and tracking information of abnormal events, convert unstructured data into structured context information through vectorization processing, and analyze and determine whether the current abnormality requires microservice migration based on the historical abnormal events that need to be migrated; if migration is required, LLM is used to determine the microservices to be migrated to support subsequent microservice migration decisions;
[0124] The LSTM-based abnormal event storage optimization module is configured to enhance decision-making capabilities by integrating short-term memory and long-term memory mechanisms and optimizing the storage of abnormal events that need to be migrated.
[0125] Preferably, according to the present invention, the migration module includes a long-term performance prediction module based on dynamic GCN and a multi-objective microservice migration decision module based on BO;
[0126] The long-term performance prediction module based on dynamic GCN is configured to: use dynamic GCN to predict the long-term performance of different microservice migration candidates and use the prediction results as input;
[0127] The BO-based multi-objective microservice migration decision module is configured to determine the final migration plan based on the long-term performance and operating cost of the microservices, and migrate the microservices to be migrated to the appropriate target nodes.
[0128] Preferably, according to the present invention, the LLM-based microservice reasoning module to be migrated includes a decision module based on LLM, an evaluation module based on historical comparison and similarity measurement, and a dynamic adjustment module based on self-feedback;
[0129] The LLM-based decision module is configured to: transform the unstructured data of historical abnormal events that need to be migrated into structured context information through vector processing, and determine whether the current abnormality requires microservice migration based on the context information; if it is determined that migration is required, locate the microservice to be migrated;
[0130] The evaluation module based on historical comparison and similarity measurement is configured to: verify the results of the preliminary inference by comparing the abnormal event performance that needs to be migrated with the historical event data, and judge the similarity between the current abnormal event and the historical abnormal event through similarity measurement, so as to further verify the validity of the inference;
[0131] The dynamic adjustment module based on self-feedback is configured to update the loss function and optimize the model to generate more accurate inference results.
[0132] The beneficial effects of the present invention are:
[0133] The present invention implements an intelligent microservice migration method enhanced by LLM in a cloud-edge environment. It uses a method for locating microservices to be migrated based on LLM and LSTM. According to the historical abnormal events that need to be migrated, the complex reasoning and context understanding capabilities of LLM are used to deeply analyze the historical abnormal events and their microservice dependencies, thereby significantly improving the accuracy of judging whether the current abnormality needs to be migrated, and accurately locating the microservices to be migrated that cause the abnormality. At the same time, the introduced LSTM optimizes the storage and inference process of abnormal events that require microservice migration, further enhancing the accuracy of migration decisions. On this basis, through a multi-objective microservice migration decision method based on dynamic GCN and BO, dynamic GCN is used to learn the dependencies between microservices, accurately capture the spatiotemporal characteristics of microservices, and more effectively predict the long-term performance of different migration candidates. Based on this, BO uses efficient search strategies and uncertainty modeling, comprehensively considers the long-term performance and operating costs of microservices, and can intelligently select suitable nodes for each microservice to be migrated in the huge migration candidate space, effectively avoiding network congestion, service interruption, performance degradation, and unbalanced resource utilization that may be caused by frequent migrations. Problems, thereby achieving long-term stability of system performance after microservice migration and significantly reducing operating costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0134] Figure 1 Schematic diagram of the architecture of intelligent microservice migration method for LLM enhancement in cloud-edge environment;
[0135] Figure 2 This is a flowchart of the method for locating microservices to be migrated based on LLM and LSTM;
[0136] Figure 3 Schematic diagram of the long-term performance prediction framework based on dynamic GCN;
[0137] Figure 4 This is a flowchart of the multi-objective microservice migration decision method based on dynamic GCN and BO; DETAILED DESCRIPTION
[0138] The present invention will be further defined below in conjunction with the accompanying drawings and embodiments, but is not limited thereto.
[0139] Example 1
[0140] Intelligent microservice migration method enhanced by LLM in cloud-edge environment, such as Figure 1 As shown, including:
[0141] The method for locating microservices to be migrated based on LLM and LSTM analyzes and determines whether the current anomaly requires microservice migration based on the historical abnormal events that need to be migrated. If migration is required, the microservice to be migrated that caused the abnormality is accurately located.
[0142] A multi-objective microservice migration decision method based on dynamic GCN and BO is adopted to intelligently select the appropriate node for each microservice to be migrated according to the long-term performance and operation cost of the microservice.
[0143] The present invention aims to improve the long-term stability of microservice performance and reduce operating costs by reducing unnecessary frequent migrations.
[0144] Example 2
[0145] The difference between the LLM-enhanced intelligent microservice migration method in the cloud-edge environment described in Example 1 is that:
[0146] The method for locating microservices to be migrated based on LLM and LSTM analyzes and determines whether the current anomaly requires microservice migration based on the historical abnormal events that need to be migrated. As shown in the figure, it includes:
[0147] The method for locating microservices to be migrated based on LLM and LSTM analyzes and determines whether the current anomaly requires microservice migration based on the historical anomaly events that need to be migrated. If migration is required, the microservices to be migrated that caused these anomalies are further determined.
[0148] Reasoning about the microservices to be migrated based on LLM: Parse the logs, monitoring indicators, and tracking information of abnormal events, convert unstructured data into structured context information through vectorization processing, and analyze and determine whether the current abnormality requires microservice migration based on the historical abnormal events that need to be migrated. If migration is required, use LLM to determine the microservices to be migrated to support subsequent microservice migration decisions.
[0149] LSTM-based abnormal event storage optimization: By integrating short-term memory and long-term memory mechanisms, the storage of abnormal events that need to be migrated is optimized to enhance decision-making capabilities.
[0150] Reasoning about the microservices to be migrated based on LLM, including:
[0151] Through comprehensive analysis of the logs, monitoring indicators, and tracking information of the current abnormal event, it is automatically inferred whether microservice migration is needed. If necessary, the microservice to be migrated that caused the abnormality is located, and self-adjustment and optimization are performed based on the feedback.
[0152] Make decisions based on LLM: Through vector processing, the unstructured data of historical abnormal events that need to be migrated is converted into structured context information. Based on the context information, it is determined whether the current abnormality requires microservice migration. If migration is determined to be necessary, the microservice to be migrated is located to provide support for subsequent migration decisions.
[0153] Evaluation based on historical comparison and similarity measurement: Verify the results of the preliminary inference by comparing the abnormal event performance that needs to be migrated with the historical event data, and use similarity measurement to determine the similarity between the current abnormal event and the historical abnormal event, so as to further verify the validity of the inference;
[0154] Dynamic adjustment based on self-feedback: Update the loss function and optimize the model to generate more accurate inference results. Through this continuous feedback and self-adjustment, the model gradually improves its inference ability for the microservices to be migrated.
[0155] Make decisions based on the LLM; including:
[0156] First, collect and annotate abnormal events that require microservice migration; specifically, extract data from system fault reports, operation and maintenance records, and historical alarms from the alarm system, especially those that triggered microservice migration after an abnormality occurred. Select events with clear abnormality types, migration conditions, and types of microservices to be migrated. For example, abnormality type: node failure; migration conditions: when a node failure may occur due to hardware problems, system crashes, or network interruptions, causing one or more microservices to be unavailable, these microservices usually need to be migrated to healthy nodes; types of microservices to be migrated: all microservices that depend on the failed node.
[0157] After collecting enough abnormal cases, annotate each case to ensure that the information is complete and the structure is clear; the specific annotation content includes: ① Abnormal type: clearly mark the type of abnormality (such as node failure, resource limitation, security attack, SLO / SLA violation, etc.). ② Affected microservices: mark the affected microservices in each abnormal event and the dependencies between microservices, especially the microservices that are directly affected and need to be migrated. ③ Fault time point and duration: record the time when the fault occurs and the duration of the fault to help the model infer the scope of the abnormal impact. ④ Migration conditions: clarify the specific conditions that lead to migration (such as resource utilization exceeding a certain critical value, node failure, etc.). ⑤ Key performance indicators: record performance indicator data related to migration decisions, such as CPU utilization, response time, number of SLO / SLA violations, etc. Focus on marking the performance mutation point that triggers migration, that is, the critical change of system indicators from normal to abnormal.
[0158] Secondly, the Sentence Transformer model is used to vectorize the logs, monitoring indicators, and tracking information related to the i-th historical abnormal event of the microservice to be migrated, and convert them into structured context information, namely context data MigraA. H Stored in the database, the conversion process is as follows:
[0159]
[0160] Among them, logs, metrics, and traces refer to the logs, monitoring indicators, and tracking information related to the i-th historical abnormal event of the microservice that needs to be migrated (these are historical anomalies); f is a data preprocessing function that converts unstructured data (such as logs and monitoring data) into contextual representation;
[0161] When an abnormal event occurs AnomN i When the FAISS library calculates the current abnormal event vector AnomN i Vector MigraA with historical abnormal events HThe L2 distance between them is used to calculate the similarity between these vectors. The current abnormal event vector AnomN i It is obtained by vectorizing the logs, monitoring indicators, and tracking information related to the current exception. If the L2 distance is less than the threshold, it means that the exception or fault needs to be migrated. A threshold is set to determine whether two vectors are similar, and the threshold is automatically found using cross-validation.
[0162] Finally, the GPT-4 model with better performance in complex reasoning, understanding context, and generating high-quality text was selected as the inference model. H Reasoning about the microservices to be migrated; current abnormal event AnomN i When microservice migration is required, set M i For the i-th microservice, the inference model represents h according to its context i To estimate the probability that the microservice is the microservice to be migrated, the calculation is as follows:
[0163] h i =Transformer(MigraA H ,M i )
[0164]
[0165] Among them, h i is the vector representation generated after contextual reasoning, W is the weight matrix, Represents microservice M i is the probability of the microservice to be migrated. The score of each microservice is converted into a probability distribution through the Softmax function. Preliminary output includes abnormal events of all potential microservices to be migrated based on the set thresholds
[0166] Evaluation based on historical comparisons and similarity metrics; including:
[0167] Verify the accuracy of the initial inference of the LLM-based decision module and evaluate the inference results based on historical abnormal events. This will include abnormal events of all potential microservices to be migrated. Historical abnormal events The comparison is as follows:
[0168]
[0169] Among them, historical abnormal events It refers to the vectorized representation of historical abnormal events that need to be migrated microservices; ΔMigrA iIs the absolute value of the difference between the dimensions of the two vectors, that is, the Manhattan distance. If ΔMigrA i If it does not exceed a certain threshold ε, the rationality of the preliminary inference is further confirmed; the initial value of the threshold ε is 10.
[0170] By similarity measurement To compare the similarity between the current event and the historical abnormal event to verify the validity of the inference, the calculation formula is as follows:
[0171]
[0172] If the similarity Greater than 0.85, confirming an abnormal event The microservices to be migrated in the final output are abnormal events All microservices to be migrated
[0173] Dynamic adjustments based on self-feedback; including:
[0174] The feedback information includes not only which inference results are accurate, but also which results are inaccurate, which provides directions for improving the model. Specifically, this feedback information is used to update its parameters to improve future inference capabilities.
[0175] Define the loss function L to measure the error between the feedback information and the current inference result; assume is the true value, and the loss function is defined as follows:
[0176]
[0177] Where N is the number of samples, and the gradient descent method is used to optimize the loss function. The calculation formula of the gradient of the loss function to the parameter is as follows:
[0178]
[0179] Among them, θ is a parameter, Represents the learning rate; generates a new inference result, the formula is as follows:
[0180]
[0181] Among them, AnomN i refers to the current abnormal event, is the input context information, θ' is the updated model parameter, and f is the forward propagation function of the GPT-4 model.
[0182] LSTM-based abnormal event storage optimization; including:
[0183] The LSTM mechanism is used to effectively store and manage abnormal events that need to be migrated throughout the process, thereby optimizing the model's decision-making ability and inference results. By integrating the features of short-term memory and long-term memory, it aims to improve the model's ability to respond to complex abnormal situations and achieve more intelligent and flexible inference.
[0184] Short-term memory mainly records the most recent inference results and the corresponding context information. During each inference, the short-term memory stores the current input data (e.g., logs, monitoring indicators, and tracking information) and the corresponding inference results in the short-term memory, that is, the current input data AnomN i and inference results Stored in short-term memory; the storage formula of short-term memory is as follows:
[0185]
[0186] in, It is a short-term memory storage used to record recent abnormal event data and inference results;
[0187] After each new data is input, the short-term memory is updated to keep the latest state information. A FIFO (first in, first out) strategy can be used to limit the length of the short-term memory to avoid the accumulation of too much irrelevant information.
[0188] Long-term memory is maintained through feedback output, recording the important experiences and learning results of the model during the inference process. When the model achieves significant results during the inference process (for example, it can accurately infer the microservices that need to be migrated), its related input, decision and feedback information will be stored in the long-term memory. The storage formula of long-term memory is as follows:
[0189]
[0190] in, It is a long-term memory storage that records the relevant data of the inference results with high accuracy during the inference process of the model.
[0191] AnomN i , They are respectively able to infer the input information, feedback information, and true value of the microservices that need to be migrated with high accuracy.
[0192] A multi-objective microservice migration decision method based on dynamic GCN and BO is adopted to intelligently select the appropriate node for each microservice to be migrated according to the long-term performance and operation cost of the microservice; Figure 4 As shown, including:
[0193] Through the method of locating microservices to be migrated based on LLM and LSTM, a set of all microservices to be migrated can be obtained. On this basis, the multi-objective microservice migration decision based on dynamic GCN and BO intelligently selects the appropriate node for each microservice to be migrated according to the predicted long-term performance and operating cost of the microservice.
[0194] Long-term performance prediction based on dynamic GCN: Use dynamic GCN to predict the long-term performance of different microservice migration candidates and use the prediction results as input;
[0195] BO-based multi-objective microservice migration decision: Determine the final migration plan based on the long-term performance and operating cost of the microservice, and migrate the microservice to be migrated to the appropriate target node.
[0196] Long-term performance prediction based on dynamic GCN; such as Figure 3 As shown, including:
[0197] Define the microservice spatial structure dependency graph: Represent the microservice as a spatial structure dependency graph G s =(V,E s ,A s ) and the dynamic association graph G D =(V,E D ,A D ), where V is a node set, |V|=N is the number of nodes, and each node represents a microservice instance; the spatial structure dependency graph and the dynamic association graph share the same nodes but have different edges and edge weights, E S and E D They represent the edge sets of different graphs respectively;
[0198] Defining the delay matrix: Taking the nodes in the microservice spatial structure dependency graph G as the collection points, the observations collected at time t are defined as the delay matrix X t =(x t,1 ,x t,2 ,...,x t,N )∈R N×C , where X t,v ∈R C It is defined as the feature vector of node v at time t, and C is the number of values of the collection points;
[0199] Defining microservice delay prediction: Given the historical delay matrix X of the past m time steps = (X t-m+1 ,X t-m+1 ,...,X t )∈R N×mThe goal of microservice delay prediction is to learn the mapping function f from the historical delay observations, and combine the N microservices on the microservice spatial structure dependency graph G to predict the delay matrix of the next n time steps:
[0200] f t-m+1,t-m+2,...,n (G)→(X t+1 ,X t+2 ,...,X t+n )
[0201] The encoder-decoder framework is used to embed features on the input data. The encoder-decoder framework includes an encoder and a decoder. The encoder extracts performance features and the decoder generates future delay predictions. The encoder and decoder are respectively stacked by multiple identical encoder layers and decoder layers, and mainly include a spatial dynamic graph convolution module and a temporal convolution sparse multi-head self-attention mechanism module. The temporal convolution sparse multi-head self-attention mechanism module processes the entire time series at the same time, but it ignores the spatial heterogeneity and temporal order information of microservices when processing time series data. Spatial heterogeneity means that different microservices may have different performance characteristics and behavior patterns. Temporal order information means that the delay or load pattern of microservices may change significantly in different time periods. Therefore, an embedding module is introduced to add a time position embedding vector to each element of the initial sequence. The temporal convolution sparse multi-head self-attention mechanism module captures the dynamic time correlation of delays between nodes. The spatial dynamic convolution module captures the dynamic change pattern of microservice space under different microservice migration candidates.
[0202] In order to capture the dynamic time correlation of microservice delay in the time dimension, the attention mechanism is used to extract dynamic features of time dependence. The attention mechanism can effectively select the time features most relevant to the current prediction target from the input data, thereby improving the performance and effect of the model. Since dot product attention has higher computational efficiency and stronger expression ability, dot product attention is used as the attention function, which is specifically expressed as follows:
[0203]
[0204] Among them, Q i , K i 、V i They are query matrix, key matrix and value matrix respectively, d k is the dimension of the key vector, and the attention mechanism calculates the attention weights to determine the contribution of each element; in this way, the model can dynamically adjust the weights based on the input sequence and better capture the long-term dependencies in the sequence.
[0205] However, the traditional self-attention mechanism requires correlation between all positions in the input sequence, and its complexity is O(n2 ), which consumes a lot of memory and computing time. Therefore, using the time convolution sparse multi-head self-attention mechanism to process time series in parallel rather than sequentially can minimize the long-term dependency problem and the time step cumulative error problem, so as to reduce the computing and storage requirements without significantly losing the model performance. Through selective sparse processing, the complexity can be reduced to O(nlogn). The formal definition of the time convolution sparse multi-head self-attention mechanism is as follows:
[0206] SpSelfMulitHead(Q,K,V)=Concat(head1,...,head h )W O
[0207] head i =Attention(Q*W i Q ,K*W i K ,V*W i V )
[0208] Where h represents the number of attention modules (heads), W i Q , W i K , W i V They refer to the projection matrices on Q, K, and V respectively, and W O Represents the projection matrix of the final output, Concat represents the concatenation operation, Q, K, and V are the query matrix, key matrix, and value matrix respectively; SpSelfMulitHead(Q,K,V) concatenates the outputs of all heads, head i is the output of each head;
[0209] The sparse processing is performed through Top-K sparsification. The attention weight is used to capture the dynamic time correlation degree of delay between services. The attention weight is calculated as follows:
[0210]
[0211] Among them, Weight(i,j) represents the dynamic time correlation degree of the delay between microservice i and microservice j, Q i is the query vector of the i-th microservice, K j is the key vector of the jth microservice. The transposition operation T transforms K j From column vector to row vector, so that dot product operation can be performed. The input of the encoder at the l+1 layer is X lAfter all nodes are operated by the inter-convolution sparse multi-head self-attention mechanism, the intermediate representation M of the sequence is obtained. l =(M l,t-n+1 ,M l,t-n+2 ,...,M l,t );
[0212] In order to capture the dynamic spatial associations between candidate options for microservice migration, a spatial dynamic graph convolutional network is designed. The spatial dynamic graph convolutional network includes a dynamic adjacency matrix construction module and a dynamic graph convolutional layer module. The dynamic adjacency matrix construction module dynamically generates an adjacency matrix based on the latency information, migration dependencies, and global structure information between microservices to capture dependencies that change over time. The dynamic graph convolutional layer module performs convolution operations on the dynamic dependency features of microservices based on the constructed dynamic adjacency matrix to extract spatiotemporal features. The dynamic adjacency matrix construction formula is as follows:
[0213] A ij (t)=αh(la(i,j,t))+βf(mi_de(i,j))+γg(gl_de(i,j))
[0214] Among them, la(i,j,t) is the delay between microservice i and microservice j at time t, h(·) is an increasing function, mi_de(i,j) is the dependency relationship between the migrated microservice i and microservice j under the current migration candidate option, f(·) is a mapping function, gl_de(i,j) is the global topology of the microservice system, that is, all microservices i and microservice j with dependencies, g(·) is a mapping function, α, β, γ are weight coefficients used to balance the influence of information from different sources; the calculation process of dynamic graph convolution is as follows:
[0215] X l+1 =σ((AΘWeight(i,j))M l W)
[0216] Among them, X l+1 is the output of the l-th convolution layer, A is the dynamic adjacency matrix, Weight(i,j) is the weight matrix of the temporal convolutional sparse multi-head self-attention mechanism, σ(·) is the activation function, Θ is the Hadamard product, and W is the learnable weight matrix;
[0217] Through the above-mentioned spatial dynamic graph convolutional network, it is possible to capture the dynamic temporal correlation of microservice delays between microservice migration candidates in the time dimension, thereby providing a more comprehensive feature representation for the long-term delay prediction of different microservice migration candidates.
[0218] Spatially, future microservice performance will be affected not only by dynamically changing network conditions, but also by spatial heterogeneity and temporal sequence information. Spatial heterogeneity means that different microservices may have different performance characteristics and behavior patterns, and temporal sequence information means that the delay or load pattern of microservices may change significantly in different time periods. Therefore, capturing the spatial heterogeneity and temporal sequence information of microservices can effectively improve the accuracy of long-term performance prediction of microservice migration plans. An initial spatial embedding vector is assigned to each microservice, and the initial spatial embedding matrix is processed using a graph convolutional network to obtain the final spatial embedding matrix ESP. The present invention uses the time embedding method of Transformer to add a time position embedding vector to each element in the initial sequence so that adjacent elements have similar representations, and selects a fixed position embedding for the input element at position t to obtain the time embedding matrix ETP(t). Sine and cosine functions are used, and each vector dimension 1≤d≤dmodel is as follows:
[0219]
[0220] Where i is the index of the current dimension and d is the dimension of the embedding vector;
[0221] By adding the spatial embedding matrix ESP and the temporal embedding matrix ETP to the microservice performance sequence, a microservice performance sequence that retains the spatial heterogeneity and temporal order information of the nodes can be generated; spatial heterogeneity means that different microservices may have different performance characteristics and behavior patterns; temporal order information means that the delay or load pattern of the microservice may change significantly in different time periods:
[0222] X SP+TP =X+E TP +E SP
[0223] By embedding modules, the model can better capture the static feature differences of microservice nodes and the sequential characteristics of time series, thereby improving the ability to predict the long-term performance of microservice migration.
[0224] The decoder is composed of L identical decoder layers stacked together; each decoder layer includes a temporal convolutional sparse multi-head self-attention mechanism and a spatial dynamic graph convolutional network. l+1 =(X L,t-m+1 ,X L,t-m+2 ,...,X L,t ), the decoder part uses another L decoding layers to predict the long-term delay sequence y of future microservice migration candidates L =(X L,t+1 ,X L,t+2 ,...,X L,t+m ).
[0225] Multi-objective microservice migration decision based on BO; including:
[0226] In the proxy model optimization stage, the SMSego acquisition function is used to find the microservice migration solution that can maximize the expected improvement in the microservice migration candidate space; after evaluating the performance and operating cost of the microservice migration solution, the results are added to the training data, and the proxy model is updated. The parameters of the Gaussian process model are optimized using the newly obtained data points to better fit the true value of the objective function; each selected Pareto optimal microservice migration solution is executed until all microservices to be migrated have completed the migration or the maximum number of iterations has been reached.
[0227] The goal of the BO-based multi-objective microservice migration decision is to find a suitable migration solution while ensuring the long-term performance of the microservice application and reducing the operating cost. Therefore, the objective function is defined as follows:
[0228]
[0229] in, and are the operating cost target and the performance target, respectively. α and β are weights, reflecting the importance of performance and operating cost, and their sum is 1;
[0230] During the microservice migration process, the computing cost and network traffic cost directly affect the operation and data transmission overhead of microservices on different nodes. Therefore, the cost target is defined as follows:
[0231]
[0232] in, and Execute migration candidates (Microservices to be migrated The overall network traffic cost and computing cost after migration to node N);
[0233] Based on the node hardware specifications provided by the provider, the number of nodes required at different time points (for example, every ten minutes) can be calculated to measure the cost caused by computing resources. Therefore, the number of nodes required at time step t is calculated as follows:
[0234]
[0235] Among them, T t is the total traffic that needs to be processed at time step t (which can be expressed in terms of number of requests, data transfer volume, etc.), Ω cpu ,Ω memare the number of CPU cores and memory size available on each node, in GB (defined by the provider), U cpu , U mem They are the CPU core usage and memory usage required per unit flow, It is a round-up operation to ensure that the number of nodes is an integer; the cost is calculated as follows:
[0236]
[0237] Among them, Θ compute is the price per node;
[0238] In a cloud-edge environment, the calculation of network traffic costs needs to comprehensively consider the traffic requirements and data transmission paths between microservices. The traffic cost is calculated as follows:
[0239]
[0240] in, Indicates that when microservice c i and c j When they are on different nodes, the condition (the condition refers to the microservice c i and c j At different nodes) is true, Θ traffic is the traffic fee per GB. is the time t from microservice c i to c j Traffic demand;
[0241] Microservice Migration Candidates Microservice performance quality indicators are used to evaluate the overall latency impact of microservice migration candidates on all microservices. The performance goals are defined as follows:
[0242]
[0243] Among them, |M| is the total number of microservices, and the overall impact of all microservices is considered by taking the average value, τ M is the weight of microservice M, which is used to reflect the importance of different microservices. Is a candidate for microservice migration Lat(M) is the new delay under, Lat(M) is the current delay;
[0244] In order to use BO, you need to specify a collection function and a surrogate model in the optimization loop; the collection function uses the SMSego collection function to achieve multi-objective optimization. For the surrogate model, a single-output Gaussian process is selected for each objective; a relatively small number of training points achieves good accuracy, which helps BO converge quickly.
[0245] In the process of BO, the SMSego acquisition function is used to balance exploration (finding areas with high uncertainty) and utilization (fine optimization near the optimal point) in the target space. The SMSego acquisition function is as follows:
[0246]
[0247] in, represents the jth objective function value of the current Pareto optimality, represents the j-th objective function value of Gaussian process prediction, and E is the expected value of uncertainty;
[0248] The Gaussian process prediction of the target function is defined as follows:
[0249]
[0250] in, Is the objective function in the microservice migration candidate The mean prediction at is the covariance function, and the proxy model is continuously adjusted through the Bayesian update mechanism.
[0251] The performance and cost of migration candidates are evaluated. According to the long-term delay of microservices predicted by dynamic GCN, the long-term delay of migration candidates (migration candidates) is calculated using the defined performance objective function, and the computation and network traffic overhead is evaluated according to the cost objective function. Subsequently, multi-objective optimization is performed using Bayesian optimization (BO), and the acquisition function is applied to evaluate the potential improvements of different migration candidates. The performance and cost data of the candidates are continuously updated by training the Gaussian process model. In each iteration, the current Pareto optimal solution migration candidate is selected and migration is performed. This process continues until the set number of iterations is reached or all microservices to be migrated have been migrated.
[0252] Example 3
[0253] The LLM-enhanced intelligent microservice migration method in the cloud-edge environment includes:
[0254] Step 1: Collect historical operation and maintenance data and mark abnormal cases, including migration abnormality type AnoT, affected microservice AffM, failure time point FaiT, duration Dur, migration condition MigC and key performance indicator KeyP.
[0255] Step 2: Use the Sentence Transformer model to vectorize the logs, monitoring indicators, and tracking information related to the historical abnormal events of the microservices to be migrated and convert them into context information MigraA H (Historical migration anomaly event).
[0256] Step 3: When an abnormal failure occurs AnomN i First, the FAISS library calculates the current exception vector AnomN i Vector MigraA with historical events H The L2 distance between these vectors is used to calculate the similarity between these vectors. If they are similar, it means that the anomaly or fault needs to be migrated. On this basis, the context information is inferred by using the LLM-based decision module to output abnormal events containing all potential microservices to be migrated.
[0257] Step 4: The evaluation module based on historical comparison and similarity metrics will include abnormal events of all potential microservices to be migrated Performance and historical data (data in long-term memory) MigraA H Make a comparison and judge the accuracy of the inference results.
[0258] Step 5: Evaluate the current abnormal event MigraA H If the similarity is high, confirm the validity of the inference result.
[0259] Step 6: The self-feedback-based dynamic adjustment module receives feedback information provided by the evaluation module based on historical comparison and similarity metrics, including accurate and inaccurate inference results.
[0260] Step 7: The dynamic adjustment module based on self-feedback measures the error between the inference result and the true feedback, optimizes the loss function L using the gradient descent method, updates the model parameters, and improves the accuracy of future inferences.
[0261] Step 8: When the accuracy of the inferred microservice to be migrated is high, store the relevant context information, decision and feedback information in long-term memory for future reasoning reference.
[0262] Step 9: Use the dynamic adjustment module based on self-feedback to continuously monitor and verify the results of each inference. If after multiple iterations, the feedback shows that there are no new microservices to be migrated, it can be considered that all microservices to be migrated have been located, and finally the abnormal event is output. All microservices to be migrated
[0263] Step 10: Based on the obtained microservices to be migrated Randomly select initial microservice migration candidates (Microservices to be migrated Migrate to node N), obtain its long-term performance value and calculate its current operating cost through long-term performance prediction based on dynamic GCN.
[0264] Step 12: Here, the microservice spatial structure dependency graph and dynamic association graph are used to represent the dependencies of microservices, and the delay matrix is constructed as the input data of the long-term performance module based on dynamic GCN.
[0265] Step 13: In the encoding phase, the dynamic GCN module is used to extract spatial features and capture the static and dynamic correlations of microservice migration candidates. The temporal dynamic correlation is captured through the temporal convolution sparse multi-head self-attention mechanism.
[0266] Step 14: Embedding and feature fusion, combining the spatial and temporal embedding matrices to generate sequences with spatial heterogeneity and temporal order features.
[0267] Step 15: In the decoding phase, the decoder predicts the microservice delay in the future time step and uses an iterative process to further refine the prediction, ultimately obtaining the prediction result y L .
[0268] Step 16: Obtain its long-term performance value y through long-term performance prediction based on dynamic GCN L get and cost A Gaussian process is trained using these initial data to fit the cost and performance targets.
[0269] Step 17: Use the SMSego capture function to find the microservice migration candidate that can maximize the expected improvement among the microservice migration candidates, evaluate the operating cost and performance of the currently selected microservice migration candidate, and add the results to the training dataset.
[0270] Step 18: Use the newly acquired data points to optimize the Gaussian process parameters to better fit the true value of the objective function.
[0271] Step 19: Check the convergence of the agent model. The Pareto optimal microservice migration plan is selected each time and executed until all microservices to be migrated have completed the migration or the maximum number of iterations is reached.
[0272] Example 4
[0273] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the LLM-enhanced intelligent microservice migration method in a cloud-edge environment described in Example 1 or 2 are implemented.
[0274] Example 5
[0275] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the LLM-enhanced intelligent microservice migration method in a cloud-edge environment described in Example 1 or 2.
[0276] Example 6
[0277] The LLM-enhanced intelligent microservice migration system in the cloud-edge environment includes:
[0278] The microservice migration judgment module is configured as follows: based on the LLM and LSTM-based microservice location method to be migrated, it analyzes and determines whether the current anomaly requires microservice migration according to the historical abnormal events that need to be migrated. If migration is required, it accurately locates the microservice to be migrated that causes the anomaly;
[0279] The migration module is configured to: adopt a multi-objective microservice migration decision method based on dynamic GCN and BO, and intelligently select a suitable node for each microservice to be migrated according to the long-term performance and operating cost of the microservice.
[0280] The microservice migration judgment module includes an LLM-based microservice reasoning module for migration and an LSTM-based abnormal event storage optimization module;
[0281] The LLM-based microservice inference module to be migrated is configured to: parse the logs, monitoring indicators and tracking information of abnormal events, convert unstructured data into structured context information through vectorization processing, and analyze and determine whether the current abnormality requires microservice migration based on the historical abnormal events that need to be migrated; if migration is required, LLM is used to determine the microservices to be migrated to support subsequent microservice migration decisions;
[0282] The LSTM-based abnormal event storage optimization module is configured to enhance decision-making capabilities by integrating short-term memory and long-term memory mechanisms and optimizing the storage of abnormal events that need to be migrated.
[0283] The migration module includes a long-term performance prediction module based on dynamic GCN and a multi-objective microservice migration decision module based on BO;
[0284] The long-term performance prediction module based on dynamic GCN is configured to: use dynamic GCN to predict the long-term performance of different microservice migration candidates and use the prediction results as input;
[0285] The BO-based multi-objective microservice migration decision module is configured to determine the final migration plan based on the long-term performance and operating cost of the microservices, and migrate the microservices to be migrated to the appropriate target nodes.
[0286] The LLM-based microservice reasoning module to be migrated includes an LLM-based decision module, an evaluation module based on historical comparison and similarity measurement, and a dynamic adjustment module based on self-feedback;
[0287] The LLM-based decision module is configured to: convert the unstructured data of historical abnormal events that need to be migrated into structured context information through vectorized processing, and determine whether the current abnormality requires microservice migration based on the context information; if it is determined that migration is required, locate the microservice to be migrated; so as to provide support for subsequent migration decisions.
[0288] The evaluation module based on historical comparison and similarity measurement is configured to: verify the results of the preliminary inference by comparing the abnormal event performance that needs to be migrated with the historical event data, and judge the similarity between the current abnormal event and the historical abnormal event through similarity measurement, so as to further verify the validity of the inference;
[0289] The dynamic adjustment module based on self-feedback is configured to update the loss function and optimize the model to generate more accurate inference results.
Claims
1. An LLM-enhanced intelligent microservice migration method in a cloud-edge environment, characterized in that: include: The method for locating microservices to be migrated based on LLM and LSTM analyzes and determines whether the current anomaly requires microservice migration based on the historical abnormal events that need to be migrated. If migration is required, the microservice to be migrated that caused the abnormality is accurately located. A multi-objective microservice migration decision method based on dynamic GCN and BO is adopted to intelligently select the appropriate node for each microservice to be migrated according to the long-term performance and operation cost of the microservice.
2. According to claim 1, the LLM-enhanced intelligent microservice migration method in the cloud edge environment is characterized in that: Based on the LLM and LSTM-based method for locating microservices to be migrated, the method analyzes and determines whether the current anomaly requires microservice migration based on the historical abnormal events that need to be migrated; include: Reasoning about the microservices to be migrated based on LLM: Parse the logs, monitoring indicators, and tracking information of abnormal events, convert unstructured data into structured context information through vectorization processing, and analyze and determine whether the current abnormality requires microservice migration based on the historical abnormal events that need to be migrated. If migration is required, use LLM to determine the microservices to be migrated to support subsequent microservice migration decisions. LSTM-based abnormal event storage optimization: By integrating short-term memory and long-term memory mechanisms, the storage of abnormal events that need to be migrated is optimized to enhance decision-making capabilities; Further preferably, the reasoning of the microservices to be migrated based on LLM includes: Make decisions based on LLM: Through vector processing, the unstructured data of historical abnormal events that need to be migrated is converted into structured context information. Based on the context information, it is determined whether the current abnormality requires microservice migration. If migration is determined to be necessary, the microservice to be migrated is located. Evaluation based on historical comparison and similarity measurement: Verify the results of the preliminary inference by comparing the abnormal event performance that needs to be migrated with the historical event data, and use similarity measurement to determine the similarity between the current abnormal event and the historical abnormal event, so as to further verify the validity of the inference; Dynamic adjustment based on self-feedback: Update the loss function and optimize the model to generate more accurate inference results; Further preferably, making a decision based on LLM includes: First, collect and annotate abnormal events that require microservice migration; Annotate each case to ensure that the information is complete and clearly structured; Secondly, the Sentence Transformer model is used to vectorize the logs, monitoring indicators, and tracking information related to the i-th historical abnormal event of the microservice to be migrated, and convert them into structured context information, namely context data MigraA. H Stored in the database, the conversion process is as follows: Among them, logs, metrics, and traces refer to the logs, monitoring indicators, and tracking information related to the i-th historical abnormal event of the microservice to be migrated, respectively; f is a data preprocessing function that converts unstructured data into contextual representation; When an abnormal event occurs AnomN i When the FAISS library calculates the current abnormal event vector AnomN i Vector MigraA with historical abnormal events H The L2 distance between them is used to calculate the similarity between these vectors. If the L2 distance is less than the threshold, it means that the anomaly or fault needs to be migrated. Finally, the GPT-4 model is selected as the inference model, based on the context data MigraA H Reasoning about the microservices to be migrated; current abnormal event AnomN i When microservice migration is required, set M i For the i-th microservice, the inference model represents h according to its context i To estimate the probability that the microservice is the microservice to be migrated, the calculation is as follows: h i =Transformer(MigraA H ,M i ) Among them, h i is the vector representation generated after contextual reasoning, W is the weight matrix, Represents microservice M i is the probability of the microservice to be migrated. The score of each microservice is converted into a probability distribution through the Softmax function. Preliminary output includes abnormal events of all potential microservices to be migrated based on the set thresholds 3. The LLM-enhanced intelligent microservice migration method in a cloud-edge environment according to claim 1 is characterized in that: Evaluation based on historical comparisons and similarity metrics; including: Will include all abnormal events of potential microservices to be migrated Historical abnormal events The comparison is as follows: Among them, historical abnormal events It refers to the vectorized representation of historical abnormal events that need to be migrated microservices; ΔMigrA i Is the absolute value of the difference between the dimensions of the two vectors, that is, the Manhattan distance. If ΔMigrA i If it does not exceed a certain threshold ε, the rationality of the initial inference is further confirmed; By similarity measurement To compare the similarity between the current event and the historical abnormal event to verify the validity of the inference, the calculation formula is as follows: If the similarity Greater than 0.85, confirming an abnormal event The microservices to be migrated in the final output are abnormal events All microservices to be migrated 4. The LLM-enhanced intelligent microservice migration method in a cloud-edge environment according to claim 1, characterized in that: Dynamic adjustments based on self-feedback; including: Define the loss function L to measure the error between the feedback information and the current inference result; assume is the true value, and the loss function is defined as follows: Where N is the number of samples, and the gradient descent method is used to optimize the loss function. The calculation formula of the gradient of the loss function to the parameter is as follows: Among them, θ is a parameter, Represents the learning rate; generates a new inference result, the formula is as follows: Among them, AnomN i refers to the current abnormal event, θ' is the updated model parameter, and f is the forward propagation function of the GPT-4 model.
5. The LLM-enhanced intelligent microservice migration method in a cloud-edge environment according to claim 1, characterized in that: LSTM-based abnormal event storage optimization; including: At each inference, the short-term memory stores the input data in the current state and the corresponding inference results in the short-term memory, that is, the current input data AnomN i and inference results Stored in short-term memory; the storage formula of short-term memory is as follows: in, It is a short-term memory storage used to record recent abnormal event data and inference results; The storage formula for long-term memory is as follows: in, It is a long-term memory storage that records the relevant data of the inference results with high accuracy during the inference process of the model. i , They are respectively the input information, feedback information and true value of the microservices that need to be migrated.
6. The LLM-enhanced intelligent microservice migration method in a cloud-edge environment according to claim 1, characterized in that: A multi-objective microservice migration decision method based on dynamic GCN and BO is used to intelligently select the appropriate node for each microservice to be migrated according to the long-term performance and operating cost of the microservice; including: Long-term performance prediction based on dynamic GCN: Use dynamic GCN to predict the long-term performance of different microservice migration candidates and use the prediction results as input; Multi-objective microservice migration decision based on BO: Determine the final migration plan based on the long-term performance and operating cost of the microservice, and migrate the microservice to be migrated to the appropriate target node; Further preferably, long-term performance prediction based on dynamic GCN includes: Define the microservice spatial structure dependency graph: Represent the microservice as a spatial structure dependency graph G s =(V,E s ,A s ) and the dynamic association graph G D =(V,E D ,A D ), where V is a node set, |V|=N is the number of nodes, and each node represents a microservice instance; the spatial structure dependency graph and the dynamic association graph share the same nodes but have different edges and edge weights, E S and E D They represent the edge sets of different graphs respectively; Defining the delay matrix: Taking the nodes in the microservice spatial structure dependency graph G as the collection points, the observations collected at time t are defined as the delay matrix X t =(x t,1 ,x t,2 ,...,x t,N )∈R N×C , where X t,v ∈R C It is defined as the feature vector of node v at time t, and C is the number of values of the collection points; Defining microservice delay prediction: Given the historical delay matrix X of the past m time steps = (X t-m+1 ,X t-m+1 ,...,X t )∈R N×m The goal of microservice delay prediction is to learn the mapping function f from the historical delay observations, and combine the N microservices on the microservice spatial structure dependency graph G to predict the delay matrix of the next n time steps: f t-m+1,t-m+2,...,n (G)→(X t+1 ,X t+2 ,...,X t+n ) The encoder-decoder framework embeds features on the input data. The encoder-decoder framework includes an encoder and a decoder. The encoder extracts performance features and the decoder generates future delay predictions. The encoder and decoder are stacked with multiple identical encoder and decoder layers. The temporal convolution sparse multi-head self-attention mechanism module processes the entire time series at the same time. The embedding module is introduced to add a time position embedding vector to each element of the initial sequence. The temporal convolution sparse multi-head self-attention mechanism module captures the dynamic time correlation of delays between nodes. The spatial dynamic convolution module captures the dynamic change pattern of microservice space under different microservice migration candidates. Use the time convolution sparse multi-head self-attention mechanism to process time series in parallel rather than sequentially. The formal definition of the time convolution sparse multi-head self-attention mechanism is as follows: SpSelfMulitHead(Q,K,V)=Concat(head1,...,head h )W O head i =Attention(Q*W i Q ,K*W i K ,V*W i V ) Among them, h represents the number of attention modules, W i Q , W i K , W i V They refer to the projection matrices on Q, K, and V respectively, and W O Represents the projection matrix of the final output, Concat represents the concatenation operation, Q, K, and V are the query matrix, key matrix, and value matrix respectively; SpSelfMulitHead(Q,K,V) concatenates the outputs of all heads, head i is the output of each head; The sparse processing is performed through Top-K sparsification. The attention weight is used to capture the dynamic time correlation degree of delay between services. The attention weight is calculated as follows: Among them, Weight(i,j) represents the dynamic time correlation degree of the delay between microservice i and microservice j, Q i is the query vector of the i-th microservice, K j is the key vector of the jth microservice. The transposition operation T transforms K j From column vector to row vector, the input of the l+1th layer encoder is X l After all nodes are operated by the inter-convolution sparse multi-head self-attention mechanism, the intermediate representation M of the sequence is obtained. l =(M l,t-n+1 ,M l,t-n+2 ,...,M l,t ); Design a spatial dynamic graph convolutional network. The spatial dynamic graph convolutional network includes a dynamic adjacency matrix construction module and a dynamic graph convolutional layer module. The dynamic adjacency matrix construction module dynamically generates an adjacency matrix based on the delay information, migration dependencies, and global structure information between microservices to capture dependencies that change over time. The dynamic graph convolutional layer module performs convolution operations on the dynamic dependency features of microservices based on the constructed dynamic adjacency matrix to extract spatiotemporal features. The dynamic adjacency matrix construction formula is as follows: TO ij (t)=αh(la(i,j,t))+βf(mi_de(i,j))+γg(gl_de(i,j)) Among them, la(i,j,t) is the delay between microservice i and microservice j at time t, h(·) is an increasing function, mi_de(i,j) is the dependency relationship between the migrated microservice i and microservice j under the current migration candidate option, f(·) is a mapping function, gl_de(i,j) is the global topology of the microservice system, that is, all microservices i and microservice j with dependencies, g(·) is a mapping function, α, β, γ are weight coefficients used to balance the influence of information from different sources; the calculation process of dynamic graph convolution is as follows: X l+1 =σ((AΘWeight(i,j))M l W) Among them, X l+1 is the output of the l-th convolution layer, A is the dynamic adjacency matrix, Weight(i,j) is the weight matrix of the temporal convolutional sparse multi-head self-attention mechanism, σ(·) is the activation function, Θ is the Hadamard product, and W is the learnable weight matrix; Using the Transformer time embedding method, add a time position embedding vector to each element in the initial sequence so that adjacent elements have similar representations. Select a fixed position embedding for the input element at position t to obtain the time embedding matrix ETP(t). Using sine and cosine functions, each vector dimension 1≤d≤dmodel is as follows: Where i is the index of the current dimension and d is the dimension of the embedding vector; Add the spatial embedding matrix ESP and the temporal embedding matrix ETP to the microservice performance sequence to generate a microservice performance sequence that retains the spatial heterogeneity and temporal order information of nodes; The decoder is composed of L identical decoder layers stacked together; each decoder layer includes a temporal convolutional sparse multi-head self-attention mechanism and a spatial dynamic graph convolutional network. l+1 =(X L,t-m+1 ,X L,t-m+2 ,...,X L,t ), the decoder part uses another L decoding layers to predict the long-term delay sequence y of future microservice migration candidates L =(X L,t+1 ,X L,t+2 ,...,X L,t+m ); Further preferably, a multi-objective microservice migration decision based on BO includes: Use the SMSego acquisition function to find the microservice migration solution that can maximize the expected improvement in the microservice migration candidate space; after evaluating the performance and operating cost of the microservice migration solution, add the results to the training data, update the proxy model, and use the newly obtained data points to optimize the Gaussian process model parameters to better fit the true value of the objective function; each selected Pareto optimal microservice migration solution is executed until all microservices to be migrated have completed the migration or the maximum number of iterations has been reached.
7. The LLM-enhanced intelligent microservice migration method in a cloud-edge environment according to claim 6 is characterized in that: The objective function is defined as follows: in, and are the operating cost target and the performance target, respectively. α and β are weights, reflecting the importance of performance and operating cost, and their sum is 1; The cost objectives are defined as follows: in, and Execute migration candidates The overall network traffic cost and computing cost after ; The number of nodes required at time step t is calculated as follows: Among them, T t is the total flow that needs to be processed at time step t, Ω cpu ,Ω mem are the number of CPU cores and memory size that each node can provide, in GB, U cpu , U mem They are the CPU core usage and memory usage required per unit flow, It is a round-up operation to ensure that the number of nodes is an integer; the cost is calculated as follows: Among them, Θ compute is the price per node; The traffic cost is calculated as follows: in, Indicates that when microservice c i and c j When they are on different nodes, the condition is true, Θ traffic is the traffic fee per GB. is the time t from microservice c i to c j Traffic demand; Microservice Migration Candidates Microservice performance quality indicators are used to evaluate the overall latency impact of microservice migration candidates on all microservices. The performance goals are defined as follows: Among them, |M| is the total number of microservices, and the overall impact of all microservices is considered by taking the average value, τ M is the weight of microservice M, which is used to reflect the importance of different microservices. Is a candidate for microservice migration Lat(M) is the new delay under, Lat(M) is the current delay; Specify a collection function and a surrogate model in the optimization loop; the collection function uses the SMSego collection function, and for the surrogate model, a single-output Gaussian process is selected for each target; In the process of BO, the SMSego acquisition function is used to balance exploration and utilization in the target space. The SMSego acquisition function is as follows: in, represents the jth objective function value of the current Pareto optimality, represents the j-th objective function value of Gaussian process prediction, and E is the expected value of uncertainty; The Gaussian process prediction of the target function is defined as follows: in, Is the objective function in the microservice migration candidate The mean prediction at is the covariance function, and the proxy model is continuously adjusted through the Bayesian update mechanism.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, it implements the steps of the LLM-enhanced intelligent microservice migration method in a cloud-edge environment as described in any one of claims 1-7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the LLM-enhanced intelligent microservice migration method in a cloud-edge environment described in any one of claims 1-7 are implemented.
10. The LLM-enhanced intelligent microservice migration system in the cloud-edge environment is characterized by: include: The microservice migration judgment module is configured as follows: based on the LLM and LSTM-based microservice location method to be migrated, it analyzes and determines whether the current anomaly requires microservice migration according to the historical abnormal events that need to be migrated. If migration is required, it accurately locates the microservice to be migrated that causes the anomaly; The migration module is configured to: adopt a multi-objective microservice migration decision method based on dynamic GCN and BO, and intelligently select a suitable node for each microservice to be migrated according to the long-term performance and operation cost of the microservice; Further preferably, the microservice migration judgment module includes a microservice reasoning module to be migrated based on LLM and an abnormal event storage optimization module based on LSTM; The LLM-based microservice inference module to be migrated is configured to: parse the logs, monitoring indicators, and tracking information of abnormal events, convert unstructured data into structured context information through vectorization processing, and analyze and determine whether the current abnormality requires microservice migration based on the historical abnormal events that need to be migrated; If migration is required, use LLM to determine the microservices to be migrated to support subsequent microservice migration decisions; The LSTM-based abnormal event storage optimization module is configured to: enhance decision-making capabilities by integrating short-term memory and long-term memory mechanisms to optimize the storage of abnormal events that need to be migrated; Further preferably, the migration module includes a long-term performance prediction module based on dynamic GCN and a multi-objective microservice migration decision module based on BO; The long-term performance prediction module based on dynamic GCN is configured to: use dynamic GCN to predict the long-term performance of different microservice migration candidates and use the prediction results as input; The BO-based multi-objective microservice migration decision module is configured to: determine the final migration plan based on the long-term performance and operating cost of the microservice, and migrate the microservice to be migrated to the appropriate target node; Further preferably, the LLM-based microservice reasoning module to be migrated includes a LLM-based decision module, an evaluation module based on historical comparison and similarity measurement, and a dynamic adjustment module based on self-feedback; The LLM-based decision module is configured to: transform the unstructured data of historical abnormal events that need to be migrated into structured context information through vector processing, and determine whether the current abnormality requires microservice migration based on the context information; If migration is determined to be necessary, locate the microservices to be migrated; The evaluation module based on historical comparison and similarity measurement is configured to: verify the results of the preliminary inference by comparing the abnormal event performance that needs to be migrated with the historical event data, and judge the similarity between the current abnormal event and the historical abnormal event through similarity measurement, so as to further verify the validity of the inference; The dynamic adjustment module based on self-feedback is configured to update the loss function and optimize the model to generate more accurate inference results.
Citation Information
Cited By
Multi-protocol fusion communication scheduling system resource allocation method and device
CN120186107A
Edge computing task dynamic migration method supporting service continuity
CN120407128A
Python dependency library API migration method based on large language model
CN120429008A
Framework migration method and system for heterogeneous micro-service architecture
CN120812121A
Framework migration method and system for heterogeneous microservice architecture
CN120812121B