Abstract:A DV-Hop (distance vector-hop) localization algorithm based on dung beetle algorithm optimization was proposed for the problem of significant localization error of traditional DV-Hop algorithm in wireless sensor networks. Firstly, the dual communication radius was introduced to refine the number of hop nodes, then the average hop size of anchor nodes was calculated using the minimum mean square error criterion, and the mean of the improved average hop size was taken as the average hop size of each unknown node, finally, a weighting factor was introduced to optimize the fitness function, and the dung beetle optimization algorithm was used for coordinate calculation instead of the trilateral measurement method. The simulation results show that the proposed algorithm improves the average positioning error by 55. 69%, 59. 61% and 67. 59%, and the error variance by 52. 41%, 45. 58% and 36. 87% than the classical DV-Hop algorithm, which has good positioning accuracy and better stability.