A fine-grained micro-service resource prediction method based on a heterogeneous graph neural network

By constructing a heterogeneous graph neural network model and combining the resource utilization relationship between physical nodes and containers, the accuracy problem of traditional methods in microservice resource prediction under the influence of multiple factors is solved, and high-precision resource prediction effects are achieved.

CN119440822BActive Publication Date: 2025-10-17XIDIAN UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411489941.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-10-17
Estimated Expiration
2044-10-24

AI Technical Summary

Technical Problem

Traditional time series forecasting methods have difficulty accurately predicting resource requirements under the influence of complex multiple factors in microservice architectures, especially when load changes drastically, and cannot effectively balance performance and cost.

Method used

A method based on heterogeneous graph neural network is adopted to construct a heterogeneous graph by encoding the resource utilization sequences of the physical nodes and containers of microservices. Then, a bidirectional recurrent gating neural network and a relational graph convolutional neural network are used to learn multi-dimensional resource utilization relationships and improve prediction accuracy.

Benefits of technology

It significantly improves the accuracy of microservice resource prediction, especially in short-term prediction, and maintains a low error level in long-term prediction. It is suitable for dynamic and complex microservice environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440822B_ABST
    Figure CN119440822B_ABST
Patent Text Reader

Abstract

The application discloses a fine-grained micro-service resource prediction method based on a heterogeneous graph neural network, relates to the field of resource prediction, and aims to improve the accuracy in the micro-service resource prediction problem. The application encodes the resource utilization rate sequence of two dimensions of physical nodes and containers of the micro-service to obtain an initial hidden state, inputs the initial hidden state into a heterogeneous graph neural network for adjustment, and decodes the adjusted hidden state to obtain a resource prediction result; the heterogeneous graph neural network is constructed according to a heterogeneous graph, and the physical nodes and the containers of the micro-service are taken as heterogeneous nodes, and the relationships existing in the physical nodes and the containers are taken as edges. The application improves the accuracy and universality of the micro-service resource prediction.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of resource prediction, and particularly to a fine-grained microservice resource prediction method based on a heterogeneous graph neural network. BACKGROUND

[0002] In recent years, microservice architecture has become a popular software architecture paradigm adopted by many organizations and enterprises. Its appeal lies in its ability to break down large, complex applications into small, independent service units, each focusing on performing specific functions or tasks. In this architecture, each microservice typically assumes unique tasks and responsibilities, leading to different resource requirements. These differences span CPU and memory, storage resources, network bandwidth, and other computing resources.

[0003] Effective resource management and prediction are crucial to ensuring the sustained performance and availability of microservice architecture. Monitoring, analyzing, and predicting the resource requirements of microservices can achieve better resource configuration and allocation, ensuring individual needs of microservices while avoiding resource waste. However, resource requirements in microservice architecture are subject to dynamic influences. The multifaceted nature of these dynamic factors makes it challenging to accurately predict resource requirements, especially when facing sudden load changes, requiring more intelligent and accurate resource management and prediction strategies to strike a balance between performance and cost. To address these challenges, predicting the resource requirements of microservices becomes a critical task.

[0004] The microservice resource prediction problem involves time series analysis, and traditional time series prediction methods mainly focus on single time series. The resource utilization of microservices is influenced by multiple factors, not just their own historical resource utilization, but also the load of other microservices related to their business, the load occupancy of other microservices under the current server node, the load changes of other instances of the current microservice, and the changes in the physical environment of the server. Therefore, considering only the resource utilization time series data of a single microservice node is far from enough.

[0005] The patent document with the Chinese publication number CN115242797A proposes a client load balancing method and system for micro-service architecture, which includes: upon receiving a service request information sent by a user, the client obtains an instance registry of the service deployed in the cluster from the registration center; historical information of all server resource utilization rates of the service is obtained from the information collector module, and a server resource prediction algorithm based on an improved ARIMA model is used to predict the next second resource utilization rate of the corresponding node; the server calculates the dynamic weight load method according to the historical resource utilization rate and the predicted next second resource utilization rate, obtains the corresponding server load value, returns the load value information to the client and compares and selects the server with the optimal load value to execute the request. Although this method improves the utilization rate of cluster resources, it is based on traditional ARIMA time series analysis, which is a statistical rule-based method. However, the rules of different time periods of micro-service running are not immutable, and this method is not suitable for predicting micro-service resource utilization in the case of large fluctuations in micro-service load.

