# Mobility-Enabled Edge Server Selection for Multi-User Composite Services
## 3 System Model
### Multi-User Mobility-Aware Time Latency Computation  
With MEC, services can be housed in edge servers that can be used to accommodate service requests from users located in their coverage regions [19]. In this section, we discuss the time consumption computation model of the users. **Definition 5** (Server selection). : _Given a service \(ws=(I,O,C,QoS)\) and mobile path \(mp=(P,Se,F)\), suppose that \(ws\) is invoked at time \(t_{1}\); then, according to Definition 3, each \(Se\) is covered by the same edge servers. When the user is located in the \(Se\), the user can select the corresponding candidate servers that meet Equations (1) and (2)._  
\[d(r,(x,y))\leq radius_{r} \tag{1}\]According to Definition 2, the user who is not positioned within the coverage of an edge server will not be able to connect to it. Therefore, the distance between the user and the edge server should be less than the coverage radius of the edge server. Meanwhile, due to the limited resources of the edge server, if there are many users connected to an edge server to request service at the same time, the edge server may be overloaded. When the user connects to an edge server, the capacity constraint has to be taken into consideration:  
\[C\leq C_{r} \tag{2}\]  
\(C\) and \(C_{r}\) represent the resources required by the service _ws_ and the remaining resources of the edge server, respectively. Under the condition of satisfying Equation (2), if the user connects to an edge server to invoke a service, the capacity of the edge server will decrease (i.e., \(C_{r}=C_{r}-C\)). When the user leaves the coverage radius of the connected edge server, the remaining resources of the edge server will increase (i.e., \(C_{r}=C_{r}+C\)). Next, we discuss the time consumed by the user in invoking services. The time consumption is mainly decomposed into three parts, namely the time latency of transmitting input data, the time latency of transmitting output data, and the response time. Sometimes, when the user connects to the remote cloud servers, the round-trip latency should be added to the time consumption. The round-trip belongs to the transmitting time. When the user connects to the remote cloud servers, some data firstly are transmitted between the mobile device and the network access point (e.g., base station, Wi-Fi). After that, the data will be transmitted between the network access point and the remote cloud server and passed through multi-hop network nodes, whose transmitting time is called the round-trip. The round-trip latency is calculated only when the user connects to the remote cloud. If the user connects to the edge node, the data will not need to be transmitted between the network access point and the remote cloud server. We only need to calculate the data transmitting time between the mobile device and the edge node. Meanwhile, because of the limited radius of the single edge server, when the user leaves the coverage of an edge server with unfinished service and connects to another server, service downtime generated by service migration should be taken into consideration. **Definition 6** (Time consumption). : _Given a service \(ws=(I,O,C,QoS)\) and a selected server \(s_{i}\), suppose that ws is invoked at time \(t_{1}\). The time consumption of invoking the service is given by:_  
\[tc=t_{du}+Q_{ws}+t_{dd}+t_{rt}I_{1}+t_{dd}I_{2} \tag{3}\]  
_where:_  
1. \(t_{du}\) _is the time latency of uploading input data, which is given by:_ \[t_{du}=\frac{D(I)}{r_{s_{i}}}\] (4) _where_ \(D(I)\) _is the data size of_ \(I\) _and_ \(r_{s_{i}}\) _is the data transmission rate between the server_ \(s_{i}\) _and the user_ \(u\)_._
2. \(Q_{ws}\) _is the response time of service ws;_
3. \(t_{dd}\) _is time latency of downloading output data, which is given by:_ \[t_{dd}=\frac{D(O)}{r_{s_{j}}}\] (5) _where_ \(D(O)\) _is the data size of_ \(O\) _and_ \(r_{s_{j}}\) _is the data transmission rate between the edge server_ \(s_{j}\) _and the user_ \(u\)_;_
4.