# A Service Recommendation Method Based on Requirements for the Cloud Environment

Authors: Liangmin Guo; Kaixuan Luan; Xiaoyao Zheng; Jing Qian
Journal: Journal of Control Science and Engineering
 (2021)

---

## Abstract

In the cloud computing environment, there are huge amounts of functionally similar cloud services. Additionally, user requirements can change. Therefore, it is difficult to recommend services that meet users’ requirements. To overcome the problems, a service recommendation method based on requirements is proposed. First, we form user communities by clustering to reduce the recommended range. Second, we use the reported QoS (Quality of Service) values and the evaluated QoS values to predict the QoS requirements of users. Third, based on the requirements, the matching degree of users to services is obtained. Finally, based on the similarity between the target user and the user’s neighbors and the difference in their matching degree of service and the ratings of services by the neighbors, we can obtain a list of service recommendations for the target user. Compared to the traditional collaborative filtering method and the deviation-based method, our method improves the recommendation accuracy without lowering the efficiency.


---

## Body

## 1. Introduction

The rapid development of Internet technology gave rise to the emergence of cloud computing, which has rapidly developed into one of the hot research fields. Cloud computing has superpowerful computing power and storage capacity. For example, in the mobile Internet, new service models and mobile applications based on mobile cloud computing show rocketing development trends [1]. Cloud computing utilizes the resource pool based on virtualization technology to provide on-demand services (i.e., cloud infrastructure, development platform, and software), which can be paid for dynamically, can be easily extended, and are fast and flexible. Users can get cloud services at any time and any place from cloud platforms. Faced with a vast amount of cloud services with similar or even identical functions, it is difficult for users, especially ordinary users, to choose the services that truly meet their requirements.Service recommendation technology has been shown to be a valuable tool. The core idea of service recommendation technology is to identify and predict the needs of users and provide corresponding recommendations to users. Existing popular recommendation methods are roughly divided into several categories: content-based recommendation [2, 3], collaborative filtering recommendation [4–12], recommendation based on association rules [13–15], knowledge-based recommendation [16–18], and hybrid recommendation methods [19, 20]. Content-based methods recommend similar items to a user according to the items that the user has liked in the past. These methods can reduce the influence of users’ subjective factors and data sparsity on recommendations. Collaborative filtering methods utilize neighbors’ known preferences to predict a user’s potential preferences for items. These methods rely too heavily on the evaluations of neighbors and have the cold start and data sparsity problems. Recommendation methods based on association rules count the relationships in which different rules appear based on historical data. Knowledge-based methods recommend items to a user in an interactive manner. Hybrid recommendation methods combine multiple methods to overcome the disadvantages of a single method. The above methods usually make recommendations based on historical circumstances, and it is difficult for these methods to respond to the changing needs of users.However, in fact, user requirements change over time, for example, a user with no specialist knowledge cannot accurately select services according to his or her requirements in the beginning. As a result, services recommended entirely based on historical records may not be suitable. Therefore, we need to predict the requirements of users to accurately recommend services that meet user requirements. In this paper, a service recommendation method based on requirements is proposed. We combine the evaluated QoS values of the users who are in the same community as a target user, the average rating of services evaluated by the target user, and the QoS value reported by the corresponding provider to predict the QoS required or expected by the target user. That is to say, we use the difference in ratings between the target user and similar users to embody the change.The main contributions are as follows: (1) a method for predicting the user requirements that is based on the reported QoS value and the evaluated QoS value is proposed to better reflect the actual requirements of users, (2) a method for calculating the matching degree of a user to a service that is based on the requirements is proposed to improve the recommendation accuracy, and (3) the construction of community based on similarity can reduce the recommended range to improve the recommendation efficiency. The rest of the paper is organized as follows. Section2 explores the related works. A service recommendation method based on requirements is presented in Section 3. Section 4 evaluates our method using experiments and complexity analysis. Finally, Section 5 summarizes all of our research.


## 2. Related Work

Recently, researchers have proposed many recommendation methods for the cloud environment.


### 2.1. Collaborative Filtering Methods

Considering the frequent changes in cloud service quality over time, Ding et al. [8] proposed a time-aware cloud service recommendation method using similarity-enhanced collaborative filtering and the autoregressive integrated moving average model to obtain the time feature of the user similarity, address the data sparsity, and predict the QoS values. To improve the prediction accuracy and recommendation efficiency, Afify et al. [9] proposed a hybrid collaborative filtering method based on the model and memory that uses user statistics, service ratings, and user interests to measure the similarity. Liu et al. [10] proposed a web recommendation method based on the locations of users and services to improve the prediction accuracy and computational efficiency. In [11], a service recommendation method based on keywords was proposed to meet users’ personalized requirements, which can improve the accuracy and scalability. Zheng et al. [12] proposed a collaborative filtering recommendation method based on the Spearman coefficient to predict the QoS of the active user for an unrated item, which can get more reliable rankings than the method based on the Pearson coefficient. Liu et al. [21] used similarity-enhanced collaborative filtering for QoS prediction, which considers the personalized influence of similar users and services. Chen et al. [22] proposed a model-based service QoS prediction method, which uses the known QoS values to learn a predictive model.


### 2.2. Association Rules Methods

Zhang et al. [14] proposed a frequent pattern growth association rules algorithm and a multilevel FP-Tree based on the association rules to extract the higher-level relationships and then combined user interests with the improved clustering algorithm to improve the accuracy of cloud service recommendation. Ming et al. [15] proposed a service recommendation method based on multitag and association rules, which can recommend services that are close to users’ potential interests.


### 2.3. Knowledge-Based Methods

Vera-del-Campo et al. [17] proposed a recommendation system that focuses on the protection of all participants against attacks. In the system, the recommenders use the intermediate nodes to recommend services to users. Amin et al. [18] proposed a recommendation method for cloud infrastructures based on a software approach to achieve an energy-efficient cloud platform.


