# Design of an Integrated Remote and Ground Sensing Monitor System for Assessing Farmland Quality
## 3 Data Transmission Optimization Routing Protocol
### Data Transmission Scheduling
2: While \(n_{dn}>0\), \(n_{sn}>0\) and support nodes exist within a one- or two-jump distance from the demand nodes, do
3: For each \(D_{i}\), \(i\in n_{dn}\) and \(S_{j}\), \(j\in n_{sn}\), do
4: If \(D_{i}\) and \(S_{j}\) lie within a single jump distance, then
5: Record the route and accumulate \(DS_{i}\) and \(DR_{j}\)
6: Update the quantity of data transmitted for \(D_{i}\) and \(S_{j}\)
7: End if
8: If \(D_{i}\) and \(S_{j}\) lie within a two-jump distance, then
9: Find all routes from \(D_{i}\) to \(S_{j}\), and select the route \(N_{k}\) that has the greatest remaining energy
10: Record the route and accumulate \(DS_{i}\), \(DR_{j}\), \(DS_{k}\), and \(DR_{k}\)
11: Update the quantity of data transmitted for \(D_{i}\) and \(S_{j}\)
12: End if
13: End for
14: End while
15: Compute the energy consumption using \(DS\) and \(DR\). 16: Update the remaining energy for all nodes. ```  
**Algorithm 1**Unit Data Polling Scheduling and the Maximum Remaining Energy Routing Algorithm. The Algorithm 2 adopts maximum data greedy scheduling, which is a dynamic allocation algorithm that is similar to the greedy algorithm. Here, the demand node having the highest data transmission load assigns its data to the supply node within a distance of three or four jumps that has the greatest additional data transmission capacity. The list of demand nodes is then reorganized after each round of assignment according to the quantity of transmitted data from largest to smallest. As was adopted for short distance scheduling, route planning is conducted over medium distances using the maximum remaining energy routing algorithm as well. The primary advantages of this algorithm are that it reduces the number of assignments to reduce energy consumption during data transmission and that it balances the remaining energy of nodes over the cluster. ```
1: Initialize: The complete list \(N\) of sensor nodes and the number of sensor nodes \(n\), the list \(D\) of demand nodes, the quantity of data \(DD\) that must be transmitted, and the number of demand nodes \(n_{dn}\), list \(S\) of support nodes, the quantity of data \(SD\) available for support, and the number of support nodes \(n_{sn}\). 2: Sort \(D\) according to \(DD\) and \(S\) according to \(SD\) in descending order
3: If \(n_{dn}>0\), \(n_{sn}>0\) and support nodes exist within a three- or four-jump distance, then
4: For each \(D_{i}\), \(I\in n_{dn}\) and \(S_{j}\), \(j\in n_{sn}\), do
5: If \(D_{i}\) and \(S_{j}\) lie within three or four jumps distance, then
6: If \(DD_{i}\geq SD_{j}\) then
7:\(DD_{i}=DD_{i}-SD_{j}\)
8:\(SD_{j}=0\)
9: Else
10:\(DD_{i}=0\)
11:\(SD_{j}=SD_{j}-DD_{i}\)
12: End if
13: Find all routes from \(D_{i}\) to \(S_{j}\)
14: Select the route having the greatest remaining energy
15: Record the route and the amount of data transmitted
16: End if
17: End for
18: End if 2.3 Long-Distance Scheduling: Maximum Data Greedy Scheduling and the Diffusion Route Finding Algorithm

The conditions of long-distance scheduling occur when the demand nodes require more than four route nodes for transmitting data to the support nodes. Under this condition, the demand nodes and support nodes can be located anywhere within the cluster. The Algorithm 3 also adopts maximum data greedy scheduling, except that the distance between the demand node and the support node is neglected in the assignment process. It can reduce the computational time of the whole algorithm and reduce the number of routes required for conducting data transmission. Route planning is conducted over long distances using the diffusion route finding algorithm to obtain the minimal number of jumps required for data transmission from the demand nodes to the support nodes. The primary advantages of this algorithm are that it requires a relatively short computational time, reduces the number of routes required for conducting data transmission, and also reduces the required number of jumps in each route. Thus, the energy consumption of the entire cluster can be reduced during data transmission over long distances.