A method for estimating latency of a microservice system
By employing multi-scale graph adaptive fusion and scene-aware technology, the problems of insufficient hierarchical organization and multi-scene adaptability in latency estimation of microservice systems are solved, achieving higher estimation accuracy and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG UNIV
- Filing Date
- 2026-01-04
- Publication Date
- 2026-05-29
Smart Images

Figure CN122111807A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of microservice systems, and in particular to a latency estimation method for microservice systems. Background Technology
[0002] In microservice systems, latency estimation is a critical step in ensuring system performance and service quality. Currently, research methods in this field can be broadly categorized into three main types: model-driven methods, data-driven methods, and graph-aware hybrid methods. Model-driven methods characterize system behavior by constructing theoretical models. Examples include using hierarchical queuing networks (LQNs) to model service interactions and predict component load, or utilizing variable-order Markov models (VOMMs) to capture temporal patterns in call sequences. Some studies also model the latency characteristics of individual microservices using piecewise linear functions. Data-driven methods treat the system as a black box, leveraging machine learning models, including convolutional neural networks (CNNs) combined with boosting trees, or CNNs combined with long short-term memory networks (LSTMs), to directly extract performance patterns from runtime data and establish a mapping from workload characteristics to end-to-end latency. However, these methods generally neglect the inherent structural dependencies between services, are highly dependent on the size of the training data, have poor interpretability, and limited generalization ability when system conditions change significantly.
[0003] To address the shortcomings of the two aforementioned methods, graph-aware hybrid approaches are emerging, attempting to integrate system structure information with data-driven techniques. For example, they utilize causal Bayesian networks to characterize service dependencies and introduce graph variational autoencoders to simulate performance across multiple scenarios; or they combine critical path analysis with reinforcement learning techniques to identify and optimize bottleneck paths. In recent years, graph neural networks (GNNs) have been widely applied to microservice performance modeling due to their ability to simultaneously capture topological structures and complex data patterns. Related research includes: API-level performance prediction based on span graphs, application-level latency estimation using message passing neural networks (MPNNs), and latency prediction by constructing PERT graphs from execution trajectories and applying GNNs.
[0004] While existing methods have achieved some success at different levels, they still have significant limitations. Firstly, most methods are based on single-scale modeling, failing to fully capture the inherent hierarchical organization of microservice systems. In reality, microservice systems typically contain multiple layers of abstraction, from low-level fine-grained components and intermediate functional modules to top-level end-to-end services. This hierarchical information is often implicit and difficult to obtain directly from configuration or manual annotation, as seen in typical microservice benchmark systems such as Online-Boutique and Sock-Shop. Secondly, microservice systems operate in highly dynamic and diverse environments, often facing different scenarios such as CPU-intensive, I / O-intensive, and network-intensive environments, with performance bottlenecks and latency-dominant factors changing significantly accordingly. Existing methods lack the ability to perceive and adapt to multiple operating scenarios, making it difficult for "one-size-fits-all" estimation models to maintain accuracy and robustness under different operating conditions, thus limiting their widespread application in complex real-world environments. Summary of the Invention
[0005] The technical problem to be solved by this invention is to provide a latency estimation method for microservice systems that can capture the hierarchical organizational structure of microservice systems, thereby improving the accuracy and robustness of latency estimation.
[0006] The technical solution adopted by this invention to solve the above-mentioned technical problem is: a latency estimation method for a microservice system, comprising the following steps: Step ①: Model the call dependencies of the microservice system as a directed graph and obtain the feature vector of the directed graph; Step 2: Construct a delay estimation model and train the delay estimation model to obtain the trained delay estimation model; Step 3: Input the feature vector of the directed graph into the trained delay estimation model to obtain the delay estimation result; The latency estimation model includes a multi-scale graph adaptive fusion module and a scene-aware latency estimation module; wherein, the multi-scale graph adaptive fusion module includes a node aggregation and allocation module, a multi-scale coarsening graph construction module, an attention mechanism graph feature update module, and a multi-scale feature fusion module; In step ③, the specific operation process for obtaining the delay estimation result is as follows: Step ③-1: The eigenvectors of the directed graph are linearly transformed and normalized to an exponential function through the node aggregation and allocation module to obtain the aggregation and allocation matrix. Step ③-2: The aggregation distribution matrix and the eigenvectors of the directed graph are coarsened using the multi-scale coarsening graph construction module to obtain a multi-scale coarsening graph containing micro, meso and macro graphs. Step ③-3: The attention mechanism graph feature update module performs attention weighted aggregation on the node features of each scale level graph in the multi-scale coarsening graph to obtain the global graph representation of each scale level graph. Step ③-4: The global graph representation of each scale level is weighted and fused using the multi-scale feature fusion module to obtain the fused context vector. Step ③-5: The scene-aware delay estimation module performs scene-aware dynamic weighted fusion estimation on the fused context vector to obtain the delay estimation result.
[0007] Compared with existing technologies, the advantages of this invention lie in generating a hierarchical graph representation from micro to macro through the node aggregation and allocation module and the multi-scale coarsening graph construction module in the multi-scale graph adaptive fusion module. This effectively captures the multi-level abstract structure of components, modules, and services implicit in microservice systems, overcoming the limitation of existing single-scale modeling methods that cannot reflect the hierarchical organization of the system. By utilizing the attention mechanism graph feature update module and the multi-scale feature fusion module, the global graph representations of graphs at different scale levels are dynamically weighted and integrated, enhancing the latency estimation model's understanding of the microservice system's topology and dependencies. Furthermore, the scene-aware latency estimation module dynamically weights and fuses the fused context vectors, enabling the latency estimation model to adaptively identify and respond to the characteristics of different operating scenarios. This maintains the accuracy and robustness of latency estimation in highly dynamic environments, improving the generalization ability of the latency estimation model under diverse operating conditions. Experiments on the Boutique dataset show that the proposed method has a mean absolute error of 36.52, while the Sinan method has a mean absolute error of 45.72, representing a reduction of approximately 20.12%. The root mean square error (RMSE) of the proposed method is 67.02, while the Sinan method has a RMS error of 77.33, representing a reduction of approximately 13.33%. The mean absolute percentage error (MSE) of the proposed method is 9.45%, while the GRAF method has a MSE of 13.24%, representing a reduction of approximately 28.63%. These findings fully demonstrate that the proposed method has the highest estimation accuracy.
[0008] Furthermore, the specific operation process of step ① is as follows: Step ①-1: Model the call dependencies of the microservice system as a directed graph. , ,in, This represents the set of nodes in a microservice system. This represents the call edge set in a microservice system. Denotes the adjacency matrix if and only if the i-th Nodes With the Nodes When there is a calling relationship, , This represents the total number of nodes in the node set. Step ①-2: Obtain the eigenvectors of the directed graph. , ,in, , System status metrics include CPU utilization, memory utilization, file I / O metrics, inbound network traffic, and outbound network traffic. Represents a resource quota vector. Indicates the workload request rate. Dimensions representing system status indicators By modeling the directed graph as a structure containing nodes, edges, and adjacency matrices, and extracting multi-dimensional feature vectors, key operational parameters such as system state, resource quotas, and workload are integrated, providing comprehensive and structured input data for subsequent multi-scale analysis. This ensures that the latency estimation model can learn based on complete system information and improves the model's ability to capture the dynamic behavior of microservice systems.
[0009] Furthermore, in step ③-1, the specific operation to obtain the aggregation allocation matrix is as follows: the eigenvectors of the directed graph are subjected to linear transformation and normalized exponential function processing to obtain the aggregation allocation matrix. , ,in, , Represents the normalized exponential function, Represents the eigenvectors of a directed graph. and These represent the learnable parameters, This represents the number of aggregated nodes. By generating an aggregation assignment matrix through linear transformation and the Softmax function, automatic aggregation and assignment of node features are achieved. This enables the model to adaptively determine the affiliation of nodes in a multi-scale graph, laying the foundation for constructing a hierarchical graph representation. This enhances the model's ability to capture the implicit structure of microservice systems and supports the extraction of multi-scale features.
[0010] Furthermore, in step ③-2, the specific operation to obtain a multi-scale coarsening map containing micro, meso, and macro plots is as follows: Obtain the coarsened node features based on the aggregation assignment matrix. and the coarsened adjacency matrix , , ,in, Represents the adjacency matrix. Indicates transpose; Based on the coarsened node features and the coarsened adjacency matrix Construct a multi-scale coarsened graph consisting of a micrograph, a mesograph, and a macrograph; where the number of aggregation nodes in the micrograph is... Number of aggregation nodes in the mesograph And the number of aggregation nodes in the macro graph By generating graph representations of different granularities through coarsening transformation, the system structure is captured at multiple levels from micro to macro, enabling the model to adaptively analyze the dependencies between fine-grained components, intermediate modules, and top-level services. This overcomes the limitations of single-scale modeling and enhances the model's understanding and representation of the hierarchical organization of microservice systems.
[0011] Furthermore, in step ③-3, the specific operation to obtain the global graph representation of each scale level graph is as follows: Obtain the first [item] in any scale level of the multi-scale coarsening plot. Each node and its neighboring nodes Attention coefficient , ,in, This indicates a rectified activation function with leakage. This represents a trainable attention vector. This represents the linear transformation matrix used for attention computation. Represents the node embedding matrix The Middle The feature vector of each node Represents the node embedding matrix The Middle The feature vector of each node Represents the node embedding matrix. , This represents the feature dimension after linear transformation. This represents the dimension of the node feature vector. This indicates a vector concatenation operation; use The function normalizes the attention coefficients to obtain node features. , ,in, Indicates the first The neighborhood of each node This represents the neighboring nodes of the i-th node. Indicates the first Each node and its neighboring nodes Attention coefficient between them This represents an exponential function with the real number e as its base. The updated features of each node are obtained by aggregating and updating node features through attention-weighted methods. , ,in, Represents a nonlinear activation function; The global graph representation is obtained by mean pooling the updated features of each node. , ,in, This represents the set of nodes in a microservice system. An attention mechanism is used to calculate importance weights between nodes, and neighbor node features are weighted and aggregated. This allows the model to dynamically focus on key nodes and dependencies in the graph. Mean pooling is then used to extract a global graph representation, thereby enhancing the model's ability to capture semantic information about the graph structure and improving the accuracy and interpretability of latency estimation.
[0012] Furthermore, in step ③-4, the specific operation to obtain the fused context vector is as follows: Obtain the fusion weights of the graph at each scale level , ,in, Represents a scale level diagram. , Represents a set of scale-level diagrams. Indicates the definition symbol, Representing the microscopic diagram hierarchy, Indicates the mesoscopic diagram level. Indicates the macroscopic diagram hierarchy. Represents a scale level diagram. This indicates that the scale level diagram is as follows: Global graph representation at time, Representing scale level diagram The following global graph representation, and These represent the learnable parameters; The fusion weights of the graphs at each scale level are weighted and combined to obtain the fused context vector. , ,in, By adaptively weighting and combining multi-scale global graph representations using learnable fusion weights, a fused context vector is generated. This enables the model to dynamically integrate graph feature information at different granularities, thereby enhancing the model's comprehensive understanding of the hierarchical structure of microservice systems and improving the robustness and adaptability of latency estimation under different operating conditions.
[0013] Furthermore, the scene-aware delay estimation module includes a scene recognizer, a dynamic weight generator, and a multi-expert estimator. The scene recognizer identifies the current running scene of the microservice system based on the fused context vector, and obtains scene features that encode the semantic representation of the current microservice system state. , ,in, , Represents the linear rectified activation function. and Let represent the learnable weight matrices, and These represent the bias terms; The dynamic weight generator performs linear mapping and normalization on scene features to obtain a set of adaptive weights. ,in, , and These represent the learnable parameters, Indicates the number of experts in the multi-expert estimator; The multi-expert estimator is composed of A team of experts is used to perform weighted fusion processing on a set of adaptive weights to obtain the latency estimation result. The scene recognizer dynamically identifies the running scene, the dynamic weight generator generates adaptive weights, and the multi-expert estimator uses multiple experts to make estimates. This enables the latency estimation model to automatically adjust the estimation strategy according to the current microservice system state (such as CPU-intensive, I / O-intensive, etc.), thereby improving the accuracy and generalization ability of latency estimation in highly variable environments.
[0014] Furthermore, the specific steps to obtain the delay estimation results are as follows: Each expert corresponds to a feedforward neural network, which will... The feedforward neural network corresponding to each expert is denoted as _ ... , ,in, Represents the linear rectified activation function. Indicates input, , , and These represent the learnable parameters; The delay estimate is obtained by weighting and combining all expert outputs. , By processing input features separately through multiple feedforward neural network experts and combining them with adaptive weights for weighted fusion, the model can flexibly utilize the expertise of different experts in different scenarios, thereby enhancing the diversity and accuracy of latency estimation and adapting to the high variability of microservice system operation.
[0015] Furthermore, in step ②, the specific operation process for obtaining the trained delay estimation model is as follows: Set up a private cloud cluster consisting of one master node and six worker nodes, and autonomously collect one training sample every 10 seconds in the private cloud cluster until at least 60,000 training samples are collected. The training parameters are set as follows: learning rate is set to 0.001, batch size is set to 64, and total number of training rounds is set to 200. Define the total loss function as: ;in, This represents the total number of training samples. The delay estimation model indicates the first... The latency estimation results for each training sample. Indicates the first The actual observation delay results for each training sample The weighting coefficients representing the loss of diversity This indicates the number of experts in the multi-expert estimator. This represents the Kullback-Leibler divergence function. Indicates the first The estimated distribution of experts, Indicates the first The estimated distribution of experts; Based on the total loss function, all training samples are input into the latency estimation model for training. The latency estimation model is updated by the Adam optimizer until the total number of training rounds is reached, at which point the iterative update stops, resulting in the trained latency estimation model. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of the overall process of the present invention; Figure 2 This is a schematic diagram of the delay estimation model in this invention; Figure 3 This is a schematic diagram of the specific operation process of step ③ in this invention; Figure 4 These are two representative microservice load test curves in this embodiment. Detailed Implementation
[0017] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0018] like Figure 1 As shown, a latency estimation method for a microservice system includes the following steps: Step ①: Model the call dependencies of the microservice system as a directed graph and obtain the feature vector of the directed graph; The specific operation process for step ① is as follows: Step ①-1: Model the call dependencies of the microservice system as a directed graph. , ,in, This represents the set of nodes in a microservice system. This represents the call edge set in a microservice system. Denotes the adjacency matrix if and only if the i-th Nodes With the Nodes When there is a calling relationship, , This represents the total number of nodes in the node set. Step ①-2: Obtain the eigenvectors of the directed graph. , ,in, , System status metrics include CPU utilization, memory utilization, file I / O metrics, inbound network traffic, and outbound network traffic. Represents a resource quota vector. Indicates the workload request rate. Dimensions representing system status indicators .
[0019] Step 2: Construct a delay estimation model and train the delay estimation model to obtain the trained delay estimation model; The specific steps for obtaining the trained delay estimation model are as follows: Set up a private cloud cluster consisting of one master node and six worker nodes, and autonomously collect one training sample every 10 seconds in the private cloud cluster until at least 60,000 training samples are collected; the training samples include the microservice call dependency graph, the feature vector of the directed graph, and the corresponding end-to-end latency; The training parameters are set as follows: learning rate is set to 0.001, batch size is set to 64, and total number of training rounds is set to 200. Define the total loss function as: ;in, This represents the total number of training samples. The delay estimation model indicates the first... The latency estimation results for each training sample. Indicates the first The actual observation delay results for each training sample The weighting coefficients representing the loss of diversity This indicates the number of experts in the multi-expert estimator. This represents the Kullback-Leibler divergence function. Indicates the first The estimated distribution of experts, Indicates the first The estimated distribution of experts; Based on the total loss function, all training samples are input into the latency estimation model for training. The latency estimation model is updated by the Adam optimizer until the total number of training rounds is reached, at which point the iterative update stops, resulting in the trained latency estimation model.
[0020] Step 3: Input the feature vector of the directed graph into the trained delay estimation model to obtain the delay estimation result.
[0021] like Figure 2 As shown, the delay estimation model includes a multi-scale graph adaptive fusion module and a scene-aware delay estimation module; wherein, the multi-scale graph adaptive fusion module includes a node aggregation and allocation module, a multi-scale coarsening graph construction module, an attention mechanism graph feature update module, and a multi-scale feature fusion module; like Figure 3 As shown, the specific operation process for obtaining the delay estimation result in step ③ is as follows: Step ③-1: The node aggregation and allocation module performs linear transformation and normalization exponential function processing on the eigenvectors of the directed graph to obtain the aggregation and allocation matrix. Specifically, this involves performing linear transformation and normalization exponential function processing on the eigenvectors of the directed graph to obtain the aggregation and allocation matrix. , ,in, , Represents the normalized exponential function, Represents the eigenvectors of a directed graph. and These represent the learnable parameters, This indicates the number of aggregation nodes.
[0022] Step ③-2: The aggregation distribution matrix and the eigenvectors of the directed graph are coarsened using the multi-scale coarsening graph construction module to obtain a multi-scale coarsening graph containing micro, meso, and macro graphs. The specific operation for obtaining the multi-scale coarsening graph containing micro, meso, and macro graphs is as follows: Obtain the coarsened node features based on the aggregation assignment matrix. and the coarsened adjacency matrix , , ,in, Represents the adjacency matrix. Indicates transpose; Based on the coarsened node features and the coarsened adjacency matrix Construct a multi-scale coarsened graph consisting of a micrograph, a mesograph, and a macrograph; where the number of aggregation nodes in the micrograph is... Number of aggregation nodes in the mesograph And the number of aggregation nodes in the macro graph .
[0023] Step ③-3: The attention mechanism graph feature update module performs attention-weighted aggregation on the node features of each scale level in the multi-scale coarsening graph to obtain the global graph representation of each scale level. The specific operation to obtain the global graph representation is as follows: Obtain the first [item] in any scale level of the multi-scale coarsening plot. Each node and its neighboring nodes Attention coefficient , ,in, This indicates a rectified activation function with leakage. This represents a trainable attention vector. This represents the linear transformation matrix used for attention computation. Represents the node embedding matrix The Middle The feature vector of each node Represents the node embedding matrix The Middle The feature vector of each node Represents the node embedding matrix. , This represents the feature dimension after linear transformation. This represents the dimension of the node feature vector. This indicates a vector concatenation operation; use The function normalizes the attention coefficients to obtain node features. , ,in, Indicates the first The neighborhood of each node This represents the neighboring nodes of the i-th node. Indicates the first Each node and its neighboring nodes Attention coefficient between them This represents an exponential function with the real number e as its base. The updated features of each node are obtained by aggregating and updating node features through attention-weighted methods. , ,in, Represents a nonlinear activation function; The global graph representation is obtained by mean pooling the updated features of each node. , ,in, This represents the set of nodes in a microservice system.
[0024] Steps ③-4 involve performing weighted fusion processing on the global graph representations of each scale level using a multi-scale feature fusion module to obtain the fused context vector. The specific operation for obtaining the fused context vector is as follows: Obtain the fusion weights of the graph at each scale level , ,in, Represents a scale level diagram. , Represents a set of scale-level diagrams. Indicates the definition symbol, Representing the microscopic diagram hierarchy, Indicates the mesoscopic diagram level. Indicates the macroscopic diagram hierarchy. Represents a scale level diagram. This indicates that the scale level diagram is as follows: Global graph representation at time, Representing scale level diagram The following global graph representation, and These represent the learnable parameters; The fusion weights of the graphs at each scale level are weighted and combined to obtain the fused context vector. , ,in, .
[0025] Step ③-5: The scene-aware delay estimation module performs scene-aware dynamic weighted fusion estimation on the fused context vector to obtain the delay estimation result; specifically, the scene-aware delay estimation module includes a scene recognizer, a dynamic weight generator, and a multi-expert estimator. The scene recognizer identifies the current running scene of the microservice system based on the fused context vectors, and obtains scene features that encode the semantic representation of the current system state of the microservice system. , ,in, , Represents the linear rectified activation function. and Let represent the learnable weight matrices, and These represent the bias terms; The dynamic weight generator performs linear mapping and normalization on scene features to obtain a set of adaptive weights. ,in, , and These represent the learnable parameters, Indicates the number of experts in the multi-expert estimator; Multi-expert estimator by A team of experts, such as experts specializing in CPU-intensive scenarios, I / O-intensive scenarios, and Network-intensive scenarios, is used to perform weighted fusion processing on a set of adaptive weights to obtain latency estimation results. The specific operation for obtaining the latency estimation results is as follows: Each expert corresponds to a feedforward neural network, which will... The feedforward neural network corresponding to each expert is denoted as _ ... , ,in, Represents the linear rectified activation function. Indicates input, , , and These represent the learnable parameters; The delay estimate is obtained by weighting and combining all expert outputs. , .
[0026] The experimental environment included: an Intel Xeon E5-2673v4 CPU, an NVIDIA GeForce RTX4060 GPU, 16GB of memory, an Ubuntu 20.04LTS operating system, PyTorch as the deep learning framework, and Python version 3.11.
[0027] To evaluate the method proposed in this invention, two widely adopted open-source microservice benchmarks were used, representing different application domains and architectural complexities: 1) Online Boutique is a cloud-native microservice application developed by Google to showcase Kubernetes, Istio, and gRPC technologies. It simulates an e-commerce platform with functions such as product browsing, shopping cart management, and purchase processing, truly representing modern microservice-based applications.
[0028] 2) Sock Shop is a microservice-based e-commerce platform that simulates a sock retail store. It consists of 13 services implemented using Spring Boot, Go Kit, and Node.js, demonstrating common microservice architecture patterns and cloud-native deployment practices.
[0029] All experiments were conducted in a private cloud cluster consisting of seven machines (one master node and six worker nodes), with a total of 80 virtual CPUs and 128 GB of memory. All compute nodes were equipped with Intel Xeon E5-2673v4 CPUs.
[0030] Workloads were generated using data from the 2022 Alibaba Cluster Tracing dataset, a publicly available collection of real microservice tracings from a production environment. Two representative microservice load variation curves were selected from this dataset: one showing large dynamic changes, such as... Figure 4 As shown in example a, the other shows smooth request rate fluctuations, such as... Figure 4 As shown in b. These workloads were tuned to match our cluster capacity. To simulate real-time traffic, Locust (an open-source asynchronous load testing tool) was used to drive traffic to the deployed service based on selected traces.
[0031] The method proposed in this invention is compared with six benchmark methods: Linear Regression, Multilayer Perceptron (MLP), Decision Tree, Random Forest, Sinan, and GRAF.
[0032] Three widely used metrics are used to evaluate the estimation accuracy of MSGAF and other models: root mean square error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE). Lower RMSE, MAE, and MAPE scores indicate better estimation performance.
[0033] Table 1
[0034] As shown in Table 1, on the Online Boutique dataset, the proposed method has a MAE of 36.52, which is about 20.12% lower than the second-best Sinan method (45.72); an RMSE of 67.02, which is about 13.33% lower than the second-best Sinan method (77.33); and a MAPE of 9.45%, which is about 28.63% lower than the second-best GRAF method (13.24%). On the Sock Shop dataset, the proposed method has a MAE of 20.75, which is about 6.36% lower than the second-best Sinan method (22.16); a MAPE of 9.06%, which is about 8.21% lower than the second-best Sinan method (9.87%); and an RMSE of 40.96, which is lower than the Random method. The Forest method (52.81) reduced the error by approximately 22.44%. In summary, the method proposed in this invention exhibits the lowest error values across all evaluation metrics, verifying that the method proposed in this invention has the highest estimation accuracy.
Claims
1. A latency estimation method for a microservice system, comprising the following steps: Step ①: Model the call dependencies of the microservice system as a directed graph and obtain the feature vector of the directed graph; Step 2: Construct a delay estimation model and train the delay estimation model to obtain the trained delay estimation model; Step 3: Input the feature vector of the directed graph into the trained delay estimation model to obtain the delay estimation result; The delay estimation model is characterized by comprising a multi-scale graph adaptive fusion module and a scene-aware delay estimation module; wherein the multi-scale graph adaptive fusion module comprises a node aggregation and allocation module, a multi-scale coarsening graph construction module, an attention mechanism graph feature update module, and a multi-scale feature fusion module. In step ③, the specific operation process for obtaining the delay estimation result is as follows: Step ③-1: The eigenvectors of the directed graph are linearly transformed and normalized using the node aggregation and allocation module to obtain the aggregation and allocation matrix. Step ③-2: The aggregation distribution matrix and the eigenvectors of the directed graph are coarsened using the multi-scale coarsening graph construction module to obtain a multi-scale coarsening graph containing micro, meso and macro graphs. Step ③-3: The attention mechanism graph feature update module performs attention weighted aggregation on the node features of each scale level graph in the multi-scale coarsening graph to obtain the global graph representation of each scale level graph. Step ③-4: The global graph representation of each scale level is weighted and fused using the multi-scale feature fusion module to obtain the fused context vector. Step ③-5: The scene-aware delay estimation module performs scene-aware dynamic weighted fusion estimation on the fused context vector to obtain the delay estimation result.
2. The latency estimation method for a microservice system according to claim 1, characterized in that... The specific operation process for step ① is as follows: Step ①-1: Model the call dependencies of the microservice system as a directed graph. , ,in, This represents the set of nodes in a microservice system. This represents the call edge set in a microservice system. Denotes the adjacency matrix if and only if the i-th Nodes With the Nodes When there is a calling relationship, , This represents the total number of nodes in the node set. Step ①-2: Obtain the eigenvectors of the directed graph. , ,in, , System status metrics include CPU utilization, memory utilization, file I / O metrics, inbound network traffic, and outbound network traffic. Represents a resource quota vector. Indicates the workload request rate. Dimensions representing system status indicators .
3. The latency estimation method for a microservice system according to claim 1, characterized in that... In step ③-1, the specific operation to obtain the aggregation allocation matrix is as follows: the eigenvectors of the directed graph are subjected to linear transformation and normalized exponential function processing to obtain the aggregation allocation matrix. , ,in, , Represents the normalized exponential function, Represents the eigenvectors of a directed graph. and These represent the learnable parameters. This indicates the number of aggregation nodes.
4. The latency estimation method for a microservice system according to claim 1, characterized in that... In step ③-2, the specific operations for obtaining a multi-scale coarsened map containing micro, meso, and macro plots are as follows: Obtain the coarsened node features based on the aggregation assignment matrix. and the coarsened adjacency matrix , , ,in, Represents the adjacency matrix. Indicates transpose; Based on the coarsened node features and the coarsened adjacency matrix Construct a multi-scale coarsened graph consisting of a micrograph, a mesograph, and a macrograph; where the number of aggregation nodes in the micrograph is... Number of aggregation nodes in the mesograph And the number of aggregation nodes in the macro graph .
5. The latency estimation method for a microservice system according to claim 1, characterized in that... In step ③-3, the specific operations for obtaining the global graph representation of each scale level are as follows: Obtain the first [item] in any scale level of the multi-scale coarsening plot. Each node and its neighboring nodes Attention coefficient , ,in, This indicates a rectified activation function with leakage. This represents a trainable attention vector. This represents the linear transformation matrix used for attention computation. Represents the node embedding matrix The Middle The feature vector of each node Represents the node embedding matrix The Middle The feature vector of each node Represents the node embedding matrix. , This represents the feature dimension after the linear transformation. This represents the dimension of the node feature vector. This indicates a vector concatenation operation; use The function normalizes the attention coefficients to obtain node features. , ,in, Indicates the first The neighborhood of each node This represents the neighboring nodes of the i-th node. Indicates the first Each node and its neighboring nodes Attention coefficient between them This represents an exponential function with the real number e as its base. The updated features of each node are obtained by aggregating and updating node features through attention-weighted methods. , ,in, Represents a nonlinear activation function; The global graph representation is obtained by mean pooling the updated features of each node. , ,in, This represents the set of nodes in a microservice system.
6. The latency estimation method for a microservice system according to claim 1, characterized in that... In steps ③-4, the specific operations for obtaining the fused context vector are as follows: Obtain the fusion weights of the graph at each scale level , ,in, Represents a scale level diagram. , Represents a set of scale-level diagrams. Indicates the definition symbol, Representing the microscopic diagram hierarchy, Indicates the mesoscopic diagram level. Indicates the macroscopic diagram hierarchy. Represents a scale level diagram. This indicates that the scale level diagram is as follows: Global graph representation at time, Representing scale level diagram The following global graph representation, and These represent the learnable parameters; The fusion weights of the graphs at each scale level are weighted and combined to obtain the fused context vector. , ,in, .
7. The latency estimation method for a microservice system according to claim 1, characterized in that... The scene-aware delay estimation module includes a scene recognizer, a dynamic weight generator, and a multi-expert estimator; The scene recognizer identifies the current running scene of the microservice system based on the fused context vector, and obtains scene features that encode the semantic representation of the current microservice system state. , ,in, , Represents the linear rectification activation function. and Let represent the learnable weight matrices, and These represent the bias terms; The dynamic weight generator performs linear mapping and normalization on scene features to obtain a set of adaptive weights. ,in, , and These represent the learnable parameters. Indicates the number of experts in the multi-expert estimator; The multi-expert estimator is composed of A team of experts was formed to perform weighted fusion processing on a set of adaptive weights to obtain the delay estimation result.
8. The latency estimation method for a microservice system according to claim 7, characterized in that... The specific steps to obtain the delay estimation results are as follows: Each expert corresponds to a feedforward neural network, which will... The feedforward neural network corresponding to each expert is denoted as _ ... , ,in, Represents the linear rectification activation function. Indicates input, , , and These represent the learnable parameters; The delay estimate is obtained by weighting and combining all expert outputs. , .
9. The latency estimation method for a microservice system according to claim 1, characterized in that... In step ②, the specific process of obtaining the trained delay estimation model is as follows: Set up a private cloud cluster consisting of one master node and six worker nodes, and autonomously collect one training sample every 10 seconds in the private cloud cluster until at least 60,000 training samples are collected. The training parameters are set as follows: learning rate is set to 0.001, batch size is set to 64, and total number of training rounds is set to 200. Define the total loss function as: ;in, This represents the total number of training samples. The delay estimation model indicates the first... The latency estimation results for each training sample. Indicates the first The actual observation delay results for each training sample The weighting coefficients representing the loss of diversity This indicates the number of experts in the multi-expert estimator. This represents the Kullback-Leibler divergence function. Indicates the first The estimated distribution of experts, Indicates the first The estimated distribution of experts; Based on the total loss function, all training samples are input into the latency estimation model for training. The latency estimation model is updated by the Adam optimizer until the total number of training rounds is reached, at which point the iterative update stops, resulting in the trained latency estimation model.