### 2.4. Trust-Based Methods

Deng et al. [23] proposed a service recommendation method based on a social network. It considers users’ historic behaviors, users’ preferences, the trust relationships among users in a social network, and users’ comments. The results show that this method can improve the recall rate and precision. Considering the impact of trust on the recommendation accuracy, Yin et al. [24] proposed a cloud service recommendation method based on the trust path model and loop trust model, and the results show that this method improves both the MEA and RMSE by 2%. Due to the existence of unreliable QoS data, Su et al. [25] proposed a trust-based method for reliable personalized QoS prediction to recommend services to users.


### 2.5. Other Methods

Ding et al. [26] proposed two modified cloud service recommendation algorithms that simultaneously consider the accuracy and diversity by viewing service recommendation as a multiobjective optimization problem, which can improve prediction accuracy and guarantee greater diversity. Zhang et al. [27] proposed a real-time QoS-aware decision-making technique based on the analytic hierarchy process method, which is suitable for selecting infrastructure services for users according to the design time and real-time QoS constraints defined by users. This method acquires the best-fit combinations of cloud services using the matching degree between the constraints and the knowledge base. Considering the historical user-service quality data on multiple platforms, Qi et al. [28] proposed a distributed cloud service recommendation approach based on locality-sensitive hashing, which can improve recommendation accuracy, scalability, and privacy preservation. Karthikeyan et al. [29] proposed a cloud service recommendation system based on semantic technologies, which uses a natural language processing method to parse the cloud service description documents and process the user queries. Wu et al. [30] proposed a QoS prediction method based on the deviation for cloud and IoT services, which can improve the accuracy and overcome the existing difficulties of heuristic collaborative filtering methods.However, most of the cloud service recommendation methods do not consider the following fact: the requirements of users change. In particular, a user with no specialist knowledge can hardly accurately select satisfactory services according to his or her requirements at the beginning. Therefore, in this paper, we propose a service recommendation method based on requirements, which can improve the recommendation accuracy without lowering the efficiency.


## 2.1. Collaborative Filtering Methods

Considering the frequent changes in cloud service quality over time, Ding et al. [8] proposed a time-aware cloud service recommendation method using similarity-enhanced collaborative filtering and the autoregressive integrated moving average model to obtain the time feature of the user similarity, address the data sparsity, and predict the QoS values. To improve the prediction accuracy and recommendation efficiency, Afify et al. [9] proposed a hybrid collaborative filtering method based on the model and memory that uses user statistics, service ratings, and user interests to measure the similarity. Liu et al. [10] proposed a web recommendation method based on the locations of users and services to improve the prediction accuracy and computational efficiency. In [11], a service recommendation method based on keywords was proposed to meet users’ personalized requirements, which can improve the accuracy and scalability. Zheng et al. [12] proposed a collaborative filtering recommendation method based on the Spearman coefficient to predict the QoS of the active user for an unrated item, which can get more reliable rankings than the method based on the Pearson coefficient. Liu et al. [21] used similarity-enhanced collaborative filtering for QoS prediction, which considers the personalized influence of similar users and services. Chen et al. [22] proposed a model-based service QoS prediction method, which uses the known QoS values to learn a predictive model.


## 2.2. Association Rules Methods

Zhang et al. [14] proposed a frequent pattern growth association rules algorithm and a multilevel FP-Tree based on the association rules to extract the higher-level relationships and then combined user interests with the improved clustering algorithm to improve the accuracy of cloud service recommendation. Ming et al. [15] proposed a service recommendation method based on multitag and association rules, which can recommend services that are close to users’ potential interests.


## 2.3. Knowledge-Based Methods

Vera-del-Campo et al. [17] proposed a recommendation system that focuses on the protection of all participants against attacks. In the system, the recommenders use the intermediate nodes to recommend services to users. Amin et al. [18] proposed a recommendation method for cloud infrastructures based on a software approach to achieve an energy-efficient cloud platform.


## 2.4. Trust-Based Methods

Deng et al. [23] proposed a service recommendation method based on a social network. It considers users’ historic behaviors, users’ preferences, the trust relationships among users in a social network, and users’ comments. The results show that this method can improve the recall rate and precision. Considering the impact of trust on the recommendation accuracy, Yin et al. [24] proposed a cloud service recommendation method based on the trust path model and loop trust model, and the results show that this method improves both the MEA and RMSE by 2%. Due to the existence of unreliable QoS data, Su et al. [25] proposed a trust-based method for reliable personalized QoS prediction to recommend services to users.


## 2.5. Other Methods

Ding et al. [26] proposed two modified cloud service recommendation algorithms that simultaneously consider the accuracy and diversity by viewing service recommendation as a multiobjective optimization problem, which can improve prediction accuracy and guarantee greater diversity. Zhang et al. [27] proposed a real-time QoS-aware decision-making technique based on the analytic hierarchy process method, which is suitable for selecting infrastructure services for users according to the design time and real-time QoS constraints defined by users. This method acquires the best-fit combinations of cloud services using the matching degree between the constraints and the knowledge base. Considering the historical user-service quality data on multiple platforms, Qi et al. [28] proposed a distributed cloud service recommendation approach based on locality-sensitive hashing, which can improve recommendation accuracy, scalability, and privacy preservation. Karthikeyan et al. [29] proposed a cloud service recommendation system based on semantic technologies, which uses a natural language processing method to parse the cloud service description documents and process the user queries. Wu et al. [30] proposed a QoS prediction method based on the deviation for cloud and IoT services, which can improve the accuracy and overcome the existing difficulties of heuristic collaborative filtering methods.However, most of the cloud service recommendation methods do not consider the following fact: the requirements of users change. In particular, a user with no specialist knowledge can hardly accurately select satisfactory services according to his or her requirements at the beginning. Therefore, in this paper, we propose a service recommendation method based on requirements, which can improve the recommendation accuracy without lowering the efficiency.


