# A Particle Swarm Optimization Algorithm for Deployment of Sensor Nodes in WSN Network

Authors: Jie Liang; Lu Wang; Qingchang Ji
Journal: Journal of Electrical and Computer Engineering
 (2022)

---

## Abstract

In order to solve the problems of security hidden dangers in the process of node location due to the characteristics of limited resources, open deployment, and being unattended in wireless sensor networks, this paper proposes a mainstream location algorithm combined with the current WSN node. By reducing the error in network positioning, the wireless sensor network positioning technology is put into practical benefits, and the WSN emitter positioning based on node resources and limited capacity is realized. Some positioning technologies are applied to emitter positioning, and some meaningful results are obtained. Aiming at the problems existing in the positioning algorithm of the main nodes in the wireless sensor network, the power consumption and positioning accuracy of the positioning technology are deeply studied to reduce the positioning error. Experiments show that when nodes are sent to different states, the number of nodes 150 remains the same, the communication radius is the same, the environment output is the same, and the number of bones in the network can be changed. After many simulation experiments, both algorithms can see the positioning result curve of the positioning program affected by the anchor node part.


---

## Body

## 1. Introduction

Since the 1990s, microelectronics have been developed rapidly due to its low cost, low power consumption, personalized integration, distribution, robustness, and other characteristics. It has brought changes to data understanding, purchasing power for equipments, as shown in Figure1 [1]. The process data is stored accordingly, and the results are finally sent to the inspector. Using a variety of sensor detection to find products in sensor nodes, we can monitor the data of the products to the satisfaction of users, including temperature and humidity, soil composition, pressure, light intensity, noise, and earthquakes. People can easily obtain a large amount of reliable and detailed information through wireless sensor networks in various environments and truly realize the “ubiquitous” information sensing concept [2]. Wireless sensor networks perfectly realize the extension from the computer virtual world to the real world and integrate real-world physics and real-world historical data to change the relationship between man and nature. At the beginning of 2006, under the background of national and medium-term scientific and technological planning and development issued by the State Council, wireless sensor network was listed as one of the important development elements of the information industry. Widespread use of wireless sensor networks is a future challenge. It will bring great changes to human lifestyle and production mode in the future [3]. WSN is a new tool based on data collection and execution. It has the characteristics of humanized organization, convenient delivery, and strong environmental adaptability. It is widely used in civil security, national defense and military industry, industry and agriculture, environmental protection and other fields, industrial supervision, smart home, and so on. In areas that are not suitable for workers, we can use wireless sensor networks to monitor, view, and record sensitive data on various surveillance devices, especially in unattended environments, hostile environments, and low-resource situations. Wireless sensor network has the advantages of fast transmission speed, good encryption, strong survivability, strong destructiveness, and no need for manual responsibility. It was first used in national defense and military applications. This technology is widely used in a very harsh battlefield environment, including battlefield security alert, reconnaissance and surveillance, nuclear, chemical, and biological weapons monitoring, and equipment and material management. It is a magic weapon to win in the information war. The “smart dust” sensor technology research and development project launched by the US Department of defense is also considering the important national defense and military uses of wireless sensor networks. Information warfare requires the combat system to have the ability to “see clearly, respond quickly, and fight accurately.” In the future war, the party who can firmly grasp the dynamic information of the battlefield will be the party who can win. In the next step, we will integrate the medical system to realize resource sharing and medical system collaboration. In the field of environmental monitoring, it can accurately and timely monitor the changes of soil temperature and humidity, crop growth, and main atmospheric components, which is conducive to collecting various environmental parameters for scientific analysis and then taking reasonable measures to control them. In the industrial field, it can be used to monitor the working state of machinery and equipment or production equipment, improve energy utilization, improve production efficiency, reduce equipment maintenance costs, reduce pollutant emissions, and ensure personnel safety. In safe home and smart home, sensor nodes are embedded into furniture and household appliances to remotely monitor the home environment and realize functions such as fire prevention, antitheft, and remote monitoring [4].Figure 1
Wireless sensor network architecture.


## 2. Literature Review

Zhang et al. and others found that wireless sensor network (WSN) is usually composed of some spatially distributed independent network nodes. It comprehensively uses high-tech technologies such as microelectronics technology, modern network, embedded computing technology, and wireless communication and provides a way of information acquisition, information dissemination, and information processing [5]. Houssein et al. and others believe that wireless sensor networks are usually deployed in areas that are not easy to manage, such as forests, rivers, and large buildings. Sensor nodes can usually be used as monitoring nodes to monitor the surrounding physical environment, such as temperature, sound, speed, and direction of moving objects. Nodes can complete autonomous monitoring through wireless self-organization according to the environment [6]. Zhen and Zhang found that wireless sensor networks have the functions of data collection, remote monitoring, real-time monitoring, target tracking, and other functions, as well as their distinctive interdisciplinary characteristics [7]. It has become a hot spot in its scientific field and one of the ten most influential technological advances of the twenty-first century. Among them, the node technology source in wireless sensor network is the core of many applications, such as object detection, monitoring, and tracking. Mohankumar and Karuppasamy proposed that, in wireless sensor networks, data center nodes play an important role in many application fields of wireless sensor networks [8]. Both static and dynamic nodes need to know the data location of the nodes in the network. Sahoo and Amgoth and others argue that, first of all, it is the basis for many uses and resources. In various applications of wireless sensor networks, the location information of nodes will be one of the most basic pieces of information contained in the collected data. If the location information of acquisition points is not obtained, the collected data will have no practical significance in applications such as environmental detection and target recognition. Secondly, node location information can support other technologies of wireless sensor networks [9]. For example, node location information can assist geographic routing protocols in data transmission so as to avoid the diffusion of information in the whole network and improve the efficiency of other routing protocols. Moreover, the location information of nodes can help the network topology control mechanism to establish the network topology diagram and evaluate the location distribution of nodes. Mobile nodes need to know their location at all times because of their different motion forms and environments. Liu et al. and others found that mobile nodes can not only be used to assist static node positioning, improve network connectivity, and expand network coverage but also be widely used in many fields such as factory logistics, fine agriculture, smart home, and environmental protection [10]. Therefore, the research of mobile node location algorithm is also of great significance to the application and development of wireless sensor networks. Kumar and Sivagami and others found that, since the research of wireless sensor in the 1990s, it has been strongly supported by academia and governments [11]. My country’s research on wireless sensor networks started relatively late, but since 2003, research on wireless sensor networks has also been funded by the National Natural Science Foundation of China, and many projects have been listed in the key projects. Sabahat and others found that, with the deepening of the research and development of wireless sensor networks, the research of sensor networks has gone from the initial development of nodes and the design of network protocols to the research stage of intelligent groups. In order to apply the existing research results to practical applications, it is necessary to speed up the research of wireless sensor network location technology. Therefore, how to design a reliable and effective location algorithm has also become an urgent problem to be solved in wireless sensor networks [12]. Suganya and Rajan and others believe that wireless sensor networks, as a new network, realize the extension of the Internet from the information world to the physical world. With the progress of microelectronics technology, computer technology, and wireless communication technology, low power multifunctional sensors have been produced and developed rapidly, enabling sensors to achieve powerful functions of data acquisition, data processing, and data transmission [13]. The sensor network forms a multihop network system through wireless self-organization, which can cooperate to complete real-time monitoring, sensing, and collecting the monitored object information in the network coverage area under various application environments and transmit the sensed monitoring object information to the user terminal in the way of multihop relay. Raj and Kannan and others found that wireless sensor networks can use built-in sensor nodes to measure the information people need according to the needs of practical applications [14], for example, temperature, humidity, moving speed, and direction of moving objects, and monitor the coverage area through the measured information. Therefore, wireless sensors have been more and more integrated into human life, changing the way of interaction between human and nature.


## 3. Method