[0006] The patent document with the Chinese publication number CN117891559A proposes a method for intelligent prediction of K8s resource scheduling, which includes: collecting and preprocessing workload and related node time series data on the Kubernetes platform, classifying and analyzing the inventory time series data to obtain historical characteristics of the workload and related nodes; using a time series prediction traditional algorithm for resource prediction; using a machine learning algorithm to generate an algorithm model based on massive time series data and performing algorithm performance evaluation; based on the resource prediction result, using an optimization algorithm to develop a Pod migration and resource allocation scheme to generate a scheduling decision; executing the scheduling decision on the Kubernetes platform and feeding back the execution result to the monitoring data. This method can save labor costs, but can only analyze a single sequence, and is also not suitable for micro-service resource prediction problems. SUMMARY

[0007] The invention aims to: for all or part of the above-mentioned problems, provide a fine-grained micro-service resource prediction method based on a heterogeneous graph neural network, which predicts micro-service resources from multiple dimensional features to improve the accuracy of micro-service resource prediction problems.

[0008] The technical solution adopted by the present application is as follows:

[0009] A fine-grained micro-service resource prediction method based on a heterogeneous graph neural network, comprising:

[0010] The initial hidden state is obtained by encoding the resource utilization rate sequences of the two dimensions of the physical nodes and the containers of the microservices, and is input into the heterogeneous graph neural network for adjustment. The resource prediction result is obtained by decoding the adjusted hidden state. The heterogeneous graph neural network is constructed according to a heterogeneous graph. The heterogeneous graph takes the physical nodes and the containers of the microservices as heterogeneous nodes, and takes the relationships existing in the physical nodes and the containers as edges.

[0011] Further, the relationships existing in the physical nodes and the containers include edges constructed according to the relationships between the physical nodes, edges constructed according to the relationships between the physical nodes and the containers, and edges constructed according to the relationships between the containers.

[0012] Further, the edges constructed according to the relationships between the containers include edges constructed according to the relationships between the containers under the same physical node, and edges constructed according to the relationships between the containers under different physical nodes.

[0013] Further, the method of constructing edges according to the relationships between the physical nodes includes:

[0014] calculating the correlation between the resource utilization rate sequences of each two physical nodes;

[0015] generating a first type of edge between two physical nodes whose correlation reaches or exceeds a first threshold.

[0016] Further, the method of constructing edges according to the relationships between the physical nodes and the containers includes:

[0017] generating a second type of edge between each container deployed on a physical node and the physical node.

[0018] Further, the method of constructing edges according to the relationships between the containers includes:

[0019] generating a third type of edge between the containers deployed on the same physical node, and generating a fourth type of edge between the containers deployed on different physical nodes.

[0020] Further, a bidirectional recurrent gated neural network Bi-GRU is used to encode the resource utilization rate sequences of the two dimensions of the physical nodes and the containers of the microservices to obtain the hidden state.

[0021] Further, a sliding window is used to select the historical resource utilization rate sequences of the two dimensions of the physical nodes and the containers of the microservices for encoding.

[0022] Further, the sliding window selects the historical resource utilization rate sequences of the two dimensions of the physical nodes and the containers of the microservices in a time-continuous manner for encoding.

[0023] Further, the initial hidden state is obtained by encoding the resource utilization rate sequence of the two dimensions of the physical node and the container of the microservice, including:

[0024] The resource utilization rate sequence of the two dimensions of the physical node and the container of the microservice is compressed into resource utilization rate information with the same size as the hidden layer state;

[0025] The resource utilization rate information is encoded by using the hidden layer to obtain a first hidden state;

[0026] The resource utilization rate information residual is connected to the first hidden state to obtain an initial hidden state.

[0027] As described above, due to the adoption of the above technical solutions, the beneficial effects of the present application are:

