A kind of improved wireless sensor network 3-D positioning method
Technical field
The invention belongs to wireless sensor field of locating technology.
Background technique
In order to the activity condition of sensor network be monitored in wireless sensor network to realize some specific network behaviour
Make and network application, the location information of node are extremely important.The information of position and node that event occurs is built upon monitoring
On the basis of information, unquestionable, the supervisory messages of location information are not often skimble-skamble.Therefore, position is believed
Breath plays key effect in application of higher wireless sensor network.
At this stage, common distance measuring method includes: arrival time (ToA), reaching time-difference (TDoA), angle of arrival
(AoA) and received signal strength indicator device (RSSI) etc..Although such method precision is higher, also bring simultaneously
The problem of in terms of hardware requirement is high and communication consumption is serious.Therefore, they are not suitable for the application journey of low energy consumption or low cost
Sequence.Specific localization method can be according to whether measurement distance or angle information be divided into the positioning based on ranging and be not necessarily to
The positioning of ranging.Localization method without ranging does not need measurement absolute distance or direction, by network connectivty information or
Positioning can be completed in other methods.
Wireless sensor network in reality is often laid out in complicated dimensional topography, according to determining based on ranging
Position then needs to measure the position or angle information of three dimensions, is also easy to produce measurement error and increases energy consumption.In order to realize three-dimensional
More accurate node locating under environment, the localization method without ranging are the emphasis of research.
Summary of the invention
The object of the present invention is to provide a kind of improved wireless sensor network 3-D positioning methods, reduce using Fermat
It accumulates and misses caused by repeatedly unknown node is estimated in the effective range of triangular pyramid shape in the 3-D positioning method of point model
Difference.
To achieve the above object, the invention adopts the following technical scheme:
A kind of improved wireless sensor network 3-D positioning method, includes the following steps:
Step 1: establishing wireless sensor network, wireless sensor network includes several wireless sensors and host computer, is appointed
By wireless communication between two adjacent wireless sensors of anticipating, all wireless sensors pass through wireless network with it is upper
Machine communication;
Step 2: all wireless sensors to host computer send inbound information, inbound information include location coordinate information and
Wireless sensor number;
Step 3: setting any one wireless sensor as wireless sensor A, host computer judges the position of wireless sensor A
Whether coordinate information is empty: being not sky, then host computer label wireless sensor A is anchor node, and generates mark information;For sky,
Then host computer label wireless sensor A is unknown node, and generates mark information;
Step 4: mark information is sent to wireless sensor A by host computer, and wireless sensor A is known certainly by mark information
As anchor node or unknown node;
Step 5: step 3 and step 4 are repeated, until all wireless sensors obtain mark information;
Step 6: host computer records the mark information of all wireless sensors;
Step 7: setting any one unknown node as unknown node B, unknown node B is to all wireless biographies adjacent thereto
Sensor sends networking request, and all anchor nodes for receiving the request that networks send the inbound information of itself to unknown node B;
Step 8: the inbound information of all anchor nodes received, unknown node B are judged inbound information by unknown node B
The power of signal simultaneously generates signal strength or weakness information, and inbound information and the synthesis processing of signal strength or weakness information are positioning by unknown node B
Data packet, and location data packet is sent to by host computer by wireless network;
Step 9: step 7 and step 8 are repeated, until the location data packet of itself is sent to by all unknown nodes
Position machine;
Step 10: whether host computer inquiry has wireless sensor to be marked as unknown node: being to then follow the steps 11;It is no,
Then follow the steps 26;
Step 11: any one unknown node of upper computer selecting reads unknown node undetermined as unknown node C undetermined
The location data packet of C;
Step 12: host computer reads from the location data packet of unknown node C undetermined and judges adjacent with unknown node C undetermined
The number of close anchor node: if the number of anchor node is greater than or equal to four, 13 are thened follow the steps;As the number of anchor node is less than
Four, then follow the steps 18;
Step 13: unknown node C undetermined is positioned using VTM-APIT-3D algorithm, its step are as follows:
Step A: host computer reads the inbound information of all anchor nodes in the location data packet of unknown node C undetermined, and root
The anchor node network Model on the periphery unknown node C undetermined is established according to the location coordinate information in inbound information;
Step B: any four anchor node in the anchor node network Model forms a triangular pyramid as vertex,
Host computer establishes the mathematical model of the triangular pyramid, and is calculated by the following method:
Host computer judges whether the triangular pyramid includes unknown node C undetermined by APIT-3D algorithm first: being, then
Retain the mathematical model information of the triangular pyramid, and defines the triangular pyramid as positioning triangular pyramid;It is no, then give up the triangular pyramid;It is described
The mathematical model information of triangular pyramid includes the inbound information for forming all anchor nodes of triangular pyramid;
Step C: the mathematical model information for the triangular pyramid that host computer record remains;
Step D: host computer, which executes, repeats step B and step C, until finding out all positioning comprising unknown node C undetermined
Triangular pyramid;
Step E: any one positioning triangular pyramid of upper computer selecting first, and calculate the Fermat point of the positioning triangular pyramid
Coordinate, then host computer is calculated by the following method: will behind 4 vertex of the positioning triangular pyramid and the Fermat point line
The positioning triangular pyramid has been divided into 4 regions, each region is set as a sub- triangular pyramid;
Judge which sub- triangular pyramid which unknown node C undetermined is included in by APIT-3D algorithm, and defining should
Sub- triangular pyramid is locator triangular pyramid, and the location coordinate information on 4 vertex of the sub- triangular pyramid of record location;
Step F: host computer establishes the mathematical model of locator triangular pyramid, and is calculated by the following method: positioning
The triangle without Fermat point is found in sub- triangular pyramid, take the triangle is used as positioning side on one side, make the middle line on positioning side,
Middle line vertical plane is done by the middle line, locator triangular pyramid is divided into two localization regions;
Step G: host computer judges unknown node C distance undetermined by the signal strength or weakness information in comparison location data packet
Which vertex is close, to judge that unknown node C undetermined is in the which side of the middle line vertical plane, i.e., at unknown node C undetermined
In which localization region;
Step H: repeating step B to step G, and host computer finds out all localization regions comprising unknown node C undetermined;
Step 14: host computer passes through the calculating overlapping region by calculating the overlapping region of all localization regions
Center-of-mass coordinate;
Step 15: the center-of-mass coordinate is sent to unknown node C undetermined by wireless network by host computer;
Step 16: unknown node C undetermined receives the center-of-mass coordinate, and sits the center-of-mass coordinate as the position of itself
Mark information;Unknown node C undetermined according to itself location coordinate information and wireless sensor number generate inbound information, it is undetermined not
Know that the inbound information of itself is sent to host computer by node C;
Step 17: executing step 2;
Step 18: host computer judges that the anchor node neighbouring with unknown node C undetermined is several: when anchor node is three,
Execute step 19;When anchor node is two, step 20 is executed;When anchor node is one, step 21 is executed;When anchor node is
When zero, step 22 is executed;
Step 19: definition forms cocked hat with three unknown node C undetermined neighbouring anchor nodes, and host computer establishes institute
It states cocked hat mathematical model and carries out the position coordinates that unknown node C undetermined is calculated by the following method:
Step I: any one side of cocked hat is taken, and makees the middle line on the side, cocked hat is divided into two by middle line
A small triangle;
Step J: host computer judges unknown node C distance undetermined by the signal strength or weakness information in comparison location data packet
Which vertex is close, to judge that unknown node C undetermined is in the which side of middle line, i.e., which unknown node C undetermined is in
In small triangle, and the point of the Fermat by the way that the small triangle is calculated, the coordinate of the Fermat point are the position of unknown node C undetermined
Set coordinate;Execute step 23;
Step 20: definition forms position line with two unknown node C undetermined neighbouring anchor nodes, and host computer is established described fixed
The mathematical model of bit line simultaneously carries out the position coordinates that unknown node C undetermined is calculated by the following method:
Step L: calculating the midpoint of position line and position line is divided into two sections by midpoint;
Step M: host computer judges unknown node C distance undetermined by the signal strength or weakness information in comparison location data packet
Which anchor node in position line is close, calculates the midpoint coordinates of the line segment of the anchor node and midpoint composition, which is
For the position coordinates of unknown node C undetermined, step 23 is executed;
Step 21: host computer is using the coordinate of anchor node as the position coordinates of unknown node C undetermined;Execute step 23;
Step 22: all anchor nodes are formed a cyberspace by host computer, and by the way that the cyberspace is calculated
The coordinate of center of gravity, and using the coordinate as the position coordinates of unknown node C undetermined;Execute step 23;
Step 23: the position coordinates of unknown node C undetermined are sent to unknown node undetermined by wireless network by host computer
C;
Step 24: unknown node C undetermined receives position coordinates, and generates location coordinate information, unknown node C storage undetermined
Location coordinate information;Unknown node C undetermined is numbered according to itself location coordinate information and wireless sensor and is generated inbound information,
The inbound information of itself is sent to host computer by unknown node C undetermined;
Step 25: executing step 2;
Step 26: positioning terminates.
The host computer is computer.
Model V-Link-200, T101 or W102 of the wireless sensor.
A kind of improved wireless sensor network 3-D positioning method of the present invention, reduces using Fermat point model
3-D positioning method in repeatedly unknown node estimate in the effective range of triangular pyramid shape caused by accumulated error;When not
When knowing the anchor node quantity around node less than four, the present invention is using the method that middle line (point) is repaired to unknown section in this case
The location estimation of point is improved, to achieve the purpose that optimum position precision and the network coverage.
Detailed description of the invention
Fig. 1 is overview flow chart of the invention;
Fig. 2 is the mathematical model figure of median of a triangle vertical plane of the invention;
Fig. 3 is the mathematical model figure that median of a triangle vertical plane of the invention divides triangular pyramid.
Specific embodiment
A kind of improved wireless sensor network 3-D positioning method as shown in FIG. 1 to 3, includes the following steps:
Step 1: establishing wireless sensor network, wireless sensor network includes several wireless sensors and host computer, is appointed
By wireless communication between two adjacent wireless sensors of anticipating, all wireless sensors pass through wireless network with it is upper
Machine communication;
Step 2: all wireless sensors to host computer send inbound information, inbound information include location coordinate information and
Wireless sensor number;
Step 3: setting any one wireless sensor as wireless sensor A, host computer judges the position of wireless sensor A
Whether coordinate information is empty: being not sky, then host computer label wireless sensor A is anchor node, and generates mark information;For sky,
Then host computer label wireless sensor A is unknown node, and generates mark information;
Step 4: mark information is sent to wireless sensor A by host computer, and wireless sensor A is known certainly by mark information
As anchor node or unknown node;
Step 5: step 3 and step 4 are repeated, until all wireless sensors obtain mark information;
Step 6: host computer records the mark information of all wireless sensors;
Step 7: setting any one unknown node as unknown node B, unknown node B is to all wireless biographies adjacent thereto
Sensor sends networking request, and all anchor nodes for receiving the request that networks send the inbound information of itself to unknown node B;
Step 8: the inbound information of all anchor nodes received, unknown node B are judged inbound information by unknown node B
The power of signal simultaneously generates signal strength or weakness information, and inbound information and the synthesis processing of signal strength or weakness information are positioning by unknown node B
Data packet, and location data packet is sent to by host computer by wireless network;
Step 9: step 7 and step 8 are repeated, until the location data packet of itself is sent to by all unknown nodes
Position machine;
Step 10: whether host computer inquiry has wireless sensor to be marked as unknown node: being to then follow the steps 11;It is no,
Then follow the steps 26;
Step 11: any one unknown node of upper computer selecting reads unknown node undetermined as unknown node C undetermined
The location data packet of C;
Step 12: host computer reads from the location data packet of unknown node C undetermined and judges adjacent with unknown node C undetermined
The number of close anchor node: if the number of anchor node is greater than or equal to four, 13 are thened follow the steps;As the number of anchor node is less than
Four, then follow the steps 18;
Step 13: unknown node C undetermined is positioned using VTM-APIT-3D algorithm, its step are as follows:
Step A: host computer reads the inbound information of all anchor nodes in the location data packet of unknown node C undetermined, and root
The anchor node network Model on the periphery unknown node C undetermined is established according to the location coordinate information in inbound information;
Step B: any four anchor node in the anchor node network Model forms a triangular pyramid as vertex,
Host computer establishes the mathematical model of the triangular pyramid, and is calculated by the following method:
Host computer judges whether the triangular pyramid includes unknown node C undetermined by APIT-3D algorithm first: being, then
Retain the mathematical model information of the triangular pyramid, and defines the triangular pyramid as positioning triangular pyramid;It is no, then give up the triangular pyramid;It is described
The mathematical model information of triangular pyramid includes the inbound information for forming all anchor nodes of triangular pyramid;
Step C: the mathematical model information for the triangular pyramid that host computer record remains;
Step D: host computer, which executes, repeats step B and step C, until finding out all positioning comprising unknown node C undetermined
Triangular pyramid;
Step E: any one positioning triangular pyramid of upper computer selecting first, and calculate the Fermat point of the positioning triangular pyramid
Coordinate, then host computer is calculated by the following method: will behind 4 vertex of the positioning triangular pyramid and the Fermat point line
The positioning triangular pyramid has been divided into 4 regions, each region is set as a sub- triangular pyramid;
Judge which sub- triangular pyramid which unknown node C undetermined is included in by APIT-3D algorithm, and defining should
Sub- triangular pyramid is locator triangular pyramid, and the location coordinate information on 4 vertex of the sub- triangular pyramid of record location;
Step F: host computer establishes the mathematical model of locator triangular pyramid, and is calculated by the following method: positioning
The triangle without Fermat point is found in sub- triangular pyramid, take the triangle is used as positioning side on one side, make the middle line on positioning side,
Middle line vertical plane is done by the middle line, locator triangular pyramid is divided into two localization regions;
Step G: host computer judges unknown node C distance undetermined by the signal strength or weakness information in comparison location data packet
Which vertex is close, to judge that unknown node C undetermined is in the which side of the middle line vertical plane, i.e., at unknown node C undetermined
In which localization region;
Step H: repeating step B to step G, and host computer finds out all localization regions comprising unknown node C undetermined;
Step 14: host computer passes through the calculating overlapping region by calculating the overlapping region of all localization regions
Center-of-mass coordinate;
Step 15: the center-of-mass coordinate is sent to unknown node C undetermined by wireless network by host computer;
Step 16: unknown node C undetermined receives the center-of-mass coordinate, and sits the center-of-mass coordinate as the position of itself
Mark information;Unknown node C undetermined according to itself location coordinate information and wireless sensor number generate inbound information, it is undetermined not
Know that the inbound information of itself is sent to host computer by node C;
Step 17: executing step 2;
Step 18: host computer judges that the anchor node neighbouring with unknown node C undetermined is several: when anchor node is three,
Execute step 19;When anchor node is two, step 20 is executed;When anchor node is one, step 21 is executed;When anchor node is
When zero, step 22 is executed;
Step 19: definition forms cocked hat with three unknown node C undetermined neighbouring anchor nodes, and host computer establishes institute
It states cocked hat mathematical model and carries out the position coordinates that unknown node C undetermined is calculated by the following method:
Step I: any one side of cocked hat is taken, and makees the middle line on the side, cocked hat is divided into two by middle line
A small triangle;
Step J: host computer judges unknown node C distance undetermined by the signal strength or weakness information in comparison location data packet
Which vertex is close, to judge that unknown node C undetermined is in the which side of middle line, i.e., which unknown node C undetermined is in
In small triangle, and the point of the Fermat by the way that the small triangle is calculated, the coordinate of the Fermat point are the position of unknown node C undetermined
Set coordinate;Execute step 23;
Step 20: definition forms position line with two unknown node C undetermined neighbouring anchor nodes, and host computer is established described fixed
The mathematical model of bit line simultaneously carries out the position coordinates that unknown node C undetermined is calculated by the following method:
Step L: calculating the midpoint of position line and position line is divided into two sections by midpoint;
Step M: host computer judges unknown node C distance undetermined by the signal strength or weakness information in comparison location data packet
Which anchor node in position line is close, calculates the midpoint coordinates of the line segment of the anchor node and midpoint composition, which is
For the position coordinates of unknown node C undetermined, step 23 is executed;
Step 21: host computer is using the coordinate of anchor node as the position coordinates of unknown node C undetermined;Execute step 23;
Step 22: all anchor nodes are formed a cyberspace by host computer, and by the way that the cyberspace is calculated
The coordinate of center of gravity, and using the coordinate as the position coordinates of unknown node C undetermined;Execute step 23;
Step 23: the position coordinates of unknown node C undetermined are sent to unknown node undetermined by wireless network by host computer
C;
Step 24: unknown node C undetermined receives position coordinates, and generates location coordinate information, unknown node C storage undetermined
Location coordinate information;Unknown node C undetermined is numbered according to itself location coordinate information and wireless sensor and is generated inbound information,
The inbound information of itself is sent to host computer by unknown node C undetermined;
Step 25: executing step 2;
Step 26: positioning terminates.
The host computer is computer.
Model V-Link-200, T101 or W102 of the wireless sensor.
The Fermat point is the particular point in three-dimensional space, and if there is a point, it arrives all tops of certain finite point set
The distance and minimum of point, this point are just referred to as Fermat point.
It defines median of a triangle vertical plane and refers to that any side in certain triangle makees its middle line, then cross this line and make one
The face vertical with plane where the triangle, as shown in Fig. 2, the coordinate on three vertex of one triangle ABC of setting is respectively A
(x1,y1,z1), B (x2,y2,z2) and C (x3,y3,z3), the coordinate of the midpoint BC M isTriangle
The equation of the middle line vertical plane AMPQ of shape ABC is as follows:
As shown in figure 3, defining any one unknown node is unknown node N, the middle line for defining triangle ABC is straight line
AM, middle line vertical plane are face AMPQ.It is divided by the space of APIT-3D algorithm and trigone Based On The Conic Model and learns that unknown node N is located at
In triangular pyramid F-ABC, and the power that unknown node N receives signal from three anchor nodes of triangle ABC was compared.If anchor
Node-B receiver to the signal strength that receives of the signal intensity ratio anchor node C from unknown node N it is all big, then unknown node N
Positioned at the side of the inclined B of middle line vertical plane;Conversely, unknown node N is located at the side of the inclined C of middle line vertical plane.
A kind of improved wireless sensor network 3-D positioning method of the present invention, on the basis of Fermat point model
The thought that space divides is incorporated, a kind of VTM-APIT-3D algorithm of innovation has been used, has reduced the three-dimensional using Fermat point model
Unknown node is repeatedly estimated accumulated error caused by the effective range of triangular pyramid shape in localization method;Work as unknown node
When the anchor node quantity of surrounding is less than four, the present invention uses the method for middle line (point) reparation to the position of unknown node in this case
It sets estimation to be improved, to achieve the purpose that optimum position precision and the network coverage.