Abstract

One of the most important means to position abnormal devices is to efficiently utilize the resources of wireless sensor network (WSN) and make proper analysis of the relevant data. Therefore, this paper constructs an indoor positioning and prewarning system that utilizes energy efficiently and achieves a long lifecycle. Firstly, the adjacent round iteration load balancing (ARILB) routing algorithm was proposed, which elects the cluster heads (CHs) by the adjacent round strategy. In this way, the random components were eliminated in CH election. Next, a short-distance multifrequency routing strategy was constructed between CHs to transmit the information to the sink, and a positioning algorithm was designed called ARILB-received signal strength (RSS). The ARILB-RSS positioning algorithm traverses the triangles formed by anchor nodes, forming multiple sets of ranging points; then, the optimal anchor node is recorded, and the path loss factor is iterated to reduce the positioning error. Simulation shows that the network survives 54.5% longer using ARILB than using the distributed energy-efficient clustering (DEEC) algorithm; the packet delivery rate using ARILB was about 139% higher than that of low energy adaptive clustering hierarchy (LEACH) algorithm and 35% higher than that of uneven clustering routing algorithm based on chain-cluster type (URCC) algorithm; ARILB-RSS reduced the ranging error by 14.31% and then the positioning error by 26.79%.

1. Introduction

Since its entry to the World Trade Organization (WTO) in 2001, China has maintained a rapid growth of economy for a long time, with its gross domestic product (GDP) growing at the rate of about 1,000% [1]. Meanwhile, there has been a significant increase in the fiscal revenue and economic capacity of the Chinese government and the hard power of the country. Against this backdrop, the Chinese people pursue long-term and better living standards [2]. Infrastructure, as an important carrier of living standards, has attracted more and more attention and policy support from the government [3]. In recent years, China has stepped up the construction of infrastructure, and completed numerous stations, stadiums, and shopping malls. Airports and residential communities are among these dense and complex buildings. The new airports are usually built together with transport facilities like high-speed rail and subway such as Hartsfield-Jackson Atlanta International Airport (Atlanta, USA), Heathrow Airport (London, UK), Frankfurt International Airport (Frankfurt, Germany), Narita International Airport (Narita, Japan), and Shanghai Pudong International Airport (Shanghai, China), making the building structure even more complicated. With the advancement of urbanization in China, newly built residential quarters in cities generally have a high floor area ratio.

While improving people’s living standards, the above infrastructure adds difficulty to building maintenance and risk prewarning. The monitoring and positioning of personnel and equipment in buildings are essential to building maintenance and risk prewarning. For example, the building infrastructure in Europe is becoming older. Steel structures in industrial facilities and plant constructions are also affected by this ageing process. America needs to spend more than a quarter of a trillion dollars to bring its PreK-12 public school buildings up to working order, because these buildings lack building maintenance and risk prewarning. The health of building maintenance can be measured by flow of people and the operation status of equipment. These metrics require continuous attention from the government and enterprises [4]. Nevertheless, it is extremely difficult to install, access, or manually maintain equipment in dense and complex buildings. This pushes up the operation and maintenance costs of buildings and reduces economic benefits. Meanwhile, the demand for effective monitoring and positioning of people in buildings has skyrocketed, owing to the rapid growth in the number of buildings [5]. Therefore, it is significant to realize reliable monitoring and positioning of indoor personnel and equipment.

The monitoring of people and equipment in buildings must be objective and consider various random factors. Objectivity is important because different equipment has different properties [6], which leads to the variation in sensor type and location. In order to ensure the improved type of the monitoring system, the development needs of the improved space and related instruments should be reserved when designing the system. The most significant random factor is people flow. The preset monitoring lines must account for the errors induced by the unpredictable people flow in the buildings. Hence, it is an inevitable trend in the development of indoor monitoring and positioning to improve the adaptability of the monitoring system.

Data is an inaccessible part of the various scientific and technological methods for digital indoor monitoring. As a key infrastructure for data acquisition, wireless sensor network (WSN) has been increasingly applied to various data collection tasks. WSN technology brings the data monitoring system multiple advantages, such as real-time uninterrupted monitoring, strong dynamic performance, and easy installation of facilities. WSN can effectively acquire data about the changes in equipment indices and personnel density in the monitoring range, eliminating the need for large-scale modifications to the original power supply lines. Although the WSN system is still in the test phase, there are some shortcomings, but it is still related to improvements and applied in actual operations. Therefore, our simulation only considers the data preprocessed by sensor chip. Then, it is a crucial issue to send these data to the data center.

