Training method of graph neural network model for recommending web service composition

Through graph neural network model training and clustering processing, it solves the problems of large calculation amount and poor real-time performance of Web service combination in the existing technology, realizes fast and high-quality service combination recommendation, and is suitable for large-scale user request scenarios.

CN114065033BActive Publication Date: 2024-08-23XIAN UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111342900.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-12
Publication Date
2024-08-23
Estimated Expiration
2041-11-12

AI Technical Summary

Technical Problem

The existing technology requires a large amount of calculation in the QoS-based Web service combination, and it is difficult to balance the quality and real-time performance of the recommendation solution, resulting in a long time consumption and poor quality of the combination solution in large-scale user request scenarios.

Method used

The graph neural network model training method is used to pre-store the QoS attribute data of the Web service through clustering, generate the service topology and construct the graph neural network model, and use the embedding module, graph convolutional neural network, pooling module and pointer module to calculate the Web service The selection probability enables rapid recommendation of high-quality service combination solutions.

Benefits of technology

It effectively reduces the calculation scale and solution difficulty, overcomes the local optimal solution problem, improves the calculation speed and the quality of combined services, improves the user experience, and is suitable for large-scale user request scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114065033B
    Figure CN114065033B
Patent Text Reader

Abstract

The present invention relates to a training method for a graph neural network model for recommending Web service combinations, including: clustering a data set of Web services with multiple QoS attribute values, obtaining multiple candidate service sets, generating a service topology structure of a multi-type Web service combination and samples corresponding to the service topology structure, obtaining two types of input data for each sample, and inputting them into a pre-built graph neural network model for training, obtaining a trained graph neural network model, and the trained graph neural network model is used to process user requests to obtain a model for recommending an optimal Web service combination solution. The above method obtains a high aggregated QoS quality of the combined service, effectively balances the amount of calculation and real-time performance, saves time costs, and ensures that the user experience is improved in an actual production environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a training method for a graph neural network model for recommending Web service combinations. Background Art

[0002] The QoS-based service composition problem refers to the problem of selecting specific services from a large number of Web services with the same functions but different quality of service (QoS) to maximize the aggregate QoS attributes of the combined service when multiple Web services with simple functions need to be combined to provide more complex functions. In general, it is to select a specific service from a large number of services that provide the same functions to form a combined service that can meet the user's functional requirements and obtain higher service quality.

[0003] There are currently three commonly used methods for QoS-based service composition: the first is a non-heuristic algorithm, which mainly uses a linear programming method to model QoS-based service composition problems, but this method cannot be applied to large-scale QoS-based service composition problems because the time required to find the optimal solution is unacceptable; the second is a heuristic algorithm, which abandons the search for the optimal solution and instead turns to finding a balance between the effect of the solution and the computing time. The most commonly used of these methods are various meta-heuristic methods, but they usually require a large number of iterative operations, and the time to find a solution close to the optimal solution is also beyond an acceptable range; the third is a learning-based QoS service composition method, which uses machine learning, neural network models or reinforcement learning models to solve service composition problems. Reinforcement learning methods still require a large number of iterative operations, and machine learning and neural network models usually need to be combined with heuristic methods, resulting in unacceptable running times.

[0004] The prior art discloses a Web service composition optimization method based on the I-PGA algorithm. The disadvantages of this method are that since the method needs to perform multiple iterations to find the optimal solution, it still takes a relatively long time to obtain the optimal service composition, and since the method uses the particle swarm algorithm as the optimization algorithm, it may still fall into the local optimum.

[0005] In view of this, how to solve the problem that the model in the existing technology has large amount of calculation and cannot balance the quality and real-time performance of the recommended solutions has become a technical problem that needs to be solved urgently. Summary of the invention

[0006] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a training method for a graph neural network model for recommending Web service combinations. The aggregated QoS quality of the combined service obtained by this method is high, effectively balancing the amount of computation and real-time performance, saving time costs, and ensuring improved user experience in an actual production environment.

[0007] In order to achieve the above object, the main technical solutions adopted by the present invention include:

[0008] In a first aspect, an embodiment of the present invention provides a method for training a graph neural network model for recommending a Web service combination, comprising:

[0009] S10, clustering a pre-stored data set of Web services having multiple QoS attribute values ​​to obtain multiple candidate service sets, each of which includes K Web services,

[0010] S20, based on the QoS attribute value of each Web service in each candidate service set, obtaining feature data of each Web service and feature data of each candidate service set, and an abstract Web service corresponding to each candidate service set for presenting service functions to users;

[0011] S30, based on all normalized feature data, generating a service topology structure of a multi-type Web service combination and a sample corresponding to the service topology structure, each sample being graph data having multiple nodes and directed edges, each node corresponding to a candidate service set, and a directed edge being the direction of a data flow between adjacent nodes;

[0012] Each sample has two types of input data, the first input data is data consisting of feature data of a specific Web service in each of all nodes, and the second input data is data consisting of feature data of each of all nodes; and the sample has label data, and the sample has label data, and the label data is used to optimize the graph neural network model in combination with the prediction results of the graph neural network model during the training process;

[0013] S40. Use the sample to train a pre-built graph neural network model to obtain a trained graph neural network model, wherein the trained graph neural network model has the ability to predict the selection probability of each specific Web service in a set of candidate services required for the user request after processing the user request, so as to obtain a recommended optimal Web service combination solution.

[0014] Optionally, the QoS attribute values ​​used as characteristics of the Web service include: a numerical value of operation duration, a numerical value of availability, a numerical value of price and a numerical value of throughput; the characteristic vector of each Web service is at least a 3-dimensional vector;

[0015] The number of candidate service sets after clustering is 150-250, each candidate service set includes 2 to 128 Web services, and the abstract Web service corresponding to each candidate service set is determined in the clustering process.

[0016] Optionally, the S20 includes:

[0017] S21, normalizing all features of all Web services in all candidate service sets to obtain normalized feature data of each Web service;

[0018] S22, for each candidate service set, based on the feature data of all normalized Web services in the candidate service set, calculate the feature data of the candidate service set to obtain a 21-dimensional vector;

[0019] The characteristic data of the candidate service set includes: the average value, standard deviation, variance, maximum value, minimum value, range and median of each corresponding characteristic of all Web services in the candidate service set;

[0020] S23. Normalize each feature in each candidate service set to obtain feature data of each candidate service set.

[0021] Optionally, the S30 includes:

[0022] S31, using a pre-synthesized workflow generator to process all candidate service sets and generate a service topology structure of a multi-type Web service combination;

[0023] S32, the service topology structure of each Web service combination generates a sample G of graph data with nodes and edges; all samples are divided according to a predetermined ratio to obtain a training sample set and a verification sample set;

[0024] The feature dimension of the first input data of each sample is N*128*3, and the feature dimension of the second input data is N*21;

[0025] G=<V,E> , V is the node set, E is the directed edge set, edge e vu The direction is from node v to node u; each node is associated with the abstract Web service of the corresponding candidate service set;

[0026] S33, for each sample, use the pre-made SanGA Web service combination algorithm to iteratively process and obtain the label data y=(y1, y2, ...y N ), y i Indicates whether each specific Web service in the candidate service set corresponding to the i-th abstract Web service in the current Web service composition is selected, y i =(y i1 ,y i2 ,…,y iK ),y ij =0 means not selected, y ij =1 represents selected, ∑ j y ij =1.

[0027] Optionally, the graph neural network model includes: an embedding module, a graph convolutional neural network module, a pooling module, a fully connected module and a pointer module;

[0028] The embedding module receives the input of the second input data and extracts the information of the input data. The dimension of the output data is N*Q. The embedding module includes: a fully connected layer, an activation function layer, a batch normalization layer and a dropout layer connected in sequence;