The positioning process of wireless sensor networks is usually divided into three stages: physical parameter measurement, position calculation, and error correction, as shown in Figure2.Figure 2
Positioning process of the wireless sensor network.These release devices can be divided into different groups according to different characteristics, as shown in Table1.Table 1
Classification of node positioning technology.
Classification basisNode location technology categoryWhether to measure the distance between nodesIncremental location algorithm (range-based)Ranging-free location algorithm (range-free)Order of node positioningBeacon-based node location algorithm (incremental)Parallel location algorithm (concurrent)Whether to use beacon nodeBeacon-based node location algorithm (beacon-based)Beacon-free node location algorithm (beacon-free)Algorithm execution and organizationCentralized location algorithm (centralized)Distributed location algorithm (distributed)Whether to have machine learning abilityLocation algorithm based on learning model (learn-based model)Nonlearning model location algorithm (learn-free model)At present, wireless sensor networks are facing many challenging problems. Recent advances in wireless communication research have made it possible for sensors with small size and short communication to achieve low power consumption, low cost, and versatility [15]. Sensors are connected and transmitted wirelessly to various sizes. They have many applications in household, urban, and environmental management. For most applications, such as forest fire monitoring, water quality monitoring, and agricultural precision, in order to visualize the data, we need to know the location of its individual sensor nodes. Additionally, site accuracy estimates can support a variety of applications such as inventory management, access detection, traffic monitoring, health monitoring, wellness, research, and assessment. In addition, data on node locations can improve efficiency and report conditions in real-time to balance network load. Generally speaking, in WSN [16], we call those sensor nodes whose location information is known as anchor nodes (reference nodes), and their location can be obtained by GPS. Due to various limitations (such as cost, power consumption, and scalability), the self-positioning of WSN is urgently needed to be widely used. The common localization algorithms in WSN include the following two kinds: the method with ranging and the method without ranging; the original estimated position of the node is not used as a relative measure of the node data; the latter only needs to locate the unknown node according to the information such as network connectivity. Because the location mechanism based on ranging has advantages in cost and power consumption, it is more inclined to study this method. Among them, the technologies based on ranging can be divided into four measurement and positioning technologies: RSSI (received signal strength indicator), TOA, TDOA, and AOA. Without ranging technology, it can be roughly divided into six positioning algorithms: centroid, APIT (approximate point in triangulation), APS (ad hoc position system), amorphous, and MDS-MAP (multidimensional scaling map).The positioning process can be divided into two steps: distance or angle information measurement and geometric positioning algorithm.


### 3.1. Common Distance Measurement Types of Wireless Positioning

Signal Power (RSSI): RSSI represents the power level received by the antenna: the higher the RSSI level is, the stronger the signal strength of the radio is and the closer it is to the target. In most cases, the radio will display the current RSSI value each time a valid packet is received. RSSI is available upon receipt of the package without any additional equipment and without interruption of power consumption and delivery. In some models [17], the unit of RSSI is dbm (decibel milliwatt), which refers to the relative value of the measured power and 1 MW. The relationship between x(dbm) and P(mw) is shown in the following:(1)xdbm=10∗log10pmw1mw.Signal arrival time (TOA): TOA represents the propagation time between two nodes. The distance between them can then be calculated by multiplying the propagation time by its message propagation speed. For example, suppose the propagation speed of the message isV, the wireless message is sent from the communication device a at the time T1, the time when the communication device B collects the data information, then the communication device B sends another data information to the communication device a at the time T2, and the communication device a collects the data information at the time T3. Through this, node a can infer the distance from node a to node B from these moments, as shown in(2)d=T3−T0−T2−T1×V2.Signal arrival time difference (TDOA): different from the TOA method, TOA calculates the distance between them only by recording the output time of the signals; when TDOA records time, it propagates the differences created by different communications sent to the same destination communications device. Assuming that the propagation speeds of the two signals areC1 and C2, respectively, the source terminal is excited at the same time, the time difference between the two signals received by the destination terminal is t, and the distance between the two points is T⋅s, where s=c1⋅c2/c1−c2. In fact, TDOA has lower requirements for time synchronization than TOA in WSN positioning, higher ranging accuracy, and wider application range.Signal angle of arrival (AOA): the source node sends signals to the destination node and records the relative orientation or angle between signals so as to calculate the distance between nodes.


### 3.2. Common Geometric Calculation Methods of Wireless Positioning Based on Ranging

The node location process based on ranging first needs ranging. Next, we introduce several common calculation methods.Trilateration: trilateration is the simplest and most comprehensive way to determine the location of sensor nodes. The principle of the algorithm is to estimate the specific position (two sides width) of the node to be measured by obtaining three beacon nodes (anchor nodes) that know the position, and they are far from the node to be measured [18]. In some cases, the type of signal used to estimate the beacon range is RSSI. The calculation of the distance from the anchor point to the original hole is called the radius of curvature between the anchor points for each anchor point. The intersection of these three circles is the location of the unknown node. Then, the position coordinates of node D can be obtained by calculation.As shown in Figure3, assume that the distance between the node Dx,y to be tested and the anchor nodes Axa,ya, Bxb,yb, and Cxc,yc is p1,p2,p3; see formula(3)xa−x2+ya−y2=p12xb−x2+yb−y2=p22xc−x2+yc−y2=p32..Figure 3
Schematic diagram of trilateral positioning method.Take nodesA, B, and C as the center of the circle and p1,p2,p3. In order to form the radiation of the triangle, the measurement node D is at the intersection of the triangles. The distance between A and B on the x-axis is d, the distance between A and C on the y-axis is j, and the distance between A and C on the x-axis is i. Let a and b be the origin of the coordinate system, as shown in the formula(4)x2+y2=p12x−d2+y2=p22x−i2+y−j2=p32..The vulnerable attack methods of location algorithm without ranging are shown in Table2.Table 2
Attack methods for location algorithm without ranging.
Location algorithmAttack targetAttack methodCentroidATIPNode adjacencyExpand the attack range of neighbor nodesWormhole attack expands the range of neighbor nodes through special channelsDV-HopAmorphousNumber of hops between nodesShorten the propagation pathExpand the range of neighbor nodesTriangulation: this method uses angle information instead of distance information. Location calculation can be done remotely or by the node itself (automatic positioning), which is more common in WSN. In the latter case, at least three reference nodes are required. After estimating the directional relationship between yourself and the three reference nodes, then calculate your position coordinates using a simple triangular relationship according to these directional relationships with the anchor node (forming a triangle), as shown in Figure4.Figure 4
Schematic diagram of triangular positioning method.Maximum likelihood estimation: the maximum likelihood estimation method (multilateral measurement method) is approximately equal to the least square method when the measured data conform to the Gaussian distribution. The algorithm can be reduced to solving the overdetermined equations. As shown in Figure5, given the coordinates of N anchor nodes 1, 2, 3, …, n and the distance from the unknown node d to each anchor node, the coordinates of the unknown node D can be obtained through these distance equations [19].Figure 5
Schematic diagram of maximum likelihood estimation method.In the range-free localization algorithm, WSN uses the absolute position and orientation of some sensors to locate a large number of unknown nodes. In recent years, there have been many related methods without scope, for example, coordinate, APIT (triangulation), MDS-MAP, centroid, APS, DV-Hop, and other algorithms. Coordinate algorithm does not need the GPS algorithm. It only needs to obtain the distance between adjacent nodes and then establish a reference frame from its own coordinate origin. APIT algorithm is reliable, has high positioning accuracy, and is suitable for target tracking, but it can only be used when a large number of anchor nodes are deployed in the network and depend on network connection and node density, and the hardware cost is high. MDS-MAP is a new multidimensional scale-based localization method (MDS). When the nodes are unevenly distributed, especially when the number of anchor nodes is small, this algorithm has more advantages than the previous methods. However, MDS-MAP is not suitable for continuous connections. In the centroid algorithm, the anchor node continuously sends its own data location to neighboring nodes and estimates the data location based on the received beacon packets. The algorithm is simple but requires a large number of anchors, which increases the cost of network equipment [20]. The APS positioning algorithm is a distributed algorithm that combines vector routing protocols and GPS strategies. It includes the following positioning methods: DV-Hop, DV-distance, Euclidean, DV-coordinate, DV-Bearing, and DV-Radial. Among them, because DV-Hop algorithm has the characteristics of low complexity, low energy consumption, and easy implementation, it is a very classic positioning algorithm, but it also has defects; that is, its positioning accuracy is not very ideal.Based on the characteristics of easy implementation and low hardware cost without ranging and positioning algorithm, it is widely studied and applied. The following is a specific analysis of several commonly used ranging-free positioning.


#### 3.2.1. Centroid Location Algorithm

In the centroid location algorithm, the node position is calculated according to the positionxi,yii=1,2,…,N of several anchor nodes (reference nodes). After receiving the information broadcast by the anchor node, the unknown node can estimate its position according to the following formula:(5)Xest,Yest=x1+⋯+xNN,Y1+⋯+YNN.In this formula,Xest,Yest represents an estimate of the sensor node location, and N is the number of anchor nodes as shown in Figure 6.Figure 6
Schematic diagram of centroid location algorithm.


