• Keine Ergebnisse gefunden

5.3 Extensions of Task Allocation for Multi-hop Mesh WSNs: DTA-mhop

5.3.2 DTA-mhop Algorithm

For the clear description of the proposed algorithm, this section firstly presents a simple case and then gives the algorithm for the general networks.

Simple Multi-hop Network

The task allocation algorithm for the multi-hop network is introduced by considering the simple network scenario as depicted in Fig. 5.3. By studying this simple network, the main concept of the algorithm is illustrated. The more general networks will be considered in the next sub-section.

For simplicity, it considers that the energy cost activities of the sensor nodes are mainly related to the processing and communicating cost. LetEpi =[Epi(v1),· · ·,Epi(vk),· · ·,Epi(vK)]

denote the processing energy cost of each vertex when they are executed by sensor nodei and Ln =[ln(v1),· · ·,ln(vk),· · · ,ln(vK)]represent the net generated data of each vertex in the DAG

Application of sensor node 1

Application of sensor node 2

Application of sensor node 3

Figure 5.4: Schematic diagram of task allocation for the multi-hop mesh network

graph, respectively. According the modeling presented in Section 5.3.1, sensor node 1 spends energy on processing the assigned workload of its own application and transmitting data to sensor node 2. The energy cost of sensor node 1 can be formulated as:

E1= Ep1X11+eo+et x(d1)LnX11 (5.42) Like sensor node 1, sensor node 2 has to process the workload of its own application and transmit to sensor node 3. In addition, sensor node 2 also needs to receive the data from sensor node 1 and decide to share parts of its workload or not, and then transmit to sensor node 3. Thus, the energy cost of sensor node 2 can be expressed as:

E2=Ep2X21+eo+et x(d2)LnX21

+eo+er xLnX11+Ep2X12+eo+et x(d2)Ln(X11+ X12) (5.43) Note that X12 can be an all zero vector, which means sensor node 2 does not share any of the tasks for sensor node 1 and just forwards the received data. Sensor node 3 has to pass the data directly or indirectly for sensor node 2 and sensor node 1, in addition to execute the tasks of its

own application. Similar to Eq. (5.43), the energy cost of sensor node 3 is:

E3=Ep3X31+eo+et x(d3)LnX31

+eo+er xLn(X11+ X12)+Ep3X13+eo+et x(d3)Ln(X11+X12+ X13)

+eo+er xLnX21+Ep3X22+eo+et x(d3)Ln(X21+ X22) (5.44) The sink node is in charge of receiving the data and completing the rest of the application of each sensor node. Its energy cost is then formulated as:

Esnk =eo+er xLn(X11+ X12+X13)+Epsnk(11−X11− X12−X13) +eo+er xLn(X21+X22)+Epsnk(1K×1−X21− X22)

+eo+er xLnX31+Epsnk(1K×1− X31) (5.45)

Since the dynamic task allocation using multiple partition cuts is better than the static task allocation as presented in Chapter 4, this section mainly focuses on the dynamic task allocation.

Firstly, the mean energy cost of the sensor nodes and the sink node in each scheduling round are exploited. Similar to Section 4.4.1, the static binary partition solutions,X11, X12, X13, X21, X22andX31are replaced by the probability partition solutions,χ1112, χ13, χ21, χ22andχ31, respectively. Moreover, as there are multiple partitions for the application of each sensor node, the summation of all of the partition solutions for each sensor node is introduced to reduce the number of the variables and thereby reducing the complexity. LetX1 = χ11, X2 = χ2112 andX3 = χ31 + χ2213. According to Eqs. (5.42) to (5.45), the average energy cost of the sensor nodes and the sink node in each scheduling round can be expressed as:

E1(X1)=Ep1X1+eo+et x(d1)LnX1 (5.46) E2(X1,X2)=eo+er xLnX1+eo+et x(d2)LnX1+Ep2X2+eo+et x(d2)LnX2 (5.47) E3(X1,X2,X3)=eo+er xLnX1+eo+et x(d3)LnX1+eo+er xLnX2

+eo+et x(d3)LnX2+Ep3X3+eo+et x(d3)LnX3 (5.48) Esnk(X1,X2,X3)=3Epsnk1K×1−Epsnk(X1+X2+X3)+3eo+er xLn(X1+X2+X3) (5.49) Based on the mean energy cost functions in each scheduling round, the lifetime of this simple multiple hop network,N L, can be represented by:

N L =min

{ Batsnk

Esnk(X1,X2,X3), Bat1

E1(X1), Bat2

E2(X1,X2), Bat3

E3(X1,X2,X3) }

