Node Location Method of Ecological Environment Monitoring Network Based on Zigbee

In view of the poor initialization performance of ecological environment monitoring network node location, a method of ecological environment monitoring network node location based on Zigbee is proposed. The node data collection model of ecological environment monitoring network is built based on Zigbee, and the performance is stable, which is more suitable for the node location of the ecological environment monitoring network; it is hoped that this study can provide reliable value reference and help for the future ecological studies. Through the installation of different types of sensors, the data of the ecological environment monitoring network nodes are automatically collected and sent to the server. The static weight coefficient of the collected data of the ecological environment monitoring network nodes is modified. According to the modified results, the ecological environment monitoring network is modified by DV-HOP positioning algorithm. The nodes of the ecological environment monitoring network are located by the three-way positioning method. The experimental results show that the initialization performance of this method is better, the accuracy is about 98%, and it is stable. It is more suitable for the node location of ecological environment monitoring network, which mainly includes ZigBee wireless sensor network module, embedded ARM, and Linux.


Introduction
Since the 1980 s, the global greenhouse effect has been obvious, and the climate is in the trend of drought. As a result, ecological problems such as glacial retreat, snow line decline, lake area change, water system change, land desertification, and grassland degradation are becoming increasingly serious, leading to the serious weakening of the water saving and purification ability of the ecological environment itself and the ability to resist erosion [1]. At present, the ecological environment is facing problems such as the crisis of water resources change, the intensification of land desertification, water and soil loss, wetland shrinkage, frequent geological disasters, and rapid and disorderly population growth. Under the influence of global warming and human activities, the wetland presents a shrinking trend, leading to the decline of lake water level, the reduction of river water supply, grassland degradation, and even frequent local climate change, which will lead to serious soil erosion and frequent occurrence of geological disasters such as collapse, landslide, and debris flow and pose a serious threat to agricultural production, traffic construction, and people's life and property safety in these areas. Since the 1980s, the greenhouse effect has increased the side effects of human production activities (especially industrial activities) on the ecosystem. The contradiction between the rapid and disorderly growth of population and the carrying capacity of environment and resources has become increasingly obvious [2]. Monitoring the ecological environment through the ecological environment monitoring network can improve the precision and real-time degree of ecological environment monitoring, reduce the tedious degree of artificial participation, and form a multi-level, multi-parameter, real-time, and fine ecological environment monitoring process. Many scholars have studied the network node localization methods. Wang et al. [3] proposed a real-time positioning and monitoring method of network node data under the data standard. Wang and Dai [4] proposed a node localization algorithm based on Gauss-Newton iterative estimation for wireless sensor networks. Gaussian filtering algorithm is used to optimize the received signal strength to reduce the ranging error. The result of traditional trilateral positioning is used as the initial position of the sampling point, and the Gauss-Newton iteration is repeated to estimate the optimal position. Zhang and Zhao [5] proposed an improved weighted centroid algorithm node positioning method, which uses the reciprocal of the error obtained by substituting the normal equation into the coordinates as the weight and uses the weight difference to process different positioning results with different positioning errors. The reciprocal of the smaller error corresponds to the larger weight, and the reciprocal of the larger error corresponds to the smaller weight, so as to improve the positioning accuracy. Through MATLAB simulation of the traditional centroid algorithm and the improved weighted centroid algorithm, the position coordinates of the positioning nodes are estimated. Song and Huang [6] proposed a DV-Hop location algorithm based on wolf colony optimization. Firstly, the DV-Hop distance estimation algorithm is optimized, and then for the unknown node whose hop number is 1 from the anchor node, the RSSI method is used to directly calculate the distance between it and the anchor node, so as to reduce the error of the estimated distance. Secondly, since the wolf swarm algorithm is easy to fall into local optimization, the optimized wolf swarm algorithm (IWCA) is proposed [7,8]. When the K iterations of wolf detection do not change the position, it is allowed to walk in the direction of poor effect with a certain probability. The walking mode is chaotic mapping. Finally, the IWCA algorithm is applied to the node location calculation stage to reduce the error caused by DV-Hop range estimation algorithm when calculating the node location [9][10][11].
Although the above methods can achieve network node positioning, the accuracy is still low. Therefore, in order to make better use of the ecological environment monitoring network, a node location method of ecological environment monitoring network based on Zigbee is proposed.

