The PCEM-MS protocol involves two parts: the distributed power control algorithm (DPCA), based on the multisink DPCA, and the unequal clustering and energy-balanced algorithm located inside the sink (UCEBA).

The DPCA based on the multisink is mainly used to adjust the power of the adjacent sink and ensure the overall multisink coverage. The UCEBA achieves energy balance and prolongs network lifetime by considering the long-strip structure of the coalmine tunnel.

#### 4.1. DPCA Algorithm

According to the power control model, the control problem of the transmission power is converted to the control problem of the communication radius, and the following theorem is obtained.

**Theorem** **1.** Two sinks (S1 and S2) are deployed in a rectangular area, P, with a size of a × b, and in the central line of the rectangular area. It is necessary for the wireless range circling the two sinks to intersect outside of the area P to guarantee sink coverage in the network. In addition, the rectangular top point corresponding to the sink location needs to be within the wireless range of the sink. Here we use R_{S1} to represent the wireless range of S1 and R_{S2} to represent the wireless range of S2.

**Proof.** Two sinks are distributed in the

ABCD rectangle area with a size of

a ×

b (

Figure 3). The two circling sink wireless ranges intersect at

E and

F. The following relation thus needs to be met to ensure network coverage:

Accordingly, EF is the connecting line between the two intersecting points of two circles. This line intersects with line AD of the rectangle at E′. F′ intersects with line BC of the rectangle. Therefore, $EF\ge {E}^{\prime}{F}^{\prime}$ needs to be met to satisfy Equation (5), and it is necessary for the two circling wireless ranges of the sink to intersect outside region P.

If we suppose that the rectangular vertices corresponding to sink

S2 are not inside its wireless range (

Figure 2), the rectangular vertices are then extended to

D′ and

C′, and rectangle

ABC′

D′ intersects with the wireless range circle

S2 at

H,

H′,

G, and

G′. However, the range covered by the circling wireless range of the two sinks does not cover the entire rectangular

ABC′

D′ area,

As Equation (6) does not meet the requirements of Equation (5), the rectangular vertices corresponding to the sink need to be located in the wireless range of the sink to ensure network coverage. ☐

According to Theorem 1, the wireless ranges of

R_{S}_{1} and

R_{S}_{2} should meet the following formula,

where (

x,

y) refers to any sensor node in the sink communication range, and (

x_{s}_{1},

y_{s}_{1}) and (

x_{s}_{2},

y_{s}_{2}) refer to the coordinates of the two sink nods. The transmission power of each sink is minimized to ensure network coverage. Function

f is defined as follows:

Here, the two sinks are taken as examples, but the remaining sinks can be deduced using the same method.

Handshake data packet needs to be defined to ensure communication between the sink nodes for the DPCA algorithm. This handshake packet includes three data domains (

Figure 4), namely, the packet header, sink ID, and sink location information. Among these domains, the sink ID in ascending order is unique in the network. At network initialization, each sink is able to obtain information relating to its adjacent sink by receiving a handshake packet.

k sink nodes are deployed in the network with a size of

L ×

W, and the coordinates are represented by (

x_{si},

y_{si}), where 1 ≤

i ≤

k.

P(

X,

Y) is set as a rectangular area, where

X is the length of the rectangle and

Y is the width of the rectangle, and

X >

Y.

Cir(

x_{si},

y_{si},

r_{si}) is a circular region with (

x_{si},

y_{si}) as the center and

r_{si} as the radius. The following then needs to be met to ensure 100% network coverage,

It is necessary for each sink to have appropriate transmission power after negotiation to ensure that each sink reaches 100% network coverage after transmission power control. Equation (4) indicates that the transmission power is calculated after obtaining the communication radius of each sink. Therefore, calculation of transmission power is converted to the solution of the communication radius.

In this respect, each sink firstly obtains its own coordinate information using the UWB technology. A handshake packet and a PCM message are then broadcasted to the neighboring sink. The distance between the sink with the minimum sink ID and the corresponding top of the rectangular area are regarded as the wireless range.

