TDMA scheduling schemes targeting high channel utilization for energy-harvesting wireless sensor networks

As a contention-free channel access protocol, Time Division Multiple Access (TDMA) is widely applied in Energy Harvesting Wireless Sensor Networks (EH-WSNs) due to ease of implementation. TDMA scheduling in EH-WSNs faces the problem of low channel utilization since time slots assigned to some nodes may not be used by them due to short-age of energy or data. It is important to design TDMA scheduling schemes that enhance channel utilization. In this paper, the Fixed Frame Size Scheme (FFSS) and the Adaptive Frame Size Scheme (AFSS) are proposed to improve channel utilization of EH-WSNs. The FFSS aims at the optimal TDMA slot assignment for the TDMA scheduling with ﬁxed frame size, and the AFSS considers the TDMA with variable frame size and targets both the optimal frame size and the optimal slot assignment. The optimization problems maximizing channel utilization are formulated for the FFSS and the AFSS, respectively, which take the upcoming energy and data into account. The optimization problems are transformed into assignment-like problems and solved by the Hungarian-based algorithm in polynomial time. Simulation results indicate that the proposed FFSS and AFSS can considerably improve channel utilization in the EH-WSNs compared with the existing TDMA scheduling schemes.


INTRODUCTION
Being main components of the Internet of Things (IoT), Wireless Sensor Networks (WSNs) have been widely deployed. The drawback of inconvenient replacing battery in the traditional WSNs is remedied by energy-harvesting technique, which brings in various Energy-Harvesting WSNs (EH-WSNs) [1]. Nodes in the EH-WSNs can gain sustainable operation by scavenging energy from ambient energy sources [2][3][4], including radio frequency, sun light, wind, etc. Channel access or medium access schemes in the EH-WSNs can be classified as contention-free and contention-based [5]. The representatives of contention-free and contentionbased schemes are Time Division Multiple Access (TDMA) and Carrier Sensing Multiple Access/Colission Avoidance (CSMA/CA), respectively. In addition to easy implementation, TDMA has advantages of collision-free, energy-efficient, and The main contributions are summarized as follows.
• We propose the Fixed Frame Size Scheme (FFSS) and the Adaptive Frame Size Scheme (AFSS) to improve the channel utilization of the EH-WSN. The FFSS and the AFSS adopt the TDMA with fixed frame size and variable frame size, respectively. • We formulate the channel utilization maximization problem to find the optimal slot assignment for the FFSS. In addition, we formulate the optimization problem for the AFSS, which maximizes the channel utilization with respect to frame size and slot assignment. Both optimization problems consider the upcoming energy and data; and the nodes with data and sufficient energy for transmission are assigned to the front slots in TDMA frames, which is proved to be helpful in increasing channel utilization. The optimization problems are solved in polynomial time by using Hungarian-based algorithm. • Simulation results show that the proposed FFSS and AFSS significantly outperform existing schemes in terms of channel utilization compared with the existing TDMA scheduling schemes.
The remainder of this paper is organized as follows. Section 2 surveys the related work. In Section 3, we introduce the system model. We elaborate the fixed size TDMA scheme and the adaptive size TDMA scheme in Sections 4 and 5, respectively. Section 6 provides simulation results, and Section 7 draws a conclusion.