#### 3.2.2. APIT Location Algorithm

APIT is located in the region, and the location is estimated by dividing the region between anchor nodes into triangular regions. The presence of each node within or outside the triangular region allows the estimation error of feasible positions to be reduced until each possible set reaches acceptable accuracy [21].


#### 3.2.3. DV-Hop Location Algorithm

Anchor node broadcast message contains spatial and hop count data from anchor nodes. Each receiver keeps the minimum value he received and ignores other pieces of more valuable information. The news media raised the average price per hop. The average distance of jumps in an anchor can be calculated from the following model:(6)HopSizei=∑xi−xj2+yi−yj2∑jh.Anchor nodej is at position xi,yj, and hj is the number of hops from j to i. Anchor I propagates the estimated number of hops to the nearest, using trigonometry to estimate the location of unknown nodes. The algorithm uses at least three key anchors in bidirectional transmission.In the slope algorithm, the unknowns of its work are obtained through multiple paths. Meanwhile, using the phone to exchange data, it is first set to zero and incremented as it propagates to other adjacent fields. The scoring algorithm follows these steps.In the second step, the unknown node determines the shortest path between itself and the anchor and receives a beacon from the anchor. The distance estimate can be calculated from the following model:(7)dji=hj,dAidhop.In the third step, the node calculates the minimum error calculation formula of its coordinates:(8)Ej=∑i=1ndji−dji,where dji is the estimated distance based on gradient propagation.Among the existing positioning algorithms, the earliest used positioning method is the direction finding (DOA) positioning method, but this method has low positioning accuracy, which cannot meet our actual needs. Theoretical research in this field began to appear in China in the early 1980s. Recently, many research institutes and universities have carried out research on it, and the research on TDOA and DD measurement and positioning methods has begun to appear. At present, the passive location technology based on WSN is also widely used in various fields in China. Emitter location based on wireless sensor networks is not simple transplantation of traditional passive location technology on WSN hardware platform, but a new cross research field. The application of emitter passive location in wireless sensor networks with limited resources and capabilities is of great research value and practical difficulty. Compared with the traditional base station passive location system, the system has more reliability and more precise location. In addition, the deployment mode is more flexible and hidden [22].


#### 3.2.4. Direction Finding and Positioning Method

The principle of the DF positioning method is to use multiple observation values to observe the radiation source to be located at the same time and measure the angle data and finally locate the specific information of the radiation source, as shown in Figure7.Figure 7
Schematic diagram of DF positioning method.It is assumed that there areN observation stations for direction finding and positioning of the target. Among them, the position coordinate of the i-th observation station is Sxi,yi, its measured value is μi, and the standard deviation of measurement error is ςi. The actual position coordinate of the target is Txt,yt, and the vertical distance of the I DF line is Ri, as shown in Figure 6; then, the linear equation of the i DF line is shown in(9)y−yi=tan,μix−xi.Formula (10) can be obtained after the above formula is deformed:(10)−xsinμi+ycosμi=xisinμi+yicosμi.ForN observation stations, see(11)A=−sinμ1cosμ1⋅−sinμNcosμN,X=xy,b=−x1sinμ1+y1cosμ1.−xNsinμN+yNcosμN.See formula(12)AX=b.If the angle measurement error is 0, then each line of sight meets the real point of the target, and equation (12) has and has only one solution. However, since the angle measurement error cannot be 0, the above equations will have no solution. Here, the least square method with weight coefficient is adopted to minimize the error of the weighted distance between the calculated position and the actual position. The vertical distance from the target to the i DF line is as shown in(13)Ri=xttanμi−yt+yi−xitanμi1+tan2μi,i=1,2…,N.Let the weighting coefficient beλi=1/σμi2; see formula(14)fxt,yt=∑i=1NλiRi2=λ1R12+λ2R22+⋯+λNRN2.Find the derivative offxt,yt and make it 0. See (15)∂f∂xt=∑i=1Nλi2tanμixttanμi−yt+yi−xttanμi1+tan2μi=0∂f∂yt=∑i=1Nλi−xttanμi−yt+yi−xttanμi1+tan2μi=0..


#### 3.2.5. TDOA Location Method

In the radiation source positioning communication area, the TDOA positioning method applied in the whole radiation source positioning system is evaluated through the environment composed of three communication equipment. Assuming that the position coordinate of thei-th observation station is Sixi,yi and the coordinate of the radiation source is Tx,y, ti′ represents the time difference between the two communication devices of the radiation source signal, c represents the communication speed of the signal, ri represents the Si position information of the communication device and the i-th communication device, and ri′ represents the distance difference between the radiation source and the two communication devices; then, see formula(16)i2=x−xi2+y−yi2,ri=0,1,2ri=rj−r0=c⋅ti,j=1,2.It can be simplified to(17)x0−xix+y0−yiy=ki+r0⋅ri,i=1,2.See formula(18)ki=12ri′+x02+y02−xi2+yi2,i=1,2.Then, it can be transformed into matrix form as(19)AX=F.Finally,X=ATA−1ATF is obtained. R0, x, and y can be calculated to complete the positioning.


## 3.1. Common Distance Measurement Types of Wireless Positioning

Signal Power (RSSI): RSSI represents the power level received by the antenna: the higher the RSSI level is, the stronger the signal strength of the radio is and the closer it is to the target. In most cases, the radio will display the current RSSI value each time a valid packet is received. RSSI is available upon receipt of the package without any additional equipment and without interruption of power consumption and delivery. In some models [17], the unit of RSSI is dbm (decibel milliwatt), which refers to the relative value of the measured power and 1 MW. The relationship between x(dbm) and P(mw) is shown in the following:(1)xdbm=10∗log10pmw1mw.Signal arrival time (TOA): TOA represents the propagation time between two nodes. The distance between them can then be calculated by multiplying the propagation time by its message propagation speed. For example, suppose the propagation speed of the message isV, the wireless message is sent from the communication device a at the time T1, the time when the communication device B collects the data information, then the communication device B sends another data information to the communication device a at the time T2, and the communication device a collects the data information at the time T3. Through this, node a can infer the distance from node a to node B from these moments, as shown in(2)d=T3−T0−T2−T1×V2.Signal arrival time difference (TDOA): different from the TOA method, TOA calculates the distance between them only by recording the output time of the signals; when TDOA records time, it propagates the differences created by different communications sent to the same destination communications device. Assuming that the propagation speeds of the two signals areC1 and C2, respectively, the source terminal is excited at the same time, the time difference between the two signals received by the destination terminal is t, and the distance between the two points is T⋅s, where s=c1⋅c2/c1−c2. In fact, TDOA has lower requirements for time synchronization than TOA in WSN positioning, higher ranging accuracy, and wider application range.Signal angle of arrival (AOA): the source node sends signals to the destination node and records the relative orientation or angle between signals so as to calculate the distance between nodes.


## 3.2. Common Geometric Calculation Methods of Wireless Positioning Based on Ranging

