# Design of an Integrated Remote and Ground Sensing Monitor System for Assessing Farmland Quality
## 3 Data Transmission Optimization Routing Protocol
### Data Transmission Scheduling  
The data transmission scheduling adopted in the DTORP was developed to address differences between the maximum amount of data \(Q\) that can be efficiently transmitted to the UAV and the volume of data storage in each sensor node by adjusting the characteristics of data transmission within a sensor node cluster based on the neighboring node list of each sensor node. The algorithm seeks to obtain an optimal tradeoff between the volume of data transmission for each sensor node and the entire cluster, and the energy consumption of the WSN. To this end, all sensor nodes in a cluster are divided into three node types, namely, either demand nodes, support nodes, or route nodes. A demand node has a value of \(Q\) that is less than its volume of data and must therefore transmit some of its data to other sensor nodes. A support node has a value of \(Q\) that is greater than its volume of data, and therefore has the capacity to receive data for demand nodes. Finally, route nodes have a value of \(Q\) that is equal to their volume of data and assist in transmitting data from demand nodes to support nodes when a demand node is unable to communicate directly with support nodes. The fundamental purpose of our algorithm is to facilitate the identification of suitable support nodes for enabling the necessary sharing of data storage resources among the available nodes in the WSN. The proposed protocol further reduces energy consumption by combining the scheduling algorithm and routing algorithm employed for conducting data transmission between the nodes in a cluster over three distance scales, including short, medium, and long distances. These separate combined scheduling and routing algorithms are presented in the following subsections. 2.1 Short Distance Scheduling: Unit Data Polling Scheduling and the Maximum Remaining Energy Routing Algorithm  
The conditions of short distance scheduling occur when the demand nodes require only one jump or two for transmitting data to the support nodes. Here, single-jump transmission represents a condition where the demand nodes can transmit data to the support nodes directly, while two-jump transmission represents a condition where the demand nodes require another sensor node as a relay for transmitting data to the support nodes. The Algorithm 1 adopts unit data polling scheduling, which functions similarly to the round robin scheduling employed in cloud computing technology. Here, one unit of data is assigned in each round of the scheduling process to the support node lying within the shortest distance from each demand node. The assignment process ends when all the data transmission tasks of the demand nodes have been assigned or all the support nodes have no remaining data requiring transmission. The routes from the demand nodes to the support nodes are selected to maximize the remaining energy of the relay nodes. In this case, all demand nodes have the same probability of distributing their data to each support node lying within the shortest distance. The algorithm can maximize the volume of data transmission and make full use of the support nodes to reduce the energy consumption of the data transmission process between demand nodes and support nodes. 2.2 Medium Distance Scheduling: Maximum Data Greedy Scheduling and the Maximum Remaining Energy Routing Algorithm  
The conditions of medium distance scheduling occur when the demand nodes require three or four jumps for transmitting data to the support nodes. As such, the data routes pass through two or three different sensor nodes which serve as route nodes. ```
1: Initialize: The complete list \(N\) of sensor nodes and the number of sensor nodes \(n\), list \(D\) of demand nodes and the number of demand nodes \(n_{dn}\), list \(S\) of support nodes and the number of support nodes \(n_{sn}\), and the list of data sending \(DS\) and data receiving \(DR\) for all sensor nodes.