[0028] The resource utilization of the microservice is affected by multiple factors, including not only the historical resource utilization of itself, but also the load of other microservices related to its business, the load occupancy of other microservices under the current server node, the load change of other instances in the current microservice, and the physical environment change of the server. The traditional time series prediction method mainly faces a single time series, and it is difficult to accurately predict the multiple influencing factors of the microservice resource utilization rate. The present application adopts a multi-node resource utilization rate data collection strategy, analyzes the resource utilization relationship between physical nodes, and introduces more fine-grained features, not only considering the resource utilization information of the physical node, but also combining the resource utilization information of the container level. Under this design concept, a resource prediction model of an encoder-heterogeneous graph neural network-decoder is designed, so that the model can deeply mine the relationship between physical nodes, physical nodes and containers, and containers, and improve the accuracy of microservice resource prediction. The test proves that the method of the present application performs very well in short-term prediction of microservice resource utilization, and can still maintain a low error level in long-term prediction, and has strong universality. BRIEF DESCRIPTION OF DRAWINGS

[0029] The present application will be described by way of example and with reference to the accompanying drawings, in which:

[0030] Figure 1 is a resource prediction model architecture diagram of an encoder-heterogeneous graph neural network-decoder structure.

[0031] Figure 2 is an encoder structure diagram.

[0032] Figure 3 is a schematic diagram of heterogeneous nodes and four types of edges of a heterogeneous graph.

[0033] Figure 4 is a decoder structure diagram.

[0034] Figure 5 is a performance graph of the method of the present application compared to the baseline method.

[0035] Figure 6 is a performance graph of the method of the present application on long-term prediction. DETAILED DESCRIPTION

[0036] All features disclosed in this specification, and / or all steps of any methods or processes disclosed in this specification, may be combined in any combination, except combinations where at least some of such features and / or steps are mutually exclusive.

[0037] Any feature disclosed in this specification, unless stated otherwise, can be replaced by any equivalent or similar feature. That is, unless stated otherwise, each feature is one example only of a generic series of equivalent or similar features.

[0038] An embodiment of the present application provides a fine-grained microservice resource prediction method based on a heterogeneous graph neural network. The model architecture implementing the method is as shown in Figure 1 The method encodes the resource utilization rate sequence of two dimensions of the physical nodes and containers of the microservice to obtain an initial hidden state, inputs the initial hidden state to the heterogeneous graph neural network for adjustment, and decodes the adjusted hidden state to obtain a resource prediction result. The heterogeneous graph neural network is constructed according to a heterogeneous graph, and the heterogeneous graph takes the physical nodes and containers of the microservice as heterogeneous nodes and takes the relationships existing in the physical nodes and containers as edges.

[0039] In some embodiments, the encoding-decoding process involved in the method uses a Seq2seq (Sequence to Sequence) model as the basic architecture. The Seq2seq model is a neural network machine learning model that maps sequences to sequences, and solves the gradient disappearance problem by using an LSTM or GRU network. The Seq2seq model mainly consists of two parts, an encoder and a decoder. The encoder converts the input into a hidden state vector containing the content of the input item. The decoder does the opposite, converting the vector into an output sequence, and using the output of the previous step as the input of the next step.

[0040] Since the Seq2seq model is limited to the prediction of a single time series and does not consider the resource utilization relationship across different nodes or containers, it is difficult to obtain accurate prediction accuracy when directly used in microservice resource utilization prediction tasks. On this basis, the embodiment of the application embeds a heterogeneous graph neural network between the encoder and the decoder of the Seq2seq model. The heterogeneous graph neural network allows the resource utilization of the microservice physical nodes and containers to be used as heterogeneous nodes in the heterogeneous graph, and the relationship between the physical nodes and the containers to be used as the edges of the heterogeneous graph. The heterogeneous graph neural network learns the potential relationship between the physical nodes and the containers of the microservice, thereby mining more features that affect the resource utilization of the microservice from the resource utilization sequence, and improving the accuracy of resource utilization prediction.

[0041] In some embodiments, a bidirectional recurrent gated neural network Bi-GRU is used to encode the resource utilization sequence of the two dimensions of the physical nodes and the containers of the microservice to obtain the hidden state. Of course, a bidirectional long short-term memory network Bi-LSTM can also be used for encoding.