## 3. Cloud Service Recommendation Method Based on Requirements

### 3.1. Description

After a service provider registers its services (i.e., items) on the cloud platform, it reports the quality of service (QoS) that can be provided. The quality of service is described using multiple dimensions, such as the response time, network bandwidth, throughput, and failure rate. The user gives a rating for each dimension after a user interacts with a service.The data source of our recommendation system isD=U,P,Q,R, where U=u1,u2,…,un is a set of users in the system, P=p1,p2,…,pm is a set of services containing the basic information of services, and Q=qp1,qp2,…,qpm is the QoS value reported for each service at the time of its registration. qpj (j=1,2,…,m) is a ω-dimensional QoS vector, where qpj=qpj1,qpj2,…,qpjω and 0≤qpjx≤1 (x=1,2,…,ω). Each dimension describes the QoS of a service attribute. R is an m×n order matrix (as shown in equation (1)), that is, the user’s evaluation matrix for services, as follows:(1)R=ru1p1…ru1pm⋮⋱⋮runp1…runpm,where ruipj is the rating of user ui for service pj, that is, ruipj=ruipj1,ruipj2,…,ruipjω. ruipjx (x=1,2,…,ω) is the rating of the xth dimension and 0≤ruipjx≤1. When ruipjx=0, it indicates that the xth dimension QoS of pj completely not meet the requirements of ui; and when ruipjx=1, the x th dimension QoS of pj can completely meet the requirements of ui.The recommended framework is shown in Figure1. It is mainly composed of four parts. (1) Part one is the construction of community. k user communities are constructed by a k-means clustering algorithm to narrow the recommendation range and improve the service recommendation efficiency (see Section 3.2). (2) Part two is obtaining the neighbors and screening the services (see Section 3.4). (3) Part three is the prediction of the QoS requirement of a target user ui. For the screened services, we combine the evaluated QoS values of users for services, the average rating of services evaluated by ui, and the QoS value reported by the corresponding provider to predict the QoS required or expected by ui (see Section 3.3). (4) Part four is the service recommendation. We calculate the matching degree between the predicted QoS values and the reported QoS values of the screened services. Then, we obtain the service recommendation list according to the matching degree, the similarity, and the service ratings by the neighboring users (see Section 3.4).Figure 1
Recommendation framework.


### 3.2. Construction of Community

In the construction of community, we first need to determine the number of communities. We selectk users with the highest interactions as the centers of the initial k communities C1,C2,…,Ck, which can better reduce the isolated points. After that, the center of each community is redetermined in each calculation round until the criterion function converges. The criterion function is shown as follows:(2)Fx=∑y=1k∑ui∈Cy∑pj∈Puiruipjx−ruCypjx2,where Fx is the sum of the squared errors of all ratings in the xth dimension, Pui represents a set of services that user ui interacts with, and ruCypjx is the x th dimension rating of center ucy of community Cy on service pj.Next, we calculate the similarity between the other users and each center of thek communities. If the similarity between a user ui and the center ucy of community Cy is the highest, then ui belongs to community Cy. The similarity between user ui and user ucy is calculated as follows:(3)simui,ucy=1ω∑x=1ω∑pj∈Puiucyruipjx−r¯uixrucypjxx−r¯ucyx∑pj∈Puiucyruipjx−r¯uix2∑pj∈Puiucyrucypjx−r¯ucyx2,where r¯uix (r¯uix=1/Pui∑pj∈Puiruipjx) and r¯ucyx (r¯ucyx=1/Pucy∑pj∈Pucyrucypjx) represent the average values of the xth dimension rating of services evaluated by user ui and ucy, respectively, and Puiucy represents a set of services that are interacted with by both users ui and ucy, that is, Puiucy=Pui∩Pucy.Algorithm1 describes the construction process of user communities. After each round of clustering, the center of each community is redetermined (lines 13–27 in Algorithm 1). For a community Cy, we first calculate the average value of each dimension of the service ratings to obtain a vectorrCy:p1,rCy:p2,…,rCy:pm (lines 14–16 in Algorithm 1). Then, if the evaluation vector rup1,rup2,…,rupm of user u is the closest to the average vector, then we consider user u to be the new center of community Cy (lines 17–26 in Algorithm 1).Algorithm 1: Construction of user community.
Input: data D, centers of the initial k user communities uc1,uc2,…,uckOutput:k user communities C1,C2,…,Ck(1)
repeat(2)
for each user ui that does not belong to the set {uc1,uc2,…,uck} do(3)
maxsim=0;(4)
for each ucy (y=1,2,…,k) do(5)
compute the similaritysimui,ucy between ui and ucy using (3);(6)
ifsimui,ucy≥maxthen(7)
max=simui,ucy;(8)
maxy=y; //record the center(9)
end if(10)
end for(11)
Addui to the community Cmaxy;(12)
end for(13)
for each Cy (y=1,2,…,k) do//the center of each community is redetermined(14)
for each service pj (j=1,2,…,m) do(15)
rCy:pj=r¯Cy:pj1,…,r¯Cy:pjω=1/Cy∑u∈Cyrupj1,…,1/Cy∑u∈Cyrupjω;(16)
end for(17)
minc=1;(18)
for each user u in Cydo(19)
dup1,…,dupm=1/ω∑x=1ωrup1x−r¯Cy:p1x,…,1/ω∑x=1ωrupmx−r¯Cy:pmx);(20)
du¯=1/m∑j=1mdupj;(21)
ifdu¯≤mincthen(22)
minc=du¯;(23)
ucy=u; //update the center(24)
end if(25)
end for(26)
end for(27)
until each Fx(x=1,2,…,ω) converge


### 3.3. Prediction of User Requirement