[0029] A graph convolutional neural network module, used to receive the output data of the embedding module as input data, and concatenate the outputs of all layers of graph convolutional neural networks to output data with an output dimension of N*QL, wherein the convolutional neural network module includes: an L-layer graph convolutional neural network that implements a directed information propagation path and a residual connection, and the dimension of the input and output data of each layer is N*Q; each layer of the graph convolutional neural network includes: a fully connected layer, an activation function layer, and a batch normalization layer;

[0030] A pooling module is used to receive the output data of the graph convolutional neural network module and extract the global information of the service composition topology structure, and output the output data with a dimension of N*P; the pooling module includes: a fully connected neural network layer, the number of neurons in the input layer is QL, the number of neurons in the output layer is P, and the output of the pooling module and the output data of the graph convolutional neural network module are concatenated to output the output data with a dimension of N*(QL+P);

[0031] The fully connected module is used to receive output data with a dimension of N*(QL+P), extract deep feature information of each abstract Web service node to reduce the length of the feature vector, and the fully connected module includes: a three-layer fully connected network, the number of neurons in the input layer is QL+P, the number of neurons in the output layer is Q, and the dimension of the output data is N*Q;

[0032] The pointer module is used to receive the output data of the fully connected module with a dimension of N*Q and the first input data of the sample, and calculate the probability of each Web service being selected according to the final characteristics of each abstract Web service node and the characteristics of each specific Web service in the corresponding candidate service set, and the probability Pred of each service in each candidate service set being selected to form a combined service, and the dimension of Pred is N×128.

[0033] Optionally, two types of input data in the pointer module are added to form data of dimension N×128×Q, and data with different dimension lengths are copied based on a broadcast mechanism to expand the length, so that the arrays of the two input data are aligned in the dimension and the corresponding bits are added;

[0034] The added result data is input into a fully connected layer with an output dimension of N×128×1. The single-dimensional entries are deleted and processed by the Softmax function to obtain the probability Pred of each service in each candidate service set being selected to form a combined service.

[0035] Among them, when performing Softmax calculation, based on the mask mechanism, the selection probability of each candidate service filling the incoming Web service is calculated as 0, and the calculation process is:

[0036]

[0037]

[0038]

[0039] Optionally, the activation functions of the embedding module, the graph convolutional neural network module and the pooling module are all linear rectification functions; the activation functions of the fully connected module and the pointer module are hyperbolic tangent activation functions;

[0040] The information propagation calculation process of the hth layer in the graph convolutional neural network module is:

[0041]

[0042]

[0043] Optionally, the graph neural network model uses the following loss function L when optimizing based on the prediction results and label data of the training samples during training, and uses the adaptive matrix estimation optimization algorithm Adam to optimize the loss function to adaptively adjust the optimization step size;

[0044]

[0045] In a second aspect, an embodiment of the present invention further provides a method for recommending a Web service combination based on a graph neural network model, comprising:

[0046] receiving a user request input by a user, wherein the user request includes: an abstract Web service set required by the user, a data stream of each abstract Web service defined in the abstract Web service set, and a QoS attribute value of each abstract Web service in the abstract Web service set;

[0047] Acquire first input data and second input data corresponding to a user request; the first input data is data composed of feature data of a specific Web service in each abstract Web service in the abstract Web service set, and the second input data is data composed of feature data of a candidate service set to which each abstract Web service in the abstract Web service set belongs; the abstract Web service corresponds to a plurality of candidate service sets pre-constructed by clustering, which are used to present service functions to the user, that is, one abstract Web service corresponds to one candidate service set, and one candidate service set is obtained after clustering the specific Web services;

[0048] Input the two input data into the trained graph neural network model to obtain the probability of each Web service in each candidate service set in the abstract Web service set being selected;

[0049] According to the probability of each Web service being selected, sampling processing is performed to obtain a recommended optimal Web service combination solution;

[0050] Among them, the trained graph neural network model is obtained by training using any of the training methods for the graph neural network model for recommending Web service combinations described in the first aspect, and the samples are samples input when training the graph neural network model.

[0051] Optionally, sampling processing is performed according to the probability of each Web service being selected to obtain a recommended optimal Web service combination solution, including:

[0052] Based on the probability selection mechanism, a Web service is randomly selected from the probabilities of each Web service being selected;

[0053] The overall QoS of the selected Web service combination is calculated, and the process of selecting the Web service combination is repeated T times to obtain T service combination schemes. The one with the best overall QoS is selected from the T service combination schemes as the optimal Web service combination scheme for output.

[0054] (III) Beneficial effects

[0055] The method of the present invention is used to solve the problems that the traditional service combination method is time-consuming and the quality of the resulting combination solution is poor in the face of large-scale user request scenarios.

[0056] The data processing method in the method of the present invention is to obtain the characteristics of the candidate service set, and use it as the input of the graph neural network model to be trained, thereby effectively reducing the calculation scale and the difficulty of solving the problem; considering that the number of Web services in each candidate service set is uncertain and has permutation invariance, which makes it difficult to define the output of the graph neural network, the method of the present invention is inspired by the attention mechanism and constructs a pointer module so that the output of the graph neural network is the selection probability of each Web service, so that the sampling process can be adopted in the recommendation method, effectively improving the quality of the recommended combination service obtained.

[0057] First, the disadvantage that the neural network structure of existing deep learning technology is fixed and difficult to be applied to service composition problems with unfixed structures is overcome, so that the present invention can apply end-to-end supervised learning to service composition problems.

[0058] Second, since the present invention is an end-to-end supervised learning framework, it can directly apply the trained neural network to the service combination problem that has never been seen before, thus overcoming the shortcoming of the prior art that a large amount of iterative exploration time is required, thereby improving the calculation speed of the present invention.

[0059] Third, since the present invention draws on the idea of ​​the attention mechanism to construct a pointer module and performs sampling according to probability when obtaining the selection probability of the Web service in each candidate service set, it overcomes the disadvantage that the prior art is prone to falling into the local optimal solution, so that the present invention can provide a variety of efficient service combination solutions.

[0060] Fourth, the method of the present invention solves the problem that the commonly used models have large computational complexity and it is difficult to balance the quality and real-time performance of the recommended solutions. On the premise of ensuring that the aggregated QoS quality of the combined service obtained by the method proposed in the present invention is high, the applicable scenarios are expanded, the real-time performance is balanced, and the time cost is saved to ensure that the user experience is improved in the actual production environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 A schematic diagram of a flow chart of a Web service composition method based on a graph neural network provided in one embodiment of the present invention;

[0062] Figure 2 An architectural block diagram of a graph neural network model provided by one embodiment of the present invention;

[0063] Figure 3 for Figure 2 Schematic diagram of the embedded module in ;

[0064] Figure 4 for Figure 2 Schematic diagram of the structure of the two fully connected neural networks in the h-th layer of the graph convolutional neural network module;

[0065] Figure 5A schematic diagram of the workflow of the example;

[0066] Figure 6 A schematic diagram of a recommended solution for the best choice of an example;

[0067] Figure 7 Schematic diagram of the sampling process in the recommended method. DETAILED DESCRIPTION

[0068] In order to better explain the present invention and facilitate understanding, the present invention is described in detail below through specific implementation modes in conjunction with the accompanying drawings.

[0069] Web services are platform-independent, low-coupled, self-contained, programmable web-based applications that can be described, published, discovered, coordinated, and configured using open XML standards. Their communication protocols are mainly based on SOAP, with services described through WSDL and metadata discovered and obtained through UDDI. Web services provide relatively simple functions, with defined inputs and outputs, as well as QoS values ​​(price, running time, throughput, etc.).

