Application of Improved DV-Hop algorithm in Wireless Sensor Network

: To improve the problem of inaccurate wireless sensor network positioning algorithm of DV-Hop node is proposed. Firstly, the optimization scheme of the anchor nodes is completed by calculating the triangle area of the anchor nodes. Furthermore, the particle group optimization algorithm combines the genetic chaotic particle group theory, and finally, the improved particle group algorithm is used to correct the node position obtained by the DV-Hop algorithm. The simulation experiments show that improving the DV-Hop algorithm compared with the traditional D V-Hop algorithm to monitor the underground leakage accident position more accurately.


Introduction
With the development of wireless communication technology, wireless sensor network (WSN) is increasingly used in coal mines.among DV-Hop [1][2]As a no-need ranging and positioning algorithm, it is very suitable for WSN node positioning under the mine. Many optimization algorithms have been improved to reduce localization error and improve localization accuracy [3][4][5][6][7]. document [3] The ant colony particle swarm algorithm is introduced into the unknown node computation stage of the DV-Hop algorithm to improve the localization accuracy. Document [4] The problem of collinear anchor nodes is removed by using the angle comparison principle of the multilateral measurement method. Document [5] The frog algorithm is introduced to solve the average per hop distance, thus reducing the node localization error and making it closer to the actual value. These algorithms contribute to some extent to optimize the performance of the DV-Hop algorithm, but they still have shortcomings. Based on the DV-Hop positioning algorithm, an anchor node optimization method avoids the problem that the nodes cannot be located, and proposes a DV-Hop improvement scheme based on the genetic chaotic particle swarm algorithm to reduce the average positioning error of downhole distribution network faults and improve the positioning accuracy.

Analysis and improvement of the DV-Hop algorithm 2.1. DV-Hop algorithm
The DV-Hop algorithm process is located as follows: Step 1 anchor node will its own information (ID, coordinates, anchor receiving information node jump) through the flood, the initial value of jump is set to 0, each critical point received the information and update the minimum jump, and jump number plus 1, and continue to forward to the neighbor node, this rule to obtain the unknown node from each anchor node minimum jump value.
Step 2 takes the jumps of other anchor nodes and the average distance per jump of the anchor node is calculated according to Eq. (1).
In this Eq.: ( , ) and ( , ) are the coordinates of anchor nodes and . ℎ is the minimum number of jumps between anchor node and node .
Step 3: Using the three-sided measurement method, the distance between the unknown node A0 and the anchor nodes A1, A2, and A3, as shown in Figure 1, is calculated by Eq. (2).

Deficiency of the D V-Hop algorithm
(1) The topological relationship of anchor nodes will directly affect the positioning accuracy of wireless sensor nodes. Figure 2 shows the distribution of wireless sensor nodes in the underground coal mine power grid [8]. Due to the long and narrow geographical environment of the underground coal mine, the sensors in the distribution network cannot meet the requirements of uniform layout during installation, which will produce the sensor node collinear or approximate collinear situation, neither of which can achieve the node positioning. Therefore, the removal of collinearity and the selection of suitable anchor nodes becomes a key problem. In the DV-Hop algorithm, the average distance often errors with the actual value due to the influence of environment and communication. And once the error occurs, it will be cumulative to affect the subsequent calculation, and eventually lead to greater calculation errors. Therefore, the calculation error must be reduced by correcting for the unknown node coordinates.

Anchor node preferred scheme
In this paper, the area of anchor node by calculating whether the anchor node is collinear: Assume that ( , ) , ( , ) and ( , ) are the coordinates of 3 anchor nodes randomly distributed, is the triangle area composed of anchor nodes.If 0 ≤ ≤ , then these three anchor nodes are considered to be in an approximate line, so another anchor nodes are needed to assist in positioning.

Particle swarm optimization DV-Hop
The particle swarm optimization algorithm PSO (Particle Swarm Optimization) shows its unique advantages in handling optimization problems due to its excellent global search performance and fast convergence ability [9]. PSO starts from the random solution, for the -dimensional optimization problem, randomly generates the initial population of particles, and substitutes the flight speed and position of the th particle into the optimization objective function to obtain the fitness value. After updating and location and iteration, the optimal solution is found. The optimal solution obtained by the th particle search is recorded as , and the current optimal solution obtained by particle swarm search is recorded as , and and are updated by using Eq. (8) and Eq. (9).
In the equation, 1 and 2 are shrinkage factors, and is inertia weight.