RELATED WORK
Plenty of work has been carried out to investigate TDMA scheduling schemes in recent years. TDMA scheduling schemes can be classified into two categories: the centralized TDMA scheduling schemes and the distributed TDMA scheduling schemes. The centralized TDMA scheduling schemes assume that the global knowledge of the network is known beforehand [10][11][12]. According to the global knowledge, the coordinator formulates the optimal TDMA schedule and broadcasts it to each node. [13] studied the stable throughput of TDMA protocols in energy-harvesting systems where the global knowledge (i.e. data arrivals and energy arrivals) is known by the coordinator. Gurakan and Ulukus [14] considered the optimal power control policy for each slot that maximize the sum rate. In [15], Hu and Cai discussed a joint design of TDMA time allocation and scheduling sequence for maximizing the throughput of Wireless Powered Communication Network (WPCN). However, such global knowledge may not be available in the EH-WSNs owing to the random nature of energy and data arrival processes.
In the distributed TDMA scheduling schemes, a node usually needs to exchange information with the others to construct a neighbor information table, which is used in determining a TDMA schedule. For example, [16] introduced a cross-layer TDMA scheduling scheme destined for tree-based power-line communications networks to enhance spectrum reuse, in which each node maintains the state information within its coverage. In [17], proposed a Distributed and Concurrent-link Scheduling Algorithm (DICSA) to improve the performance, in which each node coordinates the slots reservation of its neighbors to obtain the optimal slot allocation. Clearly, exchanging information between nodes brings in overhead. TDMA scheduling schemes for energy-limited WSNs should be simply designed to avoid overhead and computational complexity [18].
There are also some energy-harvesting related TDMA scheduling schemes in the literature. In [8], the optimal transmission problem was considered for energy-harvesting nodes under the equal-power and the equal-time TDMA schedule. [19] designed a Quality of Service (QoS)-aware slot assignment scheme to dynamically adjust the TDMA slot assignment. [20] investigated the energy-efficient resource allocation in a TDMA-based EH-WSN, subject to time and transmission power.
In our previous work [21], we studied the impact of energy arrival on the TDMA schedule based on the assumption of traffic saturation, that is, we assume that the data buffer at a node is always with data to be transmitted. In fact, many applications do not have the characteristic of traffic saturation. In other words, the nodes usually have unsaturated traffic, that is, data buffer at a node is empty at times. As a result, given a TDMA frame, all the nodes with empty data buffer do not need any time slot in the TDMA frame. Thus, the TDMA scheduling schemes presented in our previous work [21], referred to as "the earlier schemes", are not suitable for the applications with unsaturated traffic. This encourages us to investigate the TDMA schedule for unsaturated traffic accompanying with energy harvesting process. In addition to unsaturated traffic, compared with the earlier schemes, the TDMA scheduling schemes proposed in this work, referred to as "the later schemes", take into account upcoming energy, upcoming data, and the variation in the number of nodes having data to transmit. Moreover, feedback mechanism is embedded in the later schemes, which helps in real-time TDMA scheduling.