[0070] At present, there is no relevant research that applies supervised learning to the QoS-aware Web service composition problem. Due to the characteristics of the service composition problem itself, this research direction still faces some difficulties: (1) To solve the QoS-aware service composition problem based on supervised learning, it is necessary to use a neural network with memory function. When a new user request arrives, it can be calculated based on the existing parameters without retraining. However, due to the different number of abstract services involved in different user requests and the different number of Web services contained in different candidate service sets, the use of traditional neural network structures, such as fully connected networks and convolutional neural networks, cannot use a fixed network structure to receive input data of different sizes. (2) There is currently no fast and stable algorithm that can extract features from the topological connection relationship between Web services involved in different user requests. (3) The Web services in the candidate service set involved in the user request are permutation invariant. The use of traditional neural networks, such as LSTM networks, will introduce a sequential structure to them. (4) For large-scale user requests, the neural network structure needs to be carefully designed to reduce the computational scale and solution difficulty.

[0071] Embodiment 1

[0072] In view of the above defects, a new graph neural network model (i.e., service selection prediction network) is established in the embodiment of the present invention. Figure 2 As shown, the graph neural network model of this embodiment includes:

[0073] Embedding module, graph convolutional neural network module, pooling module, fully connected module and pointer module;

[0074] In order to better illustrate the processing process of each of the above modules, the following is an explanation of the processing process of a sample to be input into the graph neural network model.

[0075] The samples are generated based on a pre-selected data set of Web services with multiple QoS attribute values. Each sample is a graph data with multiple nodes and directed edges. Each node corresponds to a candidate service set, and the directed edge is the direction of the data flow between adjacent nodes. Each sample has two types of input data. The first input data is composed of the characteristic data of a specific Web service in each of all nodes, and the second input data is composed of the characteristic data of each of all nodes. The sample has label data, which is used to optimize the graph neural network model in combination with the prediction results of the graph neural network model during the training process.

[0076] During the training process, the batch size used is 16, which can well balance the stability and speed of the training process. The 16 here is derived from experience. Generally, the size range of 8 to 256 is used. Different problems and data scales can be adjusted according to experimental results. Here, 16 works best, regardless of the model to be trained.

[0077] In the following example, only one sample is used to illustrate the training process to make the description more concise and understandable:

[0078] A sample can obtain two kinds of input data: one is the input data consisting of the characteristic data of a specific Web service in each node of all nodes in the sample, Figure 2 The input data is marked as input 1, whose dimension is N×128×3, and the other is the input data composed of the feature data of each node in all nodes of the sample. Figure 2 It is marked as input 2 and its dimension is N×21.

[0079] First, input 2 is input to the embedding module, which is used to extract more information from the input data. The embedding module is a two-layer fully connected network with 21 neurons in the input layer and Q neurons in the output layer, that is, the dimension of the input data is N×21 and the dimension of the output data is N×Q. The activation function is a linear rectifier function. Batch normalization is used after the activation function to speed up the training of the model. Finally, a dropout layer is added to reduce overfitting. The structure of the embedding module is as follows: Figure 3 shown.

[0080] Subsequently, the output of the embedding module is input into the graph convolutional neural network module, which is used to further aggregate the features according to the workflow structure (i.e., data flow structure) involved in the sample and the characteristics of the abstract Web service.

[0081] The graph convolutional neural network module is a multi-layer graph convolutional neural network with directed information propagation paths and residual connections. It contains L layers, and the dimensions of the input and output data of each layer are N×Q. The output of each layer is concatenated, that is, the output data dimension of the graph convolutional neural network module is N×QL. Its activation function is a linear rectification function. The information propagation calculation process of its hth layer is:

[0082]

[0083]

[0084] in, represents the neural network output of the vth node in the i-th layer of the graph convolutional neural network, represents the input of the vth node in the first layer of the graph convolutional neural network, so, represents the neural network output of the vth node in the h-1th layer of the graph convolutional neural network, Represents an intermediate state of the vth node in the hth layer of the graph convolutional neural network, which will be converted into and Representing the two fully connected neural networks of the hth layer of the graph convolutional neural network, its structure is as follows Figure 4 As shown. v1 and v2 represent the input node set and output node set of the vth node respectively, and u represents a node in the v1 or v2 node set. Similarly, represents the neural network output of the u-th node in the h-1th layer of the graph convolutional neural network, Represents an intermediate state of the u-th node in the h-th layer of the graph convolutional neural network, which will be converted into

[0085] Subsequently, the output of the graph convolutional neural network module is input to the pooling module, which is used to extract global information on the entire service composition topology graph. The pooling module first contains a two-layer fully connected neural network with a network structure similar to Figure 3 The structure shown is the same, the number of neurons in the input layer is QL, and the number of neurons in the output layer is P, that is, the dimension of the input data is N×QL, the dimension of the output data is N×P, and the activation function used is the linear rectification function.

[0086] The output data is then subjected to a maximum pooling operation, where the dimension of the output data is 1×P. The data is then replicated N times to generate output data of dimension N×P. Finally, the output data is concatenated with the output data of the graph convolutional neural network module, i.e., the output data dimension of the final pooling module is N×(QL+P), where + represents an addition operation.

[0087] Next, the output of the pooling module is input to the fully connected module. The fully connected module is used to continue to extract the deep feature information of each abstract Web service node and reduce the length of the feature vector. It is a three-layer fully connected network with QL+P neurons in the input layer and Q neurons in the output layer. That is, the dimension of the input data is N×(QL+P) and the dimension of the output data is N×Q. Its activation function is the hyperbolic tangent activation function. The structure of each fully connected layer is as follows: Figure 3 shown.

[0088] Finally, the output of the fully connected module is input to the pointer module. The pointer module is used to calculate the probability of each specific Web service being selected based on the final features of each abstract Web service node and the features of each specific Web service in the corresponding candidate service set. The pointer module contains two types of input data, one of which is the output data of the fully connected module with a dimension of N×Q, representing the features of the N abstract Web services currently considered. This data is input to a fully connected layer with an output dimension of N×Q, and its activation function is the hyperbolic tangent activation function. The other input data is Figure 2 The input 1 in is the normalized features of the N candidate service sets, with a dimension of N×128×3. This data is input into a fully connected layer, and the output dimension is N×128×Q. Its activation function is the hyperbolic tangent activation function. Finally, the two output data are added to form data with a dimension of N×128×Q. When adding here, the broadcast mechanism is used because the two data dimensions are different. In the unaligned dimension, the shorter data is copied to expand the length, so that the two arrays are aligned in this dimension, and the corresponding bits are added. Then the added result data is input into a fully connected layer, and the output dimension is N×128×1. After deleting the single-dimensional entries, it is processed by the Softmax function, and the probability Pred of each service in each candidate service set being selected to form a combined service is obtained. The dimension of Pred is N×128. When performing the Softmax calculation, the mask mechanism is used to calculate the selection probability of the specific web service filled in each candidate service set to 0. The calculation process is as follows:

[0089]

[0090]

[0091] in, and It is a fully connected network with three fully connected layers in the pointer module. Its structure is a fully connected layer followed by a hyperbolic tangent activation function. is the output of the fully connected module, representing the characteristics of the vth abstract Web service, for Figure 2Input 1 in the vth candidate service set, which represents the characteristics of the jth specific Web service, s′ vj is an intermediate vector in the process of calculating the selection probability of the jth specific Web service in the vth candidate service set, which will then be input into Further calculations are performed in the fully connected neural network to obtain the evaluation score s representing the jth specific Web service in the vth candidate service set vj , k v is the number of Web services included in the vth candidate service set, e α is the base of the natural logarithm e raised to the power of α, prob vj is the selection probability of the jth specific Web service contained in the vth candidate service set;

[0092] In addition, the loss function of the graph neural network model during training is designed based on the multi-classification cross entropy function. Combined with the batch size used in training and the label data contained in the samples, the loss function optimized by the graph neural network model during training is obtained:

[0093]