The node location process based on ranging first needs ranging. Next, we introduce several common calculation methods.Trilateration: trilateration is the simplest and most comprehensive way to determine the location of sensor nodes. The principle of the algorithm is to estimate the specific position (two sides width) of the node to be measured by obtaining three beacon nodes (anchor nodes) that know the position, and they are far from the node to be measured [18]. In some cases, the type of signal used to estimate the beacon range is RSSI. The calculation of the distance from the anchor point to the original hole is called the radius of curvature between the anchor points for each anchor point. The intersection of these three circles is the location of the unknown node. Then, the position coordinates of node D can be obtained by calculation.As shown in Figure3, assume that the distance between the node Dx,y to be tested and the anchor nodes Axa,ya, Bxb,yb, and Cxc,yc is p1,p2,p3; see formula(3)xa−x2+ya−y2=p12xb−x2+yb−y2=p22xc−x2+yc−y2=p32..Figure 3
Schematic diagram of trilateral positioning method.Take nodesA, B, and C as the center of the circle and p1,p2,p3. In order to form the radiation of the triangle, the measurement node D is at the intersection of the triangles. The distance between A and B on the x-axis is d, the distance between A and C on the y-axis is j, and the distance between A and C on the x-axis is i. Let a and b be the origin of the coordinate system, as shown in the formula(4)x2+y2=p12x−d2+y2=p22x−i2+y−j2=p32..The vulnerable attack methods of location algorithm without ranging are shown in Table2.Table 2
Attack methods for location algorithm without ranging.
Location algorithmAttack targetAttack methodCentroidATIPNode adjacencyExpand the attack range of neighbor nodesWormhole attack expands the range of neighbor nodes through special channelsDV-HopAmorphousNumber of hops between nodesShorten the propagation pathExpand the range of neighbor nodesTriangulation: this method uses angle information instead of distance information. Location calculation can be done remotely or by the node itself (automatic positioning), which is more common in WSN. In the latter case, at least three reference nodes are required. After estimating the directional relationship between yourself and the three reference nodes, then calculate your position coordinates using a simple triangular relationship according to these directional relationships with the anchor node (forming a triangle), as shown in Figure4.Figure 4
Schematic diagram of triangular positioning method.Maximum likelihood estimation: the maximum likelihood estimation method (multilateral measurement method) is approximately equal to the least square method when the measured data conform to the Gaussian distribution. The algorithm can be reduced to solving the overdetermined equations. As shown in Figure5, given the coordinates of N anchor nodes 1, 2, 3, …, n and the distance from the unknown node d to each anchor node, the coordinates of the unknown node D can be obtained through these distance equations [19].Figure 5
Schematic diagram of maximum likelihood estimation method.In the range-free localization algorithm, WSN uses the absolute position and orientation of some sensors to locate a large number of unknown nodes. In recent years, there have been many related methods without scope, for example, coordinate, APIT (triangulation), MDS-MAP, centroid, APS, DV-Hop, and other algorithms. Coordinate algorithm does not need the GPS algorithm. It only needs to obtain the distance between adjacent nodes and then establish a reference frame from its own coordinate origin. APIT algorithm is reliable, has high positioning accuracy, and is suitable for target tracking, but it can only be used when a large number of anchor nodes are deployed in the network and depend on network connection and node density, and the hardware cost is high. MDS-MAP is a new multidimensional scale-based localization method (MDS). When the nodes are unevenly distributed, especially when the number of anchor nodes is small, this algorithm has more advantages than the previous methods. However, MDS-MAP is not suitable for continuous connections. In the centroid algorithm, the anchor node continuously sends its own data location to neighboring nodes and estimates the data location based on the received beacon packets. The algorithm is simple but requires a large number of anchors, which increases the cost of network equipment [20]. The APS positioning algorithm is a distributed algorithm that combines vector routing protocols and GPS strategies. It includes the following positioning methods: DV-Hop, DV-distance, Euclidean, DV-coordinate, DV-Bearing, and DV-Radial. Among them, because DV-Hop algorithm has the characteristics of low complexity, low energy consumption, and easy implementation, it is a very classic positioning algorithm, but it also has defects; that is, its positioning accuracy is not very ideal.Based on the characteristics of easy implementation and low hardware cost without ranging and positioning algorithm, it is widely studied and applied. The following is a specific analysis of several commonly used ranging-free positioning.


### 3.2.1. Centroid Location Algorithm

In the centroid location algorithm, the node position is calculated according to the positionxi,yii=1,2,…,N of several anchor nodes (reference nodes). After receiving the information broadcast by the anchor node, the unknown node can estimate its position according to the following formula:(5)Xest,Yest=x1+⋯+xNN,Y1+⋯+YNN.In this formula,Xest,Yest represents an estimate of the sensor node location, and N is the number of anchor nodes as shown in Figure 6.Figure 6
Schematic diagram of centroid location algorithm.


### 3.2.2. APIT Location Algorithm

APIT is located in the region, and the location is estimated by dividing the region between anchor nodes into triangular regions. The presence of each node within or outside the triangular region allows the estimation error of feasible positions to be reduced until each possible set reaches acceptable accuracy [21].


### 3.2.3. DV-Hop Location Algorithm

Anchor node broadcast message contains spatial and hop count data from anchor nodes. Each receiver keeps the minimum value he received and ignores other pieces of more valuable information. The news media raised the average price per hop. The average distance of jumps in an anchor can be calculated from the following model:(6)HopSizei=∑xi−xj2+yi−yj2∑jh.Anchor nodej is at position xi,yj, and hj is the number of hops from j to i. Anchor I propagates the estimated number of hops to the nearest, using trigonometry to estimate the location of unknown nodes. The algorithm uses at least three key anchors in bidirectional transmission.In the slope algorithm, the unknowns of its work are obtained through multiple paths. Meanwhile, using the phone to exchange data, it is first set to zero and incremented as it propagates to other adjacent fields. The scoring algorithm follows these steps.In the second step, the unknown node determines the shortest path between itself and the anchor and receives a beacon from the anchor. The distance estimate can be calculated from the following model:(7)dji=hj,dAidhop.In the third step, the node calculates the minimum error calculation formula of its coordinates:(8)Ej=∑i=1ndji−dji,where dji is the estimated distance based on gradient propagation.Among the existing positioning algorithms, the earliest used positioning method is the direction finding (DOA) positioning method, but this method has low positioning accuracy, which cannot meet our actual needs. Theoretical research in this field began to appear in China in the early 1980s. Recently, many research institutes and universities have carried out research on it, and the research on TDOA and DD measurement and positioning methods has begun to appear. At present, the passive location technology based on WSN is also widely used in various fields in China. Emitter location based on wireless sensor networks is not simple transplantation of traditional passive location technology on WSN hardware platform, but a new cross research field. The application of emitter passive location in wireless sensor networks with limited resources and capabilities is of great research value and practical difficulty. Compared with the traditional base station passive location system, the system has more reliability and more precise location. In addition, the deployment mode is more flexible and hidden [22].


### 3.2.4. Direction Finding and Positioning Method

The principle of the DF positioning method is to use multiple observation values to observe the radiation source to be located at the same time and measure the angle data and finally locate the specific information of the radiation source, as shown in Figure7.Figure 7
Schematic diagram of DF positioning method.It is assumed that there areN observation stations for direction finding and positioning of the target. Among them, the position coordinate of the i-th observation station is Sxi,yi, its measured value is μi, and the standard deviation of measurement error is ςi. The actual position coordinate of the target is Txt,yt, and the vertical distance of the I DF line is Ri, as shown in Figure 6; then, the linear equation of the i DF line is shown in(9)y−yi=tan,μix−xi.Formula (10) can be obtained after the above formula is deformed:(10)−xsinμi+ycosμi=xisinμi+yicosμi.ForN observation stations, see(11)A=−sinμ1cosμ1⋅−sinμNcosμN,X=xy,b=−x1sinμ1+y1cosμ1.−xNsinμN+yNcosμN.See formula(12)AX=b.If the angle measurement error is 0, then each line of sight meets the real point of the target, and equation (12) has and has only one solution. However, since the angle measurement error cannot be 0, the above equations will have no solution. Here, the least square method with weight coefficient is adopted to minimize the error of the weighted distance between the calculated position and the actual position. The vertical distance from the target to the i DF line is as shown in(13)Ri=xttanμi−yt+yi−xitanμi1+tan2μi,i=1,2…,N.Let the weighting coefficient beλi=1/σμi2; see formula(14)fxt,yt=∑i=1NλiRi2=λ1R12+λ2R22+⋯+λNRN2.Find the derivative offxt,yt and make it 0. See (15)∂f∂xt=∑i=1Nλi2tanμixttanμi−yt+yi−xttanμi1+tan2μi=0∂f∂yt=∑i=1Nλi−xttanμi−yt+yi−xttanμi1+tan2μi=0..


### 3.2.5. TDOA Location Method

In the radiation source positioning communication area, the TDOA positioning method applied in the whole radiation source positioning system is evaluated through the environment composed of three communication equipment. Assuming that the position coordinate of thei-th observation station is Sixi,yi and the coordinate of the radiation source is Tx,y, ti′ represents the time difference between the two communication devices of the radiation source signal, c represents the communication speed of the signal, ri represents the Si position information of the communication device and the i-th communication device, and ri′ represents the distance difference between the radiation source and the two communication devices; then, see formula(16)i2=x−xi2+y−yi2,ri=0,1,2ri=rj−r0=c⋅ti,j=1,2.It can be simplified to(17)x0−xix+y0−yiy=ki+r0⋅ri,i=1,2.See formula(18)ki=12ri′+x02+y02−xi2+yi2,i=1,2.Then, it can be transformed into matrix form as(19)AX=F.Finally,X=ATA−1ATF is obtained. R0, x, and y can be calculated to complete the positioning.


## 3.2.1. Centroid Location Algorithm

