Micro-service resource management method and system based on dynamic routing and electronic equipment

文档序号:1952354 发布日期:2021-12-10 浏览:15次 中文

阅读说明:本技术 基于动态路由的微服务资源管理方法、系统和电子设备 (Micro-service resource management method and system based on dynamic routing and electronic equipment ) 是由 张雪涛 于 2021-09-15 设计创作,主要内容包括:本申请涉及服务资源管理领域,其具体地公开了一种基于动态路由的微服务资源管理方法、系统和电子设备,其基于深度学习的神经网络模型来基于微服务资源的服务属性和请求属性对微服务资源进行合理分组,通过这样的方式,使得控制接口能够精确请求到期望的服务器上,来降低整体运维操作复杂度和降低运维成本。(The application relates to the field of service resource management, and particularly discloses a micro-service resource management method, a system and electronic equipment based on dynamic routing, wherein the micro-service resources are reasonably grouped based on service attributes and request attributes of the micro-service resources based on a deep learning neural network model, and through the mode, a control interface can accurately request an expected server to reduce the complexity of overall operation and maintenance operation and reduce the operation and maintenance cost.)

1. A micro service resource management method based on dynamic routing is characterized by comprising the following steps: obtaining a description text of the service attribute of the micro-service resource; performing word segmentation processing on the description text, and then obtaining a text feature vector sequence through a semantic understanding model; acquiring request attribute data of all requests corresponding to the micro service resources; carrying out vector coding on each data item in each request attribute data of all the request attribute data through a hidden Markov model to obtain a plurality of embedded vectors; arranging the embedded vectors into a matrix and then passing through a first convolutional neural network to obtain a first characteristic diagram; taking each text feature vector in the text feature vector sequence as a first classification vector to obtain a plurality of first classification vectors; performing global pooling along a channel dimension on the first feature map to obtain a second feature matrix and partitioning the second feature matrix along a data item dimension to obtain a plurality of second classification vectors; calculating a transfer matrix between each first classification feature vector of the plurality of first classification vectors and each second classification feature vector of the plurality of second classification vectors to obtain a plurality of transfer matrices, wherein the number of the transfer matrices is a product between 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 micro-service resource belongs to each packet; and determining the grouping to which the micro service resource belongs based on the probability of the micro service resource belonging to each grouping.

2. The micro service resource management method based on dynamic routing according to claim 1, wherein the obtaining of the text feature vector sequence through a semantic understanding model after the word segmentation processing of the description text comprises: performing word segmentation processing based on a knowledge graph on the description text to obtain a plurality of words; converting each word of the plurality of words into a word vector using a word embedding model to obtain a word vector sequence consisting 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 dynamic routing-based micro-service resource management method of claim 2, wherein inputting the sequence of word vectors into the semantic understanding model to obtain the sequence of text feature vectors comprises: converting each word vector in the word vector sequence into a word feature vector by using a Bert model of the semantic understanding model to obtain a word feature vector sequence consisting of a plurality of word feature vectors; and performing text-based context coding on the word feature vector sequence using a bidirectional LSTM model of the semantic understanding model to obtain the text feature vector sequence.

4. The method for micro-service resource management based on dynamic routing of claim 1, wherein globally pooling the first feature map along a channel dimension to obtain a second feature matrix and partitioning the second feature matrix along a data item dimension to obtain a plurality of second classification vectors comprises: and performing global mean pooling or global maximum pooling along a channel dimension on the first feature map to obtain the second feature matrix.

5. The method for micro-service resource management based on dynamic routing of claim 1, wherein computing a transition matrix between each of the first classification eigenvectors in the plurality of first classification vectors and each of the second classification eigenvectors in the plurality of second classification vectors comprises: calculating a transfer matrix between each first classification feature vector of the plurality of first classification feature vectors and each second classification feature vector of the plurality of second classification feature vectors in the following formula; the formula is: y isj=Mi,j*xiWherein x isiRepresenting each first classification vector, y, of said plurality of first classification vectorsjRepresenting each of said plurality of second classification vectors, Mi,jRepresenting the transition matrix.

6. The micro-service resource management method based on dynamic routing of claim 1, wherein passing the second feature map through a classifier to obtain a probability that the micro-service resource belongs to each group comprises: fully-concatenate encoding the second feature map using one or more fully-concatenated layers of the classifier to obtain a classified feature vector; and calculating Softmax classification function values of the classification characteristic vectors respectively belonging to the groups as probabilities of the classification characteristic vectors respectively belonging to the groups.

7. The micro-service resource management method based on dynamic routing of claim 6, wherein determining the group to which the micro-service resource belongs based on the probability that the micro-service resource belongs to each group comprises: and determining the grouping corresponding to the maximum one of the probabilities that the classified feature vectors belong to the groups as the grouping to which the micro service resources belong.

