Mobility-aware personalized service recommendation in mobile edge computing

With the proliferation of smartphones and an increasing number of services provisioned by clouds, mobile edge computing (MEC) is emerging as a complementary technology of cloud computing. It could provide cloud resources and services by local mobile edge servers, which are normally nearby users. However, a significant challenge is aroused in MEC because of the mobility of users. User trajectory prediction technologies could be used to cope with this issue, which has already played important roles in service recommendation systems with MEC. Unfortunately, little attention and work have been given in service recommendation systems considering users mobility. Thus, in this paper, we propose a mobility-aware personalized service recommendation (MPSR) approach based on user trajectory and quality of service (QoS) predictions. In the proposed method, users trajectory is firstly discovered by a hybrid long-short memory network. Then, given users trajectories, service QoS is predicted, considering the similarity of different users and different edge servers. Finally, services are recommended by a center trajectory strategy through MPSR. Experimental results on a real dataset show that our proposed approach can outperform the traditional recommendation approaches in terms of accuracy in mobile edge computing.

Undoubtedly, user mobility has a detrimental impact on the QoS-based service recommendation [6].On one hand, a user requests a cloud service by his/her mobile terminal device continuously, the service will be provided by different edge servers during physical location changes.On the other hand, QoS data of one edge server may prominently volatile due to user mobility, as the service has to switch among different edge servers frequently, resulting in higher network overhead.Although some approaches [7,8] on service recommendation have already been proposed in MEC, these approaches directly overlook user mobility, or merely consider user mobility with unrealistic models, yielding inappropriate service recommendations.User mobility brings two main problems,which are not fully taken into account as follows, • Frequent handoff among edge servers The handoff among different edge servers occur frequently caused by user mobility [9].In such a case, a user request the desired service, which will be provided by different edge server at different moments, because of his dynamical location changes [10].Each edge server is only able to provide the service for a moment due to the high QoS performance in a small area.The network load and server load can be increased by data transmission among servers.Besides, the QoS may be changed or even absent on servers.Therefore, user mobility leads to frequent handoff among edge servers and significantly degrade service performance [11].• Volatility of QoS data In the light of extensive network changes, the QoS data are unstable.One active user invokes the service many times, and QoS data is different each time.Different users who invoke the same service are provided by different QoS data at the same time.This phenomenon is common in real life.Especially in MEC, the QoS data is different each time, because of different performance, surroundings and the number of users using services at that time.So the QoS data is highly volatile, it is more complicated when recommending better services for users.
To address these questions, a mobility-aware personalized service recommendation approach is proposed in this paper, it fully considers user mobility when recommending services, makes personalized service recommendations according to different users' location change, to improve the experience of users and reduce network load.Specifically, user trajectories are predicted through mobility patterns leveraging a hybrid long short-term memory (LSTM) network firstly, which helps to obtain candidate edge servers candidate servers.Next, we predict QoS data on candidate servers based on the trajectory by reducing the influence of the above two factors.Then, QoS predictions are carried out based on a location-based collaborative filtering approach, the service with the best QoS data will be recommended to the user.The major contributions of this paper are summarized as follows: • A hybrid LSTM-based mobility prediction model(LSTMM) is proposed to predict user trajectories from long-range and sparse position data, in which server information as well as user characteristics and distances information are considered to improve the prediction efficiency.
• We put forward a mobility-aware personalized service recommendation approach, focusing on predicting the QoS data of servers along trajectories.Information of users similar to a specific user is applied to reduce the volatility of QoS data, which will improve prediction accuracy.Servers around predicted places on the trajectory will provide global optimal QoS values and reduce the network overload.
The rest of this paper is organized as follows: Sect. 2 summarizes the related work.Section 3 introduces a motivation scenario.Section 4presents our mobility-aware service recommendation approach based on trajectory prediction and edge server similarity.Section 5 describes the implementation of our experiments and performance comparisons.Section 6 draws a conclusion.