Construction of Node Data Acquisition
Model. Based on Zigbee, the node data collection model of ecological environment monitoring network is constructed, and the node data of ecological environment monitoring network are automatically collected by installing different types of sensors and sent to the server. The structure of Zigbee protocol is shown in Figure 1.
The node data collection model of the ecological environment monitoring network can be divided into four modules in terms of function, namely, Zigbee wireless sensor network module based on star topology, embedded module based on ARM and Linux, breakpoint continuous transmission processing module, and information management module based on web [12,13]. Zigbee wireless sensor network module adopts a star topology structure, which can collect and summarize various data of ecological environment monitoring network to the main node in a wide range; embedded module based on ARM and Linux is deployed on the main node, which is mainly responsible for processing and packaging the collected data, which are sent to the server by 3G router after AD conversion; breakpoint continuous transmission processing module is enough to send the lagging data to the server to ensure the integrity of the collected data; the web-based information management module is deployed on the web server to realize the functions of receiving data, querying, and downloading data [14]. The framework of the node data collection model of the ecological environment monitoring network is shown in Figure 2.

Design of Zigbee Wireless Sensor Network Module.
In Zigbee wireless sensor network module based on star topology, the slave node communicates with the master node directly. The slave node is mainly used in the network distribution scene with short distance and more monitoring positions [15]. The specific structure of Zigbee wireless sensor network is shown in Figure 3.
The master node plays the coordination function in Zigbee wireless sensor network. The main node is the convergence node of the network, and the physical device used is the full-function device FFD, which can communicate with other devices in the network through software design [16][17][18]. In Zigbee wireless sensor network, the slave node uses the simplified function device RFD, which can  complete the communication function with the master node. JN5139 chip is used in sensor network nodes. JN5139 chip is a low-power, low-cost wireless microcontroller, which is suitable for Zigbee applications. JN5139 chip integrates 32bit RISC reduced instruction set processor, fully compatible with 2.4 GHz IEEE802.15.4 wireless transceiver, 96 kb RAM, 192 kb ROM, and a variety of mixed analog and digital external devices. The ROM and RAM architecture of JN5139 chip supports the storage system software, including protocol stack, routing table, application code and data, and so on. On the other hand, based on the special Jennic development tools, Zigbee network platform can be built conveniently and quickly and can be easily integrated into the product, so as to help developers develop stable programs in a short time, shorten the product development cycle, and reduce the development difficulty and cost [19]. The specific block diagram of JN5139 is shown in Figure 4.
Zigbee wireless sensor network module is equipped with RS-485 interface and RS-232 interface, which can form a system with RS485, Ethernet, RS232, and GPRS according to specific application. The communication between RFD and FFD adopts the special development tool Jennic suite, and the programming language of Zigbee wireless sensor network module is C language. In Zigbee wireless sensor network, each master device can communicate with 2-4 slave devices, and each slave device can connect up to 16 sensors, which can meet the actual application requirements of data collection of ecological environment monitoring network. The slave device first collects the data of the ecological environment monitoring network and then transmits the collected data to the master device. After receiving the data from the device, the master device first summarizes the data and then sends the summarized data to the arm board [20,21]. After receiving the data, the arm board converts the data into binary format and sends it to the web information management module on the server [22]. The transmission data flow of the main equipment is shown in Figure 5.

Design of Embedded Module Based on Arm and Linux.
The embedded module based on arm and Linux is the lower computer of the node data collection model of the ecological environment monitoring network [23,24]. The arm data acquisition board consists of a core board and an expansion board connected by a connector. The core board is a 6-layer board, mainly including the core circuit of arm system such as the main controller, memory SDRAM, power and clock circuit, and flash of stored program. The expansion board is equipped with a memory controller and various interfaces that can communicate with external devices. Its memory controller includes 32 MB SDRAM, 64 MB NandFlash, and 4 MB NorFlash memory modules; It has two USB2.0 interfaces, a debugging port, and two data serial ports, as well as a 10/100 M adaptive Ethernet port and multiple GPIO ports. The expansion board is also equipped with RTC clock, power supply, and other auxiliary circuits. Among them, the 10/ 100 M self-adaptive Ethernet port is used for network transmission of data, the USB interface is used for local data storage and connecting the USB interface micro-camera, the serial port is mainly used to connect the Zigbee main node, and the multi-channel GPIO interface is mainly used to output control instructions and control the auxiliary equipment. The control panel of the arm board is shown in Figure 6. The Linux operating system is a cross platform system, which can adapt to a variety of CPUs and hardware platforms, support multi-user, multi-task, multi-thread, and multi-CPU, and support 32-bit and 64-bit hardware [25].