When users select services, they are unsure of their requirements in the beginning or their requirements are constantly changing. However, if the services that users select do not meet their real requirements, then users may give low ratings to the services after they use them. The ratings can reflect the real requirements of users to a certain extent. Users may need to make several selections before obtaining the services that eventually meet users’ real requirements.In this paper, we combine the ratings of users for a service, the average rating of services evaluated by a target userui, and the QoS value reported by the corresponding provider to compute the QoS value that ui expects or predicts. The xth dimension of the QoS value predicted by ui is calculated as follows:(4)euipjx=∑u∈UpjrupjxUpj−r¯uix+1×qpjx,where Upj represents a set of users interacting with pj in the community that includes ui and r¯uix is the average rating of the xth dimension QoS of services by ui. We can obtain the QoS requirement vector Euipj of ui, that is, Euipj=euipj1,euipj2,…,euipjω.


### 3.4. Recommendation Algorithm

The basic strategy of our recommendation method is as follows:(1)
We calculate the similarity betweenui and the other users in community C (we suppose the target user ui is in C) using equation (3). The N users (u1,u2,…,uN) with higher similarity are the neighboring users of ui. Then, we obtain a set P∗ of services that these neighbor users interact with, that is, P∗=∪j=1NPuj. If the average rating of a service is lower than the specified threshold, then the service will not appear in the recommendation list to ensure that no low-quality service will be recommended. Therefore, according to the ratings of the neighboring users on the services in P∗, the services with lower ratings are further screened out and then the set P∗∗ is obtained.(2)
We compute the predicted QoS values of the services inP∗∗.(3)
For each servicep (p∈P∗∗), we calculate its matching degree of the xth dimension QoS according to the following equation:(5)Mduipx=1−|euipx−qpx|euipx+qpx+2.(4)
We predict the rating of servicep for ui based on the ratings of p from the neighboring users, the similarity between users, and the difference in the matching degree of p between users. Therefore, we compute the predicted rating r^uipx of the xth dimension QoS according to the following equation:(6)r^uipx=r¯uix+∑j=1Nsimui,uj×Mduipx−Mdujpx−1/2×rujpx−r¯ujx∑j=1Nsimui,uj×Mduipx−Mdujpx−1/2.wherer¯uix and r¯ujx are the average ratings of the xth dimension QoS of services by ui and uj, respectively.(5)
Finally, we recommend theL services with the highest predicted ratings to the target user.The specific process is shown in Algorithm2.Algorithm 2: Recommendation process.
Input: dataset DOutput: a recommendation list including L services(1)
Constructk user communities via Algorithm 1;(2)
Find the communityC that the target user ui belongs to;(3)
for each user u (u≠ui) in Cdo(4)
Obtain the similaritysimui,u using (3);(5)
end for(6)
ObtainN neighboring users with higher similarity from C;(7)
P∗←services that the N users interact with;(8)
Remove the services with lower ratings fromP∗ to obtain P∗∗;(9)
for each service p in P∗∗do(10)
Obtain the requirement vectorsEuip and Eujp (j=1,2,…,N) using (4);(11)
Calculate the matching degreesMdupx and Mdujpx (x=1,2,…,ω) using (5);(12)
Calculate the predicted ratingr^uipx of the x th dimension QoS using (6);(13)
end for(14)
Sort the predicted ratings of all services inP∗∗ in descending order, and select the first L services to form a list of recommendations.


## 3.1. Description

After a service provider registers its services (i.e., items) on the cloud platform, it reports the quality of service (QoS) that can be provided. The quality of service is described using multiple dimensions, such as the response time, network bandwidth, throughput, and failure rate. The user gives a rating for each dimension after a user interacts with a service.The data source of our recommendation system isD=U,P,Q,R, where U=u1,u2,…,un is a set of users in the system, P=p1,p2,…,pm is a set of services containing the basic information of services, and Q=qp1,qp2,…,qpm is the QoS value reported for each service at the time of its registration. qpj (j=1,2,…,m) is a ω-dimensional QoS vector, where qpj=qpj1,qpj2,…,qpjω and 0≤qpjx≤1 (x=1,2,…,ω). Each dimension describes the QoS of a service attribute. R is an m×n order matrix (as shown in equation (1)), that is, the user’s evaluation matrix for services, as follows:(1)R=ru1p1…ru1pm⋮⋱⋮runp1…runpm,where ruipj is the rating of user ui for service pj, that is, ruipj=ruipj1,ruipj2,…,ruipjω. ruipjx (x=1,2,…,ω) is the rating of the xth dimension and 0≤ruipjx≤1. When ruipjx=0, it indicates that the xth dimension QoS of pj completely not meet the requirements of ui; and when ruipjx=1, the x th dimension QoS of pj can completely meet the requirements of ui.The recommended framework is shown in Figure1. It is mainly composed of four parts. (1) Part one is the construction of community. k user communities are constructed by a k-means clustering algorithm to narrow the recommendation range and improve the service recommendation efficiency (see Section 3.2). (2) Part two is obtaining the neighbors and screening the services (see Section 3.4). (3) Part three is the prediction of the QoS requirement of a target user ui. For the screened services, we combine the evaluated QoS values of users for services, the average rating of services evaluated by ui, and the QoS value reported by the corresponding provider to predict the QoS required or expected by ui (see Section 3.3). (4) Part four is the service recommendation. We calculate the matching degree between the predicted QoS values and the reported QoS values of the screened services. Then, we obtain the service recommendation list according to the matching degree, the similarity, and the service ratings by the neighboring users (see Section 3.4).Figure 1
Recommendation framework.


## 3.2. Construction of Community

