## 3 The Location-Based Interactive Model
### Mapping Functions  
We model a set of functions that used to integrate the IoT and cloud based on the location of mobile users. _Function 1:_ When an application \(\alpha\) is registered with an IoT cloud, a function \(f(\alpha_{SI})\) to map sensors of interest of the application to a set of actual sensor types \(\tau_{\alpha}^{*}\subset\tau\) within its region of interest \(\alpha_{RI}\) is modeled as follows:  
\[f_{1}(\alpha_{SI})=\tau_{\alpha}^{*}=(\tau_{j}:\tau_{j}\in\tau). \tag{2}\]  
_Function 2:_ The IoT-cloud then allocates a set of virtual sensors with the same types of \(\tau_{\alpha}^{*}\) that are responsible for providing sensing data of the types of \(\tau_{\alpha}^{*}\) in \(\alpha_{RI}\). An allocation function is defined as follows:  
\[f_{2}(\alpha_{RI},\tau_{\alpha}^{*})=\gamma_{\alpha}^{*}(\gamma_{j}:\gamma_{j- >type}\in\tau_{\alpha}^{*}and\gamma_{j->location}\in\alpha_{RI}). \tag{3}\]  
These virtual sensors are assigned to provide sensing services for the the application \(\alpha\). Sensing services in our IoT-cloud paradigm for mobile computing applications are provided based on the location of mobile users. Based on the location of mobile users, specific virtual sensors and physical sensors will be assigned on-demand. Assume a user \(\mu\) is using an application \(\alpha\) provided by the cloud. The application sends a request to the cloud for sensing data. The cloud first checks whether or not the current location of the mobile user \(\mu\) is within the registered location of interest of the corresponding application \(\alpha_{RI}\). _Function 3:_ If \(\mu^{current}_{L}\in\alpha_{RI}\), a specific subset of virtual sensors that are responsible for that area will be determined to serve the user:  
\[f_{3}(\mu_{RI},\gamma_{\alpha}^{*})=\gamma_{\mu}^{*}(\gamma_{\mu}^{*}\in\gamma _{\alpha}^{*}\&\gamma_{j->location}\in\mu_{RI}), \tag{4}\]  
where \(\mu_{RI}\) is the region of interest of the user \(\mu\) with a radius of \(R\) around his location. The specific range \(R\) around the current location of \(\mu\) depends on applications, which is not covered in this paper. The cloud can reversely map the set of virtual sensors \(\gamma_{\mu}^{*}\) to a set of corresponding physical sensors \(\zeta_{\mu}\). We model the reserved mapping function as follows:  
\[f_{vir->ply}(\gamma)=\zeta=f_{phy->pi}^{-1}(\zeta). \tag{5}\]  
We now discuss two interactive models for physical WSNs with the cloud. In the first model, the sensor periodically reports sensing data to the cloud. In the second model, sensors are scheduled to report sensing data on-demand based on the location of mobile users. _Function 1:_ When an application \(\alpha\) is registered with an IoT cloud, a function \(f(\alpha_{SI})\) to map sensors of interest of the application to a set of actual sensor types \(\tau_{\alpha}^{*}\subset\tau\) within its region of interest \(\alpha_{RI}\) is modeled as follows:  
\[f_{1}(\alpha_{SI})=\tau_{\alpha}^{*}=(\tau_{j}:\tau_{j}\in\tau). \tag{6}\]  
_Function 2:_ The IoT-cloud then allocates a set of virtual sensors with the same types of \(\tau_{\alpha}^{*}\), which are responsible to provide sensing data of the types of \(\tau_{\alpha}^{*}\) in \(\alpha_{RI}\). An allocation function is defined as follows:  
\[f_{2}(\alpha_{RI},\tau_{\alpha}^{*})=\gamma_{\alpha}^{*}(\gamma_{j}:\gamma_{ j->type}\in\tau_{\alpha}^{*}and\gamma_{j->location}\in\alpha_{RI}). \tag{7}\]  
These virtual sensors are assigned to provide sensing services for the application \(\alpha\). Sensing services in our IoT-cloud paradigm for mobile computing applications are provided based on the location of mobile users. Based on location of mobile users, specific virtual sensors and physical sensors will be assigned on-demand. Assume a user \(\mu\) is using an application \(\alpha\) provided by the cloud. The application sends a request to the cloud for sensing data.