Related work
Many literature over the past decade focused on developing service recommendation systems.Most of these works focus on collaborative filtering based recommendation [7,12,13], content-based recommendation [14,15] and model-based recommendation [16,17].Shao et al. [18] proposed a user-based collaborative filtering method for predicting the web service QoS value and conducted experiments on 20 web services.Zheng et al. developed a web service recommendation system called WSRec [19][20][21] for collecting a large-scale real-world web service QoS information through a user-collaborative mechanism.They proposed a hybrid collaborative filtering approach to predict web service QoS value by combining the user-based Pearson correlation coefficient(PCC) approach and the item-based PCC approach [20].Sun et al. [12] presented a normal recovery collaborative filtering approach to solve the personalized web service recommendation problem.They proposed a new similarity measure for web service similarity computation and proposed a novel collaborative filtering approach.Better prediction accuracy is achieved through fusing the information of similar users and similar web services.Wang et al. [7] performed the prediction via a set of multi-dimensional QoS measures through exploiting the structural relationships among multi-dimensional QoS data.They proposed an integrated QoS prediction approach to recommend efficient Web service for mobile clients.These approaches made a lot of effort on improving the accuracy of service recommendation and achieved great success in the traditional Web service recommendation.Due to users' mobility and QoS volatility, these approaches will lead to large deviations and inappropriate results when recommending services in mobile edge computing.
To address these problems, many studies have been studied on the location-based recommendation [22][23][24].Zheng et al. [25] presented a user-centered collaborative location and activity filtering approach to cluster many users data, applied the collaborative filtering to find like-minded users and like-patterned activities at different locations.They modeled the user location-activity relations with a tensor representation and proposed a regularized tensor and matrix decomposition solution to address the sparse data problem in mobile circumstances.This approach only considered the users locations, not service locations.Chen et al. [26] proposed a location-aware Web service recommend system, which employed both location information and QoS values to cluster users and services.They made personalized QoS prediction for users on the clustering results according to user locations and QoS values.Location-Aware and personalized collaborative filtering approach [27] leveraged locations of both users and Web services when selecting similar neighbors for the target user or service.The method presented an enhanced similarity measurement for both users and Web services, by taking into account the personalized influence of them.Wang et al. [7] indicated that user mobility often makes service QoS prediction values deviate from actual values in mobile edge computing networks.They proposed a service recommendation approach based on collaborative filtering considering user mobility.They divided service invocation into two cases and calculated user or edge server similarity separately.But the frequency of mobility did not take into consideration, which may bring immigration among different edge servers frequently.
Although the location is vital to service recommendation at the current time, it cannot explain movement trends, and it is not sufficient to predict QoS data only considering the next location.Therefore, these approaches will bring inaccurate even bad results in MEC.To address these problems, we propose an approach that both consider the user trajectory and the data volatility to provide high quality services.

Scenario
A mobile edge network consists of multiple mobile edge servers (MESs), which provide network access services for mobile users anytime in a certain range,such as airports,large shopping malls, museums, etc. Suppose that a mobile user named Jenny often uses services to obtain surrounding information in an airport, such as AR/VR, location, discount, etc.
Considering Jenny is invoking service s by accessing the nearby mobile edge server MES1.As Fig. 1 depicts, she uses service s continuously on her traveling from A to B along the trajectory as the black dotted line is shown.In this situation, how to predict the next accessing edge server and the corresponding QoS value of the service becomes an important issue.If service s is always provided by the nearest edge server, that is to say, the green-line option: MES1→MES2→MES5→MES3→... will provide the service successively.However, service s in MES2 may have bad quality (e.g., the response time is 100ms) for accessing by many people at that time.After that, Jenny will access MES5 with the response time is 95ms for the shortest distance.Meanwhile, the response time of service s is 95ms when accessing MES4 during the entire moving process.Therefore, the red-line option: MES1→MES4→MES6→... will obtain the best experience globally, which has the same path direction as Jenny's trajectory.Therefore, the users experience can be improved and network delays can be reduced compared to the case where only the nearest edge server is recommended.In the above scenario, the trajectory defines user mobility more accurately than the current location.