In the construction of community, we first need to determine the number of communities. We selectk users with the highest interactions as the centers of the initial k communities C1,C2,…,Ck, which can better reduce the isolated points. After that, the center of each community is redetermined in each calculation round until the criterion function converges. The criterion function is shown as follows:(2)Fx=∑y=1k∑ui∈Cy∑pj∈Puiruipjx−ruCypjx2,where Fx is the sum of the squared errors of all ratings in the xth dimension, Pui represents a set of services that user ui interacts with, and ruCypjx is the x th dimension rating of center ucy of community Cy on service pj.Next, we calculate the similarity between the other users and each center of thek communities. If the similarity between a user ui and the center ucy of community Cy is the highest, then ui belongs to community Cy. The similarity between user ui and user ucy is calculated as follows:(3)simui,ucy=1ω∑x=1ω∑pj∈Puiucyruipjx−r¯uixrucypjxx−r¯ucyx∑pj∈Puiucyruipjx−r¯uix2∑pj∈Puiucyrucypjx−r¯ucyx2,where r¯uix (r¯uix=1/Pui∑pj∈Puiruipjx) and r¯ucyx (r¯ucyx=1/Pucy∑pj∈Pucyrucypjx) represent the average values of the xth dimension rating of services evaluated by user ui and ucy, respectively, and Puiucy represents a set of services that are interacted with by both users ui and ucy, that is, Puiucy=Pui∩Pucy.Algorithm1 describes the construction process of user communities. After each round of clustering, the center of each community is redetermined (lines 13–27 in Algorithm 1). For a community Cy, we first calculate the average value of each dimension of the service ratings to obtain a vectorrCy:p1,rCy:p2,…,rCy:pm (lines 14–16 in Algorithm 1). Then, if the evaluation vector rup1,rup2,…,rupm of user u is the closest to the average vector, then we consider user u to be the new center of community Cy (lines 17–26 in Algorithm 1).Algorithm 1: Construction of user community.
Input: data D, centers of the initial k user communities uc1,uc2,…,uckOutput:k user communities C1,C2,…,Ck(1)
repeat(2)
for each user ui that does not belong to the set {uc1,uc2,…,uck} do(3)
maxsim=0;(4)
for each ucy (y=1,2,…,k) do(5)
compute the similaritysimui,ucy between ui and ucy using (3);(6)
ifsimui,ucy≥maxthen(7)
max=simui,ucy;(8)
maxy=y; //record the center(9)
end if(10)
end for(11)
Addui to the community Cmaxy;(12)
end for(13)
for each Cy (y=1,2,…,k) do//the center of each community is redetermined(14)
for each service pj (j=1,2,…,m) do(15)
rCy:pj=r¯Cy:pj1,…,r¯Cy:pjω=1/Cy∑u∈Cyrupj1,…,1/Cy∑u∈Cyrupjω;(16)
end for(17)
minc=1;(18)
for each user u in Cydo(19)
dup1,…,dupm=1/ω∑x=1ωrup1x−r¯Cy:p1x,…,1/ω∑x=1ωrupmx−r¯Cy:pmx);(20)
du¯=1/m∑j=1mdupj;(21)
ifdu¯≤mincthen(22)
minc=du¯;(23)
ucy=u; //update the center(24)
end if(25)
end for(26)
end for(27)
until each Fx(x=1,2,…,ω) converge


## 3.3. Prediction of User Requirement

When users select services, they are unsure of their requirements in the beginning or their requirements are constantly changing. However, if the services that users select do not meet their real requirements, then users may give low ratings to the services after they use them. The ratings can reflect the real requirements of users to a certain extent. Users may need to make several selections before obtaining the services that eventually meet users’ real requirements.In this paper, we combine the ratings of users for a service, the average rating of services evaluated by a target userui, and the QoS value reported by the corresponding provider to compute the QoS value that ui expects or predicts. The xth dimension of the QoS value predicted by ui is calculated as follows:(4)euipjx=∑u∈UpjrupjxUpj−r¯uix+1×qpjx,where Upj represents a set of users interacting with pj in the community that includes ui and r¯uix is the average rating of the xth dimension QoS of services by ui. We can obtain the QoS requirement vector Euipj of ui, that is, Euipj=euipj1,euipj2,…,euipjω.


## 3.4. Recommendation Algorithm

The basic strategy of our recommendation method is as follows:(1)
We calculate the similarity betweenui and the other users in community C (we suppose the target user ui is in C) using equation (3). The N users (u1,u2,…,uN) with higher similarity are the neighboring users of ui. Then, we obtain a set P∗ of services that these neighbor users interact with, that is, P∗=∪j=1NPuj. If the average rating of a service is lower than the specified threshold, then the service will not appear in the recommendation list to ensure that no low-quality service will be recommended. Therefore, according to the ratings of the neighboring users on the services in P∗, the services with lower ratings are further screened out and then the set P∗∗ is obtained.(2)
We compute the predicted QoS values of the services inP∗∗.(3)
For each servicep (p∈P∗∗), we calculate its matching degree of the xth dimension QoS according to the following equation:(5)Mduipx=1−|euipx−qpx|euipx+qpx+2.(4)
We predict the rating of servicep for ui based on the ratings of p from the neighboring users, the similarity between users, and the difference in the matching degree of p between users. Therefore, we compute the predicted rating r^uipx of the xth dimension QoS according to the following equation:(6)r^uipx=r¯uix+∑j=1Nsimui,uj×Mduipx−Mdujpx−1/2×rujpx−r¯ujx∑j=1Nsimui,uj×Mduipx−Mdujpx−1/2.wherer¯uix and r¯ujx are the average ratings of the xth dimension QoS of services by ui and uj, respectively.(5)
Finally, we recommend theL services with the highest predicted ratings to the target user.The specific process is shown in Algorithm2.Algorithm 2: Recommendation process.
Input: dataset DOutput: a recommendation list including L services(1)
Constructk user communities via Algorithm 1;(2)
Find the communityC that the target user ui belongs to;(3)
for each user u (u≠ui) in Cdo(4)
Obtain the similaritysimui,u using (3);(5)
end for(6)
ObtainN neighboring users with higher similarity from C;(7)
P∗←services that the N users interact with;(8)
Remove the services with lower ratings fromP∗ to obtain P∗∗;(9)
for each service p in P∗∗do(10)
Obtain the requirement vectorsEuip and Eujp (j=1,2,…,N) using (4);(11)
Calculate the matching degreesMdupx and Mdujpx (x=1,2,…,ω) using (5);(12)
Calculate the predicted ratingr^uipx of the x th dimension QoS using (6);(13)
end for(14)
Sort the predicted ratings of all services inP∗∗ in descending order, and select the first L services to form a list of recommendations.