WSNs can be an integral part of military command, control, communications, computing, intelligence, surveillance, reconnaissance, and targeting systems. The autonomous coordination capabilities of WSNs are utilized in the realization of a wide variety of environmental applications. For example, the developments in implanted biomedical devices and smart integrated sensors make the usage of sensor networks for biomedical applications possible. Smart sensor nodes and actuators can be buried in appliances such as vacuum cleaners, microwave ovens, refrigerators, and DVD players as well as water monitoring system. Routing algorithm [710], as an important means of data transmission in WSN, has received extensive attention from scholars. Recent years have witnessed a marked progress in routing clustering algorithms at home and abroad. Some of the latest routing algorithms are reviewed below:

Unequal cluster-based routing protocol (UCRP) is a routing algorithm to improve network throughput, packet delivery ratio, and energy of cognitive radio ad hoc networks. The UCRP realizes these goals by processing multilayer rings and normal nodes with different initial energies. Based on the optimal cluster radius, the UCRP was proved to outperform existing models through experiments [11]. Proactive source routing (PSR) protocol [12] is a lightweight routing algorithm that offers and provides new distance vector (DV) routing, link state (LS), and source routing method. Simulations have shown that PSR yields similar or better data transmission performance than other protocols.

The distributed probabilistic routing protocol (ProHet) abstracts a bidirectional route by finding a reverse path for every asymmetric link and using a probabilistic strategy to choose forwarding nodes, based on historical local information for WSN. ProHet realizes better efficiency, delivery rate, message cost, and coverage ratio than classic routing algorithms, such as prolong stable election routing (P-SEP) and unequal cluster-based routing protocol (UPRR) [13]. In 2013, Jin et al. proposed a practical passive cluster-based node-disjoint many-to-one multipath routing protocol, with the aim to enhance energy efficiency and maximize network lifecycle. This protocol searches for the optimal path through active clustering. The typical feature of the protocol is a node-disjoint many-to-one multipath routing discovery algorithm and the cost minimization on the multiple paths [14].

Centralized energy-efficient clustering routing protocol (CEECR) [15] provides a centralized cluster formation algorithm, detached nodes, and a mobile strategy. Compared to other routing protocols, CEECR reduces average energy dissipation and improves the packet delivery ratio. Aided efficient data gathering (AEDG) [16] is a novel approach to limit the number of associated nodes with the gateway nodes, with the aim to minimize network energy consumption and prevent gateway overloading. Through this approach, it is possible to obtain the suboptimal elliptical trajectory between nodes and ensure the duration, stability, and throughput of the network. Saleem et al. proposed a novel biological inspired self-organized secure autonomous routing protocol (BIOSARP) based on autonomous routing mechanism. The core of the protocol is to optimize the delay-reducing forwarding decision with the improved ant colony optimization (IACO). BIOSARP offers better results than many other protocols in WSN-based environmental monitoring [17].

To reduce the number of routes in conventional routing algorithms, Weng and Lai noted that the triangle routing algorithm saves much energy to transmit data between the transmitter and the receiver, by selecting sensors with a simple triangle rule. Therefore, they designed an enhanced relative identification and direction-based sensor routing (ERIDSR) algorithm, which effectively lowers the total energy in near-sensor nodes [18]. Ogundile et al. [19] put forward a clustered WSN that requires a sturdy energy-balanced (EB) and energy-efficient (EE) communication protocol. With the aid of the priority table, the protocol is formed by prioritizing the two shortest paths to the cluster head (CH) or sink, following some simple yet efficient rules. The purpose is to extend the lifecycle of WSN through balancing energy consumption.

The routing protocol of the WSN should prolong the lifecycle of the network and excel in data collection. The collected data should be analyzed by the server to judge whether the monitored area is abnormal. If the area is abnormal, it is necessary to locate the abnormality and make inspection and repair in a timely manner. So far, many scholars have explored WSN positioning algorithms. Depending on the necessity of node distance, the existing WSN positioning algorithms can be divided into two categories [20]: range-based algorithms and range-free algorithms. The typical range-based algorithms are time of arrival (TOA) algorithm [21], time difference of arrival (TODA) algorithm [22], angle of arrival (AOA) algorithm [23], and received signal strength indicator (RSSI) algorithm [24]. The range-free algorithms include approximate point-in-triangulation (PIT) test (APIT) [25], distance vector hop (DV-Hop) [26], and centroid algorithm [27]. Among them, the RSSI algorithm is low cost and easy to implement, because most wireless communication modules support RSSI ranging.