Design of Breakpoint Continuous Transmission Processing Module
The overall design of the breakpoint continuous transmission processing module is as follows: (1) Start the main thread and initialize global variables.
(2) The main thread starts the data collection thread, data sending thread, receiving confirmation thread, and breakpoint renewal thread. (3) The main thread establishes a network communication socket with the web information management module on the server.  Discrete Dynamics in Nature and Society (4) After the network communication socket is established, the web information management module on the server will send the last received collection data timestamp through the network communication socket. (5) The receiving confirmation thread receives the time stamp sent by the web information management module and compares the time stamp with the collected data saved in the local file. If the time stamp of some collected data is greater than the time stamp sent by the web information management module, the collected data will not be sent to the server directly, but will be sent to the server by the breakpoint update thread notified by the receiving confirmation thread. (6) The data acquisition thread collects the value of each channel sensor of each Zigbee node and forms the data message according to the format of the collected data. The header of the message includes the time stamp of month, day, hour, and minute. (7) The data collection thread writes the data message into the memory for the data sending thread to send and also stores the data message in the local file. When the file is full of 100 pieces of collection, close the file, create a new local file, and start to save the collection data. The file name is named by the time stamp corresponding to the first record.
(8) The data sending thread obtains the data message put in by the data collection thread from the memory and then sends it to the web information management module on the server through the socket communication connection. (9) After the web information management module receives 100 collection data messages, it sends a receiving confirmation message through the network communication socket. After receiving the confirmation message, the receiving confirmation thread informs the data collection thread to delete the local files corresponding to the 100 collection data, so as to avoid the local storage space being filled up after too many files [26].

Design of Information Management Module Based on
Web. The web-based information management module is deployed on the server, which mainly realizes the following functions: communicating with the lower computer based on arm and Linux, receiving the collected ecological environment monitoring network data, and storing the data in the database; interacting with the user, providing the functions of browsing, and downloading the collected data [27][28][29]. The information management module based on web is realized by ASP.NET and C# programming language [30,31]. Microsoft SQL Server 2005 database is used to store information, and MVC mode is used to design the  architecture of the whole web module. ASP.NET includes all kinds of services necessary for generating enterprise level web applications with as little code as possible. It has the characteristics of excellent upgrade, stability, faster development, easier management, brand-new language, and network services. Microsoft SQL Server 2005 is a comprehensive database platform, which uses integrated business intelligence tools to realize enterprise level data management, provides more secure and reliable storage functions for relational data and structured data, and has functions such as analysis, report, integration, and knowledge [32][33][34].
The information management module based on web adopts the design pattern of MVC and clearly divides each level of web module. Specifically, the model layer is responsible for the realization of the business logic function of the module [35,36]. The view layer includes an interface that provides user access. The control level is mainly responsible for the control of the process. MVC pattern has many advantages, such as low coupling, high reusability, applicability, low life cycle cost, rapid deployment, and maintainability [37,38]. The MVC mode is shown in Figure 7.
The collected ecological environment monitoring network data is converted through the ad embedded module in the arm and Linux software, and sent to the web server through the 3G router. The collected data are received and saved by the information management module deployed on the web server. The information management module deployed on the web server receives and saves the collected data.

Correction under the Change of Location Area Size.
The static weight correction coefficient is used to modify the collected ecological environment monitoring network node data. The optimal weight correction coefficient is generally obtained between (0, 4), which has an important impact on the quality of node positioning. Under the same location conditions, when the size of the location area, the number of reference nodes, the intensity of air interference and the number of obstacles change, it is necessary to modify the static weight value correction coefficient. Firstly, the change of the size of the location area is corrected. In the MATLAB simulation environment, 10 reference nodes and 2 unknown nodes are randomly deployed in the location area [39]. For the Gaussian white noise with the mean increase of signal strength of 0 and the variance of 1, the weight correction coefficient increases in steps of 0.1 within (0, 4) and gradually traverses the interval value. The size of the location area is 10 m × 10 m, 20 m × 20 m, and 30 m × 30 m, respectively, and the simulation results are shown in Figure 8.
According to the simulation results of the influence of the change of the size of the positioning area on the static weight correction coefficient, the static weight correction coefficient is corrected, and the correction results are shown in Table 1.
It can be seen from Table 1 that when the size of positioning area changes, because the number of reference nodes is determined, the larger the positioning area is, the smaller the distribution density of reference nodes is, and the less the number of reference nodes selected by unknown nodes is, the greater the positioning error is, and the larger the positioning error is, the larger the static weight   Discrete Dynamics in Nature and Society correction coefficient is. On the contrary, the smaller the location area, the smaller the static weight correction coefficient, and the smaller the location error.