[0094] Where L is the loss function, ∑ is the summation operation, B = 16N, represents the number of all abstract Web services in a batch, v is the sequence number of the vth candidate service set in the candidate service set corresponding to B abstract Web services, K v is the number of Web services included in the vth candidate service set, y vi is the label indicating whether the i-th Web service in the v-th candidate service set is selected, y vi =1 represents selected, y vi =0 means not selected, log is the logarithmic operation with the natural constant e as the base, P vi It is the probability of selecting the i-th specific Web service in the v-th candidate service set output by the graph neural network model.

[0095] During the optimization process, the loss function is optimized using the Adam algorithm based on adaptive matrix estimation. This optimization algorithm combines the first-order estimation and second-order estimation of the gradient, and can adaptively adjust the optimization step size to ensure the stability and speed of the optimization process.

[0096] In addition, after training, the samples of the training process can be used for prediction. For example, in the prediction stage, any specified number of samples are selected from the samples in the training sample set and input into the trained graph neural network model to obtain the prediction results.

[0097] Embodiment 2

[0098] like Figure 1As shown, this embodiment provides a training method for a graph neural network model for recommending a Web service combination. The method of this embodiment can be implemented on any electronic device, and the specific steps include:

[0099] S10. Clustering a pre-stored data set of Web services having multiple QoS attribute values ​​to obtain multiple candidate service sets, each of which includes K Web services.

[0100] The size of each candidate service set may be different, which is not limited in this embodiment.

[0101] S20. Based on the QoS attribute value of each Web service in each candidate service set, obtain feature data of each Web service and feature data of each candidate service set, and an abstract Web service corresponding to each candidate service set for presenting service functions to users.

[0102] Abstract Web service refers to a virtual service alias for a class of specific Web services. These Web services have the same functions, inputs, and outputs, but have different QoS attribute values. They form a set called the candidate service set.

[0103] S30, based on all normalized feature data, generating a service topology structure of a multi-type Web service combination and a sample corresponding to the service topology structure, each sample being graph data having multiple nodes and directed edges, each node corresponding to a candidate service set, and a directed edge being the direction of a data flow between adjacent nodes;

[0104] Each sample has two types of input data, the first input data is feature data composed of feature data of a specific Web service in each of all nodes, and the second input data is feature data composed of feature data of each of all nodes; and the sample has label data, and the label data is used to combine with the prediction results of the graph neural network model during the training process to optimize the graph neural network model.

[0105] S40. Use the sample to train a pre-built graph neural network model to obtain a trained graph neural network model, wherein the trained graph neural network model has the ability to predict the selection probability of each specific Web service in a set of candidate services required for the user request after processing the user request, so as to obtain a recommended optimal Web service combination solution.

[0106] Web service composition can be understood as: in order to complete a complex function, users need to call multiple specific Web services to obtain the desired output. The whole formed by these specific Web services is the composite service. Overall, the composite service provides complex functions and has defined input, output and QoS values.

[0107] In addition, each specific Web service in the composite service will have a calling relationship with each other, so this calling can be understood as a data flow / workflow, for example, the input of a specific Web service is the input of another specific Web service.

[0108] The above method can quickly and effectively train a graph neural network model. With the help of the training team graph neural network model, it can be used to solve the problem that the current commonly used models have large computational complexity and it is difficult to balance the quality and real-time performance of the recommendation solutions.

[0109] Embodiment 3

[0110] In order to better understand the training process, the technical solution of the above-mentioned embodiment 1 is described in detail below.

[0111] Step 1: Data preprocessing, that is, preprocessing the data set containing Web services.

[0112] In this embodiment, a data set containing more than 2,500 real Web services is used as basic data, namely, Web service data, which records more than a dozen QoS attribute values ​​of each Web service.

[0113] Sub-step 1-1 , Cluster the more than 2,500 real Web services contained in the data set in the first step according to the service name, thereby obtaining 233 candidate service sets, each of which contains K Web services, K ranges from 2 to 128, and each candidate service set corresponds to an abstract Web service.

[0114] Substeps 1-2 , the three QoS attributes of Web service running duration, availability and throughput are used as the characteristics of Web services. The characteristic vector of each Web service is a 3-dimensional vector. There are T Web services in total. The characteristics of all Web services are a (T,3)-dimensional matrix. Then all the characteristics of Web services are normalized according to the following formula:

[0115]

[0116] Among them, x qos,i is the normalized value of the i-th feature of all Web services in the Web service data, is the normalized value of the ith feature of all Web services in the Web service data, is the minimum value of the i-th feature of all Web services in the Web service data before normalization, is the maximum value of the i-th feature of all Web services in the Web service data before normalization.

[0117] Substeps 1-3,Each candidate service set contains K Web services, and the data of each candidate service set consists of the features of the Web services it contains, which is a (K, 3) dimensional matrix.

[0118] The average, standard deviation, variance, maximum, minimum, range and median of each normalized QoS attribute of the Web service in the candidate service set are calculated as the features of the candidate service set. At this time, each candidate service set becomes a vector with a dimension of 21, according to the following formula:

[0119]

[0120] in, is the feature vector of the vth candidate service set, is the kth feature of the vth candidate service set, k = 1, 2, ..., 21, σ j is the operation / statistical operation on the vector, i.e., finding the mean, standard deviation, variance, maximum, minimum, range and median, j = 1, 2, ..., 7, X v is a matrix containing the initial information of the vth candidate service set. Each row is the normalized feature of each Web service contained in the set, and each column is a QoS vector. For its i-th column, i=1,2,3.

[0121] Substeps 1-4 , normalize all the features of the candidate service set according to the following formula:

[0122]

[0123] Among them, x v,k is the normalized value of the kth feature of the vth abstract web service, is the value of the kth feature of the vth abstract web service before normalization, x k,min is the minimum value of the k-th feature of all abstract Web services before normalization, x k,max is the maximum value of the k-th feature of all abstract web services before normalization.

[0124] Step 2: Generate a sample set of deep neural network models based on graph neural networks.

[0125] Sub-step 2-1 ,The existing synthetic workflow generator is used to generate different composite service topologies, and the node set in each composite service topology consists of different numbers of abstract Web services, and the node set size is N.

[0126] That is, each node corresponds to a candidate service set, and for the convenience of representation, the nodes in the node set can be directly associated with the abstract Web services of the candidate service set.

[0127] Sub-step 2-2 ,For each composite service topology generated in step 2-1, an abstract Web service is randomly selected from the 233 abstract Web services as the node set of the topology structure, thus forming a sample.

[0128] The ratio of training samples to validation samples is set to 10:3, forming a training sample set and a validation sample set respectively; each combined service sample is a graph G consisting of nodes and edges.<V,E> , where V is a node set with a size of N. At this time, each node v is an abstract Web service, corresponding to a candidate service set. E is a directed edge set, and edge e vu The direction is from node v to node u.

[0129] Sub-steps 2-3 , for each training set sample and validation set sample generated by sub-step 2-2 in step 2.

[0130] In order to optimize the training process, the existing SanGA Web service combination algorithm is used to select Web services. The Web service selection scheme obtained when it is iterated to convergence is used as the label data y of the current sample. At this time, each sample is (G, y), where y = (y1, y2, ... y N ), y i Indicates which Web service should be selected from the candidate service set corresponding to the i-th abstract Web service in the current composite service.

[0131] In order to better understand the processing methods of the above steps 1 and 2, they are explained again below.

[0132] In this embodiment, there are M samples in the training data set, that is, there are M user requests for training. The abstract services involved in these user request samples for training and the data flows between the abstract services are all randomly constructed.

[0133] For each Web service, this embodiment considers optimizing its three service qualities: running time, price and throughput. These three service qualities are all numerical indicators with different ranges and units, that is, the dimension of the initial feature of each specific Web is 3, corresponding to the numerical values ​​of the three service qualities. The number of abstract services involved in each user request is N, and the candidate service set corresponding to each abstract service contains K specific Web services, K ranges from 2 to 128, and the sizes of different candidate service sets K are not necessarily the same.