Problem formulation
In this section, we first define the mobility prediction model, then the mobility-aware personalized service recommendation problem is formalized.Trajectory data are the foundation of the mobility prediction, which characterize locations and times of moving objects.A trajectory is a chronologically ordered sequence of spatio points.A spatio point q i is defined as a tuple of its coordinate < x i , y i > .A sequence sq is a set of spatio point q i , i.e. sq=q 1 q 2 ...q n ,(n ∈ D) .A subsequence of sq is defined as sub(sq r ) l =q r−l ...q r−1 q r , where r-l is the start position on the subsequence, and l is the number of spatiotemporal points.
Formally, given a sequence set SQ and an active user u,the trajectory set of user u is a chronologically ordered subsequence.Tr(u)=sub(sq r ) l contains all the trajectories gen- erated by user u with the sequence length l.A trajectory of user u which is recorded at the t time window can be defined as Tr(u) t =sub(sq t ) l =q t−l ...q t−1 q t ⊆ Tr(u).
If the current time window is t, then the trajectory history can be denoted as Tr(u) 1 , Tr(u) 2 , • • • Tr(u) t−1 .For the convenience of calculation, we discretize continuous time interval t to hour of day and day of week.
The mobility prediction problem can be formalized as: Problem 1 Given a user's history trajectory set Tr(u) and the current trajectory Tr(u) t , the mobility prediction is to predict the user's trajectory Tr(u) t+1 at the next time interval, the prediction length l=len(Tr(u) t+1 ), that is, construct the predicting model f (Tr(u), Tr(u) t ) → Tr(u) t+1 .
Analysis results [28] show that people's trajectory with high probability, which confirms the existence of mobility patterns for users.If the mobility pattern can be obtained through the history trajectory, then the Problem 1 will be solved according to the related mobility pattern information.
Definition (Mobility pattern) Given a trajectory set Tr of users U, the user mobility pattern mp is a set of typical trajectories that can indicate the characteristics of users movement and its uniqueness.Apparently, QoS properties, including response time, throughput, failure-probability, etc., are heavily dependent on network environments and users location [26].As a result, in service recommendations, the QoS properties of MEC servers along trajectories should be considered rather than only selecting the nearest ones.Therefore, our motivating problem is to make more accurate QoS estimations based on the trajectory for personalized service recommendations in MEC to improve user experience and reduce the overload of networks.Therefore, the user mobility-aware personalized service recommendation problem in MEC can be formulated as follows: Problem 2 Let U be a set of users, S be a set of services, MES be a set of MEC servers, an active user u ∈ U is using a service s ∈ S providing by mes ∈ MES when roam- ing at m , then u leaves the service area of mes or the QoS of s gets worse gradually, the mes i ∈ MES around the predicted trajectory Tr(u) t+1 will be recommended to provide service s for user u for better QoS.The problem is predicting the QoS data of service s on MES along the predicted trajectory Tr(u) t+1 , then the server mes j ∈ MES with the best QoS data will recommend to u.
To reach this goal, several challenges must be addressed, including: (1) How to discover the user mobility pattern and predict the trajectory.( 2) How to redefine the collaborative filtering algorithm to predict QoS data and perform service recommendation when considering edge servers information.

Mobility-aware personalized service recommendation in MEC
In this section, we propose a two-stage mobility-aware personalized service recommendation approach.Firstly, a LSTM-based mobility prediction model(LSTMM) is presented to predict the user trajectory by combining the user information, historical trajectory information and distances between servers.Then a personalized server recommendation approach is presented to predict the QoS data on the mobile edge servers around the trajectory by weakening the volatility of QoS data.
As shown in Fig. 2, our proposed approach consists of three steps as follows: 1. Trajectory prediction.In this stage, user mobility patterns can be discovered by the historical trajectories and user information, then a fully connected classifier is built to predict the future trajectory by combining mobility patterns and the current position.The servers along the trajectory consist of candidate servers set CS, which considering the frequency mobility of users in the recommendation process.
Fig. 2 Framework of mobility-aware personalized service recommendation approach 2. QoS prediction: The QoS data provided by the candidate server set CS will be predicted in this stage.We propose a personalized service recommendation approach, that considers the similarity of both users and servers to weaken the volatility of QoS data.QoS data on each edge server is personalized, which calculates on the basis of similar users and similar servers.3. Service recommendation: According to predicted QoS data along the trajectory, we make service recommendations to meet user's personalized needs.

