TSLBS: A time-sensitive and load balanced scheduling approach to wireless sensor actor networks

Existing works on scheduling in Wireless Sensor Actor Networks (WSANs) are mostly concerned with energy savings and ignore time constraints and thus increase the make-span of the network. Moreover, these algorithms usually do not consider balance of workloads on the actor nodes and hence, sometimes some of the actors are busy when some others are idle. These problem causes the actors are not utilized properly and the actors’ lifetime is reduced. In this paper we take both time awareness and balance of workloads on the actor in WSANs into account and propose a convex optimization model (TAMMs) to minimize make-span. We also propose a protocol called LIBP to improve load balancing that allocates tasks to actors according to their measured capabilities in such a way to enhance balances of workloads on the actors. Finally, by combination ofTAMMs and LIBP, a time-sensitive and load balanced scheduling approach (TSLBS) is proposed. TSLBS considers both local and global tasks and the distribution requirements of WSANs (i.e. WSANs with hybrid architecture). The results of simulations on typical scenarios shows thatTSLBs is more efficient in terms of both the make-span and load balancing compared to stochastic task scheduling algorithm (STSA). We also show that TSLBs performs significantly better than STSA in terms of actor’s lifetime.


INTRODUCTION
Advances in smart micro-devices and wireless communications provided the great opportunity to tackle an actual problem: sensing, monitoring and remote control of complex and harsh environments [1,2]. Development of sensor networks alongside the need of effectively reactions to environmental events lead to the emergence of Wireless Sensor Actor Networks (WSANs).
A typical WSAN is comprised of a group of densely spread sensor nodes along with a group of sparsely spread actor nodes connected via wireless links. Sensors are responsible for collecting environmental information and actors make appropriate actions on the environment based on the sensory information. An actor can act on the environment by means of one or several actuators and as a network entity, it is able to perform networkingrelated functionalities, i.e., receive, transmit, process, and relay data. Sensor nodes are able to sense, process and communicate information about a wide diversity of physical phenom-ena in a broad spectrum of applications ranging from wildlife and habitat monitoring to health care or battle field surveillance wherein reactions to the events should be done quickly [3,4]. Hence, to make effective use of WSANs capabilities, employing suitable time-sensitive scheduling algorithms is necessary. Furthermore, balance of workloads on actors should be considered by the scheduling algorithms as a critically desired parameter in WSANs to prevent network partitioning. Because ignore of load balancing in a scheduling may cause some actors to be busy while some others are idle and hence, the busy actors will lose their energies and die soon.
Depending on the strategies pursued by the actors to send commands [5][6][7], there are principally three different architectures: semi-automated, hybrid, and automated. In automated architecture, the network goes in a fully distributed way with the actors that autonomously accept and perform the proper actions upon receiving sensory information. In semi-automated architecture, sensors collect and transmit environmental information to a singleton network sink, and the sink determines the proper actions that actors should perform in response and allocates these actions (tasks) to proper actors. In hybrid architecture [9,10] sensors may transmit sensing data to the sink or to actors in a single hop or multiple hops. Hybrid architecture ( Figure 1) deals with two groups of tasks, global tasks and local tasks. Global tasks are determined by the sink, but local tasks are determined by the actors. These tasks are figured out based on the gathered information by the sensors and actors are the responsible nodes to perform the tasks.
However, how to allocate tasks to available actors is a critical issue influencing make-span, workloads of actors and hence, energy consumptions and network lifetime. To properly distribute tasks among the actors, it is absolutely necessary to consider the architecture of WSAN [11,12].
There are a relatively great number of existing task scheduling algorithms for distributed systems in general that try to reduce the make-span of the system [13,14]. These are however not applicable in for WSAN task scheduling since they do not consider the constraints of WSANs. In addition, there are also some scheduling algorithms for distributed systems that try to achieve their load balancing objective and improving the lifetime of the system, but do not consider time constraints of the system [15,16]. It is worthy to note that although consideration of load balancing may lead to reduction in make-span of the system, but in large scale distributed systems like WSANs, the load balancing objective alone may lead to poor make-span. Accordingly, there is a need for superior task scheduling algorithms that consider both the load balancing objective and the time constraints into account in order to shorter the make-span and upper the load balancing objective. However, to minimize make-span, we proposed a convex optimization model called TAMMs based on queuing theory. We also proposed a protocol called LIBP to improve load balancing and hence, enlarging network life time. At last we proposed an algorithm called TSLBS, with the above two mentioned objectives for allocation of tasks to actors. The algorithm is modeled with queuing networks and simulated for validation.
The rest of paper is organized as follows. Section 2 presents notable related works. Section 3 describes our assumptions. Section 4 presents TSLBS. Section 5 presents the experimental results and section 6 concludes the paper.