In the centroid location algorithm, the node position is calculated according to the positionxi,yii=1,2,…,N of several anchor nodes (reference nodes). After receiving the information broadcast by the anchor node, the unknown node can estimate its position according to the following formula:(5)Xest,Yest=x1+⋯+xNN,Y1+⋯+YNN.In this formula,Xest,Yest represents an estimate of the sensor node location, and N is the number of anchor nodes as shown in Figure 6.Figure 6
Schematic diagram of centroid location algorithm.


## 3.2.2. APIT Location Algorithm

APIT is located in the region, and the location is estimated by dividing the region between anchor nodes into triangular regions. The presence of each node within or outside the triangular region allows the estimation error of feasible positions to be reduced until each possible set reaches acceptable accuracy [21].


## 3.2.3. DV-Hop Location Algorithm

Anchor node broadcast message contains spatial and hop count data from anchor nodes. Each receiver keeps the minimum value he received and ignores other pieces of more valuable information. The news media raised the average price per hop. The average distance of jumps in an anchor can be calculated from the following model:(6)HopSizei=∑xi−xj2+yi−yj2∑jh.Anchor nodej is at position xi,yj, and hj is the number of hops from j to i. Anchor I propagates the estimated number of hops to the nearest, using trigonometry to estimate the location of unknown nodes. The algorithm uses at least three key anchors in bidirectional transmission.In the slope algorithm, the unknowns of its work are obtained through multiple paths. Meanwhile, using the phone to exchange data, it is first set to zero and incremented as it propagates to other adjacent fields. The scoring algorithm follows these steps.In the second step, the unknown node determines the shortest path between itself and the anchor and receives a beacon from the anchor. The distance estimate can be calculated from the following model:(7)dji=hj,dAidhop.In the third step, the node calculates the minimum error calculation formula of its coordinates:(8)Ej=∑i=1ndji−dji,where dji is the estimated distance based on gradient propagation.Among the existing positioning algorithms, the earliest used positioning method is the direction finding (DOA) positioning method, but this method has low positioning accuracy, which cannot meet our actual needs. Theoretical research in this field began to appear in China in the early 1980s. Recently, many research institutes and universities have carried out research on it, and the research on TDOA and DD measurement and positioning methods has begun to appear. At present, the passive location technology based on WSN is also widely used in various fields in China. Emitter location based on wireless sensor networks is not simple transplantation of traditional passive location technology on WSN hardware platform, but a new cross research field. The application of emitter passive location in wireless sensor networks with limited resources and capabilities is of great research value and practical difficulty. Compared with the traditional base station passive location system, the system has more reliability and more precise location. In addition, the deployment mode is more flexible and hidden [22].


## 3.2.4. Direction Finding and Positioning Method

The principle of the DF positioning method is to use multiple observation values to observe the radiation source to be located at the same time and measure the angle data and finally locate the specific information of the radiation source, as shown in Figure7.Figure 7
Schematic diagram of DF positioning method.It is assumed that there areN observation stations for direction finding and positioning of the target. Among them, the position coordinate of the i-th observation station is Sxi,yi, its measured value is μi, and the standard deviation of measurement error is ςi. The actual position coordinate of the target is Txt,yt, and the vertical distance of the I DF line is Ri, as shown in Figure 6; then, the linear equation of the i DF line is shown in(9)y−yi=tan,μix−xi.Formula (10) can be obtained after the above formula is deformed:(10)−xsinμi+ycosμi=xisinμi+yicosμi.ForN observation stations, see(11)A=−sinμ1cosμ1⋅−sinμNcosμN,X=xy,b=−x1sinμ1+y1cosμ1.−xNsinμN+yNcosμN.See formula(12)AX=b.If the angle measurement error is 0, then each line of sight meets the real point of the target, and equation (12) has and has only one solution. However, since the angle measurement error cannot be 0, the above equations will have no solution. Here, the least square method with weight coefficient is adopted to minimize the error of the weighted distance between the calculated position and the actual position. The vertical distance from the target to the i DF line is as shown in(13)Ri=xttanμi−yt+yi−xitanμi1+tan2μi,i=1,2…,N.Let the weighting coefficient beλi=1/σμi2; see formula(14)fxt,yt=∑i=1NλiRi2=λ1R12+λ2R22+⋯+λNRN2.Find the derivative offxt,yt and make it 0. See (15)∂f∂xt=∑i=1Nλi2tanμixttanμi−yt+yi−xttanμi1+tan2μi=0∂f∂yt=∑i=1Nλi−xttanμi−yt+yi−xttanμi1+tan2μi=0..


## 3.2.5. TDOA Location Method

In the radiation source positioning communication area, the TDOA positioning method applied in the whole radiation source positioning system is evaluated through the environment composed of three communication equipment. Assuming that the position coordinate of thei-th observation station is Sixi,yi and the coordinate of the radiation source is Tx,y, ti′ represents the time difference between the two communication devices of the radiation source signal, c represents the communication speed of the signal, ri represents the Si position information of the communication device and the i-th communication device, and ri′ represents the distance difference between the radiation source and the two communication devices; then, see formula(16)i2=x−xi2+y−yi2,ri=0,1,2ri=rj−r0=c⋅ti,j=1,2.It can be simplified to(17)x0−xix+y0−yiy=ki+r0⋅ri,i=1,2.See formula(18)ki=12ri′+x02+y02−xi2+yi2,i=1,2.Then, it can be transformed into matrix form as(19)AX=F.Finally,X=ATA−1ATF is obtained. R0, x, and y can be calculated to complete the positioning.


## 4. Experiment and Discussion

The application of WSN generally has the characteristics of large number of nodes and complex network topology. In order to accurately evaluate the advantages of the above-improved algorithm, the number of nodes and network topology close to the actual situation are needed in the process of algorithm simulation. But in fact, such a huge network structure cannot be achieved in the simulation experiment [23]. In general, to verify the performance of an algorithm, we must consider the practicability of the algorithm in different communication environments. At the same time, different parameters need to be adjusted in the same communication environment. At present, it is very difficult to verify the algorithm in the real environment. Therefore, in general simulation experiments, it is necessary to measure the efficiency of the algorithm through simulation tools [24]. This paper uses the Matlab package tool to identify the DV source hopping algorithm of NRSSI_performance. It is a comprehensive network simulation software and is widely used in scientific research. Next, the NRSSI DV-Hop source algorithm is simulated and compared with the original DV-Hop algorithm. In a plane area of 100 m ∗ 100 m, 150 nodes are randomly deployed, and the nodes are evenly dispersed, “.” represents unknown node, and “+” represents anchor node, as shown in Figure 8. Due to the large uncertainty of the results of an experiment, it is difficult to verify the performance of the algorithm. Therefore, the statistical method is adopted here. For each node distribution scene, it is calculated 100 times, respectively. According to the 100 experimental simulation results, the statistical average value becomes the performance evaluation standard of the algorithm. All nodes communicate freely, and the performance parameters are consistent. The specific test parameters are shown in Table 3. Under the same network conditions, the simulation results are compared and analyzed to verify the NRSSI_Localization performance of the DV-Hop algorithm in wireless sensor networks [25].Figure 8
Network distribution of unknown nodes and anchor nodes.Table 3
NRSSI_Network parameters of DV-Hop algorithm simulation.
ParameterValueParameterValueNetwork range400∗ 200 m′Eelec50 nj/bitCarrier frequency2.412 GHzEstart250 nj/packetSignal sensitivity−84 dBmTransmission radius10米Maximum transmit power100 mWSignal amplifier multiple2MAC layer header length24 bitsPath attenuation factor2.0NET layer header length24 bitsMAC protocolCSMA/CABy changing parameters such as the number of unknown nodes, the number of anchors, and the difference in output ports, the two algorithms are simulated and compared with our performance, with good results [26].In the RSSI ranging technology applied in this paper, the specific distance between two communication devices is measured using the power transmitted and received by wireless signals in free space. Due to the influence of environmental uncertain factors, such as buildings and noise, which affect the signal propagation intensity and lead to inaccurate measurement, data preprocessing is required.


### 4.1. Reference Node Preferred Measurement

In the process of RSSI ranging, the larger the RSSI value perceived by the terminal equipment, the smaller the distance between the anchor node and the unknown node, the smaller the attenuation of the signal in space propagation, and the smaller the interference in the environment. More accurate data is placed when the operation of our anchor creates an approximate equation of the triangle. Separate the visible RSSI values in order and use the node with the larger RSSI value to create an equal triangle with the other nodes to find the unknown node.


### 4.2. Data Filtering

