Personalized Recommendation of Mashup Web API Based on Collaborative Filtering and Link Prediction
Through the Mashup Web API personalized recommendation algorithm based on collaborative filtering and link prediction, the problem of how to dynamically select the best user needs among multiple web services is solved, and high accuracy and personalized Web API recommendation is achieved.
Patent Information
- Application Number
- CN201911096185.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-11
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2039-11-11
AI Technical Summary
When faced with a large number of web services, how to dynamically select the service that best meets user needs is an important issue, especially among multiple candidate services with the same or similar functions.
Through the Mashup Web API personalized recommendation algorithm based on collaborative filtering and link prediction, a user social network model is built, link prediction is used to predict similar users of the target user, and combined with the popularity prediction of the Web API, a Web API that meets the needs of the target user is recommended.
This method can effectively improve the accuracy and personalization of Web API recommendations, meet users' diverse functional and non-functional needs, and reduce development costs and speed.
Smart Images

Figure CN110851719B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of recommendation, and specifically recommends web APIs that meet user requirements according to user needs, ensuring the accuracy and personalization of recommendation results. Background Art
[0002] With the rapid development of web services, the number of web services published on the Internet is increasing day by day. Facing a large number of web services, especially when facing multiple candidate services with the same or similar functions, how to dynamically select the service that best meets user needs is an important issue in the field of service discovery. Currently, with the increase in user requirements, a single web service is difficult to meet the requests of multiple functions of users. In order to reconstruct existing web service resources, accelerate the speed of system construction, and reduce the cost of system development, it is necessary to combine multiple existing web services according to their functions, semantics, and logical relationships between them to meet the diversity of user functional and non-functional requirements, such as cost, reputation, reliability, security, privacy, etc. For the above reasons, Mashup, as an application development mode for quickly integrating data, can very quickly integrate information related to a certain theme to meet situational application requirements. Situational Mashup applications require to be constructed relatively quickly, and using open APIs and tools becomes the best choice. Since Mashup development has many advantages, such as accelerating the software development cycle, saving development costs, being easy to build an environment, and being easy to integrate, ordinary users with a certain programming foundation can also carry out application development, which has won the favor of most software development companies and has become the mainstream mode of software development.
[0003] The function of a Web API recommendation system is to quickly select the Web API that best meets user needs and has high quality from a large number of APIs, saving the time for users to search for Web APIs during the development process, so as to quickly and efficiently develop a high-quality software service system. Summary of the Invention
[0004] 1. The personalized recommendation of Mashup Web API based on collaborative filtering and link prediction mainly includes the following five steps:
[0005] A. Mashup clustering: Cluster the mashup according to the mashup description information input by the user, obtain N mashups with a relatively high similarity to the user's mashup description information, and obtain the Web API information included in the N mashups.
[0006] B. User Link Prediction Algorithm: Construct a user social network based on whether users have used the same web APIs and whether they have comments on the same web APIs. Then, obtain M similar users with a high similarity to the target user based on the similarity of the web APIs historically used by the similar users and the target user and the number of web API comments. The specific calculation method is as follows:
[0007]
[0008] Among them, Γ(u 1 ) represents the set of web APIs commented by user u 1 , sim(a i , a j ) represents the similarity between a i and a j , and n represents the number of web APIs used by the user.
[0009] C. Collaborative Filtering Algorithm Based on Link Prediction: After obtaining the global similarity of users through link prediction, the calculation method for the web API to be recommended is as follows:
[0010]
[0011] Among them, sim link (u 1 , u 2 ) represents the global similarity of users, I represents the union of the web APIs used by users u and v, r u,i represents the number of times user u uses i (API), and sim(u, v) represents the similarity of users.
[0012]
[0013] Among them represents the average score of user u for the used web APIs, represents the average score of user v for the used web APIs, represents the score of user v for web API a i , sim(u, v) represents the similarity of users u and v, represents the predicted score of user u for a i .
[0014] D. Web API Popularity Prediction:
[0015]
[0016] Among them, a i represents the web API for which the popularity needs to be calculated, Freq(ai ) represents a i The number of times called, MinValue(a j ) represents the minimum number of times all web APIs are called, MaxValue(a z ) represents the maximum number of times all web APIs are called, represents a i The growth rate of the number of calls over a period of time, Follow(a i ) represents a i The number of followers of, FollowMinValue(a x ) represents the minimum value of followers in web APIs, FollowMaxValue(a y ) represents the maximum value of followers in web APIs. Since the above data changes dynamically, formulas containing the above variables are used to calculate the popularity of web APIs.
[0017] E. Web API Recommendation Algorithm: The formula of the web API obtained by collaborative filtering is added to the corresponding popularity formula according to a ratio to obtain the final recommendation value for each web API, where the value range of λ is 0 to 1.
[0018]
[0019] The present invention has the following significant advantages compared with the prior art:
[0020] 1. Based on whether the user has used or commented on the same API, a social network model of the user is constructed. Similar users of the target user are predicted according to the link prediction of the social network model, and Web APIs that meet the target user are recommended through collaborative filtering.
[0021] 2. Considering the dynamic call changes of Web APIs being mashed up, a popularity model of the API is constructed to predict its future popularity. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is the overall flowchart of the present invention.
[0023] Figure 2 are the recommendation results with the same Mashup requirements, different target users and different target user categories.
[0024] Figure 3 are the recommendation results with the same Mashup requirements, the same target user but different target user types.
[0025] Figure 4 are the recommendation results with the same Mashup requirements, different target users but the same target user type.
[0026] Figure 5 It is a comparison of the results of the recommended metrics of this model algorithm with those of other recommended algorithms of the same type.
[0027] Figure 6 It is the influence of λ on the accuracy, recall rate, and F-measure of this algorithm. Specific implementation manners
[0028] The following will describe the implementation manners of the present invention with reference to the accompanying drawings.
[0029] Figure 1 It is the overall flowchart of the present invention. The specific implementation process of the recommendation algorithm based on collaborative filtering and link prediction is as follows:
[0030] A. Mashup clustering: Cluster the mashups according to the mashup description information input by the user to obtain N mashups with a high similarity to the user's mashup description information, and obtain the Web API information included in the N mashups. As Figure 1 shown.
[0031] B. User link prediction algorithm: Construct a user social network according to whether the user has used the same web API and whether there are comments on the same web API. Then, obtain M similar users with a high similarity to the target user according to the similarity of the web APIs used by the similar users and the target user in history and the number of web API comments. The specific calculation method is as follows:
[0032]
[0033] where Γ(u 1 ) represents the set of web APIs commented by user u 1 , sim(a i , a j ) represents the similarity between a i and a j , and n represents the number of web APIs used by the user.
[0034] C. Collaborative filtering algorithm based on link prediction: After obtaining the global similarity of the user through link prediction, the calculation method for the web API to be recommended is as follows:
[0035]
[0036] where sim link (u 1 , u 2 ) represents the global similarity of the user, I represents the union of the web APIs used by users u and v, ru,i represents the number of times user u uses i (API), and sim(u, v) represents the similarity between users.
[0037]
[0038] Among them represents the average score of user u for the used web APIs, represents the average score of user v for the used web APIs, represents the score of user v for web API a i , sim(u, v) represents the similarity between users u and v, represents predicting the score of user for a i .
[0039] D. Prediction of Web API Popularity:
[0040]
[0041] Among them a i represents the web API for which popularity needs to be calculated, Freq(a i ) represents the number of times a i is called, MinValue(a j ) represents the minimum number of times all web APIs are called, MaxValue(a z ) represents the maximum number of times all web APIs are called, represents the growth rate of the number of calls of a i over a period of time, Follow(a i ) represents the number of followers of a i , FollowMinValue(a x ) represents the minimum value of followers among web APIs, FollowMaxValue(a y ) represents the maximum value of followers among web APIs. Since the above data changes dynamically, a formula containing the above variables is used to calculate the popularity of web APIs.
[0042] E. Web API Recommendation Algorithm: Add the web API formula obtained by collaborative filtering to the corresponding popularity formula in proportion to obtain the final recommendation value for each web API, where the value range of λ is 0 to 1.
[0043]
[0044] According to this algorithm, experiments are conducted when the needs of target users are the same, when target users are different, and when target user types are different, and Figure 2Results; obtained when the target users are the same but the target user types are different Figure 3 Experimental results; obtained when the target users are different but the target user types are the same Figure 4 Results. Figure 5 It is the comparison of this algorithm with other Web API recommendation algorithms of the same type. Figure 6 It is the impact on the corresponding evaluation metrics when dynamically changing λ.
Claims
1. A personalized recommendation method for Mashup Web APIs based on collaborative filtering and link prediction, comprising the following five steps: A. Mashup clustering: Cluster the mashups according to the mashup description information input by the user, obtain N mashups with a relatively high similarity to the user's mashup description information, and obtain the Web API information contained in the N mashups; B. User link prediction algorithm: Construct a user social network based on whether the user has used the same web API and whether there are comments on the same web API. Then, obtain M similar users with a relatively high similarity to the target user according to the similarity of the web APIs historically used by the similar users and the target user and the number of web API comments. The specific calculation method is as follows: where Γ(u 1 ) represents the set of web APIs commented by user u 1 , sim(a i , a j ) represents the similarity between a i and a j , and n represents the number of web APIs used by the user; C. Collaborative filtering algorithm based on link prediction: After obtaining the global similarity of the user through link prediction, the calculation method for the web API to be recommended is as follows: where sim link (u 1 , u 2 ) represents the global similarity of users, I represents the union of web APIs used by users u and v, r u,i represents the number of times user u uses i (API), and sim(u, v) represents the similarity of users; Among them represents the average score of user u for the used web APIs, represents the average score of user v for the used web APIs, represents the score of user v for web API a i , sim(u, v) represents the similarity between users u and v, represents the predicted score of user for a i ; D. Web API popularity prediction: where a i represents the popularity calculation web API, Freq(a i ) represents the number of times a i is called, MinValue(a j ) represents the minimum number of times all web APIs are called, MaxValue(a z ) represents the maximum number of times all web APIs are called, represents the growth rate of the number of calls of a i over a period of time, Follow(a i ) represents the number of followers of a i , FollowMinValue(a x ) represents the minimum value of the followers among web APIs, FollowMaxValue(a y ) represents the maximum value of the followers among web APIs. Since the above data is dynamically changing, a formula containing the above variables is used to calculate the popularity of web APIs; E. Web API Recommendation Algorithm: The recommended value of each web API is obtained by adding the web API value obtained by collaborative filtering to the corresponding popularity value in proportion, where the value of λ ranges from 0 to 1. .