RELATED WORKS
Due to the challenging features and constraints of WSANs, such as their dynamicity and resource constraints, the existing general-purpose scheduling algorithms are usually inappropriate to WSANs. There are however various research works on scheduling algorithms for wireless sensor actor networks. The applicability of notable scheduling algorithms is discussed here. Farias et al. [17] presented an algorithm to schedule tasks in WSANs to enhance the energy efficiency and hence, enlarging the network lifetime. To achieve this goal, the characteristics of applications is tried to be utilized with common tasks and unnecessary repeat of tasks is avoided. However, their algorithm may raise the total remaining energies of actuators, but neither service reliability nor make-span has been considered by their approach.
Sharifi and Okhovvat [5] presented a starvation free, time and energy aware scheduling algorithm for WSANs. Their algorithm supports concurrent executions of any mix of small and large tasks and yet precludes likely starvation of tasks. Decreasing the tasks' completion time and enhancing the remaining energies of actors were the dual objectives of their algorithm. The main disadvantage of their algorithm is that it does not guarantee the execution deadline for applications.
Shu et al. [13] proposed a scheduling algorithm to maximize the network lifetime while making firm sensing guarantees in the WSN. In order to validate their algorithm, they carried out an in-depth evaluation of its performance via large-scale simulations and reported an average of 39.2% enhancement of network lifetime over the baseline method. The main disadvantage of their work is that time as an important parameter in WSANs was not considered in their algorithm.
Yang and Lee [18] presented a fault-tolerant assignment method to tolerate failures in more than one actuator. Their method operates based on the redundancy to tolerate failures. The main drawback of their method is that time constraint of applications was not considered in their method.
Okhovvat and Kangavari [19] proposed a task allocation model to maximize total utilization of actor nodes in WSANs. They showed the task allocation policy applied by the sink with a Generalized Stochastic Petri Net (GSPN) model. Then, to maximize actors' utilization, the arrival rate of tasks for each actor is determined based on the capability of that actor. Steady state analyzing of the GSPN model and with the computation of the task dispatching weight at each actor, task arrival rates is calculated. All the above research works try to schedule tasks in sensor networks while do not consider both local and global tasks since they match one of the semi-automated or full automated architecture. However, in this paper we propose a time-sensitive and load balanced approach to schedule tasks in order to provide an appropriate tradeoff between make-span and balance of workloads on the actors in WSANs with hybrid architecture.

ASSUMPTIONS
Task scheduling is defined as the allocation of one or more time slots to one or more resources [20,21]. The scheduling problem in WSANs amounts to the mapping of a set of tasks to a set of actors based on determined QoS parameters such as makespan minimization, expanding actors' lifetime, residual energy maximization and etc. Since the scheduling is an NP-complete problem [13,17,20], consideration of multi QoSs to get an optimized scheduling scheme is however impractical [7,15].
We study a WSAN with hybrid architecture (Figure 2) wherein m actors A j ( j = 1, ..., m) would carry out n global tasks T i (i = 1, ..., n) and n local tasks T i (i = 1, ..., n ). The execution time of task i by actor j , E i j , is defined as the total expected time taken by actor j to execute the task with no load at the time of assignment. The expected completion time of task i by actor j (C i j ) is defined as the time interval in which A j finishes task i after completing any remaining previous assigned tasks.
Let C i denotes the completion time of task i which is equal to C i j where actor j is actually assigned to perform T i . The overall completion time of all tasks in the network is called make-span.  Accordingly, the make-span of a WSAN with m actors for the set of i tasks can be computed by Eq. (1).
We defined the workload of each actor as the time to be spent by the actor to perform all tasks assigned to that actor. We assumed that tasks are independent and sensors gather information from the environment and determine the related local tasks or send them to the sink to determine the related global tasks. We also assumed that the sink and also each actor have their own independent queue. Global tasks are initially inserted in the queue of the sink and later put in the queue of the actor chosen by the sink to perform the task. Local tasks are assigned to closest actor/actors directly by the sensors, but global tasks are assigned to the proper actors by the sink. It is assumed that the process of assigning tasks to actors follows a Poisson distribution. Moreover, we have assumed that all tasks are nonpreemptive and the generation rate of local tasks (λ ) and also the generation rate of global tasks (λ) follows an exponential distribution.