Correction under the Influence of Obstacles.
In the MATLAB simulation environment, 10 reference nodes and 2 unknown nodes are randomly deployed in the location area. In the location area of 10 m × 10 m, for the Gaussian white noise with the mean value of signal strength increase of 0 and variance of 1, the weight correction coefficient increases in steps of 0.1 within (0, 4), and gradually values are traversed [40]. At the same time, the number of people in the location area increases from 1, 2, and 3, and the obstacles are randomly determined; the simulation results are shown in Figure 9. As shown in Table 2, when the number of obstacles changes, the wireless signal will reflect when encountering obstacles, which will result in the error of the signal strength received by the receiving node, thus affecting the positioning results. The more the number of obstacles, the larger the static weight correction coefficient, which shows that under the influence of the number of obstacles, the correction direction of the static weight correction coefficient is that the smaller the static weight correction coefficient is, the smaller the positioning error is.

Correction under the Influence of Air Interference
Intensity. In the MATLAB simulation environment, 10 reference nodes and 2 unknown nodes are randomly deployed in the location area, and the size of the location area is within the range of l0 m × l0 m. For the Gaussian white noise with the mean value of signal strength increase of 0 and the variance increasing from 1, 2, 3, 4, and 5, respectively, the weight correction coefficient is 0.1 in step within (0, 4), and it is gradually traversed from the value within the interval. The simulation results are shown in Figure 10.
The simulation results of the influence of the variance of Gaussian distribution on the static weight correction coefficient are sorted out, as shown in Table 3.
It can be seen from Table 3 that when the variance of Gaussian white noise changes, as the interference intensity received by the sensor node increases, the interference generated by the signal intensity value received by the receiving node also increases, and the positioning accuracy of the unknown node will produce errors. When the variance of Gaussian white noise is larger, the static weight correction coefficient is larger, which shows that under the influence of air interference intensity, the correction direction of static     Discrete Dynamics in Nature and Society weight correction coefficient is that the smaller the static weight correction coefficient is, the smaller the positioning error is.  (0, 4). The simulation results are shown in Figure 11. The simulation results of the influence of the number of different reference nodes on the static weight correction coefficient are sorted out, as shown in Table 4.

Correction under the Influence of the Number of
It can be seen from Table 4 that when the number of reference nodes changes, the number of reference nodes increases due to the constant location area, that is, the density of reference nodes in unit area increases, and the number of unknown reference nodes increases, so the more accurate the signal strength value received by the unknown nodes, the more accurate the positioning accuracy. When the signal strength value received by the unknown node is more accurate, the static weight correction coefficient is smaller, which shows that under the influence of the number of reference nodes, the correction direction of the static weight correction coefficient is that the smaller the static weight correction coefficient is, the smaller the positioning error is.

Realizing Node Positioning
2.3.1. Node Linear Distance Ranging. According to the results of the static weight correction coefficient, the distance between the nodes of the ecological environment monitoring network is measured by DV-HOP algorithm, which includes two stages [41][42][43].
In the first stage, using the wireless sensor network architecture, through the typical distance vector exchange protocol, each reference node in the ecological environment monitoring network broadcasts its own location information group to the neighbor node, so that other reference nodes in the ecological environment monitoring network can obtain the minimum hop information of the reference node [44][45][46][47]. The architecture of wireless sensor network is shown in Figure 12.
L1, L2, and L3 represent three reference nodes with known positions, the rest are unknown nodes, and unknown node A is located by three reference nodes.
In the second stage, each reference node uses the location information of other reference nodes and the minimum number of route hops to calculate the average distance of each hop. For unknown node a, its distance to reference nodes L1, L2, and L3 is obtained by multiplying the average minimum number of hops by the average distance of each hop. The specific formula is as follows: where d 1 represents the distance from unknown node A to reference node Ll; d 2 represents the distance from unknown node A to reference node L2; d 3 represents the distance from unknown node A to reference node L3; HS D 1 represents the average per hop distance calculated based on reference node Ll; HS D 2 represents the average per hop distance calculated based on reference node L2; and HS D 3 represents the flat distance calculated based on reference node L3. Every jump distance represents the average per hop distance calculated based on reference node L3.
After calculating the average per hop distance of communication between the reference nodes in this range, it is broadcast to the unknown nodes in the network. The unknown node is used to locate itself after receiving these data [48,49]. The unknown node will receive the average per hop distance from all the reference nodes. The average per hop distance from each reference node can reflect the node density of the reference node. Because the average hop distance calculated by each reference node is different, the DV-HOP algorithm is improved by using weighted average to reduce the overall error range [50][51][52]. Through the