8. A micro-service resource management system based on dynamic routing, comprising: the service attribute unit is used for acquiring a description text of the service attribute of the micro-service resource; the semantic understanding unit is used for performing word segmentation processing on the description text and then obtaining a text feature vector sequence through a semantic understanding model; the request attribute unit is used for acquiring request attribute data of all requests corresponding to the micro service resources; the vector construction unit is used for respectively carrying out vector coding on each data item in each request attribute data of all the request attribute data through a hidden Markov model so as to obtain a plurality of embedded vectors; the first neural network unit is used for arranging the embedded vectors into a matrix and then obtaining a first characteristic diagram through a first convolutional neural network; a first classification vector specifying unit, configured to use 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 configured to perform global pooling along a channel dimension on the first feature map to obtain a second feature matrix and divide the second feature matrix along a data item dimension to obtain a plurality of second classification vectors; a transfer matrix calculation unit, 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, where the number of transfer matrices is a product between the number of first classification vectors and the number of second classification vectors; a second neural network unit for inputting the plurality of transfer matrices into a second convolutional neural network to obtain a second feature map; a classification unit, configured to pass the second feature map through a classifier to obtain a probability that the micro service resource belongs to each packet; and the grouping unit is used for determining the grouping to which the micro service resources belong based on the probability of the micro service resources belonging to each grouping.

9. The micro service resource management system based on dynamic routing of claim 8, wherein the semantic understanding unit comprises: the word segmentation subunit is used for carrying out word segmentation processing on the description text based on a knowledge graph to obtain a plurality of words; a word vector transformation unit for transforming each word of the plurality of words into a word vector using a word embedding model to obtain a word vector sequence composed of a plurality of word vectors; and the semantic feature extraction subunit is used for inputting the word vector sequence into the semantic understanding model to obtain the text feature vector sequence.

10. An electronic device, comprising: a processor; and a memory in which are stored computer program instructions which, when executed by the processor, cause the processor to perform the method of dynamic routing based micro-service resource management according to any of claims 1-7.

Technical Field

The present invention relates to the field of motion monitoring, and more particularly, to a micro-service resource management method based on dynamic routing, a micro-service resource management system based on dynamic routing, and an electronic device.

Background

Motan is an RPC framework for high-performance distributed service rapid development, focuses on simple and practical service management functions and excellent RPC protocol expansion capability, can provide efficient RPC remote calling, and can also provide service management functions such as service discovery, high service availability, load balancing, management and the like. An existing technical scheme is to configure and manage a Motan micro-service resource based on a dynamic route so as to solve the problems of high gateway concurrency, API dynamic route, data packet encryption, request authentication, request black and white lists, gray release, gateway caching and the like.

However, the existing micro-service resource management system based on dynamic routing cannot efficiently manage micro-service resources, and has the problems that micro-service issuing cannot be performed in a manner similar to canary issuing, and the like, and particularly, the micro-service resource management system cannot control an interface to accurately request to a desired server. Moreover, since the interface cannot be controlled to accurately request to a desired server, the gray scale distribution service cannot be performed and there may be an abnormal problem caused by inconsistent service versions during the service distribution.

Therefore, an optimized micro-service resource management scheme is desired.

At present, deep learning and neural networks have been widely applied in the fields of computer vision, natural language processing, text signal processing, and the like. In addition, deep learning and neural networks also exhibit a level close to or even exceeding that of humans in the fields of image classification, object detection, semantic segmentation, text translation, and the like.

In recent years, deep learning and the development of neural networks provide solutions and schemes for the management of micro-service resources.

Disclosure of Invention

The present application is proposed to solve the above-mentioned technical problems. The embodiment of the application provides a micro-service resource management method based on dynamic routing, a micro-service resource management system based on dynamic routing and electronic equipment, wherein the micro-service resources are reasonably grouped based on service attributes and request attributes of the micro-service resources based on a deep learning neural network model, and through the mode, a control interface can accurately request an expected server, so that the overall operation and maintenance operation complexity is reduced, and the operation and maintenance cost is reduced.

According to an aspect of the present application, there is provided a micro service resource management method based on dynamic routing, which includes: obtaining a description text of the service attribute of the micro-service resource; performing word segmentation processing on the description text, and then obtaining a text feature vector sequence through a semantic understanding model; acquiring request attribute data of all requests corresponding to the micro service resources; carrying out vector coding on each data item in each request attribute data of all the request attribute data through a hidden Markov model to obtain a plurality of embedded vectors; arranging the embedded vectors into a matrix and then passing through a first convolutional neural network to obtain a first characteristic diagram; taking each text feature vector in the text feature vector sequence as a first classification vector to obtain a plurality of first classification vectors; performing global pooling along a channel dimension on the first feature map to obtain a second feature matrix and partitioning the second feature matrix along a data item dimension to obtain a plurality of second classification vectors; calculating a transfer matrix between each first classification feature vector of the plurality of first classification vectors and each second classification feature vector of the plurality of second classification vectors to obtain a plurality of transfer matrices, wherein the number of the transfer matrices is a product between 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 micro-service resource belongs to each packet; and determining the grouping to which the micro service resource belongs based on the probability of the micro service resource belonging to each grouping.

