Microservice resource management method, system and electronic device based on dynamic routing
The deep learning neural network model is used to group and manage microservice resources, which solves the problem of inability to efficiently manage microservice resources and the accuracy of interface requests in the existing technology, and achieves the effects of grayscale release and version consistency.
Patent Information
- Application Number
- CN202111078415.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-15
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-09-15
AI Technical Summary
The existing microservice resource management system based on dynamic routing cannot efficiently manage microservice resources, especially the inability to control the interface to accurately request the desired server, which may lead to the problem of inconsistent service versions when publishing services in grayscale.
Using a neural network model based on deep learning, by obtaining the service attributes and request attributes of the microservice resources, performing word segmentation processing and vector encoding, combined with the convolutional neural network and classifier, the transfer matrix is calculated to determine the group to which the microservice resources belong. The interface requests the exact destination of the desired server.
It reduces the overall operation and maintenance complexity and operation and maintenance costs, and ensures the grayscale release and version consistency of services.
Smart Images

Figure CN113778718B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of motion monitoring, and more specifically, to a microservice resource management method based on dynamic routing, a microservice resource management system based on dynamic routing, and an electronic device. Background Art
[0002] Motan is an RPC framework for rapid development of high-performance distributed services. It focuses on simple and practical service governance functions and excellent RPC protocol extension capabilities. It can provide efficient RPC remote calls, as well as service discovery, high service availability, load balancing, management and other service governance functions. One of the current technical solutions is to configure and manage Motan microservice resources based on dynamic routing to solve problems such as high gateway concurrency, API dynamic routing, data packet encryption, request authentication, request blacklist and whitelist, grayscale release, and gateway cache.
[0003] However, the existing microservice resource management system based on dynamic routing cannot efficiently manage microservice resources, and has problems such as not being able to publish microservices through canary publishing, especially it cannot control the interface to accurately request to the desired server. In addition, since it cannot control the interface to accurately request to the desired server, it will lead to the inability to grayscale release services and there may be abnormal problems caused by inconsistent service versions during service release.
[0004] Therefore, an optimized microservice resource management solution is expected.
[0005] At present, deep learning and neural networks have been widely used in computer vision, natural language processing, text signal processing and other fields. In addition, deep learning and neural networks have also shown a level close to or even beyond that of humans in image classification, object detection, semantic segmentation, text translation and other fields.
[0006] In recent years, the development of deep learning and neural networks has provided solutions and plans for the management of microservice resources. Summary of the invention
[0007] In order to solve the above technical problems, this application is proposed. The embodiments of this application provide a microservice resource management method based on dynamic routing, a microservice resource management system based on dynamic routing, and an electronic device, which uses a deep learning neural network model to reasonably group microservice resources based on the service attributes and request attributes of microservice resources. In this way, the control interface can accurately request to the desired server, thereby reducing the overall operation complexity and operation cost of operation.
[0008] According to one aspect of the present application, a microservice resource management method based on dynamic routing is provided, which includes: obtaining a description text of a service attribute of a microservice resource; performing word segmentation on the description text and obtaining a text feature vector sequence through a semantic understanding model; obtaining request attribute data of all requests corresponding to the microservice resource; performing vector encoding on each data item in the request attribute data of each request in the request attribute data of all the requests through a hidden Markov model to obtain a plurality of embedded vectors; arranging the plurality of embedded vectors into a matrix and obtaining a first feature map through a first convolutional neural network; using each text feature vector in the text feature vector sequence as a first classification vector to obtain a plurality of first classification vectors; The feature graph is globally pooled along the channel dimension to obtain a second feature matrix and the second feature matrix is divided along the data item dimension to obtain a plurality of second classification vectors; a transfer matrix between each first classification feature vector in the plurality of first classification vectors and each second classification feature vector in the plurality of second classification vectors is calculated to obtain a plurality of transfer matrices, wherein the number of the transfer matrices is the product of the number of the first classification vectors and the number of the second classification vectors; the plurality of transfer matrices are input into a second convolutional neural network to obtain a second feature graph; the second feature graph is passed through a classifier to obtain a probability that the microservice resource belongs to each group; and based on the probability that the microservice resource belongs to each group, the group to which the microservice resource belongs is determined.
[0009] In the dynamic routing-based microservice resource management method according to the present application, the description text is segmented and then a text feature vector sequence is obtained through a semantic understanding model, including: performing knowledge graph-based word segmentation on the description text to obtain multiple words; using a word embedding model to convert each of the multiple words into a word vector to obtain a word vector sequence composed of multiple word vectors; and, inputting the word vector sequence into the semantic understanding model to obtain the text feature vector sequence.
[0010] In the dynamic routing-based microservice resource management method according to the present application, the word vector sequence is input into the semantic understanding model to obtain the text feature vector sequence, including: using the Bert model of the semantic understanding model to convert each word vector in the word vector sequence into a word feature vector to obtain a word feature vector sequence composed of multiple word feature vectors; and using the bidirectional LSTM model of the semantic understanding model to perform context encoding on the word feature vector sequence based on the description text to obtain the text feature vector sequence.
[0011] In the dynamic routing-based microservice resource management method according to the present application, the first feature map is globally pooled along the channel dimension to obtain a second feature matrix and the second feature matrix is divided along the data item dimension to obtain multiple second classification vectors, including: performing global average pooling or global maximum pooling along the channel dimension on the first feature map to obtain the second feature matrix.
[0012] In the microservice resource management method based on dynamic routing according to the present application, calculating the transfer matrix between each first classification feature vector in the plurality of first classification vectors and each second classification feature vector in the plurality of second classification vectors includes: calculating the transfer matrix between each first classification feature vector in the plurality of first classification vectors and each second classification feature vector in the plurality of second classification vectors by the following formula; the formula is: j =M i,j *x i , where x i represents each first classification vector in the plurality of first classification vectors, y j represents each second classification vector in the plurality of second classification vectors, M i,j Denotes the transfer matrix.
[0013] In the microservice resource management method based on dynamic routing according to the present application, the second feature graph is passed through a classifier to obtain the probability that the microservice resource belongs to each group, including: using one or more fully connected layers of the classifier to fully connect the second feature graph to obtain a classification feature vector; and calculating the Softmax classification function value of the classification feature vector belonging to each group respectively as the probability that the classification feature vector belongs to each group respectively.
[0014] In the microservice resource management method based on dynamic routing according to the present application, the group to which the microservice resource belongs is determined based on the probability that the microservice resource belongs to each group, including: determining the group corresponding to the maximum probability that the classification feature vector belongs to each group as the group to which the microservice resource belongs.
[0015] According to another aspect of the present application, there is also provided a microservice resource management system based on dynamic routing, which includes: a service attribute unit, used to obtain a description text of a service attribute of a microservice resource;
[0016] A semantic understanding unit, used to perform word segmentation processing on the description text and then obtain a text feature vector sequence through a semantic understanding model; a request attribute unit, used to obtain request attribute data of all requests corresponding to the microservice resource; a vector construction unit, used to vector encode each data item in the request attribute data of each request in the request attribute data of all the requests through a hidden Markov model to obtain multiple embedded vectors; a first neural network unit, used to arrange the multiple embedded vectors into a matrix and then obtain a first feature map through a first convolutional neural network; a first classification vector specifying unit, used to use each text feature vector in the text feature vector sequence as a first classification vector to obtain multiple first classification vectors; a global pooling unit, used to perform global pooling processing on the first feature map along the channel dimension to obtain a second feature matrix and divide the second feature matrix along the data item dimension to obtain multiple second classification vectors; a transfer matrix calculation unit, used to calculate the transfer matrix between each first classification feature vector in the multiple first classification vectors and each second classification feature vector in the multiple second classification vectors to obtain multiple transfer matrices, and the number of the transfer matrices is the product of the number of the first classification vectors and the number of the second classification vectors; a second neural network unit, used to input the multiple transfer matrices into a second convolutional neural network to obtain a second feature map; a classification unit, used to pass the second feature map through a classifier to obtain the probability that the microservice resource belongs to each group; and a grouping unit, used to determine the group to which the microservice resource belongs based on the probability that the microservice resource belongs to each group.
[0017] In the dynamic routing-based microservice resource management system according to the present application, the semantic understanding unit includes: a word segmentation subunit, which is used to perform word segmentation processing on the description text based on the knowledge graph to obtain multiple words; a word vector conversion subunit, which is used to use a word embedding model to convert each of the multiple words into a word vector to obtain a word vector sequence composed of multiple word vectors; and a semantic feature extraction subunit, which is used to input the word vector sequence into the semantic understanding model to obtain the text feature vector sequence.
[0018] According to another aspect of the present application, an electronic device is provided, comprising: a processor; and a memory, in which computer program instructions are stored, and when the computer program instructions are executed by the processor, the processor executes the microservice resource management method based on dynamic routing as described above.
[0019] Compared with the prior art, the microservice resource management method based on dynamic routing, the microservice resource management system based on dynamic routing and the electronic device provided by the present application use a deep learning-based neural network model to reasonably group microservice resources based on the service attributes and request attributes of the microservice resources. In this way, the control interface can accurately request the desired server, thereby reducing the overall operation complexity and operation cost of operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] By describing the embodiments of the present application in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present application will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0021] Figure 1 A schematic diagram of grouping and managing microservice resources according to an embodiment of the present application is illustrated.
[0022] Figure 2 is a flowchart of a microservice resource management method based on dynamic routing according to an embodiment of the present application;
[0023] Figure 3 Schematic diagram of the system architecture of a microservice resource management method based on dynamic routing according to an embodiment of the present application;
[0024] Figure 4 The present invention is a flowchart of a method for managing microservice resources based on dynamic routing according to an embodiment of the present application, in which a text feature vector sequence is obtained through a semantic understanding model after word segmentation processing is performed on the description text.
[0025] Figure 5 4 is a block diagram of a microservice resource management system based on dynamic routing according to an embodiment of the present application.
[0026] Figure 6 4 is a block diagram of a semantic understanding unit in a microservice resource management system based on dynamic routing according to an embodiment of the present application.
[0027] Figure 7 is a block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] Below, the exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application, and it should be understood that the present application is not limited to the exemplary embodiments described here.
[0029] Scenario Overview
[0030] As mentioned above, the existing microservice resource management system based on dynamic routing cannot efficiently manage microservice resources, and there are problems such as the inability to publish microservices through a canary release method, especially the inability to control the interface to accurately request to the desired server. In addition, since it cannot control the interface to accurately request to the desired server, it will lead to the inability to grayscale release services and there may be abnormal problems caused by inconsistent service versions during service release. Therefore, an optimized microservice resource management solution is expected.
[0031] Accordingly, the inventors of the present application attempt to manage Motan microservice resources in groups, such as Figure 1 As shown. It should be understood that grouping management of Motan microservice resources facilitates routing control and other operations on the grouped resources as a whole so that the control interface can accurately request the desired server, thereby reducing the overall operation and maintenance complexity and cost. However, the key point is how to group Motan microservice resources so that the operation and management of the gateway are very efficient. In other words, in order to manage Motan service resources, multiple services need to be managed in groups. Therefore, how to group different services becomes a problem that needs to be considered.
[0032] The inventors of the present application have considered that in the grouping process, in addition to the properties of the service itself, it is also necessary to consider the grayscale access controlled by the Motan microservice, that is, it is necessary to consider the allocation of requests to grayscale groups.
[0033] Therefore, in the technical solution of the present application, in order to perform appropriate grouping based on both service attributes and request attributes, it is necessary to effectively extract and express the hidden information in the service attributes and request attributes. Therefore, the applicant of the present application considers using a neural network model based on deep learning to implement the classification problem.
[0034] Specifically, first, when using the service attributes, the description text of the service is obtained and converted into a feature vector sequence through a semantic understanding model. Here, in order to make full use of the contextual information of the description text of the service, the semantic understanding model is implemented as a Bert model + a bidirectional LSTM model, so that a feature vector is obtained for each word of the description text, which constitutes the feature vector sequence. Then, for the request attributes, the request attribute data of all requests corresponding to the service are obtained, including data such as the specified API version number, the specified user, the specified area, the specified IP, the random ratio, the weight, etc., and each data is represented by a vector. For example, a hidden Markov model can be used for vector encoding to obtain an embedded vector for each data. In addition, since the semantic information between these data is not rich, in order to mine the implicit association information between the data, multiple embedded vectors are arranged into a matrix and input into the first convolutional neural network to obtain the first feature map.
[0035] Then, in order to realize the association fusion of service attributes and request attributes, each feature vector in the feature vector sequence is first used as a first classification vector to obtain multiple first classification vectors, for example, denoted as x m , and perform global pooling along the channel on the first feature map to obtain a second feature matrix, and then divide it along the data item dimension to obtain multiple second classification vectors, for example, denoted as y n Then, calculate x m Each vector x in i With y n Each vector y in j The transfer matrix M i,j , so that y j =M i,j *x i , that is, the transfer matrix M i,j Can represent the corresponding set of vectors x i and j The association information between them, so that a total of m*n transfer matrices M are obtained i,j .
[0036] After that, we further transform the m*n transfer matrices M i,j As the input of the second convolutional neural network, a second feature map is obtained. After the second feature map is passed through the classifier, the probability of the service belonging to each group can be obtained, thereby realizing the grayscale grouping of the service.
[0037] Based on this, the present application proposes a microservice resource management method based on dynamic routing, which includes: obtaining a description text of the service attributes of a microservice resource; performing word segmentation on the description text and then obtaining a text feature vector sequence through a semantic understanding model; obtaining request attribute data of all requests corresponding to the microservice resource; performing vector encoding on each data item in the request attribute data of each request in the request attribute data of all the requests through a hidden Markov model to obtain multiple embedded vectors; arranging the multiple embedded vectors into a matrix and then passing through a first convolutional neural network to obtain a first feature map; using each text feature vector in the text feature vector sequence as a first classification vector to obtain multiple first classification vectors; Performing global pooling processing along the channel dimension to obtain a second feature matrix and dividing the second feature matrix along the data item dimension to obtain a plurality of second classification vectors; calculating a transfer matrix between each first classification feature vector in the plurality of first classification vectors and each second classification feature vector in the plurality of second classification vectors to obtain a plurality of transfer matrices, wherein the number of the transfer matrices is the product of the number of the first classification vectors and the number of the second classification vectors; inputting the plurality of transfer matrices into a second convolutional neural network to obtain a second feature map; passing the second feature map through a classifier to obtain a probability that the microservice resource belongs to each group; and determining the group to which the microservice resource belongs based on the probability that the microservice resource belongs to each group.
[0038] After introducing the basic principles of the present application, various non-limiting embodiments of the present application will be described in detail with reference to the accompanying drawings.
[0039] Exemplary Methods
[0040] Figure 2 The figure shows a flow chart of a microservice resource management method based on dynamic routing. Figure 2As shown, according to the embodiment of the present application, the microservice resource management method based on dynamic routing includes: S110, obtaining a description text of the service attributes of the microservice resource; S120, performing word segmentation on the description text and then obtaining a text feature vector sequence through a semantic understanding model; S130, obtaining request attribute data of all requests corresponding to the microservice resource; S140, respectively performing vector encoding on each data item in the request attribute data of each request in the request attribute data of all the requests through a hidden Markov model to obtain a plurality of embedded vectors; S150, arranging the plurality of embedded vectors into a matrix and then obtaining a first feature map through a first convolutional neural network; S160, using each text feature vector in the text feature vector sequence as a first classification vector to obtain a plurality of first classification vectors; S170, The first feature map is globally pooled along the channel dimension to obtain a second feature matrix and the second feature matrix is divided along the data item dimension to obtain a plurality of second classification vectors; S180, a transfer matrix between each first classification feature vector in the plurality of first classification vectors and each second classification feature vector in the plurality of second classification vectors is calculated to obtain a plurality of transfer matrices, wherein the number of transfer matrices is the product of the number of the first classification vectors and the number of the second classification vectors; S190, the plurality of transfer matrices are input into a second convolutional neural network to obtain a second feature map; S200, the second feature map is passed through a classifier to obtain a probability that the microservice resource belongs to each group; and, S210, based on the probability that the microservice resource belongs to each group, the group to which the microservice resource belongs is determined.
[0041] Figure 3 The figure shows a schematic diagram of the architecture of the microservice resource management method based on dynamic routing according to an embodiment of the present application. Figure 3 As shown, in the network architecture of the microservice resource management method based on dynamic routing, first, the description text of the service attribute of the acquired microservice resource (for example, Figure 3 The T in the figure is then segmented and passed through a semantic understanding model (e.g. Figure 3 ) to obtain a sequence of text feature vectors (e.g., Figure 3 Ts indicated in ).
[0042] Then, the obtained request data of all requests corresponding to the microservice resource (for example, Figure 3 Each data item in each requested attribute data (R1 to Rn) shown in FIG. 1 is respectively passed through a hidden Markov model (e.g., Figure 3 ) to obtain multiple embedded vectors (e.g., Figure 3Next, the plurality of embedded vectors are arranged into a matrix (e.g., as Figure 3 M) is then passed through a first convolutional neural network (e.g., Figure 3 ) to obtain the first feature map (e.g., Figure 3 F1 shown in the figure).
[0043] Then, if Figure 3 As shown, the first feature map is globally pooled along the channel dimension to obtain a second feature matrix (for example, Figure 3 Mf) and divide the second feature matrix along the data item dimension to obtain a plurality of second classification vectors (for example, Figure 3 Vc2 as shown in the figure), and each text feature vector in the text feature vector sequence is used as a first classification vector to obtain a plurality of first classification vectors. Then, a transfer matrix between each first classification feature vector in the plurality of first classification vectors and each second classification feature vector in the plurality of second classification vectors is calculated to obtain a plurality of transfer matrices (for example, Figure 3 Mt shown in the figure).
[0044] Furthermore, if Figure 3 As shown, the multiple transfer matrices are input into a second convolutional neural network (for example, as Figure 3 ) to obtain the second feature map (e.g., Figure 3 Then, the second feature graph is passed through a classifier to obtain the probability that the microservice resource belongs to each group, and based on the probability that the microservice resource belongs to each group, the group to which the microservice resource belongs is determined.
[0045] In step S110, the description text of the service attributes of the microservice resources is obtained. As mentioned above, in order to manage Motan service resources, multiple services need to be managed in groups. Therefore, how to group different services becomes a problem that needs to be considered. The inventors of the present application have taken into account that in the grouping process, in addition to the attributes of the service itself, the grayscale access controlled by Motan microservices needs to be considered, that is, the allocation of requests to grayscale groups needs to be considered. Therefore, in the technical solution of the present application, appropriate grouping is performed based on both service attributes and request attributes. Accordingly, in step S110, the description text of the service attributes of the microservice resources is first obtained.
[0046] Here, in the embodiment of the present application, the microservice resource is a Motan microservice resource, and the description text of its service attributes includes an RPC framework description, a registration center, a configuration center, a governance center, a scheduling center, and the like.
[0047] In step S120, the description text is segmented and then a text feature vector sequence is obtained through a semantic understanding model. In order to perform appropriate grouping based on both service attributes and request attributes, it is necessary to effectively extract and express the hidden information in the service attributes and request attributes. Therefore, the applicant of this application considers using a neural network model based on deep learning as a classification problem.
[0048] Specifically, in an embodiment of the present application, the process of obtaining a text feature vector sequence through a semantic understanding model after word segmentation of the description text includes: first, word segmentation of the description text of the service attribute based on a knowledge graph is performed to split the description text into multiple words, that is, word segmentation of the description text of the service attribute is performed based on a knowledge graph with professional knowledge as the core. It should be understood that in some examples of the present application, after word segmentation of the description text of the service attribute, the obtained multiple words can also be sorted, for example, redundant words are removed, duplicate words are removed, etc., to reduce the difficulty of data processing, and comparison is not limited to the present application.
[0049] Next, the multiple words are converted into word vectors, that is, the multiple words are mapped to the word vector space to represent each word in the form of a vector. In a specific implementation, a bag-of-words model or a word embedding model can be used to implement word vector conversion. A person of ordinary skill in the art should know that the essential purpose of word vector conversion is to convert words originally represented by unstructured data into word vectors represented by structured data, so as to facilitate computer data processing.
[0050] In order to make full use of the contextual information of the description text of the service, the semantic understanding model is implemented as a Bert model + a bidirectional LSTM model, so that a feature vector is obtained for each word in the description text, which constitutes the feature vector sequence. Specifically, in an embodiment of the present application, the semantic understanding model includes a Bert model and a bidirectional LSTM model, wherein the Bert model of the semantic understanding model converts each word vector in the word vector sequence into a word feature vector to obtain a word feature vector sequence composed of multiple word feature vectors; and the bidirectional LSTM model is used to perform context encoding of the word feature vector sequence based on the description text to obtain the text feature vector sequence.
[0051] Those skilled in the art should know that the Bert model uses the Masked model to achieve the bidirectionality of the language model, proving the importance of bidirectionality to language representation pre-training, that is, the Bert model is a truly bidirectional language model, and each word can use the context information of the word at the same time. The bidirectional LSTM model is derived from the LSTM model. The LSTM is proposed to address the shortcomings of the RNN neural network, such as the gradient vanishing problem when the sequence is too long, and it is difficult to learn long-term dependent features. The LSTM unit controls the transmission of information through the input gate, forget gate, and output gate. The unidirectional LSTM can only capture the historical information of the sequence. When doing identity recognition, the context of the name needs to be considered, so the bidirectional LSTM is used here to capture the context information of the sequence.
[0052] Figure 4 The present invention is a flowchart of a method for managing microservice resources based on dynamic routing according to an embodiment of the present application, in which the description text is segmented and then a semantic understanding model is used to obtain a text feature vector sequence. Figure 4 As shown, in an embodiment of the present application, the description text is segmented and then a text feature vector sequence is obtained through a semantic understanding model, including the steps of: S310, performing word segmentation on the description text based on a knowledge graph to obtain a plurality of words; S320, using a word embedding model to convert each of the plurality of words into a word vector to obtain a word vector sequence composed of a plurality of word vectors; S330, using the Bert model of the semantic understanding model to convert each word vector in the word vector sequence into a word feature vector to obtain a word feature vector sequence composed of a plurality of word feature vectors; and, S340, using the bidirectional LSTM model of the semantic understanding model to perform context encoding on the word feature vector sequence based on the description text to obtain the text feature vector sequence.
[0053] In step S130, the request attribute data of all requests corresponding to the microservice resource are obtained. Here, in the embodiment of the present application, the request attribute data of the request includes: specified API version number, specified user, specified region, specified IP, random ratio, weight and other data items.
[0054] In step S140, each data item in the request attribute data of each request in the request attribute data of all the requests is vector-encoded by a hidden Markov model to obtain a plurality of embedded vectors. That is, the request attribute data of each request is represented in the form of a vector by a hidden Markov model.
[0055] Those skilled in the art should know that the hidden Markov model is a statistical model that requires a large amount of data related to recognition for training. Based on the characteristics of the statistical model, the hidden Markov model is divided into two types: a discrete hidden Markov model (DHMM): the statistical probability of this type of model is based on discrete data, and a continuous hidden Markov model (CHMM): the statistical probability of this type of model is based on continuous data. Accordingly, the present application adopts a discrete hidden Markov model (DHMM).
[0056] In step S150, the plurality of embedded vectors are arranged into a matrix and then passed through a first convolutional neural network to obtain a first feature map. It should be understood that although the data items in the request attributes are represented in the form of vectors using a hidden Markov model, the semantic information between these data is not rich. Therefore, in order to mine the implicit association information between the data, the plurality of embedded vectors are arranged into a matrix and then input into the first convolutional neural network to obtain the first feature map.
[0057] A person skilled in the art should be aware that convolutional neural networks have excellent performance in extracting local features. Therefore, after arranging the multiple embedded vectors into a matrix, the first convolutional neural network can extract a high-dimensional implicit representation of the local features in the matrix. It should be understood that the embedded vector represents a data item, and therefore the local features of the matrix represent high-dimensional implicit features of the association between the data items.
[0058] In step S160, each text feature vector in the text feature vector sequence is used as a first classification vector to obtain a plurality of first classification vectors. In step S170, the first feature map is globally pooled along the channel dimension to obtain a second feature matrix and the second feature matrix is divided along the data item dimension to obtain a plurality of second classification vectors. In step S180, the transfer matrix between each first classification feature vector in the plurality of first classification vectors and each second classification feature vector in the plurality of second classification vectors is calculated to obtain a plurality of transfer matrices, the number of which is the product of the number of the first classification vectors and the number of the second classification vectors.
[0059] That is, in the embodiment of the present application, in order to realize the association and fusion of service attributes and request attributes, each feature vector in the feature vector sequence is first used as a first classification vector to obtain multiple first classification vectors, for example, denoted as x m , and perform global pooling along the channel on the first feature map to obtain a second feature matrix, and then divide it along the data item dimension to obtain multiple second classification vectors, for example, denoted as y n Then, calculate x m Each vector x ini With y n Each vector y in j The transfer matrix M i,j , so that y j =M i,j *x i , that is, the transfer matrix M i,j Can represent the corresponding set of vectors x i and j The association information between them, so that a total of m*n transfer matrices M are obtained i,j .
[0060] That is, in the embodiment of the present application, calculating the transfer matrix between each first classification feature vector in the plurality of first classification vectors and each second classification feature vector in the plurality of second classification vectors includes: calculating the transfer matrix between each first classification feature vector in the plurality of first classification vectors and each second classification feature vector in the plurality of second classification vectors by the following formula; wherein the formula is: j =M i,j *x i , where x i represents each first classification vector in the plurality of first classification vectors, y j represents each second classification vector in the plurality of second classification vectors, M i,j Denotes the transfer matrix.
[0061] In a specific example of the present application, the first feature map can be subjected to global average pooling or global maximum pooling along the channel dimension to obtain the second feature matrix. It should be understood that global average pooling makes the eigenvalues at each position in the second feature matrix more focused on the average features of the vectors on each channel dimension, while average maximum pooling makes the eigenvalues at each position in the second feature matrix more focused on the features with the largest amount of information of the vectors on each channel dimension. Both have their own advantages and disadvantages and can be selected based on actual application scenarios and performance.
[0062] It is worth mentioning that in an embodiment of the present application, the transfer matrix between the first classification vector and the second classification vector is used to represent the association between the first classification vector and the second classification vector, that is, the association between the service attributes and the request attributes of the microservice resource.
[0063] In step S2190, the multiple transfer matrices are input into a second convolutional neural network to obtain a second feature map. That is, the convolutional neural network is used as a feature extractor to extract high-dimensional implicit features in the multiple transfer matrices, that is, high-dimensional implicit features of the association between the service attributes and request attributes of the microservice resources, so as to improve the grouping accuracy of the microservice resources.
[0064] In step S200, the second feature map is passed through a classifier to obtain the probability that the microservice resource belongs to each group. Specifically, in an embodiment of the present application, the process of passing the second feature map through a classifier to obtain the probability that the microservice resource belongs to each group includes: first, using one or more fully connected layers of the classifier to fully connect the second feature map to obtain a classification feature vector. It should be understood that the information at each position in the second feature map can be fully utilized through the fully connected layer to improve the grouping accuracy.
[0065] Next, the Softmax classification function values of the classification feature vectors belonging to each group are calculated as the probabilities of the classification feature vectors belonging to each group. That is, the probability values of the classification feature vectors belonging to each classification label are calculated with each group as the classification label.
[0066] In step S210, based on the probability that the microservice resource belongs to each group, the group to which the microservice resource belongs is determined. Specifically, the group label corresponding to the one with the highest probability is used as the group of the microservice resource. In this way, grayscale grouping of services is achieved.
[0067] In summary, the microservice resource management method based on dynamic routing of the embodiment of the present application is explained, which uses a deep learning-based neural network model to reasonably group microservice resources based on the service attributes and request attributes of the microservice resources. In this way, the control interface can accurately request the desired server, thereby reducing the overall operation complexity and reducing the operation cost.
[0068] Exemplary Systems
[0069] Figure 5 The figure shows a block diagram of a microservice resource management system based on dynamic routing according to an embodiment of the present application. Figure 5As shown, according to an embodiment of the present application, a microservice resource management system 500 based on dynamic routing includes: a service attribute unit 510, which is used to obtain a description text of the service attributes of a microservice resource; a semantic understanding unit 520, which is used to perform word segmentation on the description text and then obtain a text feature vector sequence through a semantic understanding model; a request attribute unit 530, which is used to obtain request attribute data of all requests corresponding to the microservice resource; a vector construction unit 540, which is used to vector encode each data item in the request attribute data of each request in the request attribute data of all the requests through a hidden Markov model to obtain multiple embedded vectors; a first neural network unit 550, which is used to arrange the multiple embedded vectors into a matrix and then obtain a first feature map through a first convolutional neural network; a first classification vector specifying unit 560, which is used to use each text feature vector in the text feature vector sequence as a first classification vector to obtain multiple first classification vectors ; A global pooling unit 570, configured to perform global pooling processing on the first feature map along the channel dimension to obtain a second feature matrix and to divide the second feature matrix along the data item dimension to obtain a plurality of second classification vectors; a transfer matrix calculation unit 580, configured to calculate a transfer matrix between each first classification feature vector in the plurality of first classification vectors and each second classification feature vector in the plurality of second classification vectors to obtain a plurality of transfer matrices, wherein the number of the transfer matrices is the product of the number of the first classification vectors and the number of the second classification vectors; a second neural network unit 590, configured to input the plurality of transfer matrices into a second convolutional neural network to obtain a second feature map; a classification unit 600, configured to pass the second feature map through a classifier to obtain a probability that the microservice resource belongs to each group; and a grouping unit 610, configured to determine the group to which the microservice resource belongs based on the probability that the microservice resource belongs to each group.
[0070] In one example, in the microservice resource management system 500 based on dynamic routing, as Figure 6 As shown, the semantic understanding unit 520 includes: a word segmentation subunit 521, used to perform word segmentation processing on the description text based on the knowledge graph to obtain multiple words; a word vector conversion subunit 522, used to use a word embedding model to convert each of the multiple words into a word vector to obtain a word vector sequence composed of multiple word vectors; and a semantic feature extraction subunit 523, used to input the word vector sequence into the semantic understanding model to obtain the text feature vector sequence.
[0071] In one example, in the above-mentioned dynamic routing-based microservice resource management system 500, the semantic feature extraction subunit is further used to use the Bert model of the semantic understanding model to convert each word vector in the word vector sequence into a word feature vector to obtain a word feature vector sequence composed of multiple word feature vectors; and, use the bidirectional LSTM model of the semantic understanding model to perform context encoding on the word feature vector sequence based on the description text to obtain the text feature vector sequence.
[0072] In one example, in the above-mentioned dynamic routing-based microservice resource management system 500, the global pooling unit 570 is further used to perform global average pooling or global maximum pooling processing along the channel dimension on the first feature map to obtain the second feature matrix.
[0073] In one example, in the microservice resource management system 500 based on dynamic routing, the transfer matrix calculation unit 580 is further used to calculate the transfer matrix between each first classification feature vector in the plurality of first classification vectors and each second classification feature vector in the plurality of second classification vectors using the following formula, wherein the formula is: j =M i,j *x i , where x i represents each first classification vector in the plurality of first classification vectors, y j represents each second classification vector in the plurality of second classification vectors, M i,j Denotes the transfer matrix.
[0074] In one example, in the above-mentioned dynamic routing-based microservice resource management system 500, the classification unit 600 is further used to: use one or more fully connected layers of the classifier to fully connect the second feature map to obtain a classification feature vector; and calculate the Softmax classification function value of the classification feature vector belonging to each group respectively as the probability that the classification feature vector belongs to each group respectively.
[0075] In one example, in the above-mentioned dynamic routing-based microservice resource management system 500, the grouping unit 610 is further used to determine the group corresponding to the maximum probability that the classification feature vector belongs to each group as the group to which the microservice resource belongs.
[0076] Here, those skilled in the art can understand that the specific functions and operations of each unit and module in the microservice resource management system 500 based on dynamic routing have been referred to above. Figures 1 to 4The description of the dynamic routing-based microservice resource management method has been introduced in detail, and therefore, its repeated description will be omitted.
[0077] As described above, the microservice resource management system 500 based on dynamic routing according to the embodiment of the present application can be implemented in various terminal devices, such as a server based on a microservice resource management algorithm based on dynamic routing. In one example, the microservice resource management system 500 based on dynamic routing according to the embodiment of the present application can be integrated into the terminal device as a software module and / or a hardware module. For example, the microservice resource management system 500 based on dynamic routing can be a software module in the operating system of the terminal device, or can be an application developed for the terminal device; of course, the microservice resource management system 500 based on dynamic routing can also be one of the many hardware modules of the terminal device.
[0078] Alternatively, in another example, the dynamic routing-based microservice resource management system 500 and the terminal device may also be separate devices, and the dynamic routing-based microservice resource management system 500 may be connected to the terminal device via a wired and / or wireless network, and transmit interactive information in accordance with an agreed data format.
[0079] Exemplary Electronic Devices
[0080] Below, reference Figure 7 To describe the electronic device according to the embodiment of the present application. Figure 7 As shown, the electronic device 10 includes one or more processors 11 and a memory 12. The processor 11 may be a central processing unit (CPU) or other processing units with data processing capability and / or instruction execution capability, and may control other components in the electronic device 10 to perform desired functions.
[0081] The memory 12 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 11 may run the program instructions to implement the functions of the microservice resource management method based on dynamic routing of the various embodiments of the present application described above and / or other desired functions. Various contents such as description text of service attributes, various data items of request attributes, grouping results, etc. may also be stored in the computer-readable storage medium.
[0082] In one example, the electronic device 10 may further include: an input system 13 and an output system 14 , and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0083] The input system 13 may include, for example, a keyboard, a mouse, and the like.
[0084] The output system 14 can output various information to the outside, including grouping results, etc. The output system 14 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0085] Of course, to simplify, Figure 7 Only some of the components related to the present application in the electronic device 10 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device 10 may also include any other appropriate components.
[0086] The basic principles of the present application are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present application are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present application. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, not for limitation, and the above details do not limit the present application to being implemented by adopting the above specific details.
[0087] The block diagrams of the devices, apparatuses, equipment, and systems involved in this application are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The words "such as" used here refer to the phrase "such as but not limited to", and can be used interchangeably with them.
[0088] It should also be noted that in the apparatus, device and method of the present application, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present application.
[0089] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present application. Therefore, the present application is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0090] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present application to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A microservice resource management method based on dynamic routing, characterized in that: include: Get the description text of the service attributes of the microservice resource; After word segmentation processing is performed on the description text, a text feature vector sequence is obtained through a semantic understanding model; Obtain request attribute data of all requests corresponding to the microservice resource; perform vector encoding on each data item in the request attribute data of each request in the request attribute data of all the requests through a hidden Markov model to obtain multiple embedded vectors; arrange the multiple embedded vectors into a matrix and pass it through a first convolutional neural network to obtain a first feature map; use each text feature vector in the text feature vector sequence as a first classification vector to obtain multiple first classification vectors; perform global pooling processing on the first feature map along the channel dimension to obtain a second feature matrix and divide the second feature matrix along the data item dimension to obtain multiple second classification vectors; calculate the transfer matrix between each first classification feature vector in the multiple first classification vectors and each second classification feature vector in the multiple second classification vectors to obtain multiple transfer matrices, and the number of the transfer matrices is the product of the number of the first classification vectors and the number of the second classification vectors; Inputting the multiple transfer matrices into a second convolutional neural network to obtain a second feature map; The second feature graph is passed through a classifier to obtain the probability that the microservice resource belongs to each group; and based on the probability that the microservice resource belongs to each group, the group to which the microservice resource belongs is determined.
2. The microservice resource management method based on dynamic routing according to claim 1, wherein: After word segmentation is performed on the description text, a text feature vector sequence is obtained through a semantic understanding model, including: performing word segmentation on the description text based on a knowledge graph to obtain a plurality of words; using a word embedding model to convert each of the plurality of words into a word vector to obtain a word vector sequence composed of a plurality of word vectors; and inputting the word vector sequence into the semantic understanding model to obtain the text feature vector sequence.
3. The microservice resource management method based on dynamic routing according to claim 2, wherein: The word vector sequence is input into the semantic understanding model to obtain the text feature vector sequence, including: using the Bert model of the semantic understanding model to convert each word vector in the word vector sequence into a word feature vector to obtain a word feature vector sequence composed of multiple word feature vectors; and using the bidirectional LSTM model of the semantic understanding model to perform context encoding on the word feature vector sequence based on the description text to obtain the text feature vector sequence.
4. The microservice resource management method based on dynamic routing according to claim 1, wherein: The first feature map is globally pooled along the channel dimension to obtain a second feature matrix and the second feature matrix is divided along the data item dimension to obtain multiple second classification vectors, including: performing global average pooling or global maximum pooling along the channel dimension on the first feature map to obtain the second feature matrix.
5. The microservice resource management method based on dynamic routing according to claim 1, wherein: Calculating the transfer matrix between each first classification feature vector in the plurality of first classification vectors and each second classification feature vector in the plurality of second classification vectors, comprising: calculating the transfer matrix between each first classification feature vector in the plurality of first classification vectors and each second classification feature vector in the plurality of second classification vectors by the following formula; the formula is: j =M i,j *x i , where x i represents each first classification vector in the plurality of first classification vectors, y j represents each second classification vector in the plurality of second classification vectors, M i,j Denotes the transfer matrix.
6. The microservice resource management method based on dynamic routing according to claim 1, wherein: Passing the second feature graph through a classifier to obtain the probability that the microservice resource belongs to each group includes: using one or more fully connected layers of the classifier to fully connect encode the second feature graph to obtain a classification feature vector; and calculating the Softmax classification function value of the classification feature vector belonging to each group respectively as the probability that the classification feature vector belongs to each group respectively.
7. The microservice resource management method based on dynamic routing according to claim 6, wherein: Based on the probability that the microservice resource belongs to each group, determining the group to which the microservice resource belongs includes: determining the group corresponding to the maximum probability that the classification feature vector belongs to each group as the group to which the microservice resource belongs.
8. A microservice resource management system based on dynamic routing, characterized in that: include: Service attribute unit, used to obtain the description text of the service attributes of microservice resources; A semantic understanding unit, used for performing word segmentation processing on the description text and obtaining a text feature vector sequence through a semantic understanding model; A request attribute unit, used to obtain request attribute data of all requests corresponding to the microservice resource; A vector construction unit, used for respectively performing vector encoding on each data item in the request attribute data of each request in the request attribute data of all the requests through a hidden Markov model to obtain a plurality of embedded vectors; a first neural network unit, used for arranging the plurality of embedded vectors into a matrix and then passing through a first convolutional neural network to obtain a first feature map; a first classification vector specifying unit, used for taking each text feature vector in the text feature vector sequence as a first classification vector to obtain a plurality of first classification vectors; a global pooling unit, used for performing global pooling processing on the first feature map along the channel dimension to obtain a second feature matrix and dividing the second feature matrix along the data item dimension to obtain a plurality of second classification vectors; a transfer matrix calculation unit, used for calculating a transfer matrix between each first classification feature vector in the plurality of first classification vectors and each second classification feature vector in the plurality of second classification vectors to obtain a plurality of transfer matrices, wherein the number of the transfer matrices is the product of the number of the first classification vectors and the number of the second classification vectors; A second neural network unit, used for inputting the multiple transfer matrices into a second convolutional neural network to obtain a second feature map; A classification unit, configured to pass the second feature graph through a classifier to obtain a probability that the microservice resource belongs to each group; and a grouping unit, configured to determine the group to which the microservice resource belongs based on the probability that the microservice resource belongs to each group.
9. The microservice resource management system based on dynamic routing according to claim 8, wherein: The semantic understanding unit includes: a word segmentation subunit, used to perform word segmentation processing on the description text based on the knowledge graph to obtain multiple words; a word vector conversion subunit, used to use a word embedding model to convert each of the multiple words into a word vector to obtain a word vector sequence composed of multiple word vectors; and a semantic feature extraction subunit, used to input the word vector sequence into the semantic understanding model to obtain the text feature vector sequence.
10. An electronic device comprising: processor; and a memory, wherein computer program instructions are stored in the memory, and when the computer program instructions are executed by the processor, the processor executes the microservice resource management method based on dynamic routing as described in any one of claims 1 to 7.
