Web service recommendation method based on graph attention convolutional network and graph pooling
By adopting a graph-based convolutional network and graph pooling method in the field of service computing, the problem of low service recommendation accuracy in the prior art is solved, and more efficient service feature extraction and recommendation effects are achieved.
Patent Information
- Application Number
- CN202510060709.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2045-01-15
AI Technical Summary
The prior art is difficult to effectively learn the deep features of services and capture the high-order feature interaction of Web APIs, resulting in low accuracy of service recommendations and failure to consider the complex signal differences and changes in user-oriented interactions with API services.
Using the Web service recommendation method based on graph attention convolution network and graph pooling, a service network diagram is constructed through the dual tower model, a two-level perceived self-attention mechanism is designed for graph convolution, and a heterogeneous node graph roughening is used to further extract service information, and through dynamic representation, graph-level representation and target service stitching learning combination embedding representation, the user and target service interaction probability is predicted.
It improves the construction quality of service network graphs, enhances the quality of service embedding and aggregation, can better capture high-level correlations between services, and improves the accuracy of service recommendations.
Smart Images

Figure CN119484625B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of service computing, and in particular relates to a Web service recommendation method based on graph attention convolutional network and graph pooling. Background Art
[0002] Service-Oriented Architecture (SOA) is a component model that enables different functional modules of an application to communicate efficiently through well-defined interfaces. Web services are one of the core technologies for implementing SOA. They can provide specific functions and business logic and are considered a new generation of Web applications. Web services enable business-level software reuse, which significantly optimizes the development process. API is an application program interface that provides specific functions. Web services expose their functions through APIs, and other applications can obtain the functions provided by Web services by calling APIs. APIs are booming because they have many advantages, such as improving the flexibility of software systems, reducing costs, and promoting business changes, which increases the difficulty for software developers to obtain suitable APIs.
[0003] In response to the above problems, a large number of researchers in the service computing field have conducted research on service recommendation technology. For example, Jiang et al. embedded the API entities in the service knowledge graph into a low-dimensional space through representation learning, and then calculated the distance between API vectors to recommend related APIs. Yao et al. studied the API recommendation problem based on the regularized matrix decomposition framework, decomposed the API-Mashup matrix into two low-dimensional matrices, and proposed a latent variable model to capture the implicit associations between APIs. However, the above methods cannot learn the deep features of the service and it is difficult to capture the high-order feature interactions of Web APIs, resulting in low accuracy of service recommendations.
[0004] Graph neural network is a kind of neural network that processes graph structure data. Its characteristics are that data is represented as nodes, and the relationship between data is represented as edges. The characteristics and information of data are mined by transferring and aggregating information and topological structures between nodes. It is widely used in molecular structure, recommendation system, and social network. For example, Liu et al. used gated neural network to represent user session information, and aggregated the information of users and their friends in social network in graph attention network, so as to effectively model user preferences. Gu et al. proposed a matrix decomposition method based on random walk, which prompted nodes to represent the topological structure of graph by embedding autocovariance similarity. And use specific aggregation function to mine the dissimilarity distribution in the graph, so as to obtain the potential association between users and items. Some researchers in the field of service computing use graph neural network to improve the accuracy of service recommendation. For example, Ling et al. used graph neural network to capture high-order collaboration signals and project structure information in API calls, and integrated the text attributes of nodes in neural network to represent semantics, which improved the accuracy of API recommendation to a certain extent. Kang et al. proposed a method for service recommendation using graph neural networks and autoencoder technology, taking into account the local and global structural relationships in the WebAPI collaboration network and the network structural relationships of message passing, and recommending Web services that match user queries. The above recommendation method improves the accuracy of recommendations to a certain extent, but does not take into account the differences in complex signals in the interaction between users and API services, cannot accurately capture the role of different signals in API service mining, and does not pay attention to the problem of changes in user needs, lacking research on the needs of personalized service recommendations. Summary of the invention
[0005] In order to overcome the shortcomings of the existing technology, the present invention proposes a Web service recommendation method based on graph attention convolutional network and graph pooling. Firstly, a service network graph is constructed based on the double-tower model, and the focus service is differentiated from it; secondly, a two-level perceptual self-attention mechanism is proposed in the graph convolution process, and the amount of information aggregated from the source node to the target node is controlled in the clustering-aware self-attention mechanism, and the amount of information sent by the source node to the target node is controlled in the query-aware self-attention mechanism; then, a graph pooling method with heterogeneous node coarsening strategy as the core is adopted to further extract service information; finally, the dynamic representation, graph-level representation and target service of the focus service are spliced and the combined embedding representation is learned, and the probability of the target service interacting with the user at the next moment is predicted in the prediction layer.
[0006] The technical solution adopted by the present invention to solve its technical problem is:
[0007] A Web service recommendation method based on graph attention convolutional network and graph pooling, the method comprising the following steps:
[0008] Step 1: Create a service data set, obtain service interaction data, and use the dual-tower model to build a service network diagram;
[0009] Step 2: Based on the graph structure in the service network graph, a two-level perceptual self-attention mechanism is designed to aggregate service embedding vectors, and a graph convolutional network is used to extract service features.
[0010] Step 3: Graph pooling with heterogeneous node graph coarsening as the core is used to further extract important service information. Heterogeneous nodes refer to nodes of various types in the service network graph.
[0011] Step 4: Capture the dynamically changing focus service and perform graph-level representation readout. The final output embedding is obtained based on the focus service representation and graph-level representation readout, and then the probability of the target service interacting with the user is obtained.
[0012] Further, the process of step 1 is as follows:
[0013] Step (1.1) The dual-tower model is a deep learning framework whose basic idea is to learn two different data features from two towers respectively, and then measure the similarity between the two input data;
[0014] Step (1.2) creates a service data set, crawls user information and API services from relevant websites, analyzes and organizes the collected results, and obtains a service data set. The service data set contains the following information:
[0015] Step (1.2.1) User: The developer who calls the API service, using the symbol express;
[0016] Step (1.2.2) API service: An interface that allows communication and data exchange between different software applications. It is the recommended object in service recommendation and is represented by the symbol express.
[0017] Step (1.3) constructs an interaction sequence set, obtains the interaction information between the user and the service at a timestamp from the service data set, and forms an interaction sequence. The process is:
[0018] Step (1.3.1) constructs the interaction sequence, using the symbol express;
[0019] Step (1.3.2) traverses the service data set, user and Services If there is interaction between them, the service Put in middle;
[0020] Step (1.4) sorts the interaction sequences by timestamp to form an interaction sequence set. The process is:
[0021] Step (1.4.1) constructs the set of interaction sequences, using the symbol express;
[0022] Step (1.4.2) All interaction sequences are arranged in chronological order to obtain an interaction sequence set;
[0023] Step (1.5) constructs a service network diagram and converts the interaction sequence set into a service network diagram through the dual tower model.
[0024] Preferably, in step (1.5), the construction process of the service network diagram is as follows:
[0025] Step (1.5.1) defines the service network diagram, using the symbol express, The node set of express, The edge set of The adjacency matrix is represented by express;
[0026] Step (1.5.2) replaces step (1.3.2) Convert to Node ;
[0027] Step (1.5.3) inputs the API service node into the dual-tower model for feature learning and uses multi-head weighted cosine similarity to calculate the similarity between services, and then constructs a service network graph based on the similarity.
[0028] The process of step (1.5.3) is:
[0029] Step (1.5.3.1) uses one-hot encoding to convert any two API service nodes into embedding vectors and ,One-hot encoding is an encoding method that converts categorical variables into numerical format;
[0030] Step (1.5.3.2) encodes the description document and label information of the API service in the interaction sequence.
[0031] Step (1.5.3.3) combines the API service embedding vector and the semantic vector to obtain a service vector containing semantic information. The process is described by the formula Indicates, symbol represents the fusion function, which combines two features into a single representation using a weighted sum method. And Symbol These are all fusion function parameters.
[0032] Step (1.5.3.4) uses weighted cosine similarity to measure the similarity between two embedding vectors and assigns the result to , the process is expressed as Indicates, symbol Represents the use of cosine similarity measurement method, symbol Represents a learnable weight vector, symbol Stands for Hadamard product. Weighted cosine similarity is a method to measure the similarity between two vectors. It adds the concept of weights to cosine similarity to better reflect the importance of different features.
[0033] Step (1.5.3.5) is repeated The weighted cosine metric function is extended to a multi-head weighted cosine similarity metric, and the similarity metric function is used to calculate independent similarity matrices, and then take the average value as the final similarity of the two embedding vectors, and assign the result to , the process is expressed as and Indicates, symbol Representative The similarity of similar matrices, symbol Representative The learnable weight vector of similarity matrices, symbol Represents the total number of heads for multi-head expansion. Each head captures different semantic information. The multi-head weighted cosine similarity metric refers to calculating the weighted cosine similarity between vectors in multiple different dimensions.
[0034] Step (1.5.3.6) adds two API service nodes with similarity in step (1.5.3.5) and Connect an edge between them, using the symbol Indicates that the initial service network diagram is constructed In addition, set the adjacency matrix Elements 1, for two API service nodes that have no edge connection and , then the adjacency matrix Set to 0;
[0035] Step (1.5.3.7) Utilization - Sparsity Perform sparsification to ensure that the graph convolution is performed on the most relevant aspects of the graph, and then construct the sparse service network graph .
[0036] More preferably, the process of (1.5.3.2) is:
[0037] Step (1.5.3.2.1) The description document of the API service is a document used to record the functions, features and interface information of the service;
[0038] Step (1.5.3.2.2) The service label is a short text used to identify the service function type;
[0039] Step (1.5.3.2.3) segment the description documents and tag information of any two API services and remove stop words;
[0040] Step (1.5.3.2.4) uses the BERT (Bidirectional Encoder Representations from Transformers) model to encode the description documents and label information of the two processed API services to obtain semantic vectors and ,The BERT model is a natural language processing model;
[0041] The process of the step (1.5.3.7) is:
[0042] Steps (1.5.3.7.1) - Sparsity is a model compression technique that discards samples smaller than a threshold. The elements of the adjacency matrix Become sparse, thereby improving the running efficiency of the model;
[0043] Step (1.5.3.7.2) is from step (1.5.3.5) Extract the symmetric sparse non-negative adjacency matrix from and assign the result to , the process is expressed as Indicates, symbol represent Middle Line Elements of the column, symbols Represents the return similarity matrix Ranked Large value, symbol Represents the number of service nodes, symbol is a square operation, symbol control The overall sparsity of .
[0044] Furthermore, the process of step 2 is as follows:
[0045] Step (2.1) Design a two-level perceptual self-attention mechanism in the graph convolutional network;
[0046] Step (2.2) adjusts the weight of the service embedding vector in information aggregation according to the two-level perceptual self-attention mechanism, and updates the embedding representation through graph convolution operations.
[0047] Preferably, the design process of the two-level perceptual self-attention mechanism in step (2.1) is as follows:
[0048] Step (2.1.1) The dual-level perceptual self-attention mechanism includes a cluster-perceptual self-attention mechanism and a query-perceptual self-attention mechanism;
[0049] Step (2.1.2) designs a cluster-aware self-attention mechanism. The process is as follows:
[0050] Step (2.1.2.1) assumes that the target node Form a cluster for the expected median value and The hop neighbors are used as the receptive field of the cluster. Get the target node The normalized activity level of , the process is expressed as Indicates, symbol Represents the total number of first-order neighbors of all nodes, symbol Representative Node The first-order neighbor set of Represents the node For other nodes outside, the expected median is the pre-assumed central value in each cluster. The activity of a node refers to the frequency of interaction between the node and the user. Normalization is a data processing technology that aims to convert data with different characteristics into a unified standard to facilitate subsequent analysis and processing;
[0051] Step (2.1.2.2) uses the k-medoids algorithm to obtain the center point of each cluster. The process is as follows:
[0052] Step (2.1.2.2.1) Randomly select from API service embeddings The node embedding is used as the initial cluster center, and k-medoids is a commonly used clustering analysis method;
[0053] Step (2.1.2.2.2) calculates the embedding of each API service node To the center of each cluster The Euclidean distance of , the process is expressed as Indicates, symbol The representative node is the center of the cluster, and the symbol n represents the total number of API service node embeddings;
[0054] Step (2.1.2.2.3) is based on step (2.1.2.2.2) Assign each API service node to its nearest cluster;
[0055] Step (2.1.2.2.4) calculates the overall deviation and assigns the result to , the process is expressed as Indicates, symbol represents the total number of clusters, symbol Representative The node embedding set of each cluster;
[0056] Step (2.1.2.2.5) Repeat steps (2.1.2.2.1) - step (2.1.2.2.4) until the end of step (2.1.2.2.4) No longer changing;
[0057] Step (2.1.2.2.6) calculates the API service cluster-aware self-attention weights, and the normalized user activity is calculated in a non-destructive way, and the result is assigned to , the process is expressed as Indicates, symbol , and represents the learnable weight matrix, represent The transpose of is the scaling factor to avoid the inner product being too large. is an activation function. The non-destructive method is to use only The influence coefficient will not affect and , more efficient modeling is achieved by controlling the information source of the self-attention component.
[0058] Step (2.1.3) designs a query-aware self-attention mechanism. The process of the query-aware self-attention mechanism is as follows:
[0059] Step (2.1.3.1) User The embedding vector of the API service query is symbolized by Indicates that the superscript Indicates that the current service vector is the user's query vector;
[0060] Step (2.1.3.2) User query service embedding according to time order is represented by symbol express, Represents the length of time;
[0061] Step (2.1.3.3) Calculation Attention scores at different times, assign the results to , the process is expressed as Indicates, symbol and is a trainable time parameter, Representatives will Transpose, symbol Represents the query representation dimension, is the square root operation, It is a A two-layer feedforward neural network with activation function;
[0062] Step (2.1.3.4) calculates the attention weights in the API service node aggregation in a non-destructive way and assigns the results to , the process is expressed as Indicates, symbol , and represents the learnable weight matrix, is the scaling factor to avoid the inner product being too large. represents the source node, represents the target node, is an activation function. The non-destructive method is to use only and The influence coefficient will not affect , more efficient modeling is achieved by controlling the information source of the self-attention component.
[0063] The embedding update process of step (2.2) is as follows:
[0064] Step (2.2.1) calculates the attention weight of the service node embedding update according to the two-level perception self-attention mechanism, and assigns the result to , the process is expressed as Indicates, symbol Represents balance and The balance coefficient of the proportion;
[0065] Step (2.2.2) Embed the API service node into the matrix Enter the Layer, Symbol represents the number of node embeddings, is a mathematical symbol that indicates a relationship of belonging to, Representatives include The set of dimensional real vectors, is the embedding size of the node;
[0066] Step (2.2.3) calculates The service embedding representation of the layer is assigned to , the process is expressed as Indicates, symbol Representative Node The neighbor node set of , ∑ is a summation symbol, represent A neighbor node of .
[0067] Furthermore, the process of step 3 is as follows:
[0068] Step (3.1) obtains the heterogeneous API service node embedding matrix. The process is:
[0069] Step (3.1.1) divides the node embedding matrix into F sub-matrices according to the API service node type. The class node embedding matrix is expressed as ,symbol Represents the total number of embeddings of this type of nodes;
[0070] Step (3.1.2) learns each type of node embedding in the graph pooling layer and assigns the result to , the process is expressed as Indicates, symbol Representative The pooling matrix of the node type, symbol Represents the parameter set of the pooling GNN, symbol Indicates that the current operation is graph pooling;
[0071] Step (3.1.3) replaces the Compress to obtain the summary matrix and assign the result to , the process is expressed as Indicates, symbol and are all learnable parameters, is an activation function;
[0072] Step (3.1.4) Zero padding technique is used to obtain the aligned service node embedding pooling matrix ,Zero-padding technique refers to adding zero elements at the edge of the data to keep the embedding dimension of the summary matrix stable;
[0073] Step (3.1.5) proposes a node embedding aggregator to perform node embedding aggregation and assign the result to , the process is expressed as Then, the various node embedding matrices are concatenated to obtain the complete node embedding matrix ,symbol Indicates that the current operation is splicing, symbol Representative step (3.1.4) The transpose of represents the total number of node embeddings after pooling, with the superscript Indicates that the current node embedding matrix is a matrix that has undergone heterogeneous pooling;
[0074] Step (3.2) uses the global graph content attribute extraction technology 2GCont (Global Graph Content) and the cross-attention mechanism CAMe (Cross-Attention Mechanism) to coarsen the graph. The graph coarsening process is as follows:
[0075] Step (3.2.1) calculates the global graph content matrix and assigns the result to , the process is expressed as Indicates, symbol represents the parameterized weight matrix;
[0076] Step (3.2.2) calculates the cross attention mechanism and assigns the result to , the process is expressed as Indicates, symbol represents a trainable shared attention parameter, symbol Represents the dimension before coarsening The service node is embedded, Represents the dimension after coarsening Service clustering embedding, Represents a splicing operation;
[0077] Step (3.2.3) Normalize and assign the result to , the process is expressed as Indicates, symbol is the natural exponential operation, symbol Representative All elements of the row, symbols represent No. The number of columns in the row;
[0078] Step (3.3) uses the pooled service node embedding matrix Generate the service cluster embedding of the coarsened graph and assign the result to , the process is given by the formula Indicates, symbol Represents the number of layers of the final graph convolution, symbol represents the number of service cluster embeddings, symbol Cross-attention mechanism in the representative step (3.2.2) The transpose of
[0079] Step (3.4) uses the service node score before coarsening Generate the service clustering score of the coarsened graph and assign the result to , the process is expressed as Indicates, symbol Cross-attention mechanism in the representative step (3.2.2) The transpose of is the application The service node obtained Importance score.
[0080] The process of step 4 is as follows:
[0081] Step (4.1) The focal service is a densely connected service in the service network diagram, representing the main needs of users;
[0082] Step (4.2) captures the user's dynamically changing focus service under the multi-head self-attention mechanism;
[0083] Step (4.3) uses the average function to calculate the average node embedding of all service nodes after the forward calculation of the propagation layer to generate the service network graph before pooling The graph-level representation of , the process is expressed as Indicates, symbol represents the average function;
[0084] Step (4.4) predicts the probability of the user interacting with the target service and makes recommendations.
[0085] Preferably, the process of step (4.2) is:
[0086] Step (4.2.1) The multi-head self-attention mechanism is a variant of the self-attention mechanism, which can extract information from different subspaces at different positions;
[0087] Step (4.2.2) embeds the clustering matrix obtained in step (3.3) using the symbol Indicates that ,symbol Representative Service cluster embedding;
[0088] Step (4.2.3) captures the dynamically changing focus service and assigns the result to , the process is expressed as Indicates, symbol Represents the total number of long positions, symbol Represents the splicing operation, symbol Representatives from The embedding representation learned in each head is expressed by the formula Indicates, symbol , , and All are learnable parameters, attention mechanism By scaling the dot product and Function implementation.
[0089] More preferably, the process of step (4.4) is:
[0090] Step (4.4.1) will , Embedded with target service The combined embedding vector is concatenated and then the combined embedding representation is learned through the fully connected layer to obtain the probability of user interaction with the API service. The result is assigned to , the process is expressed as express, For splicing symbols, symbols is the Hadamard product, represents the prediction function with a two-layer feed-forward neural network;
[0091] Step (4.4.2) constructs the Bayesian loss function training model and assigns the loss function result to , the process is expressed as Indicates, symbol Representative User The set of interaction sequences, symbol represents a positive sample, indicating that the user has interacted with the service. represents that the user has not interacted with the service, the symbol log represents logarithmic operation, and the symbol represent Function, symbol Represented by Parameterized Regularizer, whose function is to prevent overfitting problems in the model learning process. Bayesian loss function is a function used to measure the difference between the predicted results and the actual results.
[0092] The beneficial effects of the present invention are mainly manifested in:
[0093] 1. For massive API service data, we learn service embedding expressions in the dual-tower model, and use multi-head weighted cosine similarity to measure the semantic similarity between API services from multiple dimensions, effectively improving the construction quality of the service network graph;
[0094] 2. Design a two-level perceptual self-attention mechanism in the graph convolutional network to constrain the amount of information transmitted between service nodes, maximize the use of important information, and improve the quality of service embedding aggregation;
[0095] 3. By utilizing the graph pooling operation with heterogeneous graph coarsening as the core, different categories of service information are learned in the pooling layer respectively, realizing the optimization of 2GCont, thereby better capturing the high-order associations between services and improving the accuracy of service recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0096] Figure 1 Flowchart of the web service recommendation method based on graph attention convolutional network and graph pooling. DETAILED DESCRIPTION
[0097] The present invention will be further described below in conjunction with the accompanying drawings.
[0098] Reference Figure 1 , a Web service recommendation method based on graph attention convolutional network and graph pooling, comprising the following steps:
[0099] Step 1: Create a service data set, obtain service interaction data, and use the dual-tower model to build a service network diagram. The process is as follows:
[0100] Step (1.1) The dual-tower model is a deep learning framework whose basic idea is to learn two different data features from two towers respectively, and then measure the similarity between the two input data;
[0101] Step (1.2) creates a service data set, crawls user information and API services from relevant websites, analyzes and organizes the collected results, and obtains a service data set;
[0102] In the step (1.2), the service data set includes the following information:
[0103] Step (1.2.1) User: The developer who calls the API service, using the symbol express;
[0104] Step (1.2.2) API service: An interface that allows communication and data exchange between different software applications. It is the recommended object in service recommendation and is represented by the symbol express.
[0105] Step (1.3) constructs an interaction sequence set, obtains the interaction information between the user and the service at a timestamp from the service dataset, and forms an interaction sequence;
[0106] The process of step (1.3) is as follows:
[0107] Step (1.3.1) constructs the interaction sequence, using the symbol express;
[0108] Step (1.3.2) traverses the service data set, user and Services If there is interaction between them, the service Put in middle;
[0109] Step (1.4) sorts the interaction sequences by timestamp to form an interaction sequence set;
[0110] The process of step (1.4) is as follows:
[0111] Step (1.4.1) constructs the set of interaction sequences, using the symbol express;
[0112] Step (1.4.2) All interaction sequences are arranged in chronological order to obtain an interaction sequence set;
[0113] Step (1.5) constructs a service network diagram, converting the interaction sequence set into a service network diagram through the two-tower model;
[0114] In the step (1.5), the construction process of the service network diagram is as follows:
[0115] Step (1.5.1) defines the service network diagram, using the symbol express, The node set of express, The edge set of The adjacency matrix is represented by express;
[0116] Step (1.5.2) replaces step (1.3.2) Convert to Node ;
[0117] Step (1.5.3) Input the API service node into the dual-tower model for feature learning and use multi-head weighted cosine similarity to calculate the similarity between services, and then build a service network graph based on the similarity;
[0118] The process of the step (1.5.3) is as follows:
[0119] Step (1.5.3.1) uses one-hot encoding to convert any two API service nodes into embedding vectors and , the one-hot encoding is an encoding method that converts categorical variables into numerical format;
[0120] Step (1.5.3.2) encodes the description document and label information of the API service in the interaction sequence.
[0121] Furthermore, the process of (1.5.3.2) is:
[0122] Step (1.5.3.2.1) The description document of the API service is a document used to record the functions, features and interface information of the service;
[0123] Step (1.5.3.2.2) The service label is a short text used to identify the service function type;
[0124] Step (1.5.3.2.3) segment the description documents and tag information of any two API services and remove stop words;
[0125] Step (1.5.3.2.4) uses the BERT (Bidirectional Encoder Representations from Transformers) model to encode the description documents and label information of the two processed API services to obtain semantic vectors and ,The BERT model is a natural language processing model;
[0126] Step (1.5.3.3) combines the API service embedding vector and the semantic vector to obtain a service vector containing semantic information. , the process is expressed as Indicates, symbol represents the fusion function, which combines two features into a single representation using a weighted sum method. And Symbol These are all fusion function parameters.
[0127] Step (1.5.3.4) uses weighted cosine similarity to measure the similarity between two embedding vectors and assigns the result to , the process is expressed as Indicates, symbol Represents the use of cosine similarity measurement method, symbol Represents a learnable weight vector, symbol Stands for Hadamard product. Weighted cosine similarity is a method to measure the similarity between two vectors. It adds the concept of weights to cosine similarity to better reflect the importance of different features.
[0128] Step (1.5.3.5) is repeated The weighted cosine metric function is extended to a multi-head weighted cosine similarity metric, and the similarity metric function is used to calculate independent similarity matrices, and then take the average value as the final similarity of the two embedding vectors, and assign the result to , the process is expressed as and Indicates, symbol Representative The similarity of similar matrices, symbol Representative The learnable weight vector of similarity matrices, symbol Represents the total number of heads for multi-head expansion. Each head captures different semantic information. The multi-head weighted cosine similarity metric refers to calculating the weighted cosine similarity between vectors in multiple different dimensions.
[0129] Step (1.5.3.6) adds two API service nodes with similarity in step (1.5.3.5) and Connect an edge between them, using the symbol Indicates that the initial service network diagram is constructed In addition, set the adjacency matrix Elements 1, for two API service nodes that have no edge connection and , then the adjacency matrix Set to 0;
[0130] Step (1.5.3.7) Utilization - Sparsity Perform sparsification to ensure that the graph convolution is performed on the most relevant aspects of the graph, and then construct the sparse service network graph ;
[0131] The process of the step (1.5.3.7) is:
[0132] Steps (1.5.3.7.1) - Sparsity is a model compression technique that discards samples smaller than a threshold. The elements of the adjacency matrix Become sparse, thereby improving the running efficiency of the model;
[0133] Step (1.5.3.7.2) is from step (1.5.3.5) Extract the symmetric sparse non-negative adjacency matrix from and assign the result to , the process is expressed as Indicates, symbol represent Middle Line Elements of the column, symbols Represents the return similarity matrix Ranked Large value, symbol Represents the number of service nodes, symbol is a square operation, symbol control The overall sparsity of .
[0134] Step 2: Based on the graph structure in the service network graph, a two-level perception self-attention mechanism is designed to aggregate service embedding vectors, and a graph convolutional network is used to extract service features. The process is as follows:
[0135] Step (2.1) designs a two-level perceptual self-attention mechanism in the graph convolutional network. The design process is as follows:
[0136] Step (2.1.1) The dual-level perceptual self-attention mechanism includes a cluster-perceptual self-attention mechanism and a query-perceptual self-attention mechanism;
[0137] Step (2.1.2) designs a cluster-aware self-attention mechanism. The process is as follows:
[0138] Step (2.1.2.1) assumes that the target node Form a cluster for the expected median value and The hop neighbors are used as the receptive field of the cluster. Get the target node The normalized activity level of , the process is expressed as Indicates, symbol Represents the total number of first-order neighbors of all nodes, symbol Representative Node The first-order neighbor set of Represents the node For other nodes outside, the expected median is the pre-assumed central value in each cluster. The activity of a node refers to the frequency of interaction between the node and the user. Normalization is a data processing technology that aims to convert data with different characteristics into a unified standard to facilitate subsequent analysis and processing;
[0139] Step (2.1.2.2) uses the k-medoids algorithm to obtain the center point of each cluster. The process is:
[0140] Step (2.1.2.2.1) Randomly select from API service embeddings The node embedding is used as the initial cluster center, and k-medoids is a commonly used clustering analysis method;
[0141] Step (2.1.2.2.2) calculates the embedding of each API service node To the center of each cluster The Euclidean distance of , the process is expressed as Indicates, symbol The representative node is the center of the cluster, and the symbol n represents the total number of API service node embeddings;
[0142] Step (2.1.2.2.3) is based on step (2.1.2.2.2) Assign each API service node to its nearest cluster;
[0143] Step (2.1.2.2.4) calculates the overall deviation and assigns the result to , the process is expressed as Indicates, symbol represents the total number of clusters, symbol Representative The node embedding set of each cluster;
[0144] Step (2.1.2.2.5) Repeat steps (2.1.2.2.1) - step (2.1.2.2.4) until the end of step (2.1.2.2.4) No longer changing;
[0145] Step (2.1.2.2.6) calculates the API service cluster-aware self-attention weights, and the normalized user activity is calculated in a non-destructive way, and the result is assigned to , the process is expressed as Indicates, symbol , and represents the learnable weight matrix, represent The transpose of is the scaling factor to avoid the inner product being too large. is an activation function. The non-destructive method is to use only The influence coefficient will not affect and , more efficient modeling is achieved by controlling the information source of the self-attention component;
[0146] Step (2.1.3) designs a query-aware self-attention mechanism. The process is as follows:
[0147] Step (2.1.3.1) User The embedding vector of the API service query is symbolized by Indicates that the superscript Indicates that the current service vector is the user's query vector;
[0148] Step (2.1.3.2) User query service embedding according to time order is represented by symbol express, Represents the length of time;
[0149] Step (2.1.3.3) Calculation Attention scores at different times, assign the results to , the process is expressed as Indicates, symbol and is a trainable time parameter, Representatives will Transpose, symbol Represents the query representation dimension, is the square root operation, It is a A two-layer feedforward neural network with activation function;
[0150] Step (2.1.3.4) calculates the attention weights in the API service node aggregation in a non-destructive way and assigns the results to , the process is expressed as Indicates, symbol , and represents the learnable weight matrix, is the scaling factor to avoid the inner product being too large. represents the source node, represents the target node, is an activation function. The non-destructive method is to use only and The influence coefficient will not affect , more efficient modeling is achieved by controlling the information source of the self-attention component;
[0151] Step (2.2) adjusts the weight of the service embedding vector in information aggregation according to the two-level perceptual self-attention mechanism, and updates the embedding representation through graph convolution operations. The embedding update process is as follows:
[0152] Step (2.2.1) calculates the attention weight of the service node embedding update according to the two-level perception self-attention mechanism, and assigns the result to , the process is expressed as Indicates, symbol Represents balance and The balance coefficient of the proportion;
[0153] Step (2.2.2) Embed the API service node into the matrix Enter the Layer, Symbol represents the number of node embeddings, is a mathematical symbol that indicates a relationship of belonging to, Representatives include The set of dimensional real vectors, is the embedding size of the node;
[0154] Step (2.2.3) calculates The service embedding representation of the layer is assigned to , the process is expressed as Indicates, symbol Representative Node The neighbor node set of , ∑ is a summation symbol, represent A neighbor node of .
[0155] Step 3: Use graph pooling with heterogeneous node graph coarsening as the core to further extract important service information. Heterogeneous nodes refer to nodes of various types in the service network graph. The process is as follows:
[0156] Step (3.1) obtains the heterogeneous API service node embedding matrix;
[0157] The process of step (3.1) is:
[0158] Step (3.1.1) divides the node embedding matrix into F sub-matrices according to the API service node type. The class node embedding matrix is expressed as ,symbol Represents the total number of embeddings of this type of nodes;
[0159] Step (3.1.2) learns each type of node embedding in the graph pooling layer and assigns the result to , the process is expressed as Indicates, symbol Representative The pooling matrix of the node type, symbol Represents the parameter set of the pooling GNN, symbol Indicates that the current operation is graph pooling;
[0160] Step (3.1.3) replaces the Compress to obtain the summary matrix and assign the result to , the process is expressed as Indicates, symbol and are all learnable parameters, is an activation function;
[0161] Step (3.1.4) Zero padding technique is used to obtain the aligned service node embedding pooling matrix ,Zero-padding technique refers to adding zero elements at the edge of the data to keep the embedding dimension of the summary matrix stable;
[0162] Step (3.1.5) proposes a node embedding aggregator to perform node embedding aggregation and assign the result to , the process is expressed as Then, the various node embedding matrices are concatenated to obtain the complete node embedding matrix ,symbol Indicates that the current operation is splicing, symbol Representative step (3.1.4) The transpose of represents the total number of node embeddings after pooling, with the superscript Indicates that the current node embedding matrix is a matrix that has undergone heterogeneous pooling;
[0163] Step (3.2) uses the global graph content attribute extraction technology 2GCont (Global Graph Content) and the cross-attention mechanism CAMe (Cross-Attention Mechanism) to coarsen the graph. The graph coarsening process is as follows:
[0164] Step (3.2.1) calculates the global graph content matrix and assigns the result to , the process is expressed as Indicates, symbol represents the parameterized weight matrix;
[0165] Step (3.2.2) calculates the cross attention mechanism and assigns the result to , the process is expressed as Indicates, symbol represents a trainable shared attention parameter, symbol Represents the dimension before coarsening The service node is embedded, Represents the dimension after coarsening Service clustering embedding, Represents a splicing operation;
[0166] Step (3.2.3) Normalize and assign the result to , the process is expressed as Indicates, symbol is the natural exponential operation, symbol Representative All elements of the row, symbols represent No. The number of columns in the row;
[0167] Step (3.3) uses the pooled service node embedding matrix Generate the service cluster embedding of the coarsened graph and assign the result to , the process is given by the formula Indicates, symbol Represents the number of layers of the final graph convolution, symbol represents the number of service cluster embeddings, symbol Cross-attention mechanism in the representative step (3.2.2) The transpose of
[0168] Step (3.4) uses the service node score before coarsening Generate the service clustering score of the coarsened graph and assign the result to , the process is expressed as Indicates, symbol Cross-attention mechanism in the representative step (3.2.2) The transpose of is the application The service node obtained Importance score.
[0169] Step 4: Capture the dynamically changing focus service and read out the graph-level representation. The final output embedding is obtained based on the focus service representation and the graph-level representation readout, and then the probability of the target service interacting with the user is obtained. The process is as follows:
[0170] Step (4.1) The focal service is a densely connected service in the service network diagram, representing the main needs of users;
[0171] Step (4.2) captures the user's dynamically changing focus service under the multi-head self-attention mechanism. The process is:
[0172] Step (4.2.1) The multi-head self-attention mechanism is a variant of the self-attention mechanism, which can extract information from different subspaces at different positions;
[0173] Step (4.2.2) embeds the clustering matrix obtained in step (3.3) using the symbol Indicates that ,symbol Representative Service cluster embedding;
[0174] Step (4.2.3) captures the dynamically changing focus service and assigns the result to , the process is expressed as Indicates, symbol Represents the total number of long positions, symbol Represents the splicing operation, symbol Representatives from The embedding representation learned in each head is expressed by the formula Indicates, symbol , , and All are learnable parameters, attention mechanism By scaling the dot product and Function implementation.
[0175] Step (4.3) uses the average function to calculate the average node embedding of all service nodes after the forward calculation of the propagation layer to generate the service network graph before pooling The graph-level representation of , the process is expressed as Indicates, symbol represents the average function;
[0176] Step (4.4) predicts the probability of the user interacting with the target service and makes recommendations. The process is:
[0177] Step (4.4.1) will , Embedded with target service The combined embedding vector is concatenated and then the combined embedding representation is learned through the fully connected layer to obtain the probability of user interaction with the API service. The result is assigned to , the process is expressed as express, For splicing symbols, symbols is the Hadamard product, represents the prediction function with a two-layer feed-forward neural network;
[0178] Step (4.4.2) constructs the Bayesian loss function training model and assigns the loss function result to , the process is expressed as Indicates, symbol Representative User The set of interaction sequences, symbol represents a positive sample, indicating that the user has interacted with the service. represents that the user has not interacted with the service, the symbol log represents logarithmic operation, and the symbol represent Function, symbol Represented by Parameterized Regularizer, whose function is to prevent overfitting problems in the model learning process. Bayesian loss function is a function used to measure the difference between the predicted results and the actual results.
[0179] This embodiment analyzes the actual effect of the invention with specific service data, and the implementation process is as follows:
[0180] Step 1. Select the data from the Programmable Web website from 2019 to 2020 as the experimental data set. The specific information is shown in Table 1.
[0181] Table 1 is the detailed information table of the experimental data set;
[0182] project Statistics Number of users 3102 Number of API services 11930 Number of interaction sequences 6206
[0183] The dataset contains 3102 users, 11930 API service data, and 6206 interaction sequences.
[0184] Step 2: The present invention (GAGP-SR) is compared with the 9 recommended methods:
[0185] PHCF: A hybrid collaborative filtering algorithm considering the impact of user and service personalization is proposed;
[0186] RACF: It performs similarity calculation based on direct comparison of attribute values and compares the attribute values of similar services with the current service to predict unknown values;
[0187] EHR-MF: Mining implicit associations between users and APIs based on joint matrix factorization and cognitive knowledge;
[0188] TC-PR: Personalized recommendation based on time-aware convolutional neural network;
[0189] LightGCN: removes feature transformation and nonlinear activation in GCN and implements embedding learning of users and items by performing linear propagation on the user-item interaction graph;
[0190] GraphRec: Capturing interaction and rating information on user-item interaction graphs based on a novel graph neural network framework;
[0191] Query-SeqRec: Recommendations using heterogeneous user sequences fused with query information and graph-based sequence augmentation;
[0192] FDSA: Adopts ordinary attention mechanism to adaptively select important features of items, and uses deep self-attention network to model the transition patterns of items and feature sequences respectively;
[0193] SASRec: A sequential recommendation model based on self-attention mechanism, identifying relevant items in the user interaction history at each time step for recommendation.
[0194] Step 3: Use HR indicators to evaluate the accuracy of service recommendation results. The calculation method is as follows:
[0195] ;
[0196] Among them, HR represents the accuracy of the recommendation results. Represents the service recommendation result, Represents the actual interaction data between users and API services. The larger the value of the HR indicator, the higher the accuracy of the recommendation. When the length of the service recommendation list is 10 or 20, the HR indicator can be recorded as HR@10 or HR@20.
[0197] Step 4: Use the NDCG indicator to evaluate the relevance of the service recommendation results. The calculation method is as follows:
[0198] ;
[0199] ;
[0200] Among them, NDCG represents the relevance of the recommendation results, DCG represents the weighted sum index of the relevance scores in the recommendation results, Represents the length of the recommendation list, Representative The relevance score of an API service, IDCG represents the ideal DCG. The larger the value of the NDCG indicator, the higher the quality of the ranking result and the more relevant it is to the user's development needs. When the length of the service recommendation list is 10 or 20, the NDCG indicator can be recorded as NDCG@10 or NDCG@20.
[0201] Step 5: Use 70% of the experimental data in the dataset as the training set and the remaining 30% as the test set. The experimental results are shown in Table 2, and the optimal experimental indicators are bolded in Table 2.
[0202] Table 2 shows the experimental results of this embodiment;
[0203]
[0204] From the analysis of Table 2, it can be seen that compared with the above methods, the recommendation results of the present invention are the best. From the perspective of HR and NDCG indicators, the present invention has reached 0.5027, 0.4821, 0.5259 and 0.5198 in HR@10, NDCG@10, HR@20 and NDCG@20 respectively, which are 6.08%, 5.4%, 3.61% and 2.71% higher than the best comparison method in each indicator. Therefore, it can be considered that the present invention has a higher recommendation accuracy.
[0205] This embodiment analyzes the actual effect of the invention with specific service data, and the comparison is explained as follows:
[0206] Step 1: The experimental data set is the same as the implementation plan;
[0207] Step 2: Provide 5 service recommendation methods:
[0208] GAGP-SR: The service recommendation method proposed in this invention;
[0209] w / o DLA: The service recommendation method proposed in this invention removes the two-level perceptual self-attention module;
[0210] w / o CA: The service recommendation method proposed in the present invention removes the cluster-aware self-attention module in the dual-level aware self-attention;
[0211] w / o QA: The service recommendation method proposed in this invention removes the query-aware self-attention module in the dual-level self-attention;
[0212] w / o CPHN: The service recommendation method proposed in the present invention removes the graph pooling module based on the coarsening of heterogeneous node graphs and adopts a differentiable pooling method instead;
[0213] Step 3: The evaluation indicators are HR and NDCG, which are the same as those in the implementation plan;
[0214] Step 4: Use 70% of the experimental data in the dataset as the training set and the remaining 30% as the test set. The experimental results are shown in Table 3.
[0215] Table 3 shows the experimental results of this embodiment;
[0216]
[0217] As can be seen from Table 3, the worst result is obtained by removing the two-level perception self-attention module, which is caused by the introduction of a large amount of noise information due to the indiscriminate embedding of aggregated service nodes. w / o CA and w / o QA improved w / o DLA, and the results obtained by both are similar, proving that they have made great contributions to improving model performance. The results of w / o CPHN are 2.86%, 2.61%, 4.49% and 4.77% lower than the results of the present invention in HR@10, NDCG@10, HR@20 and NDCG@20, respectively. This is because the use of the DiffPool pooling method is not easy to capture the high-order dependencies of important information between nodes, which in turn affects the recommendation performance. In summary, it can be considered that each module of the present invention plays an indispensable role in improving the service recommendation performance.
[0218] The contents described in the embodiments of this specification are merely enumerations of implementation forms of the inventive concept and are for illustrative purposes only. The protection scope of the present invention should not be considered to be limited to the specific forms described in this embodiment, and the protection scope of the present invention also extends to equivalent technical means that can be thought of by ordinary technicians in this field based on the inventive concept.
Claims
1. A Web service recommendation method based on graph attention convolutional network and graph pooling, characterized in that: The method comprises the following steps: Step 1: Create a service data set, obtain service interaction data, and use the dual-tower model to build a service network diagram; Step 2: Based on the graph structure in the service network graph, a two-level perception self-attention mechanism is designed to aggregate service embedding vectors, and a graph convolutional network is used to extract service features; Step 3: Graph pooling with heterogeneous node graph coarsening as the core is used to further extract important service information. Heterogeneous nodes refer to nodes of various types in the service network graph. Step 4: Capture the dynamically changing focus services and read out the graph-level representation. The focus services are densely connected services in the service network graph, representing the main needs of users. The final output embedding is obtained based on the focus service representation and graph-level representation reading, and then the probability of interaction between the target service and the user is obtained; The process of step 1 is as follows: Step (1.1) The dual-tower model is a deep learning framework that learns two different data features from two towers and then measures the similarity between the two input data; Step (1.2) creates a service data set, crawls user information and API services from relevant websites, analyzes and organizes the collected results, and obtains a service data set. The service data set contains the following information: Step (1.2.1) User: Developer who calls API service, using symbol express; Step (1.2.2) API service: An interface that allows communication and data exchange between different software applications. It is the recommended object in service recommendation and is represented by the symbol express; Step (1.3) constructs an interaction sequence set, obtains the interaction information between the user and the service at a timestamp from the service data set, and forms an interaction sequence. The process is: Step (1.3.1) constructs the interaction sequence, using the symbol express; Step (1.3.2) traverses the service data set, user and Services If there is interaction between them, the service Put in middle; Step (1.4) sorts the interaction sequences by timestamp to form an interaction sequence set. The process is: Step (1.4.1) constructs the set of interaction sequences, using the symbol express; Step (1.4.2) All interaction sequences are arranged in chronological order to obtain an interaction sequence set; Step (1.5) constructs a service network diagram, and converts the interaction sequence set into a service network diagram through the dual-tower model; In step (1.5), the construction process of the service network diagram is as follows: Step (1.5.1) defines the service network diagram, using the symbol express, The node set of express, The edge set of The adjacency matrix is represented by express; Step (1.5.2) replaces step (1.3.2) Convert to Node ; Step (1.5.3) Input the API service node into the dual-tower model for feature learning and use multi-head weighted cosine similarity to calculate the similarity between services, and then build a service network graph based on the similarity; The process of step 2 is as follows: Step (2.1) designs a two-level perceptual self-attention mechanism in the graph convolutional network. The design process of the two-level perceptual self-attention mechanism is as follows: Step (2.1.1) The dual-level perceptual self-attention mechanism includes a cluster-perceptual self-attention mechanism and a query-perceptual self-attention mechanism; Step (2.1.2) designs a cluster-aware self-attention mechanism. The process is as follows: Step (2.1.2.1) assumes that the target node Form a cluster for the expected median value and The hop neighbor is used as the acceptance domain of the cluster to obtain the target node The normalized activity level of , the process is expressed as Indicates, symbol Represents the total number of first-order neighbors of all nodes, symbol Representative Node The first-order neighbor set of Represents the node For other nodes outside, the expected median is the pre-assumed central value in each cluster. The activity of a node refers to the frequency of interaction between the node and the user. Normalization is a data processing technology that aims to convert data with different characteristics into a unified standard to facilitate subsequent analysis and processing; Step (2.1.2.2) Utilization k-medoids The algorithm obtains the center point of each cluster, the process is: Step (2.1.2.2.1) Randomly select from API service embeddings Node embeddings are used as initial cluster centers; Step (2.1.2.2.2) calculates the embedding vector for each API service node To the center of each cluster The Euclidean distance of , the process is expressed as Indicates, symbol The node represents the center of the cluster, symbol n Represents the total number of API service node embeddings; Step (2.1.2.2.3) is based on step (2.1.2.2.2) Assign each API service node to its nearest cluster; Step (2.1.2.2.4) calculates the overall deviation and assigns the result to , the process is expressed as Indicates, symbol represents the total number of clusters, symbol Representative The node embedding set of each cluster; Step (2.1.2.2.5) Repeat steps (2.1.2.2.1) - step (2.1.2.2.4) until the end of step (2.1.2.2.4) No longer changing; Step (2.1.2.2.6) calculates the API service cluster-aware self-attention weights, and the normalized user activity is calculated in a non-destructive way, and the result is assigned to , the process is expressed as Indicates, symbol , and represents the learnable weight matrix, represent The transpose of is the scaling factor to avoid the inner product being too large. is an activation function. The non-destructive method is to use only The influence coefficient will not affect and , more efficient modeling is achieved by controlling the information source of the self-attention component; Step (2.1.3) designs a query-aware self-attention mechanism. The process of the query-aware self-attention mechanism is as follows: Step (2.1.3.1) User The embedding vector of the API service query is symbolized by Indicates that the superscript Indicates that the current service vector is the user's query vector; Step (2.1.3.2) User query service embedding according to time order is represented by symbol express, Represents the length of time; Step (2.1.3.3) Calculation Attention scores at different times, assign the results to , the process is expressed as Indicates, symbol and is a trainable time parameter, Representatives will Transpose, symbol Represents the query representation dimension, is the square root operation, It is a A two-layer feedforward neural network with activation function; Step (2.1.3.4) calculates the attention weights in the API service node aggregation in a non-destructive way and assigns the results to , the process is expressed as Indicates, symbol , and represents the learnable weight matrix, is the scaling factor to avoid the inner product being too large. represents the source node, represents the target node, is an activation function. The non-destructive method is to use only and The influence coefficient will not affect , more efficient modeling is achieved by controlling the information source of the self-attention component.
2. The Web service recommendation method based on graph attention convolutional network and graph pooling as claimed in claim 1, characterized in that: The process of step (1.5.3) is: Step (1.5.3.1) uses one-hot encoding to convert any two API service nodes into embedding vectors and , the one-hot encoding is an encoding method that converts categorical variables into numerical format; Step (1.5.3.2) encodes the description document and label information of the API service in the interaction sequence; Step (1.5.3.3) combines the API service embedding vector and the semantic vector to obtain a service vector containing semantic information. , the process is expressed as Indicates, symbol represents the fusion function, which combines two features into a single representation using a weighted sum method. Semantic vector representing API service, symbol and Symbol All are fusion function parameters; Step (1.5.3.4) uses weighted cosine similarity to measure the similarity between two embedding vectors and assigns the result to , the process is expressed as Indicates, symbol Represents the use of cosine similarity measurement method, symbol Represents a learnable weight vector, symbol Stands for Hadamard product. Weighted cosine similarity is a method to measure the similarity between two vectors. It adds the concept of weights to cosine similarity to better reflect the importance of different features. Step (1.5.3.5) is repeated The weighted cosine metric function is extended to a multi-head weighted cosine similarity metric, and the similarity metric function is used to calculate independent similarity matrices, and then take the average value as the final similarity of the two embedding vectors, and assign the result to , the process is expressed as and Indicates, symbol Representative The similarity of similar matrices, symbol Representative The learnable weight vector of similarity matrices, symbol Represents the total number of heads for multi-head expansion. Each head captures different semantic information. The multi-head weighted cosine similarity metric refers to calculating the weighted cosine similarity between vectors in multiple different dimensions. Step (1.5.3.6) adds two API service nodes with similarity in step (1.5.3.5) and Connect an edge between them, using the symbol Indicates that the initial service network diagram is constructed In addition, set the adjacency matrix Elements 1, for two API service nodes that have no edge connection and , then the adjacency matrix Set to 0; Step (1.5.3.7) Utilization - Sparsity Perform sparsification to ensure that the graph convolution is performed on the most relevant aspects of the graph, and then construct the sparse service network graph .
3. The Web service recommendation method based on graph attention convolutional network and graph pooling as claimed in claim 2, characterized in that: The process described (1.5.3.2) is: Step (1.5.3.2.1) The description document of the API service is a document used to record the functions, features and interface information of the service; Step (1.5.3.2.2) The service label is a short text used to identify the service function type; Step (1.5.3.2.3) segment the description documents and tag information of any two API services and remove stop words; Step (1.5.3.2.4) uses the BERT model to encode the description documents and label information of the two processed API services to obtain semantic vectors and ; The process of the step (1.5.3.7) is: Steps (1.5.3.7.1) - Sparsity is a model compression technique that discards samples smaller than a threshold. The elements of the adjacency matrix Become sparse, thereby improving the running efficiency of the model; Step (1.5.3.7.2) is from step (1.5.3.5) Extract the symmetric sparse non-negative adjacency matrix from and assign the result to , the process is expressed as Indicates, symbol represent Middle Line Elements of the column, symbols Represents the return similarity matrix Ranked Large value, symbol Represents the number of service nodes, symbol is a square operation, symbol control The overall sparsity of .
4. The Web service recommendation method based on graph attention convolutional network and graph pooling according to any one of claims 1 to 3, characterized in that: The process of step 2 also includes: Step (2.2) adjusts the weight of the service embedding vector in information aggregation according to the two-level perceptual self-attention mechanism, and updates the embedding representation through graph convolution operations.
5. The Web service recommendation method based on graph attention convolutional network and graph pooling as claimed in claim 4, characterized in that: The embedding update process of step (2.2) is as follows: Step (2.2.1) calculates the attention weight of the service node embedding update according to the two-level perception self-attention mechanism, and assigns the result to , the process is expressed as Indicates, symbol Represents balance and The balance coefficient of the proportion; Step (2.2.2) Embed the API service node into the matrix Enter the Layer, Symbol n represents the number of node embeddings, is a mathematical symbol that indicates a relationship of belonging to, Representatives include The set of dimensional real vectors, is the embedding size of the node; Step (2.2.3) calculates The service embedding representation of the layer is assigned to , the process is expressed as Indicates, symbol Representative Node The neighbor node set of , ∑ is a summation symbol, represent A neighbor node of .
6. The Web service recommendation method based on graph attention convolutional network and graph pooling as claimed in claim 1, characterized in that: The process of step 3 is as follows: Step (3.1) obtains the heterogeneous API service node embedding matrix. The process is: Step (3.1.1) divides the node embedding matrix into F sub-matrix, The class node embedding matrix is expressed as ,symbol Represents the total number of embeddings of this type of nodes; Step (3.1.2) learns each type of node embedding in the graph pooling layer and assigns the result to , the process is expressed as Indicates, symbol Representative The pooling matrix of the node type, symbol Represents the parameter set of the pooling GNN, symbol Indicates that the current operation is graph pooling; Step (3.1.3) replaces the Compress to obtain the summary matrix and assign the result to , the process is expressed as Indicates, symbol and are all learnable parameters, is an activation function; Step (3.1.4) Zero padding technique is used to obtain the aligned service node embedding pooling matrix ,Zero-padding technique refers to adding zero elements at the edge of the data to keep the embedding dimension of the summary matrix stable; Step (3.1.5) proposes a node embedding aggregator to perform node embedding aggregation and assign the result to , the process is expressed as Then, various node embedding matrices are concatenated to obtain the complete node embedding matrix ,symbol Indicates that the current operation is splicing, symbol Representative step (3.1.4) The transpose of represents the total number of node embeddings after pooling, with the superscript Indicates that the current node embedding matrix is a matrix that has undergone heterogeneous pooling; Step (3.2) uses the global graph content attribute extraction technology 2GCont and the cross attention mechanism CAMe to coarsen the graph. The graph coarsening process is as follows: Step (3.2.1) calculates the global graph content matrix and assigns the result to , the process is expressed as Indicates, symbol represents the parameterized weight matrix; Step (3.2.2) calculates the cross attention mechanism and assigns the result to , the process is expressed as Indicates, symbol represents a trainable shared attention parameter, symbol Represents the dimension before coarsening The service node is embedded, Represents the dimension after coarsening Service clustering embedding, Represents a splicing operation; Step (3.2.3) Normalize and assign the result to , the process is expressed as Indicates, symbol is the natural exponential operation, symbol Representative All elements of the row, symbols represent No. The number of columns in the row; Step (3.3) uses the pooled service node embedding matrix Generate the service cluster embedding of the coarsened graph and assign the result to , the process is given by the formula Indicates, symbol Represents the number of layers of the final graph convolution, symbol m represents the number of service cluster embeddings, symbol Cross-attention mechanism in the representative step (3.2.2) The transpose of Step (3.4) uses the service node score before coarsening Generate the service clustering score of the coarsened graph and assign the result to , the process is expressed as Indicates, symbol Cross-attention mechanism in the representative step (3.2.2) The transpose of is the application The service node obtained Importance score.
7. The Web service recommendation method based on graph attention convolutional network and graph pooling as claimed in claim 6, characterized in that: The process of step 4 is as follows: Step (4.1) The focal service is a densely connected service in the service network diagram, representing the main needs of users; Step (4.2) captures the user's dynamically changing focus service under the multi-head self-attention mechanism. The process is: Step (4.2.1) The multi-head self-attention mechanism is a variant of the self-attention mechanism, which can extract information from different subspaces at different positions; Step (4.2.2) embeds the clustering matrix obtained in step (3.3) using the symbol Indicates that ,symbol Representative Service cluster embedding; Step (4.2.3) captures the dynamically changing focus service and assigns the result to , the process is expressed as Indicates, symbol Represents the total number of long positions, symbol Represents the splicing operation, symbol Representatives from The embedding representation learned in each head is expressed by the formula Indicates, symbol , , and All are learnable parameters, attention mechanism By scaling the dot product and Function implementation; Step (4.3) uses the average function to calculate the average node embedding of all service nodes after the forward calculation of the propagation layer to generate the service network graph before pooling The graph-level representation of , the process is expressed as Indicates, symbol represents the average function; Step (4.4) predicts the probability of the user interacting with the target service and makes recommendations. The process is: Step (4.4.1) will , Embedded with target service The combined embedding vector is concatenated and then the combined embedding representation is learned through the fully connected layer to obtain the probability of user interaction with the API service. The result is assigned to , the process is expressed as express, For splicing symbols, symbols is the Hadamard product, represents the prediction function with a two-layer feedforward neural network; Step (4.4.2) constructs the Bayesian loss function training model and assigns the loss function result to , the process is expressed as Indicates, symbol Representative User The set of interaction sequences, symbol represents a positive sample, indicating that the user has interacted with the service. represents that the user has not interacted with the service, the symbol log represents logarithmic operation, and the symbol represent Function, symbol Represented by Parameterized Regularizer, whose function is to prevent overfitting problems during model learning.
Citation Information
Patent Citations
Interactive service recommendation method based on double interactive relationships and attention mechanism
CN112486467A
Health service recommendation method and system based on attention and decoupling graph neural network
CN118782260A