In the micro service resource management method based on dynamic routing according to the application, the obtaining of the text feature vector sequence by the semantic understanding model after the word segmentation processing is performed on the description text comprises: performing word segmentation processing based on a knowledge graph on the description text to obtain a plurality of words; converting each word of the plurality of words into a word vector using a word embedding model to obtain a word vector sequence consisting of a plurality of word vectors; and inputting the word vector sequence into the semantic understanding model to obtain the text feature vector sequence.

In the micro service resource management method based on dynamic routing according to the application, inputting the word vector sequence into the semantic understanding model to obtain the text feature vector sequence includes: converting each word vector in the word vector sequence into a word feature vector by using a Bert model of the semantic understanding model to obtain a word feature vector sequence consisting of a plurality of word feature vectors; and performing text-based context coding on the word feature vector sequence using a bidirectional LSTM model of the semantic understanding model to obtain the text feature vector sequence.

In the method for micro-service resource management based on dynamic routing according to the present application, performing global pooling along a channel dimension on the first feature map to obtain a second feature matrix and dividing the second feature matrix along a data item dimension to obtain a plurality of second classification vectors includes: and performing global mean pooling or global maximum pooling along a channel dimension on the first feature map to obtain the second feature matrix.

In the method for managing micro service resources based on dynamic routing according to the application, 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 includes: calculating a transfer matrix between each first classification feature vector of the plurality of first classification feature vectors and each second classification feature vector of the plurality of second classification feature vectors in the following formula; the formula is: y isj=Mi,j*xiWherein x isiRepresenting each first classification vector, y, of said plurality of first classification vectorsjRepresenting each of said plurality of second classification vectors, Mi,jRepresenting the transition matrix.

In the micro service resource management method based on dynamic routing according to the application, passing the second feature map through a classifier to obtain the probability that the micro service resource belongs to each group includes: fully-concatenate encoding the second feature map using one or more fully-concatenated layers of the classifier to obtain a classified feature vector; and calculating Softmax classification function values of the classification feature vectors respectively belonging to the groups as probabilities of the classification feature vectors respectively belonging to the groups.

In the micro service resource management method based on dynamic routing according to the application, determining the group to which the micro service resource belongs based on the probability that the micro service resource belongs to each group includes: and determining the grouping corresponding to the maximum one of the probabilities that the classified feature vectors belong to the groups as the grouping to which the micro service resources belong.

According to another aspect of the present application, there is also provided a micro service resource management system based on dynamic routing, including: the service attribute unit is used for acquiring a description text of the service attribute of the micro-service resource;

the semantic understanding unit is used for performing word segmentation processing on the description text and then obtaining a text feature vector sequence through a semantic understanding model; the request attribute unit is used for acquiring request attribute data of all requests corresponding to the micro service resources; the vector construction unit is used for respectively carrying out vector coding on each data item in each request attribute data of all the request attribute data through a hidden Markov model so as to obtain a plurality of embedded vectors; the first neural network unit is used for arranging the embedded vectors into a matrix and then obtaining a first characteristic diagram through a first convolutional neural network; a first classification vector specifying unit, configured to use 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 configured to perform global pooling along a channel dimension on the first feature map to obtain a second feature matrix and divide the second feature matrix along a data item dimension to obtain a plurality of second classification vectors; a transfer matrix calculation unit, 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, where the number of transfer matrices is a product between the number of first classification vectors and the number of second classification vectors; a second neural network unit for inputting the plurality of transfer matrices into a second convolutional neural network to obtain a second feature map; a classification unit, configured to pass the second feature map through a classifier to obtain a probability that the micro service resource belongs to each packet; and the grouping unit is used for determining the grouping to which the micro service resources belong based on the probability of the micro service resources belonging to each grouping.

In the micro service resource management system based on dynamic routing according to the application, the semantic understanding unit includes: the word segmentation subunit is used for carrying out word segmentation processing on the description text based on a knowledge graph to obtain a plurality of words; a word vector transformation unit for transforming each word of the plurality of words into a word vector using a word embedding model to obtain a word vector sequence composed of a plurality of word vectors; and the semantic feature extraction subunit is used for inputting the word vector sequence into the semantic understanding model to obtain the text feature vector sequence.

According to yet another aspect of the present application, there is provided an electronic device including: a processor; and a memory having stored therein computer program instructions which, when executed by the processor, cause the processor to perform the dynamic routing based micro-service resource management method as described above.

Compared with the prior art, the micro-service resource management method based on the dynamic routing, the micro-service resource management system based on the dynamic routing and the electronic device provided by the application are based on the deep learning neural network model to reasonably group the micro-service resources based on the service attributes and the request attributes of the micro-service resources, and through the mode, the control interface can accurately request to a desired server, so that the overall operation and maintenance operation complexity is reduced, and the operation and maintenance cost is reduced.

Drawings

The above and other objects, features and advantages of the present application will become more apparent by describing in more detail embodiments of the present application with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of the embodiments of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the principles of the application. In the drawings, like reference numbers generally represent like parts or steps.

Fig. 1 illustrates a schematic diagram of group management of micro service resources according to an embodiment of the present application.

