Summary of the invention
To the object of the invention is to overcome in prior art the deficiency that the existing physical location that cannot realize wireless terminal is accurately located, provide a kind of can the wireless terminal location system of accurate locating wireless terminals.
In order to realize foregoing invention object, the invention provides following technical scheme:
A kind of wireless terminal location system, comprises packet capture unit, signal analysis unit, motion sensor, Track Pick-up unit, navigation elements and display unit, wherein,
Described packet capture unit gathers the packet that wireless terminal sends from wireless network card, and by data packet transmission to described signal analysis unit; Signal analysis unit is analyzed the packet received, and obtains address and the signal strength signal intensity of wireless terminal, and transfers to described navigation elements;
The per interval t of described motion sensor extracts acceleration and the moving direction of the movement of a wireless terminal location system, and by the acceleration that extracts each time and moving direction information transmission to described Track Pick-up unit; Track Pick-up unit with wireless terminal location system current location point for the origin of coordinates sets up relative coordinate system, the relative coordinate of a location point is determined according to an acceleration and moving direction, connect all location points, generate the motion track of wireless terminal location system, and the motion track of generation is transferred to navigation elements and display unit;
Described navigation elements chooses the N number of location point in motion track, according to
Solve and make
get X and Y of minimum value, obtain the physical coordinates (X, Y) of wireless terminal relative to wireless terminal location system, wherein, N be greater than 2 natural number, P
irepresent i-th location point of distance wireless terminal location system current location, P is the transmitting power of wireless terminal, RSSI
ifor at location point P
itime wireless terminal signal strength signal intensity, x
i' and y
i' be respectively location point P
irelative to x-axis coordinate figure and the y-axis coordinate figure of the relative coordinate of wireless terminal location system current location, X and Y is respectively wireless terminal relative to the x-axis coordinate figure of the physical coordinates of wireless terminal location system current location and y-axis coordinate figure,-500<X<500,-500<Y<500, and the equal round numbers of X and Y, Z
irepresent location point P
irange error, Z represents the distance overall error of N number of location point;
Display unit demonstrates the motion track of wireless terminal location system and the wireless terminal physical coordinates (X, Y) relative to navigation system current location.
Preferably, the signal strength signal intensity that described signal analysis unit obtains is: the mean value of signal strength signal intensity in all packets that wireless terminal sends in time interval t.
According to the embodiment of the present invention, described Track Pick-up unit all the time with wireless terminal location system current location point for the origin of coordinates sets up relative coordinate system, determine the relative coordinate of a location point according to an acceleration and moving direction:
According to V
x (i-1)=V
xi+ a
xit and V
y (i-1)=V
yi+ a
yit, calculates respectively at location point P
i-1time the speed V of wireless terminal location system in x-axis direction
x (i-1)with the speed V in y-axis direction
y (i-1), according to
With
Draw location point P respectively
irelative to location point P
i-1in the displacement x in x-axis direction
iwith the displacement y in y-axis direction
i, at location point P
i-1time wireless terminal location system the initial velocity in x-axis direction be location point P
itime speed V in x-axis direction
xi, the initial velocity in y-axis direction is location point P
itime speed V in y-axis direction
yi;
With wireless terminal location system current location point for the origin of coordinates sets up relative coordinate system, according to
draw location point P
irelative to the relative coordinate (x of wireless terminal location system current location
i', y
i'), connect all location points, generate the motion track of described wireless terminal location system;
Wherein, i=1,2,3 ..., a
xifor location point P
itime wireless terminal location system x-axis direction acceleration, a
yifor location point P
itime wireless terminal location system y-axis direction acceleration, P
i-1represent location point P
ia location point afterwards, i.e. the i-th-1 location point of distance current location point.
According to the embodiment of the present invention, described N number of location point is the nearest N number of location point of motion track middle distance wireless terminal location system current location.
Preferably, described packet capture unit, by network monitoring mode, obtains the packet that in wireless network, all wireless terminals send from wireless network card drives, and signal analysis unit, to the address by analyzing in all packets, sets up network topology structure.
Preferably, signal analysis unit is according to selecting the wireless terminal needing location from network topology structure.
Compared with prior art, beneficial effect of the present invention: wireless terminal location system of the present invention, generates corresponding motion track by the mobile of wireless terminal location system self, and from motion track, chooses several location points, according to
Solve and make
get X and Y of minimum value, obtain the physical coordinates (X, Y) of wireless terminal relative to wireless terminal location system, achieve the object of wireless terminal being carried out to accurately location.
Embodiment
Below in conjunction with test example and embodiment, the present invention is described in further detail.But this should be interpreted as that the scope of the above-mentioned theme of the present invention is only limitted to following embodiment, all technology realized based on content of the present invention all belong to scope of the present invention.
Core concept of the present invention is: navigation system is moved by self (moved by the user carrying navigation system and realize navigation system and move), generate relative movement track, according to identical sample frequency relative movement track sampled and extract the wireless signal strength of wireless terminal, the distance between wireless terminal and navigation system is drawn according to wireless signal strength, generate wireless terminal relative to the physical coordinates of movement locus according to the distance of sampled point, realize wireless terminal and accurately locate.
Below in conjunction with accompanying drawing and preferred embodiment, the present invention is described in further detail.
With reference to figure 1, a kind of wireless terminal location system that the present embodiment is enumerated comprises signal acquisition module, for gathering the wireless signal packet of wireless terminal; Signal analyse block, for analyzing source address in the wireless signal packet of collection and signal strength signal intensity, and builds wireless network topology structure; Track Pick-up module, for generating the relative movement track of navigation system; Navigation module, for generating the physical coordinates of wireless terminal according to relative movement orbit and signal strength signal intensity; Display module, for showing the motion track of navigation system and the wireless terminal physical coordinates relative to navigation system current location.
Navigation system of the present invention with terminals such as mobile phone, PC, panel computer, notebook computer, POS for carrier, also can make independently wireless terminal location device.
Described signal acquisition module is by network monitoring mode, the wireless signal packet of all wireless terminals is obtained from wireless network card drives, include the MAC Address of wireless terminal and the signal strength information of wireless signal in described packet, sampling precision can reach Microsecond grade.
In order to realize radio wave to carry the transmission of data, IEEE specifies to comprise 4 address fields in 802.11 frame formats, sees Fig. 2.DS (destinationaddress), represents the MAC Address of final recipient; SA (Sourceaddress), represents the MAC Address of sender, only has a station (client) can be the sender of this frame; RA (Receiveraddress), represents the next MAC Address that will process the station of this frame; TA (Transmitteraddress), represents the address of interface frame being transformed into radio frames, and this address only just can be used between wireless bridge.
The wireless signal packet that signal analyse block analysis gathers, first the source address of wireless signal packet will be judged, namely wireless signal packet from which wireless terminal sends out, its method is, by judging ToDS and FromDS two positions in wireless data packet in FrameContrl field, FrameContrl structure is shown in Fig. 2.
ToDS and FromDS is 0, represents that packet is that Address2 is exactly SA (Sourceaddress) from STA to STA.
ToDS is 1, FromDS is 0, represents that packet is that Address2 is exactly SA (Sourceaddress) from STA to AP.
ToDS is 0, FromDS is 1, represents that packet is that Address3 is exactly SA (Sourceaddress) from AP to STA.
ToDS and FromDS is 1, represents that packet is that Address4 is exactly SA (Sourceaddress) from AP to AP.It is as shown in table 1,
Table 1
Such as, collect two wireless signal packets, ToDS=0, FromDS=1, SA=11:11:11:11:11:11 in first wireless signal packet, DA=22:22:22:22:22:22, RSSl=-20dBm, indicate that a MAC Address is the AP of 11:11:11:11:11:11, the signal strength signal intensity to this navigation system is-20dBm, also be connected to a STA in addition below this AP, MAC Address is 22:22:22:22:22:22.Second wireless signal packet, ToDS=1, FromDS=0, SA=33:33:33:33:33:33, DA=11:11:11:11:11:11, RSSl=-50dBm, represent that MAC Address is the AP of 11:11:11:11:11:11, signal strength signal intensity to this navigation system is-50dBm, and also have a STA below, MAC Address is 33:33:33:33:33:33.Signal analyse block, by analyzing these two the wireless signal packets collected, can build wireless network topology structure, as shown in Figure 3.All wireless signal packets that signal analyse block analysis collects, build wireless network topology structure, obtain the signal strength signal intensity of wireless terminal in different time points simultaneously.
With reference to figure 4, in actual environment test, even if the position of wireless terminal is motionless, the signal strength signal intensity of the wireless signal that wireless terminal sends also has larger shake.In order to reduce to shake the error caused, need to carry out noise abatement process, its method is, with 100 milliseconds for the time interval, to sue for peace calculating mean value again, effectively decrease the impact of signal jitter to 100000 signal strength values gathered in 100 milliseconds.The signal strength signal intensity of the wireless terminal shown in the network topology structure that namely signal analyse block builds is the average signal strength of all wireless signals gathered in this wireless terminal 100 milliseconds.
Navigation system user handheld positioning device or be loaded with the fast mobile terminal of navigation system, Track Pick-up module, based on the motion sensor such as electronic compass or gyroscope, is extracted moving direction and the acceleration of navigation system, is calculated the movement locus of navigation system.The method of the movement locus of compute location system is: motion sensor according to the time interval sampling navigation system of 100 milliseconds at the acceleration of different time points and moving direction, each sampled point represents a location point of wireless terminal location system, according to uniformly accelerated motion computing formula, can show that previous location point is relative to the displacement of a rear location point on x-axis direction and y-axis direction respectively according to each acceleration of sampling and moving direction.Due to sampling acceleration and moving direction be Millisecond, so can think that the movement of wireless terminal location system is uniformly accelerated motion in 100 milliseconds.
Think P
0current location point, P
irepresent i-th location point of distance current location point, according to V
x (i-1)=V
xi+ a
xit and V
y (i-1)=V
yi+ a
yit, calculates respectively at location point P
i-1time the speed V of wireless terminal location system in x-axis direction
x (i-1)with the speed V in y-axis direction
y (i-1), according to
With
Draw location point P respectively
irelative to location point P
i-1in the displacement x in x-axis direction
iwith the displacement y in y-axis direction
i, at location point P
i-1time wireless terminal location system the initial velocity in x-axis direction be location point P
itime speed V in x-axis direction
xi, the initial velocity in y-axis direction is location point P
itime speed V in y-axis direction
yi; Navigation system is mobile from static, and first location point is zero at the initial velocity in x-axis direction and y-axis direction.The acceleration of the wireless terminal location system that motion sensor extracts is appropriate, there is directivity, the moving direction that motion sensor extracts is the direction of the translational speed of wireless terminal location system, the direction of acceleration and the direction of speed may be inconsistent, so when calculating the relative coordinate of each position point, degree of will speed up and speed are all decomposed, and are decomposed into acceleration and the speed in x-axis direction and y-axis direction respectively, such as location point P
itime, acceleration and the speed in x-axis direction and y-axis direction are respectively a
xi, a
yi, V
xi, V
yi, decomposition method is prior art, repeats no more herein.
With wireless terminal location system current location point P
0for the origin of coordinates sets up relative coordinate system, according to
draw location point P
irelative to current location point P
0relative coordinate (x
i', y
i'), connect all location points, generate the motion track of described wireless terminal location system;
Wherein, i=1,2,3 ..., a
xifor location point P
itime wireless terminal location system x-axis direction acceleration, a
yifor location point P
itime wireless terminal location system y-axis direction acceleration, P
i-1represent location point P
ia location point afterwards, i.e. the i-th-1 location point of distance current location point.
The motion track of wireless terminal location system as shown in Figure 5.Owing to thinking between location point it is uniformly accelerated motion when calculating movement locus, can there is certain accumulation of error in the movement locus therefore calculated.In order to reduce error, when calculating the physical coordinates of wireless terminal relative to contemporary wireless terminals navigation system, one section of motion track that Track Pick-up module adopts distance wireless terminal location system current location nearest, choose the data in 10 seconds, according to the interval of 100 milliseconds, 100 location points will be had.
Because radio frequency signal is with sphere to outdiffusion, same energy is divided at ball on the surface, and the relation of sphere area S and radius r is S (sphere)=4 π r
2, so signal strength signal intensity RSSI is RSSI=n/d with the relation of distance d
2, i.e. d=sqr (n/RSSI), wherein n represents the energy of wireless terminal,
p represents the transmitting power of wireless terminal, or is called transmitting power.Figure 7 shows that the relation schematic diagram of ecotopia distance and signal strength signal intensity.
With reference to figure 7, the distance between navigation system and wireless terminal is nearer, and signal strength signal intensity is larger.When distance is very near, signal strength signal intensity can increase rapidly, distance simultaneously between navigation system and wireless terminal is nearer, namely the distance of Signal transmissions is nearer, interference signal intensity inconsistent factor of decaying is fewer, therefore distance is nearer, and the wireless signal strength of sampling is more accurate, and the distance between the wireless terminal utilizing signal strength signal intensity to calculate and navigation system is also more accurate.The relative movement track of navigation system according to 100 milliseconds time interval sampling, record, match with the signal strength signal intensity sampling time interval of signal analyse block.Namely the signal strength signal intensity of the wireless signal of wireless terminal is extracted while the motion track of navigation system being sampled.The signal strength signal intensity of the wireless signal of extraction is transferred to navigation module by signal analyse block, navigation module according to the change of signal strength signal intensity, the direction that always directional signal intensity is the strongest.The user of navigation system moves along navigation module indicated direction, if moved according to navigation module indicated direction, the signal strength signal intensity of reception is more and more less, and navigation module can upgrade in time direction indication, always the direction that strengthens gradually of directional signal intensity.According to the change in signal strength received at location point, navigation system always moves along the direction that signal strength signal intensity is the strongest, and the wireless terminal that raising calculates is relative to the accuracy of the physical coordinates of navigation system current location.
Analysis result (signal strength signal intensity of wireless signal) is transferred to navigation module by signal analyse block, is calculated the distance drawn between wireless terminal and navigation system by signal strength signal intensity.The relative movement track of navigation system is transferred to navigation module by Track Pick-up module, the relative movement track of navigation module according to navigation system and the distance of wireless terminal, calculate the physical coordinates of wireless terminal relative to navigation system current location, then wireless terminal is calculated relative to the direction of navigation system and distance, as shown in Figure 5.Calculating wireless terminal relative to the method for the physical coordinates of navigation system current location is:
(1), from 100 location points of record choose any 3 location points, the coordinate of 3 location points is (x respectively
1', y
1'), (x
2', y
2'), (x
3', y
3'), signal strength signal intensity is respectively RSSI
1, RSSI
2, RSSI
3.
(2), set up equation group, calculate the distance d of 3 location points to wireless terminal respectively
1, d
2, d
3, d
1=sqr (n/RSSI
1); d
2=sqr (n/RSSI
2); d
3=sqr (n/RSSI
3);
(3), assumed wireless terminal is (X, Y) relative to the physical coordinates of navigation system current location, according to the known ((X-x of Pythagorean theorem
1')
2+ (Y-y
1')
2)=d
1 2; ((X-x
2')
2+ (Y-y
2')
2)=d
2 2; ((X-x
3')
2+ (Y-y
3')
2)=d
3 2; Then draw equation group d
1=sqr (n/RSSI
1)=sqr ((X-x
1')
2+ (Y-y
1')
2); d
2=sqr (n/RSSI
2)=sqr ((X-x
2')
2+ (Y-y
2')
2); d
3=sqr (n/RSSI
3)=sqr ((X-x
3')
2+ (Y-y
3')
2).Sqr (n/RSSI
1) what calculate is distance under ideal network environment between wireless terminal and navigation system, sqr ((X-x
1')
2+ (Y-y
1')
2) what calculate is distance under real network environment between wireless terminal and navigation system.If real network environment is ideal network environment, then can obtain the physical coordinates (X, Y) of wireless terminal according to 3 equation group.
But wireless signal is in the process of transmission under real network environment, because of refraction, diffraction and to pass through the rate of decay that different medium causes inconsistent, wireless signal strength in the wireless data packet received is caused to there is error, so sqr (n/RSSI
1) and sqr ((X-x
1')
2+ (Y-y
1')
2) may be not exclusively equal, namely there is certain error, possibly cannot obtain wireless terminal relative to wireless terminal location system physical coordinates (X, Y) accurately by 3 equation group set up.
The inventive method is by calculating the range error of several location points in motion track, at interval range-500<X<500,-500<Y<500 (coverage of current wireless network is 500m to the maximum) travels through X and Y, calculate (an X, Y) value makes the value of the distance overall error of several location points minimum, this (X, Y) is exactly the physical coordinates of wireless terminal relative to wireless terminal location system.In the present embodiment, calculate the range error that 100 location points are corresponding, Z
1, Z
2, Z
3, Z
100represent the range error of location point 1, location point 2, location point 3, location point 100 respectively,
Z
1=|sqr(n/RSSI
1)-sqr((X-x
1’)
2+(Y-y
1’)
2)|;
Z
2=|sqr(n/RSSI
2)-sqr((X-x
2’)
2+(Y-y
2’)
2)|;
Z
3=|sqr(n/RSSI
3)-sqr((X-x
3’)
2+(Y-y
3’)
2)|;
…
Z
100=|sqr(n/RSSI
100)-sqr((X-x
100’)
2+(Y-y
100’)
2)|;
The distance overall error Z=Z of 100 location points
1+ Z
2+ Z
3+ ... + Z
100.
At interval range-500<X<500,-500<Y<500 travels through X and Y, the equal round numbers of X and Y, calculate (an X, Y) value makes the value of the distance overall error Z of multiple location point minimum, then this (X, Y) is exactly the physical coordinates of wireless terminal relative to wireless terminal location system.The value precision of X and Y is less, and the wireless terminal calculated is more accurate relative to the physical coordinates of wireless terminal location system, and namely wireless terminal location is more accurate, but the complexity calculated is higher, in the present embodiment, the equal round numbers of X and Y, within namely wireless terminal location precision reaches 1m.
When calculating the physical coordinates of wireless terminal, only calculate 100 up-to-date location points, 100 location points that namely distance wireless terminal location system is nearest, the physical coordinates of the wireless terminal of calculating can continuous dynamic corrections.The navigation module direction that always directional signal is the strongest, as long as therefore move according to navigation module indicated direction, will complete wireless terminal location rapidly, finally realizes zero error location.
Display module by the digital independent of navigation module out, is shown.First wireless network topology structure can be seen, after selecting one of them wireless terminal, can position this wireless terminal, enter navigation mode, as shown in Figure 6, can see similar compass interface, the inside has marked the motion track of navigation system history and the direction of wireless terminal and distance, as long as the direction that now navigation system is pointed to along with navigation module is moved, just can the physical location of locating wireless terminals rapidly.