The above review shows that clustering and data transmission are the research focus of WSN communication. Therefore, this paper proposes the adjacent round iteration load balancing (ARILB) routing algorithm. Once the network is initialized, the number of CHs is optimized based on adjacent rounds to extend the network lifecycle. Then, the ARILB-received signal strength (RSS) algorithm was designed to enhance positioning accuracy. In the positioning phase, the ARILB-RSS algorithm determines the multilateral centroid more accurately. Finally, MATLAB simulations were conducted to demonstrate the performance of the proposed ARILB-RSS algorithm, compared with the ARILB algorithm.

2. Indoor Wireless Monitoring and Positioning System

2.1. Technical Roadmap

Figure 1 shows the technical roadmap of our indoor wireless monitoring and positioning system. There are two parts in the system: a routing algorithm and a positioning algorithm. The routing algorithm is the basis for running the positioning algorithm. The routing algorithm is the basis for running the positioning algorithm. First, the routing algorithm obtains various monitoring data based on WSN and sends the data to the server. Then, the server performs data analysis and discovers the anomalies. Finally, the location algorithm calculates the location of the anomalies. (1)Routing algorithm

The routing algorithm collects data through sensors regularly arranged in the monitoring area and stores them in sensor memories. Then, the data are transmitted to the data center by the proposed ARILB algorithm, which is innovative in specificity analysis, CH election, and data transmission. Specifically, the sensor nodes are deployed evenly; adjacent rounds are introduced to the threshold equation to optimize the number of CHs; the optimal relay link is adopted to transmit the acquired data to the base station. (2)Positioning algorithm (ARILB-RSS)

Firstly, the data obtained by ARILB algorithm are analyzed to find anomalies. Then, the abnormal equipment and people are located by ARILB-RSS in three phases: ranging, positioning, and correction. The ranging is realized with a classic ranging model. The positioning and correction are completed by ARILB-RSS, which is extended from the ARILB. The positioning is implemented in the following procedure: the triangles formed by anchor nodes are traversed to form multiple sets of range points. Then, the optimal anchor node is recorded by comparing the slope of each anchor node with that of the equilateral triangle. After that, the correction is made by periodically measuring the RSSI between anchor nodes near the unknown node. Then, the path loss factor of the next iteration is estimated based on multiple measured values, thereby minimizing the positioning error.

2.2. Specificity Analysis

With the expansion of application fields, WSN is facing more and more challenges. Unlike other monitoring systems, the indoor monitoring system does not need to focus on signal fluctuations in conventional deployment environments. For example, sensor nodes are sometimes arranged in liquid like water, which obstructs the signal transmission to a certain extent. Because of the uniform density of the liquid, the signal obstruction effect is uniform across the liquid. However, the signal might fluctuate due to crowd movement in buildings, as well as other random factors in indoor equipment and personnel monitoring. Therefore, wireless sensors need to be installed to suppress data fluctuations.

The indoor environment is different from the environment of classic routing algorithms. In indoor monitoring, the randomness brought by crowd movement is the key constraint on data transmission. There are many drawbacks of traditional data transmission methods in indoor monitoring. The WSN can transmit data in multihop mode or single-hop mode. In a single-hop transmission network, energy consumption is mainly affected by distance, the signal is dispersed, and the monitoring threshold is extremely low. As a result, single-hop transmission should be avoided in indoor monitoring.

In a multihop transmission network, the death of any CH has an immense impact, which can be mitigated by increasing the density and energy of CHs. However, increasing CH density will delay information transmission, while increasing CH energy will increase economic cost. Therefore, both single- and multihop transmission modes should be improved before being used for indoor monitoring and positioning.

3. Assumptions and Modeling

3.1. Assumptions

It is assumed that the monitoring area is a regular rectangle, all sensors are arranged randomly in this area, and all sensors can cover the area effectively without sudden failure. The sensors installed by the ARILB algorithm have the following features: (1)Every sensor installed in the network has a unique identification (ID) tag. Once a sensor fails, its ID will no longer be used(2)The position of each sensor does not change after installation(3)The sink has certain perception capabilities(4)When the system is running (the main switch is not turned off), the energy of the sensors cannot be supplemented(5)The sensors communicate via a symmetric two-way channel, which will never be blocked