SYSTEM MODEL
The studied EH-WSN consists of one sink and K Energy Harvesting (EH) nodes, referred to as node k (k = 1, 2, … , K ). Each node either operates with timing acquisition mode or random acquisition mode according to the operation of its data acquisition module (i.e. sensor) [22]. With the timing acquisition mode, the node has a constant sampling frequency of its sensor (i.e. the data arrival interval is fixed), and with the random acquisition mode, the node has a random sampling frequency (i.e. the data arrival interval is random). In either mode, one data packet is captured by the node at one time. We assume that the sink has a constant energy supply and communicates with each EHnode directly. Surely, transmit power affects the received signal strength at receiver and may incur interference at the nodes other than the desired receiver, which may impact efficiency of channel usage. It should be stressed that this work focuses on improving channel utilization measured by the proportion of the consumed time slots in TDMA frames to those assigned to the nodes, that is, we make efforts on making as many time slots in TDMA frames consumed by the nodes as possible. In order to pay full attention to slot assignment, as done in the existing work [23] [24][34], we do not consider transmit power and the other physical layer parameters in this study. For simple description, we assume the link between the sink and each node is reliable [25], that is, a data packet can be successfully received without bit error. The assumption can be relaxed when we extend the mathematics model to include wireless links with each having a successful probability of packet delivery. This will be investigated in our future work.
Each node has an energy storage to store the harvested energy to maintain uninterrupted operation against energy fluctuation. Similar to [8] and [26], we adopt the term of "energy packet" to represent one unit of energy that suffices for one transmission. In addition, each node has a buffer to keep the captured data.
The EH-nodes follow TDMA protocol to access the channel shared by all nodes. In the EH-WSN, the sink makes a TDMA schedule and then broadcasts it to all nodes at the beginning of each TDMA frame. The TDMA schedule sets an n-slot frame and assign the slots to the EH-nodes. An EH-node sends a data packet to the sink in its own slot if the node has sufficient energy and its data buffer is not empty. In other words, shortage of energy or empty data buffer cause the node to lose the transmission opportunity in the assigned slot.
In this paper, we allow a node to send only one data packet in one slot. We refer to the slot in which the last data packet arrives as the "last data slot" and the slot in which the last energy packet arrives as the "last energy slot". For node k, we use four-tuple (E k , D k , k , k ) to represent its state. Here, E k and D k stand for the number of energy packets in its energy storage and that of data packets in its data buffer, respectively, k represents the number of slots from the end of last data slot to the beginning of current transmission slot, and k denotes the number of slots from the end of last energy slot to the beginning of current transmission slot. denotes the duration of one slot. Each node reports to the sink its four-tuple, which is piggybacked in the data packet to the sink [27]. The sink uses states table to keep all nodes' states and assigns TDMA frame slots based on the information in the states table. The states table contains fields "nID", "Ek", "Dk", "uk", and "vk", where field "nID" keeps identification of a node, and fields "Ek", "Dk", "uk", and "vk" record E k , D k , k , and k , respectively.
We use Figure 1 as an example to show the main idea underlying our TDMA scheduling scheme. In the figure, there are three EH-nodes A, B, and C. Notation "A(a 1 , a 2 )" represents that node A has a 1 energy packets and a 2 data packets. For example, "A(1, 2)" means that there is 1 energy packet and 2 data packets at node A. Similarly, "B(0, 2)" indicates that node B does not have energy packet but has 2 data packets and "C(0, 0)" shows that both energy storage and data buffer at node C are empty.
Initially, node A has 2 energy packets and 3 data packets, node B has 1 energy packet and 3 data packets, and node C has 1 energy packet and 1 data packet. The states table at the sink is initialized to A(0,0), B(0,0), and C(0,0), which means each node has empty energy storage and data buffer.
In TDMA frame 1, the sink assigns the 1st, 2nd, 3rd slots to nodes A, B, and C, respectively. These slots are assigned at random since the sink does not have knowledge about the nodes. Node A transmits one data packet to the sink and reports by piggyback its energy storage and data buffer status to the sink, which consumes one energy packet. Thus, at the end of frame 1, the sink has the buffer status at node A, which reads A(1,2). After node A having delivered a data packet, node A harvests one energy packet, and thus, node A has 2 energy packets and 2 data packets at the end of frame 1. At node B, one energy packet is harvested before its slot, which makes it has 2 energy packets before data delivery. Node B transmits one data packet by spending one energy packet, leaving 1 energy packet and FIGURE 2 Interaction between the sink and a node in a TDMA frame 2 data packets in its storage and buffer, which is reported to the sink so that the item in the states table in the sink is updated to B(1,2) at the end of frame 1. After transmitting data, one data packet arrives at node B, which makes 3 data packets in addition to 1 energy packet at node B. Node C transmits the only data packet by consuming the sole energy packet, leaving empty energy storage and data buffer, which is reported to the sink, and then node C harvests one energy packet. Hence, at the end of frame 1, the sink has the buffer status of node C as C(0,0), and there is one energy packet at node C.
In TDMA frame 2, the sink first assigns the slots to the nodes with energy and data, and all the nodes without energy or data are each assigned a later slot. That is, nodes A and B are assigned slots prior to the slot of node C. Unfortunately, the slot assigned to node C is unused in frame 2 due to no data packet arrival. The buffer status of each node and the states table at the sink are updated as did in frame 1.
In TDMA frame 3, node A is assigned a slot earlier than nodes B and C since node A has both energy and data whereas nodes B and C do not. The buffer status of each node and the states table at the sink are updated as did in frame 1.
It is clear from the above example that estimating energy and data arriving to the nodes is important for avoiding or alleviating the number of unused slots. Therefore, our goal is to design a novel TDMA scheduling scheme to fully utilize the channel based on the states table and the estimation of energy/data arrival at the nodes. We elaborate this estimation in Section 4.3 and 4.4.

CHANNEL SCHEDULE WITH FIXED FRAME SIZE
In this section, we first consider the TDMA schedule with fixed slots, where the number of slots in each TDMA frame does not change [21] [28]. In order to ensure fairness among the nodes for channel access, we set the number of slots in one TDMA frame to the number of nodes [28], that is, n = K . The FFSS is proposed to improve the channel utilization by the optimal TDMA slot assignment for each TDMA frame.