A hybrid LSTM-based mobility prediction model
In this section, textcolorredLSTMM is presented to discovery user mobility patterns and predict the user trajectory, then the edge servers around the trajectory will be the candidate servers recommended.

User mobility patterns discovery
Each trajectory has different spatio points and variable temporal distances.To process these long-term variable length trajectories, we employ LSTM network to discover user mobility patterns.LSTM is a particular implementation of recurrent neural network, which can learn long-term dependency information and avoid the problem of gradient disappearance.
It is generally considered much suitable for time series.The network architecture of the LSTM predictor is schematically presented in Fig. 3. Specially, we take the user information and the historical trajectories as the input to model the characteristic of mobility patterns.Before training the model, the spare representation of user and location information are converted into a dense vector.Position vector pos i is embedded to p i by where V p is an trainable embedding matrix for all positions, and pos i is an one-hot vector of a spatio point.User information vector u j is embedded to u j by (1)  where V u is an trainable embedding matrix for all positions, and us j is an one-hot vector of a user.
For the trajectory vector Tr(u j ) t = {p s , p s+1 , ..., p t } , let h t and h t+1 denote the previous and current embedding state respectively.The basic LSTM model, which takes p i and h t as inputs, the implementation is as follows: where f t+1 , i t+1 , o t+1 are the forget gate, input gate and output gate respectively, σ stands for the standard sigmoid function, W are different gate parameters, and b is the bias.The memory cell c t+1 is updated by partially replacing the existing memory unit c t with a new cell as: The embedding of the trajectory Tr(u j ) t+1 which expresses the mobility pattern infor- mation is then output by,

Users trajectory Prediction
To predict the following trajectory of an active user, a fully connected encoder takes the encoded u j and Tr(u j ) t as input and predicts the probability Pr t+l of user u j belonging to each place P i in the future t+l time by where fc t+l is the output of feature data after fully connection operation in the l t h branch, σ stands for the standard ReLU function [29].Then, a softmax layer is used to normalizes the output value fc t+l whose formula is given as, Besides, due to the limitation of users movement, the distance among the current server and the future servers is also an important factor during the trajectory prediction.
is defined as a |P| th vector represents the distance between the current server position pos i and the positions of other edge serv- ers.A typical geographic distance algorithm [30] is adopted to calculate the distance d j (1 ≤ j ≤ |P|) , which means the distance between pos i and pos j , where pos i and pos j specified by the coordinates < x i , y i > and < x j , y j >, (2) (5) h t+1 = o t+1 tanh (c t+1 ).