Based on the above assumptions, sensors are randomly arranged in an rectangular area and transmit the acquired data back to the sink. Since the equipment and people flow are fixed, the sink (data center) should be installed in the geometric center to ensure the symmetry of data collection. Once the wireless monitoring system enters into operation, the network nodes will aggregate around CHs into clusters, and the data collected by the nodes in the same cluster will be sent collectively to the sink. Then, a clustering method should be adopted to mitigate the impact from the constantly changing network structure.

3.2. Energy Consumption Model

WSN mainly consumes energy in data sending and reception (Figure 2). By the transmission distance of nodes, the data sending energy can be described by two models. The energy consumed by a sensor to send each -bit of data can be calculated by where is the energy consumed to support equipment operation; is the energy consumed by the radio frequency power amplifier, which accounts for a large portion of the energy consumption of the sensor node, within a communication distance (if the energy consumption surpasses , it will nosedive to ); is dependent on the transmission distance; if ( is the threshold of the transmission distance), and if .

3.3. Protocol Matching by Classical Algorithm

Low energy adaptive clustering hierarchy (LEACH) algorithm [28] is the most classic routing algorithm, which effectively reduces energy consumption through clustering. However, its clustering rules have many defects in the matching of wireless routing protocols. (1)CH election

LEACH generates CHs randomly by formula (2). In the initial state, each sensor node produces a number randomly in [0, 1] and uses this random number to influence CH election. Specifically, the random number is compared against the threshold . If the random number is smaller than , the node becomes the CH in this round. where is the percentage of the expected number of CHs among all nodes; is the number of election rounds; and is the number of nodes elected as CHs before this round. The nodes not elected as CH in this round are allocated to a set .

Formula (2) ensures that every network node could be elected as CH and balances the energy consumption of all CHs. However, if this scheme is applied to a short-distance multifrequency scenario, the network nodes might cluster unevenly. To make matters worse, the heterogeneity of equipment properties determines that sensors differ greatly in adjustment. In other words, there is a huge difference in the data output in different areas. Therefore, formula (2) cannot be adopted for clustering alone. (2)Data transmission

In LEACH, after a CH receives the requests from all non-CH nodes, it will create a scheduling table based on the number of sensors in its cluster and establish a scheduling sequence. Then, the CH sends the data directly to the sink. Nevertheless, in our monitoring scenario, some sensors might fail suddenly due to sudden changes in the monitoring area. Besides, the local data transmission is not smooth in the monitoring system. Therefore, it is necessary to enhance the degree of redundancy by improving the data transmission rules.

4. ARILB Routing Algorithm

In ARILB algorithm, CH election is usually implemented in the following stages. Before the algorithm starts, all sensors are fully charged, and the current state is by default the initial energy state of each sensor: where is the unique ID of the sensor, is the ratio of the current round number to the total time, is an indicator of CH status (if , the sensor is not a CH; if , the sensor is a CH), is the percentage of the remaining energy of the current node, and is the relative distance between the node and the base station (%). Therefore, the initial state of sensor can be denoted as .

In WSN, the health of sensors can be largely measured by energy. Let be the health of a sensor at a certain moment, i.e., the energy factor. Obviously, the energy factor decreases continuously with the progression of data collection. The value of this factor falls in . If , the sensor is in the healthiest state. If keeps dropping, the energy loss of the sensor is on the rise.

4.1. Structure of Monitoring Area

As suggested by signal characteristics [29] and Section 2.2, the monitoring area must be preprocessed to improve the monitoring effect. Considering the cost of sensors, the best preprocessing strategy is to optimize the spatial distribution rules. Therefore, this paper derives a suitable space model in the following process.

As mentioned before, the study area is an square, with the sink at the geometric center. According to the equipment locations and mean speed of people flow [30], the interval of the sensors deployed in the network is smaller than the threshold mentioned in Section 2.2. The monitoring area could be divided into square subareas with a side length shorter than .The side length is related to various transmission paths and monitoring thresholds: . In addition, a circular area with a radius of is planned near the sink and monitored directly by the base station (Figure 3). The purpose of this circular area is to prevent energy holes [31] and reduce path loss. Energy hole is a phenomenon in the traditional multihop mechanism: the nodes close to the sink are overloaded by data transmission tasks and thereby die prematurely. If the nodes close to the sink reduce or cancel the data transmission tasks, the energy consumed by them will be mostly utilized to transfer their own data. If , the energy consumption will be greatly reduced.

