Wireless sensor networks are widely used in various fields, including scientific research, industry, and agriculture. However, due to the influence of geographical location and random placement, low localization accuracy and waste of resources may occur. To address these issues, this paper proposes a sensor node DV-Hop localization algorithm based on quantum behavior cuckoo search algorithm, called the QBCS-D algorithm, which is more effective and lower in cost. Firstly, the algorithm establishes a quantized potential well model using individual information in the cuckoo, which obtains the individual optimal solution and the global optimal solution based on the cuckoo update formula. The algorithm uses Monte Carlo random sampling to update the individual extreme value and searches in parallel angle near the individual and global extreme values to improve the local search performance of the algorithm. This reduces the probability of the cuckoo search algorithm falling into local optimal values in the search process. Then, the QBCS algorithm replaces the least square method in the DV-Hop localization algorithm to search for unknown nodes in the target area, transforming the problem of locating unknown nodes into an intelligent optimization problem. Simulation results demonstrate that the combination of the two algorithms can effectively reduce the location error of unknown nodes and improve the positioning accuracy of nodes. The improvement is particularly noticeable when the communication radius is between 25 and 40. Overall, the proposed QBCS-D algorithm offers promising results in improving localization accuracy and optimizing resource utilization in wireless sensor networks.