FIG. 2 is a flowchart of a method for micro-service resource management based on dynamic routing according to an embodiment of the present application;

fig. 3 is a schematic system architecture diagram of a method for micro-service resource management based on dynamic routing according to an embodiment of the present application;

fig. 4 is a flowchart of obtaining a text feature vector sequence through a semantic understanding model after performing word segmentation processing on the description text in the micro service resource management method based on dynamic routing according to the embodiment of the application.

Fig. 5 is a block diagram of a micro service resource management system based on dynamic routing according to an embodiment of the present application.

Fig. 6 is a block diagram of a semantic understanding unit in a micro service resource management system based on dynamic routing according to an embodiment of the present application.

Fig. 7 is a block diagram of an electronic device according to an embodiment of the application.

Detailed Description

Hereinafter, example embodiments according to the present application will be described in detail with reference to the accompanying drawings. It should be understood that the described embodiments are only some embodiments of the present application and not all embodiments of the present application, and that the present application is not limited by the example embodiments described herein.

Overview of a scene

As described above, the conventional micro-service resource management system based on dynamic routing cannot efficiently manage micro-service resources, and cannot issue micro-services in a manner similar to canary issuance, and in particular, cannot control an interface to accurately request a desired server. Moreover, since the interface cannot be controlled to accurately request to a desired server, the gray scale distribution service cannot be performed and there may be an abnormal problem caused by inconsistent service versions during the service distribution. Therefore, an optimized micro-service resource management scheme is desired.

Accordingly, the present inventors have attempted to manage Motan micro service resources in a group, as shown in fig. 1. It should be understood that, the Motan micro service resource is managed in a grouping manner, so that the routing control and other operations on the whole packet resource are facilitated, and the control interface can accurately request a desired server, so as to reduce the complexity of the whole operation and maintenance operation and the operation and maintenance cost. However, the key point is how to manage the Motan microservice resources in groups, so that the gateway can be operated and managed very efficiently. That is, in order to manage the Motan service resource, it is necessary to manage a plurality of services in a packet manner, and therefore, how to group different services becomes a problem to be considered.

The inventors of the present application consider that in the grouping process, in addition to the attributes of the service itself, the gradation access by Motan microservice control needs to be considered, that is, the assignment of requests to gradation groups needs to be considered.

Therefore, in the technical solution of the present application, in order to perform appropriate grouping based on both the service attribute and the request attribute, it is necessary to effectively extract and express hidden information in the service attribute and the request attribute, and therefore, the applicant of the present application considers that a neural network model based on deep learning is used as a classification problem.

Specifically, first, when the service attribute is utilized, a description text of the service is acquired and converted into a feature vector sequence through a semantic understanding model. Here, in order to fully utilize the context information of the description text of the service, the semantic understanding model is implemented as a Bert model + a bidirectional LSTM model, so that one feature vector is obtained for each word of the description text, and is composed as the feature vector sequence. Then, for the request attribute, the request attribute data of all requests corresponding to the service, including data of the specified API version number, the specified user, the specified region, the specified IP, the random proportion, the weight, etc., are obtained, and each item of data is represented by a vector, for example, vector coding may be performed using a hidden markov model to obtain an embedded vector of each item of data. In addition, because semantic information among the data is not rich, in order to dig out implicit correlation information among the data, a plurality of embedded vectors are arranged into a matrix and then input into a first convolution neural network to obtain a first feature map.

Then, in order to realize the associative fusion of the service attribute and the request attribute, each feature vector in the feature vector sequence is first used as a first classification vector to obtain a plurality of first classification vectors, which are denoted as x for examplemAnd globally pooling the first feature map along the channel to obtain a second feature matrix, and partitioning along the dimension of the data item to obtain a plurality of second classification vectors, e.g., denoted as yn. Then, x is calculatedmEach vector x in (1)iAnd ynEach vector y in (1)jIs transferred to the matrix Mi,jSo that y isj=Mi,j*xiThat is, the transition matrix Mi,jCan represent a corresponding set of vectors xiAnd yjSo as to obtain M × n transition matrixes Mi,j

Then, M × n transition matrixes M are further processedi,jAnd the probability that the service belongs to each group can be obtained by passing the second feature map through a classifier, so that the gray level grouping of the service is realized.

Based on this, the present application provides a micro service resource management method based on dynamic routing, which includes: obtaining a description text of the service attribute of the micro-service resource; performing word segmentation processing on the description text, and then obtaining a text feature vector sequence through a semantic understanding model; acquiring request attribute data of all requests corresponding to the micro service resources; carrying out vector coding on each data item in each request attribute data of all the request attribute data through a hidden Markov model to obtain a plurality of embedded vectors; arranging the embedded vectors into a matrix and then passing through a first convolutional neural network to obtain a first characteristic diagram; taking each text feature vector in the text feature vector sequence as a first classification vector to obtain a plurality of first classification vectors; performing global pooling along a channel dimension on the first feature map to obtain a second feature matrix and partitioning the second feature matrix along a data item dimension to obtain a plurality of second classification vectors; calculating a transfer matrix between each first classification feature vector of the plurality of first classification vectors and each second classification feature vector of the plurality of second classification vectors to obtain a plurality of transfer matrices, wherein the number of the transfer matrices is a product between 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 micro-service resource belongs to each packet; and determining the grouping to which the micro service resource belongs based on the probability of the micro service resource belonging to each grouping.