There are four intersection points between the wireless range circle and the rectangular boundary of this sink (S1 in

Figure 3). The other sinks also have four intersection points, if an appropriate wireless range is selected (S2 in

Figure 3). After the wireless range is determined, each sink then sends a sink ID message to all the sensor nodes in its coverage. Moreover, this sink ID message is used in the clustering algorithm. For the overlapping region with two sinks, the sensor node will obtain two sink IDs, and these sensor nodes then select the closest sink and transmit the data to the sink directly.

In this study, it is considered that the sink coverage is guaranteed for the entire network once the union of the cutting line contains four lines of the entire rectangle, and after the circle (with each sink as the center of the circle) and the corresponding wireless range (as the radius) intersect with the rectangle’s lines. The wireless range,

r_{i}, starting from the second sink,

$i\in k$, must then meet the following relation,

Based on this theory (

Figure 5), the following three selections of the sink for the wireless range are found, if three sinks exist in the network: (a) extremely large; (b) suitable; and (c) extremely small. Calculations are then required for each sink to obtain the most ideal wireless range, and then each sink can select the proper transmission power by automatic adjustment.

Figure 6 introduces the calculation process for determining the wireless range. Two sinks are deployed in S1 and S2: the coordinates of S1 are (

x_{s}_{1},

y_{s}_{1}) and those of S2 are (

x_{s}_{2},

y_{s}_{2}). S1 is the first sink with sink ID 1. This sink regards |S1B| as its wireless range (i.e.,

R_{S}_{1}). S2 therefore needs to calculate its wireless range (

R_{S}_{2}) based on R

_{S1},

The wireless range

R_{Si} of each sink is then represented by

The UCEBA proposed in this paper is used for clustering after the transmission power of each sink has been adjusted. After clustering has been completed, the sensor nodes in each cluster initiate a one hop communication with the cluster head in the same cluster. Finally, the cluster head sends data to the sink using the one hop communication, thereby ensuring that the data are rapidly and stably transmitted to the sink from the sensor node.

Transmission power maintenance is a process that involves adjusting the sink’s own transmission power in real time according to the actual working environment. After a route becomes invalid, the sensor node begins an alternate route or routing mechanism, and this causes each sink to rearrange its transmission power. The wireless range of the sink is estimated by the DPCA algorithm on the basis of the link between the local sinks. Therefore, its power maintenance is realized through the periodic exchange and broadcasting of the PCM.

Figure 7 describes the DPCA algorithm.

#### 4.2. UCEBA Algorithm

The UCEBA algorithm is mainly used in the selection of the cluster head, calculation of the unequal campaign radius, and generation of the final cluster head. Each sensor node joins the cluster in one hop. For the overlapping region with two sinks, the sensor node will obtain a two sink ID; these sensor nodes select the closer sink and transmit the data to that sink directly. To guarantee the energy balance and to prolong the network lifetime, the cluster that is furthest from the sink has a larger radius and more cluster members than the cluster that is closer to the sink.

Figure 8 shows the specific clustering mechanism involved. Accordingly, the cluster near sink 1 has a small radius, whereas that which is furthest from sink 1 has a large radius. The communication process is described as follows. First, the sinks are set in the middle of the coalmine tunnel at random intervals (i.e., not more than the maximum communication radius of each sink). Second, the transmission power between the sinks is controlled to ensure network coverage dynamically based on the DPCA algorithm. Third, the clusters are built within the coverage of each sink as individual regions using the UCEBA algorithm; the transmission power of the sensor nodes can then be controlled to guarantee minimum energy consumption. Finally, the sensor nodes use one hop or two hops to transmit data to the sink directly or via the cluster head.

#### 4.2.1. Selection of the Candidate Cluster Head