[0042] The introduction of the Bi-GRU network further enhances the modeling ability of the time characteristics. Compared with the traditional unidirectional recurrent neural network, the Bi-GRU network can more comprehensively learn the forward and backward characteristics of the data, and consider the historical and future information at the same time. This combination makes the resource prediction model of the embodiment have obvious advantages in dealing with the dynamic and complex resource utilization in the microservice environment.

[0043] As Figure 2 shown is a structure diagram of the Bi-GRU. The function of the encoder Bi-GRU is to convert the historical sequence x of the resource utilization into the hidden state h, x t is the resource utilization feature vector of the time series x of the resource utilization at the time step t. At the time step t, the forward recurrent neural network converts the feature vector of the input x t and the hidden state of the previous time step into the hidden state of the current time step. The transformation function of the hidden layer of the forward recurrent neural network is as follows:

[0044]

[0045] The specific transformation process of the hidden layer of the recurrent neural network is as follows:

[0046] Reset gate: r t = σ(W r · [h t-1 , x t ]),

[0047] Update gate: z t = σ(Wz ·[h t-1 ,x t ]),

[0048] new candidate state:

[0049] hidden state: h t =(1-z t )*h t-1 +z t *h t .

[0050] σ and tanh are activation functions, W r , W z , are the corresponding transpose matrices.

[0051] For the backward recurrent neural network input, the backward hidden state of the next time step is used is represented by the function :

[0052]

[0053] For a time series x of length H, the final forward hidden layer state and the backward hidden layer state are obtained, and the two hidden layer states are spliced and combined to obtain the final hidden layer state h as the initial hidden state.

[0054] Since the encoder needs to compress all the information in the input sequence into the size of the hidden layer state, and capture and retain information from remote time steps, it is difficult to avoid the loss of fine-grained details and the forgetting of part of the long-term dependencies. To this end, a simplified version of the residual connection is added based on the hidden layer state, which adds the original input to the final hidden layer state. Make the model easier to train, and better capture long-term dependencies in the sequence when processing long sequences. Specifically, the resource utilization rate sequence of the two dimensions of the physical nodes and containers of the microservice is encoded to obtain the initial hidden state, including:

[0055] Compress the resource utilization rate sequence of the two dimensions of the physical nodes and containers of the microservice into resource utilization rate information with the same size as the hidden layer state;

[0056] Encode the resource utilization rate information using the hidden layer to obtain the first hidden state;

[0057] Residual connection of the resource utilization rate information to the first hidden state to obtain the initial hidden state.

[0058] In addition, in an embodiment of the present application, the resource utilization sequence fed into the encoder is selected from the historical resource utilization sequence through a sliding window, that is, the historical resource utilization sequences of the physical nodes and containers of the microservice are selected using a sliding window for encoding.

[0059] Sliding windows allow models to be trained using historical time series data, capturing past trends and patterns and helping to better predict changes in resource utilization. They are also highly adaptable, flexibly capturing both short-term and long-term changes in the series and applicable to different types of time series data. More importantly, for real-time data, sliding windows can promptly update the model to maintain sensitivity to new observations in the series.

[0060] In some embodiments, the sliding window selects the historical resource utilization sequences of the physical nodes and containers of the microservice in a time-series continuous manner for encoding. The so-called time-series continuous manner means that the resource utilization sequence selected by each sliding is continuous in time. For example, the sequence selected at the current time step is {x1, x2, ..., x H}, then the sequence selected for the next time step is {x H+1 ,x H+2 ,…,x 2H}.

[0061] Heterogeneous graph neural networks are constructed based on heterogeneous graphs. Specifically, a heterogeneous graph neural network is designed to learn from the heterogeneous graph. The heterogeneous graph constructs the physical nodes and containers of microservices as heterogeneous nodes, and constructs edges based on the relationships between physical nodes and containers. Edges in this heterogeneous graph include those based on relationships between physical nodes, those between physical nodes and containers, and those between containers.

[0062] Specifically, the edges constructed for heterogeneous graphs are:

