## 3 The Location-Based Interactive Model
### Location-Based On-Demand Sensing Model
#### 3.4.1 Selective Nodes for Transmission  
In wireless sensor networks, sensors are normally deployed densely and some nodes may obtain similar information. If the cloud requests all nodes within the region of interest to report sensing data, a great amount of data may be redundant. In our model, homogeneous virtual sensors from the same geographic region with similar sensing patterns are grouped into one cluster (i.e., corresponding to the same cluster for physical nodes) by the cloud. The similarity depends on the requirement of applications. We assume applications allow a sensing data error of \(err\). The cloud then groups sensors whose sensing values' difference is lower than or equal to \(err\), into a cluster. For example, two temperature sensors having similar sensing patterns with the difference of temperature values of 0.2 \({}^{\circ}\)C can be grouped into one cluster if the requirement of applications for \(err\) is greater than 0.2 \({}^{\circ}\)C. In this case, only one of the two nodes is required to report sensing data at a time to eliminate data redundancy. Sensors within a cluster produce similar data, so if they all report their data, a high redundancy will occur. Therefore, in each round, the cloud selects only one virtual sensor (i.e., corresponding to one physical node) within a cluster to serve mobile users to eliminate redundancy. Other sensors of the same cluster can sleep to save energy. For energy balancing, each node in a cluster is responsible as the active node for reporting data in one round if there are sensing demands. The role of active node is switched after each round (i.e., the length of one round is normally quite long, and equals a number of request intervals). For example, we assume that there is a cluster of four nearby temperature sensors that produce similar sensing data. It is inefficient when all four of the sensors are required to be active and transmit their data to the sensor cloud. In our model, only one of the four nodes is required to be active and report its sensing data to the cloud at a time when there are demands. The other three nodes can sleep to save energy. For energy balancing, in each round, a sensor with the highest residual energy among the four nodes is selected as the active node. Note that all operations are executed on the cloud, so no complexity is put into resource-constrained sensors. We model the cluster discovery of a virtual sensor \(\
u\) using network community discovery theory [20]. According to [20], we can define constraints so that the difference between sensing data \(\
u\) and other virtual sensors is minimized. Given a set of \(n\) virtual sensors \(N=1,2,...,n\) within a geographical region, a virtual sensor \(\
u\), determines a cluster \(C_{\
u}\) and a regression function \(\omega\) so that the difference, expressed through the loss function \(\Phi(\
u,\omega)=Loss(d_{\
u},\omega(d_{C_{\
u}}))\), where \(d\) are sensing values, is minimized. We assume that \(\omega\) is linear and \(\Phi\) is mean square error (MSE). For lowering the difference, we need to find a group of node \(C_{v}\)\(v\) so that a decision \(\zeta\) is minimized:  
\[\mathbb{E}[\Phi(D,\zeta)]=\mathbb{E}[(D_{v}-\zeta^{T}D_{C_{v}})^{2}]. \tag{10}\]  
In the formula, \(D_{x}\) is a random vector consisting of \(D_{v}\). The cluster discovery relies on a given historical data set consisting of \(h\) samples \(D=[d_{1}d_{2}...d_{m}]\). As correlations of nodes may change over time, the cluster discovery is updated periodically every round. We can apply a heuristic solution to discover a decision \(\zeta_{v}\) based on the given data set so that it can obtain the number of zero entries of \(\zeta\) as high as possible. In other words, we should look for a sparse decision \(\zeta_{v}\) that minimizes the mean square error (MSE) and the \(L_{1}\) norm.