Micro-service workflow arrangement recommendation method based on dynamic graph neural network and sequence model
By employing a dynamic graph neural network and self-attention mechanism, the method addresses the limitations of traditional algorithms by integrating spatial and temporal information, improving the orchestration of microservices through comprehensive vector representations that consider long-term and short-term interests.
Patent Information
- Application Number
- CN202411138794.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-12-06
AI Technical Summary
Traditional recommendation algorithms for microservice workflow orchestration fail to fully utilize temporal and spatial information, and do not consider long-term and short-term interests, leading to suboptimal microservice combinations.
A method using a dynamic graph neural network to extract spatial structure information and a sequence model to capture timing information, combined with a self-attention mechanism to generate comprehensive vector representations, considering both long-term and short-term interests for microservice recommendation.
The method effectively recommends microservices by integrating spatial and temporal information, resulting in more reasonable orchestration by considering long-term and short-term interests, enhancing the accuracy of microservice workflow orchestration.
Smart Images

Figure CN119088440A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of graph neural network technology, and specifically to a microservice orchestration recommendation method based on graph neural network and self-attention mechanism. Background Art
[0002] In today's increasingly complex and changing business environment, microservice architecture has become one of the key technologies for building flexible, maintainable and scalable systems. With the continuous growth of business needs, the coordination and combination of microservices has become a very complex problem. To address this problem, microservice workflows have emerged. Microservice workflows are a method of coordinating and organizing multiple microservices in a microservice architecture to execute complex business processes. Microservice workflows enable developers to design the entire business process more effectively through a central workflow engine, flexible workflow rules and visualization tools, ensuring decoupling, flexibility and high availability between microservices. However, the orchestration of microservice workflows is a very complex process. Workflow modelers need to be familiar with the basic functions of each microservice and the common combinations between microservices. Through human-computer collaboration, the use of microservice recommendation technology can effectively alleviate this problem and assist people to easily and quickly complete the orchestration of the entire microservice workflow.
[0003] At present, in the business scenario of microservice workflow orchestration, traditional recommendation algorithms cannot achieve ideal results. For example, when using a recommendation model based on a collaborative filtering algorithm for recommendation, the model will recommend microservices with high functional similarity to the target microservice to users. However, this approach can only simply combine microservices with similar functions, and does not have the dependency relationship between microservices and the order of execution information. In the microservice workflow orchestration task, adjacent microservices are often two microservices with completely different functions. Therefore, it is meaningless to connect several microservices with similar functions together. It can be seen that it is very important to study a set of recommendation methods suitable for business scenarios of microservice orchestration. Summary of the invention
[0004] The purpose of this paper is to propose a microservice orchestration recommendation method based on dynamic graph neural network and self-attention mechanism to address the problems that traditional recommendation methods do not fully mine the temporal information and spatial information in microservice workflows and do not consider the long-term and short-term interests of microservice workflows in the business scenario of microservice orchestration. To achieve the above purpose, the technical solutions adopted by this invention are as follows:
[0005] Step 1: For a given microservice workflow, take each microservice in the microservice workflow as a node, build edges between two adjacent microservices in the microservice workflow, and build the microservice workflow into a dynamic graph;
[0006] Step 2: Take the constructed microservice dynamic graph as input and input it into the graph neural network. The spatial structure information in the microservice workflow is extracted through the graph neural network. At the same time, a sequence model is built and the workflow sequence is input into the sequence model to extract the timing information in the microservice workflow. Finally, the spatial information and timing information are merged to generate a comprehensive vector as output.
[0007] Step 3: Generate the long-term interest representation of the microservice workflow through the attention mechanism based on the comprehensive vector, generate the short-term interest of the microservice workflow through the recent behavior of the microservice, and comprehensively consider the long-term and short-term interests of the microservice workflow to perform microservice recommendation scoring;
[0008] Step 4: Traverse all microservices in the microservice candidate set, calculate the microservice recommendation score, sort them according to the score, select several microservices with higher scores as the final recommendation results and return them to the user for selection.
[0009] Furthermore, the dynamic graph is represented as G=(u,i,t), which means that microservice node u interacts with microservice i at time t, wherein the dynamic graph includes sequence information between microservices and time information of the interaction.
[0010] Furthermore, the process of mining spatial structure information in microservice workflows through graph neural networks is as follows:
[0011] First, find the neighbor node v of the microservice node u, and then input the current embedding vector of the neighbor node v into the deep neural network to obtain the vector set of the neighbor nodes of the microservice node u. Then input the obtained vector into an aggregator to obtain the final vector representation. The formula is as follows:
[0012] n u =f({ReLU(Qh v +q)|v∈N(u)})
[0013] where n u represents the neighborhood vector, h v is the vector representation of node v, Q is the parameter matrix of the aggregator, q is the bias vector of the aggregator, ReLU is the nonlinear function, f() is the aggregation function, and N(u) is the set of neighbor nodes;
[0014] Then, k layers of convolution operations are performed to obtain more information about the local graph structure around node u; the convolution input of the kth layer depends on the representation output of the k-1th layer, the input of the k-1th layer of convolution depends on the output of the k-2th layer, and so on; this process continues until k is reduced to 0, and the formula is as follows:
[0015]
[0016] Among them, CONVOLVE represents the convolution operation, represents the input vector of node u at the kth layer; the output of the kth convolutional layer is fed back through the fully connected neural network to generate the output embedding z u , the formula is as follows:
[0017]
[0018] Where P1 and P2 are the parameter matrices of the fully connected layer, and I is the bias vector of the fully connected layer;
[0019] Finally, the aggregated neighborhood vector n u The vector representation h with u u Connect them, and then transform the connection vector through the neural network. The formula is as follows:
[0020]
[0021] Where W is the splicing parameter matrix, b is the splicing bias vector, Represents the final output embedding, that is, the spatial structure information; CONACT is the concatenation operation.
[0022] Furthermore, the process of extracting the timing information in the microservice workflow is as follows:
[0023] For a given microservice workflow S = {s1, s2, ..., s n},s n is a microservice node. The microservice node is input into the gate control unit GRU to obtain the hidden state h l ;
[0024] For microservice nodes n , whose vector represents Through the hidden state of step l Get, and h sl is the hidden state of step l-1 Calculate and obtain; thus, the learning embedding of all microservice nodes in the microservice workflow S is obtained, that is, the time series information X, as shown in the following formula:
[0025]
[0026] Furthermore, the process of combining the spatial information and the temporal information is as follows:
[0027]
[0028] where h n Yesn The comprehensive vector representation of Yes n The spatial structure information of Yes n The timing information of Represents element-wise addition.
[0029] Furthermore, the step 3 is specifically as follows:
[0030] Step 3.1: Generate the long-term interest representation of the microservice workflow through the attention mechanism, as follows:
[0031] The comprehensive vector is represented by H = [h1,h2,…,h n ] is input to the self-attention layer to generate the global vector representation F of the microservice workflow, which is formally represented as follows:
[0032]
[0033] Among them, W Q , W k , W V They are the query, key, and value projection matrices of the self-attention mechanism;
[0034] Then the global vector representation F undergoes two linear transformations and a ReLU activation function, and finally passes through a residual connection to complete a self-attention network;
[0035] By stacking m layers of self-attention networks, the final output E of the multi-layer self-attention network is obtained (m) As a long-term expression of interest;
[0036] Step 3.2: Calculate the score based on the long-term and short-term interests of the microservice workflow;
[0037] The vector s of the end node in the microservice workflow n The vector h n As short-term interests, long-term and short-term interests are integrated as the final vector representation, as shown in the following formula:
[0038]
[0039] where Indicates E (k) The nth row of the matrix, ω is the weight coefficient;
[0040] Finally, the model predicts the usage probability of each candidate microservice for a given microservice workflow S, as shown in the following formula:
[0041]
[0042] in Represents microservice V i The recommended probability of being the next microservice used in workflow S;
[0043] Step 3.3: Train the model by minimizing the following objective function J as shown below:
[0044]
[0045] in, Represents the model prediction value, y i represents the actual value, λ represents the regularization parameter, ||θ|| 2 represents the L2 norm of the model parameters θ.
[0046] Furthermore, the step 4 is specifically as follows:
[0047] The user completes the preliminary arrangement of the microservice workflow in the front-end microservice workflow arrangement interface; the front-end page sends the current microservice workflow to the back-end recommendation module; the back-end recommendation module receives the microservice arrangement information sent by the front-end and inputs it into the trained model, then traverses all the microservices in the microservice candidate set, and generates the corresponding microservice score according to the method in the above steps. Then, according to Sort by size and select The microservice with a higher value is returned to the front-end interface as the final recommendation result; after the front-end interface accepts the returned recommendation result, it is displayed on the microservice workflow orchestration page for users to choose.
[0048] Furthermore, the hidden state h l The calculation method is as follows:
[0049] r l =σ(W r ·[h l-1 ,s l ])
[0050] z l =σ(W z ·[h l-1 ,s l ])
[0051] c l =tanh(W·[r l ⊙h l-1 ,s l ])
[0052] h l =(1-z l )⊙h l-1 +z l ⊙cl
[0053] Where W r , W z , W is the parameter matrix, s l is the lth element in the microservice workflow S, ⊙ is element multiplication, r l is the reset gate, z l is the update gate, c l is a candidate hidden state.
[0054] Compared with the prior art, the present invention has the following effects:
[0055] First, the invention transforms the microservice workflow into a microservice dynamic graph, then extracts the spatial structure information in the microservice workflow through a dynamic graph neural network, uses a sequence model to extract the timing information in the microservice workflow, merges the spatial information with the sequence information, and generates a comprehensive vector representation of the microservice. Secondly, the present invention generates a global representation of the microservice workflow through a self-attention mechanism, generates a local representation of the microservice workflow by analyzing recent behaviors in the microservice workflow, and finally performs a comprehensive analysis of the global and local representations of the microservice workflow to complete the microservice recommendation. The method provided by the present invention takes into account the long-term and short-term interests of the microservice workflow, and can fully mine the timing information and spatial information in the microservice workflow, making the orchestration recommendation of the microservice workflow more reasonable. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 This is a flow chart of a microservice orchestration recommendation method based on dynamic graph neural network and self-attention mechanism in the present invention.
[0057] Figure 2 Schematic diagram of the self-attention mechanism in the present invention.
[0058] Figure 3 This is an example diagram of the microservices orchestration recommendation in the present invention. DETAILED DESCRIPTION
[0059] Figure 1This is the overall structural diagram of the present invention. The technical solution of the present invention will be further explained in conjunction with the accompanying drawings. The present invention mainly includes four modules. The function of the first module is to convert the microservice sequence and time information in the microservice workflow into a corresponding dynamic graph, and then generate the spatial vector and sequence vector of the microservice through GNN (graph neural network) and GRU (gated unit), and splice them together to obtain a comprehensive vector of the microservice; the second module extracts the global information of the microservice workflow through the attention mechanism, and generates a global representation of the microservice workflow; the third module comprehensively considers the global progress and local information of the microservice workflow to generate a microservice score; finally, the fourth module scores the candidate microservices, sorts them according to the scores, and generates microservice recommendations. Specifically includes the following steps:
[0060] Step 1: For a given microservice workflow, take each microservice in the microservice workflow as a node, build edges between two adjacent microservices in the microservice workflow, and build the microservice workflow into a dynamic graph. The details are as follows:
[0061] The key point of dynamic graph construction is how to convert the microservice workflow containing timing information into a dynamic graph. Dynamic graphs are different from static graphs. The construction of dynamic graphs needs to include the time when the edges are generated. Therefore, in the present invention, G = (u, i, t) is used to represent the dynamic graph, where the dynamic graph G = (u, i, t) is defined as: microservice u interacts with microservice i at time t, that is, the dynamic graph establishes an edge e between the u node and the i node, and t is the timestamp when the interaction occurs. According to the definition, it can be known that the constructed dynamic graph is a discrete dynamic graph. In addition to the sequence information between microservices, the dynamic graph also obtains the time information of the interaction between microservices.
[0062] Step 2: Input the constructed microservice dynamic graph into the graph neural network as input, and mine the spatial structure information in the microservice workflow through the graph neural network. At the same time, build a sequence model, input the workflow sequence into the sequence model, mine the timing information in the microservice workflow, and finally merge the spatial information and timing information to generate a comprehensive vector as output, as follows:
[0063] Step 2.1: Build a graph neural network to mine the spatial structure information in the microservice workflow.
[0064] The core of the graph neural network part is a local convolution operation. In this operation, the graph neural network learns how to aggregate information from the neighborhood of point u. The basic idea is to first find the neighbor node v of point u, and then input the current embedding vector of v into a DNN (deep neural network) to obtain the vector set of its neighbor nodes. Then input the obtained vector into an aggregator to obtain the final vector representation, and its formula is shown below:
[0065] n u =f({ReLU(Qh v +q)|v∈N(u)})
[0066] Where n u represents the neighborhood vector, h v is the vector representation of node v, Q is the parameter matrix of the aggregator, q is the bias vector of the aggregator, ReLU is the nonlinear function, f() is the aggregation function, and N is the set of neighbor nodes.
[0067] Then, the aggregated neighborhood vector n u The vector representation h with u u Connect them, and then transform the connection vector through a neural network. The formula is shown below.
[0068]
[0069] Where ReLU is a nonlinear function, W is the splicing parameter matrix, and b is the splicing bias vector. represents the final output embedding, n u is the neighbor vector of node u, CONACT is the concatenation operation, which connects the two vectors.
[0070] Each time a convolution operation is applied, a new representation of a microservice node is obtained. By stacking multiple such convolution operations together, more information about the local graph structure around node u can be obtained. Among them, the convolution input of the kth layer depends on the representation output of the k-1th layer, the input of the k-1th layer convolution depends on the output of the k-2th layer, and so on. This process continues until k is reduced to 0, and the formula is as follows:
[0071]
[0072] Among them, CONVOLVE represents the convolution operation; the output of the convolution layer is fed back through the fully connected neural network to generate the output embedding z u , the formula is as follows:
[0073]
[0074] Among them, P1 and P2 are the parameter matrices of the fully connected layer, I is the bias vector of the fully connected layer, and ReLU is a nonlinear function.
[0075] Step 2.2: Build a sequence model:
[0076] Microservice workflows contain a wealth of temporal information. Although the application of graph neural networks solves the problem of difficulty in extracting spatial structure information in the microservice orchestration recommendation process, it cannot extract temporal information in microservice workflows. Based on the above reasons, the present invention uses GRU to generate a sequential embedding representation of microservice nodes.
[0077] For a given microservice workflow S = {s1, s2, ..., s n}. Input it into GRU, and the formal expression of GRU is as follows:
[0078] r l =σ(W r ·[h l-1 ,s l ])
[0079] z l =σ(W z ·[h l-1 ,s l ])
[0080] c l =tanh(W·[r i ⊙h l-1 ,s l ])
[0081] h l =(1-z l )⊙h l-1 +z l ⊙c l
[0082] where all W are parameter matrices, s l is the lth element in the microservice workflow S, ⊙ is element multiplication, r l is the reset gate: it determines whether the previous information should be kept or reset. l Is the update gate: determines how the hidden state at the previous moment should be combined with the candidate hidden state at the current moment. l Candidate hidden state: An intermediate state calculated based on the current input and the previous hidden state, used to generate a new hidden state. t It is a hidden state: it contains the information of the current moment, which is determined by the candidate hidden state and the update gate.
[0083] For a microservice node in S, its vector representation is is the hidden state of step l obtained, and is the hidden state of step l-1 By the above method, the learning embedding of all microservice nodes in the microservice workflow S can be obtained, as shown in the following formula:
[0084]
[0085] Finally, the present invention connects i and X to obtain the vector representation of n microservices in a given microservice workflow, and concatenates the two vectors to obtain the final vector H, as shown in the following formula.
[0086]
[0087] Where h1 is the corresponding vector of s1, i is the vector representation generated by the graph neural network in step 2.1, and X is the vector representation generated in step 2.2. Represents element-wise addition.
[0088] Step 3: Generate the long-term interest representation of the microservice workflow through the attention mechanism, generate the short-term interest of the microservice workflow through the recent behavior of the microservice, and comprehensively consider the long-term and short-term interests of the microservice workflow to recommend microservices. The details are as follows:
[0089] Step 3.1, generate the long-term interest representation of the microservice workflow through the attention mechanism, as follows:
[0090] In the previous steps, the present invention has obtained the node-level vector representation of the microservice in the microservice workflow, that is, H = [h1, h2, ..., h n ]. Next, they are input into the self-attention layer to better generate the global vector representation F of the workflow. The schematic diagram of the self-attention mechanism is as follows Figure 2 Its formal expression is shown as follows:
[0091]
[0092] Where W Q , W k , W V is the projection matrix.
[0093] Then, the present invention uses two linear transformations and the ReLU activation function to enhance the nonlinear ability. Since the problem of underlying data loss may occur in the attention operation, a residual connection is added after the neural network layer to better utilize the underlying information, as shown in the following formula:
[0094] E=ReLU(FW1+b1)W2+b2+F
[0095] Where W1 and W2 are d×d dimensional matrices, b1 and b2 are d dimensional bias vectors; E is the vector representation of the final output.
[0096] Finally, by stacking attention layers layer by layer, the present invention enables the model to better capture the abstract and complex relationships in the input sequence, thereby improving the modeling effect of the hierarchical structure of sequence data. In addition, the multi-layer attention mechanism also increases the depth of the model, which helps to more comprehensively capture the long-distance dependencies in the sequence, thereby improving the performance of the model. The definition of the k-th attention layer is shown in the following formula.
[0097] E (k) =SAN(E (k-1) )
[0098] Where E (k) ∈R n×d It is the final output of the multi-layer self-attention network, and SAN stands for self-attention network.
[0099] Step 3.2, score calculation based on the long-term and short-term interests of the microservice workflow;
[0100] In the previous step, the model obtains the embedding representation E of the microservice workflow through a multi-layer self-attention mechanism. (k) In order to better predict the microservices that users may use next, the model combines the global information (long-term interest) and current information (short-term interest) of the microservice workflow, and then uses this combined embedding as the final vector representation. Specifically, for a given workflow S = {s1, s2, …, s n}, the model takes E (k) As a long-term interest. Use the vector of the end node in the current microservice workflow, that is, s n The vector h n As a short-term interest. Then put them together as the final vector representation, as shown below:
[0101]
[0102] in represents the nth row of the matrix, and ω is the weight coefficient that controls the proportion of long-term interest and short-term interest information. Finally, the model predicts the usage probability of each candidate microservice for a given workflow S, as shown in the following formula:
[0103]
[0104] in Represents microservice V i The recommended probability of becoming the next microservice used in workflow S; Finally, the model is trained by minimizing the following objective function, as shown in the following formula:
[0105]
[0106] Step 4: traverse all microservices in the microservice candidate set, calculate the microservice recommendation score, sort them according to the score, select several microservices with higher scores as the final recommendation results and return them to the user for selection.
[0107] Step 4.1:
[0108] The user completes the preliminary arrangement of the microservice workflow in the front-end microservice workflow arrangement interface. The front-end page sends the current microservice workflow to the back-end recommendation algorithm module.
[0109] Step 4.2:
[0110] After receiving the microservice orchestration information sent by the front-end, the back-end recommendation algorithm module inputs it into the trained model, and then traverses all microservices in the microservice candidate set, and generates the corresponding microservice score according to the method in the above steps. Then, according to Sort by size and select The microservice with a higher value is returned to the front-end interface as the final recommendation result. After the front-end interface accepts the returned recommendation result, it will be displayed on the microservice workflow arrangement page for users to choose, such as Figure 3 As shown in the figure, users need to complete the business requirement of leave approval through microservice workflow orchestration. After the user adds the "leave approval microservice" to the workflow, the recommendation system recommends the "salary statistics service" and "request rejection service" for the user to choose according to the current situation.
[0111] It should be understood that researchers in the field can use the various forms of processes shown above to reorder, add or delete steps. For example, the steps recorded in the present invention can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0112] The above specific implementations do not constitute a limitation on the protection scope of the present invention. Those skilled in the art can make various modifications, combinations, sub-combinations and substitutions according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A microservice workflow orchestration recommendation method based on dynamic graph neural network and sequence model, characterized in that: The following steps are involved: Step 1: For a given microservice workflow, take each microservice in the microservice workflow as a node, build edges between two adjacent microservices in the microservice workflow, and build the microservice workflow into a dynamic graph; Step 2: Take the constructed microservice dynamic graph as input and input it into the graph neural network. The spatial structure information in the microservice workflow is extracted through the graph neural network. At the same time, a sequence model is built and the workflow sequence is input into the sequence model to extract the timing information in the microservice workflow. Finally, the spatial information and timing information are merged to generate a comprehensive vector as output. Step 3: Generate the long-term interest representation of the microservice workflow through the attention mechanism based on the comprehensive vector, generate the short-term interest of the microservice workflow through the recent behavior of the microservice, and comprehensively consider the long-term and short-term interests of the microservice workflow to perform microservice recommendation scoring; Step 4: Traverse all microservices in the microservice candidate set, calculate the microservice recommendation score, sort them according to the score, select several microservices with higher scores as the final recommendation results and return them to the user for selection.
2. According to claim 1, a microservice workflow orchestration recommendation method based on dynamic graph neural network and sequence model is characterized in that: The dynamic graph is represented by G=(u,i,t), which means that microservice node u interacts with microservice i at time t, wherein the dynamic graph includes sequence information between microservices and time information of the interaction.
3. According to claim 1, a microservice workflow orchestration recommendation method based on dynamic graph neural network and sequence model is characterized in that: The specific process of mining spatial structure information in microservice workflows through graph neural networks is as follows: First, find the neighbor node v of the microservice node u, and then input the current embedding vector of the neighbor node v into the deep neural network to obtain the vector set of the neighbor nodes of the microservice node u. Then input the obtained vector into an aggregator to obtain the final vector representation. The formula is as follows: n u =({ReLU(Qh v +q)|v∈N(u)}) where n u represents the neighborhood vector, h v is the vector representation of node v, Q is the parameter matrix of the aggregator, q is the bias vector of the aggregator, ReLU is the nonlinear function, f() is the aggregation function, and N(u) is the set of neighbor nodes; Then, k layers of convolution operations are performed to obtain more information about the local graph structure around node u; the convolution input of the kth layer depends on the representation output of the k-1th layer, the input of the k-1th layer of convolution depends on the output of the k-2th layer, and so on; This process continues until k decreases to 0, and the formula is as follows: Among them, CONVOLVE represents the convolution operation, represents the input vector of node u at the kth layer; the output of the kth convolutional layer is fed back through the fully connected neural network to generate the output embedding z u , the formula is as follows: Where P1 and P2 are the parameter matrices of the fully connected layer, and I is the bias vector of the fully connected layer; Finally, the aggregated neighborhood vector n u The vector representation h with u u Connect them, and then transform the connection vector through the neural network. The formula is as follows: Where W is the splicing parameter matrix, b is the splicing bias vector, Represents the final output embedding, that is, the spatial structure information; CONACT is the concatenation operation.
4. According to claim 1, a microservice workflow orchestration recommendation method based on dynamic graph neural network and sequence model is characterized in that: The process of extracting timing information in the microservice workflow is as follows: For a given microservice workflow S = {s1, s2, ..., s n },s n is a microservice node. The microservice node is input into the gate control unit GRU to obtain the hidden state h l ; For microservice nodes n , whose vector represents Through the hidden state of step l Get, and is the hidden state of step l-1 Calculate and obtain; thus, the learning embedding of all microservice nodes in the microservice workflow S is obtained, that is, the time series information X, as shown in the following formula:
5. According to claim 4, a method for recommending microservice workflow arrangement based on dynamic graph neural network and sequence model is characterized in that: The specific process of combining the spatial information and the temporal information is as follows: where h n Yes n The comprehensive vector representation of Yes n The spatial structure information of Yes n The timing information of Represents element-wise addition.
6. According to claim 5, a method for recommending microservice workflow arrangement based on dynamic graph neural network and sequence model is characterized in that: The step 3 is as follows: Step 3.1: Generate the long-term interest representation of the microservice workflow through the attention mechanism, as follows: The comprehensive vector is represented by H = [h1,h2,…,h n ] is input into the self-attention layer to generate the global vector representation F of the microservice workflow, which is formally represented as follows: Among them, W Q , W k , W V They are the query, key, and value projection matrices of the self-attention mechanism; Then the global vector representation F undergoes two linear transformations and a ReLU activation function, and finally passes through a residual connection to complete a self-attention network; By stacking m layers of self-attention networks, the final output E of the multi-layer self-attention network is obtained (m) As a long-term expression of interest; Step 3.2: Calculate the score based on the long-term and short-term interests of the microservice workflow; The vector s of the end node in the microservice workflow n The vector h n As short-term interests, long-term and short-term interests are integrated as the final vector representation, as shown in the following formula: in Indicates E (k) The nth row of the matrix, ω is the weight coefficient; Finally, the model predicts the usage probability of each candidate microservice for a given microservice workflow S, as shown in the following formula: in Represents microservice V i The recommended probability of being the next microservice used in workflow S; Step 3.3: Train the model by minimizing the following objective function J as shown below: in, Represents the model prediction value, y i represents the actual value, λ represents the regularization parameter, ||θ|| 2 represents the L2 norm of the model parameters θ.
7. A method for recommending microservice workflow arrangement based on dynamic graph neural network and sequence model according to claim 6, characterized in that: The step 4 is specifically as follows: The user completes the preliminary arrangement of the microservice workflow in the front-end microservice workflow arrangement interface; the front-end page sends the current microservice workflow to the back-end recommendation module; the back-end recommendation module receives the microservice arrangement information sent by the front-end and inputs it into the trained model, then traverses all the microservices in the microservice candidate set, and generates the corresponding microservice score according to the method in the above steps. Then, according to Sort by size and select The microservice with a higher value is returned to the front-end interface as the final recommendation result; after the front-end interface accepts the returned recommendation result, it is displayed on the microservice workflow orchestration page for users to choose.
8. The microservice workflow orchestration recommendation method based on dynamic graph neural network and sequence model according to claim 7 is characterized in that: The hidden state h l The calculation method is as follows: r l =σ(W r ·[h l-1 ,s l ]) z l =σ(W z ·[h l-1 ,s l ]) c l =tanh(W·[r l ⊙h l-1 ,s l ]) h l =(1-z l )⊙h l-1 +z l ⊙c l Where W r , W z , W is the parameter matrix, s l is the lth element in the microservice workflow S, ⊙ is element multiplication, r l is the reset gate, z l is the update gate, c l is a candidate hidden state.