Genetic chaos particle swarm algorithm
This paper presents a genetic chaos particle swarm algorithm called GCPSO (Genetic Chaos Particle Swarm Optimization) by introducing the chaos principle and the dynamic weight adaptive regulation method.

Genetic algorithm
The genetic algorithm GA (Genetic Algorithm) is a development law that simulates the continuous evolution of living organisms in nature [10]. In this paper, a new generation of elites is formed by introducing the crossover and variation of GA algorithm in the PSO algorithm, and finally the optimal solution of the optimization problem is obtained.
(1) Select the crossover Select even individuals, then pair the selected individuals in pairs, perform cross operation, and generate offspring particles. Suppose that particle and particle are selected for cross operation, and the corresponding positions ( ) and ( ) are replaced by the following descendants: 2 (11) Corresponding speed: 2 (12) 2 = 2 + (1 − ) 1 (13) 2) Variant operation After crossing particles with probability , perform the following mutation operations: In the equation, is the interval [ − , − ] uniformly distributed random number, and are the upper and lower limits of search respectively.

Adaptive parameter adjustment
Chaos is a nonlinear motion which is very sensitive to initial conditions and can traverse all states. In this paper, the chaos principle is used to optimize the velocity and position of particles by adaptively adjusting the parameters of particle swarm optimization algorithm. Create a chaotic sequence as follows: When = 4, the system will enter into a chaotic state, and the chaotic variable ( = 1,2, ⋯ ) will traverse all the states in the system without repetition. After that, 1 and 2 are dynamically adjusted to generate an excellent population, and then lead the particles to the optimal solution through equations (8) and (9). Chaotic optimization is as follows: Inertial weights play a role in maintaining algorithmic balance in optimization. This paper chooses the dynamic weight adjustment method, and the weight update Eq. is: In the equation, and are the upper and lower limits of inertia weight; is the current iteration number; is the maximum number of iterations.

DV-Hop improvement based on genetic chaos particles
DV-Hop algorithm (GCPSO-Hop) and DV-Hop algorithm based on genetic chaos particle swarm algorithm have the same communication energy consumption, but GCPSO-Hop algorithm has slightly more computing energy consumption than DV-Hop algorithm. Since the energy consumption of the wireless sensor network is mainly generated by the communication energy consumption, so the energy consumption of the GCPSO-Hop positioning algorithm meets the application conditions. This paper targets as the minimum localization error: (19) In the equation, ( , ) is the coordinate of the unknown node, ( , ) is the coordinate of the anchor node, and is the actual measured distance. The fitness function is: The fitness function is: (20) In the equation, A is the inverse ratio of the number of hops of unknown node and anchor node ; is the number of unknown nodes. In this paper, we use the GCPSO algorithm to correct the coordinates of unknown nodes found in the later part of the DV-Hop algorithm. The specific optimization steps are as follows: Step 1 The average hop distance and the minimum hop number ℎ are obtained through step 1 and Step 2 of the DV Hop algorithm.
Step 2 Initialize particle swarm. Initialize particle velocity and position , and set the number of iterations = 0.
Step 3 Calculate the fitness value according to equation (20).
Step 4 Compare the fitness of each particle. The individual optimal solution in the group is set as , and the global optimal solution is set as .
Step 5 Update the velocity and position of particles according to Formula (8) and Formula (9).
Step 6 Determine whether the algorithm is terminated. If the maximum number of iterations is reached, the optimal solution will be output; otherwise, go to Step 7.
Step 7 Randomly select individuals according to the fitness value, and perform cross operation on them to obtain new individuals.
Step 8 Perform mutation operation on all individuals, select individuals with high fitness from + to enter the next generation, and return to Step 3.