The proposed FFSS
The proposed scheme contains two stages in one TDMA frame: TDMA scheduling stage and data receiving stage. The interaction between the sink and a node in one TDMA frame is illustrated in Figure 2. In the TDMA scheduling stage, the sink solves the optimisation problem in (21), which yields the optimal TDMA schedule, and broadcasts the TDMA schedule to each node. In the data receiving stage, the sink receives the data from the node and records its four-tuple in the states table. Each TDMA frame repeats these two stages. The proposed scheme, which is applied at the sink, aims to find the TDMA schedule that maximizes the channel utilization in the EH-WSN. The main steps of the proposed scheme in a TDMA frame are listed as follows.
Step 1. The sink checks its stats table to see whether its states table is empty or not. If yes, the sink gives each node a random slot, and then goes to Step 4.
Step 2. Using the states table, the sink classifies all the nodes into four categories as resource-sufficient, energy-poor, data-poor, and naught-resource nodes, which are defined in the next section. Then, for each slot in the following TDMA frame, the sink calculates the transmission probabilities of all nodes with data.
Step 3. With the derived probabilities, the sink solves the optimisation problem in (21), which yields the optimal TDMA schedule that assigns each node a slot in the following TDMA frame.
Step 4. The sink broadcasts the optimal TDMA schedule to all the nodes.
Step 5. The sink receives the data packets from each node and updates the states table by using the four-tuples piggybacked in the data packets from the nodes. End.

Node category
From Section 3, we are aware that time slots may be unused if they are assigned to the nodes without energy or with empty data buffer. Hence, slots should be assigned according to both the state of energy storage and that of data buffer so that channel utilization can be improved. For node k, the number of energy packets in its energy storage, that is, E k , and the number of data packets in its data buffer, that is, D k , have four possibilities: According to these possibilities, we divide all the nodes into four categories as follows: 1) resource-sufficient node, which satisfies Con1; 2) energy-poor node, which satisfies Con2; 3) data-poor node, which satisfies Con3; and 4) naught-resource node, which satisfies Con4.
In addition, we introduce the set of resource-sufficient nodes, the set of energy-poor nodes, the set of data-poor nodes, and the set of naught-resoures as follows: Clearly, a slot assigned to a node in d , e , or n may be unused due to the fact that the node may not harvest enough energy for transmitting one packet if it is in e ∪ n or the node may not have data arrival if it is in d ∪ n . This may result in the degradation of channel utilization. In our scheme, the sink considers which set a node belong to when the sink assigns a slot to the node.

Character of data arrival process
Recall that the operation modes of nodes are classified as timing acquisition mode and random acquisition mode in Section 3. The former has a constant sampling frequency, that is, the interarrival times of data packets are identical, and the latter has a random sampling frequency, that is, the data arrival interval is a random variable. In the sequel, we refer to timing acquisition mode and random acquisition mode as "Mode I" and "Mode II", respectively. We use Figure 3 to illustrate the data arrival process at node k, where we use three continuous TDMA frames called previous frame, current frame, and next frame, respectively. In the figure, r k is the number of slots in the interval between the end of the slot assigned to node k in the current frame and the beginning of the next frame, k is the fourth term of the four-tuple introduced in Section 3, n is the number of slots in a TDMA frame, and k stands for the interval between two successive data arrival. In Figure 3, the slot in gray (i.e. the transmission slot) is assigned to node k and that in orange is a data packet arrival slot. In the gray slot, node k transmits its data, together with four-tuple state information, to the sink so that the sink updates the states table.
It should be noticed that, the sink cannot update the states table for a node until it receives a data packet from the node. Hence, the sink has the knowledge of k , k , r k when it makes decision on assigning the slots in the beginning of next TDMA frame, and the sink does not have knowledge of the data packet arrival and the energy packet arrival in the period from the instant when the node sends out the data packet to the beginning of the next frame. Therefore, it is expected to estimate data arrival interval and energy-harvesting period for transmitting a data packet since this estimation has a significant impact on the slot assignment. Now, we start characterizing the data arrivals for the nodes with Mode I and Mode II, respectively.
For node k with Mode I, k is a constant. Let For node k with Mode II, we assume that the inter-arrival interval of data packets k obeys a general distribution with probability density function g k (x) and cumulative distribution function (CDF) G k (x). Since the sink cannot update the item in the states table for node k until it receives the node's data packet, which piggybacks the four-tuple, the sink knows that the next data packet will arrive at node k after node k's slot in the current TDMA frame. Therefore, the event that the next data packet arrives at node k before slot i in the next TDMA frame is equivalent to the event that the next data packet arrives in duration of k + r k + (i − 1) , that is, k ≤ k + r k + (i − 1) , given that the data packet does not arrive during k , that is, k > k . (see Figure 3). Thus, we have the probability of the next data packet arriving at node k before slot i in the next TDMA as Using (9) and (10), we define notation