(5.50)

Consequently, the problem of maximizingN Lis modeled as the following LP problem.

arg min

X1,X2,X3max

{Esnk(X1,X2,X3) Batsnk

, E1(X1)

Bat1 , E2(X1,X2)

Bat2 , E3(X1,X2,X3) Bat3

}

(5.51) Subject to:

BT(1K×1−X1)50, BT(2K×1−X1−X2)50, BT(3K×1−X1−X2−X3)50; (5.52) X1(1)=1,X1(end)=0, X2(1)=1,X2(end)=0, X3(1)=1,X3(end)=0; (5.53) 05X151K×1,05X2 52K×1,05X353K×1. (5.54) where2K×1and3K×1areK×1 vectors and each elements of them equal 2 and 3, respectively;

Eq. (5.52) is the constraint to guarantee the transmitted data is from the source node to the sink node; Eq. (5.53) is the constraint to ensure the first task (sensing task) is done by the sensor node and the data is finally received by the sink node.

The summations of the partition solutions for the sensor nodes,X1,X2andX3, can be obtained by solving the above LP problem in the gateway which typically has powerful computing ability and no energy constraint. The corresponding partition solutions for each sensor node are calculated as follows: the partition solution for sensor node 1,X11, equalsX1; then, the partition solutions of sensor node 2 are calculated based on X11, X2and the constraints of the partition solutions; finally, the partition solutions of sensor node 3 can be obtained based on the partition solutions of sensor node 1 and 2.

After illustrating the task allocation algorithm for a simple multi-hop WSN, the general multi-hop networs are considered in the next part.

General Multi-hop Network

In this section, a general multi-hop WSN, as depicted in Fig. 2.2 of Section 2.2.1, is considered to illustrate the task allocation algorithm. For such a network, the minimum hop routing algorithm, which is one of the most popular routing algorithms in existing literature (e.g., [36, 37, 38, 39]), is employed for each sensor node to find the path to the sink node. According to this routing algorithm, the network can be represented by a static tree structure WSN as shown in Fig. 5.5.

The relationships of the sensor nodes based on this tree structure are expressed by an inter-node adjacency matrix A, whose rows and columns stand for the sensor nodes in order, respectively.

Each element of Ais defined by:

A(i,j)=

⎧⎪

⎪⎪

1, if sensor nodei is on the path from sensor node j to sink node 0, otherwise

Sensor node

Sink node 1

2 3

Figure 5.5: The tree structure model for a general multi-hop WSN as depicted in Fig. 2.2 of Section 2.2.1 by using the minimum hop routing algorithm.

Note that sensor nodeiis not considered on the path from itself to the sink node. In other words, Ai j =0 wheni = j. Thus, the inter-node adjacency matrixAfor Fig. 5.5 is:

A=

©

­

­

­

­

­

«

0 0 0 · · · 1 0 0 · · · 1 1 0 · · · ... ... ... ...

ª

®

®

®

®

®

¬ .

After modeling the tree structure, the energy cost of each sensor node is formulated. According to Eqs. (5.46) to (5.48), the average energy cost of sensor nodeiin each scheduling round can be formulated as:

Ei(Xj,Xi)=EpiXi+eo+et x(di)LnXi

+ ∑

j∈Ci

(eo+er xLnXj +eo+et x(di)LnXj)

(5.55)

whereCi is the set of sensor nodes whose paths to the sink node pass sensor nodei, which can be represented by the rows of the inter-node adjacency matrix A. Correspondingly, based on Eq. (5.49), the average energy cost of the sink node in each scheduling round is expressed by:

Esnk(X1,· · · ,Xn)=nEpsnk11+

n

i=1

(eo+er xLnXi−EpsnkXi

) (5.56)

wherenis the number of the sensor nodes in the network.

Therefore, the dynamic task allocation algorithms for maximizing the lifetime of a general multi-hop mesh WSN,DTA-mhop, can be formulated as the following LP problem:

arg min

Xi

max

{Esnk(X1,· · ·,Xn) Batsnk

, Ei

Bati

i =1,· · ·,n }

(5.57) Subject to:

BT(

(Nc+1)1K×1−Xi− ∑

j∈Ci

Xj) 50;

Xi(1)=1,Xi(end)= 0;

05Xi 5(Nc+1)1K×1.

whereNcstands for the number of the sensor nodes inCi. According to the obtained summation of the partition solutions of each sensor node, the detailed partition solutions for the sensor nodes can be calculated iteratively.