[0063] (1) Edges constructed based on the relationships between physical nodes.

[0064] The edges between physical nodes are as follows Figure 3 (a). Microservice physical nodes have similar resource utilization characteristics. In some embodiments, the method of constructing edges based on the relationship between physical nodes includes:

[0065] Calculate the correlation between resource utilization sequences between two physical nodes;

[0066] A first type of edge is generated between two physical nodes whose correlation reaches or exceeds a first threshold.

[0067] In some optional methods, the Pearson correlation coefficient is used to measure the correlation between physical nodes and to construct the edge weight. The calculation method is as follows:

[0068]

[0069] where p(x, y) is the correlation coefficient of sequences x and y, cov(x, y) is the covariance of sequences x and y, H is the length of the sliding window, i.e., the length of the sequence at each time step, and σ x , σ y are the mean and standard deviation of the two sequences, respectively.

[0070] The Pearson correlation coefficient ranges between [-1, 1], and the closer the absolute value is to 1, the stronger the correlation between the two resource utilization sequences. A first type of edge between physical nodes is established between all physical nodes with a correlation coefficient greater than a given first threshold δ, W ij represents whether the first type of edge exists between the physical nodes. The formula is as follows:

[0071]

[0072] where X i , X j represent the resource utilization sequences of physical node i and physical node j, respectively.

[0073] (2) Construct edges according to the relationship between physical nodes and containers.

[0074] The edges between physical nodes and containers are shown in Figure 3 (b). Since each container needs to be physically deployed on a physical node, the resource utilization of physical nodes and containers is physically closely related.

[0075] In some embodiments, the method of constructing edges according to the relationship between physical nodes and containers includes:

[0076] Generating a second type of edge between a physical node and each container deployed thereon.

[0077] (3) Construct edges according to the relationship between containers.

[0078] The relationship between containers includes two types, the first type is that the containers under the same node are strongly related in physical deployment. The second type is that the containers of microservices are also related in logical relationship. Therefore, there are two types of edges between containers, including edges constructed according to the relationship between containers on the same physical node and edges constructed according to the relationship between containers on different physical nodes. The two types of edges are shown in Figure 3 (c) and Figure 3 (d), respectively.

[0079] Specifically, the method of constructing edges according to the relationship between containers includes:

[0080] The third type of edges is generated between containers deployed in the same physical node, as shown in (c). Figure 3 Figure 3 The fourth type of edges is generated between containers deployed in different physical nodes, as shown in (d).

[0081] By the above method, the four types of edges between the physical nodes and containers of the microservices, and the physical nodes and containers can be used to construct a heterogeneous graph.

[0082] In some embodiments, the resource prediction model is trained based on the constructed heterogeneous graph using RGCN (Relational Graph Convolutional Network). In the constructed heterogeneous graph, the RGCN is used by the following way: each heterogeneous node, whether it represents a physical node or a container, has an initial representation containing features such as CPU and memory utilization. There are four types of edges in the heterogeneous graph, each representing a different relationship. The heterogeneity of the heterogeneous graph is used to apply RGCN layers to each edge type. The calculation process of information propagation and aggregation of RGCN layers on the heterogeneous graph can be represented as:

[0083]

[0084] where, is the representation of node i in layer l, R is the set of edge types, N r (i) is the set of neighbor nodes of node i under edge type r, is the normalized coefficient of the edge between nodes i and j of type r, is the weight matrix of the l-th layer under edge type r.

[0085] The RGCN layer allows the heterogeneous nodes to communicate and aggregate information with adjacent nodes through different types of edges through multiple rounds of graph convolution operations. In this way, the resource prediction model can more comprehensively understand the relationships between physical nodes, physical nodes and containers, and containers, and improve the prediction accuracy of resource utilization in the microservice architecture. Finally, the RGCN layer is embedded between the encoder and the decoder of the Seq2seq model to form an end-to-end heterogeneous graph neural network structure.

[0086] For the decoder, it decodes the hidden state generated by the encoder and adjusted by the heterogeneous graph neural network to obtain the resource utilization prediction value of the future window.