Character of energy-harvesting process
There are several different energy sources with different energy harvesting techniques [29]. Some works model energy arrival by using Bernoulli distribution [30], Poisson distribution [22], etc. In this paper, we consider a general model in which we assume that the inter-arrival interval of energy packets at node k obeys a general probability distribution with probabil-ity density function f k (x) and cumulative distribution function F k (x). From Figure 4, using the similar way to deriving (10), we obtain the probability of the next energy packet arriving at node k before slot i in the next TDMA frame as where k denotes inter-arrival interval of energy packets at node k.

Qualified node
We refer to a node with at least one data packet and at least one energy packet as a "qualified node", which indicates that the node qualifies for data transmission without shortage of energy and data. In our scheme, the nodes are in r , d , e , or n . Only the nodes in r are qualified nodes since each of them has both energy and data so that data transmission can be conducted as soon as it is assigned a time slot, and the other nodes are not due to shortage of energy and/or lacking data packet. Let P i,k be the probability that node k becomes a qualified node before slot i in the following TDMA frame. Then, P i,k = 1 when node k is in r . The probabilities for the other nodes are given below.
For node k in e , we only need to consider its energy arrival process due to the available data in its data buffer. Thus, we have Similarly, for node k in d , which has available energy in its energy storage, we only consider its data arrival process. Then, For node k in n , we need to consider both data arrival and energy arrival. Therefore, Combining (11) through (15), we obtain i,k when node k is with Mode I, where and , node k ∈ n ,

The optimization problem for the FFSS
We formulate the optimisation problem in this section for the proposed FFSS to improve channel utilization, defined as the proportion of used slots to total slots in a TDMA frame. Let x i,k be an indicator for whether slot i is assigned to node k when x i,k = 1 or not when x i,k = 0. Then, the channel utilization can be measured by where Matrix n×K is a 0-1 matrix (i.e. each element is 0 or 1) with the feature that each row has exactly one 1 and so does each column. In the sequel, we refer to Matrix n×K as "slot assignment matrix". As a result, we formulate the optimisation problem as follows: Here, = {1, 2, … , K } and = {1, 2, … , n}. In the above optimisation problem, Constraint (21a) assigns each node at most one slot and Constraint (21b) assigns a slot to at most one node. To reflect the fairness in channel access, the TDMA scheduling scheme assigns each node exactly one time slot, and thus it holds that n = K . Equivalently, the equal signs hold in Constraints (21a) and (21b).
Before solving the optimisation problem in (21), we present two theorems. From (5)-(8), we have where c r stands for the complement of set r . Theorem 1. The prerequisite of the optimal solution to the optimisation problem P1 in (21) is that each node in r is assigned to a slot earlier than any node in c r .
Proof. We prove this theorem by contradiction. Suppose the theorem does not hold. Equivalently, we have the argument as follows. That is, there exists a slot assignment scheme, called scheme I below, in which node k 1 in c r and node k 2 in r are assigned to slots i and j (i < j , i.e., slot of node k 2 is behind slot of node k 1 ), respectively, in the following TDMA frame; and meanwhile channel utilization of any other slot assignment scheme cannot exceed that of scheme I. Now, we begin to show the above argument is not correct. In scheme I, it holds that x i,k 1 = 1 and x j ,k 2 = 1. Then, the slot assignment matrix in scheme I is In addition, scheme I has channel utilization 1 = ( n×n ), which is defined in (19).
Then, we adopt scheme II in which we exchange the slots of nodes k 1 and k 2 , that is, slots i and j are assigned to k 2 and k 1 , respectively. Then, the slot assignment matrix in scheme II is Additionally, scheme II has channel utilization 2 = ( n×n ), which is defined in (19).
Next, we prove that the above argument is not true by validating Noticing the main difference between matrices (1) n×n and (2) n×n is the four elements located at <i, k 1 >, <i, k 2 >, < j , k 1 >, and < j , k 2 >, where <i, k 1 > stands for the i th row and k 1 column in the matrices.
In summary, 1 ≤ 2 holds for all case, which contradicts the above argument. This completes the proof. □ Theorem 2. In the optimal solution to the optimisation problem P1 in (21), the optimal channel utilization is not related to the slot location of any node in r .
Proof. Given any pair of nodes k 1 and k 2 in r , suppose there is a slot assignment scheme, called scheme III below, which assigns slots i and j (i ≠ j ) in the following TDMA frame to nodes k 1 and k 2 , respectively. Thus, scheme III has the channel utilization of 3 = ( n×K ), defined in (19), and in the slot assignment matrix (3) n×K , it holds that x i,k 1 = 1 and x j ,k 2 = 1. Then, we exchange the slots of nodes k 1 and k 2 , which leads to a new slot assignment scheme, called scheme IV below, which has channel utilization 4 = ( (4) n×K ). In addition, in the slot assignment matrix of scheme IV, it holds that x j ,k 1 = 1 and x i,k 2 = 1.
Using (19) and the property of slot assignment matrix lead to Noticing nodes k 1 and k 2 are in r , we have P i,k 1 = P i,k 2 = P j ,k 1 = P j ,k 2 = 1 by using (16). As a result, (33) turns into In other words, we have arrive at the conclusion that channel utilisation remains unchanged when we exchange time slots of whichever pair of nodes in r . This completes the proof of Theorem 2. □ From Theorem 1 and Theorem 2, we are aware that all the nodes in r are required to be assigned to the first | r | time slots in the solution to P1 in (21). As a result, P1 is reduced to P2 in (35), which only assigns the last n − | r | slots to the nodes in c r .
Here, * = {| r | + 1, | r | + 2, … , n}. Further, the channel utilization maximization problem in (35) can be transformed into a typical assignment problem if we consider the P i,k n− r as the cost in the assignment problem. Therefore, the optimization problem in (35) can be solved by the Hungarian algorithm [31], a well-known combinatorial optimiza-tion algorithm that solves the assignment problem in polynomial time.