Having described the general principles of the present application, various non-limiting embodiments of the present application will now be described with reference to the accompanying drawings.

Exemplary method

Fig. 2 illustrates a flow chart of a dynamic routing based micro-service resource management method. As shown in fig. 2, a method for micro-service resource management based on dynamic routing according to an embodiment of the present application includes: s110, obtaining a description text of the service attribute of the micro-service resource; s120, performing word segmentation processing on the description text, and then obtaining a text feature vector sequence through a semantic understanding model; s130, acquiring request attribute data of all requests corresponding to the micro service resources; s140, respectively carrying out vector coding on each data item in each request attribute data of all the request attribute data through a hidden Markov model to obtain a plurality of embedded vectors; s150, arranging the embedded vectors into a matrix and then obtaining a first characteristic diagram through a first convolutional neural network; s160, taking each text feature vector in the text feature vector sequence as a first classification vector to obtain a plurality of first classification vectors; s170, performing global pooling along a channel dimension on the first feature map to obtain a second feature matrix, and dividing the second feature matrix along a data item dimension to obtain a plurality of second classification vectors; s180, 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; s190, inputting the plurality of transfer matrixes into a second convolutional neural network to obtain a second characteristic diagram; s200, passing the second feature map through a classifier to obtain the probability that the micro service resource belongs to each group; and S210, determining the grouping to which the micro service resource belongs based on the probability of the micro service resource belonging to each grouping.

Fig. 3 is a schematic diagram illustrating an architecture of a micro service resource management method based on dynamic routing according to an embodiment of the present application. As shown in fig. 3, in the network architecture of the micro service resource management method based on dynamic routing, first, a description text (e.g., T as illustrated in fig. 3) of the service attribute of the acquired micro service resource is passed through a semantic understanding model (e.g., SUM as illustrated in fig. 3) after word segmentation processing to obtain a text feature vector sequence (e.g., Ts as illustrated in fig. 3).

Then, the respective data items in each request attribute data of all the acquired request data (e.g., R1 to Rn as illustrated in fig. 3) corresponding to the micro service resource are vector-encoded by a hidden markov model (e.g., HMM as illustrated in fig. 3) to obtain a plurality of embedded vectors (e.g., Ev1 to Evn as illustrated in fig. 3), respectively. Next, the plurality of embedded vectors are arranged into a matrix (e.g., M as illustrated in fig. 3) and then passed through a first convolutional neural network (e.g., CNN1 as illustrated in fig. 3) to obtain a first feature map (e.g., F1 as illustrated in fig. 3).

Next, as shown in fig. 3, the first feature map is subjected to global pooling along a channel dimension to obtain a second feature matrix (e.g., Mf as illustrated in fig. 3) and the second feature matrix is divided along a data item dimension to obtain a plurality of second classification vectors (e.g., Vc2 as illustrated in fig. 3), and each text feature vector in the sequence of text feature vectors is taken as a first classification vector to obtain a plurality of first classification vectors. Then, a transfer matrix between each of the plurality of first classification feature vectors and each of the plurality of second classification feature vectors is calculated to obtain a plurality of transfer matrices (e.g., Mt as illustrated in fig. 3).

Further, as shown in fig. 3, the plurality of transfer matrices are input to a second convolutional neural network (e.g., CNN2 as illustrated in fig. 3) to obtain a second profile (e.g., F2 as illustrated in fig. 3). Then, the second feature map is processed by a classifier to obtain the probability of the micro service resource belonging to each group, and the group to which the micro service resource belongs is determined based on the probability of the micro service resource belonging to each group.

In step S110, a description text of the service attribute of the micro service resource is acquired. As described above, in order to manage a Motan service resource, it is necessary to manage a plurality of services in a packet manner, and therefore, how to group different services becomes a problem to be considered. The inventors of the present application consider that in the grouping process, in addition to the attributes of the service itself, the gradation access by Motan microservice control needs to be considered, that is, the assignment of requests to gradation groups needs to be considered. Therefore, in the technical solution of the present application, appropriate grouping is performed based on both the service attribute and the request attribute. Accordingly, in step S110, a description text of the service attribute of the micro service resource is first obtained.

Here, in the embodiment of the present application, the micro service resource is a Motan micro service resource, and the description text of the service attribute includes RPC framework description, a registration center, a configuration center, an administration center, a scheduling center, and the like.

In step S120, the description text is subjected to word segmentation processing and then passed through a semantic understanding model to obtain a text feature vector sequence. In order to properly group based on both the service attribute and the request attribute, it is necessary to efficiently extract and express hidden information in the service attribute and the request attribute, and therefore, the applicant of the present application considers to use a deep learning-based neural network model as a classification problem to implement.