PROPOSED APPROACH
The main goals in the proposed approach is to reduce makespan, to improve the balances of workloads on actors and hence, increasing the network lifetime. We noticed the inherent unpredictability of WSANs in the proposed approach using the queuing theory. According to our assumptions, sensory information of a local task is directly sent to the closest actor and the best allocation rate of global tasks to the actors is determined. To minimize the make-span, a convex optimization model (TAMMs) based on queuing network has been proposed In order to improve load balancing we proposed a protocol (LBIP) that determines the allocation rates of tasks for each actor based on its capability in performing tasks. Finally, we proposed our time-sensitive and load balanced scheduling (TSLBS) that tries to makes an appropriate trade-off between minimization of make-span and load balancing enhancement in a WSAN.

Task Assignment Model to Minimize Makespan (TAMMs)
The aim of TAMMs is to achieve the minimum make-span within a WSAN. To attain this purpose, tasks arrival rates at each of the actors should be approximated properly. Since local tasks are directly assigned to closest actors by the sensor nodes, the allocation rates of global tasks should be tune appropriately. As mentioned before, it is assumed that all allocated tasks arrived at the actor, A i , follows a Poisson distribution. To carry out steady state analysis on the actors, the sum of the local and global tasks arrival rates in each of the actors have to be less than the corresponding actor's service rate (μ i ). Hence, Eq. (2) must be satisfied for each actor i :  (3) can be found in [24].
Since the goal of this phase is to minimize the make-span of the WSAN, using Eqs. (1)-(3), this goal can be formulated as (4). Goal: To solve (4), the problem is modeled in GAMS software using DICOPT solver [24], which is based on the extensions of the external estimation algorithm for the equality relaxation policy. Applying the resultant tasks arrival rates to the actors, the makespan of the WSAN could be minimized.

Load Balancing Improvement Protocol (LBIP)
The only objective of minimizing make-span and ignoring load balancing in TAMMs, may result in overloading of some actors and idling of some others, resulting in the partitioning of the WSAN. To avoid this problem, as shown in Figure 3, we proposed a load balanced protocol (LBIP) that tries to improve balanced loads on the actors. In LBIP, Eq. (5) is used to compute the utilization of the actor A i assuming that there is no restriction on the number of tasks in an actor queue; utilization of an actor indicates the actor's busy times.
To improve balanced loads on the actors, the arrival rates of tasks for each actor should be based on the capability of that actor. Therefore, in this phase of algorithm, all arrival rates and ρ i pairs are sorted and based on (6), a proper pair of λ i and ρ i is chosen and thus, n − 1 equations is made.
These equations can be solved using Eq. (7), resulting in proper arrival rates of tasks that result in more balanced loads on the actors. Because in this case further and bigger tasks are transmitted to the actors in which the capability of performing tasks is more than others.

Time-Sensitive and Load Balanced Scheduling Approach (TSLBS)
The main goal in the TAMMs is to minimize make-span while the main goal in the LBIP is the increase of load balancing. The proposed TSLBS is applying TAMMs and LBIP and tries to reduce make-span, while load balancing increased and the network lifetime enlarged. Figure 5 shows the steps followed by the proposed TSLBS scheduling. However, the only objective of reducing make-span and ignoring load balancing in TAMMs, may lead to overloading of some actors and idling of some other actors, resulting in the partitioning of the WSAN. On the other hand, ignoring make-span and the sole objective of load balancing in LBIP, may lead to unnecessary delays. To avoid these problems, both make-span and load balancing should be considered. To achieve this goal, TSLBS by using the average amounts of λ i that was derived in the TAMMs and LBIP, makes a proper trade-off between makespan and load balancing and tries to optimize balanced loads on the actors and reducing the network make-span, too. Figure 4 shows the steps followed by the TSLBS.

EXPERIMENTAL RESULTS
The proposed TAMMs, LBIP, and TSLBS have been compared with STSA algorithm in a typical scenario. In addition, to study the effect of scale on the performance of the proposed approach, simulations have carried out in both large and small scales in two different settings. In the small scale, we assume a Input: The context information of each actor A j and λ as the arrival rates of tasks to the sink Output: Allocation rates of tasks to each actor A j 1. For all A j do 2. Set the global allocation rate to λ/n 3. Calculate the actor's utilization ρ j //As defined in Eq. (5) 4. Sort (λ j + λ j ) and ρ j pairs based on: Select the most proper tuple of λ j , λ j and ρ j // The calculated arrival rates to actors result in enhancing load balancing 6. Allocate local tasks (T ) and global tasks (T ) to the related actor A j with the rates of λ j and λ j , respectively. Step 2 // Enhancing Load balancing