ADAPTIVE FRAME SIZE SCHEME
In the previous section, we investigated the optimal slot assignment scheme with fixed number of slots in a TDMA frame, one slot per node. It should be noticed that, slots assigned to some nodes may be unused due to the random and sparse feature in energy and data arrival. For instance, a node may need more than one TDMA frame to harvest energy, and thus the slots assigned to the node during energy-harvesting is unused, wasting channel resource. Fortunately, with the help of states table, the TDMA frame size (i.e., the number of slots in the TDMA frame) can be adjusted dynamically by the sink. In this section, we present the slot assignment scheme, called the Adaptive Frame Size Scheme (AFSS), to further improve the channel utilization in which TDMA frame size (i.e. n) can be dynamically adjusted to cope with the random and sparse feature in data and energy arrival.

Estimation of qualified nodes
Clearly, the slots in a TDMA frame are underutilized if the number of qualified nodes is smaller than the TDMA frame size (i.e., the number of slots in the frame), and data delivery in some nodes may be postponed otherwise [32]. In other words, TDMA frame size is strongly related to the number of qualified nodes. Hence, we first estimate the number of qualified nodes in a TDMA frame. As each one in r is a qualified node, we have the number of qualified nodes in r as | r |.
Suppose we set the size of the next TDMA frame to n slots. As mentioned in Section 4.5, node k in c r is either an energy-poor node, a data-poor node, or a naughtresource node, and the node becomes a qualified node before slot n (i.e., the last slot) in the next TDMA frame with probability of n,k , n,k , and n,k n,k when the node is an data-poor, energy-poor, and naught-resource nodes, respectively.
Therefore, we have the number of qualified nodes in the following TDMA frame as

The optimization problem for the AFSS
In this section, we formulate a optimisation problem P3 in (37) for our AFSS. This optimisation problem aims at maximizing channel utilization of the EH-WSN by optimizing TDMA frame size.
Here, ⌈⋅⌉ denotes the ceil function. Constraint (37d) intends to set the TDMA frame size to a value up to ⌈n q ⌉. Problem P3 is non-convex since the binary variable x i,k is involved, which is a mixed-integer programming problem. We solve the optimisation problem P3 by considering two cases as follows.