Node Location of Ecological Environment Monitoring
Network. Based on the obtained results, the nodes of the ecological environment monitoring network are located by the trilateral positioning method. The principle of trilateral positioning method is shown in Figure 13. Equation (2) can be listed according to the distance formula between two points: Among them, x a and y a represent the left and right coordinates of reference node A; x b and y b represent the left and right coordinates of reference node B; x c and y c represent the left and right coordinates of reference node C; x and y represent the left and right coordinates of unknown node D; and d a , d b , and d c are the distances from D to three reference nodes A, B, and C obtained by the same ranging algorithm.
By solving the equation, the coordinates of the unknown nodes can be obtained, and the nodes of the ecological environment monitoring network can be located.

Experimental Preparation.
Firstly, the experimental test platform is built to realize the construction of Zigbee network and its connection with Wi-Fi network and then realize two-way communication, as shown in Figure 14.
The specific control protocol of the experimental test platform is shown in Table 5.
The experimental node distribution is shown in Figure 15.

Experiment and Result Analysis.
In order to ensure the reliability of the experimental results, the real-time location and monitoring method of network node data under the metadata standard in literature [3] is taken as the traditional   The number of reference nodes is 25 The number of reference nodes is 30 The number of reference nodes is 20 The number of reference nodes is 15 The number of reference nodes is 10 Figure 11: Reference node number influence chart. 8 Discrete Dynamics in Nature and Society method, and the wireless network node location algorithm based on Gauss-Newton iterative estimation in literature [4] is taken as the comparison method. The comparison is made with the Zigbee-based ecological environment monitoring node location method designed in this paper. First, the node initialization performance is compared. The judgment of node initialization performance is based on the density of the node initialization distribution map. The denser the node initialization distribution is, the more the nodes are proved and the better the initialization performance is. The experimental results of node initialization performance of traditional ecological environment monitoring network node positioning method are shown in Figure 16.
The experimental results of node initialization performance of the comparison method are shown in Figure 17.     The experimental results of node initialization performance of Zigbee-based ecological environment monitoring network node positioning method are shown in Figure 18.
According to the experimental results of the node initialization performance in Figures 16-18, the density of the node initialization distribution map of the traditional method and the comparison method is relatively scattered, while the density of the node initialization distribution map of the Zigbee-based ecological environment monitoring network node positioning method is very dense, which indicates that the node initialization performance of the proposed method is better than the first two methods.
In order to further verify the accuracy of the proposed method, the positioning accuracy performance of the proposed method is compared with that of the traditional method and the comparison method. The results are shown in Figure 19.
According to the experimental results of node positioning accuracy in Figure 19, it can be seen that the measurement results of node positioning accuracy of the traditional method and the comparative method are unstable, high, and low, and the accuracy results are between 75% and 89%. The accuracy of the proposed method is about 98%, and the measurement results are stable, which indicates that the proposed method has high node positioning accuracy and stable results.

Conclusions
Due to the poor initialization performance of the ecological environment monitoring network node positioning method, a Zigbee-based ecological environment monitoring network node positioning method is proposed to improve the accuracy of node positioning. Based on Zigbee, the node data collection model of the ecological environment monitoring network is constructed, and the nodes of the ecological environment monitoring network are located by the trilateral positioning method. The results show that the initialization performance of this method is better, the accuracy is about 98%, and it is stable. It is more suitable for the node location of ecological environment monitoring network. The improvement of node initialization performance is of great significance to the development of ecological environment monitoring network. It can improve the precision and realtime degree of ecological environment monitoring, reduce the tedious degree of human participation, and form a multilevel, multi-parameter, real-time, and fine ecological environment monitoring process.

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

Conflicts of Interest
The author declares that there are no conflicts of interest regarding the publication of this paper.