(6)
Pr t+l = softmax(f c t+l ), (7) with hav(θ)= sin 2( y 1 −y 2 2 )+ cos y 1 cos y 2 sin 2( , where θ is a central angle between the two edge servers and R is the radius of the Earth, which we assume to be 6371 km. Considering the distance effect on the future position result, a parameter α(0 ≤ α ≤ 1) is employed to adjust the final results.The probability of position on t + l time can be formula by,

Implementation
The model is trained by maximizing the likelihood of the true position being generated from the predicted value.Hence, we jointly learn all the parameters by minimizing the negative cross entropy loss L= − m l=1 y l log(P l |W,b) for the future trajectory.An important aspect of the training phase is all parameters should be learned jointly, since the hybrid LSTM layers of the encoder and decoder units are trained in an end to end fashion.Thus, an adaptive gradient descent algorithm is used to backpropagate the loss for each trajectory at every time slot t.The pseudo-code of the trajectory prediction is shown as Algorithm 1. for each 1 ≤ l ≤ seq do 20:

Algorithm 1 Mobility Prediction
Calculate predict probability P r t+l by Formula (6) 21: Calculate per time probability of belonging to each known location P l by Formula (9) 22: Calculate lossEntropy(P l , onehot(pre l )) 23: end for 24: Update model parameters by adaptive gradient descent 25: end for 26: until convergence Algorithm 1 takes the trajectory set Tr, the user set U, trajectory length lag and prediction length seq as input, and output is a trajectory predicted model with stable parameters.Line 1-9 is the data pre-processing stage, where an empty training set is constructed in line 2, and the distance matrix D between each spatio point is (9) calculated in Line 5-7.Lines 5 and 6 indicate that the sub-sequence St(u) of length (lag + seq) is extracted from the user trajectory Tr(u), then the front lag locations of each sub-sequence are used as training data, and the seq locations are used as training labels, and line 7 get the distance dist p between the current location p lag and all loca- tions from the distance matrix D. Line 10-26 is the stage of model training, line 11 initializes all trainable parameters of the model.The line 15 and 16 convert the sparse representation of the user and the location into a dense vector emb u and emb(p i ) through the trainable embedding matrix, and line 17 inputs the sequence location vector into the LSTM-cell to obtain the vector representation encoder v tr of the tra- jectory.Vector join is to connect the user's representation and the trajectory representation as a user trajectory pattern vector and as an input to the location prediction classifier in line 18.The line 20 and 21 calculate the output of the location prediction classifier and output the final prediction probability P t+l in conjunction with the loca- tion distance according to the Formula ( 6) and ( 9).Line 22 calculates the training loss and line 24 update all trainable parameters by adaptive gradient descent.

Mobility-aware personalized service recommendation
The number of QoS data on MEC servers is not large in MEC, because of the user mobility and the service quantity.When services are provided, it can be described by a user-serviceserver matrix, the majority of empty data in the matrix donates that the service has never been invoked by any user on the server before, which leads to the matrix density.Besides, the QoS data vary greatly on different servers, due to the variety of edge servers.The traditional similarity calculation methods [31] do not properly handle the QoS data in different vector spaces.To overcome these shortcomings, a location-based collaborative filtering (LCF) method is proposed to recommend services.

Normalized similarity calculation
In our approach, we first measure the similarity between servers and users to predict QoS data on certain servers.The user-service-server matrix is decomposed into user-service matrix US and server-service matrix SS firstly.Then we normalized each row of the original US and SS to eliminate data variety.
Assume the server s and t co-provide services J, sdist(s, t) calculates the Euclidean distance between s and t in the |J|-dimensional vector space, while sdis max calculates the maximal Euclidean distance in the |J|-dimensional vector space.Therefore the formula to measure the similarity between two servers s and t is as follows: where J = J s ∩ J t is the set of services co-provided by servers s and t; r s,t is the value of service j provided by server u in the server-service matrix SS; r smin and r smax denote the lowest and the highest values from server s in SS, respectively; r tmin and r tmax denote the (10) lowest and the highest values from server t in SS, respectively.Sim(s, t) = 0 represents that two servers are dissimilar and Sim(s, t) = 1 indicates that two servers are the same.
To calculate the similarity between users, similarly, relying on normalizing service QoS data, the original user-service matrix US is also mapped into the row-normal userservice matrix where each row is in the range of [0,1].The formula to measure the similarity between two users u and v is as follows: where I = I u ∩ I v is the set of services co-invoked by users u and v; |I| is the number of I; r u,i is the QoS value of service i from user u in the user-service matrix P; r umin and r umax denote the lowest and the highest values from user u in US, respectively;r vmin and r vmax denote the lowest and the highest values from user v in US, respectively.Sim(u, v) = 0 represents that two users are dissimilar and Sim(u, v) = 1 indicates that two users are the same.

Location-based Collaborative Filtering
Based on the normalized similarity measurement approach, we propose a Locationbased Personalized QoS Prediction method.In our approach, the prediction value is calculated by the value of similar users and similar servers.
When predicting the unknown QoS value ru,i of user u on service i, our approach recover the original scale of user u or service i.In the user-based QoS value prediction, we define our user-based CF as follows: where U denotes the set of similar users to user u, who have invoked service i; nr u ′ ,i is the value of service i from user u ′ in the row-normal matrix US nu ; r umin and r umax are the lowest and the highest values from user u in the original matrix US, respectively; and Sim(u, u ′ ) can be computed by formula (11).
In the server-based value prediction, we first cluster servers using K-means [32] to reduce the influence of the servers sparsity.Then we create server-based CF to predict the unknown QoS value rs,i of server s when provides service i, whose formula is given as: where S denotes the set of similar servers to server s, who have provided service j; nr s ′ ,j is the value of service j provided by server s ′ in the row-normal matrix SS nu ; r smin and r smax are the lowest and the highest values from server s in the original matrix SS, respectively; and Sim(u, u ′ ) can be computed by formula (10).
To make use of the information from both similar users and similar servers, a parameter (0 ≤ ≤ 1) is employed to determine how much does the prediction rely (11) , on user-based CF or server-based CF.Our approach makes prediction by employing the following equation: when = 1 , the approach only uses information of similar users to make prediction.When = 0 , it uses information of similar server for predicting the QoS data.When 0 < < 1 , it systematically combines the user-based CF approach and the item-based CF approach to fully utilize the information of both similar users and similar servers.

Service Recommendation
After predicting an active user trajectory, the mobile computing platform will choose servers around the trajectory and predict the QoS data on these servers.We assume that the best position is the center of the predicted trajectory which is the best distance to provide services for the user.servers around the best (within bkm radius) will be considered to provide good QoS data for the active user.The mobile edge computing platform will calculate the QoS data of the service on these servers based on LCF, and recommend the active user to use that on the new edge server with the best QoS data or still use the service provided by the current edge server.In this way, personalized service recommendations can be achieved without conducting the expensive and time-consuming real-world service invocations on the edge server.The process of mobility-aware personalized service recommendation(MPSR) for an active user is shown in Algorithm 2.

Algorithm 2 MPSR Algorithm
Input: an active user u ∈ U ; History trajectories htr of u; The service s invoked by u; Trajectory length lag; Prediction Trajectory seq; Neighbor's search radius r Output: Server with the best QoS 1: p servers = M obilityP rediction(u, htr, lag, seq)//Using the trained predicted locations model to obtain a prediction sequence of length seq 2: center p = get center(p servers) // find servers center.3: nb servers = get neighbors(center p, r) // Find neighbors near the center point within radius r. 4: QoS = dictionary() //Initialize a candidate set and save the QoS of each server.5: for each s ∈ nb servers do 6: QoS[s] = Get QoS(u, b, s)//According to Eq.( 14) 7: end for 8: best server = get best server(QoS) // find the best QoS server 9: return best server

Results and discussion
In this section, we present experiments to verify the performance of our approach and compare the results with other recommendation methods.Our experiments are intended to (1) validate the rationality of our proposed approach; (2) compare our approach with other trajectory prediction methods; (3) compare our approach with other recommendation methods without considering the mobility; and (4) analyze parameters of our approach to achieve optimum performance.(14) rs,u,i = × ru,i + (1 − ) × rs,i ,

Dataset description
In our experiments, we merge two real-world datasets on data fusion [33]: the WSDream dataset [20] and the Shanghai Telecom base station dataset [7].The WSDream dataset contains the real-world QoS evaluation obtains from 142 users on 4500 web services in 64-time intervals, QoS evaluations contain response time, throughput, etc.The Shanghai Telecom dataset contains the information about 6357 users invoked on 3233 base station, it is regarded as user historical trajectories.The base stations are considered as edge servers in our experiment.A hybrid dataset is constructed according to the previous work [7], which contains both QoS data, edge server locations, and user trajectories.

Evaluation metric
Since our approach tries to predict top-K candidate positions for each user trajectory, we adopt the accuracy of top-K(ACC@K) [34] to evaluate the performance.ACC@K is the percentage of accurate predictions, i.e., correctly predicts the following positions for users, which is calculated as: To evaluate the QoS value prediction accuracy, we adopt the commonly used Mean Absolute Error(MAE) [35] and Root Mean Squared Error(RMSE) [35] as the accuracy metrics.MAE is defined as follows: where r u,i is the actual QoS value of user u using service i, ru,i is the corresponding pre- dicted QoS value, N is the total number of test samples.The RMSE is defined as follows: the meaning of the r u,i , ru,i and N are the same as the formula (16).For the position sam- ples, the smaller the values of RMSE are, the more accurate the prediction.

Performance comparison on QoS prediction
For the sake of demonstrating the performance and effectiveness of our location-based collaborative filtering recommendation approach(LCF).We compare the MAE and RMSE with other approaches.The other approaches are as follows: • User-Based Collaborative Filtering Recommendation Approach (UCF): This approach is to predict QoS values by user-based prediction algorithm using Pearson correlation coefficient, employs similar users for service recommendation; • Service-Based Collaborative Filtering Recommendation Approach(SCF): This approach is to predict QoS values by item-based prediction algorithm using Pearson correlation coefficient, employs similar web services for service recommendation; (15) • Hybrid Collaborative Filtering Recommendation Approach (HCF): This approach is to predict QoS values by combining the user-based and service-based prediction approach for service recommendation; We make service recommendations in terms of qualities of service(response time and throughput) for randomly active users and compare our approach with others.The experimental results are shown in Table 1.
The results show that the MAE and RMSE values of our approach are all smaller than other approaches under different matrix density.We set the matrix density from 10% to 90%.The MAE and RMSE values increase gradually when the matrix density is set as 10% to 70%, which shows that prediction accuracy decreases.Because prediction results are in deviation when less information on similar users and services.The MAE and RMSE values increase dramatically when the matrix density increases 90%, because similar users and servers are rare.The MAE and RMSE values of our approach are smaller than other approaches, indicating that the prediction accuracy can be improved by our approach because we consider the volatility and the mobility.We take the similarities of both users and servers into consideration.In MEC environment, QoS data provided by different edge servers and various conditions, the QoS prediction provided by similar servers will eliminate volatility effectively.Besides, we normalize QoS data before calculating similarities.

Performance comparison on trajectory prediction
For the sake of demonstrating the trajectory prediction accuracy of LSTMM.We compare the ACC@K with persistent(benchmark), Seq2Seq [36] and CNNM [37].werandomly select 20% data from our dataset to verify the trajectory prediction accuracy and compare our approach with other methods.
The length of the predicted trajectory is not long in terms of the prediction accuracy.The literature [10] shows that with the length of the predicted trajectory increases, the prediction accuracy will gradually decrease.In this experiment, we only predict the trajectory of the next (T + 3) th time.Figure 4 shows the ACC@1 and ACC@5 values in different prediction trajectory length.The row labels T + 1 , T + 2 , and T + 3 express positions on the (T + l) th time in the predicted trajectory.The difference between pre- diction accuracy in each position is small because they are predicted at the same time.When the ACC@5 chooses the top 5 candidate position as the correct position, its value is much better than ACC@1, which only chooses the most likely position.Compared with other approaches, the ACC@1 and ACC@5 values of our approach are greater slightly.Compared with the Seq2Seq model only uses LSTM coding, the ACC@1 value of our approach increases by about 4% on average due to considering user characteristics and distances among servers.CNNM also results in poor prediction performance, because it is depend on the convolutional network, which is unsuitable to solve the longterm dependence problem.Therefore, our approach takes advantage of long-term and short-term dependence and considers more information, which lead to more accurate results than other approaches.

Impact of recommendation strategies
Trajectory prediction plays an important role in service recommendation.We analysis the impact from two aspects, first we compare the recommended QoS data with our approaches to other recommending strategies: • Random Location Service Recommendation(RLSR): Randomly select a server around the current server, it will be the candidate server providing the service at the next time.• Nearest Location Service Recommendation(NLSR): Select the nearest server to the current server as the candidate server providing the service at the next time.
The experimental results are shown in Fig. 5.We set the prediction length of the trajectory to be next T + 1 , T + 2 , and T + 3 times.With the trajectory prediction times increasing, QoS data changes slightly in our approach, which shows that our approach can provide a consistent quality during the movement of users.The QoS changes impermanence in RLSR and NLSR, because of recommending services randomly.It also illustrates that the nearest server may not always provide the best QoS.Besides, our approach reduces the number of handoffs among servers.In our approach, we choose the server with the best QoS which around the center of predicted trajectory as the recommendation, therefore, we only handoff the service one time during prediction.Comparatively, the service has to transfer once when a user moves each time in RLSR and NLSR, which will increase the loading and decrease the performance of the network.The limitation of our approach is the prediction length cannot be too long, which will decrease the QoS with the expanding area.

Impact of MES distribution
Figure 6 shows the distribution of historical trajectory points for three typical active users randomly selected from the dataset.The distribution of each active user historical trajectory point and edge servers are very different.For user 58, the distribution of both trajectory points and the edge servers are well-proportioned.The distribution of trajectory points is well-proportioned, and the distribution of edge servers are disproportioned for user 68.Both of the historical trajectory points of users 83 and the surrounding servers are distributed dis-proportioned.Then, we analysis the recommendation results for the three active users shown in Fig. 7.The results show that the greater the QoS data provided, the greater the range of distances.There are also some slight  fluctuations, which are caused by the dis-proportioned distribution of edge servers.The throughput increases obviously when the range of distance is more than 1 km, and the response time reduces when the range of distance is between 0.8 km to 2 km.On the whole, the QoS data changes are less obvious with radius increases after 2 km.Hence, we predict QoS data in the range between 0.8 km and 2 km for active users to examine which distance ranges provided the most accurate service recommendations.

Impact of parameter
Different geographical areas may have different data correlation characteristics.parameter makes our prediction method more feasible and adaptable to different data sets.We fuse information from both similar users and similar servers to predict the missing value for active users.To study the impact of the parameter to our hybrid collaborative filtering method, we vary the value of from 0 to 1 with a step value of 0.1.If = 1 , we only consider information from similar users, and if = 0 , we only con- sider information from similar servers.MAE and RMSE are compared to study the effect of the for the prediction accuracy.The experimental results are shown in the Table 2, which shows that MAE gains the best performance when = 0.8 (corresponding to the bold and italic value in column MAE in Table 2) and RMSE gains the best performance when = 0.7 (corresponding to the bold and italic value in column RMSE in Table 2).It means that user-based collaborative filtering has a greater influence on the prediction results on our dataset.Because in our experimental data, the number of servers is larger than the number of users, the average number of samples per user is much larger than the number of samples corresponding to each server, which results in the sparsity of the server-service matrix.Therefore, will prefer to set 0.7 as the fusion factor in the experiment.

Conclusion
In this paper, we investigate the problem of service recommendation in Mobile Edge computing for frequent mobility scenarios.We propose a two-stage approach for predicting QoS values on mobile edge servers by systematically combining user mobility and location-based Collaborative filtering.We first present a hybrid LSTM-based mobility prediction approach to obtain an active user trajectory by jointly consider server information, user characteristics and distance information.Then a mobility-aware personalized service recommendation approach is proposed to acquire the QoS values based on the mobility results.We conduct simulation experiments to study the performance of the proposed work base on the real dataset.Large-scale real-world experiments are conducted and the comprehensive experimental results show the effectiveness and feasibility of our approach.
In our future study, we will research on more trajectory prediction method, e.g., social GAN and ESN, can be employed to predict the future position of users to further improve the QoS values prediction.And other factors should be considered, e.g., the impact of time, when the service is recommended in the mobile edge computing.

Fig. 1
Fig. 1 Scenario of service recommendation in MEC

Fig. 3
Fig. 3 Network architecture of the LSTM predictor

Fig. 4
Fig. 4 Prediction accuracy comparison of trajectory prediction methods

Fig. 5
Fig. 5 Impact of different recommending strategies on QoS

Fig. 6 Fig. 7
Fig. 6 Historical track point distribution and neighbor distribution for different users

Table 1
Impact of data sparsity on prediction accuracyThe significance of "bold and italic values" is used to highlight the data in LCF is better than other methods

Table 2
The effect of lambda taking different values on prediction accuracyThe significance of "bold and italic values" highlights the best value in MAE and RMSE respectively, which is used to choose the best