Method based on the technological staff attendance location of Wi-Fi
Technical field:
the present invention relates to the Wireless Network Applications field, are specifically related to a kind of method of locating based on the staff attendance of Wi-Fi technology.
Background technology:
Wi-Fi (Wireless Fidelity) technology is wireless lan (wlan) technology---the commercial title of IEEE 80211 series standards.IEEE 802.11 series standards mainly comprise 4 kinds of IEEE 802.11a/b/g/n.In open zone, the communication distance of Wi-Fi can reach 305 m; In the closure zone, communication distance is 76-122 m.At present also not with the precedent of Wi-Fi technical application in employee's management of enterprise; The work attendance mode that present enterprise generally carries out has fingerprint attendance, the work attendance etc. of checking card; These work attendance modes all need the employee scene to register bar none; This has just occurred in the situation that rush hour, queuing was registered on and off duty, and the enterprise that the employee is more is because the overlong time of waiting in line causes a part of time that does not have late employee to register originally to surpass the work hours of regulation.And just can't work attendance for employee on business trips, enterprise can not grasp its trend at any time, has formed the blind spot in the business administration.Also depend on GPS (Global Positioning System; GPS) be the application of obtaining the long-range geographical location information of employee; But because satellite-signal is vulnerable to blocking of barrier, satellite positioning tech such as GPS and AGPS also is not suitable for indoor (market, office etc.) or occasion that high building stands in great numbers etc. and to have barrier to block.Location technology relatively more commonly used at present has based on step-out time, based on arriving angle, also having based on receiving signal intensity and come localisation of mobile terminals; Because it is bigger that the Wi-Fi signal is influenced by extraneous factor; Event is relatively poor based on the precision of the triangulation location of signal intensity; And (Access Point, positional information AP) is also relatively more difficult, has limited the Wi-Fi technology in the managerial application of the employee of enterprise to obtain access point.
Summary of the invention:
the objective of the invention is to the problem of above-mentioned existence a kind of method of locating based on the staff attendance of Wi-Fi technology to be provided, accurate positioning, rapidly.
Above-mentioned purpose realizes through following technical scheme:
Based on the method that the staff attendance of Wi-Fi technology is located, this method comprises the steps:
(1) gathers the signal characteristic of reference point locations, comprise unique identification (BSSID) and the signal intensity of AP, set up a location fingerprint database;
Sort the RSS vector that tested point collected
(2) according to signal intensity after; Find out the strongest preceding 8-15 bar record of signal; In fingerprint database, match corresponding fingerprint recording then, calculate coupling fingerprint and tested point Euclidean distance and estimate the position of tested point.
Scanning Wi-Fi signal is averaged for 30 times when method of
described staff attendance location based on Wi-Fi technology, the signal characteristic of the collection reference point locations described in the step (1).
Employing nearest neighbor algorithm when the method for described staff attendance location based on Wi-Fi technology, the Euclidean distance of the fingerprint that calculates coupling described in the step (2) and tested point: suppose that the RSS observed reading that tested point receives is:
, existing being recorded as in the database
Wherein n represents detected different AP numbers on the measuring point to be checked; I ∈ [1, Nt], Nt are the record number in the database, and Ni represents the different AP numbers of storage in the i bar record, and then nearest neighbor algorithm can be expressed as:
wherein || and s-Si|| represents the Euclidean distance between s and the Si.
Beneficial effect:
1. the present invention adopt the Wi-Fi technology to integrate with existing wired ethernet network easily, and networking cost is low.Wi-Fi be by access point (Access Point, the wireless network of AP) forming with wireless network card, simple in structure, can realize quickly networking, the complicacy of setting up expense and program is well below traditional cable network.Computer more than two can also be set up peer-to-peer network, does not need AP. only to need every computer to be equipped with wireless network card.AP is as traditional cable network and the bridge between the WLAN; Any PC that wireless network card is housed can have access to spider lines through AP; Its principle of work is equivalent to the hub or the router of a built-in wireless launcher, and wireless network card then is to be responsible for receiving the client that AP transmitted.The Wi-Fi finger print information that can be used as the work attendance index can be collected in preset location by enterprise; The employee just can accomplish punching operation easily near its preset; Especially in the busier unit of some elevators, enterprise can provide the mechanism of registering of some hommizations to make things convenient for the employee to register.Adopt the Wi-Fi positioning system, record outworker's movement locus reappears its movement locus with Google Map with patterned form then, reaches the work attendance of enterprise to the outworker.
are owing to the uncertain of Wi-Fi signal and receive the influence of extraneous factor bigger; The present invention shows through practice result repeatedly; Continuous surface sweeping about 30 times; The Wi-Fi signal tends towards stability, and sets up fingerprint database afterwards so the present invention adopts scanning Wi-Fi signal to average for 30 times.
need travel through entire database owing to nearest neighbor method, and calculate the Euclidean distance of every fingerprint and tested point, thereby the fingerprint recording of finding out minimum value is then estimated position to be measured, and this method calculated amount is huge.What we taked is; With RSS vector that tested point collected according to the signal intensity ordering after; Find out the strongest preceding N bar record of signal, in fingerprint database, match corresponding fingerprint recording then, thus only need calculate coupling fingerprint and tested point Euclidean distance and estimate the position of tested point; Reduced calculated amount greatly, established technical foundation for supporting mass user.
represent that then actual distance is near more because Euclidean distance is more little, and the confidence level of this value is also high more, so the shared weight of this value should be bigger.Algorithm after the improvement has increased certain precision than the location of common nearest neighbor algorithm.
Embodiment:
Below in conjunction with concrete embodiment technical scheme of the present invention is further specified:
Based on the method that the staff attendance of Wi-Fi technology is located, this method comprises the steps:
(1) scanning Wi-Fi signal is averaged for 30 times, gathers the signal characteristic of reference point locations, comprises unique identification (BSSID) and the signal intensity of AP, sets up a location fingerprint database;
Sort the RSS vector that tested point collected
(2) according to signal intensity after; Find out the strongest preceding 8-15 bar record of signal; In fingerprint database, match corresponding fingerprint recording then, calculate coupling fingerprint and tested point Euclidean distance and estimate the position of tested point.Adopt nearest neighbor algorithm during the Euclidean distance of described fingerprint that calculates coupling and tested point: suppose that the RSS observed reading that tested point receives is: , existing being recorded as in the database
Wherein n represents detected different AP numbers on the measuring point to be checked; I ∈ [1, Nt], Nt are the record number in the database, and Ni represents the different AP numbers of storage in the i bar record, and then nearest neighbor algorithm can be expressed as:
wherein || and s-Si|| represents the Euclidean distance between s and the Si.
Common nearest neighbor algorithm location:
ask its mean value to estimate the position of this point for N RP of coupling.
(x is respectively y) that (lat1, lon1), (lat2, lon2), (lat3, lon3), the point that then finally estimates is ((lat1+lat2+lat3)/3, (lon1+lon2+lon3)/3) to the coordinate position that for example three RPs is calculated
Algorithm after improve
has carried out new weight allocation to the RP of coupling, calculates the Euclidean distance of this sample point and RP respectively, with the inverse of Euclidean distance as weight.
Three points are for example mated in
, and the Euclidean distance value of calculating is respectively a, b, c.The coordinate position of these three points (x, y) be respectively (lat1, lon1); (lat2, lon2), (lat3; Lon3), the point that then finally estimates is ((lat1/a+lat2/b+lat3/c)/(1/a+1/b+1/c), (lon1/a+lon2/b+lon3/c)/(1/a+1/b+1/c)).
are example with 10 AP signals; Classical nearest neighbor algorithm contains 21 basic calculating, 10 subtractions, 10 multiplyings; 1 extracting operation; Because classical nearest neighbor algorithm need travel through entire database, suppose to have write down in the fingerprint database 100 finger print datas, so calculated amount is 100 * 21.The present invention is through the algorithm after improveing; Elder generation is according to the RSS vector of tested point; Calculated amount becomes 10 *, 21+Tn (wherein Tn is for screening the needed calculated amount of fingerprint recording according to tested point RSS) after matching the fingerprint vector; Confirmable is that the calculated amount of Tn is significantly smaller than the calculated amount of 90 Euclidean distances.The root-mean-square error of improved nearest neighbor algorithm is 9.68m, and maximum positioning error is 29.3m, and after scanning wireless signal, whole position fixing process is in 1 second.