# Distributed Reliable and Efficient Transmission Task Assignment for WSNs
## 5 Reliable and Efficient Task Allocation Algorithm for WSNs
### Distributed Task Assignment
#### 5.2.2 Distributed Reliable and Efficient Task Allocation in Planar Topology  
For a large-scale WSN, perceptual information needs to go through multi-hop communication to the sink. Considering the overhead of establishment, maintenance routing by node, and long-distance multi-hop communication delay in planar topology to ensure the reliability and scalability of WSNs, some researchers have proposed the multi-sink deployment scheme [22; 23; 24; 25] or software-defined network (SDN) controller [26]. The deployment strategies of multiple sinks in a planar topology include static and dynamic, random, and scheduled deployment methods. As an illustration, the static and mobile deployment of multiple sinks is shown in Figure 5.  
In a WSN with multiple sinks deployed, this section proposes a distributed task assignment strategy based on multiple sinks. Multiple sinks in this strategy have a global view of the entire network, enabling local requirements to be globally optimized and without the need to communicate with remote nodes, reducing the communication cost and latency of task assignments. (A) Consistency of Multi-Sink Global View  
Due to the geographical distribution and asynchronous operation features, when the sink publishes the global view, the update time of multiple sinks is not synchronized due to network delay or other reasons, resulting in inconsistency in the forwarding or processing of the task data. To share the global view among multiple sinks, it is necessary to consider the consistency problem of the global views between multiple sinks. In a resource-constrained WSN, how to efficiently share global view among multiple sinks to achieve fast and efficient global task allocation is still one of the significant questions. In [PERSON]'s consistency, availability and partition tolerance (CAP) theory, it has been proved that consistency, availability, and partition tolerance in a distributed system cannot be considered together [27]. Partition occurs easily in WSNs. If strong consistency is guaranteed, the availability of the network cannot be guaranteed at the same time, and the communication cost of realizing the  
Figure 5: Multi-sink deployed WSNs. (a) Static multi-sink WSNs; (b) mobile multi-sink WSNs. strong consistency of multiple sink global views in large-scale WSNs is high, the final consistency is chosen to reduce the communication cost of synchronization between nodes. In an existing final consistency technology, Dynamo, the storage platform of the key-value pattern of Amazon has been paid more attention by many researchers [28; 29]. Dynamo proposes an NWR model that guarantees eventual consistency, where \(N\) represents the number of copies of data being saved, \(R\) represents the number of copies required for each read success, and \(W\) represents the number of copies as are necessary for each write success. By setting \(R\) and \(W\), when \(R+W>N\), it produces a system similar to Quorum. Quorum is widely used in distributed storage systems [30; 31; 32; 33]. It is a set and a subset of all copies \(C\), where two parameters \(W\) and \(R\) are pre-defined for \(N\) copies, and \(N=|C|,\ W\geq 1,\ R\leq N\). The quorum set of writing is as follows:  
\[S_{W}=\{Q|Q\subseteq C\wedge|Q|=W\} \tag{12}\]  
and the quorum set of reading as:  
\[S_{R}=\{Q|Q\subseteq C\wedge|Q|=R\} \tag{13}\]  
If \(R+W>N\), there is an intersection between \(S_{W}\) and \(S_{R}\), so any read operation can return the latest write and guarantee strong consistency. Conversely, if \(R+W\leq N\), then the two elements overlap with probability \(P_{overlap}\)[29], as in Equation (14):  
\[ \begin{split} P_{overlap}&=1-\frac{\left(\begin{array} []{c}N\\ W\end{array}\right)\left(\begin{array}{c}N-W\\ R\end{array}\right)}{\left(\begin{array}{c}N\\ W\end{array}\right)\left(\begin{array}{c}N\\ R\end{array}\right)}\\ &=1-\frac{\left(\begin{array}{c}N-W\\ R\end{array}\right)}{\left(\begin{array}{c}N\\ R\end{array}\right)}\end{split}