Specifically, in this embodiment of the present application, the process of obtaining a text feature vector sequence through a semantic understanding model after performing word segmentation processing on the description text includes: firstly, performing word segmentation processing based on a knowledge graph on the description text of the service attribute to split the description text into a plurality of words, namely, performing word segmentation processing on the description text of the service attribute based on the knowledge graph with professional knowledge as a kernel. It should be understood that, in some examples of the present application, after performing word segmentation processing on the description text of the service attribute, the obtained multiple words may be further sorted, for example, redundant words are removed, repeated words are removed, and the like, so as to reduce difficulty of data processing, and the comparison is not limited by the present application.

Then, word vector translation of the plurality of words is used, i.e., the plurality of words are mapped to a word vector space to represent the respective words in vector form. In specific implementation, a bag-of-words model and a word embedding model can be adopted to realize word vector conversion. Those skilled in the art will appreciate that the essential purpose of word vector transformation is to transform words originally represented by non-structural data into word vectors represented by structural data, so as to facilitate data processing by a computer.

In order to fully utilize the context 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, and the feature vector sequence is formed. Specifically, in this embodiment of the present application, the semantic understanding model includes a Bert model and a bidirectional LSTM model, where 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 a plurality of word feature vectors; and the bidirectional LSTM model is used to perform text-based context coding on the sequence of word feature vectors to obtain the sequence of text feature vectors.

As will be appreciated by those skilled in the art, the Bert model implements the bi-directionality of the language model by using the Masked model, and proves the importance of the bi-directionality to the pre-training of the language representation, i.e., the Bert model is a bi-directional language model in the true sense, and each word can simultaneously utilize the context information of the word. The bidirectional LSTM model is derived on the basis of the LSTM model, the LSTM is provided aiming at the defects that the RNN neural network has gradient disappearance when the sequence is too long and the characteristic of long-term dependence is difficult to learn, and the LSTM unit controls information transmission through an input gate, a forgetting gate and an output gate. The unidirectional LSTM can only capture the history information of the sequence, and the context of the name of the person needs to be considered when performing identification, so the bidirectional LSTM is used for capturing the context information of the sequence.

Fig. 4 is a flowchart of obtaining a text feature vector sequence through a semantic understanding model after performing word segmentation processing on the description text in the micro service resource management method based on dynamic routing according to the embodiment of the application. As shown in fig. 4, in the embodiment of the present application, after performing word segmentation processing on the description text, obtaining a text feature vector sequence through a semantic understanding model, including the steps of: s310, carrying out word segmentation processing based on a knowledge graph on the description text to obtain a plurality of words; s320, converting each word in the plurality of words into a word vector by using a word embedding model to obtain a word vector sequence consisting of a plurality of word vectors; s330, converting each word vector in the word vector sequence into a word feature vector by using a Bert model of the semantic understanding model to obtain a word feature vector sequence consisting of a plurality of word feature vectors; and S340, carrying out context coding based on description text on the word feature vector sequence by using a bidirectional LSTM model of the semantic understanding model to obtain the text feature vector sequence.

In step S130, request attribute data of all requests corresponding to the micro service resource is acquired. Here, in this embodiment of the present application, the requested request attribute data includes: data items such as a specified API version number, a specified user, a specified region, a specified IP, a random proportion, a weight and the like.

In step S140, vector-coding each data item in each requested request attribute data of all the requested request attribute data by using a hidden markov model to obtain a plurality of embedded vectors. That is, the request attribute data of each request is expressed in the form of a vector by a hidden markov model.

Those skilled in the art will appreciate that hidden markov models are statistical models that require a large series of data to train in connection with recognition. Based on the characteristics of statistical models, hidden markov models are divided into two categories: 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 employs a Discrete Hidden Markov Model (DHMM).

In step S150, the 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 attribute are represented in the form of vectors by using the hidden markov model, since semantic information between the data is not rich, in order to dig out implicit association information between the data, a plurality of embedded vectors are arranged into a matrix and then input into the first convolutional neural network to obtain the first feature map.

It will be appreciated by those skilled in the art that a convolutional neural network has excellent performance in extracting local features, and therefore, after arranging the plurality of embedded vectors into a matrix, the first convolutional neural network can extract a high-dimensional implicit representation of the local features in the matrix, and it will be understood that the embedded vectors represent one data item, and therefore, the local features of the matrix represent the associated high-dimensional implicit features between the respective data items.

In step S160, each text feature vector in the text feature vector sequence is taken as a first classification vector to obtain a plurality of first classification vectors. In step S170, the first feature map is subjected to global pooling along a channel dimension to obtain a second feature matrix and the second feature matrix is divided along a data item dimension to obtain a plurality of second classification vectors. In step S180, a transfer matrix between each first classification feature vector of the plurality of first classification vectors and each second classification feature vector of the plurality of second classification vectors is calculated to obtain a plurality of transfer matrices, wherein the number of the transfer matrices is a product between the number of the first classification vectors and the number of the second classification vectors.

