Web API recommendation method fusing explicit and implicit network structure features
By fusing explicit and implicit network structure features, and utilizing a two-layer, two-channel graph convolutional neural network, the problem of spurious connections in Web API recommendations is solved, resulting in more accurate API recommendations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING UNIV OF POSTS & TELECOMM
- Filing Date
- 2026-01-04
- Publication Date
- 2026-04-10
AI Technical Summary
Existing Web API recommendation methods suffer from spurious connections, causing network analysis and inference to deviate from the actual operating state and failing to reliably guide API composition.
A two-layer, two-channel graph convolutional neural network is used to fuse explicit and implicit network structure features. Explicit and implicit networks are constructed through semantic encoding and historical call records to learn network features and generate a recommendation list.
It improves the accuracy and reliability of Web API recommendations, ensuring a better match between the recommendation results and the actual API call status.
Smart Images

Figure CN121833015A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of API recommendation technology, specifically to a Web API recommendation method that integrates explicit and implicit network structure features. Background Technology
[0002] Web APIs (Web Application Programming Interfaces) are standardized communication rules used to enable data interaction and function calls between different software systems. Mashups, as a key application form of Web APIs, enable developers to quickly build innovative web application solutions for specific business scenarios through the semantic association and processing of various APIs. Web API recommended methods arose to address how to select appropriate APIs from a large number of service resources to build the required Mashups.
[0003] In existing technologies, the network structure used by Web API recommendation methods has the problem of spurious connections. These spurious links are connected in the topology but cannot establish effective interaction at the actual composition level. As a result, the analysis and reasoning based on this network deviates from the actual running state of real API calls and cannot reliably guide real API composition.
[0004] Therefore, there is an urgent need for a more rationally designed method for recommending Web APIs. Summary of the Invention
[0005] In view of this, this application discloses a Web API recommendation method that integrates explicit and implicit network structure features to solve the above problems; including:
[0006] S1. Obtain the raw data from ProgrammableWeb, clean the raw data, and obtain the cleaned dataset; the raw data includes: Mashup function description, Web API function description, Web API category description, and historical call records of Mashup and Web API.
[0007] S2. Semantically encode the cleaned dataset and process it using the BERT model to obtain vectorized description vectors;
[0008] S3. Calculate the Web text similarity and Web category similarity based on the functional description vector, and fuse them to obtain the comprehensive similarity of the Web API;
[0009] S4. Extract historical call records of Mashup and Web API, and construct a Web API collaboration network as an implicit network; use comprehensive similarity as auxiliary information to construct a Web API complex network as an explicit network.
[0010] S5. A two-layer, two-channel graph convolutional neural network is used to learn implicit network features and explicit network features respectively.
[0011] S6. Integrate explicit and implicit network structure features, combine them with Mashup functional description vectors to generate the final Web API score, and generate a recommendation list based on the Web API score.
[0012] This application provides a Web API recommendation method that integrates explicit and implicit network structure features. By integrating explicit and implicit structural information from the service network, the explicit structural information is represented by a complex network model, with the topology being a mapping transformation of historical interaction records. The implicit structural information transforms historical records into an API-API collaboration network. The semantic compatibility of the explicit network constrains the topological connectivity of the implicit network, while the implicit network, in turn, helps the explicit network decouple historical interaction records from other types of information, thereby facilitating the direct representation and extraction of structural features. A dual-channel, dual-layer graph convolutional neural network is introduced into the recommendation framework to combine explicit and implicit network structural features within the framework. This addresses the problem that a single implicit network intertwined with other information and a single explicit network structure may exhibit spurious connections that fail to interact effectively at the actual combination level. Attached Figure Description
[0013] Figure 1 This is a flowchart illustrating the Web API recommendation method in an embodiment of this application. Detailed Implementation
[0014] To make the objectives, technical solutions, features, and advantages of this application clearer and to enable those skilled in the art to better understand the technical solutions of this application, the following detailed description of this application is provided in conjunction with the accompanying drawings and embodiments.
[0015] This embodiment includes a Web API recommendation method that integrates explicit and implicit network structure features, comprising:
[0016] S1. Obtain the raw data from ProgrammableWeb, clean the raw data, and obtain the cleaned dataset.
[0017] The original data includes: Mashup function descriptions, Web API function descriptions, Web API category descriptions, and historical call records of Mashups and Web APIs; the ProgrammableWeb dataset in this embodiment contains 1647 Web APIs and 2739 Mashups; the cleaning process includes: removing meaningless pause words, removing punctuation marks and other special characters, unifying the capitalization of English text, reducing characters to their basic or original form, and deleting blank and duplicate data; thus obtaining the cleaned dataset.
[0018] S2. Semantically encode the cleaned dataset and process it using the BERT model to obtain vectorized description vectors.
[0019] Specifically, the Mashup functional description, Web API functional description, and Web API category description are used as node features for semantic encoding to obtain the Mashup functional description text. Web API feature description text and Web API category description text .
[0020] For a given description text , This describes the Mashup functionality. To represent the Web API function description, the BERT model is used to extract the embedding information of the Mashup function description text, the Web API function description text, and the Web API category description text, respectively, to obtain the corresponding description vector.
[0021] The input embedding formula for the BERT model is:
[0022]
[0023] in, These represent the vocabulary tag embedding matrix, sentence type embedding matrix, and sentence position encoding matrix, respectively. The Transformer embedded in BERT... Within the layer, the formula for the multi-head attention mechanism is:
[0024]
[0025]
[0026] in, Indicates the first One point of attention, This represents the learnable multi-head attention output transformation matrix. Indicates the first A query matrix with attention heads Indicates the first The key matrix of each attention head. Indicates the first The value matrix of each attention head, Represents the Transformer The hidden layer feature matrix output by the layer. The parameter matrix representing the attention mechanism, Indicates dimension.
[0027] The resulting description vectors include: Mashup feature description vector, Web API feature description vector, and Web API category description vector, with the following formula:
[0028]
[0029]
[0030]
[0031] in, This represents a Mashup feature description vector. Represents a Web API functionality description vector. This represents a WebAPI category description vector.
[0032] S3. Calculate Web text similarity based on functional description vectors. Similarity to Web categories The overall similarity of Web APIs is obtained by merging these similarities. The formula is:
[0033]
[0034]
[0035] in, Representing the eigenvector and Textual similarity or classification similarity between them Indicates category, and This represents the BERT-encoded feature vector of any two web description or classification texts. This indicates the calculation of the vector length. Indicates the overall similarity.
[0036] S4. Extract historical call records of Mashup and Web API to construct a Web API collaboration network as an implicit network; use Web API similarity as auxiliary information to construct a Web API complex network as an explicit network.
[0037] Extract m Mashups With n Web APIs Based on the call records, construct a Mashup-Web API bipartite graph; convert the call records into a Web API collaboration graph, and define the Web API collaboration network as follows. ,in Represents a Web API node. Represents the edge set in a collaborative network. China-Singapore node connection node The probability formula is: ;in, This indicates that the new node connects to the node. The probability, Represents the degree of a node. Indicates the overall similarity. Define the Web API complex network as... ,in Represents a Web API node. This represents the edge set in a collaborative network.
[0038] S5. A two-layer, two-channel graph convolutional neural network is used to learn implicit network features and explicit network features respectively.
[0039] The data from the two networks are processed in parallel dual-channel mode, with each channel containing two layers of graph convolution operations for each graph type. The formula for learning network features is:
[0040]
[0041]
[0042] in, This represents the output features of the second-layer graph convolutional neural network, i.e., the output network features. Represents the normalized adjacency matrix. This represents the output features of the first layer of the graph convolutional neural network. This indicates the initial node characteristics, using the Web API functionality description as the initial node characteristic. and This represents the weight matrix of the two-layer network; the normalized adjacency matrix is extracted from complex networks and cooperative networks, and the formula is:
[0043]
[0044] in, Represents the normalized adjacency matrix. Represents the graph adjacency matrix. Represents the identity matrix. The degree matrix is used to represent the final features of the complex network. Features of collaborative networks That is, explicit network features and implicit network features.
[0045] S6. Integrate explicit and implicit network structure features and combine them with Mashup functional description vectors to obtain the final Web API score, and generate a recommendation list based on the final Web API score.
[0046] The fusion of explicit and implicit network structure features includes: and The comprehensive representation features are obtained by fusing and passing through the output of a multilayer perceptron (MLP). ;Graph features Mapping to the API space yields network features; the Mashup function description vectors are then compared with... Integrate and use Function activation yields the fusion features of the explicit and implicit network structures; the formula is:
[0047]
[0048]
[0049]
[0050] in, To comprehensively represent features, Representing network characteristics, This represents the learnable mapping weight matrix. Indicates the bias term. This represents the fusion characteristics of explicit and implicit network structures, including Mashup textual semantic features, Web API collaborative network topology features, and Web API complex network topology features. This represents a Mashup feature description vector.
[0051] In obtaining the integration features of development needs Then, the Mashup function describes the vector and the fused features. go through Layers, using Activation earns a Web API score:
[0052]
[0053] in, Indicates Web API rating. This represents a Mashup feature description vector. The Web API score represents the fusion characteristics of the explicit and implicit network structures. It is used to quantify the degree of matching between each Web API and the development needs of the target Mashup. Furthermore, a recommendation list is generated based on the ranking of the Web API scores, and Web APIs are pushed based on the recommendation list.
[0054] Furthermore, the aforementioned Web API recommendation method is model-based. The model is pre-trained before use and employs a binary cross-entropy loss function as its loss function, as shown in the formula:
[0055]
[0056] in, Indicates the true label, Indicates the predicted probability. Indicates the number of samples.
[0057] Furthermore, to update the parameters at each layer, a backpropagation algorithm is employed, using a chain rule to iteratively calculate the gradient, obtain gradient information, and optimize the model parameters. To further accelerate training, a mini-batch-based Adam optimization algorithm is used. This method can speed up the convergence of the optimal solution and mitigate the impact of error fluctuations.
[0058] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A Web API recommendation method that integrates explicit and implicit network structure features, characterized in that, include: S1. Obtain the raw data from ProgrammableWeb, clean the raw data, and obtain the cleaned dataset. The raw data includes: Mashup function description, Web API function description, Web API category description, and historical call records of Mashup and Web API; S2. Semantically encode the cleaned dataset and process it using the BERT model to obtain vectorized description vectors; the description vectors include Mashup function description vectors, Web API function description vectors, and Web API classification description vectors; S3. Calculate the Web text similarity and Web category similarity based on the description vectors, and fuse them to obtain the comprehensive similarity of the Web API; S4. Extract historical call records of Mashup and Web API, and construct a Web API collaboration network as an implicit network; use comprehensive similarity as auxiliary information to construct a Web API complex network as an explicit network. S5. A two-layer, two-channel graph convolutional neural network is used to learn implicit network features and explicit network features respectively. S6. Integrate explicit and implicit network structure features, combine them with Mashup functional description vectors to generate the final Web API score, and generate a recommendation list based on the Web API score.
2. The Web API recommendation method integrating explicit and implicit network structure features according to claim 1, characterized in that, The cleaning of the raw data includes: removing meaningless pause words, removing punctuation marks and other special characters, standardizing the case of English text, reducing characters to their basic or original form, and deleting blank and duplicate data.
3. The Web API recommendation method integrating explicit and implicit network structure features according to claim 1, characterized in that, The semantic encoding and BERT model processing includes: semantically encoding the Mashup function description, Web API function description, and Web API classification description as node features to obtain Mashup function description text, Web API function description text, and Web API classification description text; and using the BERT model to extract the embedding information of the Mashup function description text, Web API function description text, and Web API classification description text to obtain the corresponding description vectors.
4. The Web API recommendation method integrating explicit and implicit network structure features according to claim 1, characterized in that, The generation of the Web API collaboration network, as an implicit network, includes: extracting m Mashups. With n Web APIs Based on the call records, construct a Mashup-Web API bipartite graph; convert the call records into a Web API collaboration graph, and define the Web API collaboration network as follows. ,in Represents a Web API node. Represents the edge set in a collaborative network. China-Singapore node connection node The probability formula is: in, This indicates that the new node connects to the node. The probability, Represents the degree of a node. Indicates the overall similarity.
5. The Web API recommendation method integrating explicit and implicit network structure features according to claim 1, characterized in that, The described dual-layer, dual-channel graph convolutional neural network processes data in parallel dual-channel mode, with each channel containing a dual-layer graph convolution operation for each graph type. The formula for learning network features is: in, This represents the output features of the second-layer graph convolutional neural network. Represents the normalized adjacency matrix. This represents the output features of the first layer of the graph convolutional neural network. Indicates the initial node characteristics. and This represents the weight matrix of a two-layer network.
6. The Web API recommendation method integrating explicit and implicit network structure features according to claim 1, characterized in that, The fusion of explicit and implicit network structure features includes: incorporating complex network features Features of collaborative networks The comprehensive representation features are obtained by fusing and passing through the output of a multilayer perceptron (MLP). ;Will Mapping to the API space yields network features; the Mashup feature description vectors are then fused with the network features and used... Function activation yields the fusion features of the explicit and implicit network structures; the formula is: in, To comprehensively represent features, Representing network characteristics, This represents the learnable mapping weight matrix. Indicates the bias term. This represents the fusion characteristics of explicit and implicit network structures. This represents a Mashup feature description vector.
7. The Web API recommendation method integrating explicit and implicit network structure features according to claim 1, characterized in that, The process of generating the final Web API score by combining Mashup feature description vectors includes: processing the fusion features of the Mashup feature description vectors and the explicit / implicit network structure... Layers, using Activation yields a Web API score; the formula is: in, Indicates Web API rating. This represents a Mashup feature description vector. This represents the fusion characteristics of explicit and implicit network structures. This indicates the Web API score.
8. The Web API recommendation method integrating explicit and implicit network structure features according to claim 1, characterized in that, The Web API recommendation method is based on a model. The model is pre-trained before use and uses a binary cross-entropy loss function as the loss function, as shown in the formula: in, Represents the loss function. Indicates the true label, Indicates the predicted probability. Indicates the number of samples.
9. The Web API recommendation method integrating explicit and implicit network structure features according to claim 8, characterized in that, The model employs the backpropagation algorithm, iteratively calculates the gradient using the chain rule, obtains gradient information, and optimizes the model parameters; it also employs the Adam optimization algorithm based on mini-batch processing.