[0134] For each training sample G, it is constructed in the form of a graph, that is, G =<V,E> , V is a node set, that is, the abstract Web service set involved in the current service request, E is a directed edge set, edge e uv The direction is from node u to node v. Each node u corresponds to a K u Therefore, the initial feature dimension of the candidate service set corresponding to each node is K u ×3.

[0135] For each sample, the SanGA service composition algorithm is used to select Web services. The Web service selection scheme obtained when it is iterated to convergence is used as the label data y of the current sample. At this time, each sample is (G, y), where y = (y1, y2, ..., y N ), y i Indicates whether each specific Web service in the candidate service set corresponding to the i-th abstract Web service in the current composite service is selected, y i =(y i1 ,y i2 ,…,y iK ),y ij =0 means not selected, y ij =1 represents selected, ∑ j y ij =1.

[0136] This embodiment performs two preprocessing operations on the data in the training data set to obtain two types of input data required subsequently.

[0137] The first preprocessing is: first, normalize the features of each specific Web service according to formula (1); second, fill the number of services in all candidate service sets so that the size of all candidate service sets is K u The maximum value is 128, that is, the initial feature dimension of the candidate service set corresponding to each node after this step is 128 × 3. In this step, the all-zero vector is used as the feature of the filled Web service. At this point, the normalized candidate service set feature is obtained.

[0138] The second preprocessing is: first, normalize the features of each specific Web service in the same way as the first preprocessing.

[0139] Then, for all candidate service sets, the seven statistical values ​​of the mean, standard deviation, variance, maximum, minimum, range and median of each normalized QoS attribute of all specific Web services contained in them are calculated according to formula (2) as the initial features of the abstract Web services corresponding to the candidate service sets, that is, the initial feature dimension of each abstract Web service is 21×1.

[0140] Finally, all the features of the abstract Web service are normalized using formula (3):

[0141] Through the above steps, the normalized abstract Web service features can be obtained.

[0142] Step 3: Build a deep neural network model based on graph neural network.

[0143] Sub-step 3-1 , build a deep neural network model based on graph neural network, which includes five modules: embedding module, graph convolutional neural network module, pooling module, fully connected module and pointer module.

[0144] Sub-step 3-2 , the batch size of the deep neural network model based on graph neural network is set to 16, the embedding module is a two-layer fully connected network, the number of neurons in its input layer is Y, Y=21, and the number of neurons in its output layer is Q, that is, the dimension of the input data is (16*N,21), and the dimension of the output data is (16*N,Q), * represents the multiplication operation. Its activation function is a linear rectification function.

[0145] Sub-step 3-3 The graph convolutional neural network module is a multi-layer graph convolutional neural network with directed information propagation paths and residual connections. It contains L layers, and the dimensions of the input and output data of each layer are (16*N,Q). The output of each layer is finally concatenated along the last dimension, that is, the output data dimension of the graph convolutional neural network module is (16*N,Q*L). Its activation function is a linear rectification function.

[0146] Substeps 3-4 , the pooling module is used to extract global information on the entire service combination topology map. The pooling module is a two-layer fully connected neural network, the number of neurons in its input layer is Q*L, and the number of neurons in its output layer is P, that is, the dimension of the input data is (16*N,Q*L), and the dimension of the output data is (16*N,P). The output data of sub-step 3-3 of step 3 is first input into this fully connected neural network to obtain the output data, and then the output data belonging to the same combined service sample is subjected to the maximum pooling operation. At this time, the dimension of the output data is (16,P), and then the data of each sample is copied N times to generate output data with a dimension of (16*N,P). Finally, this output data and the output data of the third step of step 3 are spliced ​​together along the last dimension, that is, the output data dimension of the final pooling module is (16*N,Q*L+P), and + represents the addition operation. The activation function used by the pooling module is the linear rectification function.

[0147] Substeps 3-5The fully connected module is used to extract deep feature information. It is a three-layer fully connected network. The number of neurons in the input layer is Q*L+P, and the number of neurons in the output layer is Q. That is, the dimension of the input data is (16*N,Q*L+P), and the dimension of the output data is (16*N,Q). Its activation function is the hyperbolic tangent activation function.

[0148] Substeps 3-6 The pointer module is a new structure built based on the characteristics of the combined service task and the idea of ​​the attention mechanism. The pointer module contains two types of input data, one of which is the output data of the fifth step of step 3, with a dimension of (16*N,Q), representing the features of the 16*N candidate service sets currently considered. This data is input into a fully connected layer, with an output dimension of (16*N,Q), and its activation function is the hyperbolic tangent activation function. The other input data is the features of the Web services contained in the 16*N candidate service sets, with a dimension of (16*N,128,3), where 128 is the maximum number of Web services contained in the candidate service set, that is, this input data uses a mask mechanism. This data is input into a fully connected layer, with an output dimension of (16*N,128,Q), and its activation function is the hyperbolic tangent activation function. The last two output data are added through the broadcast mechanism to form data with a dimension of (16*N,128,Q), which is input into a fully connected layer with an output dimension of (16*N,128,1). After deleting the single-dimensional entries, the data is processed by the Softmax function to obtain the probability Pred of each service in each candidate service set being selected to form a combined service. The dimension of Pred is (16*N,128).

[0149] Substeps 3-7 , the loss function in the deep neural network model based on graph neural network is set as follows:

[0150]

[0151] Where L is the loss function, ∑ is the summation operation, B = 16*N, represents the number of all candidate service sets in a batch, v is the sequence number of the vth candidate service set among B candidate service sets, K v is the number of Web services included in the vth candidate service set, y vi is the label indicating whether the i-th Web service in the v-th candidate service set is selected, y vi =1 means selected, y vi =0 means not selected, log is the logarithmic operation with the natural constant e as the base, P vi It is the probability of the i-th Web service being selected in the v-th candidate service set output by the deep neural network model based on graph neural network.

[0152] Substeps 3-8, the optimization algorithm of the deep neural network model based on graph neural network is set to the adaptive matrix estimation optimization algorithm Adam.

[0153] Step 4: Train the deep neural network model based on graph neural network.

[0154] Input the training sample set and the verification sample set into the deep neural network model based on the graph neural network, use the neural network structure, parameters and activation function of sub-steps 3-2 to 3-6 of step 3 to perform forward propagation of the deep neural network model based on the graph neural network, use the loss function in sub-step 3-7 and the optimization algorithm in sub-step 3-8 to back propagate the error of the deep neural network model based on the graph neural network until the loss function converges to obtain a trained deep neural network model based on the graph neural network.

[0155] Step 5: Recommend a Web service combination solution for the new user request.

[0156] According to the simple abstract Web service functions required in the user request, find the corresponding candidate Web service set, use the data preprocessing method from step 1-3 to step 1-5 to preprocess the data, and obtain the normalized Web service QoS data And the normalized candidate service set feature data x v ,in, is the normalized value of the QoS of the i-th Web service, x v is the normalized feature data of the vth candidate service set; the normalized Web service QoS data and the normalized candidate service set feature data are input into the deep neural network model based on graph neural network, and the neural network structure, parameters and activation function of sub-steps 3-2 to 3-6 and the trained deep neural network model parameters based on graph neural network obtained in step 4 are used to perform forward propagation of the deep neural network model based on graph neural network to obtain the probability of each Web service being selected in each candidate service set, and sampling is performed more than twice according to the probability to obtain more than two Web service selection schemes, and the scheme with the highest aggregate QoS is selected as the recommended Web service combination scheme for the user request.

[0157] Embodiment 4

[0158] The present invention is further described below in conjunction with specific examples:

[0159] Step 1: Data preprocessing.

[0160] This example uses the dataset Info containing 2507 real Web services. service As raw data, it records the basic information of each Web service.service ={w1,w2,...,w 2507}, w = (name, Q), where name is the name of service w, Q = (Q time ,Q throu ,Q ava ) are the three QoS attributes of service w: operation duration, availability, and throughput. For example, suppose there is a Web service that can be called through an API interface. Its function is to translate a given English text into Chinese. Its operation duration is 100ms, its availability is 80%, and its throughput is 30 user requests per second. It can be represented as w = (trans_english_to_chinese, (100, 80, 30)).

[0161] Sub-step 1-1, using the existing text clustering algorithm, cluster the 2507 real Web services contained in the original data in the first step of step 1 according to the service name, thereby obtaining 233 clusters, and the number of Web services contained in each cluster ranges from 2 to 128. The Web services in each cluster provide the same functions but have different QoS attributes, that is, each cluster is a candidate service set, and each candidate service set corresponds to an abstract Web service.

[0162] In sub-step 1-2, the three QoS attributes of Web service running duration, availability and throughput are used as the characteristics of Web services. The characteristic vector of each Web service is a 3-dimensional vector, so the characteristics of all Web services are a (2507,3)-dimensional matrix. Then all the characteristics of Web services are normalized. A brief introduction to the three QoS attributes and the calculation method of aggregated QoS under serial and parallel structures are listed as follows: Table 1

[0163]

[0164] In sub-steps 1-3, each candidate service set contains a different number of Web services from 2 to 128, and the dimension of the feature vector of each Web service is 3. The mean, standard deviation, variance, maximum, minimum, range, and median of each feature of the Web services in the candidate service set are calculated and combined into a vector with a dimension of 21 as the feature of the candidate service set.

[0165] Sub-steps 1-4 normalize all features of the candidate service set.

[0166] Step 2: Generate a sample set of the deep neural network model based on the graph neural network. A sample represents a user's combined service request and the corresponding recommended combination solution. For example, suppose the user needs to translate an English document into Chinese and then extract its article tags. Currently, there is no Web service that can provide these two functions at the same time. Then the user generates a combined service request, which requires combining two Web services with different functions so that the combination can provide a shorter running duration, higher availability and higher throughput when providing the corresponding functions.

[0167] To address this issue, the QoS-aware service composition method needs to provide corresponding recommended combination solutions. For example, the combined service that ultimately meets the requirements is the translation Web service provided by Baidu and the article tag Web service provided by Baidu. Thus, the user's combined service request and the corresponding recommended combination solution constitute a complete sample. The combined service in the above example only involves a serial structure of two Web services. In the actual industrial field, the combined service request is often more complex in structure and involves large-scale Web services, resulting in the response time of the existing QoS-aware service composition algorithm often growing exponentially with the growth of scale, seriously affecting the user experience. The end-to-end supervised learning framework proposed in the present invention solves this problem.

[0168] Sub-step 2-1, using the existing synthetic workflow generator to generate different composite service topology structures, each composite service topology structure contains 10 nodes.

[0169] Sub-step 2-2: For each composite service topology structure generated in the first step of step 2, 10 abstract Web services are randomly selected from the 233 abstract Web services as the node set of the topology structure to form a sample. The number of samples in the training set, validation set, and test set are 1000, 300, and 20, respectively.

[0170] Sub-step 2-3, for each training set sample, validation set sample and test set sample generated in the second step of step 2, use the existing SanGA Web service combination algorithm to select Web services, and let it iterate until the Web service selection scheme obtained when convergence is used as the label data y of the current sample, y = (y1, y2, ... y N ), y i Indicates whether each specific Web service in the candidate service set corresponding to the i-th abstract Web service in the current Web service composition is selected, y i =(y i1 ,y i2 ,…,y iK ),y ij =0 means not selected, y ij =1 represents selected, ∑j y ij =1.

[0171] Step 3: Build a deep neural network model based on graph neural network.

[0172] Sub-step 3-1, build a deep neural network model based on graph neural network, which includes five modules: embedding module, graph convolutional neural network module, pooling module, fully connected module and pointer module.

[0173] Sub-step 3-2, set the batch size of the deep neural network model based on graph neural network to 16, the embedding module is a fully connected neural network, the number of neurons in its input layer is 21, and the number of neurons in its output layer is Q=64, that is, the dimension of the input data is (16*10,21), and the dimension of the output data is (16*10,64). Its activation function is a linear rectification function.

[0174] Sub-step 3-3, the graph convolutional neural network module is a 3-layer graph convolutional neural network, and the dimensions of the input data and output data of each layer are (16*10,64). The output of each layer is concatenated along the last dimension, that is, the output data dimension of the graph convolutional neural network module is (16*10,64*3). Its activation function is a linear rectification function.

[0175] In sub-step 3-4, the pooling module is a fully connected neural network, the number of neurons in its input layer is 64*3, and the number of neurons in its output layer is 200, that is, the dimension of the input data is (16*10,64*3), and the dimension of the output data is (16*10,200). Then, the output data of the same combined service sample in a batch is subjected to the maximum pooling operation, and the dimension of the output data is (16,200). Then, the data of each sample is copied 10 times to generate output data of dimension (16*10,200). Finally, this output data is spliced ​​together with the output data of the third step of step 3 along the last dimension, that is, the output data dimension of the final pooling module is (16*10,64*3+200). The activation function used by the pooling module is the linear rectification function.

[0176] Sub-step 3-5, the fully connected module is a fully connected neural network, the number of neurons in its input layer is 64*3+200, and the number of neurons in its output layer is 64, that is, the dimension of the input data is (16*10,64*3+200), and the dimension of the output data is (16*10,64). Its activation function is the hyperbolic tangent activation function.

[0177] In sub-step 3-6, the pointer module contains two types of input data. One is the output data of the fifth step of step 3, with a dimension of (16*10,64). This data is input into a fully connected layer, and the output dimension is (16*10,64). Its activation function is the hyperbolic tangent activation function. The other input data is the features of the web services included in the 16*10 candidate service sets in the batch, with a dimension of (16*10,128,3), where 128 is the maximum number of web services included in the candidate service set. This data is input into a fully connected layer, and the output dimension is (16*10,128,64). Its activation function is the hyperbolic tangent activation function. The last two output data are added through the broadcast mechanism to form data with a dimension of (16*10,128,64), which is input into a fully connected layer with an output dimension of (16*10,128,1). After deleting the single-dimensional entries, the probability Pred of each service in each candidate service set being selected to form a combined service is obtained through mask processing and Softmax function. The dimension of Pred is (16*10,128).

[0178] Sub-step 3-7, setting the loss function L in the deep neural network model based on the graph neural network;

[0179] In the loss function, B=16*10, which represents the number of all abstract Web services included in a batch.

[0180] Sub-step 3-8, setting the optimization algorithm of the deep neural network model based on graph neural network to the adaptive matrix estimation optimization algorithm Adam.

[0181] Step 4: Train the deep neural network model based on graph neural network.

[0182] The training sample set D train Input it into the deep neural network model based on graph neural network, use the neural network structure, parameters and activation function of step 3, ...

[0183] Step 5: Recommend a Web service combination solution for the new user request.

[0184] According to the simple abstract Web service functions required in the user request, find the corresponding candidate Web service set, use the data preprocessing method from step 1-3 to step 1-5 to preprocess the data, and obtain the normalized Web service QoS data And the normalized candidate service set feature data x v ,in, is the normalized value of the QoS of the i-th Web service, x v is the normalized feature data of the vth candidate service set; the normalized Web service QoS data and the normalized feature data of the candidate service set are input into the deep neural network model based on the graph neural network, and the neural network structure, parameters and activation function of steps 3-2 to 3-6 and the trained deep neural network model parameters based on the graph neural network obtained in step 4 are used to perform forward propagation of the deep neural network model based on the graph neural network to obtain the probability of each Web service being selected in each candidate service set, and sampling is performed more than twice according to the probability to obtain more than two Web service selection schemes, and the scheme with the highest aggregate QoS is selected as the recommended Web service combination scheme for the user request.