That is, in the embodiment of the present application, in order to implement associative fusion of the service attribute and the request attribute, each feature vector in the feature vector sequence is first used as a first classification vector to obtain a plurality of first classification vectors, which are denoted as x, for examplemAnd globally pooling the first feature map along the channel to obtain a second feature matrix, and partitioning along the dimension of the data item to obtain a plurality of second classification vectors, e.g., denoted as yn. Then, x is calculatedmEach vector x in (1)iAnd ynEach vector y in (1)jIs transferred to the matrix Mi,jSo that y isj=Mi,j*xiThat is, the transition matrix Mi,jCan represent a corresponding set of vectors xiAnd yjSo as to obtain M × n transition matrixes Mi,j

That is, in the embodiment of the present application, calculating a transfer matrix between each first classification feature vector of the plurality of first classification vectors and each second classification feature vector of the plurality of second classification vectors includes: calculating a transfer matrix between each of the plurality of first classification feature vectors and each of the plurality of second classification feature vectors in the following formula(ii) a Wherein the formula is: y isj=Mi,j*xiWherein x isiRepresenting each first classification vector, y, of said plurality of first classification vectorsjRepresenting each of said plurality of second classification vectors, Mi,jRepresenting the transition matrix.

In a specific example of the present application, the first feature map may be subjected to global mean pooling or global maximum pooling along a channel dimension to obtain the second feature matrix. It should be understood that global mean pooling makes the feature values of the respective positions in the second feature matrix more focused on the mean features of the vectors in the respective channel dimensions, and mean max pooling makes the feature values of the respective positions in the second feature matrix more focused on the features with the largest information amount of the vectors in the respective channel dimensions, and the merits of both can be selected based on actual application scenarios and performance.

It is worth mentioning that, in the embodiment of the present application, the transition 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 attribute and the request attribute of the micro service resource.

In step S2190, the plurality of transition matrices are input to 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 plurality of transfer matrices, that is, the high-dimensional implicit features of the association between the service attribute and the request attribute of the micro service resource, so as to be beneficial to improving the grouping precision of the micro service resource.

In step S200, the second feature map is passed through a classifier to obtain a probability that the micro service resource belongs to each group. Specifically, in this embodiment of the present application, the process of passing the second feature map through a classifier to obtain a probability that the micro service resource belongs to each group includes: first, the second feature map is full-join encoded using one or more full-join layers of the classifier to obtain a classified feature vector. It should be appreciated that the information of each position in the second characteristic diagram can be fully utilized by the full connection layer, so as to improve the grouping precision.

Next, Softmax classification function values, to which the classification feature vectors belong to the respective groups, are calculated as probabilities, to which the classification feature vectors belong to the respective groups. That is, the probability values of the classification feature vectors respectively belonging to the classification tags are calculated with the respective groups as the classification tags.

In step S210, a group to which the micro service resource belongs is determined based on a probability that the micro service resource belongs to each group. Specifically, the grouping label corresponding to the maximum probability is used as the grouping of the micro service resource, and thus, the gray level grouping of the service is realized.

In summary, the micro-service resource management method based on dynamic routing is elucidated, and the micro-service resources are reasonably grouped based on the service attributes and the request attributes of the micro-service resources based on the deep learning neural network model, so that the control interface can accurately request the desired server, thereby reducing the overall operation and maintenance operation complexity and the operation and maintenance cost.

Exemplary System

FIG. 5 illustrates a block diagram of a dynamic routing based micro-service resource management system according to an embodiment of the application. As shown in fig. 5, a micro service resource management system 500 based on dynamic routing according to an embodiment of the present application includes: a service attribute unit 510, configured to obtain a description text of a service attribute of the micro service resource; a semantic understanding unit 520, configured 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 530, configured to obtain request attribute data of all requests corresponding to the micro service resource; a vector constructing unit 540, configured to perform vector coding on each data item in each requested attribute data of all the requested attribute data through a hidden markov model to obtain a plurality of embedded vectors; a first neural network unit 550, configured to arrange the plurality of embedded vectors into a matrix and then pass through a first convolutional neural network to obtain a first feature map; a first classification vector specifying unit 560, configured to take 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 570 configured to perform global pooling along a channel dimension on the first feature map to obtain a second feature matrix and to divide the second feature matrix along a 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, where the number of transfer matrices is a product between the number of first classification vectors and the number of second classification vectors; a second neural network unit 590 for inputting 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 micro service resource belongs to each packet; and a grouping unit 610, configured to determine a group to which the micro service resource belongs based on a probability that the micro service resource belongs to each group.

In an example, in the above-mentioned micro service resource management system 500 based on dynamic routing, as shown in fig. 6, the semantic understanding unit 520 includes: a word segmentation subunit 521, configured to perform a knowledge graph-based word segmentation process on the description text to obtain a plurality of words; a word vector transformation unit 522 for transforming each word of the plurality of words into a word vector using a word embedding model to obtain a word vector sequence consisting of a plurality of word vectors; and a semantic feature extraction subunit 523, configured to input the word vector sequence into the semantic understanding model to obtain the text feature vector sequence.