[0087] As shown in (c). Figure 4 ​The structure diagram of the decoder is shown. The decoder also uses a GRU network as a basic component, and uses the output of the previous time step as the input of the current time step, so that the previous information can be better used to generate the prediction of the next time step.

[0088] Referring to Figures 1-4 In the training of the resource prediction model in the embodiments of the present application, the historical resource utilization rate sequence is needed, and then input into the encoder-heterogeneous graph neural network-decoder model to predict the resource utilization rate at the future time. Therefore, in some embodiments, the microservice resource prediction method comprises the following steps:

[0089] (1) Collect the resource utilization rate sequence of the two dimensions of the physical node and the container of the microservice. The resource utilization rate sequence collected here belongs to the historical record of the resource utilization rate sequence, which is used for training the resource prediction model.

[0090] (2) Use the bidirectional recurrent gated neural network Bi-GRU to extract the bidirectional time sequence features of the resource utilization rate sequence to obtain the initial hidden state.

[0091] (3) According to the hidden state of the resource utilization rate of the two types of physical nodes and containers (i.e. the potential relationship between the two), two different types of heterogeneous nodes and edge attributes of the heterogeneous graph are constructed.

[0092] (4) Measure the correlation between the physical nodes by the correlation coefficient to construct the edges between the physical nodes of the heterogeneous graph; according to the physical deployment relationship between the microservice containers and the physical nodes, the edges between the physical nodes and the containers are constructed; according to the same physical deployment of the physical contact and the same logical contact of the subordinate microservice between the microservice containers, two types of edges between the containers and the containers are constructed; four different edges are used to connect two types of heterogeneous nodes to construct a heterogeneous graph.

[0093] (4) Based on the heterogeneous graph, a heterogeneous graph neural network is constructed. In the embodiments, the heterogeneous graph neural network uses RGCN, and the RGCN graph neural network is used to adjust the hidden state of the resource utilization rate features of the physical nodes and the containers.

[0094] (5) The adjusted hidden state is decoded by the recurrent gated neural network GRU (Gated Recurrent Unit) to obtain the resource prediction value of the future time window.

[0095] According to the embodiments of the present application, the microservice running data disclosed by Alibaba is used to verify the feasibility of the method, which contains more than 40,000 BM nodes, and the resource utilization rate data of about 5839 containers of 500 randomly selected nodes is extracted, totaling 6339 sequences of resource utilization rate at about 14400 timestamps in 10 days.

[0096] Each sliding window contains a historical sequence X H and a future sequence X F as input and output of the model. The first 6 days of resource utilization sequences are used as the training set, the middle 2 days of data are used as the validation set, and the last 2 days of data are used as the test set to ensure that the model can learn historical information during training. The effect of the model is tested from three indicators: MAE (Mean Absolute Error), MAPE (Mean Absolute Percentage Error), and MSE (Mean Squared Error).

[0097] Table 1 and Figure 5 respectively give the test comparison results between the method of the present application and the benchmark method.

[0098] Table 1 Performance comparison table of the method of the present application (HGL-RP) and the benchmark method

[0099]

[0100]

[0101] According to Table 1 and Figure 5 It can be seen that:

[0102] 1. The ARIMA model is based on a linear model, and its ability to simulate nonlinear relationships is relatively limited, with the largest errors in the three indicators.

[0103] 2. MLP, LSTM and GRU models can handle nonlinear relationships, and compared with ARIMA model, they have significant improvement in error. LSTM and GRU models have smaller errors because they are better at handling time series data.

[0104] 3. The GraphGRU model introduces the DTW algorithm to calculate the similarity between nodes based on GRU, and adds GAT to model this relationship. However, DTW cannot capture the negative correlation between nodes, and ignores more fine-grained container sequence features. It also uses a linear layer to process the final hidden state. The performance improvement is small, and it is only slightly better than the GRU model.

[0105] 4. The method of the present application comprehensively considers the positive and negative correlation characteristics between physical nodes on the basis of the existing method, increases the resource utilization characteristics at the container level, introduces RGCN to model the complex relationship between sequences, and overall adopts the encoder-heterogeneous graph neural network-decoder architecture. These improvements enable the method of the present application to comprehensively surpass the comparative method in three indicators. It is particularly outstanding in short-term prediction.