5.2.1
Case 1 (| r | = 0) In this case, r is empty and we only need to assign the slots to the nodes in c r . We use Algorithm 1 to find the solution to P3, where max keeps the maximum channel utilization, n * saves the optimal value of TDMA frame size, * holds the optimal slot assignment matrix, and ℂ n×K stands for the cost matrix, which is the input of Hungarian algorithm. In Algorithm 1, statements 5-11 judge whether constraint (37d) is satisfied or not, statements 12-14 keep the best suboptimal solution via comparison.
The algorithm uses the Hungarian algorithm to obtain the suboptimal for each given n, and the derived suboptimal solutions lead to the solution to P3.

5.2.2
Case 2 (| r | > 0) In this case, we use the following theorem to find the solution to P3.
Proof. When n = | r | > 0, the TDMA frame size is set to the number of nodes in r . For the given n, we use Theorem 1 and obtain the optimal slot assignment that assigns the | r | slots to the nodes in r . With this slot assignment, the channel utiliza- Recall that slot assignment matrix has the property that the elements at a row or a column have sum of 1. By substituting (16) into (38), we have * = From (37), it holds that Equations (39) and (40) indicate that the above slot assignment achieves the maximum channel utilization. Equivalently, n * = | r | is a solution to P3. □ Hitherto, we complete solving the optimization problem P3.

The admission threshold
It should be noticed that the AFSS with the solution to P3 probably exists the following limitation. In the case when | r | > 0, setting n = | r | may cause the nodes in c r to lack chance for transmission until | r | becomes empty. This also causes the sink unable to update the states of the nodes in c r , which may lead to the problem as follows. The nodes in c r can not be admitted into r by the sink, regardless of how many data and energy packets in the buffers.
In this section, we overcome the above limitation by giving a node in c r a condition on which it is admitted into r by the sink.
In fact, for a node in c r , the sink may not receive information from the node in a period consisting of a single TDMA frame or several consecutive frames. We refer to this period as a "blind period" of the node, denoted by T .
A node in c r belongs to e , d , or n . For node k in e , the probability that the node harvests one energy packet during a blind period is Similarly, the probability that node k in d captures one data packet during a blind period is and (II) In addition, the probability that node k in n harvests both one data packet and one energy packet during a blind period is For ease description, we introduce the following notation for the above probabilities.
Then, we present the condition for the sink to admit a node in c r into r as follows: where ∈ (0, 1) is a preset constant, called the admission threshold.
With the above condition, the sink preprocesses the node category, and then uses P3 to obtain the optimal TDMA frame size and the optimal slot assignment.