In one example, in the above-mentioned micro service resource management system 500 based on dynamic routing, the semantic feature extraction subunit is further configured to convert each word vector in the word vector sequence into a word feature vector using a Bert model of the semantic understanding model to obtain a word feature vector sequence composed of a plurality of word feature vectors; and performing text-based context coding on the word feature vector sequence using a bidirectional LSTM model of the semantic understanding model to obtain the text feature vector sequence.

In an example, in the above-mentioned micro service resource management system 500 based on dynamic routing, the global pooling unit 570 is further configured to perform global mean pooling or global maximum pooling along a channel dimension on the first feature map to obtain the second feature matrix.

In one example, in the above-mentioned micro service resource management system 500 based on dynamic routing, the transition matrix calculation unit 580 is further configured to calculate a transition 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 according to the following formula: y isj=Mi,j*xiWherein x isiRepresenting each first classification vector, y, of said plurality of first classification vectorsjRepresenting each of said plurality of second classification vectors, Mi,jRepresenting the transition matrix.

In an example, in the above-mentioned micro service resource management system 500 based on dynamic routing, the classifying unit 600 is further configured to: fully-concatenate encoding the second feature map using one or more fully-concatenated layers of the classifier to obtain a classified feature vector; and calculating Softmax classification function values of the classification feature vectors respectively belonging to the groups as probabilities of the classification feature vectors respectively belonging to the groups.

In an example, in the micro service resource management system 500 based on dynamic routing, the grouping unit 610 is further configured to determine the grouping corresponding to the largest one of the probabilities that the classification feature vectors belong to the respective groupings as the grouping to which the micro service resource belongs.

Here, it will be understood by those skilled in the art that the detailed functions and operations of the respective units and modules in the above-described dynamic routing based micro service resource management system 500 have been described in detail in the description of the dynamic routing based micro service resource management method above with reference to fig. 1 to 4, and thus, a repetitive description thereof will be omitted.

As described above, the micro service resource management system 500 based on dynamic routing according to the embodiment of the present application may be implemented in various terminal devices, such as a server of a micro service resource management algorithm based on dynamic routing, and the like. In one example, the micro service resource management system 500 based on dynamic routing according to the embodiment of the present application may be integrated into the terminal device as one software module and/or hardware module. For example, the dynamic routing-based microservice resource management system 500 may be a software module in the operating system of the terminal device, or may be an application developed for the terminal device; of course, the micro service resource management system 500 based on dynamic routing can also be one of many hardware modules of the terminal device.

Alternatively, in another example, the dynamic routing-based micro-service resource management system 500 and the terminal device may be separate devices, and the dynamic routing-based micro-service resource management system 500 may be connected to the terminal device through a wired and/or wireless network and transmit the interactive information according to an agreed data format.

Exemplary electronic device

Next, an electronic apparatus according to an embodiment of the present application is described with reference to fig. 7. As shown in fig. 7, 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 form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 10 to perform desired functions.

Memory 12 may include one or more computer program products that 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), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by the processor 11 to implement the functions of the dynamic routing-based micro-service resource management method of the various embodiments of the present application described above and/or other desired functions. Various contents such as a description text of the service attribute, individual data items of the request attribute, a grouping result, and the like can also be stored in the computer-readable storage medium.

In one example, the electronic device 10 may further include: an input system 13 and an output system 14, which are interconnected by a bus system and/or other form of connection mechanism (not shown).

The input system 13 may comprise, for example, a keyboard, a mouse, etc.

The output system 14 can output various information including the grouping result and the like to the outside. The output system 14 may include, for example, a display, speakers, a printer, and a communication network and its connected remote output devices, among others.

Of course, for simplicity, only some of the components of the electronic device 10 relevant to the present application are shown in fig. 7, and components such as buses, input/output interfaces, and the like are omitted. In addition, the electronic device 10 may include any other suitable components depending on the particular application.

The foregoing describes the general principles of the present application in conjunction with specific embodiments, however, it is noted that the advantages, effects, etc. mentioned in the present application are merely examples and are not limiting, and they should not be considered essential to the various embodiments of the present application. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the foregoing disclosure is not intended to be exhaustive or to limit the disclosure to the precise details disclosed.

The block diagrams of devices, apparatuses, systems referred to in this application are only given as illustrative examples and are not intended to require or imply that the connections, arrangements, configurations, etc. must be made in the manner shown in the block diagrams. These devices, apparatuses, devices, systems may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art. Words such as "including," "comprising," "having," and the like are open-ended words that mean "including, but not limited to," and are used interchangeably therewith. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".

It should also be noted that in the devices, apparatuses, and methods of the present application, the components or steps may be decomposed and/or recombined. These decompositions and/or recombinations are to be considered as equivalents of the present application.

The previous 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 generic principles defined herein may be applied to other aspects without departing from the scope of the application. Thus, the present application is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

The foregoing description has been presented for purposes of illustration and description. Furthermore, the description is not intended to limit embodiments of the application to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.

20页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种页面导航方法、设备及可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!