[0185] Embodiment 5

[0186] Here is a specific example. Currently, there are two types of abstract services in the entire system:

[0187] 1) Translation Web Service: can translate an English document into Chinese

[0188] 2) Word segmentation Web service, which can divide a Chinese article into a series of words

[0189] The candidate service sets corresponding to these two abstract services are:

[0190] A: Translation candidate service set: including Baidu translation web service, Google translation web service, 360 translation web service, which provide the same functions and have the same input and output, but have different quality of service (QoS) (only price and running time are used as examples here). The number of translation candidate service sets and the characteristics of each service in this embodiment are assumed for the convenience of explaining the technical solution of this application. In actual applications, the number of candidate service sets is very large.

[0191] Web Services price Run time Baidu Translate 10 Yuan 10 minutes Google Translate 20 Yuan 1 minute 360 Translation 5 Yuan 30 minutes

[0192] B: Word segmentation Web service: including Jieba word segmentation Web service and Baidu word segmentation Web service. They provide the same functions and have the same input and output, but have different quality of service (QoS) (here only price and running time are used as examples):

[0193] Web Services price Run time stuttering participle 5 Yuan 10 minutes Baidu word segmentation 10 Yuan 5 minutes

[0194] At this time, a user makes a service request, he wants the following combination of services, such as Figure 5 shown.

[0195] This is a very simple composite service that only includes two types of abstract services: translation Web service and word segmentation Web service, and only involves serial workflows.

[0196] After receiving this service request, the system needs to select a specific Web service from the candidate service sets corresponding to the two abstract services, translation Web service and word segmentation Web service (translation candidate service set, word segmentation candidate service set), to combine them into a composite service, with the goal of making the cost as small as possible and the total service execution time as short as possible. This is a multi-objective optimization problem. In this work, the weighted sum calculation method is used to simplify it, that is, in this example, the goal = 0.5*price+0.5*running time is minimized.

[0197] final, Figure 6 The combination shown is the optimal one.

[0198] The filled circle is the selected specific Web service. In actual applications, user requests are more complex, involving more abstract services, more complex topology (including parallel branches), and the calculation of the overall QoS is related to the topology. Different QoS indicators have different calculation formulas.

[0199] Embodiment 6

[0200] The embodiment of the present invention provides a method for recommending a Web service combination based on a graph neural network model, which includes:

[0201] 601. Receive a user request input by a user, where the user request includes: an abstract Web service set required by the user, data flows of each abstract Web service defined in the abstract Web service set, and a QoS attribute value of each abstract Web service in the abstract Web service set;

[0202] 602. Obtain first input data and second input data corresponding to the user request; the first input data is data consisting of feature data of a specific Web service in each abstract Web service in the abstract Web service set, and the second input data is data consisting of feature data of a candidate service set to which each abstract Web service in the abstract Web service set belongs; the abstract Web service corresponds to multiple candidate service sets pre-constructed by clustering, which are used to present service functions to the user; one abstract Web service corresponds to one candidate service set.

[0203] 603. Input the two input data into the trained graph neural network model to obtain the probability of each Web service in each candidate service set in the abstract Web service set being selected;

[0204] 604. Perform sampling processing according to the probability of each Web service being selected to obtain a recommended optimal Web service combination solution;

[0205] Specifically, based on the probability selection mechanism, a Web service is randomly selected from the probabilities of each Web service being selected, and based on the probability of the selected Web service, the probability and QoS value of the Web service combination are predicted;

[0206] like Figure 7 As shown in the figure, the specific process is to randomly select a specific Web service from each candidate service set according to the predicted service selection probability Pred for each abstract Web service contained in the user request. The greater the predicted service selection probability, the greater the probability of being selected. When all abstract Web services have selected the corresponding specific Web services, a service combination scheme is formed. At this time, its overall QoS can be calculated. The calculation method of each QoS indicator of the combined service is shown in Table 1. The overall QoS of the final service combination is the average weighted sum of all QoS indicators. Figure 7 In it, i and t are both natural numbers greater than 0. Iterate t to T, that is, repeat the above process T times, and T service combination solutions can be obtained. The one with the best overall QoS is selected as the feedback result of the system to the user. In particular, the selection of T in this embodiment needs to comprehensively consider the running time and the effect of the solution. The larger T is, the better the effect of the solution is, but the running speed is faster. The smaller T is, the smaller the running time is, but the effect of the solution may be reduced. Usually, T is generally used as 1000. T in this embodiment is a natural number greater than 100.

[0207] The trained graph neural network model is obtained by training using the training method for a graph neural network model for recommending Web service combinations described in any of the above embodiments, and the samples are samples input during the training of the graph neural network model.

[0208] The method of this embodiment solves the problem that the commonly used models have large computational complexity and are difficult to balance the quality and real-time performance of the recommended solutions. On the premise of ensuring that the aggregated QoS quality of the combined service obtained by the method proposed in the present invention is high, the applicable scenarios are expanded, the real-time performance is balanced, and the time cost is saved to ensure that the user experience is improved in the actual production environment.

[0209] It should be noted that, in the description of this specification, the description of the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.

[0210] Those skilled in the art may make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention should also include these modifications and variations.

Claims