4.2. CH Generation

CHs are constantly updated in the routing algorithm. In the beginning, the sink sends an initial signal to the entire monitoring area in a radiant manner. Then, each sensor starts to prepare for CH election. The proposed ARILB algorithm combines the classic routing algorithm with application scenarios into a CH generation scheme suitable for wireless monitoring of indoor equipment and personnel. The specific process is as follows:

Firstly, the sink broadcasts a “Hello” to the entire network. Upon receiving this information, each sensor waits to enter the working state. When all sensors are activated, the ARILB algorithm enters the CH generation phase. When a CH is elected, every network sensor will spontaneously generate a random number, rand, in the interval of (0, 1) and compare this number with a threshold function to finalize the CH election.

Specifically, the rand is contrasted with the new threshold function for the following reasons: environmental factors (temperature, humidity, and wind speed) on the speed of crowd movement exert a combined effect on equipment monitoring, making it hard to balance the operation of the routing algorithm. In other words, the sensors are triggered at nonperiodic frequency.

ARILB has different requirements for CHs in different adjacent rounds. Therefore, this paper proposes a new threshold function based on adjacent rounds. The function uses the energy factor defined above and introduces the iteration parameter : where can be calculated by where is the ratio of the current number of rounds to the total time. Formula (5) shows that clusters of different sizes can better match the frequency of a sensor triggered by random factors and make the CH election and cluster members more reasonable.

4.3. Routing Strategy

Energy consumption is the most pressing problem in the data transmission. As mentioned before, network data can be transmitted in single-hop mode or multihop mode. Under single-hop mode, each CH directly sends the collected data to the base station. Despite being simple to implement, single-hop mode has obvious shortcomings. Since the CH directly communicates with the sink, distance has a great impact on energy consumption. Different amounts of energy are consumed to transmit the same data over different distances. In the monitoring area, the sensors near the boundaries need to consume the greatest amount of energy. The excessive energy consumption of boundary sensors can be effectively prevented by the multihop mode. However, the multihop mode can hardly realize the continuity of data relay, which should not be interrupted. When multiple areas need to be monitored simultaneously, the multihop transmission links must meet higher requirements.

Through the above analysis, this section proposes a short-distance multifrequency routing scheme. It is assumed that, under multihop mode, each CH for data relay only forwards the information from the previous CH, without performing other relay tasks. Then, the problem of data transmission from boundary sensors to the sink can be converted into the selection of relay links.

To choose the right link, the CH in the CH set needs to find the next-level relay CHs . During data transmission, at least one relay CH needs to be found. Then, the total transmission distance of data in the link can be shown as where is the energy of CH; is the total transmission distance; is the transmission distance of a relay interval; and is the number of relays.

To transmit data, ARILB uses a partition-based multihop mode (Figure 4). Each CH can only transmit information once in a round. After receiving a piece of information, a CH will no longer receive any other information. At this time, the CH needs to forward the information to another CH that has not received the information in the subarea. If all CHs in the subarea have received the information, the CH will jump to another subarea, looking for a suitable CH. If the energy of the current CH is below the mean energy of the candidate CHs for next-level relay, the current CH will choose the closest CH as the next-level relay. This process will be repeated in turn, until the remaining energy of the current CH is greater than the mean energy of the remaining candidate CHs. In the latter case, the CH will directly send the data to the sink.

4.4. Positioning Algorithm

The distance-based positioning algorithms position nodes by the principle of space geometry, using the bases of distance and angle. Among them, the RSSI algorithm is simple, energy-efficient, and power-efficient, providing a suitable tool for the design of a low-power WSN. That is why this section presents the ARILB-RSS positioning algorithm. There are three stages of the RSSI-based positioning [32]: ranging, positioning, and correction.

4.4.1. Phase 1: Ranging

The distance between each anchor node and the unknown node is calculated based on the intensity of the transmitted signal to the unknown node. The most popular RSSI model can be expressed as where d is the distance of the source;  m is the reference distance; is the path loss factor; and is the signal strength at . represents the zero mean Gaussian variable. Then, a target can be positioned based on the location and signal strengths between two points. Formula (7) shows that the signal attenuates very quickly over a short distance. Therefore, the positioning error using RSSI signal attenuation is small in a short distance. This meets the short-range multifrequency requirements of the routing strategy in Section 4.3.