To reduce errors using RSSI, multiple RSSI values are displayed via the filter node, including formats such as Media Filter, Gaussian, Particle, and Kalman.Generally speaking, the larger the network area, the more the space allocated, the larger the proportion of anchors, the larger the proportion of known space, and the higher the authenticity. Therefore, we analyze the positioning accuracy according to different proportion of anchor nodes. Since the NRSSI_DV-Hop space algorithm divides and calculates the node positions of single hop and multihop, it is based on the number of hops, the wrong position of the unknown node in one of the hops, and the unknown node. It is observation-based in multihop; by changing the ratio of anchors, the errors of the NRSSI_DV-Hop algorithm and DV-Hop algorithm are compared.


#### 4.2.1. Analysis of Location Error of Unknown Nodes

According to the number of anchor switches, the performance of the adjacent NRSSI_DV-Hop algorithm is shown in Figure9. First, adjust the number of sensor nodes and the space in the patch area. Spatial communication process increases the proportion of nodes and records the average error for each simulated event that occurs. From the simulation results, it can be seen that as the network area increases and the number of nodes used increases, other nodes change, and the average error of the two algorithms decreases. On the other hand, we find that the NRSSI_DV skip detection algorithm is faster than the traditional DV skip algorithm. And under different anchor node ratios, the average position simulation result of the NRSI_DV-Hop algorithm is smaller than the original algorithm. The reason for this simulation result is that the localization methods of the two algorithms are different within a hop. The original DV-Hop algorithm directly replaces the node distance in one hop with the average distance of each hop, while the NRSSI_DV-Hop algorithm obtains the distance within one hop from the reference node through the RSSI ranging method to replace the distance estimation of the original algorithm. At the same time, as the node usage increases, the number of unknown nodes within one hop decreases. These unknown nodes are measured by RSSI technology output to reduce the error of unknown nodes.Figure 9
Comparison of location errors of unknown nodes in one hop.


#### 4.2.2. Comparative Analysis of Unknown Node Location Error in Multihop Case

As shown in Figure10, for the unknown node error in the multistep case, the errors of both algorithms decrease with the increase of the anchor part. The NRSSI_DV-Hop algorithm reduces errors faster. In the case of the same anchor ratio, the error of the hop NRSSI_DV algorithm is smaller than that of the original algorithm, and the positioning accuracy is higher. Therefore, the single-step NRSSI_DV positioning algorithm can reduce the positioning error and improve the positioning accuracy when the position is unknown in the multistep mode. In the hierarchical algorithm, this is because the true accuracy of the NRSSI DV bouncing placement algorithm is higher than the original algorithm within a single hop. When an unknown node enters, it converts to an anchor node to find more unknown nodes, and the error of multihop unknown nodes can be reduced to improve the accuracy of multihop positioning.Figure 10
Comparison of location errors of unknown nodes under multiple hops.The simulation results of the above two cases show that whether it is a single hop or multihop, by increasing the number of anchors, the path strength of the unknown node will gradually decrease, and the error will reduce the speed of NRSSI_DV. The jump point placement algorithm is faster than the traditional jump point algorithm DV. For the same number of anchors, the error of the NRSSI_DV-Hop algorithm is lower than that of the original algorithm, and the actual position of the NRSSI_DV-Hop algorithm is always higher than that of the original hop DV algorithm. From the error, it can be seen that the error of the switching position varies greatly with the increase of the anchor scale. When the proportion of anchors rises to a certain value (about 20%), the unknown error of the node changes slightly because the proportion of anchors is not a determining factor that affects the error of the DV-Hop algorithm. These results demonstrate the advantages of the NRSSI_DV source hopping algorithm. First of all, this is because, in the process of algorithm registration, the RSSI technology has been used to find unknown packets from a certain hop of the anchor, which is indeed better than the old algorithm; secondly, the NRSSI_DV-Hop location algorithm uses RSSI measurement technology to modify the unknown address to anchor. The location of the next node is unknown. In this way, the proportion of anchors in the network increases, so the actual position is higher. Therefore, by comparing the inaccuracy of the one-hop node location in the former form with the inaccuracy of the multihop node location, it can be seen that the NRSSI_DV one-hop location algorithm can reduce the error of the algorithm.Figure11 shows the curves of the average center error of the two algorithms as a function of the communication radius. By changing the communication radius, when nodes are referenced, by the way, the number of nodes 150 remains the same and the number of anchors. The node remains unchanged, and the output environment remains unchanged. In this case, the communication periods are r = 10, 20, 30, 40, and 50 m, respectively. The comparative simulation experiment is carried out on NRSSI_ DV-Hop algorithm and DV-Hop algorithm, and the node positioning errors of the two algorithms are obtained, as shown in Figure 11.Figure 11
Unknown node positioning error under different communication radius.The experimental results show that, in wireless sensor networks, when the communication radius of nodes increases gradually, the accuracy of unknown nodes also increases accordingly. Because large-scale communication will lead to communication between unknown nodes and other nodes, it will increase the accuracy of data transmission and reduce chaw errors. The NRSSI_DV skipping algorithm is the best in terms of accuracy. Compared with the hop DV algorithm, the hop NRSSI_DV algorithm has smaller errors in all communications. At the same time, it can be seen that when the communication radius is 30 m, the interference of the communication circuit has a great influence on the actual output of the NRSSI_DV-Hop algorithm and the DV-Hop algorithm. Higher or latter, it indicates that the performance of the hop NRSSI_DV algorithm has been improved.Figure12 depicts the visible results of the two algorithms, where the resources are affected by the anchor score after multiple simulations with the same number of nodes, the same node radius connections, and the same perimeter. Export is the same. Among them, the more the anchor nodes, the less bad the nodes in the whole network, and the higher the site coverage. With the same proportion of anchor nodes, the location coverage of the DV-Hop algorithm is lower than that of the NRSSI_DV-Hop algorithm. If the NRSSI_DV-Hop location algorithm upgrades the detected unknown nodes to anchor nodes, the proportion of anchor nodes will increase accordingly after each anchor node upgrade, so the number of undetectable nodes will decrease accordingly. When the share of anchors in the network reaches 18%, the address of the network reaches 100%, and all nodes can be located. The DV-Hop algorithm requires 22% of the anchors to complete 100% of the network service. Experimental results show that if the proportion of anchors in the network continues, it will only increase the cost of the network, but not the cost of the algorithm.Figure 12
Comparison of location coverage.Comparing the simulation results of the two algorithms, it can be seen that, in the NRSSI_DV-Hop algorithm, there is no need to add other nodes that need their own positioning function, which reduces the burden of materials, increases the positioning of anchor nodes in the positioning network, and improves the network positioning coverage. Figure13 shows the power advantage of the NRSSI_DV-Hop algorithm compared to the original DV-Hop algorithm in this behavior. Based on the NS-2 power consumption model, calculate the power consumption of each node before and after running the algorithm, and compare the power consumption results. As can be seen from Figure 12, the procedural algorithm increases as the anchor score increases. However, it is found from the results that the power consumption of the NRSSI_DV-Hop algorithm is slightly higher than that of the original algorithm, because in the entire network, the power consumption is determined by the reception and transmission of information (communication nodes). As the number of anchors in the network increases, so does network communication, and data transmission and reception increase, resulting in increased power consumption. Since the NRSSI_DV-Hop positioning algorithm has the function of improving the anchor, this new anchor will increase the throughput and transmission volume of the network during the broadcast process, and the next data will consume more energy than the old algorithm. The network positioning power consumption is high.Figure 13
Comparison of positioning energy consumption.Overall, the simulation results show that the performance of the NRSSI_DV-Hop algorithm is much better than the original DV-Hop algorithm, especially in terms of debugging. The NRSSI_DV-Hop algorithm can reduce and improve unknown network errors and provide correct location. The accuracy of positioning is the key to our positioning algorithm, which directly determines the quality of the positioning algorithm. Therefore, the advantage of the NRSSI_DV-Hop intended in this form is that the location is good.


## 4.1. Reference Node Preferred Measurement

In the process of RSSI ranging, the larger the RSSI value perceived by the terminal equipment, the smaller the distance between the anchor node and the unknown node, the smaller the attenuation of the signal in space propagation, and the smaller the interference in the environment. More accurate data is placed when the operation of our anchor creates an approximate equation of the triangle. Separate the visible RSSI values in order and use the node with the larger RSSI value to create an equal triangle with the other nodes to find the unknown node.


## 4.2. Data Filtering

