The method has the beneficial effects that the relation between the distance from the beacon node to the unknown node and the average distance fromThe beacon nodes to the area in which theunknown node is located is established by fully utilizing the hop information of the neighbor nodes of the nodes, which greatly improves the locating accuracy without increasing a hardware device.
The invention discloses a method for locating a wireless sensor network (WSN). The method comprises the following steps that: beacon nodes and an unknown node are randomly and uniformly distributed in areas, and the unknown node selects the nearest beacon node as a reference node after all the nodes obtain positions and hops of the beacon nodes; according to the information of the hops from neighbor nodes of the reference node to certain beacon node and the information of the hops from neighbor nodes of the unknown node to the beacon node, the average distance from the beacon node to the area where the unknown node is located is calculated; the distance from the beacon node to the unknown node is calculated according to a two-stage splitting iterative method; and finally the position of the unknown node is determined after the distances from the unknown node to more than three beacon nodes are obtained. The method has the beneficial effects that the relation between the distance from the beacon node to the unknown node and the average distance from the beacon node to the area in which the unknown node is located is established by fully utilizing the hop information of the neighbor nodes of the nodes, which greatly improves the locating accuracy without increasing a hardware device.