Experimental Simulation and Results analysis
To verify the effectiveness of the improved algorithm, sensor nodes are randomly generated in a simulation region of 100 m×100 m. Simulation experiments using MATLAB for GCPSO-Hop, DV-Hop, GA-Hop and Posho, and analyze the results were analyzed. The absolute positioning error is: Relative definition error is: Because the coal mine underground roadway is narrow and slender and the open space is limited. In order to reduce the error of the node communication, reducing the distance between the deployment paving nodes and adding the redundant nodes is adopted to ensure the communication between the nodes. In addition, a denser single-chain deployment mode is adopted in the narrow width lanes to ensure the communication quality between nodes. In order to test the performance of this algorithm, the experimental platform of simulated ZigBee wireless sensor distribution network is built. A schematic diagram of the experimental platform is shown in Figure 3. The power supply is a threephase current source, the single-phase output current is 1 A~100 A, the isolation transformer ratio is 1:1, R is the protection resistance, A, B and C are three-phase upper current sensors. Once the circuit in the grid ground fault, the three-phase line loses balance will appear zero order component. After the signal adjustment circuit, the 0~3.3V voltage signal is output, and then converted into a digital signal by the A / D converter, and ultimately conducive to the ZigBee wireless technology transmission to the terminal. Table 1 shows the zero-order current of the measured alignment lines.  Figure 4 is a random distribution plot of the nodes. The asterisk is the unknown node, and the cross symbol is the anchor node. At this time, the anchor node is approximately collinear with the underground coal mine. Figure 5 shows the localization effect of undetecting collinearity and excluding colollinearity. As shown in Figure 5 (a) and Figure 5 (b), the localization effect after excluding collinearity scheme is better, which can effectively reduce the average localization error of nodes.   Figure 6 shows the change curve of the average total number of anchor nodes between 5% and 35%. It can be seen from the figure that the average localization error of the four localization algorithms is constantly decreasing as the proportion of anchor nodes increases, and the localization performance of the GCPSO-Hop algorithm shows obvious advantages. At the anchor node ratio of 35%, the GCPSO-Hop algorithm has the smallest average localization error and was 11.16% lower than DV-Hop. It show that GCPSO-Hop algorithm can improve node localization accuracy and reduce localization error. Figure 7 shows the relationship of the average localization error with the number of nodes with the same proportion of anchor nodes. As the number of nodes increases, the average localization error all decreases and gradually stabilizes. The average localization error of both the GA-Hop algorithm and the PSO-Hop algorithm was smaller than that of the DV-Hop algorithm, but it did not reach the optimization. Since the GCPSO-Hop algorithm is more accurate on the location correction obtained from the localization, the average localization error is smaller.   For a more comprehensive analysis of the performance of the GAPSO-Hop algorithm. Figure 8 shows the average localization error change curve of the nodes at different communication radii when the anchor node ratio is 20%. It can be seen from the simulation results that when R hours as the communication radius increases, the average localization error begins to decrease.
For example, at R = 10 m, the average localization error of the nodes of the GCPSO-Hop algorithm was reduced by 23.8% compared with that of the DV-Hop algorithm. When R is greater than 35m, although the connectivity change of the network increases the localization error as the communication radius increases. But then the GAPSO-Hop algorithm is still the best of all the algorithms. To verify the effectiveness and accuracy of the GCPSO-Hop algorithm, six positioning nodes were selected in the underground coal mine for the validation experiment, and the experimental data are shown in Table 2. In Table 2, the actual coordinates of nodes are ( , ) and the measured coordinates are ( , ) . From the actual measurement results, we can see that the GCPSO-Hop algorithm is closer to the actual value than other algorithms, and thus has smaller localization error and higher accuracy.

Conclusion
An improved DV-Hop algorithm is proposed for the identification of underground leakage accidents. Firstly, through the anchor node optimization scheme, the defect of the anchor node combination is avoided. On the basis of the particle swarm optimization algorithm, a genetic chaotic particle swarm optimization algorithm (GCPSO) is proposed to correct the estimated position of DV-Hop. Experimental simulations show that GCPSO-Hop algorithm has a better optimization effect than DV-Hop algorithm in reducing the average positioning error and improving the positioning accuracy, which proves the feasibility and effectiveness of GCPSO-Hop algorithm in the underground safety supervision process in coal mines.