After power adjustment, the obtained coverage areas, all the sinks that broadcast the sink ID data packet in their coverage areas, and the sensor nodes that receive the same sink ID are considered to be in the same region. Clustering is then conducted in this region. Some of the sensor nodes located in the overlapping region will obtain a two sink ID; these sensor nodes will then transmit data directly to the closer sink without needing to join a cluster.

In selecting the candidate cluster head, a threshold value,

T, is firstly preset. A

u_{0} value is then randomly generated in each sensor node in [0, 1]. If this value is smaller than

T, then the sensor node becomes the candidate cluster head. The calculation formula of

u_{0} is shown as follows:

where

E_{0} refers to the initial energy of the sensor node, and

E_{cu}_{(i)} refers to the residual energy of

i sensor node.

u_{0} is then calculated using Equation (13) after generating

u randomly. A sensor node is selected as the candidate cluster head if

u_{0} ≤

T. Moreover, a sensor node with larger residual energy has a smaller

u_{0} after calculation and is thus more likely to become the candidate cluster head. A sensor node with

u_{0} >

T become a non-candidate cluster head and it then enters a sleeping state.

#### 4.2.2. Calculation of Unequal Radius

It is necessary to have an unequal competitive radius to control the cluster scale and to determine the final cluster head out of all candidate cluster heads. A certain relation clearly exists between the unequal radius and the residual energy of the node; the radius becomes larger if the residual energy is higher and the scale is larger. In contrast, the radius becomes smaller if the residual energy is lower, which effectively prolongs the network lifetime. The competitive formula proposed in this paper is presented as follows:

Accordingly, ω_{1} and ω_{2} refer to the adjustment coefficient in the 0–1 range. E_{cu} refers to the residual energy of the existing candidate cluster head node, E_{0} refers to the initial energy of the candidate cluster node, d_{toSK} refers to the distance between this candidate cluster head node and the sink, d_{max} refers to the maximum distance between all the candidate cluster heads and sink, and R_{max} refers to the maximum cluster radius. Clearly, exceeding R_{si} is impossible for the maximum cluster radius, R_{max}. Therefore, this study considers that R_{max} ≤ R_{si}.

An analysis of Equation (14) shows that if the residual energy of the candidate cluster head is less than others and has a smaller competitive radius, then the premature death of the cluster head is avoided. In addition, if the distance between the candidate cluster head and sink is shorter, then the competitive radius is also smaller than others, thereby avoiding the premature death of the cluster head caused by heavy forwarding of data. Therefore, a competitive radius is used to control the scale of the cluster head and to ultimately achieve an energy balance.

#### 4.2.3. Selection of Final Cluster Head and Cluster Formation

The final cluster head is generated using a certain competitive strategy. The sensor nodes are unable to supply energy for the coalmine tunnel once they are deployed; therefore, it is necessary to prolong the lifetime of the sensor nodes that are located far from the sink and have low energy. That is to say, the sensor which is closer to the sink node and higher in energy is preferred as the cluster head, thus prolonging the network lifetime.

First, each sensor node for the UCEBA saves a list of neighbor nodes.

Table 1 presents information relating to neighbor sensor nodes. All sensor nodes receiving the same sink ID are located in the same region. Some of the sensor nodes in the overlapping region will obtain a two sink ID, and these sensor nodes transmit data directly to the closer sink and do not need to join any cluster.

Table 1 shows that the list of neighbor nodes comprises the candidate cluster head ID, status, residual energy, and distance to the sink. Each candidate cluster head broadcasts with a competitive radius,

R_{ra}, as it transmits its competitive information COMPETE_MSG. All candidate cluster heads in radius

R_{ra} of a candidate cluster head,

V_{i}, are regarded as neighbor nodes of this candidate cluster head. The neighbor node of the candidate cluster head

V_{i} is recorded as

V_{i}.Neitab.

where range (

V_{i},

V_{j}) denotes the distance between nodes

V_{i} and

V_{j}.

Each candidate cluster head calculates the average residual energy,