[0106] In addition, as shown in the test results of the method of the present application in long-term prediction, Figure 6 as the prediction time span increases, the performance of the model gradually approaches that of the traditional model. Although it gradually approaches the performance of the traditional model in long-term prediction, it can still maintain a low error level, further proving its superiority in the microservice resource prediction task.

[0107] In summary, in the microservice resource prediction problem, the method of the present application, due to the introduction of multi-dimensional features at the container level, is overall superior to the benchmark method in three indicators, and the prediction error is reduced by about 58.12%. In long-term prediction after the prediction window exceeds 90s, the method of the present application also has better performance, and the error of long-term prediction is reduced by about 14.88%.

[0108] The present application is not limited to the foregoing specific embodiments. The present application extends to any novel one, or any new combination, of the characteristics disclosed in this specification, as well as to any novel method or process disclosed in any step or any new combination of steps.

Claims

1. A fine-grained microservice resource prediction method based on heterogeneous graph neural network, characterized in that: include: The bidirectional recurrent gated neural network (Bi-GRU) is used to encode the resource utilization sequences of the microservice's physical nodes and containers to obtain the initial hidden state, including: compressing the resource utilization sequences of the microservice's physical nodes and containers into resource utilization information of the same size as the hidden layer state; The resource utilization information is encoded using a hidden layer to obtain a first hidden state; the resource utilization information residual is connected to the first hidden state to obtain an initial hidden state, which is input into a heterogeneous graph neural network for adjustment, and the adjusted hidden state is decoded to obtain a resource prediction result; the heterogeneous graph neural network is constructed according to a heterogeneous graph, and the heterogeneous graph uses the physical nodes and containers of the microservice as heterogeneous nodes, respectively, and the relationships between the physical nodes and containers as edges.

2. The fine-grained microservice resource prediction method based on heterogeneous graph neural network according to claim 1 is characterized in that: The relationships between the physical nodes and containers are used as edges, including edges constructed based on relationships between physical nodes, edges constructed based on relationships between physical nodes and containers, and edges constructed based on relationships between containers.

3. The fine-grained microservice resource prediction method based on heterogeneous graph neural network according to claim 2 is characterized in that: The edges constructed based on the relationship between containers include edges constructed based on the relationship between containers under the same physical node and edges constructed based on the relationship between containers under different physical nodes.

4. The fine-grained microservice resource prediction method based on heterogeneous graph neural network according to claim 2 is characterized in that: Methods for constructing edges based on the relationships between physical nodes include: Calculate the correlation between resource utilization sequences between two physical nodes; A first type of edge is generated between two physical nodes whose correlation reaches or exceeds a first threshold.

5. The fine-grained microservice resource prediction method based on heterogeneous graph neural network according to claim 2 is characterized in that: Methods for constructing edges based on the relationship between physical nodes and containers include: The second type of edge is generated between a physical node and each container deployed on it.

6. The fine-grained microservice resource prediction method based on heterogeneous graph neural network according to claim 3 is characterized in that: Methods for constructing edges based on relationships between containers include: The third type of edge is generated between containers deployed on the same physical node, and the fourth type of edge is generated between containers deployed on different physical nodes.

7. The fine-grained microservice resource prediction method based on heterogeneous graph neural network according to claim 1 is characterized in that: A sliding window is used to select the historical resource utilization sequences of the physical nodes and containers of the microservices for encoding.

8. The fine-grained microservice resource prediction method based on heterogeneous graph neural network according to claim 7 is characterized in that: The sliding window selects historical resource utilization sequences of two dimensions, physical nodes and containers of the microservice, in a time-series continuous manner for encoding.

Citation Information

Patent Citations

  • Micro-service architecture-oriented client load balancing method and system

    CN115242797A

  • Method for intelligently predicting K8s resource scheduling

    CN117891559A

  • Serverless efficient resource allocation method and system based on reinforcement learning

    CN116069512A

  • Serialized micro-service resource prediction method based on adversarial learning and heterogeneous graph learning

    CN117648197A