LBIP(A j )
5. Select the most proper tuple of λ j , λ j and ρ j // The calculated arrival rates result in enhancing load balancing Step 3 // Making tradeoff between Make-span and load balancing improvement 6. For all A j do 7. Compute the average amounts of λ j , λ j that was derived in step 1 & step2. // These allocations rates improve load balancing and reduce the make-span. 8. Allocate global tasks (T ) and local tasks (T ) to the related A j with the rates of λ j , λ j respectively. two-dimensional square space, 10m×10m, including100 sensor nodes with 1 meter transmission range, and 7 actor nodes. We assume that the tasks to be carried out by actors were independent and that actors could browse the whole network with no restrictions on routing hops. The primary energy of each actor was assumed to be the same as others and equal to 20 Joules.
In the large scale, we assume a two-dimensional square space, 100m×100m including 1000 sensors with 10 meters transmission range, and 10 actor nodes. The primary energy of each actor is assumed to be the same as others and equal to 40 Joules. In our evaluations, we assume that each of the actors runs only a single task at any time. To have better evaluation, actors are selected from three different classes with slow, medium, and fast service rates. It is assumed that tasks are independent. The workload of actors, the network make-span, the energy consumption of actors, and the network life time in small and large scales are shown in Figures 5 to 12, respectively. In these figures, the efficiency of TAMMs, LBIP and TSLBS is evaluated in compare with each other and STSA in terms of make-span, load balancing, energy consumption and network lifetime. As figures 5 and 6 show, LBIP is the best in the balanced distribution of workloads on the actors in both small and large scales, respectively while STSA was the worse one.
As Figures 7 and 8 depict, although the make-span resulting from the TAMMs is much better than the make-span resulting from STAS and LIBP, it is a little better than the make-span resulting from TSLBS. However, the results are similar in both small and large scales, but the difference between the TAMMS and TSLBS is less in small scale. Figure 9 and 10 show the energy consumptions of actors in Setting I and Setting II, respectively. Figure 10 shows, in small scale STSA and TAMMs have already the same operation, but     LBIP results in less energy consumption. Although the energy consumption resulting from LBIP is better than others, it is a little better than the energy consumption resulting from TSLBS. As shown in Figure 11, in large scale STSA and TAMMs have nearly the same operation in reducing energy consumption which is worse than others, but LBIP reduce the energy consumptions of actors better than others. It is worthy to note that STSA and TAMMs cannot perform any more tasks because of lacking of required energies, but LBIP and TSLBS can perform more tasks. However, as Figure 11 demonstrates, in large scale wherein the required energy to pass the distance between a selected actor A j and the location of the task T i allocated to actor A j is significant in compare with Eij, C is operates considerably better than others in reducing energy consumptions of actors. Figures 11 and 12 compare network life time of STSA, TAMMs, LBIP and TSLBS. The network lifetime is evaluated in terms of all of the actor nodes alive (ANA) and half of the actor nodes alive (HNA) for the sake of clarity.
As shown in Figures 11 and 12, in terms of ANA, LBIP has done considerably better in both small and large scales while TAMMs done the worst. In terms of HNA, STSA and TAMMs have nearly the same operations and resulted in the worst HNA while LBIP performed the best and resulted in higher HNA compared with others.
All in all, STSA yields minimum make-span and LBIP yields the best load balancing and minimum energy consumption, but TSLBS yields reasonable results as a tradeoff between both load balancing and minimizing make-span objectives. It also performed well in enlarging network lifetime and reducing the energy consumptions of actor nodes.

CONCLUSION AND FUTURE WORKS
This paper proposed a time-sensitive and load balanced approach (TSLBS) comprising of three algorithms to schedule tasks in WSANs. TSLBS is based on queuing theory and models a WSAN with the queuing networks. The first algorithm tries to minimum make-span as its only objective. Enhancing the Balance of workloads on the actors is the objective of the second algorithm. Improving load balancing and hence, enlarging network life time along with reducing make-span are the objectives of the third proposed algorithm. Experimental results illustrated that the first algorithm did minimize make-span but was bad on load balancing. The second algorithm did best on load balancing but performed badly on make-span. The third proposed algorithm provided a suitable tradeoff between balance of workloads on the actors and minimizing make-span. Experimental results also showed lower make-span, higher load balancing, larger network lifetime, and lower energy dissipation of actors under the proposed algorithms compared to the STSA.