To reduce errors using RSSI, multiple RSSI values are displayed via the filter node, including formats such as Media Filter, Gaussian, Particle, and Kalman.Generally speaking, the larger the network area, the more the space allocated, the larger the proportion of anchors, the larger the proportion of known space, and the higher the authenticity. Therefore, we analyze the positioning accuracy according to different proportion of anchor nodes. Since the NRSSI_DV-Hop space algorithm divides and calculates the node positions of single hop and multihop, it is based on the number of hops, the wrong position of the unknown node in one of the hops, and the unknown node. It is observation-based in multihop; by changing the ratio of anchors, the errors of the NRSSI_DV-Hop algorithm and DV-Hop algorithm are compared.


### 4.2.1. Analysis of Location Error of Unknown Nodes

According to the number of anchor switches, the performance of the adjacent NRSSI_DV-Hop algorithm is shown in Figure9. First, adjust the number of sensor nodes and the space in the patch area. Spatial communication process increases the proportion of nodes and records the average error for each simulated event that occurs. From the simulation results, it can be seen that as the network area increases and the number of nodes used increases, other nodes change, and the average error of the two algorithms decreases. On the other hand, we find that the NRSSI_DV skip detection algorithm is faster than the traditional DV skip algorithm. And under different anchor node ratios, the average position simulation result of the NRSI_DV-Hop algorithm is smaller than the original algorithm. The reason for this simulation result is that the localization methods of the two algorithms are different within a hop. The original DV-Hop algorithm directly replaces the node distance in one hop with the average distance of each hop, while the NRSSI_DV-Hop algorithm obtains the distance within one hop from the reference node through the RSSI ranging method to replace the distance estimation of the original algorithm. At the same time, as the node usage increases, the number of unknown nodes within one hop decreases. These unknown nodes are measured by RSSI technology output to reduce the error of unknown nodes.Figure 9
Comparison of location errors of unknown nodes in one hop.


### 4.2.2. Comparative Analysis of Unknown Node Location Error in Multihop Case

As shown in Figure10, for the unknown node error in the multistep case, the errors of both algorithms decrease with the increase of the anchor part. The NRSSI_DV-Hop algorithm reduces errors faster. In the case of the same anchor ratio, the error of the hop NRSSI_DV algorithm is smaller than that of the original algorithm, and the positioning accuracy is higher. Therefore, the single-step NRSSI_DV positioning algorithm can reduce the positioning error and improve the positioning accuracy when the position is unknown in the multistep mode. In the hierarchical algorithm, this is because the true accuracy of the NRSSI DV bouncing placement algorithm is higher than the original algorithm within a single hop. When an unknown node enters, it converts to an anchor node to find more unknown nodes, and the error of multihop unknown nodes can be reduced to improve the accuracy of multihop positioning.Figure 10
Comparison of location errors of unknown nodes under multiple hops.The simulation results of the above two cases show that whether it is a single hop or multihop, by increasing the number of anchors, the path strength of the unknown node will gradually decrease, and the error will reduce the speed of NRSSI_DV. The jump point placement algorithm is faster than the traditional jump point algorithm DV. For the same number of anchors, the error of the NRSSI_DV-Hop algorithm is lower than that of the original algorithm, and the actual position of the NRSSI_DV-Hop algorithm is always higher than that of the original hop DV algorithm. From the error, it can be seen that the error of the switching position varies greatly with the increase of the anchor scale. When the proportion of anchors rises to a certain value (about 20%), the unknown error of the node changes slightly because the proportion of anchors is not a determining factor that affects the error of the DV-Hop algorithm. These results demonstrate the advantages of the NRSSI_DV source hopping algorithm. First of all, this is because, in the process of algorithm registration, the RSSI technology has been used to find unknown packets from a certain hop of the anchor, which is indeed better than the old algorithm; secondly, the NRSSI_DV-Hop location algorithm uses RSSI measurement technology to modify the unknown address to anchor. The location of the next node is unknown. In this way, the proportion of anchors in the network increases, so the actual position is higher. Therefore, by comparing the inaccuracy of the one-hop node location in the former form with the inaccuracy of the multihop node location, it can be seen that the NRSSI_DV one-hop location algorithm can reduce the error of the algorithm.Figure11 shows the curves of the average center error of the two algorithms as a function of the communication radius. By changing the communication radius, when nodes are referenced, by the way, the number of nodes 150 remains the same and the number of anchors. The node remains unchanged, and the output environment remains unchanged. In this case, the communication periods are r = 10, 20, 30, 40, and 50 m, respectively. The comparative simulation experiment is carried out on NRSSI_ DV-Hop algorithm and DV-Hop algorithm, and the node positioning errors of the two algorithms are obtained, as shown in Figure 11.Figure 11
Unknown node positioning error under different communication radius.The experimental results show that, in wireless sensor networks, when the communication radius of nodes increases gradually, the accuracy of unknown nodes also increases accordingly. Because large-scale communication will lead to communication between unknown nodes and other nodes, it will increase the accuracy of data transmission and reduce chaw errors. The NRSSI_DV skipping algorithm is the best in terms of accuracy. Compared with the hop DV algorithm, the hop NRSSI_DV algorithm has smaller errors in all communications. At the same time, it can be seen that when the communication radius is 30 m, the interference of the communication circuit has a great influence on the actual output of the NRSSI_DV-Hop algorithm and the DV-Hop algorithm. Higher or latter, it indicates that the performance of the hop NRSSI_DV algorithm has been improved.Figure12 depicts the visible results of the two algorithms, where the resources are affected by the anchor score after multiple simulations with the same number of nodes, the same node radius connections, and the same perimeter. Export is the same. Among them, the more the anchor nodes, the less bad the nodes in the whole network, and the higher the site coverage. With the same proportion of anchor nodes, the location coverage of the DV-Hop algorithm is lower than that of the NRSSI_DV-Hop algorithm. If the NRSSI_DV-Hop location algorithm upgrades the detected unknown nodes to anchor nodes, the proportion of anchor nodes will increase accordingly after each anchor node upgrade, so the number of undetectable nodes will decrease accordingly. When the share of anchors in the network reaches 18%, the address of the network reaches 100%, and all nodes can be located. The DV-Hop algorithm requires 22% of the anchors to complete 100% of the network service. Experimental results show that if the proportion of anchors in the network continues, it will only increase the cost of the network, but not the cost of the algorithm.Figure 12
Comparison of location coverage.Comparing the simulation results of the two algorithms, it can be seen that, in the NRSSI_DV-Hop algorithm, there is no need to add other nodes that need their own positioning function, which reduces the burden of materials, increases the positioning of anchor nodes in the positioning network, and improves the network positioning coverage. Figure13 shows the power advantage of the NRSSI_DV-Hop algorithm compared to the original DV-Hop algorithm in this behavior. Based on the NS-2 power consumption model, calculate the power consumption of each node before and after running the algorithm, and compare the power consumption results. As can be seen from Figure 12, the procedural algorithm increases as the anchor score increases. However, it is found from the results that the power consumption of the NRSSI_DV-Hop algorithm is slightly higher than that of the original algorithm, because in the entire network, the power consumption is determined by the reception and transmission of information (communication nodes). As the number of anchors in the network increases, so does network communication, and data transmission and reception increase, resulting in increased power consumption. Since the NRSSI_DV-Hop positioning algorithm has the function of improving the anchor, this new anchor will increase the throughput and transmission volume of the network during the broadcast process, and the next data will consume more energy than the old algorithm. The network positioning power consumption is high.Figure 13
Comparison of positioning energy consumption.Overall, the simulation results show that the performance of the NRSSI_DV-Hop algorithm is much better than the original DV-Hop algorithm, especially in terms of debugging. The NRSSI_DV-Hop algorithm can reduce and improve unknown network errors and provide correct location. The accuracy of positioning is the key to our positioning algorithm, which directly determines the quality of the positioning algorithm. Therefore, the advantage of the NRSSI_DV-Hop intended in this form is that the location is good.


## 4.2.1. Analysis of Location Error of Unknown Nodes

According to the number of anchor switches, the performance of the adjacent NRSSI_DV-Hop algorithm is shown in Figure9. First, adjust the number of sensor nodes and the space in the patch area. Spatial communication process increases the proportion of nodes and records the average error for each simulated event that occurs. From the simulation results, it can be seen that as the network area increases and the number of nodes used increases, other nodes change, and the average error of the two algorithms decreases. On the other hand, we find that the NRSSI_DV skip detection algorithm is faster than the traditional DV skip algorithm. And under different anchor node ratios, the average position simulation result of the NRSI_DV-Hop algorithm is smaller than the original algorithm. The reason for this simulation result is that the localization methods of the two algorithms are different within a hop. The original DV-Hop algorithm directly replaces the node distance in one hop with the average distance of each hop, while the NRSSI_DV-Hop algorithm obtains the distance within one hop from the reference node through the RSSI ranging method to replace the distance estimation of the original algorithm. At the same time, as the node usage increases, the number of unknown nodes within one hop decreases. These unknown nodes are measured by RSSI technology output to reduce the error of unknown nodes.Figure 9
Comparison of location errors of unknown nodes in one hop.