E_{a}, of all the sensor nodes in its competitive radius and the average distance,

D_{a}, to the sink according to the list of neighbor nodes.

Accordingly, V_{j} (1 ≤ i ≤ m, i ≠ j) refers to the neighbor sensor node in a radius, R_{ra}, of the candidate cluster head V_{i}, and m refers to the number of neighboring sensor nodes.

Each candidate cluster head then starts timer,

t, according to the following equation,

where

k refers to the real number evenly distributed in [0, 1] at random, and

t_{0} refers to the competitive duration of the candidate cluster head agreed in advance. The candidate cluster head node is successfully competitive if it does not receive the message on the competition victory of the neighbor candidate cluster head node SUCCESS_MSG before time,

t. The message SUCCESS_MSG is then sent to the other neighbor candidate cluster nodes. Otherwise, the candidate cluster head is defeated and quits the competition. The aforementioned formula and analysis show that all the sensor nodes in the competitive radius have relatively high residual energy. Moreover, there is a higher probability that a sensor node that is located relatively near the sink will become the final cluster head, and will ultimately and effectively prolong the lifetime of the candidate cluster head nodes located far from the sink that have lower energy.

The sensor nodes that do not participate in the competition are woken from their sleeping state after the final cluster head has been selected through competition. The final cluster head broadcasts the competition victory message, CH_ADV_MSG, using

R_{ra} as the radius. The ordinary sensor nodes select the cluster head that has the minimum communication cost from many neighboring cluster heads, namely, the cluster head with the strongest signal-receiving intensity, to send the message JOIN_CLUSTER_MSG, and to note the cluster head. This cluster head finally constructs the TDMA dispatch using the organization method, which is similar to the LEACH protocol, and transmits data by clustering members to the cluster head. Algorithm 1 shows the process of a sensor node,

V_{i}, participating in the cluster head competition and finally forming a cluster.

**Algorithm 1:** UCEBA Algorithm: unequal cluster algorithm |

Input: initial energy of the E_{0} node; residual energy of i of the E_{cu}_{(i)} node; distance d_{toSK} between the candidate cluster head and the sink; the maximum distance R_{max} between the candidate cluster head and the sink; duration of the competition of the candidate cluster head agreed in advance t_{0} |

Output: cluster head, unequal radius R_{ra} |

01: | Sensor nodes with the same sink ID form a region. |

A sensor node in the overlapping region obtains two sink IDs and the distance between it and the two sinks is calculated. The sensor node then transmits data to the closer sink and does not need to join a cluster. |

02: | Other sensor nodes that only have one sink ID are used to calculate u_{0} according to Equation (13), and are then compared with the threshold value, T; those with a value less than T become the candidate cluster head (if not, they become an ordinary sensor node). The unequal radius, R_{ra} is then calculated according to Equation (14). |

03: | Each candidate cluster head broadcasts its competitive message, COMPETE_MSG, using a competitive radius R_{ra}. |

04: | Each candidate cluster head starts timer, t, according to Equation (17). |

05: | The candidate cluster head is successfully competitive if each candidate cluster head does not receive the message SUCCESS_MSG from the neighbor candidate cluster head before t time is shown in its timer. This indicates that the candidate cluster head has been successfully competitive. After it becomes the cluster head, it then proceeds to 07; otherwise it proceeds to 06. |

06: | The candidate cluster head defects and quits the competition, thereby becoming an ordinary sensor node. |

07: | The candidate cluster head is successfully competitive, becomes a cluster head node, and sends a competition victory message, SUCCESS_MSG, to all neighboring candidate cluster head nodes. |

08: | The cluster head node broadcasts the competition victory message, CH_ADV_MSG, to the ordinary sensor nodes, using R_{ra} as the radius. |

09: | The ordinary sensor node sends message, JOIN_CLUSTER_MSG, to notify the cluster head that it will become a cluster member node for sending data to the cluster head. |

10: | End |