4.4.2. Phase 2: Positioning

The unknown node calculates the distance from an anchor node and locates its position. The greater the RSSI received by the unknown node, the smaller the signal attenuation, and the shorter the distance between the known node and the anchor node. Therefore, a high RSSI received by the unknown node means the environment and obstacles have a limited impact on positioning. It is possible to locate any object based on the positions of 3 sensor nodes, which are not in a straight line. Therefore, this paper proposes an improved positioning method (Figure 5).

In WSN, each anchor node sends RSSI signals to any unknown node. Then, the unknown node sorts the RSSI signals in a descending order by signal strength: , with being the number of received RSSI signals, i.e., the number of anchor nodes within the communication range. Since the corresponding anchor node position is known, the unknown node selects the three largest values: RSSI 1-3, namely, (, ), (, ), and (, ). Then, the slope of the straight line connecting any two anchor nodes can be calculated by

We can define the value of the error , when the actual error is smaller than ; the ARILB-RSS considers that the three anchor nodes are close to an equilateral triangle and tends to locate unknown nodes as the optimal anchor node. Otherwise, the three anchor nodes that meet the conditions are selected, or the anchor nodes that meet the conditions are deemed as unqualified.

4.4.3. Phase 3: Correction

To reduce the positioning error and improve positioning accuracy, the coordinates of the unknown node, which are estimated in the positioning phase, are optimized or corrected. Our algorithm is further improved to reduce the path loss factor for ranging. Preset is usually impractical and leads to a large deviation. Therefore, the actual value should be approximated continuously in the actual environment. Our improved algorithm tries to iteratively update in the following procedure: the RSSI between anchor nodes near the unknown node is measured periodically, and multiple measured values are used to derive the path loss factor of the next iteration, thereby minimizing the positioning error.

For the nodes in subarea in the monitoring area, there are three possible scenarios near the subarea adjacent to . In these three scenarios, there are 3, 5, and 8 square subareas, respectively (Figure 6).

Suppose there are multiple square subareas near the unknown node. Then, there should be at least anchor nodes near this node: . The distance between anchor node and the other nodes can be expressed as . Then, the following can be derived from formula (7):

Formula (9) can be simplified to obtain the of the next iteration. The ranging error can be reduced through the constant updates of .

5. Simulation and Result Analysis

5.1. Simulation Parameters

Our simulation was carried out on MATLAB. According to the proposed algorithm, 100 nodes were set up, with the sink at the geometric center (50 m, 50 m) of the monitoring area. Table 1 lists the simulation parameters.

5.2. Performance Analysis

This section compares the performance of our method, ARILB, with three other algorithms, namely, LEACH [33], distributed energy-efficient clustering (DEEC) [34], and uneven clustering routing algorithm based on chain-cluster type (URCC) [35], using metrics like stability time of the network, number of data packets received by the sink, and the total energy consumption of the network. (1)Stability time

Figure 7 compares the stability time of the four algorithms, which is the top consideration in the design of wireless monitoring system. Only when the routing protocol survives long enough could the other performance indices be improved. In Figure 7, the stability time is demonstrated by the sensor failure rate in the same period. As shown in Figure 7, our algorithm boasts a rather long lifecycle. In the same period, our algorithm controlled the sensor failure rate below 20%, all the sensors in LEACH failed, and more than 54.5% of the sensors were damaged in DEEC and URCC. Therefore, our algorithm has an obvious advantage over LEACH, DEEC, and URCC in network lifecycle. (2)Energy consumption

Energy is another key evaluation metric of WSN performance and an important consideration of protocol design. This paper quantifies the energy consumed by each protocol with the total energy consumption of the network in the same period. Figure 8 compares the energy consumption of the four algorithms. In the early stage (within 500 rounds), LEACH, DEEC, and URCC had similar slopes in their energy consumption curves. This means the three protocols have similar energy consumption rates in the early stage. In contrast, our algorithm had a smoother energy consumption curve in this stage, reflecting the good control of early energy cost. In addition, the network using our algorithm lasted longer than that using any other algorithm, under the premise of the same energy consumption. As the network operated, the network energy of LEACH, DEEC, and URCC was exhausted in 1,384; 1,844; and 2,200 rounds, respectively, while that of our algorithm was not exhausted before 2,500 rounds. (3)Data packets