1. A training method for a graph neural network model for recommending Web service combinations, characterized in that: include: S10, clustering a pre-stored data set of Web services with multiple QoS attribute values ​​to obtain multiple candidate service sets, each candidate service set including K Web services, S20, based on the QoS attribute value of each Web service in each candidate service set, obtaining feature data of each Web service and feature data of each candidate service set, and an abstract Web service corresponding to each candidate service set for presenting service functions to users; S30, based on all normalized feature data, generating a service topology structure of a multi-type Web service combination and a sample corresponding to the service topology structure, each sample being graph data having multiple nodes and directed edges, each node corresponding to a candidate service set, and a directed edge being the direction of a data flow between adjacent nodes; Each sample has two types of input data, the first input data is feature data composed of feature data of a specific Web service in each of all nodes, and the second input data is feature data composed of feature data of each of all nodes; and the sample has label data, and the label data is used to optimize the graph neural network model in combination with the prediction results of the graph neural network model during the training process; S40, using the sample to train a pre-built graph neural network model to obtain a trained graph neural network model, wherein the trained graph neural network model has the ability to predict the selection probability of each specific Web service in the candidate service set required for the user request after processing the user request, so as to obtain a recommended optimal Web service combination solution; during the training process, the batch size used is 16, The graph neural network model includes: an embedding module, a graph convolutional neural network module, a pooling module, a fully connected module and a pointer module; The embedding module receives the input of the second input data and extracts the information of the input data. The dimension of the output data is N*Q. The embedding module includes: a fully connected layer, an activation function layer, a batch normalization layer and a dropout layer connected in sequence; A graph convolutional neural network module, used to receive the output data of the embedding module as input data, and concatenate the outputs of all layers of graph convolutional neural networks to output data with an output dimension of N*QL, wherein the convolutional neural network module includes: an L-layer graph convolutional neural network that implements a directed information propagation path and a residual connection, and the dimension of the input and output data of each layer is N*Q; each layer of the graph convolutional neural network includes: a fully connected layer, an activation function layer, and a batch normalization layer; A pooling module is used to receive the output data of the graph convolutional neural network module and extract the global information of the service composition topology structure, and output the output data with a dimension of N*P; the pooling module includes: a two-layer fully connected neural network layer, the number of neurons in the input layer is QL, the number of neurons in the output layer is P, the dimension of the input data is N*QL, the dimension of the output data is N*P, the activation function used is a linear rectification function, and the output data is subjected to a maximum pooling operation. At this time, the dimension of the output data is 1*P, and then the data is copied N times to generate output data with a dimension of N*P. The output of the pooling module and the output data of the graph convolutional neural network module are concatenated to output output data with a dimension of N*(QL+P); The fully connected module is used to receive output data with a dimension of N*(QL+P), extract deep feature information of each abstract Web service node to reduce the length of the feature vector, and the fully connected module includes: a three-layer fully connected network, the number of neurons in the input layer is QL+P, the number of neurons in the output layer is Q, the dimension of the output data is N*Q, and the activation function is a hyperbolic tangent activation function; The pointer module is used to receive the output data of the fully connected module with a dimension of N*Q and the first input data of the sample, and calculate the probability of each Web service being selected according to the final characteristics of each abstract Web service node and the characteristics of each specific Web service in the corresponding candidate service set, and the probability Pred of each service in each candidate service set being selected to form a combined service, where the dimension of Pred is N×128; In the pointer module, two types of input data are added to form data with dimensions of N×128×Q. Based on the broadcast mechanism, the values ​​of data with different dimension lengths are copied to expand the length, so that the arrays of the two input data are aligned in this dimension and the corresponding bits are added. The added result data is input into a fully connected layer with an output dimension of N×128×1. The single-dimensional entries are deleted and processed by the Softmax function to obtain the probability Pred of each service in each candidate service set being selected to form a combined service. Among them, when performing Softmax calculation, based on the mask mechanism, the selection probability of each candidate service filling the incoming Web service is calculated as 0, and the calculation process is: In the formula, and represents the fully connected network with three fully connected layers in the pointer module, is the output of the fully connected module, representing the characteristics of the vth abstract Web service, is the first input data, representing the features of the jth Web service contained in the vth candidate service set, s' vj is an intermediate vector in the process of calculating the selection probability of the jth Web service in the vth candidate service set, input to The calculation is performed in the fully connected neural network to obtain the evaluation score s representing the jth Web service in the vth candidate service set. vj , k v is the number of Web services included in the vth candidate service set, e α is the base of the natural logarithm e raised to the power of α, prob vj is the selection probability of the jth Web service contained in the vth candidate service set.

2. The training method according to claim 1, characterized in that: The QoS attribute values ​​that characterize a Web service include: the value of the operation duration, the value of the availability, the value of the price and the value of the throughput rate; the characteristic vector of each Web service is at least a 3-dimensional vector; The number of candidate service sets after clustering is 150-250, each candidate service set includes 2 to 128 Web services, and the abstract Web service corresponding to each candidate service set is determined in the clustering process.

3. The training method according to claim 2, characterized in that: The S20 includes: S21, normalizing all features of all Web services in all candidate service sets to obtain normalized feature data of each Web service; S22, for each candidate service set, based on the feature data of all normalized Web services in the candidate service set, calculate the feature data of the candidate service set to obtain a 21-dimensional vector; The characteristic data of the candidate service set includes: the average value, standard deviation, variance, maximum value, minimum value, range and median of each corresponding characteristic of all Web services in the candidate service set; S23. Normalize each feature in each candidate service set to obtain feature data of each candidate service set.

4. The training method according to claim 3, characterized in that: The S30 includes: S31, using a pre-synthesized workflow generator to process all candidate service sets and generate a service topology structure of a multi-type Web service combination; S32, the service topology structure of each Web service combination generates a sample G of graph data with nodes and edges; all samples are divided according to a predetermined ratio to obtain a training sample set and a verification sample set; The feature dimension of the first input data of each sample is N*128*3, and the feature dimension of the second input data is N*21; G=<V,E>, V is the set of nodes, E is the set of directed edges, and edge e vu The direction is from node v to node u; each node is associated with the abstract Web service of the corresponding candidate service set; S33, for each sample, use the pre-made SanGAWeb service combination algorithm to perform iterative processing to obtain the label data y=(y1, y2, ...y N ), y i Indicates whether each specific Web service in the candidate service set corresponding to the i-th abstract Web service in the current Web service composition is selected, y i =(y i1 ,y i2 ,…,y iK ),y ij =0 means not selected, y ij =1 represents selected, ∑ j y ij =1.

5. The training method according to any one of claims 1 to 4, characterized in that: The activation functions of the embedding module, graph convolutional neural network module and pooling module are all linear rectification functions; the activation functions of the fully connected module and the pointer module are hyperbolic tangent activation functions; The information propagation calculation process of the hth layer in the graph convolutional neural network module is: in, represents the neural network output of the vth node in the i-th layer of the graph convolutional neural network, represents the input of the vth node in the first layer of the graph convolutional neural network, represents the neural network output of the vth node in the h-1th layer of the graph convolutional neural network, Represents an intermediate state of the vth node in the hth layer of the graph convolutional neural network, which will be converted into and Represents two fully connected neural networks in the hth layer of the graph convolutional neural network. v1 and v2 represent the input node set and output node set of the vth node respectively. u represents a node in the v1 or v2 node set. represents the neural network output of the u-th node in the h-1th layer of the graph convolutional neural network, Represents an intermediate state of the u-th node in the h-th layer of the graph convolutional neural network, which will be converted into 6. The training method according to any one of claims 1 to 4, characterized in that: The graph neural network model uses the following loss function L when optimizing the prediction results and label data of the training samples during training, and uses the adaptive matrix estimation optimization algorithm Adam to optimize the loss function to adaptively adjust the optimization step size; Where L is the loss function, ∑ is the summation operation, B = 16N, represents the number of all abstract Web services in a batch, v is the sequence number of the vth candidate service set in the candidate service set corresponding to B abstract Web services, K v is the number of Web services included in the vth candidate service set, y vi is the label indicating whether the i-th Web service in the v-th candidate service set is selected, y vi =1 represents selected, y vi =0 means not selected, P vi It is the probability of selecting the i-th specific Web service in the v-th candidate service set output by the graph neural network model.

7. A method for recommending Web service combinations based on a graph neural network model, characterized in that: include: receiving a user request input by a user, wherein the user request includes: an abstract Web service set required by the user, a data stream of each abstract Web service defined in the abstract Web service set, and a QoS attribute value of each abstract Web service in the abstract Web service set; The first input data and the second input data corresponding to the user request are obtained; the first input data is data composed of characteristic data of a specific Web service in each abstract Web service in the abstract Web service set, and the second input data is data composed of characteristic data of a candidate service set to which each abstract Web service in the abstract Web service set belongs; the abstract Web service corresponds to a plurality of candidate service sets pre-constructed by clustering, and is used to present service functions to the user, Input the two input data into the trained graph neural network model to obtain the probability of each Web service in each candidate service set in the abstract Web service set being selected; According to the probability of each Web service being selected, sampling processing is performed to obtain a recommended optimal Web service combination solution; Among them, the trained graph neural network model is obtained by training using the training method of the graph neural network model for recommending Web service combinations described in any one of claims 1 to 6, and the samples are the samples input when training the graph neural network model.

8. The recommendation method according to claim 7, characterized in that: According to the probability of each Web service being selected, sampling processing is performed to obtain a recommended optimal Web service combination solution, including: Based on the probability selection mechanism, a Web service is randomly selected from the probabilities of each Web service being selected; The overall QoS of the selected Web service combination is calculated, and the process of selecting the Web service combination is repeated T times to obtain T service combination schemes. The one with the best overall QoS is selected from the T service combination schemes as the optimal Web service combination scheme for output.

Citation Information

Patent Citations

  • Structure optimization design method for accelerating by using graph convolutional neural network structure

    CN111898730A

  • Web service quality prediction method and system based on network topology perception

    CN113259163A