## 4. Experiments

### 4.1. Experimental Environment, Dataset, and Performance Metrics

The hardware and software environment of our experiments is as follows: an Intel (R) Core (TM) i7-6500U 2.5 GHz CPU, 8 GB of memory (RAM), the Windows 10 64-bit operating system, and Dev C++ as the programming language.In this paper, we use a public dataset WSDREAM (https://github.com/wsdream/wsdream-dataset) [31], which includes data on real-world QoS evaluation results from 339 users on 5825 Web services. In this dataset, there are two dimensions to the evaluation results: the response time and throughput. Therefore, the value of ω is equal to two. For this dataset, we conduct the following pretreatment: (1) if the response time or throughput of a user on a service is equal to −1, then we ignore this data pair; and (2) the other data will be normalized by dividing the maximum. In addition, we assume that the reported QoS value for a service is equal to the average of the evaluation values of all users on the service.We use the MAE and RMSE to assess the predictive accuracy of the predicted ratings produced by the recommendation system. The MAE and RMSE are the mean absolute error and root mean square error, respectively. The smaller the values of the MAE and RMSE are, the higher the accuracy. Their calculation methods are as follows:(7)MAE=1Ndata∑ui,pj∈data1ω∑x=1ωr^uipjx−1ω∑x=1ωruipjx,RMSE=1Ndata∑ui,pj∈data1ω∑x=1ωr^uipjx−1ω∑x=1ωruipjx2.


### 4.2. Experimental Results and Analysis

Our method is founded on the user-based collaborative filtering and considers the QoS requirements of users. Hence, to evaluate the performance of our method (abbreviated as RB), we compare it with the following methods:(i)
A traditional collaborative filtering method based on users (abbreviated as CF), which only uses the similarity among users to make recommendations(ii)
A prediction method based on the deviation (abbreviated as DB) [30], which is based on the principle of collaborative filtering and uses deviations of the services and the users to estimate the QoS value(iii)
A collaborative filtering method based on neighbors (abbreviated as NB) [21], which considers the influence of similar users and services(iv)
A collaborative filtering method based on model (abbreviated as MB) [22], which applies the overall known QoS values to learn a predictive model for predictions


#### 4.2.1. Recommendation Accuracy

Figure2 shows the variations in the MAE and RMSE for different numbers of neighbors with rating matrix densities of 2% and 4%. According to Figure 2, the MAEs and RMSEs of the RB method are the lowest. These results indicate that the accuracy of the RB method is the highest. This is because the RB method removes the services that are given lower ratings by the neighboring users to ensure the recommendation quality and considers the target user’s requirement to reduce the impact of data sparsity and improve the accuracy. The CF method uses the user similarity that is calculated by the Pearson correlation coefficient to obtain the predicted ratings. This leads to large errors in datasets with high sparsity. Therefore, its accuracy is the lowest. The accuracy of the DB method is higher than that of the CF method, especially when the density is lower. This is because the DB method considers contextual information. When the matrix density is 2% and the number of neighbors is less than 20, the MAEs of the NB and MB methods are slightly lower than those of the RB method. But their RMSEs are still higher than those of our method. The MB method uses the known data to learn a predictive model, and the NB method only employs enhanced similarity to make the prediction. Therefore, they still suffer from the data sparsity problem.Figure 2
MAEs and RMSEs for different numbers of neighbors. (a) MAE (matrix density: 2%), (b) MAE (matrix density: 4%), (c) RMSE (matrix density: 2%), and (d) RMSE (matrix density: 4%).
(a)(b)(c)(d)Figure3 shows the variations in the MAEs and RMSEs with rating matrix densities of 2%, 4%, 6%, 8%, and 10%. As the matrix density increases, the MAEs and RMSEs of the RB, DB, NB, and MB methods are relatively stable, and those of the CF method have a tendency to decline. This indicates that the RB, DB, NB, and MB methods are more robust. In addition, according to Figure 3, the accuracy of the RB method is obviously higher than those of the other methods under the same matrix density. This is because when predicting the rating of a service, the RB method not only considers the similarity between users but also considers the difference in the matching degrees of a service. The difference in the matching degrees reflects the difference between the requirement of the target user and that of a neighboring user. The smaller the difference in the matching degrees for a service is, the more important the rating given by the neighboring user is when predicting the rating.Figure 3
MAEs and RMSEs for different matrix densities (2%–10%). (a) MAE (number of neighbors: 15), (b) MAE (number of neighbors: 20), (c) RMSE (number of neighbors: 15), and (d) RMSE (number of neighbors: 20).
(a)(b)(c)(d)Figure4 shows the variations in the MAE with rating matrix densities of 30%, 40%, 50%, 60%, and 70%. According to Figure 4, the MAEs of each method are lower than the values in Figure 3. This is because the sparsity of the rating matrix is reduced. However, when the matrix density is higher than 50%, the MAE values of the DB, MB, and CF methods are slightly increasing, and those of the RB and NB methods are still dropping and starting to level off. In addition, the RB method outperforms the other methods. This further indicates that the RB method is more robust. The main reason for the results is that the RB method considers the service matching degree and the similarity between users. The DB and MB methods are more suitable for the sparse rating matrix. This is because the DB method uses the deviation-based baseline estimate, and the MB method uses the entire training data to learn a model.Figure 4
MAE for different matrix densities (30%–70%).


#### 4.2.2. Time Complexity Analysis and Execution Time

For simplicity, we assume thatn is the number of users and m is the number of services. For the CF method, the time complexity can be estimated as On2. For the DB method, the time complexity can be estimated as OmnNIDB, where IDB is the number of iterations and N is the number of neighbors. For the RB method, the time complexity is OknIRB+On2=On2 (k,IRB≪n), where IRB is the number of iterations in the construction of the user community.Figure5 shows the execution time of each method. The execution time of the RB method is close to that of the CF method, and their execution times are less than those of the DB, MB, and NB methods. From the above results, we see that the RB method can improve the recommendation accuracy without lowering the time efficiency.Figure 5
Execution time: (a) CF, (b) RB (k=4), (c) DB, (d) MB, and (e) NB.
(a)(b)(c)(d)(e)


## 4.1. Experimental Environment, Dataset, and Performance Metrics

The hardware and software environment of our experiments is as follows: an Intel (R) Core (TM) i7-6500U 2.5 GHz CPU, 8 GB of memory (RAM), the Windows 10 64-bit operating system, and Dev C++ as the programming language.In this paper, we use a public dataset WSDREAM (https://github.com/wsdream/wsdream-dataset) [31], which includes data on real-world QoS evaluation results from 339 users on 5825 Web services. In this dataset, there are two dimensions to the evaluation results: the response time and throughput. Therefore, the value of ω is equal to two. For this dataset, we conduct the following pretreatment: (1) if the response time or throughput of a user on a service is equal to −1, then we ignore this data pair; and (2) the other data will be normalized by dividing the maximum. In addition, we assume that the reported QoS value for a service is equal to the average of the evaluation values of all users on the service.We use the MAE and RMSE to assess the predictive accuracy of the predicted ratings produced by the recommendation system. The MAE and RMSE are the mean absolute error and root mean square error, respectively. The smaller the values of the MAE and RMSE are, the higher the accuracy. Their calculation methods are as follows:(7)MAE=1Ndata∑ui,pj∈data1ω∑x=1ωr^uipjx−1ω∑x=1ωruipjx,RMSE=1Ndata∑ui,pj∈data1ω∑x=1ωr^uipjx−1ω∑x=1ωruipjx2.


## 4.2. Experimental Results and Analysis

Our method is founded on the user-based collaborative filtering and considers the QoS requirements of users. Hence, to evaluate the performance of our method (abbreviated as RB), we compare it with the following methods:(i)
A traditional collaborative filtering method based on users (abbreviated as CF), which only uses the similarity among users to make recommendations(ii)
A prediction method based on the deviation (abbreviated as DB) [30], which is based on the principle of collaborative filtering and uses deviations of the services and the users to estimate the QoS value(iii)
A collaborative filtering method based on neighbors (abbreviated as NB) [21], which considers the influence of similar users and services(iv)
A collaborative filtering method based on model (abbreviated as MB) [22], which applies the overall known QoS values to learn a predictive model for predictions


### 4.2.1. Recommendation Accuracy

Figure2 shows the variations in the MAE and RMSE for different numbers of neighbors with rating matrix densities of 2% and 4%. According to Figure 2, the MAEs and RMSEs of the RB method are the lowest. These results indicate that the accuracy of the RB method is the highest. This is because the RB method removes the services that are given lower ratings by the neighboring users to ensure the recommendation quality and considers the target user’s requirement to reduce the impact of data sparsity and improve the accuracy. The CF method uses the user similarity that is calculated by the Pearson correlation coefficient to obtain the predicted ratings. This leads to large errors in datasets with high sparsity. Therefore, its accuracy is the lowest. The accuracy of the DB method is higher than that of the CF method, especially when the density is lower. This is because the DB method considers contextual information. When the matrix density is 2% and the number of neighbors is less than 20, the MAEs of the NB and MB methods are slightly lower than those of the RB method. But their RMSEs are still higher than those of our method. The MB method uses the known data to learn a predictive model, and the NB method only employs enhanced similarity to make the prediction. Therefore, they still suffer from the data sparsity problem.Figure 2
MAEs and RMSEs for different numbers of neighbors. (a) MAE (matrix density: 2%), (b) MAE (matrix density: 4%), (c) RMSE (matrix density: 2%), and (d) RMSE (matrix density: 4%).
(a)(b)(c)(d)Figure3 shows the variations in the MAEs and RMSEs with rating matrix densities of 2%, 4%, 6%, 8%, and 10%. As the matrix density increases, the MAEs and RMSEs of the RB, DB, NB, and MB methods are relatively stable, and those of the CF method have a tendency to decline. This indicates that the RB, DB, NB, and MB methods are more robust. In addition, according to Figure 3, the accuracy of the RB method is obviously higher than those of the other methods under the same matrix density. This is because when predicting the rating of a service, the RB method not only considers the similarity between users but also considers the difference in the matching degrees of a service. The difference in the matching degrees reflects the difference between the requirement of the target user and that of a neighboring user. The smaller the difference in the matching degrees for a service is, the more important the rating given by the neighboring user is when predicting the rating.Figure 3
MAEs and RMSEs for different matrix densities (2%–10%). (a) MAE (number of neighbors: 15), (b) MAE (number of neighbors: 20), (c) RMSE (number of neighbors: 15), and (d) RMSE (number of neighbors: 20).
(a)(b)(c)(d)Figure4 shows the variations in the MAE with rating matrix densities of 30%, 40%, 50%, 60%, and 70%. According to Figure 4, the MAEs of each method are lower than the values in Figure 3. This is because the sparsity of the rating matrix is reduced. However, when the matrix density is higher than 50%, the MAE values of the DB, MB, and CF methods are slightly increasing, and those of the RB and NB methods are still dropping and starting to level off. In addition, the RB method outperforms the other methods. This further indicates that the RB method is more robust. The main reason for the results is that the RB method considers the service matching degree and the similarity between users. The DB and MB methods are more suitable for the sparse rating matrix. This is because the DB method uses the deviation-based baseline estimate, and the MB method uses the entire training data to learn a model.Figure 4
MAE for different matrix densities (30%–70%).


### 4.2.2. Time Complexity Analysis and Execution Time

For simplicity, we assume thatn is the number of users and m is the number of services. For the CF method, the time complexity can be estimated as On2. For the DB method, the time complexity can be estimated as OmnNIDB, where IDB is the number of iterations and N is the number of neighbors. For the RB method, the time complexity is OknIRB+On2=On2 (k,IRB≪n), where IRB is the number of iterations in the construction of the user community.Figure5 shows the execution time of each method. The execution time of the RB method is close to that of the CF method, and their execution times are less than those of the DB, MB, and NB methods. From the above results, we see that the RB method can improve the recommendation accuracy without lowering the time efficiency.Figure 5
Execution time: (a) CF, (b) RB (k=4), (c) DB, (d) MB, and (e) NB.
(a)(b)(c)(d)(e)


## 4.2.1. Recommendation Accuracy

Figure2 shows the variations in the MAE and RMSE for different numbers of neighbors with rating matrix densities of 2% and 4%. According to Figure 2, the MAEs and RMSEs of the RB method are the lowest. These results indicate that the accuracy of the RB method is the highest. This is because the RB method removes the services that are given lower ratings by the neighboring users to ensure the recommendation quality and considers the target user’s requirement to reduce the impact of data sparsity and improve the accuracy. The CF method uses the user similarity that is calculated by the Pearson correlation coefficient to obtain the predicted ratings. This leads to large errors in datasets with high sparsity. Therefore, its accuracy is the lowest. The accuracy of the DB method is higher than that of the CF method, especially when the density is lower. This is because the DB method considers contextual information. When the matrix density is 2% and the number of neighbors is less than 20, the MAEs of the NB and MB methods are slightly lower than those of the RB method. But their RMSEs are still higher than those of our method. The MB method uses the known data to learn a predictive model, and the NB method only employs enhanced similarity to make the prediction. Therefore, they still suffer from the data sparsity problem.Figure 2
MAEs and RMSEs for different numbers of neighbors. (a) MAE (matrix density: 2%), (b) MAE (matrix density: 4%), (c) RMSE (matrix density: 2%), and (d) RMSE (matrix density: 4%).
(a)(b)(c)(d)Figure3 shows the variations in the MAEs and RMSEs with rating matrix densities of 2%, 4%, 6%, 8%, and 10%. As the matrix density increases, the MAEs and RMSEs of the RB, DB, NB, and MB methods are relatively stable, and those of the CF method have a tendency to decline. This indicates that the RB, DB, NB, and MB methods are more robust. In addition, according to Figure 3, the accuracy of the RB method is obviously higher than those of the other methods under the same matrix density. This is because when predicting the rating of a service, the RB method not only considers the similarity between users but also considers the difference in the matching degrees of a service. The difference in the matching degrees reflects the difference between the requirement of the target user and that of a neighboring user. The smaller the difference in the matching degrees for a service is, the more important the rating given by the neighboring user is when predicting the rating.Figure 3
MAEs and RMSEs for different matrix densities (2%–10%). (a) MAE (number of neighbors: 15), (b) MAE (number of neighbors: 20), (c) RMSE (number of neighbors: 15), and (d) RMSE (number of neighbors: 20).
(a)(b)(c)(d)Figure4 shows the variations in the MAE with rating matrix densities of 30%, 40%, 50%, 60%, and 70%. According to Figure 4, the MAEs of each method are lower than the values in Figure 3. This is because the sparsity of the rating matrix is reduced. However, when the matrix density is higher than 50%, the MAE values of the DB, MB, and CF methods are slightly increasing, and those of the RB and NB methods are still dropping and starting to level off. In addition, the RB method outperforms the other methods. This further indicates that the RB method is more robust. The main reason for the results is that the RB method considers the service matching degree and the similarity between users. The DB and MB methods are more suitable for the sparse rating matrix. This is because the DB method uses the deviation-based baseline estimate, and the MB method uses the entire training data to learn a model.Figure 4
MAE for different matrix densities (30%–70%).


## 4.2.2. Time Complexity Analysis and Execution Time

For simplicity, we assume thatn is the number of users and m is the number of services. For the CF method, the time complexity can be estimated as On2. For the DB method, the time complexity can be estimated as OmnNIDB, where IDB is the number of iterations and N is the number of neighbors. For the RB method, the time complexity is OknIRB+On2=On2 (k,IRB≪n), where IRB is the number of iterations in the construction of the user community.Figure5 shows the execution time of each method. The execution time of the RB method is close to that of the CF method, and their execution times are less than those of the DB, MB, and NB methods. From the above results, we see that the RB method can improve the recommendation accuracy without lowering the time efficiency.Figure 5
Execution time: (a) CF, (b) RB (k=4), (c) DB, (d) MB, and (e) NB.
(a)(b)(c)(d)(e)


## 5. Conclusions

This paper proposed a service recommendation method based on requirements. First, user communities are constructed by clustering to reduce the range. Second, the reported QoS values and the evaluation QoS values are used to predict the QoS requirements of users. Then, the matching degree of users to services is computed. Finally, service ratings are predicted for the target user to obtain the recommendation list based on the similarity, the difference in their matching degrees, and the ratings of services by the target user’s neighbors. In the case of the lower rating matrix densities (2%–10%), the average MAE value (0.28) of our method is less than that of the CF method (0.39), that of the DB method (0.40), that of the NB method (0.31), and that of the MB method (0.34). In addition, the average execution time of our method is less than that of the DB method, that of the NB method, and that of the MB method. Therefore, our method can improve the recommendation accuracy without lowering the efficiency.In future works, we will further improve the requirement prediction method by mining implicit user information from reviews.



---

*Source: 6669798-2021-03-25.xml*