Apart from stability time and energy consumption, data transmission capacity is a nonnegligible performance index of routing protocols. In this paper, the data transmission capacity of the four algorithms is characterized by the number of data packets received by the base station in the same period (2,000 rounds). Figure 9 compares the data packets of the four algorithms. The base station under LEACH only received 41.71% of the data packets, which are received under our algorithm. The reason is that the single-hop mode of sensors in LEACH may fail over time, resulting in a vacuum of data in some subareas. The data throughput of DEEC was less than 60% of that of our algorithm. This is because data transmission under DEEC is difficult, owing to link interruptions and the long time consumed to reestablish link distance. URCC achieved more data packets than LEACH and DEEC but never caught up with our algorithm. Throughout the simulation, our algorithm always realized more data packets than the other three protocols. The number of data packets of our algorithm was about 1.35-2.39 times that of the other protocols.

5.3. Comparison of Positioning Performance

Multiple wireless nodes were adopted for the simulation, one of which is an unknown node. The other nodes were placed in the same subarea as anchor nodes. Each anchor node sent an RSSI signal to the unknown node. Upon receiving the signal, the unknown node saves the information in the register and then transmits it through the gateway. Then, the host computer locates the unknown node by the positioning algorithm. The noise of each RSSI signal was designed by adding a random signal with a standard peak value of 1 at a certain probability, with a signal-to-noise ratio (SNR) of -5. The mean of 100 repeated simulations was taken as the final result. The simulation subareas are smaller than the subareas in the study area. Thus, the actual simulation range was set to 10-70 m.

Figure 10 compares the ranging errors of our algorithm and the traditional RSSI-based algorithm. When the subarea is small (e.g., 5 m), the two algorithms differed little in ranging error. With the growing distance, the error of the traditional algorithm increased rapidly since the subarea size of 40 m, while that of our algorithm rose slowly since the subarea size of 55 m. The results show that our algorithm can adapt effectively to multiple subarea sizes. As the distance increased, the error gap between the two gradually grew. The difference was 14.31% at the distance of 70 m.

Figure 11 compares the positioning errors of our algorithm with self-positioning algorithm (SPA) and ranging stratify unit (RSU) algorithms. When the noise and other factors were the same, the positioning errors of all three algorithms increased with the subarea size. However, the error increment of our algorithm was the smallest. With the growing distance, the RSSI ranging error also increased. The positioning error of SPA rocketed up, because the algorithm cannot effectively eliminate the ranging error. Despite improving the positioning results, the RSU could not fully remove the influence of low-probability yet significant interferences during the processing of RSSI source data and the calculation of the mean of each data center. As a result, the positioning error of the RSU grew quickly with the increase of distance. In our algorithm, the path loss factor is updated constantly with the growing number of anchor nodes. The updating factor slows down the growth of positioning error induced by the increase of subarea size. Within the distance of 40 m, the error gap between our algorithm and SPA and RSU was 7.45% and 5.61%, respectively. When the distance was 70 m, the difference was 18.54% and 26.79%, respectively. Therefore, our algorithm can get close to the true position, because the ARILB protocol can derive the accurate value of , which reduces positioning error and improves positioning accuracy.

6. Conclusions

Considering the extensive application of WSN in indoor monitoring, this paper analyzes the rules of equipment installation and the features of human movement inside buildings and demonstrates the possibility and necessity of establishing an indoor data monitoring system. Then, the performance of the data monitoring network was simulated, and the protocol matching by a classic algorithm was discussed on computer software. On this basis, this paper proposes a novel adjacent round iterative load balancing routing protocol (ARILB). Simulation results show that the ARILB can achieve a good applicability and balance the network energy consumption. In addition, the protocol can balance the data throughput in each phase, delay the appearance of dead nodes, maximize the lifecycle of the network, and improve the overall energy efficiency. Furthermore, the ARILB was coupled with the division of monitoring area to propose the ARILB-RSS positioning algorithm. This new algorithm improves the positioning and correction performance, eliminates the ranging error, and controls the growth of positioning error. However, this research only discusses static WSN routing protocols for two-dimensional (2D) data. The future research will investigate the monitoring and positioning of mobile WSN nodes.

Data Availability

The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that they have no conflicts of interest.