## 4.2.2. Comparative Analysis of Unknown Node Location Error in Multihop Case

As shown in Figure10, for the unknown node error in the multistep case, the errors of both algorithms decrease with the increase of the anchor part. The NRSSI_DV-Hop algorithm reduces errors faster. In the case of the same anchor ratio, the error of the hop NRSSI_DV algorithm is smaller than that of the original algorithm, and the positioning accuracy is higher. Therefore, the single-step NRSSI_DV positioning algorithm can reduce the positioning error and improve the positioning accuracy when the position is unknown in the multistep mode. In the hierarchical algorithm, this is because the true accuracy of the NRSSI DV bouncing placement algorithm is higher than the original algorithm within a single hop. When an unknown node enters, it converts to an anchor node to find more unknown nodes, and the error of multihop unknown nodes can be reduced to improve the accuracy of multihop positioning.Figure 10
Comparison of location errors of unknown nodes under multiple hops.The simulation results of the above two cases show that whether it is a single hop or multihop, by increasing the number of anchors, the path strength of the unknown node will gradually decrease, and the error will reduce the speed of NRSSI_DV. The jump point placement algorithm is faster than the traditional jump point algorithm DV. For the same number of anchors, the error of the NRSSI_DV-Hop algorithm is lower than that of the original algorithm, and the actual position of the NRSSI_DV-Hop algorithm is always higher than that of the original hop DV algorithm. From the error, it can be seen that the error of the switching position varies greatly with the increase of the anchor scale. When the proportion of anchors rises to a certain value (about 20%), the unknown error of the node changes slightly because the proportion of anchors is not a determining factor that affects the error of the DV-Hop algorithm. These results demonstrate the advantages of the NRSSI_DV source hopping algorithm. First of all, this is because, in the process of algorithm registration, the RSSI technology has been used to find unknown packets from a certain hop of the anchor, which is indeed better than the old algorithm; secondly, the NRSSI_DV-Hop location algorithm uses RSSI measurement technology to modify the unknown address to anchor. The location of the next node is unknown. In this way, the proportion of anchors in the network increases, so the actual position is higher. Therefore, by comparing the inaccuracy of the one-hop node location in the former form with the inaccuracy of the multihop node location, it can be seen that the NRSSI_DV one-hop location algorithm can reduce the error of the algorithm.Figure11 shows the curves of the average center error of the two algorithms as a function of the communication radius. By changing the communication radius, when nodes are referenced, by the way, the number of nodes 150 remains the same and the number of anchors. The node remains unchanged, and the output environment remains unchanged. In this case, the communication periods are r = 10, 20, 30, 40, and 50 m, respectively. The comparative simulation experiment is carried out on NRSSI_ DV-Hop algorithm and DV-Hop algorithm, and the node positioning errors of the two algorithms are obtained, as shown in Figure 11.Figure 11
Unknown node positioning error under different communication radius.The experimental results show that, in wireless sensor networks, when the communication radius of nodes increases gradually, the accuracy of unknown nodes also increases accordingly. Because large-scale communication will lead to communication between unknown nodes and other nodes, it will increase the accuracy of data transmission and reduce chaw errors. The NRSSI_DV skipping algorithm is the best in terms of accuracy. Compared with the hop DV algorithm, the hop NRSSI_DV algorithm has smaller errors in all communications. At the same time, it can be seen that when the communication radius is 30 m, the interference of the communication circuit has a great influence on the actual output of the NRSSI_DV-Hop algorithm and the DV-Hop algorithm. Higher or latter, it indicates that the performance of the hop NRSSI_DV algorithm has been improved.Figure12 depicts the visible results of the two algorithms, where the resources are affected by the anchor score after multiple simulations with the same number of nodes, the same node radius connections, and the same perimeter. Export is the same. Among them, the more the anchor nodes, the less bad the nodes in the whole network, and the higher the site coverage. With the same proportion of anchor nodes, the location coverage of the DV-Hop algorithm is lower than that of the NRSSI_DV-Hop algorithm. If the NRSSI_DV-Hop location algorithm upgrades the detected unknown nodes to anchor nodes, the proportion of anchor nodes will increase accordingly after each anchor node upgrade, so the number of undetectable nodes will decrease accordingly. When the share of anchors in the network reaches 18%, the address of the network reaches 100%, and all nodes can be located. The DV-Hop algorithm requires 22% of the anchors to complete 100% of the network service. Experimental results show that if the proportion of anchors in the network continues, it will only increase the cost of the network, but not the cost of the algorithm.Figure 12
Comparison of location coverage.Comparing the simulation results of the two algorithms, it can be seen that, in the NRSSI_DV-Hop algorithm, there is no need to add other nodes that need their own positioning function, which reduces the burden of materials, increases the positioning of anchor nodes in the positioning network, and improves the network positioning coverage. Figure13 shows the power advantage of the NRSSI_DV-Hop algorithm compared to the original DV-Hop algorithm in this behavior. Based on the NS-2 power consumption model, calculate the power consumption of each node before and after running the algorithm, and compare the power consumption results. As can be seen from Figure 12, the procedural algorithm increases as the anchor score increases. However, it is found from the results that the power consumption of the NRSSI_DV-Hop algorithm is slightly higher than that of the original algorithm, because in the entire network, the power consumption is determined by the reception and transmission of information (communication nodes). As the number of anchors in the network increases, so does network communication, and data transmission and reception increase, resulting in increased power consumption. Since the NRSSI_DV-Hop positioning algorithm has the function of improving the anchor, this new anchor will increase the throughput and transmission volume of the network during the broadcast process, and the next data will consume more energy than the old algorithm. The network positioning power consumption is high.Figure 13
Comparison of positioning energy consumption.Overall, the simulation results show that the performance of the NRSSI_DV-Hop algorithm is much better than the original DV-Hop algorithm, especially in terms of debugging. The NRSSI_DV-Hop algorithm can reduce and improve unknown network errors and provide correct location. The accuracy of positioning is the key to our positioning algorithm, which directly determines the quality of the positioning algorithm. Therefore, the advantage of the NRSSI_DV-Hop intended in this form is that the location is good.


## 5. Conclusion

The principles underlying the importance of the DV-Hop algorithm are investigated, special steps are documented, and negative effects on algorithm functionality are assessed. According to the defects of the algorithm, three aspects of optimization are proposed. Performance improvement is proposed for three key points. Firstly, the positioning mode of unknown nodes in one hop is changed, and the distance-based RSSI technology is used to directly measure the distance between the anchor node and the unknown node to improve the positioning accuracy of one-hop nodes. Secondly, update the discovered unknown nodes as anchor nodes, increase the proportion of anchor nodes positioned by subsequent unknown nodes, obtain the positions of more unknown nodes, and improve the location coverage; finally, the computation of the jump average distance is optimized to approximate the distance, thereby improving the accuracy of node localization in WSN. Based on the above improvements, the NRSI_DV source bounce algorithm in this paper is designed and compared with the original DV bounce algorithm. By changing the communication radius parameter and the anchor point ratio, the three factors of positioning accuracy, power consumption, and steering are comparatively controlled. It is proved that the NRSI_DV-Hop algorithm has certain advantages.WSN is a multidisciplinary intersection technology rising in recent years. It has a wide application prospect and has attracted more and more attention. However, the technology in related aspects is not very mature and needs to continue to carry out corresponding scientific research work. Based on this, this paper makes some in-depth exploration of the relevant positioning algorithms in WSN and achieves some results. However, due to the limitations of hardware equipment, personal ability, simulation environment, research time, and other relevant factors, there are still many problems that need to be improved and solved. For wireless sensor network technology, the following problems need to be further studied. For wireless sensor networks, network security is the ultimate performance pursued by all network applications. At present, the DV-Hop localization algorithm based on RSSI (NRSSI_DV-Hop) and CA-PSO_BP neural network localization algorithm does not consider the temporary security localization. However, in wireless sensor network technology, the security issue is more and more popular and is a major influence, so we can understand security in the future.



---

*Source: 1270029-2022-05-30.xml*