PERFORMANCE EVALUATION
In this section, we present simulation results to evaluate the effectiveness of the proposed FFSS and AFSS. In the eventdriven simulation, we assume that energy packet arrivals at a node follow a Poisson distribution with rate e [33], and the data packet arrivals at a node with Mode II follow a Poisson distribution with rate d . As stated in [10], the duration of one slot is set to 1 ms. We compare the FFSS and the AFSS with the Fixed-Order TDMA Scheme (FOS) [8], the Traffic-Adaptive Slot-Assignment (TASA) [34], and the Slot-Hitting Ratio-based TDMA schedule (SHR-TDMA) [21]. In the FOS, the nodes share the channel via TDMA and access the channel one by one in a fixed order. The TASA applies a traffic-adaptive priority scheduler in TDMA slot allocation. In the SHR-TDMA, the sink assigns the slots to each node in different order according to their slot-hitting ratios. The following results are the mean of 10 6 simulation runs.
First, we compare these schemes in terms of channel utilization with different node scales, which is presented in Figure 5. In the figure, we set K = 10, 12, … , 20 and = 0.95. Figure 5(a) illustrates the channel utilization under low energy and data arrival rate, where half of the nodes are with mode I and take ∈ [10, 100] randomly, the other nodes are with mode II and take d ∈ [0.01, 0.1] randomly , and all the nodes take e ∈ [0.01, 0.1] randomly. Figure 5(b) shows the channel utilization under high energy and data arrival rate, where half of the nodes with mode I randomly take ∈ [1,10], the other nodes with mode II randomly take d ∈ [0.1, 1], and all the K nodes randomly take e ∈ [0.1, 1]. It should be noticed that the values of e and d in Figure 5(b) are ten times as those in Figure 5(a).
From Figure 5, we have the following observations. 1) Our FFSS and the AFSS outperform the other schemes in terms of channel utilization, which realizes the objective of the FFSS and the AFSS that focus on maximizing channel utilization. 2) Channel utilization increases with growth in the number of nodes K . 3) The AFSS has a higher channel utilization than the FFSS since the AFSS can adapt the TDMA frame size to the number of qualified nodes so that TDMA frames are fully utilized. 4) Compared with other schemes, the channel utilization in the AFSS and the FFSS can be considerably improved in the case of high energy and data rates (see Figure 5(b)) than in the case of low energy and data rates (see Figure 5(a)). The reason is that, the channel resource in the case of high energy and data rates is more scarce than in the case of low energy and data rates, and thus TDMA scheduling scheme helps in improving channel utilization.   Next, we compare these schemes with different energy arrival rates. Setting e = 0.02, 0.04, … , 0.2 and the other parameters as in Figure 5(a), we obtain Figure 6. From the figure, we observe that these schemes share a close channel utilization when energy arrival rate is small, and the proposed AFSS and FFSS achieve a higher channel utilization than the others as the energy arrival rate increases. The reason is that, with a small energy arrival rate, a node may not harvest sufficient energy for transmission, which wastes the assigned slots. With a larger arrival rate, the FFSS is able to make full use of the TDMA frame by assigning slots optimally. In addition, the AFSS can reduce the number of unused slots by adjusting TDMA frame size according to the predicted number of qualified nodes, which further improves channel utilization.
Finally, we compare the schemes via slot utilization. Given a slot, we define its utilization as the ratio of the times of the slot being used to the total number of TDMA frames. Fixing 1) Compared with the AFSS and the FFSS, the slot utilization of the FOS and the SHR-TDMA keeps stable as slot varies, and the TASA exhibits a higher utilization for a slot located close to the beginning of the TDMA frame and a lower one for a slot near the end of the TDMA frame. The reason is that both the FOS and the SHR-TDMA are longterm scheduling schemes which are insensitive to random data/energy arrival. The TASA, however, gives priority to the nodes with sufficient data and thus brings in a higher slot utilization for the slots close to the beginning of the TDMA frame. 2) In the FFSS, the utilization of the slot at the beginning and the end of the TDMA frame is higher than that in the middle of the TDMA frame. The reason is that the slots at the beginning of TDMA frame are assigned to the nodes in r , and the assigned slots can be definitely used as the nodes are with data and have sufficient energy to transmit the data. Additionally, the slots at the end of the TDMA frame are assigned to the nodes in c r , which have a longer time to capture energy or/and data so that the last slots can be fully used.
3) The AFSS exhibits a higher slot utilization at the beginning slots and a lower one at the last slots in the TDMA frame. The reason is that, in the AFSS, the front slots are assigned to the nodes in r and can be definitely used. The AFSS dynamically adjusts the TDMA frame size, which may result in the numbers of slots in TDMA frames are different so that the slots with a larger indexes may not always exist.

CONCLUSIONS
In the EH-WSNs with random energy source and data traffic, a TDMA scheduling scheme may waste time slots if it assigns time slots to the nodes that do not have energy or/and data at their assigned slots, which reduces channel utilization. In this paper, we propose the FFSS and the AFSS to improve channel utilization, in which the upcoming energy and data are considered. The proposed two schemes are applicable to EH-WSNs with random energy source and data. Clearly, a time slot is wasted if it is assigned to an EH-node that cannot deliver data to the sink because the sink cannot receive the signal with acceptable Signal-to-Noise Ratio (SNR). There are many factors that degrade the signal and SNR, including fading due to motion or atmospheric conditions, radio frequency shadow created by a s structure or hill, and more. Nowadays, some of the factors are diluted by channel diversity techniques, including space diversity, frequency diversity, etc. Space diversity uses different physical paths for a signal so that a wireless link can overcome propagation or interference issues, thus improving reliability and capacity; and frequency diversity uses multiple widely spaced frequency channels to send the same message, usually at the same time, in hope that at least one of the signals carried in the channels is received with acceptable SNR, making the message recovered by the receiver. Therefore, performance can be improved if we can design a slot assignment scheme that takes channel diversity and time-invariant of fading channel into account. This will be investigated in our future work.