WO2016023190A1 - Method and device for locating ap - Google Patents

Method and device for locating ap Download PDF

Info

Publication number
WO2016023190A1
WO2016023190A1 PCT/CN2014/084262 CN2014084262W WO2016023190A1 WO 2016023190 A1 WO2016023190 A1 WO 2016023190A1 CN 2014084262 W CN2014084262 W CN 2014084262W WO 2016023190 A1 WO2016023190 A1 WO 2016023190A1
Authority
WO
WIPO (PCT)
Prior art keywords
fingerprint
fingerprints
target
signal strength
measurement point
Prior art date
Application number
PCT/CN2014/084262
Other languages
French (fr)
Chinese (zh)
Inventor
李颖哲
刘勇
武凯
陈斌
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2014/084262 priority Critical patent/WO2016023190A1/en
Priority to CN201480019518.8A priority patent/CN105519140B/en
Publication of WO2016023190A1 publication Critical patent/WO2016023190A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor

Definitions

  • the present invention relates to the field of wireless network technologies, and in particular, to a method and apparatus for locating an AP. Background technique
  • WLANs Wireless Local Area Networks
  • AP Access Point
  • the user terminal that receives the AP signal must be in the circle with the AP as the center and 70 meters as the radius, and then through the synthesis. Multiple other AP signals are received, and finally the user's location can be located. Due to the small coverage of the WLAN network, the positioning accuracy of the method is higher than that of the base station. However, in actual situations, the deployment location of most APs is not public and very random. Therefore, how to obtain the AP location becomes a problem that needs to be solved.
  • a method for relocating an AP which mainly uses a triangulation algorithm based on a propagation model to measure a WLAN signal through a terminal (mobile phone, tablet, notebook computer, etc.) having a WLAN function.
  • the intensity value is then analyzed by triangulation algorithm for the WLAN signal strength value to obtain the AP position.
  • the triangulation algorithm was originally applied only to GPS (Global Positioning System) positioning and base station positioning, that is, for outdoor positioning scenes. Since the propagation of wireless signals indoors is completely different from the outdoor propagation, the blockage of indoor walls and different building materials can cause complex multipath effects and fading. Therefore, the triangulation method is not accurate enough for indoor AP positioning. Summary of the invention
  • the present invention provides a method and apparatus for locating an AP, which can improve the accuracy of AP positioning.
  • a first aspect of the embodiments of the present invention provides a method for locating an AP, including:
  • the AP fingerprint database includes a plurality of AP fingerprints acquired at a plurality of measurement points, where the AP fingerprint includes location information of the corresponding measurement point, a MAC address of the AP, and a signal strength of the AP;
  • the fingerprint database further includes another AP corresponding to the AP fingerprint determined by the vertical height
  • the method further includes:
  • the determining, according to the location information and the signal strength of the plurality of AP fingerprint corresponding measurement points, the gradient size and the gradient direction of the searched AP fingerprints Includes:
  • the neighboring AP fingerprint includes a preset number of AP fingerprints that are closest to the measurement point corresponding to the target AP fingerprint. Determining, according to a signal strength difference between the target AP fingerprint and the neighboring AP fingerprint, a gradient size of the target AP fingerprint, and corresponding a measurement point according to the target AP fingerprint. Determining a gradient direction of the target AP fingerprint to the direction of the neighboring AP fingerprint corresponding measurement point includes:
  • the location information corresponding to the measurement point according to the target AP fingerprint and the neighboring AP fingerprint corresponding measurement point is calculated:
  • the target ⁇ fingerprint corresponds to the direction of the measurement point to the adjacent ⁇ fingerprint corresponding measurement point, and determining the gradient direction of the target ⁇ fingerprint includes:
  • the determining, according to the obtained gradient size and the gradient direction of each of the fingerprints, The horizontal position includes:
  • the step, the gradient direction, and the corresponding AP fingerprints of each AP fingerprint in each cluster are corresponding to Measuring the position information of the points, determining the gradient direction and the reference position of the class head in each cluster include:
  • the gradient direction of the AP fingerprint having the largest gradient size in each of the clusters is used as the gradient direction of the first class in the respective clusters.
  • the determining, according to the gradient direction and the reference position of the class head in each of the clusters, determining the AP The horizontal position includes:
  • the intersection point is taken as the horizontal position of the AP.
  • the determining, according to the gradient direction and the reference position of the class head in each of the clusters, determining the AP The horizontal position also includes:
  • a point in the intersection area as a horizontal position of the AP, wherein a sum of a reference position of the head of the cluster to the point of the point and a gradient direction of the head of the cluster in each cluster is the smallest .
  • Determining, according to a mean value of signal strengths of the plurality of AP fingerprints and a Gaussian distribution of signal strengths of other APs determined by a vertical height, determining a vertical height of the AP includes: Calculating the Gaussian distribution of the signal strength when the vertical height of the AP is higher than the first preset height and the Gaussian distribution of the signal strength when the vertical height of the AP is lower than the first preset height, and calculating the vertical height at the AP is equal to Signal strength threshold at the first preset height;
  • the average value of the information strength according to the multiple pieces of AP fingerprints and the vertical height of the AP are equal to
  • the comparison result of the signal intensity threshold at the first preset height determines that the vertical height of the AP includes:
  • the vertical height of the AP is a first preset height
  • the vertical height of the AP is a second preset height
  • the vertical height of the AP is a third preset height.
  • a second aspect of the embodiments of the present invention provides an apparatus for locating an AP, including:
  • An information obtaining module configured to acquire a pre-established AP fingerprint database, where the AP fingerprint database includes a plurality of AP fingerprints acquired at a plurality of measurement points, where the AP fingerprint includes location information of a corresponding measurement point, a MAC address of the AP, and The signal strength of the AP;
  • An information finding module configured to search, by using the AP fingerprint database, a plurality of AP fingerprints that are the same as the MAC address of the AP to be located;
  • An information calculation module configured to calculate a gradient size and a gradient direction of each AP fingerprint that is found according to the found location information of the multiple AP fingerprint corresponding measurement points and the signal strength;
  • a location determining module configured to determine a horizontal location of the AP according to a gradient size and a gradient direction of each of the AP fingerprints.
  • the fingerprint database further includes another AP corresponding to the AP fingerprint determined by the vertical height
  • the terminal further includes: a signal statistics module, configured to calculate a Gaussian distribution of signal strengths of other APs determined by the vertical height from the AP fingerprint database;
  • a mean value calculation module configured to calculate, according to the found signal strengths of the plurality of AP fingerprints, an average value of the signal strengths of the plurality of AP fingerprints found;
  • a height determining module configured to determine a vertical height of the AP according to a mean value of the signal strengths of the plurality of AP fingerprints and a Gaussian distribution of signal strengths of other APs determined by the vertical height.
  • the information calculation module includes: a fingerprint spacing calculation unit, configured to calculate, according to the found location information of each AP fingerprint corresponding to the measurement point, the AP fingerprints Corresponding to the spacing between measurement points;
  • the proximity fingerprint searching unit is configured to search for a neighboring AP fingerprint corresponding to the measurement point of the target AP fingerprint from the plurality of AP fingerprints that are found according to the spacing between the measurement points of the respective AP fingerprints; the fingerprint information calculation unit, And calculating, according to the location information of the target AP fingerprint corresponding measurement point and the location information of the neighboring AP fingerprint corresponding measurement point, the direction of the target AP fingerprint corresponding measurement point to the neighboring AP fingerprint corresponding measurement point, and Calculating a signal strength difference between the target AP fingerprint and the neighboring AP fingerprint according to the signal strength of the target AP fingerprint and the signal strength of the neighboring AP fingerprint;
  • a fingerprint parameter calculation unit configured to determine a gradient size of the target AP fingerprint according to a signal strength difference between the target AP fingerprint and the neighboring AP fingerprint, and correspondingly measure a point to the neighboring AP fingerprint according to the target AP fingerprint Corresponding to the direction of the measurement point, the gradient direction of the target AP fingerprint is determined.
  • the neighboring AP fingerprint includes a preset number of AP fingerprints that are closest to the measurement point corresponding to the target AP fingerprint
  • the fingerprint parameter calculation unit is specifically configured to obtain a signal strength difference of all neighboring AP fingerprints in the same direction of the target AP fingerprint corresponding to the measurement point, and obtain a signal strength of the target AP fingerprint corresponding measurement point in the direction. Comparing a signal strength difference in different directions of the target AP fingerprint corresponding to the measurement point, using the maximum signal strength difference as the gradient size of the target AP fingerprint, and using the direction of the signal strength difference as the The gradient direction of the target AP fingerprint.
  • the fingerprint information calculation unit is further configured to divide a circular space with an angle of 2 ⁇ into a plurality of quantization intervals, each of the quantization intervals respectively corresponding to one quantization direction; and determining that the target ⁇ fingerprint corresponding measurement point corresponds to the adjacent ⁇ fingerprint a quantization interval in which the direction of the measurement point is located; wherein the target ⁇ fingerprint corresponds to the quantization interval in which the measurement point is located in the direction corresponding to the measurement point of the adjacent ⁇ fingerprint, and the target ⁇ fingerprint corresponds to the measurement point The adjacent ⁇ fingerprint corresponds to the direction of the measurement point to obtain a quantization direction;
  • the fingerprint parameter calculation unit is further configured to determine a gradient direction of the target ⁇ fingerprint according to the quantization direction of the target ⁇ fingerprint corresponding measurement point to the adjacent ⁇ fingerprint corresponding measurement point.
  • the location determining module includes:
  • a clustering unit configured to divide the plurality of fingerprints found by the fingerprints into a plurality of clusters according to a spacing between the measurement points corresponding to the fingerprints;
  • the class header information determining unit is configured to determine a gradient direction and a reference position of the class head in each cluster according to the gradient size of each fingerprint in the respective clusters, the gradient direction, and the position information of the measurement points corresponding to the respective fingerprints;
  • a horizontal position determining unit configured to determine a horizontal position of the ⁇ according to a gradient direction and a reference position of the class head in the respective clusters.
  • the class header information determining unit is specifically configured to:
  • the gradient direction of the fingerprint is used as the gradient direction of the first class in the respective clusters.
  • the horizontal position determining unit is specifically configured to: if the gradient direction of the class head in the each cluster is intersected At one point, the intersection point is taken as the horizontal position of the crucible.
  • the horizontal position determining unit is specifically configured to: if the gradient direction of the class head in the respective clusters is intersected And determining, at a plurality of points, an intersection region in a gradient direction of the class leader in each of the clusters; determining a point in the intersection region as a horizontal position of the ⁇ , a reference position of the class leader in each cluster The sum of the direction to the point and the angle of the gradient direction of the head of each cluster is the smallest.
  • the signal statistics module is specifically configured to calculate, from the AP fingerprint database, a vertical height of the AP a Gaussian distribution of signal intensity at a first predetermined height and a Gaussian distribution of signal strength when the vertical height of the AP is lower than the first predetermined height position;
  • the height determination module includes:
  • a threshold value calculation unit configured to: according to the Gaussian distribution of the signal strength when the vertical height of the AP is higher than the first preset height, and the Gaussian distribution of the signal strength when the vertical height of the AP is lower than the first preset height, Calculating a signal strength threshold when the vertical height of the AP is equal to the first preset height;
  • a threshold value comparison unit configured to compare an average value of information strengths of the plurality of AP fingerprints with a signal strength threshold value when the vertical height of the AP is equal to the first preset height
  • a height determining unit configured to determine a vertical height of the AP according to a comparison between an average value of information strengths of the plurality of AP fingerprints and a signal strength threshold value when the vertical height of the AP is equal to the first preset height.
  • the height determining unit is specifically configured to: if an average value of information strengths of the multiple pieces of AP fingerprints is equal to When the vertical height of the AP is equal to the first preset height, the vertical height of the AP is the first preset height; if the average of the information strengths of the multiple AP fingerprints is greater than the vertical of the AP The height of the signal is equal to the first preset height, and the vertical height of the AP is the second preset height; if the average of the information strengths of the plurality of AP fingerprints is smaller than the vertical height of the AP is equal to the first When the signal strength is preset at a height, the vertical height of the AP is a third preset height.
  • a third aspect of the embodiments of the present invention provides a positioning AP device, where the positioning AP device includes a network interface, a memory, and a processor, wherein the memory stores a set of program codes, and the processor is configured to call the program code stored in the memory. , to do the following:
  • the AP fingerprint database includes a plurality of AP fingerprints acquired at a plurality of measurement points, where the AP fingerprint includes location information of the corresponding measurement point, a MAC address of the AP, and a signal strength of the AP;
  • the embodiment of the present invention implements the problem that the accuracy of the indoor AP positioning is not high enough in the prior art, and the plurality of AP fingerprints that are the same as the MAC address of the AP to be located are searched from the pre-established AP fingerprint database.
  • the gradient size and the gradient direction of the searched AP fingerprints are calculated; finally, according to the gradient size and the gradient direction of the respective AP fingerprints, Determining the horizontal position of the AP, and determining the vertical height of the AP according to the mean value of the signal strength of the plurality of AP fingerprints and the Gaussian distribution of the signal strengths of other APs determined by the vertical height, thereby improving the accuracy of the AP positioning. the goal of. DRAWINGS
  • FIG. 1 is a flowchart of a method for locating an AP according to a first embodiment of the present invention
  • FIG. 2 is a flowchart of a method for locating an AP according to a second embodiment of the present invention
  • FIG. 3 is a flowchart of a method for locating an AP according to a third embodiment of the present invention.
  • FIG. 4 is a flowchart of a method for locating an AP according to a fourth embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a clustering method according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of determining a horizontal position of an AP according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of another determining a horizontal position of an AP according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of an apparatus for locating an AP according to a fourth embodiment of the present invention
  • FIG. 9 is a schematic structural diagram of an information calculation module in an apparatus for locating an AP according to an embodiment of the present invention
  • 10 is a schematic structural diagram of a location determining module in an apparatus for locating an AP according to an embodiment of the present invention
  • 11 is a schematic structural diagram of a height determining module in an apparatus for positioning an AP according to an embodiment of the present invention
  • FIG. 12 is a schematic structural diagram of a positioning AP device according to a fifth embodiment of the present invention. detailed description
  • the present invention provides a method and apparatus for locating an AP, which can improve the accuracy of AP positioning. Take the station.
  • FIG. 1 is a flow chart of a method for locating an AP according to a first embodiment of the present invention. As shown in the figure, the method for locating an AP in the embodiment of the present invention includes:
  • multiple measurement points can be set around the building, and the position information of the measurement point, the MAC address of the AP, and the signal strength of the AP are respectively measured at each measurement point.
  • the location information of the measurement point may be the longitude and dimension of the measurement point.
  • the AP fingerprint may also include the service set identifier of the AP, and the service set identifier is the network name, and the terminal can enter the network only by setting the service set identifier. After obtaining multiple AP fingerprints at multiple measurement points, these AP fingerprints can be built into an AP fingerprint database, and the AP fingerprints are sorted according to the signal strength of the AP fingerprint. It should be noted that the signals of different APs may be acquired at the same measurement point. Therefore, the signal strength of the AP and the service set identifier may be different at the MAC address of the AP acquired at the measurement point.
  • S102 Search, by the AP fingerprint database, a plurality of AP fingerprints that are the same as the MAC address of the AP to be located.
  • the MAC address of the AP to be located may be obtained first, and then the to-be-positioned The MAC address of the AP is compared with each AP fingerprint in the fingerprint database. If the MAC address of the AP corresponding to the AP fingerprint in the fingerprint database is the same as the MAC address of the AP to be located, it is searched from the AP fingerprint database.
  • the distance between the measurement points of each AP fingerprint may be calculated according to the location information of the corresponding AP fingerprint corresponding to the measured points.
  • the location information of the measurement point corresponding to the AP fingerprint records the longitude and dimension of the measurement point. Therefore, the distance calculation formula can be used to calculate the distance between the measurement points of each AP fingerprint.
  • the neighboring AP fingerprints corresponding to the measurement points of the target AP fingerprint are searched from the plurality of AP fingerprints found.
  • the distances of the other AP fingerprints that are found to the target AP fingerprints are calculated in the foregoing steps.
  • the distances of the corresponding AP fingerprint corresponding measurement points to the target AP fingerprint corresponding measurement points are respectively determined.
  • the neighboring AP fingerprint closest to the measurement point corresponding to the target AP fingerprint is obtained therefrom.
  • the target AP fingerprint calculates the direction of the target AP fingerprint corresponding measurement point to the corresponding measurement point of the neighboring AP fingerprint, and according to the signal strength of the target AP fingerprint and the proximity
  • the signal strength of the AP fingerprint calculates the signal strength difference between the target AP fingerprint and the neighboring AP fingerprint.
  • the target AP fingerprint gradient direction is determined, and the gradient of the target AP is determined according to the signal strength difference between the target AP fingerprint and the neighboring AP fingerprint.
  • the formula is as follows:
  • the circular space with an angle of 2 ⁇ may be divided into a plurality of quantization intervals, each of which corresponds to a quantization direction; and then the direction of the target ⁇ fingerprint corresponding to the measurement point to the adjacent measurement point of the fingerprint is determined.
  • Quantization interval corresponds to the determined target ⁇ fingerprint corresponding to the measurement interval to the adjacent ⁇ fingerprint corresponding measurement point in the quantization interval.
  • the target ⁇ fingerprint corresponding measurement point to the adjacent ⁇ fingerprint corresponding measurement point processing to obtain a quantification direction. Therefore, the gradient direction of the target fingerprint is determined according to the quantization direction of the target ⁇ fingerprint corresponding measurement point to the adjacent ⁇ fingerprint corresponding measurement point.
  • the angle [0, 2 ⁇ ] is equally divided into 8 quantization intervals.
  • the direction corresponding to the measurement point of fs corresponding to f Sj is located at ⁇ ⁇ 0 ⁇ 2; ⁇ or 0 ⁇ 0 ⁇ , it will be quantized to 0;
  • f Sl corresponds to the measurement point to the f Sj corresponding measurement point in the direction ⁇ , ⁇ + 0 ⁇ i ⁇ 6, it will be quantized to 1 J 8 8 4
  • any one of the plurality of fingerprints found above may be used as the target fingerprint, and the direction of one of the fingerprint corresponding measurement points to the corresponding measurement point of the adjacent fingerprint and the fingerprint and the adjacent fingerprint may be calculated. After the difference between the signal strengths of the fingerprints, the direction of the corresponding measurement points of the other detected fingerprints to the corresponding measurement points of the respective fingerprints, and the signal intensity difference between the other fingerprints and the adjacent fingerprints are sequentially calculated.
  • the gradient of the target ⁇ fingerprint may be determined according to the signal strength difference between the target ⁇ fingerprint and the adjacent ⁇ fingerprint, and the measurement point is corresponding to the measurement point of the neighbor ⁇ fingerprint according to the target ⁇ fingerprint Direction, determining the gradient direction of the target fingerprint.
  • the neighboring fingerprint includes a preset number of fingerprints closest to the target corresponding to the target fingerprint, and may first calculate the target fingerprint corresponding measurement point to each neighbor according to the same calculation method as in the above steps.
  • the fingerprint corresponds to the direction of the measurement point, and the difference between the target ⁇ fingerprint and the adjacent ⁇ fingerprint signal strength, and then will be located at the target ⁇ fingerprint corresponding measurement point Comparing the signal strength differences of all neighboring AP fingerprints in the same direction to obtain the signal strength difference of the target AP fingerprint corresponding measurement points in the direction, and finally comparing the signal strength differences in different directions of the target AP fingerprint corresponding measurement points And using the maximum signal strength difference as a gradient size of the target AP fingerprint, and using the direction in which the signal strength difference is located as a gradient direction of the target AP fingerprint.
  • the signal strength function of the AP when the curve passes through the measurement points is calculated according to the location information of the plurality of AP fingerprints corresponding to the detected measurement points and the signal strength, and then the signal strength function of the AP is derived. Calculate the gradient direction and gradient size of each AP fingerprint.
  • S104 Determine a horizontal position of the AP according to a gradient size and a gradient direction of each AP fingerprint.
  • the intersection point is used as the AP.
  • the horizontal position if there are only three AP fingerprints in the AP fingerprint database that are the same as the MAC address of the AP to be located, and the three AP fingerprints intersect in a gradient direction, the intersection point is used as the AP. The horizontal position.
  • the multiple AP fingerprints that are found are divided into multiple clusters according to the spacing between the measurement points of the respective AP fingerprints; and then, according to the gradient of each AP fingerprint in each cluster
  • the size, the gradient direction, and the position information of each AP fingerprint corresponding to the measurement point determine the first reference position and the gradient direction in each cluster, and then determine the AP according to the reference position and the gradient direction of the class head in each cluster.
  • FIG. 2 is a flow chart of a method for locating an AP according to a second embodiment of the present invention. As shown in the figure, the method for locating an AP in the embodiment of the present invention includes:
  • the AP fingerprint may also include the service set identifier of the AP, and the service set identifier is the network name, and the terminal can enter the network only by setting the service set identifier.
  • these AP fingerprints can be built into a fingerprint database, and each AP fingerprint is sorted according to the signal strength of the AP fingerprint. It should be noted that the signals of different APs may be acquired at the same measurement point. Therefore, the MAC address of the AP acquired at the measurement point may be different between the signal strength of the AP and the service set identifier.
  • the MAC address of the AP to be located may be obtained first, and then the MAC address of the AP to be located is compared with each AP fingerprint in the fingerprint database, and the MAC address of the AP corresponding to the AP fingerprint in the fingerprint database is If the MAC address of the AP to be located is the same, it is searched from the AP fingerprint database.
  • a Gaussian distribution of signal strength when the vertical height of the AP is higher than the first preset height and a Gaussian distribution of signal strength when the vertical height of the AP is lower than the first preset height position may be counted from the AP fingerprint library. .
  • the AP fingerprints corresponding to other APs whose vertical height is determined can be classified into two types: the vertical height of the AP is 10 meters or more and the vertical height of the AP is 10 meters or less. It is known that the vertical height of the AP corresponding to the ⁇ ( ⁇ ⁇ 2) AP fingerprint is above 10 meters, ( ⁇ 2) eight? The vertical height of the AP corresponding to the fingerprint is less than 10 meters.
  • the average and variance of the signal strength when the vertical height of the AP is higher than 10 meters can be firstly calculated, and the mean value of the signal strength when the vertical height of the AP is less than 10 meters.
  • the variance then the Gaussian distribution of the signal strength above the 10 m vertical height of the AP, and the Gaussian distribution G 2 of the signal strength when the vertical height of the AP is less than 10 m, and the representation formula of 0 2 are:
  • ⁇ and ⁇ 2 are the mean and variance of the signal strength when the vertical height of the raft is higher than 10 m; ⁇ 2 . ⁇ 2 2 is the mean and variance of the signal strength when the vertical height of the AP is less than 10 m.
  • the distance between the measurement points of each AP fingerprint may be calculated according to the location information of the corresponding AP fingerprint corresponding to the measured points.
  • the location information of the AP fingerprint corresponding to the measurement point records the longitude and dimension of the measurement point. Therefore, the distance calculation formula can be used to calculate the distance from the corresponding measurement points of the other AP fingerprints to the corresponding measurement points of the target AP fingerprint.
  • the neighboring AP fingerprints corresponding to the measurement points of the target AP fingerprint are searched from the plurality of AP fingerprints found.
  • the distances of the other AP fingerprints that are found to the target AP fingerprints are calculated in the foregoing steps.
  • the distances of the corresponding AP fingerprint corresponding measurement points to the target AP fingerprint corresponding measurement points are respectively determined.
  • the neighboring AP fingerprint closest to the measurement point corresponding to the target AP fingerprint is obtained therefrom.
  • the target AP fingerprint calculates the direction of the target AP fingerprint corresponding measurement point to the corresponding measurement point of the neighboring AP fingerprint, and according to the signal strength of the target AP fingerprint and the proximity
  • the signal strength of the AP fingerprint calculates the signal strength difference between the target AP fingerprint and the neighboring AP fingerprint.
  • the target AP fingerprint gradient direction is determined, and the gradient of the target AP is determined according to the signal strength difference between the target AP fingerprint and the neighboring AP fingerprint.
  • the formula for calculating the direction is as follows:
  • the circular space with an angle of 2 ⁇ may be divided into a plurality of quantization intervals, each of which corresponds to a quantization direction; and then the direction of the target ⁇ fingerprint corresponding to the measurement point to the adjacent measurement point of the fingerprint is determined.
  • Quantization interval corresponds to the determined target ⁇ fingerprint corresponding to the measurement interval to the adjacent ⁇ fingerprint corresponding measurement point in the quantization interval.
  • the target ⁇ fingerprint corresponding measurement point to the adjacent ⁇ fingerprint corresponding measurement point processing to obtain a quantification direction. Therefore, the gradient direction of the target fingerprint is determined according to the quantization direction of the target ⁇ fingerprint corresponding measurement point to the adjacent ⁇ fingerprint corresponding measurement point.
  • the angle [0, 2 ⁇ ] is equally divided into 8 quantization intervals.
  • the direction corresponding to the measurement point of fs corresponding to f Sj is located at ⁇ ⁇ 0 ⁇ 2; ⁇ or 0 ⁇ 0 ⁇ , it will be quantized to 0;
  • f Sl corresponds to the measurement point
  • any one of the plurality of fingerprints found above may be used as the target fingerprint, and the direction of one of the fingerprint corresponding measurement points to the corresponding measurement point of the adjacent fingerprint and the fingerprint and the adjacent fingerprint may be calculated. After the difference between the signal strengths of the fingerprints, the direction of the corresponding measurement points of the other detected fingerprints to the corresponding measurement points of the respective fingerprints, and the signal intensity difference between the other fingerprints and the adjacent fingerprints are sequentially calculated.
  • the gradient of the target ⁇ fingerprint may be determined according to the signal strength difference between the target ⁇ fingerprint and the adjacent ⁇ fingerprint, and the measurement point is corresponding to the measurement point of the neighbor ⁇ fingerprint according to the target ⁇ fingerprint Direction, determining the gradient direction of the target fingerprint.
  • the neighboring fingerprint includes a preset number of fingerprints closest to the target corresponding to the target fingerprint, and may first calculate the target fingerprint corresponding measurement point to each neighbor according to the same calculation method as in the above steps.
  • the fingerprint corresponds to the direction of the measurement point, and the difference between the target ⁇ fingerprint and the signal strength of each adjacent ⁇ fingerprint, and then sums the signal strength differences of all adjacent ⁇ fingerprints located in the same direction of the target ⁇ fingerprint corresponding to the measurement point.
  • the target ⁇ fingerprint corresponds to the signal strength difference of the measurement point in the direction, and finally the comparison is located at the target ⁇ fingerprint corresponding measurement
  • the signal strength difference in different directions is used, and the maximum signal strength difference is used as the gradient size of the target AP fingerprint, and the direction in which the signal strength difference is located is used as the gradient direction of the target AP fingerprint.
  • the signal strength function of the AP when the curve passes through the measurement points is calculated according to the location information of the plurality of AP fingerprints corresponding to the detected measurement points and the signal strength, and then the signal strength function of the AP is derived. Calculate the gradient direction and gradient size of each AP fingerprint.
  • S204 Determine a horizontal position of the AP according to a gradient size and a gradient direction of each AP fingerprint.
  • the step S202 finds that there are only three AP fingerprints in the AP fingerprint database that are the same as the MAC address of the AP to be located, and the three AP fingerprints intersect in a gradient direction, the intersection point is used as the AP.
  • the horizontal position if the step S202 finds that there are only three AP fingerprints in the AP fingerprint database that are the same as the MAC address of the AP to be located, and the three AP fingerprints intersect in a gradient direction, the intersection point is used as the AP.
  • the horizontal position if the step S202 finds that there are only three AP fingerprints in the AP fingerprint database that are the same as the MAC address of the AP to be located, and the three AP fingerprints intersect in a gradient direction, the intersection point is used as the AP. The horizontal position.
  • the multiple AP fingerprints that are found are divided into multiple clusters according to the spacing between the measurement points of the respective AP fingerprints; and then, according to the gradient of each AP fingerprint in each cluster
  • the size, the gradient direction, and the position information of each AP fingerprint corresponding to the measurement point determine the first reference position and the gradient direction in each cluster, and then determine the AP according to the reference position and the gradient direction of the class head in each cluster.
  • S205 Calculate, according to the found signal strengths of the plurality of AP fingerprints, an average of signal strengths of the plurality of AP fingerprints that are found.
  • the signal strengths of the plurality of AP fingerprints found may be summed, and then the sum of the summed signal strengths is divided by the number of the obtained AP fingerprints, and the calculated average value is used as the found value.
  • S206 Determine a vertical height of the AP according to a mean value of the signal strengths of the plurality of AP fingerprints and a Gaussian distribution of signal strengths of other APs determined by the vertical height.
  • the signal strength threshold is when the vertical height of the AP is equal to the first preset height.
  • the Gaussian distribution of the signal strength when the vertical height of the AP is higher than 10 meters and the Gaussian distribution G 2 of the signal strength when the vertical height of the AP is less than 10 meters are calculated by the step S202, and the two distribution curves are calculated.
  • the average of the information strengths of the plurality of AP fingerprints is compared with the signal strength threshold when the vertical height of the AP is equal to the first preset height.
  • determining a vertical height of the AP according to a comparison between an average of information strengths of the plurality of AP fingerprints and a signal strength threshold value when the vertical height of the AP is equal to the first preset height. Specifically, if the average value of the information strengths of the plurality of AP fingerprints is equal to the signal strength threshold when the vertical height of the AP is equal to the first preset height, the vertical height of the AP is the first preset height; The average of the information strengths of the plurality of AP fingerprints is greater than the signal strength threshold when the vertical height of the AP is equal to the first preset height, and the vertical height of the AP is the second preset height; The average value of the information strength of the AP fingerprint is smaller than the signal strength threshold when the vertical height of the AP is equal to the first preset height, and the vertical height of the AP is the third preset height.
  • the average value of the signal strengths of the multiple AP fingerprints found above is recorded as the signal strength threshold when the vertical height of the AP is equal to 10 meters. If > 3 ⁇ 4 , the AP to be located is located below 10 meters, and the AP can be positioned to 5 meters. If ⁇ , it means that the AP to be located is located at 10 meters or more, and the AP can be positioned to 15 meters.
  • the indoor AP is measured on the outdoor ground, the signal strength of the AP located indoors of 20 meters or more is very low, which is difficult to measure outdoors, so the applicable range of the vertical height of the AP can be set. Between 0 and 20 meters, the vertical height of the AP is divided into two parts of 10 meters or less and 10 meters or more. In order to reduce the average positioning error of the vertical height, the AP located below 10 meters is further positioned to 5 meters, and the AP located above 10 meters is positioned to 15 meters.
  • the horizontal position of the AP and the vertical height of the AP can determine the specific location of the AP.
  • FIG. 3 is a flowchart of a method for locating an AP according to a third embodiment of the present invention. As shown in the figure, the method for locating an AP in the embodiment of the present invention includes:
  • AP fingerprint database includes multiple AP fingerprints acquired at multiple measurement points, where the AP fingerprint includes location information of a corresponding measurement point, a MAC address of the AP, and a signal of the AP. strength.
  • multiple measurement points can be set around the building, and the position information of the measurement point, the MAC address of the AP, and the signal strength of the AP are respectively measured at each measurement point.
  • the location information of the measurement point may be the longitude and dimension of the measurement point
  • the AP fingerprint may also include the service set identifier of the AP, and the service set identifier is the network name, and the terminal can enter the network only by setting the service set identifier.
  • these AP fingerprints can be built into a fingerprint database, and the AP fingerprints are sorted according to the signal strength of the AP fingerprint. It should be noted that the signals of different APs may be obtained at the same measurement point. Therefore, the signal strength of the AP and the service set identifier of the AP may be different at the MAC address of the AP obtained at the measurement point.
  • the MAC address of the AP to be located may be obtained first, and then the MAC address of the AP to be located is compared with each AP fingerprint in the fingerprint database, and the MAC address of the AP corresponding to the AP fingerprint in the fingerprint database is If the MAC address of the AP to be located is the same, it is searched from the AP fingerprint database.
  • the distance between the measurement points of each AP fingerprint may be calculated according to the location information of the corresponding AP fingerprint corresponding to the measured points.
  • the location information of the AP fingerprint corresponding to the measurement point records the longitude and dimension of the measurement point. Therefore, the distance calculation formula can be used to calculate the distance from the corresponding measurement points of the other AP fingerprints to the corresponding measurement points of the target AP fingerprint.
  • the neighboring AP fingerprints corresponding to the measurement points of the target AP fingerprint are searched from the plurality of AP fingerprints found. Specifically, it can be used for other articles
  • the AP fingerprint corresponding measurement points are respectively compared with the distances of the target AP fingerprint corresponding measurement points, and the neighboring AP fingerprints closest to the measurement point of the target AP fingerprint are obtained therefrom.
  • the target AP fingerprint calculates the direction of the target AP fingerprint corresponding measurement point to the corresponding measurement point of the neighboring AP fingerprint, and according to the signal strength of the target AP fingerprint and the proximity
  • the signal strength of the AP fingerprint calculates the signal strength difference between the target AP fingerprint and the neighboring AP fingerprint.
  • the target AP fingerprint gradient direction is determined, and the gradient of the target AP is determined according to the signal strength difference between the target AP fingerprint and the neighboring AP fingerprint.
  • the formula for calculating the direction is as follows:
  • the circular space with an angle of 2 ⁇ may be divided into a plurality of quantization intervals, each of which corresponds to a quantization direction; and then the direction of the target ⁇ fingerprint corresponding to the measurement point to the adjacent measurement point of the fingerprint is determined.
  • Quantization interval corresponds to the determined target ⁇ fingerprint corresponding to the measurement interval to the adjacent ⁇ fingerprint corresponding measurement point in the quantization interval.
  • the target ⁇ fingerprint corresponding measurement point to the adjacent ⁇ fingerprint corresponding measurement point processing to obtain a quantification direction. Therefore, the gradient direction of the target fingerprint is determined according to the quantization direction of the target ⁇ fingerprint corresponding measurement point to the adjacent ⁇ fingerprint corresponding measurement point.
  • the angle [0, 2 ⁇ ] is equally divided into 8 quantization intervals, when f Sl corresponds to the measurement point to f Sj
  • the direction of the quantum point is located at ⁇ ⁇ 0 ⁇ 2; r or 0 ⁇ 0 ⁇ , it will be quantized to 0; when f Sl corresponds to the measurement point
  • any one of the plurality of fingerprints found above may be used as the target fingerprint, and the direction of one of the fingerprint corresponding measurement points to the corresponding measurement point of the adjacent fingerprint and the fingerprint and the adjacent fingerprint may be calculated. After the difference between the signal strengths of the fingerprints, the direction of the corresponding measurement points of the other detected fingerprints to the corresponding measurement points of the respective fingerprints, and the signal intensity difference between the other fingerprints and the adjacent fingerprints are sequentially calculated.
  • the gradient of the target ⁇ fingerprint may be determined according to the signal strength difference between the target ⁇ fingerprint and the adjacent ⁇ fingerprint, and the measurement point is corresponding to the measurement point of the neighbor ⁇ fingerprint according to the target ⁇ fingerprint Direction, determining the gradient direction of the target fingerprint.
  • the neighboring fingerprint includes a preset number of fingerprints closest to the target corresponding to the target fingerprint, and may first calculate the target fingerprint corresponding measurement point to each neighbor according to the same calculation method as in the above steps.
  • the fingerprint corresponds to the direction of the measurement point, and the difference between the target ⁇ fingerprint and the signal strength of each adjacent ⁇ fingerprint, and then sums the signal strength differences of all adjacent ⁇ fingerprints located in the same direction of the target ⁇ fingerprint corresponding to the measurement point.
  • the target ⁇ fingerprint corresponds to the signal strength difference of the measurement point in the direction, and finally compares the signal strength difference in different directions of the target ⁇ fingerprint corresponding measurement point, and the maximum signal strength difference is used as the target ⁇ fingerprint
  • the gradient size, and the direction in which the signal intensity difference is located is taken as the gradient direction of the target fingerprint.
  • the signal strength function of the ⁇ when the curve passes through the measurement points is calculated, and then the signal strength function of the ⁇ is derivation. Calculate the gradient direction and gradient size of each fingerprint.
  • the plurality of fingerprints that are found are divided into a plurality of clusters according to the spacing between the measurement points corresponding to the respective fingerprints.
  • the fingerprints corresponding to the measuring points with similar distances can be classified into one cluster, and the corresponding position distribution of the measuring points according to the plurality of found fingerprints is selected, and the corresponding cluster number is selected. the amount.
  • the dot in the figure is the AP fingerprint corresponding measurement point
  • the pentagram is the reference position of the class head in each cluster
  • the found AP fingerprint is divided into three (at least three) clusters, each The AP fingerprints in the clusters are close to the measurement points.
  • each of the AP fingerprints in the cluster has a respective gradient size and a gradient direction, and the gradient direction of the AP fingerprint with the largest gradient in each of the clusters may be used as the first class in the respective clusters.
  • the reference position of the class leader in each cluster is the point closest to the sum of the distances of the fingerprints corresponding to the fingerprints in the cluster.
  • the intersection point is used as the horizontal position of the AP, as shown in FIG. 6, the horizontal position of the AP is the intersection of the three rays in the figure. .
  • the gradient direction of the class leader in the respective clusters intersects at multiple points, determining an intersection region in a gradient direction of the class leader in each cluster; determining a point in the intersection region
  • the horizontal position of the AP, the sum of the reference position of the class head in the respective clusters to the point and the angle of the gradient direction of the class heads in the respective clusters being the smallest.
  • the reference position of the class head in each cluster can be calculated to the direction of a certain point in the intersection region, so that the reference position of the k class heads can be obtained to indicate the gradient direction of the k class heads.
  • k l, 2, ..., K, calculate the difference between the gradient direction of the class head in each cluster and the reference position of the class head to the point direction, and calculate the sum of the differences. Then, the other points in the intersection area are calculated in turn, and the point corresponding to the sum of the minimum differences is used as the horizontal position of the AP to be located.
  • the location area where the AP may exist may be divided into multiple grids, and each cluster is calculated.
  • the reference position of the class head to the direction of a grid Gddi, so that the reference position of the k class heads can be obtained to the direction of the grid, and the gradient direction of the k class heads is expressed as k l, 2, .. ., K, calculate the difference between the gradient direction of the class head in each cluster and the direction of the reference position of the class head to the direction of the grid, and calculate the sum of the differences.
  • FIG. 4 is a flowchart of a method for locating an AP according to a third embodiment of the present invention. As shown in the figure, the method for locating an AP in the embodiment of the present invention includes:
  • multiple measurement points can be set around the building, and the position information of the measurement point, the MAC address of the AP, and the signal strength of the AP are respectively measured at each measurement point.
  • the location information of the measurement point may be the longitude and dimension of the measurement point.
  • the AP fingerprint may also include a service set identifier of the AP, and the service set identifier is a network name. After acquiring multiple AP fingerprints at multiple measurement points, these AP fingerprints can be built into a fingerprint database, and each AP fingerprint is sorted according to the signal strength of the AP fingerprint. It should be noted that the signals of different APs may be obtained at the same measurement point. Therefore, the signal strength of the AP and the service set identifier of the AP may be different at the MAC address of the AP obtained at the measurement point.
  • the MAC address of the AP to be located may be obtained first, and then the MAC address of the AP to be located is compared with each AP fingerprint in the fingerprint database, and the MAC address of the AP corresponding to the AP fingerprint in the fingerprint database is If the MAC address of the AP to be located is the same, it is searched from the AP fingerprint database.
  • S403 Calculate, according to the location information of each AP fingerprint corresponding to the measurement point, the spacing between the measurement points of the AP fingerprints.
  • the location information of the AP fingerprint corresponding to the measurement point records the longitude and dimension of the measurement point, so the distance calculation formula can be used to calculate the distance between the measurement points of each AP fingerprint.
  • the plurality of Find the neighboring AP fingerprint of the target AP fingerprint corresponding to the measurement point in the AP fingerprint According to the spacing between the measurement points corresponding to the pieces of the AP fingerprints, the plurality of Find the neighboring AP fingerprint of the target AP fingerprint corresponding to the measurement point in the AP fingerprint.
  • the distances of the other AP fingerprints that are found to the target AP fingerprints are calculated in the foregoing steps.
  • the distances of the corresponding AP fingerprint corresponding measurement points to the target AP fingerprint corresponding measurement points are respectively determined.
  • the neighboring AP fingerprint closest to the measurement point corresponding to the target AP fingerprint is obtained therefrom.
  • FS sum the sum-strip AP fingerprint with the same MAC address as the AP to be located from the fingerprint database, denoted as FS sum , f Si e FS sum , ⁇ is one of the fingerprints of the sum AP fingerprint, which is recorded as the target AP.
  • the circular space with an angle of 2 ⁇ may be divided into a plurality of quantization intervals, each of which corresponds to a quantization direction; and then the direction of the target ⁇ fingerprint corresponding to the measurement point to the adjacent measurement point of the fingerprint is determined.
  • Quantization interval corresponds to the determined target ⁇ fingerprint corresponding to the measurement interval to the adjacent ⁇ fingerprint corresponding measurement point in the quantization interval.
  • the target ⁇ is processed in the direction corresponding to the measurement point of the adjacent AP fingerprint to obtain a quantization direction. Therefore, determining a gradient direction of the target AP fingerprint according to the quantization direction of the target AP fingerprint corresponding measurement point to the neighboring AP fingerprint corresponding measurement point.
  • the angle [0, 2 ⁇ ] is equally divided into 8 quantization intervals.
  • the direction corresponding to the measurement point of fs corresponding to f Sj is located at ⁇ ⁇ 0 ⁇ 2; ⁇ or 0 ⁇ 0 ⁇ , it will be quantized to 0;
  • f Sl corresponds to the measurement point
  • any one of the plurality of fingerprints found above may be used as the target fingerprint, and the direction of one of the fingerprint corresponding measurement points to the corresponding measurement point of the adjacent fingerprint and the fingerprint and the adjacent fingerprint may be calculated. After the difference between the signal strengths of the fingerprints, the direction of the corresponding measurement points of the other detected fingerprints to the corresponding measurement points of the respective fingerprints, and the signal intensity difference between the other fingerprints and the adjacent fingerprints are sequentially calculated.
  • S406. Determine, according to a signal strength difference between the target fingerprint and the neighboring fingerprint, a gradient size of the target fingerprint, and according to the target fingerprint corresponding to a measurement point to a direction corresponding to the neighboring fingerprint. , determining a gradient direction of the target ⁇ fingerprint.
  • the neighboring fingerprint includes a preset number of fingerprints closest to the target corresponding to the target fingerprint, and may first calculate the target fingerprint corresponding measurement point to each neighbor according to the same calculation method as in the above steps.
  • the fingerprint corresponds to the direction of the measurement point, and the signal intensity difference between the target ⁇ fingerprint and the adjacent ⁇ fingerprint, and then sums the signal strength differences of all adjacent ⁇ fingerprints located in the same direction of the target ⁇ fingerprint corresponding to the measurement point to obtain the target
  • the fingerprint corresponds to the difference in signal strength of the measurement point in the direction, and finally compares the signal strength difference in different directions of the target corresponding to the target fingerprint, and the maximum signal strength difference is used as the gradient of the target fingerprint And the direction in which the signal strength difference is located is taken as the gradient direction of the target fingerprint.
  • the signal strength function of the ⁇ when the curve passes through the measurement points is calculated, and then the signal strength function of the ⁇ is derivation.
  • Calculate the gradient direction and gradient size of each fingerprint. S407. Determine a horizontal position of the AP according to a gradient size and a gradient direction of each of the AP fingerprints.
  • the step S402 finds that there are only three AP fingerprints in the AP fingerprint database that are the same as the MAC address of the AP to be located, and the three AP fingerprints intersect in a gradient direction, the intersection point is used as the AP.
  • the horizontal position if the step S402 finds that there are only three AP fingerprints in the AP fingerprint database that are the same as the MAC address of the AP to be located, and the three AP fingerprints intersect in a gradient direction, the intersection point is used as the AP. The horizontal position.
  • the multiple AP fingerprints that are found are divided into multiple clusters according to the spacing between the measurement points of the AP fingerprints. Then, the AP fingerprints corresponding to the measurement points with similar distances are classified into one cluster, and the corresponding clusters are selected according to the specific location distribution of the corresponding AP fingerprints. As shown in FIG. 5, the dot in the figure is the AP fingerprint corresponding measurement point, and the pentagram is the reference position of the class head in each cluster, and the found AP fingerprint is divided into three (at least three) clusters, each The AP fingerprints in the clusters are close to the measurement points.
  • each of the AP fingerprints in the cluster has a respective gradient size and a gradient direction, and the gradient direction of the AP fingerprint with the largest gradient in each of the clusters may be used as the first class in the respective clusters.
  • the reference position of the class head of each cluster is the closest to the sum of the distances of the corresponding measurement points of each fingerprint in the cluster.
  • the horizontal position of the AP is determined according to the gradient direction and the reference position of the class head in each cluster.
  • the intersection point is taken as the horizontal position of the AP, as shown in FIG. 6, the horizontal position of the AP is 3 rays in the figure. Intersection.
  • the gradient direction of the class leader in the respective clusters intersects a plurality of points, determining an intersection region in a gradient direction of the class leader in each of the clusters; determining a point in the intersection region As a horizontal position of the AP, a sum of a reference position of the head of the cluster to the point of the point and a gradient direction of the head of the cluster in each cluster is the smallest.
  • the location area where the AP may exist may be divided into multiple grids, and each cluster is calculated.
  • the reference position of the class head in the direction of a certain grid Gddi, so that the reference position of the k class heads can be obtained to the direction of the grid, and the gradient direction of the k class heads is expressed as k l, 2,. .., K, calculate the difference between the gradient direction of the class head in each cluster and the reference position of the class head to the grid direction, and calculate the sum of the differences.
  • the other grids are calculated in sequence, and the grid corresponding to the sum of the minimum differences is used as the positioning grid of the AP to be located, and finally the center point of the positioning grid is taken as the horizontal position of the AP.
  • FIG. 8 is an AP positioning AP device according to an embodiment of the present invention, which may be a network management device or a base station. As shown in the figure, the device for locating an AP in the embodiment of the present invention includes:
  • the information obtaining module 801 is configured to acquire a pre-established AP fingerprint database, where the AP fingerprint database includes a plurality of AP fingerprints acquired at a plurality of measurement points, where the AP fingerprint includes location information of a corresponding measurement point, and a MAC address of the AP. And the signal strength of the AP.
  • multiple measurement points can be set around the building, and the position information of the measurement point, the MAC address of the AP, and the signal strength of the AP are respectively measured at each measurement point.
  • the location information of the measurement point may be the longitude and dimension of the measurement point, and the AP fingerprint may also include the service set identifier of the AP, and the service set identifier is the network name, and the terminal can enter the network only by setting the service set identifier.
  • these AP fingerprints can be built into a fingerprint database, and each AP fingerprint is sorted according to the signal strength of the AP fingerprint. It should be noted that the signals of different APs may be acquired at the same measurement point. Therefore, the MAC address of the AP acquired at the measurement point, the signal strength of the AP, and the service set identifier are both May be different.
  • the information search module 802 is configured to search, from the AP fingerprint database, a plurality of AP fingerprints that are the same as the MAC address of the AP to be located.
  • the MAC address of the AP to be located may be obtained first, and then the MAC address of the AP to be located is compared with each AP fingerprint in the fingerprint database, and the MAC address of the AP corresponding to the AP fingerprint in the fingerprint database is If the MAC address of the AP to be located is the same, it is searched from the AP fingerprint database.
  • the information calculation module 803 is configured to calculate a gradient size and a gradient direction of each of the found AP fingerprints according to the found location information of the plurality of AP fingerprint corresponding measurement points and the signal strength.
  • the information calculation module 803 may further include:
  • the fingerprint spacing calculation unit 901 is configured to calculate a spacing between the measurement points of the respective AP fingerprints according to the location information of the corresponding measurement points of the AP fingerprints.
  • the location information of the AP fingerprint corresponding to the measurement point records the longitude and dimension of the measurement point. Therefore, the distance calculation formula can be used to calculate the distance from the corresponding measurement points of the other AP fingerprints to the corresponding measurement points of the target AP fingerprint.
  • the proximity fingerprint searching unit 902 is configured to search for a neighboring AP fingerprint corresponding to the measurement point of the target AP fingerprint from the plurality of AP fingerprints that are obtained according to the distance between the measurement points of the respective AP fingerprints.
  • the distances of the corresponding AP fingerprint corresponding measurement points to the target AP fingerprint corresponding measurement points are compared, and the neighboring AP fingerprints closest to the target AP fingerprint corresponding measurement points are obtained therefrom.
  • the fingerprint information calculation unit 903 is configured to calculate, according to the location information of the measurement point corresponding to the target AP fingerprint and the location information of the measurement point corresponding to the neighboring AP fingerprint, the corresponding measurement of the target AP fingerprint corresponding measurement point to the neighboring AP fingerprint.
  • the direction of the point, and the signal strength difference between the target AP fingerprint and the neighboring AP fingerprint is calculated according to the signal strength of the target AP fingerprint and the signal strength of the neighboring AP fingerprint.
  • the target AP fingerprint gradient direction is determined, and the gradient of the target AP is determined according to the signal strength difference between the target AP fingerprint and the adjacent AP fingerprint.
  • the circular space with an angle of 2 ⁇ may be divided into a plurality of quantization intervals, each of which corresponds to a quantization direction; and then the direction of the target ⁇ fingerprint corresponding to the measurement point to the adjacent measurement point of the fingerprint is determined.
  • Quantization interval corresponds to the determined target ⁇ fingerprint corresponding to the measurement interval to the adjacent ⁇ fingerprint corresponding measurement point in the quantization interval.
  • the target ⁇ fingerprint corresponding measurement point to the adjacent ⁇ fingerprint corresponding measurement point processing to obtain a quantification direction. Therefore, the gradient direction of the target fingerprint is determined according to the quantization direction of the target ⁇ fingerprint corresponding measurement point to the adjacent ⁇ fingerprint corresponding measurement point.
  • the angle [0, 2 ⁇ ] is equally divided into 8 quantization intervals.
  • f Sl corresponds to the direction of the measurement point to f Sj corresponding to the measurement point is ⁇ ⁇ 0 ⁇ 2; ⁇ or 0 ⁇ 0 ⁇ , it will be quantized to 0.
  • f Sl corresponds to the direction from the measurement point to the corresponding measurement point of fSj ⁇ is located at i ⁇ , ⁇ + 0 ⁇ i ⁇ 6, it will be quantified as
  • any one of the plurality of fingerprints found above may be used as the target fingerprint, and the direction of one of the fingerprint corresponding measurement points to the corresponding measurement point of the adjacent fingerprint and the fingerprint and the adjacent fingerprint may be calculated. After the difference between the signal strengths of the fingerprints, the direction of the corresponding measurement points of the other detected fingerprints to the corresponding measurement points of the respective fingerprints, and the signal intensity difference between the other fingerprints and the adjacent fingerprints are sequentially calculated.
  • the fingerprint parameter calculation unit 904 is configured to determine a gradient size of the target AP fingerprint according to a signal strength difference between the target AP fingerprint and the neighboring AP fingerprint, and correspondingly measure points to the neighboring AP according to the target AP fingerprint. The fingerprint corresponds to the direction of the measurement point, and the gradient direction of the target AP fingerprint is determined.
  • the neighboring AP fingerprint includes a preset number of AP fingerprints that are closest to the measurement point corresponding to the target AP fingerprint, and may first calculate the target AP fingerprint corresponding measurement point to other neighbors according to the same calculation method as in the foregoing steps.
  • the AP fingerprint corresponds to the direction of the measurement point, and the signal strength difference between the target AP fingerprint and other neighboring AP fingerprints, and then sums the signal strength differences of all neighboring AP fingerprints located in the same direction of the target AP fingerprint corresponding to the measurement point.
  • the target AP fingerprint corresponds to the signal strength difference of the measurement point in the direction, and finally compares the signal strength difference in different directions of the target AP fingerprint corresponding measurement point, and uses the maximum signal strength difference as the target AP fingerprint.
  • the gradient size, and the direction in which the signal strength difference is located is the gradient direction of the target AP fingerprint.
  • the signal strength function of the AP when the curve passes through the measurement points is calculated according to the location information of the plurality of AP fingerprints corresponding to the detected measurement points and the signal strength, and then the signal strength function of the AP is derived. Calculate the gradient direction and gradient size of each AP fingerprint.
  • the location determining module 804 is configured to determine a horizontal location of the AP according to a gradient size and a gradient direction of each of the AP fingerprints.
  • the information search module 802 finds that there are only three AP fingerprints in the AP fingerprint database that are the same as the MAC address of the AP to be located, and the three AP fingerprints intersect at a point in the gradient direction, the intersection point is used as the location.
  • the horizontal position of the AP is used as the location.
  • the location determining module 804 may further include:
  • the clustering unit 1001 is configured to divide the plurality of AP fingerprints that are found into multiple clusters according to the spacing between the measurement points of the respective AP fingerprints.
  • the AP fingerprints corresponding to the measurement points with similar distances can be classified into one cluster, and the corresponding clusters are selected according to the specific location distributions of the plurality of AP fingerprints corresponding to the measured points.
  • the dot in the figure is the AP fingerprint corresponding measurement point
  • the pentagram is the reference position of each class in the cluster
  • the found AP fingerprint is divided into three (at least three) clusters, each The AP fingerprints in the cluster correspond to similar measurement points.
  • the class header information determining unit 1002 is configured to determine a gradient direction and a reference position of the class head in each cluster according to the gradient size of each AP fingerprint in each cluster, the gradient direction, and the position information of the corresponding measurement points of each AP fingerprint.
  • each AP fingerprint in the cluster has a respective gradient size and a gradient direction
  • the gradient direction of the AP fingerprint with the largest gradient in each of the clusters may be used as the gradient of the first class in each cluster. direction.
  • the reference position of the class head of each cluster is the closest to the sum of the distances of the measurement points corresponding to the fingerprints in the cluster.
  • the horizontal position determining unit 1003 is configured to determine a horizontal position of the AP according to a gradient direction and a reference position of the class head in the respective clusters.
  • the intersection point is taken as the horizontal position of the AP, as shown in FIG. 6, the horizontal position of the AP is 3 rays in the figure. Intersection.
  • the gradient direction of the class leader in the respective clusters intersects a plurality of points, determining an intersection region in a gradient direction of the class leader in each of the clusters; determining a point in the intersection region As a horizontal position of the AP, a sum of a reference position of the head of the cluster to the point of the point and a gradient direction of the head of the cluster in each cluster is the smallest.
  • the location area where the AP may exist may be divided into multiple grids, and each class may be calculated.
  • the other grids are calculated in sequence, and the grid corresponding to the sum of the minimum differences is used as the positioning grid of the AP to be located, and finally the center point of the positioning grid is taken as the horizontal position of the AP.
  • a signal statistics module 805, configured to calculate a vertical height determination from the AP fingerprint database Gaussian distribution of the signal strength of the AP.
  • a Gaussian distribution of the signal strength when the vertical height of the AP is higher than the first preset height and a signal strength when the vertical height of the AP is lower than the first preset height position may be calculated from the AP fingerprint database. Gaussian distribution.
  • the AP fingerprints corresponding to other APs whose vertical height is determined can be classified into two types: the vertical height of the AP is 10 meters or more and the vertical height of the AP is 10 meters or less. It is known that the vertical height of the AP corresponding to the AP fingerprint is more than 10 meters, and the vertical height of the AP corresponding to the AP fingerprint of n 2 (n 2 ⁇ 2) is less than 10 meters.
  • the vertical height of the AP can be separately calculated first.
  • is the mean and variance of the signal strength when the vertical height of the raft is higher than 10 meters; ⁇ is the mean and variance of the signal strength when the vertical height of the AP is less than 10 meters.
  • the mean value calculation module 806 is configured to calculate an average value of the signal strengths of the plurality of AP fingerprints that are found according to the found signal strengths of the plurality of AP fingerprints.
  • the signal strengths of the plurality of AP fingerprints found may be summed, and then the sum of the summed signal strengths is divided by the number of the obtained AP fingerprints, and the calculated average value is used as the found value.
  • the height determining module 807 is configured to determine a vertical height of the AP according to a mean value of the signal strengths of the plurality of AP fingerprints and a Gaussian distribution of signal strengths of other APs determined by the vertical height.
  • the height determining module 807 may further include:
  • the threshold comparison unit 1102 is configured to compare the mean value of the information strengths of the plurality of AP fingerprints with the signal strength threshold when the vertical height of the AP is equal to the first preset height.
  • the height determining unit 1103 is configured to determine a vertical height of the AP according to a comparison between an average value of information strengths of the plurality of AP fingerprints and a signal strength threshold value when the vertical height of the AP is equal to the first preset height.
  • the vertical height of the AP is a first preset height
  • the vertical height of the AP is the second preset height
  • the average value of the information strength of the AP fingerprint is smaller than the signal strength threshold when the vertical height of the AP is equal to the first preset height, and the vertical height of the AP is the third preset height.
  • the average value of the signal strengths of the plurality of AP fingerprints found above is recorded as the signal strength threshold when the vertical height of the AP is equal to 10 meters. If > 3 ⁇ 4 , the AP to be located is located below 10 meters, and the AP can be positioned to 5 meters. If ⁇ , the AP to be located is located at 10 meters or more, and the AP can be positioned to 15 meters.
  • the indoor AP is measured on the outdoor ground, the signal strength of the AP located indoors of 20 meters or more is very low, which is difficult to measure outdoors, so the applicable range of the vertical height of the AP can be set. Between 0 and 20 meters, the vertical height of the AP is divided into two parts of 10 meters or less and 10 meters or more. In order to reduce the average positioning error of the vertical height, the AP located below 10 meters is further positioned to 5 meters, and the AP located above 10 meters is positioned to 15 meters.
  • the horizontal position of the AP and the vertical height of the AP can determine the specific location of the AP.
  • the location information and the signal strength of the corresponding measurement points are obtained according to the found multiple AP fingerprints.
  • Gaussian distribution which determines the vertical height of the AP, so as to improve the accuracy of AP positioning.
  • FIG. 12 is a schematic structural diagram of a positioning AP device according to an embodiment of the present invention.
  • the apparatus for locating an AP may include: at least one processor 1201, such as a CPU, at least one network interface 1203, a memory 1204, and at least one communication bus 1202.
  • the communication bus 1202 is used to implement connection communication between these components.
  • the network interface 1203 of the device for locating the AP in the embodiment of the present invention may be a wireless interface, for example, including an antenna device, for performing signaling or data communication with other devices.
  • the memory 1204 may be a high speed RAM memory or a non-volatile memory such as at least one disk memory.
  • the memory 1204 can also optionally be at least one storage device located remotely from the aforementioned processor 1201.
  • the memory 1204 stores a set of program codes, and the processor is configured to call the program code stored in the memory, to perform the following operations: acquiring a pre-established AP fingerprint database, where the AP fingerprint database includes multiple acquired at multiple measurement points.
  • An AP fingerprint where the AP fingerprint includes location information of a corresponding measurement point, a MAC address of the AP, and a signal strength of the AP;
  • the storage medium may include: a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Position Fixing By Use Of Radio Waves (AREA)

Abstract

Embodiments of the present invention provide a method for locating an AP. The method comprises: acquiring a pre-established AP fingerprint library, wherein the AP fingerprint library comprises multiple AP fingerprints obtained at multiple measuring points, and each AP fingerprint comprises location information of the corresponding measuring point, a MAC address of the AP, and the signal strength of the AP; searching in the AP fingerprint library for multiple AP fingerprints that have the same MAC address as an AP to be located; calculating the gradient size and the gradient direction of each found AP fingerprint according to the location information of the corresponding measuring point and the signal strength of each found AP fingerprint; and determining the horizontal location of the AP according to the gradient size and the gradient direction of each AP fingerprint. The embodiments of the present invention also provide a device for locating an AP. By means of the present invention, the precision of AP locating can be improved.

Description

一种定位 AP的方法和装置 技术领域  Method and device for positioning AP
本发明涉及无线网络技术领域, 尤其涉及一种定位 AP的方法和装置。 背景技术  The present invention relates to the field of wireless network technologies, and in particular, to a method and apparatus for locating an AP. Background technique
目前, WLAN ( Wireless Local Area Networks, 无线局域网络) 大多部署 在 2.4GHz频段, 其网络覆盖半径最大在 70米左右。 若用户终端能够接收到 某一位置确定的 AP ( Access Point, 接入点) 信号, 则接收到该 AP信号的用 户终端一定在以此 AP为圓心, 70米为半径的圓内, 然后通过综合接收到多个 其他 AP信号, 最终可以定位到用户的位置。 由于 WLAN网络覆盖范围小, 该方法的定位精度要高于基站定位。 但是在实际情况下, 大多数 AP的部署位 置并没有公开且非常随意。 因此, 如何获取 AP位置成为了需要解决的问题。  Currently, WLANs (Wireless Local Area Networks) are mostly deployed in the 2.4 GHz band, with a network coverage radius of up to 70 meters. If the user terminal can receive the AP (Access Point) signal determined by a certain location, the user terminal that receives the AP signal must be in the circle with the AP as the center and 70 meters as the radius, and then through the synthesis. Multiple other AP signals are received, and finally the user's location can be located. Due to the small coverage of the WLAN network, the positioning accuracy of the method is higher than that of the base station. However, in actual situations, the deployment location of most APs is not public and very random. Therefore, how to obtain the AP location becomes a problem that needs to be solved.
在现有技术方案中, 提出了一种反向定位 AP的方法, 该方法主要釆用基 于传播模型的三角定位算法, 通过具有 WLAN功能的终端(手机, 平板电脑, 笔记本电脑等)测量 WLAN信号强度值, 然后对 WLAN信号强度值进行三角 定位算法分析得到 AP位置。但是,三角定位算法最初只是应用于 GPS ( Global Positioning System,全球定位系统)定位和基站定位中, 即用于室外定位场景。 由于无线信号在室内的传播完全不同于室外的传播情况,室内墙壁的阻挡和不 同的建筑材料都会造成复杂的多径效应与衰落情况。 因此, 三角定位法对于室 内 AP定位的精确度不够高。 发明内容  In the prior art solution, a method for relocating an AP is proposed, which mainly uses a triangulation algorithm based on a propagation model to measure a WLAN signal through a terminal (mobile phone, tablet, notebook computer, etc.) having a WLAN function. The intensity value is then analyzed by triangulation algorithm for the WLAN signal strength value to obtain the AP position. However, the triangulation algorithm was originally applied only to GPS (Global Positioning System) positioning and base station positioning, that is, for outdoor positioning scenes. Since the propagation of wireless signals indoors is completely different from the outdoor propagation, the blockage of indoor walls and different building materials can cause complex multipath effects and fading. Therefore, the triangulation method is not accurate enough for indoor AP positioning. Summary of the invention
本发明提供了一种定位 AP的方法和装置, 可以提高 AP定位的精确度。 本发明实施例第一方面提供了一种定位 AP的方法, 包括:  The present invention provides a method and apparatus for locating an AP, which can improve the accuracy of AP positioning. A first aspect of the embodiments of the present invention provides a method for locating an AP, including:
获取预先建立的 AP指纹库, 所述 AP指纹库包括在多个测量点获取到的 多条 AP指纹, 所述 AP指纹包括对应测量点的位置信息、 AP的 MAC地址以 及该 AP的信号强度;  Obtaining a pre-established AP fingerprint database, where the AP fingerprint database includes a plurality of AP fingerprints acquired at a plurality of measurement points, where the AP fingerprint includes location information of the corresponding measurement point, a MAC address of the AP, and a signal strength of the AP;
从所述 AP指纹库中查找与待定位的 AP的 MAC地址相同的多条 AP指纹; 根据查找到的所述多条 AP指纹对应测量点的位置信息以及信号强度, 计 算查找到的各条 AP指纹的梯度大小和梯度方向; Finding, by the AP fingerprint database, a plurality of AP fingerprints that are the same as the MAC address of the AP to be located; Calculating a gradient size and a gradient direction of each of the found AP fingerprints according to the found location information of the plurality of AP fingerprints corresponding to the measurement points and the signal strength;
根据所述各条 AP指纹的梯度大小和梯度方向,确定所述 AP的水平位置。 在第一方面的第一种可能的实现方式中,所述指纹库还包括垂直高度确定 的其他 AP对应 AP指纹, 所述方法还包括:  And determining a horizontal position of the AP according to a gradient size and a gradient direction of each of the AP fingerprints. In a first possible implementation manner of the first aspect, the fingerprint database further includes another AP corresponding to the AP fingerprint determined by the vertical height, and the method further includes:
从所述 AP指纹库中统计出垂直高度确定的其他 AP的信号强度的高斯分 布;  Calculating a Gaussian distribution of signal strengths of other APs determined by the vertical height from the AP fingerprint database;
根据查找到的所述多条 AP指纹的信号强度, 计算查找到的所述多条 AP 指纹的信号强度的均值;  Calculating, according to the signal strengths of the plurality of AP fingerprints, the average value of the signal strengths of the plurality of AP fingerprints that are found;
根据查找到所述多条 AP指纹的信号强度的均值以及所述垂直高度确定的 其他 AP的信号强度的高斯分布, 确定所述 AP的垂直高度。  And determining a vertical height of the AP according to a mean value of the signal strengths of the plurality of AP fingerprints and a Gaussian distribution of signal strengths of the other APs determined by the vertical height.
在第一方面的第二种可能的实现方式中, 所述根据查找到的所述多条 AP 指纹对应测量点的位置信息以及信号强度, 计算查找到的各条 AP指纹的梯度 大小和梯度方向包括:  In a second possible implementation manner of the first aspect, the determining, according to the location information and the signal strength of the plurality of AP fingerprint corresponding measurement points, the gradient size and the gradient direction of the searched AP fingerprints Includes:
根据查找到的各条 AP指纹对应测量点的位置信息, 计算所述各条 AP指 纹对应测量点之间的间 巨;  Calculating, according to the location information of each AP fingerprint corresponding to the measurement point, the inter-macro between the measurement points of the AP fingerprints;
根据所述各条 AP指纹对应测量点之间的间距, 从查找到的所述多条 AP 指纹中查找目标 AP指纹对应测量点的邻近 AP指纹;  And searching, according to the spacing between the measurement points of the AP fingerprints, the neighboring AP fingerprints corresponding to the measurement points of the target AP fingerprints from the plurality of AP fingerprints that are found;
根据所述目标 AP指纹对应测量点的位置信息以及所述邻近 AP指纹对应 测量点的位置信息, 计算所述目标 AP指纹对应测量点到所述邻近 AP指纹对 应测量点的方向, 并根据所述目标 AP指纹的信号强度以及所述邻近 AP指纹 的信号强度, 计算所述目标 AP指纹与所述邻近 AP指纹的信号强度差;  Calculating, according to the location information of the target AP fingerprint corresponding measurement point and the location information of the neighboring AP fingerprint corresponding measurement point, a direction of the target AP fingerprint corresponding measurement point to the neighboring AP fingerprint corresponding measurement point, and according to the a signal strength of the target AP fingerprint and a signal strength of the neighboring AP fingerprint, and calculating a signal strength difference between the target AP fingerprint and the neighboring AP fingerprint;
根据所述目标 AP指纹与所述邻近 AP指纹的信号强度差, 确定所述目标 AP指纹的梯度大小,并根据所述目标 AP指纹对应测量点到所述邻近 AP指纹 对应测量点的方向, 确定所述目标 AP指纹的梯度方向。  Determining, according to a signal strength difference between the target AP fingerprint and the neighboring AP fingerprint, a gradient size of the target AP fingerprint, and determining, according to the direction of the target AP fingerprint corresponding measurement point to the neighboring AP fingerprint corresponding measurement point, The gradient direction of the target AP fingerprint.
结合第一方面的第二种可能的实现方式,在第一方面的第三种可能的实现 方式中, 所述邻近 AP指纹包括距离所述目标 AP指纹对应测量点最近的预设 数目的 AP指纹, 所述根据所述目标 AP指纹与所述邻近 AP指纹的信号强度 差, 确定所述目标 AP指纹的梯度大小, 并根据所述目标 AP指纹对应测量点 到所述邻近 AP指纹对应测量点的方向, 确定所述目标 AP指纹的梯度方向包 括: In conjunction with the second possible implementation of the first aspect, in a third possible implementation manner of the first aspect, the neighboring AP fingerprint includes a preset number of AP fingerprints that are closest to the measurement point corresponding to the target AP fingerprint. Determining, according to a signal strength difference between the target AP fingerprint and the neighboring AP fingerprint, a gradient size of the target AP fingerprint, and corresponding a measurement point according to the target AP fingerprint. Determining a gradient direction of the target AP fingerprint to the direction of the neighboring AP fingerprint corresponding measurement point includes:
将位于所述目标 AP指纹对应测量点相同方向上的所有邻近 AP指纹的信 号强度差求和得到所述目标 AP指纹对应测量点在该方向上的信号强度差; 比较位于所述目标 AP指纹对应测量点不同方向上的信号强度差, 将所述 最大的信号强度差作为所述目标 AP指纹的梯度大小, 并将该信号强度差所在 的方向作为所述目标 AP指纹的梯度方向。  And summing signal strength differences of all neighboring AP fingerprints in the same direction of the target AP fingerprint corresponding to the measurement point to obtain a signal strength difference of the target AP fingerprint corresponding measurement point in the direction; comparing the fingerprints corresponding to the target AP fingerprints Measuring a signal strength difference in different directions, using the maximum signal strength difference as a gradient of the target AP fingerprint, and using the direction of the signal strength difference as a gradient direction of the target AP fingerprint.
结合第一方面的第二种的可能实现方式,在第一方面的第四种可能的实现 方式中, 所述根据所述目标 AP指纹对应测量点的位置信息以及所述邻近 AP 指纹对应测量点的位置信息, 计算所述目标 AP指纹对应测量点到所述邻近 AP指纹对应测量点的方向包括:  With reference to the second possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, the location information corresponding to the measurement point according to the target AP fingerprint and the neighboring AP fingerprint corresponding measurement point The location information, the direction of the target AP fingerprint corresponding measurement point to the neighboring AP fingerprint corresponding measurement point is calculated:
将角度为 2π的圓周空间划分为多个量化区间, 每个量化区间分别对应一 个量化方向;  Dividing a circular space having an angle of 2π into a plurality of quantization intervals, each of which corresponds to a quantization direction;
确定所述目标 ΑΡ指纹对应测量点到所述邻近 ΑΡ指纹对应测量点的方向 所位于的量化区间;  Determining, in the quantization interval in which the target ΑΡ fingerprint corresponds to a direction in which the measurement point to the adjacent ΑΡ fingerprint corresponds to the measurement point;
居确定的所述目标 ΑΡ指纹对应测量点到所述邻近 ΑΡ指纹对应测量点 的方向所位于的量化区间, 将所述目标 ΑΡ指纹对应测量点到所述邻近 ΑΡ指 纹对应测量点的方向处理得到一个量化方向;  Determining the target ΑΡ fingerprint corresponding to the quantization interval in which the direction of the measurement point to the adjacent ΑΡ fingerprint corresponding measurement point is located, and processing the target ΑΡ fingerprint corresponding measurement point to the direction corresponding to the measurement point of the adjacent ΑΡ fingerprint a quantitative direction;
所述 居所述目标 ΑΡ指纹对应测量点到所述邻近 ΑΡ指纹对应测量点的 方向, 确定所述目标 ΑΡ指纹的梯度方向包括:  The target ΑΡ fingerprint corresponds to the direction of the measurement point to the adjacent ΑΡ fingerprint corresponding measurement point, and determining the gradient direction of the target ΑΡ fingerprint includes:
根据所述目标 ΑΡ指纹对应测量点到所述邻近 ΑΡ指纹对应测量点的所述 量化方向, 确定所述目标 ΑΡ指纹的梯度方向。  And determining a gradient direction of the target ΑΡ fingerprint according to the quantization direction of the target ΑΡ fingerprint corresponding measurement point to the adjacent ΑΡ fingerprint corresponding measurement point.
结合第一方面的第二种可能的实现方式,在第一方面的第五种可能的实现 方式中, 所述根据查找到的所述各条 ΑΡ指纹的梯度大小和梯度方向, 确定所 述 ΑΡ的水平位置包括:  With reference to the second possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, the determining, according to the obtained gradient size and the gradient direction of each of the fingerprints, The horizontal position includes:
根据所述各条 ΑΡ指纹对应测量点之间的间距, 将查找到的所述多条 ΑΡ 指纹划分为多个聚类;  And dividing the plurality of fingerprints that are found into a plurality of clusters according to the spacing between the measurement points corresponding to the fingerprints;
根据各个聚类中各条 ΑΡ指纹的梯度大小、 梯度方向以及各条 ΑΡ指纹对 应测量点的位置信息, 确定各个聚类中类首的梯度方向和参考位置; 根据所述各个聚类中类首的梯度方向和参考位置, 确定所述 AP的水平位 置。 Determining the gradient direction and the reference position of the head of each cluster according to the gradient size of each fingerprint in the respective clusters, the gradient direction, and the position information of the measurement points corresponding to each of the fingerprints; Determining a horizontal position of the AP according to a gradient direction and a reference position of the class leader in each of the clusters.
结合第一方面的第五种可能的实现方式,在第一方面的第六种可能的实现 方式中, 所述根据各个聚类中各条 AP指纹的梯度大小、 梯度方向以及各条 AP指纹对应测量点的位置信息, 确定各个聚类中类首的梯度方向和参考位置 包括:  With reference to the fifth possible implementation manner of the first aspect, in a sixth possible implementation manner of the first aspect, the step, the gradient direction, and the corresponding AP fingerprints of each AP fingerprint in each cluster are corresponding to Measuring the position information of the points, determining the gradient direction and the reference position of the class head in each cluster include:
将所述各个类聚中梯度大小为最大的 AP指纹的梯度方向作为所述各个聚 类中类首的梯度方向。  The gradient direction of the AP fingerprint having the largest gradient size in each of the clusters is used as the gradient direction of the first class in the respective clusters.
结合第一方面的第六种可能的实现方式,在第一方面的第七种可能的实现 方式中, 所述根据所述各个聚类中类首的梯度方向和参考位置, 确定所述 AP 的水平位置包括:  With reference to the sixth possible implementation manner of the first aspect, in a seventh possible implementation manner of the first aspect, the determining, according to the gradient direction and the reference position of the class head in each of the clusters, determining the AP The horizontal position includes:
若所述各个聚类中类首的梯度方向上交于一点, 则将交点作为所述 AP的 水平位置。  If the gradient direction of the class leader in the respective clusters intersects at a point, the intersection point is taken as the horizontal position of the AP.
结合第一方面的第六种可能的实现方式,在第一方面的第八种可能的实现 方式中, 所述根据所述各个聚类中类首的梯度方向和参考位置, 确定所述 AP 的水平位置还包括:  With reference to the sixth possible implementation manner of the first aspect, in an eighth possible implementation manner of the first aspect, the determining, according to the gradient direction and the reference position of the class head in each of the clusters, determining the AP The horizontal position also includes:
若所述各个聚类中类首的梯度方向上交于多个点,则确定所述各个聚类中 类首的梯度方向上的交叉区域;  If the gradient direction of the class leader in the respective clusters intersects at a plurality of points, determining an intersection region in a gradient direction of the class leader in each of the clusters;
在所述交叉区域中确定一点作为所述 AP的水平位置, 所述各个聚类中类 首的参考位置到该点的方向与所述各个聚类中类首的梯度方向的夹角之和最 小。  Determining a point in the intersection area as a horizontal position of the AP, wherein a sum of a reference position of the head of the cluster to the point of the point and a gradient direction of the head of the cluster in each cluster is the smallest .
结合第一方面的第一种可能的实现方式,在第一方面的第九种可能的实现 方式中, 所述从所述 AP指纹库中统计出垂直高度确定的其他 AP的信号强度 的高斯分布包括:  In conjunction with the first possible implementation of the first aspect, in a ninth possible implementation manner of the first aspect, the Gaussian distribution of signal strengths of other APs determined by the vertical height is calculated from the AP fingerprint database Includes:
从所述 AP指纹库中统计出在 AP的垂直高度高于第一预设高度时信号强 度的高斯分布以及在 AP的垂直高度低于第一预设高度位置时信号强度的高斯 分布;  Calculating a Gaussian distribution of signal strength when the vertical height of the AP is higher than the first preset height from the AP fingerprint database and a Gaussian distribution of signal strength when the vertical height of the AP is lower than the first preset height position;
所述根据所述多条 AP指纹的信号强度的均值以及垂直高度确定的其他 AP的信号强度的高斯分布, 确定所述 AP的垂直高度包括: 根据所述在 AP的垂直高度高于第一预设高度时信号强度的高斯分布以及 所述在 AP的垂直高度低于第一预设高度时信号强度的高斯分布, 计算在 AP 的垂直高度等于第一预设高度时信号强度阔值; Determining, according to a mean value of signal strengths of the plurality of AP fingerprints and a Gaussian distribution of signal strengths of other APs determined by a vertical height, determining a vertical height of the AP includes: Calculating the Gaussian distribution of the signal strength when the vertical height of the AP is higher than the first preset height and the Gaussian distribution of the signal strength when the vertical height of the AP is lower than the first preset height, and calculating the vertical height at the AP is equal to Signal strength threshold at the first preset height;
对所述多条 AP指纹的信息强度的均值和所述在 AP的垂直高度等于第一 预设高度时信号强度阈值进行比较;  Comparing an average of information strengths of the plurality of AP fingerprints with a signal strength threshold when the vertical height of the AP is equal to the first preset height;
根据所述多条 AP指纹的信息强度的均值和所述在 AP的垂直高度等于第 一预设高度时信号强度阔值的比较结果, 确定所述 AP的垂直高度。  And determining a vertical height of the AP according to a comparison between an average of information strengths of the plurality of AP fingerprints and a comparison of the signal strength thresholds when the vertical height of the AP is equal to the first preset height.
结合第一方面的第九种可能的实现方式,在第一方面的第十种可能的实现 方式中, 所述根据所述多条 AP指纹的信息强度的均值和所述在 AP的垂直高 度等于第一预设高度时信号强度阔值的比较结果, 确定所述 AP的垂直高度包 括:  With reference to the ninth possible implementation manner of the first aspect, in a tenth possible implementation manner of the first aspect, the average value of the information strength according to the multiple pieces of AP fingerprints and the vertical height of the AP are equal to The comparison result of the signal intensity threshold at the first preset height determines that the vertical height of the AP includes:
若所述多条 AP指纹的信息强度的均值等于所述在 AP的垂直高度等于第 一预设高度时信号强度阔值, 则所述 AP的垂直高度为第一预设高度;  If the average value of the information strength of the plurality of AP fingerprints is equal to the signal strength threshold when the vertical height of the AP is equal to the first preset height, the vertical height of the AP is a first preset height;
若所述多条 AP指纹的信息强度的均值大于所述在 AP的垂直高度等于第 一预设高度时信号强度阔值, 则所述 AP的垂直高度为第二预设高度;  If the average value of the information strength of the plurality of AP fingerprints is greater than the signal strength threshold when the vertical height of the AP is equal to the first preset height, the vertical height of the AP is a second preset height;
若所述多条 AP指纹的信息强度的均值小于所述在 AP的垂直高度等于第 一预设高度时信号强度阔值, 则所述 AP的垂直高度为第三预设高度。  And if the average value of the information strengths of the plurality of AP fingerprints is smaller than the signal strength threshold when the vertical height of the AP is equal to the first preset height, the vertical height of the AP is a third preset height.
本发明实施例第二方面提供了一种定位 AP的装置, 包括:  A second aspect of the embodiments of the present invention provides an apparatus for locating an AP, including:
信息获取模块, 用于获取预先建立的 AP指纹库, 所述 AP指纹库包括在 多个测量点获取到的多条 AP指纹,所述 AP指纹包括对应测量点的位置信息、 AP的 MAC地址以及该 AP的信号强度;  An information obtaining module, configured to acquire a pre-established AP fingerprint database, where the AP fingerprint database includes a plurality of AP fingerprints acquired at a plurality of measurement points, where the AP fingerprint includes location information of a corresponding measurement point, a MAC address of the AP, and The signal strength of the AP;
信息查找模块, 用于从所述 AP指纹库中查找与待定位的 AP的 MAC地 址相同的多条 AP指纹;  An information finding module, configured to search, by using the AP fingerprint database, a plurality of AP fingerprints that are the same as the MAC address of the AP to be located;
信息计算模块, 用于根据查找到的所述多条 AP指纹对应测量点的位置信 息以及信号强度, 计算查找到的各条 AP指纹的梯度大小和梯度方向;  An information calculation module, configured to calculate a gradient size and a gradient direction of each AP fingerprint that is found according to the found location information of the multiple AP fingerprint corresponding measurement points and the signal strength;
位置确定模块, 用于根据所述各条 AP指纹的梯度大小和梯度方向, 确定 所述 AP的水平位置。  And a location determining module, configured to determine a horizontal location of the AP according to a gradient size and a gradient direction of each of the AP fingerprints.
在第二方面的第一种可能的实现方式中,所述指纹库还包括垂直高度确定 的其他 AP对应 AP指纹, 所述终端还包括: 信号统计模块, 用于从所述 AP指纹库中统计出垂直高度确定的其他 AP 的信号强度的高斯分布; In a first possible implementation manner of the second aspect, the fingerprint database further includes another AP corresponding to the AP fingerprint determined by the vertical height, and the terminal further includes: a signal statistics module, configured to calculate a Gaussian distribution of signal strengths of other APs determined by the vertical height from the AP fingerprint database;
均值计算模块, 用于根据查找到的所述多条 AP指纹的信号强度, 计算查 找到的所述多条 AP指纹的信号强度的均值;  And a mean value calculation module, configured to calculate, according to the found signal strengths of the plurality of AP fingerprints, an average value of the signal strengths of the plurality of AP fingerprints found;
高度确定模块, 用于根据查找到所述多条 AP指纹的信号强度的均值以及 所述垂直高度确定的其他 AP的信号强度的高斯分布, 确定所述 AP的垂直高 度。  And a height determining module, configured to determine a vertical height of the AP according to a mean value of the signal strengths of the plurality of AP fingerprints and a Gaussian distribution of signal strengths of other APs determined by the vertical height.
在第二方面的第二种可能的实现方式中, 所述信息计算模块包括: 指纹间距计算单元, 用于根据查找到的各条 AP指纹对应测量点的位置信 息, 计算所述各条 AP指纹对应测量点之间的间距;  In a second possible implementation manner of the second aspect, the information calculation module includes: a fingerprint spacing calculation unit, configured to calculate, according to the found location information of each AP fingerprint corresponding to the measurement point, the AP fingerprints Corresponding to the spacing between measurement points;
邻近指纹查找单元, 用于根据所述各条 AP指纹对应测量点之间的间距, 从查找到的所述多条 AP指纹中查找目标 AP指纹对应测量点的邻近 AP指纹; 指纹信息计算单元, 用于根据所述目标 AP指纹对应测量点的位置信息以 及所述邻近 AP指纹对应测量点的位置信息, 计算所述目标 AP指纹对应测量 点到所述邻近 AP指纹对应测量点的方向, 并才艮据所述目标 AP指纹的信号强 度以及所述邻近 AP指纹的信号强度, 计算所述目标 AP指纹与所述邻近 AP 指纹的信号强度差;  The proximity fingerprint searching unit is configured to search for a neighboring AP fingerprint corresponding to the measurement point of the target AP fingerprint from the plurality of AP fingerprints that are found according to the spacing between the measurement points of the respective AP fingerprints; the fingerprint information calculation unit, And calculating, according to the location information of the target AP fingerprint corresponding measurement point and the location information of the neighboring AP fingerprint corresponding measurement point, the direction of the target AP fingerprint corresponding measurement point to the neighboring AP fingerprint corresponding measurement point, and Calculating a signal strength difference between the target AP fingerprint and the neighboring AP fingerprint according to the signal strength of the target AP fingerprint and the signal strength of the neighboring AP fingerprint;
指纹参数计算单元, 用于根据所述目标 AP指纹与所述邻近 AP指纹的信 号强度差, 确定所述目标 AP指纹的梯度大小, 并根据所述目标 AP指纹对应 测量点到所述邻近 AP指纹对应测量点的方向, 确定所述目标 AP指纹的梯度 方向。  a fingerprint parameter calculation unit, configured to determine a gradient size of the target AP fingerprint according to a signal strength difference between the target AP fingerprint and the neighboring AP fingerprint, and correspondingly measure a point to the neighboring AP fingerprint according to the target AP fingerprint Corresponding to the direction of the measurement point, the gradient direction of the target AP fingerprint is determined.
结合第二方面第二种可能的实现方式,在第二方面的第三种可能的实现方 式中, 所述邻近 AP指纹包括距离所述目标 AP指纹对应测量点最近的预设数 目的 AP指纹,  With reference to the second possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, the neighboring AP fingerprint includes a preset number of AP fingerprints that are closest to the measurement point corresponding to the target AP fingerprint,
所述指纹参数计算单元, 具体用于将位于所述目标 AP指纹对应测量点相 同方向上的所有邻近 AP指纹的信号强度差求和得到所述目标 AP指纹对应测 量点在该方向上的信号强度差; 比较位于所述目标 AP指纹对应测量点不同方 向上的信号强度差, 将所述最大的信号强度差作为所述目标 AP指纹的梯度大 小, 并将该信号强度差所在的方向作为所述目标 AP指纹的梯度方向。 结合第二方面第二种可能的实现方式,在第二方面的第四种可能的实现方 式中, The fingerprint parameter calculation unit is specifically configured to obtain a signal strength difference of all neighboring AP fingerprints in the same direction of the target AP fingerprint corresponding to the measurement point, and obtain a signal strength of the target AP fingerprint corresponding measurement point in the direction. Comparing a signal strength difference in different directions of the target AP fingerprint corresponding to the measurement point, using the maximum signal strength difference as the gradient size of the target AP fingerprint, and using the direction of the signal strength difference as the The gradient direction of the target AP fingerprint. In conjunction with the second possible implementation of the second aspect, in a fourth possible implementation of the second aspect,
所述指纹信息计算单元, 还用于将角度为 2π的圓周空间划分为多个量化 区间, 每个量化区间分别对应一个量化方向; 确定所述目标 ΑΡ指纹对应测量 点到所述邻近 ΑΡ指纹对应测量点的方向所位于的量化区间; 才艮据确定的所述 目标 ΑΡ指纹对应测量点到所述邻近 ΑΡ指纹对应测量点的方向所位于的量化 区间, 将所述目标 ΑΡ指纹对应测量点到所述邻近 ΑΡ指纹对应测量点的方向 处理得到一个量化方向;  The fingerprint information calculation unit is further configured to divide a circular space with an angle of 2π into a plurality of quantization intervals, each of the quantization intervals respectively corresponding to one quantization direction; and determining that the target ΑΡ fingerprint corresponding measurement point corresponds to the adjacent ΑΡ fingerprint a quantization interval in which the direction of the measurement point is located; wherein the target ΑΡ fingerprint corresponds to the quantization interval in which the measurement point is located in the direction corresponding to the measurement point of the adjacent ΑΡ fingerprint, and the target ΑΡ fingerprint corresponds to the measurement point The adjacent ΑΡ fingerprint corresponds to the direction of the measurement point to obtain a quantization direction;
所述指纹参数计算单元, 还用于根据所述目标 ΑΡ指纹对应测量点到所述 邻近 ΑΡ指纹对应测量点的所述量化方向,确定所述目标 ΑΡ指纹的梯度方向。  The fingerprint parameter calculation unit is further configured to determine a gradient direction of the target ΑΡ fingerprint according to the quantization direction of the target ΑΡ fingerprint corresponding measurement point to the adjacent ΑΡ fingerprint corresponding measurement point.
结合第二方面第二种可能的实现方式,在第二方面的第五种可能的实现方 式中, 所述位置确定模块包括:  With reference to the second possible implementation of the second aspect, in a fifth possible implementation manner of the second aspect, the location determining module includes:
聚类划分单元, 用于根据所述各条 ΑΡ指纹对应测量点之间的间距, 将查 找到的所述多条 ΑΡ指纹划分为多个聚类;  a clustering unit, configured to divide the plurality of fingerprints found by the fingerprints into a plurality of clusters according to a spacing between the measurement points corresponding to the fingerprints;
类首信息确定单元, 用于根据各个聚类中各条 ΑΡ指纹的梯度大小、 梯度 方向以及各条 ΑΡ指纹对应测量点的位置信息, 确定各个聚类中类首的梯度方 向和参考位置;  The class header information determining unit is configured to determine a gradient direction and a reference position of the class head in each cluster according to the gradient size of each fingerprint in the respective clusters, the gradient direction, and the position information of the measurement points corresponding to the respective fingerprints;
水平位置确定单元, 用于根据所述各个聚类中类首的梯度方向和参考位 置, 确定所述 ΑΡ的水平位置。  And a horizontal position determining unit, configured to determine a horizontal position of the ΑΡ according to a gradient direction and a reference position of the class head in the respective clusters.
结合第二方面第五种可能的实现方式,在第二方面的第六种可能的实现方 式中, 所述类首信息确定单元, 具体用于将所述各个类聚中梯度大小为最大的 ΑΡ指纹的梯度方向作为所述各个聚类中类首的梯度方向。  With reference to the fifth possible implementation manner of the second aspect, in a sixth possible implementation manner of the second aspect, the class header information determining unit is specifically configured to: The gradient direction of the fingerprint is used as the gradient direction of the first class in the respective clusters.
结合第二方面第六种可能的实现方式,在第二方面的第七种可能的实现方 式中, 所述水平位置确定单元, 具体用于若所述各个聚类中类首的梯度方向上 交于一点, 则将交点作为所述 ΑΡ的水平位置。  With reference to the sixth possible implementation manner of the second aspect, in the seventh possible implementation manner of the second aspect, the horizontal position determining unit is specifically configured to: if the gradient direction of the class head in the each cluster is intersected At one point, the intersection point is taken as the horizontal position of the crucible.
结合第二方面第六种可能的实现方式,在第二方面的第八种可能的实现方 式中, 所述水平位置确定单元, 具体用于若所述各个聚类中类首的梯度方向上 交于多个点, 则确定所述各个聚类中类首的梯度方向上的交叉区域; 在所述交 叉区域中确定一点作为所述 ΑΡ的水平位置, 所述各个聚类中类首的参考位置 到该点的方向与所述各个聚类中类首的梯度方向的夹角之和最小。 结合第二方面第一种可能的实现方式,在第二方面的第九种可能的实现方 式中, 所述信号统计模块, 具体用于从所述 AP指纹库中统计出在 AP的垂直 高度高于第一预设高度时信号强度的高斯分布以及在 AP的垂直高度低于第一 预设高度位置时信号强度的高斯分布; With reference to the sixth possible implementation manner of the second aspect, in the eighth possible implementation manner of the second aspect, the horizontal position determining unit is specifically configured to: if the gradient direction of the class head in the respective clusters is intersected And determining, at a plurality of points, an intersection region in a gradient direction of the class leader in each of the clusters; determining a point in the intersection region as a horizontal position of the ΑΡ, a reference position of the class leader in each cluster The sum of the direction to the point and the angle of the gradient direction of the head of each cluster is the smallest. With reference to the first possible implementation manner of the second aspect, in a ninth possible implementation manner of the second aspect, the signal statistics module is specifically configured to calculate, from the AP fingerprint database, a vertical height of the AP a Gaussian distribution of signal intensity at a first predetermined height and a Gaussian distribution of signal strength when the vertical height of the AP is lower than the first predetermined height position;
所述高度确定模块包括:  The height determination module includes:
阔值计算单元, 用于根据所述在 AP的垂直高度高于第一预设高度时信号 强度的高斯分布以及所述在 AP的垂直高度低于第一预设高度时信号强度的高 斯分布, 计算在 AP的垂直高度等于第一预设高度时信号强度阔值;  a threshold value calculation unit, configured to: according to the Gaussian distribution of the signal strength when the vertical height of the AP is higher than the first preset height, and the Gaussian distribution of the signal strength when the vertical height of the AP is lower than the first preset height, Calculating a signal strength threshold when the vertical height of the AP is equal to the first preset height;
阔值比较单元, 用于对所述多条 AP指纹的信息强度的均值和所述在 AP 的垂直高度等于第一预设高度时信号强度阔值进行比较;  a threshold value comparison unit, configured to compare an average value of information strengths of the plurality of AP fingerprints with a signal strength threshold value when the vertical height of the AP is equal to the first preset height;
高度确定单元, 用于根据所述多条 AP指纹的信息强度的均值和所述在 AP 的垂直高度等于第一预设高度时信号强度阔值的比较结果, 确定所述 AP 的垂直高度。  And a height determining unit, configured to determine a vertical height of the AP according to a comparison between an average value of information strengths of the plurality of AP fingerprints and a signal strength threshold value when the vertical height of the AP is equal to the first preset height.
结合第二方面第九种可能的实现方式,在第二方面的第十种可能的实现方 式中, 所述高度确定单元, 具体用于若所述多条 AP指纹的信息强度的均值等 于所述在 AP的垂直高度等于第一预设高度时信号强度阔值, 则所述 AP的垂 直高度为第一预设高度; 若所述多条 AP指纹的信息强度的均值大于所述在 AP的垂直高度等于第一预设高度时信号强度阔值, 则所述 AP的垂直高度为 第二预设高度; 若所述多条 AP指纹的信息强度的均值小于所述在 AP的垂直 高度等于第一预设高度时信号强度阔值, 则所述 AP的垂直高度为第三预设高 度。  With reference to the ninth possible implementation of the second aspect, in a tenth possible implementation manner of the second aspect, the height determining unit is specifically configured to: if an average value of information strengths of the multiple pieces of AP fingerprints is equal to When the vertical height of the AP is equal to the first preset height, the vertical height of the AP is the first preset height; if the average of the information strengths of the multiple AP fingerprints is greater than the vertical of the AP The height of the signal is equal to the first preset height, and the vertical height of the AP is the second preset height; if the average of the information strengths of the plurality of AP fingerprints is smaller than the vertical height of the AP is equal to the first When the signal strength is preset at a height, the vertical height of the AP is a third preset height.
本发明实施例第三方面提供了一种定位 AP装置, 所述定位 AP装置包括网 络接口、 存储器以及处理器, 其中, 存储器中存储一组程序代码, 且处理器用 于调用存储器中存储的程序代码, 用于执行以下操作:  A third aspect of the embodiments of the present invention provides a positioning AP device, where the positioning AP device includes a network interface, a memory, and a processor, wherein the memory stores a set of program codes, and the processor is configured to call the program code stored in the memory. , to do the following:
获取预先建立的 AP指纹库, 所述 AP指纹库包括在多个测量点获取到的 多条 AP指纹, 所述 AP指纹包括对应测量点的位置信息、 AP的 MAC地址以 及该 AP的信号强度;  Obtaining a pre-established AP fingerprint database, where the AP fingerprint database includes a plurality of AP fingerprints acquired at a plurality of measurement points, where the AP fingerprint includes location information of the corresponding measurement point, a MAC address of the AP, and a signal strength of the AP;
从所述 AP指纹库中查找与待定位的 AP的 MAC地址相同的多条 AP指纹; 根据查找到的所述多条 AP指纹对应测量点的位置信息以及信号强度, 计 算查找到的各条 AP指纹的梯度大小和梯度方向; Finding, by the AP fingerprint database, a plurality of AP fingerprints that are the same as the MAC address of the AP to be located; Calculating a gradient size and a gradient direction of each of the found AP fingerprints according to the found location information of the plurality of AP fingerprints corresponding to the measurement points and the signal strength;
根据所述各条 AP指纹的梯度大小和梯度方向,确定所述 AP的水平位置。 实施本发明实施例, 针对现有技术中三角定位算法对于室内 AP定位的精 确度不够高的问题, 通过从预先建立的 AP指纹库中查找与待定位的 AP 的 MAC地址相同的多条 AP指纹,从而根据查找到的多条 AP指纹对应测量点的 位置信息以及信号强度, 计算查找到的各条 AP指纹的梯度大小和梯度方向; 最后根据所述各条 AP指纹的梯度大小和梯度方向,确定所述 AP的水平位置, 同时可以根据查找到多条 AP指纹的信号强度的均值以及垂直高度确定的其他 AP的信号强度的高斯分布,确定 AP的垂直高度,从而达到提高 AP定位的精 确度的目的。 附图说明  And determining a horizontal position of the AP according to a gradient size and a gradient direction of each of the AP fingerprints. The embodiment of the present invention implements the problem that the accuracy of the indoor AP positioning is not high enough in the prior art, and the plurality of AP fingerprints that are the same as the MAC address of the AP to be located are searched from the pre-established AP fingerprint database. Therefore, according to the position information and the signal strength of the plurality of AP fingerprint corresponding measurement points, the gradient size and the gradient direction of the searched AP fingerprints are calculated; finally, according to the gradient size and the gradient direction of the respective AP fingerprints, Determining the horizontal position of the AP, and determining the vertical height of the AP according to the mean value of the signal strength of the plurality of AP fingerprints and the Gaussian distribution of the signal strengths of other APs determined by the vertical height, thereby improving the accuracy of the AP positioning. the goal of. DRAWINGS
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例中所需要 使用的附图作简单地介绍,显而易见地, 下面描述中的附图仅仅是本发明的一 些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动性的前提下, 还可以根据这些附图获得其他的附图。  In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings to be used in the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention, Those skilled in the art can also obtain other drawings based on these drawings without paying creative labor.
图 1是本发明第一实施例提出的一种定位 AP的方法的流程图;  1 is a flowchart of a method for locating an AP according to a first embodiment of the present invention;
图 2是本发明第二实施例提出的一种定位 AP的方法的流程图;  2 is a flowchart of a method for locating an AP according to a second embodiment of the present invention;
图 3是本发明第三实施例提出的一种定位 AP的方法的流程图;  3 is a flowchart of a method for locating an AP according to a third embodiment of the present invention;
图 4是本发明第四实施例提出的一种定位 AP的方法的流程图;  4 is a flowchart of a method for locating an AP according to a fourth embodiment of the present invention;
图 5是本发明实施例提出的一种聚类划分方法的示意图;  FIG. 5 is a schematic diagram of a clustering method according to an embodiment of the present invention; FIG.
图 6是本发明实施例提出的一种确定 AP水平位置的示意图;  6 is a schematic diagram of determining a horizontal position of an AP according to an embodiment of the present invention;
图 7是本发明实施例提出的另一种确定 AP水平位置的示意图;  FIG. 7 is a schematic diagram of another determining a horizontal position of an AP according to an embodiment of the present invention; FIG.
图 8是本发明第四实施例提出的一种定位 AP的装置的结构示意图; 图 9是本发明实施例提出的定位 AP的装置中的信息计算模块的结构示意 图;  FIG. 8 is a schematic structural diagram of an apparatus for locating an AP according to a fourth embodiment of the present invention; FIG. 9 is a schematic structural diagram of an information calculation module in an apparatus for locating an AP according to an embodiment of the present invention;
图 10是本发明实施例提出的定位 AP的装置中的位置确定模块的结构示意 图; 图 11是本发明实施例提出的定位 AP的装置中的高度确定模块的结构示意 图; 10 is a schematic structural diagram of a location determining module in an apparatus for locating an AP according to an embodiment of the present invention; 11 is a schematic structural diagram of a height determining module in an apparatus for positioning an AP according to an embodiment of the present invention;
图 12是本发明第五实施例提出的一种定位 AP装置的结构示意图。 具体实施方式  FIG. 12 is a schematic structural diagram of a positioning AP device according to a fifth embodiment of the present invention. detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。基于本发明中的实施例, 本领域普通技术人员在没有做出创造 性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。  BRIEF DESCRIPTION OF THE DRAWINGS The technical solutions in the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without the creative work are all within the scope of the present invention.
本发明提供了一种定位 AP的方法和装置, 可以提高 AP定位的精确度。 以 站。  The present invention provides a method and apparatus for locating an AP, which can improve the accuracy of AP positioning. Take the station.
请参考图 1, 图 1是本发明第一实施例提出的一种定位 AP的方法的流程 图。 如图所示, 本发明实施例中的定位 AP的方法包括:  Referring to FIG. 1, FIG. 1 is a flow chart of a method for locating an AP according to a first embodiment of the present invention. As shown in the figure, the method for locating an AP in the embodiment of the present invention includes:
S101 , 获取预先建立的 AP指纹库, 所述 AP指纹库包括在多个测量点获 取到的多条 AP指纹, 所述 AP指纹包括对应测量点的位置信息、 AP的 MAC 地址以及该 AP的信号强度。  S101. Acquire a pre-established AP fingerprint database, where the AP fingerprint database includes multiple AP fingerprints acquired at multiple measurement points, where the AP fingerprint includes location information of a corresponding measurement point, a MAC address of the AP, and a signal of the AP. strength.
具体实现中, 在对建筑物内的 AP进行定位时, 可以围绕着建筑物设置多 处测量点, 在每个测量点分别测量该测量点的位置信息, AP的 MAC地址以 及该 AP的信号强度, 其中, 测量点的位置信息可以是测量点的经度和维度。 AP指纹还可以包括该 AP的服务集标识, 服务集标识为网络名称, 终端只有 设置服务集标识才能进入到该网络。 在多个测量点获取到多条 AP指纹后, 可 以将这些 AP指纹建立一个 AP指纹库, 按照 AP指纹的信号强度对各条 AP 指纹进行排序。 需要说明的是, 在同一测量点可能获取到不同 AP的信号, 因 此, 在该测量点获取到的 AP的 MAC地址, 该 AP的信号强度以及服务集标 识都可能不同。  In the specific implementation, when positioning the AP in the building, multiple measurement points can be set around the building, and the position information of the measurement point, the MAC address of the AP, and the signal strength of the AP are respectively measured at each measurement point. Wherein, the location information of the measurement point may be the longitude and dimension of the measurement point. The AP fingerprint may also include the service set identifier of the AP, and the service set identifier is the network name, and the terminal can enter the network only by setting the service set identifier. After obtaining multiple AP fingerprints at multiple measurement points, these AP fingerprints can be built into an AP fingerprint database, and the AP fingerprints are sorted according to the signal strength of the AP fingerprint. It should be noted that the signals of different APs may be acquired at the same measurement point. Therefore, the signal strength of the AP and the service set identifier may be different at the MAC address of the AP acquired at the measurement point.
S 102, 从所述 AP指纹库中查找与待定位的 AP的 MAC地址相同的多条 AP指纹。  S102: Search, by the AP fingerprint database, a plurality of AP fingerprints that are the same as the MAC address of the AP to be located.
具体实现中, 可以首先获取待定位的 AP的 MAC地址, 然后将待定位的 AP的 MAC地址与指纹库中的每条 AP指纹进行对比,若指纹库中的 AP指纹 对应的 AP的 MAC地址与待定位的 AP的 MAC地址相同,则从 AP指纹库中 查找出来。 In a specific implementation, the MAC address of the AP to be located may be obtained first, and then the to-be-positioned The MAC address of the AP is compared with each AP fingerprint in the fingerprint database. If the MAC address of the AP corresponding to the AP fingerprint in the fingerprint database is the same as the MAC address of the AP to be located, it is searched from the AP fingerprint database.
S103,根据查找到的所述多条 AP指纹对应测量点的位置信息以及信号强 度, 计算查找到的各条 AP指纹的梯度大小和梯度方向。  S103. Calculate, according to the found location information of the multiple AP fingerprint corresponding measurement points and the signal strength, a gradient size and a gradient direction of the searched AP fingerprints.
可选的, 首先可以根据查找到的各条 AP指纹对应测量点的位置信息, 计 算各条 AP指纹对应测量点之间的间距。 其中, AP指纹对应测量点的位置信 息记录了测量点的经度和维度, 因此可以利用距离计算公式计算各条 AP指纹 对应测量点之间的距离。  Optionally, the distance between the measurement points of each AP fingerprint may be calculated according to the location information of the corresponding AP fingerprint corresponding to the measured points. The location information of the measurement point corresponding to the AP fingerprint records the longitude and dimension of the measurement point. Therefore, the distance calculation formula can be used to calculate the distance between the measurement points of each AP fingerprint.
其次, 根据各条 AP指纹对应测量点之间的间距, 从查找到的多条 AP指 纹中查找目标 AP指纹对应测量点的邻近 AP指纹。 具体实现中, 在上述步骤 中计算得到查找到的其他各条 AP指纹分别到目标 AP指纹的间距, 在本步骤 中可以对其他各条 AP指纹对应测量点分别到目标 AP指纹对应测量点的距离 进行比较, 从中获取距离目标 AP指纹对应测量点最近的邻近 AP指纹。  Secondly, according to the spacing between the measurement points of the respective AP fingerprints, the neighboring AP fingerprints corresponding to the measurement points of the target AP fingerprint are searched from the plurality of AP fingerprints found. In the specific implementation, the distances of the other AP fingerprints that are found to the target AP fingerprints are calculated in the foregoing steps. In this step, the distances of the corresponding AP fingerprint corresponding measurement points to the target AP fingerprint corresponding measurement points are respectively determined. For comparison, the neighboring AP fingerprint closest to the measurement point corresponding to the target AP fingerprint is obtained therefrom.
然后, 根据目标 AP指纹对应测量点的位置信息以及邻近 AP指纹对应测 量点的位置信息, 计算目标 AP指纹对应测量点到邻近 AP指纹对应测量点的 方向, 并根据目标 AP指纹的信号强度以及邻近 AP指纹的信号强度, 计算目 标 AP指纹与邻近 AP指纹的信号强度差。 进而根据目标 AP指纹对应测量点 到邻近 AP指纹对应测量点的方向,确定目标 AP指纹梯度方向,根据目标 AP 指纹与邻近 AP指纹的信号强度差, 确定目标 AP的梯度大小。  Then, according to the location information of the target AP fingerprint corresponding to the measurement point and the location information of the measurement point corresponding to the neighboring AP fingerprint, calculate the direction of the target AP fingerprint corresponding measurement point to the corresponding measurement point of the neighboring AP fingerprint, and according to the signal strength of the target AP fingerprint and the proximity The signal strength of the AP fingerprint calculates the signal strength difference between the target AP fingerprint and the neighboring AP fingerprint. Then, according to the direction of the target AP fingerprint corresponding to the measurement point of the neighboring AP fingerprint, the target AP fingerprint gradient direction is determined, and the gradient of the target AP is determined according to the signal strength difference between the target AP fingerprint and the neighboring AP fingerprint.
例如: 从指纹库中查找到与待定位的 AP的 MAC地址相同的 sum条 AP 指纹, 记为 FSsum, fSi e FSsum , 1^为 sum条 AP指纹中的其中一条指纹, 记为目 标 AP指纹, (Longitud , Latitude )为 fs对应测量点的位置信息, η为 fs的信号强 度; fsj e FSsum, fSj为 sum 条 AP 指纹中距离 fs '最近的邻近 AP 指纹, (Longitudej , Latitudej )为 fSj对应测量点的位置信息, Pj为 fSj的信号强度, 则 AP 指纹与邻近 AP指纹的信号强度差 = Pi - Pj, fS[对应测量点到 fSj对应测量点 的方向 的计算公式如下: For example: Find the sum-strip AP fingerprint with the same MAC address as the AP to be located from the fingerprint database, and record it as FS sum , f Si e FS sum , 1^ is one of the sum AP fingerprints, and record it as the target. AP fingerprint, (Longitud, Latitude) is the position information of fs corresponding to the measurement point, η is the signal strength of fs; fs je FS sum , f Sj is the nearest neighbor AP fingerprint of distance fs ' in the AP fingerprint, (Longitudej, Latitud Ej ) is f Sj corresponding to the position information of the measuring point, Pj is the signal strength of f Sj , then the signal intensity difference between the AP fingerprint and the neighboring AP fingerprint = Pi - Pj, f S [ corresponding to the direction of the measuring point to the measuring point of f Sj The formula is as follows:
calculate( Longitude - , Latitudej , Longitudej , Latitude; )  Calculate( Longitude - , Latitudej , Longitudej , Latitude; )
= arctan  = arctan
calculate(Longitudej , Latitudej , Longitude; , Latitudej ) 其中 , calculate( Longitude j , Latitudej , Longitude j , Latitude; )是点 (Longitudej , Latitudej ) 到点 (Longitudej , Latitud )的 巨离函数, calculateCLongitudej , Latitudej , Longitude; , Latitudej ) 是点 ( Longitude j , Latitudej )到点 (Longitude; , Latitudej )的 巨离函数。 Calculate(Longitudej , Latitudej , Longitude; , Latitudej ) Among them, calculate( Longitude j , Latitudej , Longitude j , Latitude; ) is the macro function of point (Longitudej , Latitudej ) to point (Longitudej , Latitud ), calculateCLongitudej , Latitudej , Longitude ; , Latitudej ) is the point ( Longitude j , Latitudej ) ) The macro function of the point (Longitude; , Latitudej ).
进一步可选的, 可以将角度为 2π的圓周空间划分为多个量化区间, 每个 量化区间分别对应一个量化方向; 然后确定目标 ΑΡ指纹对应测量点到邻近 ΑΡ指纹对应测量点的方向所位于的量化区间; 最后才艮据确定的目标 ΑΡ指纹 对应测量点到邻近 ΑΡ指纹对应测量点的方向所位于的量化区间, 将目标 ΑΡ 指纹对应测量点到邻近 ΑΡ指纹对应测量点的方向处理得到一个量化方向。从 而根据所述目标 ΑΡ指纹对应测量点到所述邻近 ΑΡ指纹对应测量点的所述量 化方向, 确定所述目标 ΑΡ指纹的梯度方向。  Further optionally, the circular space with an angle of 2π may be divided into a plurality of quantization intervals, each of which corresponds to a quantization direction; and then the direction of the target ΑΡ fingerprint corresponding to the measurement point to the adjacent measurement point of the fingerprint is determined. Quantization interval; Finally, according to the determined target ΑΡ fingerprint corresponding to the measurement interval to the adjacent ΑΡ fingerprint corresponding measurement point in the quantization interval, the target ΑΡ fingerprint corresponding measurement point to the adjacent ΑΡ fingerprint corresponding measurement point processing to obtain a quantification direction. Therefore, the gradient direction of the target fingerprint is determined according to the quantization direction of the target ΑΡ fingerprint corresponding measurement point to the adjacent ΑΡ fingerprint corresponding measurement point.
例如: 将角度 [0, 2π]平均分为 8个量化区间, 当 fs对应测量点到 fSj对应测 量点的方向 位于^ < 0≤2;τ或 0 < 0≤ 时, 将 量化为 0; 当 fSl对应测量点 到 fSj对应测量点的方向 位于 ^^,^^ + 0≤i≤6时, 将 量化为 1 J 8 8 4 For example: The angle [0, 2π] is equally divided into 8 quantization intervals. When the direction corresponding to the measurement point of fs corresponding to f Sj is located at ^ < 0 ≤ 2; τ or 0 < 0 ≤, it will be quantized to 0; When f Sl corresponds to the measurement point to the f Sj corresponding measurement point in the direction ^^, ^^ + 0 ≤ i ≤ 6, it will be quantized to 1 J 8 8 4
(2i+l) * r π_  (2i+l) * r π_
8 + ¥ °  8 + ¥ °
需要说明的是, 可以将上述查找到的多条 ΑΡ指纹的其中任何一条作为目 标 ΑΡ指纹, 在计算得到其中一条 ΑΡ指纹对应测量点到邻近 ΑΡ指纹对应测 量点的方向以及该 ΑΡ指纹与邻近 ΑΡ指纹的信号强度差之后, 然后依次计算 上述查找到的其他各条 ΑΡ指纹对应测量点到各自邻近 ΑΡ指纹对应测量点的 方向, 以及其他各条 ΑΡ指纹与各自邻近 ΑΡ指纹的信号强度差。  It should be noted that any one of the plurality of fingerprints found above may be used as the target fingerprint, and the direction of one of the fingerprint corresponding measurement points to the corresponding measurement point of the adjacent fingerprint and the fingerprint and the adjacent fingerprint may be calculated. After the difference between the signal strengths of the fingerprints, the direction of the corresponding measurement points of the other detected fingerprints to the corresponding measurement points of the respective fingerprints, and the signal intensity difference between the other fingerprints and the adjacent fingerprints are sequentially calculated.
最后, 可以根据所述目标 ΑΡ指纹与所述邻近 ΑΡ指纹的信号强度差, 确 定所述目标 ΑΡ指纹的梯度大小, 并根据所述目标 ΑΡ指纹对应测量点到所述 邻近 ΑΡ指纹对应测量点的方向, 确定所述目标 ΑΡ指纹的梯度方向。  Finally, the gradient of the target ΑΡ fingerprint may be determined according to the signal strength difference between the target ΑΡ fingerprint and the adjacent ΑΡ fingerprint, and the measurement point is corresponding to the measurement point of the neighbor ΑΡ fingerprint according to the target ΑΡ fingerprint Direction, determining the gradient direction of the target fingerprint.
具体实现中, 上述邻近 ΑΡ指纹包括距离所述目标 ΑΡ指纹对应测量点最 近的预设数目的 ΑΡ指纹, 可以首先按照如上述步骤中相同的计算方法计算目 标 ΑΡ指纹对应测量点到各条邻近 ΑΡ指纹对应测量点的方向,以及该目标 ΑΡ 指纹与邻近 ΑΡ指纹的信号强度差, 然后将位于所述目标 ΑΡ指纹对应测量点 相同方向上的所有邻近 AP指纹的信号强度差求和得到所述目标 AP指纹对应 测量点在该方向上的信号强度差, 最后比较位于所述目标 AP指纹对应测量点 不同方向上的信号强度差, 将所述最大的信号强度差作为所述目标 AP指纹的 梯度大小, 并将该信号强度差所在的方向作为所述目标 AP指纹的梯度方向。 In a specific implementation, the neighboring fingerprint includes a preset number of fingerprints closest to the target corresponding to the target fingerprint, and may first calculate the target fingerprint corresponding measurement point to each neighbor according to the same calculation method as in the above steps. The fingerprint corresponds to the direction of the measurement point, and the difference between the target ΑΡ fingerprint and the adjacent ΑΡ fingerprint signal strength, and then will be located at the target ΑΡ fingerprint corresponding measurement point Comparing the signal strength differences of all neighboring AP fingerprints in the same direction to obtain the signal strength difference of the target AP fingerprint corresponding measurement points in the direction, and finally comparing the signal strength differences in different directions of the target AP fingerprint corresponding measurement points And using the maximum signal strength difference as a gradient size of the target AP fingerprint, and using the direction in which the signal strength difference is located as a gradient direction of the target AP fingerprint.
可选的, 可以根据查找到的多条 AP指纹对应测量点的位置信息以及信号 强度, 统计出在曲线经过这些测量点时 AP的信号强度函数, 然后对该 AP的 信号强度函数进行求导, 计算各条 AP指纹的梯度方向及梯度大小。  Optionally, the signal strength function of the AP when the curve passes through the measurement points is calculated according to the location information of the plurality of AP fingerprints corresponding to the detected measurement points and the signal strength, and then the signal strength function of the AP is derived. Calculate the gradient direction and gradient size of each AP fingerprint.
S104, 根据所述各条 AP指纹的梯度大小和梯度方向, 确定所述 AP的水 平位置。  S104. Determine a horizontal position of the AP according to a gradient size and a gradient direction of each AP fingerprint.
具体实现中, 若步骤 S102从 AP指纹库中查找到与待定位的 AP的 MAC 地址相同的 AP指纹只有三条,并且该三条 AP指纹在其梯度方向上交于一点, 则将交点作为所述 AP的水平位置。  In a specific implementation, if there are only three AP fingerprints in the AP fingerprint database that are the same as the MAC address of the AP to be located, and the three AP fingerprints intersect in a gradient direction, the intersection point is used as the AP. The horizontal position.
可选的, 可以首先根据所述各条 AP指纹对应测量点之间的间距, 将查找 到的所述多条 AP指纹划分为多个聚类; 然后根据各个聚类中各条 AP指纹的 梯度大小、 梯度方向以及各条 AP指纹对应测量点的位置信息, 确定各个聚类 中类首参考位置和梯度方向,进而根据所述各个聚类中类首的参考位置和梯度 方向, 确定所述 AP的水平位置。  Optionally, the multiple AP fingerprints that are found are divided into multiple clusters according to the spacing between the measurement points of the respective AP fingerprints; and then, according to the gradient of each AP fingerprint in each cluster The size, the gradient direction, and the position information of each AP fingerprint corresponding to the measurement point, determine the first reference position and the gradient direction in each cluster, and then determine the AP according to the reference position and the gradient direction of the class head in each cluster. The horizontal position.
在本发明实施例中, 通过从预先建立的 AP指纹库中查找与待定位的 AP 的 MAC地址相同的多条 AP指纹, 从而根据查找到的多条 AP指纹对应测量 点的位置信息以及信号强度, 计算查找到的各条 AP指纹的梯度大小和梯度方 向; 最后根据所述各条 AP指纹的梯度大小和梯度方向, 确定所述 AP的水平 位置, 从而达到提高 AP定位的精确度的目的。 请参考图 2, 图 2是本发明第二实施例提出的一种定位 AP的方法的流程 图。 如图所示, 本发明实施例中的定位 AP的方法包括:  In the embodiment of the present invention, by searching for a plurality of AP fingerprints that are the same as the MAC address of the AP to be located, the location information and the signal strength of the corresponding measurement points are obtained according to the found multiple AP fingerprints. Calculating the gradient size and gradient direction of each AP fingerprint found; finally, determining the horizontal position of the AP according to the gradient size and the gradient direction of each AP fingerprint, thereby achieving the purpose of improving the accuracy of the AP positioning. Please refer to FIG. 2. FIG. 2 is a flow chart of a method for locating an AP according to a second embodiment of the present invention. As shown in the figure, the method for locating an AP in the embodiment of the present invention includes:
S201 , 获取预先建立的 AP指纹库, 所述 AP指纹库包括在多个测量点获 取到的多条 AP指纹, 所述 AP指纹包括对应测量点的位置信息、 AP的 MAC 地址以及该 AP的信号强度。  S201. Acquire a pre-established AP fingerprint database, where the AP fingerprint database includes multiple AP fingerprints acquired at multiple measurement points, where the AP fingerprint includes location information of a corresponding measurement point, a MAC address of the AP, and a signal of the AP. strength.
具体实现中, 在对建筑物内的 AP进行定位时, 可以围绕着建筑物设置多 处测量点, 在每个测量点分别测量该测量点的位置信息, AP的 MAC地址以 及该 AP的信号强度, 其中, 测量点的位置信息可以是测量点的经度和维度。 AP指纹还可以包括该 AP的服务集标识, 服务集标识为网络名称, 终端只有 设置服务集标识才能进入该网络。 在多个测量点获取到多条 AP指纹后, 可以 将这些 AP指纹建立一个指纹库, 按照 AP指纹的信号强度对各条 AP指纹进 行排序。 需要说明的是, 在同一测量点可能获取到不同 AP的信号, 因此, 在 该测量点获取到的 AP的 MAC地址, 该 AP的信号强度以及服务集标识都可 能不同。 In the specific implementation, when positioning the AP in the building, it can be set around the building. At the measurement point, the position information of the measurement point, the MAC address of the AP, and the signal strength of the AP are respectively measured at each measurement point, wherein the position information of the measurement point may be the longitude and dimension of the measurement point. The AP fingerprint may also include the service set identifier of the AP, and the service set identifier is the network name, and the terminal can enter the network only by setting the service set identifier. After obtaining multiple AP fingerprints at multiple measurement points, these AP fingerprints can be built into a fingerprint database, and each AP fingerprint is sorted according to the signal strength of the AP fingerprint. It should be noted that the signals of different APs may be acquired at the same measurement point. Therefore, the MAC address of the AP acquired at the measurement point may be different between the signal strength of the AP and the service set identifier.
S202, 从所述 AP指纹库中查找与待定位的 AP的 MAC地址相同的多条 AP指纹, 并统计出垂直高度确定的其他 AP的信号强度的高斯分布。  S202. Search for, from the AP fingerprint database, multiple AP fingerprints with the same MAC address as the AP to be located, and collect a Gaussian distribution of signal strengths of other APs determined by the vertical height.
具体实现中, 可以首先获取待定位的 AP的 MAC地址, 然后将待定位的 AP的 MAC地址与指纹库中的每条 AP指纹进行对比,若指纹库中的 AP指纹 对应的 AP的 MAC地址与待定位的 AP的 MAC地址相同,则从 AP指纹库中 查找出来。 另外, 可以从所述 AP指纹库中统计出在 AP的垂直高度高于第一 预设高度时信号强度的高斯分布以及在 AP的垂直高度低于第一预设高度位置 时信号强度的高斯分布。  In a specific implementation, the MAC address of the AP to be located may be obtained first, and then the MAC address of the AP to be located is compared with each AP fingerprint in the fingerprint database, and the MAC address of the AP corresponding to the AP fingerprint in the fingerprint database is If the MAC address of the AP to be located is the same, it is searched from the AP fingerprint database. In addition, a Gaussian distribution of signal strength when the vertical height of the AP is higher than the first preset height and a Gaussian distribution of signal strength when the vertical height of the AP is lower than the first preset height position may be counted from the AP fingerprint library. .
例如: 在上述 AP指纹库中, 可以将垂直高度确定的其他 AP对应的 AP 指纹分类两类: AP的垂直高度在 10米以上和 AP的垂直高度在 10米以下。 已知 ηι(ηι≥ 2)条 AP指纹对应的 AP垂直高度是在 10米以上, ( ≥2)条八?指 纹对应的 AP垂直高度是在 10米以下,可以首先分别统计出在 AP的垂直高度 高于 10米时信号强度的均值和方差, 以及在 AP的垂直高度低于 10米时信号 强度的均值和方差, 然后得到在 AP的垂直高度高于 10米的信号强度的高斯 分布 ,以及在 AP的垂直高度低于 10米时信号强度的高斯分布 G2, 和02的 表示公式^口下: For example, in the above AP fingerprint database, the AP fingerprints corresponding to other APs whose vertical height is determined can be classified into two types: the vertical height of the AP is 10 meters or more and the vertical height of the AP is 10 meters or less. It is known that the vertical height of the AP corresponding to the ηι ( ηι ≥ 2) AP fingerprint is above 10 meters, ( ≥ 2) eight? The vertical height of the AP corresponding to the fingerprint is less than 10 meters. The average and variance of the signal strength when the vertical height of the AP is higher than 10 meters can be firstly calculated, and the mean value of the signal strength when the vertical height of the AP is less than 10 meters. The variance, then the Gaussian distribution of the signal strength above the 10 m vertical height of the AP, and the Gaussian distribution G 2 of the signal strength when the vertical height of the AP is less than 10 m, and the representation formula of 0 2 are:
G1 = G 1 =
Figure imgf000015_0001
Figure imgf000015_0001
其中, ^、^2为在 ΑΡ的垂直高度高于 10米时信号强度的均值和方差; μ2 . σ2 2为在 AP的垂直高度低于 10米时信号强度的均值和方差。 S203,根据查找到的所述多条 AP指纹对应测量点的位置信息以及信号强 度, 计算查找到的各条 AP指纹的梯度大小和梯度方向。 Where ^ and ^ 2 are the mean and variance of the signal strength when the vertical height of the raft is higher than 10 m; μ 2 . σ 2 2 is the mean and variance of the signal strength when the vertical height of the AP is less than 10 m. S203. Calculate, according to the found location information of the multiple AP fingerprint corresponding measurement points and the signal strength, a gradient size and a gradient direction of the searched AP fingerprints.
可选的, 首先可以根据查找到的各条 AP指纹对应测量点的位置信息, 计 算各条 AP指纹对应测量点之间的间距。 其中, AP指纹对应测量点的位置信 息记录了测量点的经度和维度, 因此可以利用距离计算公式计算其他各条 AP 指纹对应测量点分别到目标 AP指纹对应测量点的距离。  Optionally, the distance between the measurement points of each AP fingerprint may be calculated according to the location information of the corresponding AP fingerprint corresponding to the measured points. The location information of the AP fingerprint corresponding to the measurement point records the longitude and dimension of the measurement point. Therefore, the distance calculation formula can be used to calculate the distance from the corresponding measurement points of the other AP fingerprints to the corresponding measurement points of the target AP fingerprint.
其次, 根据各条 AP指纹对应测量点之间的间距, 从查找到的多条 AP指 纹中查找目标 AP指纹对应测量点的邻近 AP指纹。 具体实现中, 在上述步骤 中计算得到查找到的其他各条 AP指纹分别到目标 AP指纹的间距, 在本步骤 中可以对其他各条 AP指纹对应测量点分别到目标 AP指纹对应测量点的距离 进行比较, 从中获取距离目标 AP指纹对应测量点最近的邻近 AP指纹。  Secondly, according to the spacing between the measurement points of the respective AP fingerprints, the neighboring AP fingerprints corresponding to the measurement points of the target AP fingerprint are searched from the plurality of AP fingerprints found. In the specific implementation, the distances of the other AP fingerprints that are found to the target AP fingerprints are calculated in the foregoing steps. In this step, the distances of the corresponding AP fingerprint corresponding measurement points to the target AP fingerprint corresponding measurement points are respectively determined. For comparison, the neighboring AP fingerprint closest to the measurement point corresponding to the target AP fingerprint is obtained therefrom.
然后, 根据目标 AP指纹对应测量点的位置信息以及邻近 AP指纹对应测 量点的位置信息, 计算目标 AP指纹对应测量点到邻近 AP指纹对应测量点的 方向, 并根据目标 AP指纹的信号强度以及邻近 AP指纹的信号强度, 计算目 标 AP指纹与邻近 AP指纹的信号强度差。 进而根据目标 AP指纹对应测量点 到邻近 AP指纹对应测量点的方向,确定目标 AP指纹梯度方向,根据目标 AP 指纹与邻近 AP指纹的信号强度差, 确定目标 AP的梯度大小。  Then, according to the location information of the target AP fingerprint corresponding to the measurement point and the location information of the measurement point corresponding to the neighboring AP fingerprint, calculate the direction of the target AP fingerprint corresponding measurement point to the corresponding measurement point of the neighboring AP fingerprint, and according to the signal strength of the target AP fingerprint and the proximity The signal strength of the AP fingerprint calculates the signal strength difference between the target AP fingerprint and the neighboring AP fingerprint. Then, according to the direction of the target AP fingerprint corresponding to the measurement point of the neighboring AP fingerprint, the target AP fingerprint gradient direction is determined, and the gradient of the target AP is determined according to the signal strength difference between the target AP fingerprint and the neighboring AP fingerprint.
例如: 从指纹库中查找到与待定位的 AP的 MAC地址相同的 sum条 AP 指纹, 记为 FSsum, fSi e FSsum , 1^为 sum条 AP指纹中的其中一条指纹, 记为目 标 AP指纹, (Longitudei , Latitude )为 fs对应测量点的位置信息, Pt为 fs的信号强 度; fSj e F ¾UII , fSj为 sum 条 AP 指纹中距离 fs '最近的邻近 AP 指纹, (Longitudej , Latitudej )为 fSj对应测量点的位置信息, Pj为 fSj的信号强度, 则 AP 指纹与邻近 AP指纹的信号强度差 = Pi - Pj, fSl对应测量点到 fSj对应测量点 的方向 的计算公式如下: For example: Find the sum-strip AP fingerprint with the same MAC address as the AP to be located from the fingerprint database, and record it as FS sum , f Si e FS sum , 1^ is one of the sum AP fingerprints, and record it as the target. AP fingerprint, (Longitudei, Latitude) is the position information of fs corresponding to the measurement point, P t is the signal strength of fs; f Sj e F 3⁄4 UII , f Sj is the nearest neighbor AP fingerprint of distance fs ' in the sum AP fingerprint, ( Longitudej, Latitud ej ) is the position information of f Sj corresponding to the measurement point, Pj is the signal strength of f Sj , then the signal intensity difference between AP fingerprint and neighboring AP fingerprint = Pi - Pj, f Sl corresponds to the measurement point of f Sj The formula for calculating the direction is as follows:
calculate( Longitude - , Latitudej , Longitudej , Latitude; )  Calculate( Longitude - , Latitudej , Longitudej , Latitude; )
= arctan  = arctan
calculate(Longitudej , Latitudej , Longitude; , Latitudej ) 其中, calculate(Longitudej , Latitudej , Longitudej , Latitude; )是点 (Longitudej , Latitudej ) 到点 (Longitudej , Latitudei)的 巨离函数, calculateiLongitude, , Latitude, , Longitude; , Latitude, ) 是点 ( Longitude j , Latitudej )到点 (Longitude; , Latitudej )的 巨离函数。 Calculate(Longitudej , Latitudej , Longitude; , Latitudej ) where calculate(Longitudej , Latitudej , Longitudej , Latitude ; ) is the macro function of the point (Longitudej , Latitudej ) to point (Longitudej , Latitudei), calculateiLongitude, , Latitude, , Longitude ; , Latitude, ) It is the giant function of the point (Longitude j , Latitudej ) to the point (Longitude; , Latitudej ).
进一步可选的, 可以将角度为 2π的圓周空间划分为多个量化区间, 每个 量化区间分别对应一个量化方向; 然后确定目标 ΑΡ指纹对应测量点到邻近 ΑΡ指纹对应测量点的方向所位于的量化区间; 最后才艮据确定的目标 ΑΡ指纹 对应测量点到邻近 ΑΡ指纹对应测量点的方向所位于的量化区间, 将目标 ΑΡ 指纹对应测量点到邻近 ΑΡ指纹对应测量点的方向处理得到一个量化方向。从 而根据所述目标 ΑΡ指纹对应测量点到所述邻近 ΑΡ指纹对应测量点的所述量 化方向, 确定所述目标 ΑΡ指纹的梯度方向。  Further optionally, the circular space with an angle of 2π may be divided into a plurality of quantization intervals, each of which corresponds to a quantization direction; and then the direction of the target ΑΡ fingerprint corresponding to the measurement point to the adjacent measurement point of the fingerprint is determined. Quantization interval; Finally, according to the determined target ΑΡ fingerprint corresponding to the measurement interval to the adjacent ΑΡ fingerprint corresponding measurement point in the quantization interval, the target ΑΡ fingerprint corresponding measurement point to the adjacent ΑΡ fingerprint corresponding measurement point processing to obtain a quantification direction. Therefore, the gradient direction of the target fingerprint is determined according to the quantization direction of the target ΑΡ fingerprint corresponding measurement point to the adjacent ΑΡ fingerprint corresponding measurement point.
例如: 将角度 [0, 2π]平均分为 8个量化区间, 当 fs对应测量点到 fSj对应测 量点的方向 位于^ < 0≤2;τ或 0 < 0≤ 时, 将 量化为 0; 当 fSl对应测量点 For example: The angle [0, 2π] is equally divided into 8 quantization intervals. When the direction corresponding to the measurement point of fs corresponding to f Sj is located at ^ < 0 ≤ 2; τ or 0 < 0 ≤, it will be quantized to 0; When f Sl corresponds to the measurement point
J 8 8 J 到 fSj对应测量点的方向 位于 ^^,^^ + 0≤i≤6时, 将 量化为 1 J 8 8 4 When J 8 8 J to f Sj corresponds to the direction of the measuring point, ^^, ^^ + 0 ≤ i ≤ 6, it will be quantized to 1 J 8 8 4
(2i+l) * r π_  (2i+l) * r π_
8 + °  8 + °
需要说明的是, 可以将上述查找到的多条 ΑΡ指纹的其中任何一条作为目 标 ΑΡ指纹, 在计算得到其中一条 ΑΡ指纹对应测量点到邻近 ΑΡ指纹对应测 量点的方向以及该 ΑΡ指纹与邻近 ΑΡ指纹的信号强度差之后, 然后依次计算 上述查找到的其他各条 ΑΡ指纹对应测量点到各自邻近 ΑΡ指纹对应测量点的 方向, 以及其他各条 ΑΡ指纹与各自邻近 ΑΡ指纹的信号强度差。  It should be noted that any one of the plurality of fingerprints found above may be used as the target fingerprint, and the direction of one of the fingerprint corresponding measurement points to the corresponding measurement point of the adjacent fingerprint and the fingerprint and the adjacent fingerprint may be calculated. After the difference between the signal strengths of the fingerprints, the direction of the corresponding measurement points of the other detected fingerprints to the corresponding measurement points of the respective fingerprints, and the signal intensity difference between the other fingerprints and the adjacent fingerprints are sequentially calculated.
最后, 可以根据所述目标 ΑΡ指纹与所述邻近 ΑΡ指纹的信号强度差, 确 定所述目标 ΑΡ指纹的梯度大小, 并根据所述目标 ΑΡ指纹对应测量点到所述 邻近 ΑΡ指纹对应测量点的方向, 确定所述目标 ΑΡ指纹的梯度方向。  Finally, the gradient of the target ΑΡ fingerprint may be determined according to the signal strength difference between the target ΑΡ fingerprint and the adjacent ΑΡ fingerprint, and the measurement point is corresponding to the measurement point of the neighbor ΑΡ fingerprint according to the target ΑΡ fingerprint Direction, determining the gradient direction of the target fingerprint.
具体实现中, 上述邻近 ΑΡ指纹包括距离所述目标 ΑΡ指纹对应测量点最 近的预设数目的 ΑΡ指纹, 可以首先按照如上述步骤中相同的计算方法计算目 标 ΑΡ指纹对应测量点到各条邻近 ΑΡ指纹对应测量点的方向,以及该目标 ΑΡ 指纹与各条邻近 ΑΡ指纹的信号强度差, 然后将位于所述目标 ΑΡ指纹对应测 量点相同方向上的所有邻近 ΑΡ指纹的信号强度差求和得到所述目标 ΑΡ指纹 对应测量点在该方向上的信号强度差, 最后比较位于所述目标 ΑΡ指纹对应测 量点不同方向上的信号强度差, 将所述最大的信号强度差作为所述目标 AP指 纹的梯度大小, 并将该信号强度差所在的方向作为所述目标 AP指纹的梯度方 向。 In a specific implementation, the neighboring fingerprint includes a preset number of fingerprints closest to the target corresponding to the target fingerprint, and may first calculate the target fingerprint corresponding measurement point to each neighbor according to the same calculation method as in the above steps. The fingerprint corresponds to the direction of the measurement point, and the difference between the target ΑΡ fingerprint and the signal strength of each adjacent ΑΡ fingerprint, and then sums the signal strength differences of all adjacent ΑΡ fingerprints located in the same direction of the target ΑΡ fingerprint corresponding to the measurement point. The target ΑΡ fingerprint corresponds to the signal strength difference of the measurement point in the direction, and finally the comparison is located at the target ΑΡ fingerprint corresponding measurement The signal strength difference in different directions is used, and the maximum signal strength difference is used as the gradient size of the target AP fingerprint, and the direction in which the signal strength difference is located is used as the gradient direction of the target AP fingerprint.
可选的, 可以根据查找到的多条 AP指纹对应测量点的位置信息以及信号 强度, 统计出在曲线经过这些测量点时 AP的信号强度函数, 然后对该 AP的 信号强度函数进行求导, 计算各条 AP指纹的梯度方向及梯度大小。  Optionally, the signal strength function of the AP when the curve passes through the measurement points is calculated according to the location information of the plurality of AP fingerprints corresponding to the detected measurement points and the signal strength, and then the signal strength function of the AP is derived. Calculate the gradient direction and gradient size of each AP fingerprint.
5204, 根据所述各条 AP指纹的梯度大小和梯度方向, 确定所述 AP的水 平位置。  S204: Determine a horizontal position of the AP according to a gradient size and a gradient direction of each AP fingerprint.
具体实现中, 若步骤 S202从 AP指纹库中查找到与待定位的 AP的 MAC 地址相同的 AP指纹只有三条,并且该三条 AP指纹在其梯度方向上交于一点, 则将交点作为所述 AP的水平位置。  In a specific implementation, if the step S202 finds that there are only three AP fingerprints in the AP fingerprint database that are the same as the MAC address of the AP to be located, and the three AP fingerprints intersect in a gradient direction, the intersection point is used as the AP. The horizontal position.
可选的, 可以首先根据所述各条 AP指纹对应测量点之间的间距, 将查找 到的所述多条 AP指纹划分为多个聚类; 然后根据各个聚类中各条 AP指纹的 梯度大小、 梯度方向以及各条 AP指纹对应测量点的位置信息, 确定各个聚类 中类首参考位置和梯度方向,进而根据所述各个聚类中类首的参考位置和梯度 方向, 确定所述 AP的水平位置。  Optionally, the multiple AP fingerprints that are found are divided into multiple clusters according to the spacing between the measurement points of the respective AP fingerprints; and then, according to the gradient of each AP fingerprint in each cluster The size, the gradient direction, and the position information of each AP fingerprint corresponding to the measurement point, determine the first reference position and the gradient direction in each cluster, and then determine the AP according to the reference position and the gradient direction of the class head in each cluster. The horizontal position.
5205, 根据查找到的所述多条 AP指纹的信号强度, 计算查找到的所述多 条 AP指纹的信号强度的均值。  S205: Calculate, according to the found signal strengths of the plurality of AP fingerprints, an average of signal strengths of the plurality of AP fingerprints that are found.
具体实现中, 可以对查找到的多条 AP指纹的信号强度进行求和, 然后将 求和得到的信号强度之和除以查找到的 AP指纹的个数, 计算得到的平均值作 为查找到的多条 AP指纹的信号强度的均值。  In a specific implementation, the signal strengths of the plurality of AP fingerprints found may be summed, and then the sum of the summed signal strengths is divided by the number of the obtained AP fingerprints, and the calculated average value is used as the found value. The average of the signal strengths of multiple AP fingerprints.
5206,根据查找到所述多条 AP指纹的信号强度的均值以及所述垂直高度 确定的其他 AP的信号强度的高斯分布, 确定所述 AP的垂直高度。  S206: Determine a vertical height of the AP according to a mean value of the signal strengths of the plurality of AP fingerprints and a Gaussian distribution of signal strengths of other APs determined by the vertical height.
具体实现中, 首先可以根据所述在 AP的垂直高度高于第一预设高度时信 号强度的高斯分布以及所述在 AP的垂直高度低于第一预设高度时信号强度的 高斯分布, 计算在 AP的垂直高度等于第一预设高度时信号强度阔值。  In a specific implementation, first, according to the Gaussian distribution of the signal strength when the vertical height of the AP is higher than the first preset height, and the Gaussian distribution of the signal strength when the vertical height of the AP is lower than the first preset height, The signal strength threshold is when the vertical height of the AP is equal to the first preset height.
例如: 由步骤 S202计算得到在 AP的垂直高度高于 10米时信号强度的高 斯分布 以及所述在 AP的垂直高度低于 10米时信号强度的高斯分布 G2, 计 算上述两条分布曲线的交点( G, = G2 )得到在 AP的垂直高度等于 10米时信号 强度阔值。 For example: the Gaussian distribution of the signal strength when the vertical height of the AP is higher than 10 meters and the Gaussian distribution G 2 of the signal strength when the vertical height of the AP is less than 10 meters are calculated by the step S202, and the two distribution curves are calculated. The intersection point ( G, = G 2 ) gives the signal when the vertical height of the AP is equal to 10 meters. Strength and value.
然后, 对所述多条 AP指纹的信息强度的均值和所述在 AP的垂直高度等 于第一预设高度时信号强度阔值进行比较。  Then, the average of the information strengths of the plurality of AP fingerprints is compared with the signal strength threshold when the vertical height of the AP is equal to the first preset height.
最后, 根据所述多条 AP指纹的信息强度的均值和所述在 AP的垂直高度 等于第一预设高度时信号强度阔值的比较结果, 确定所述 AP的垂直高度。 具 体的, 若所述多条 AP指纹的信息强度的均值等于所述在 AP的垂直高度等于 第一预设高度时信号强度阔值, 则所述 AP的垂直高度为第一预设高度; 若所 述多条 AP指纹的信息强度的均值大于所述在 AP的垂直高度等于第一预设高 度时信号强度阔值, 则所述 AP的垂直高度为第二预设高度; 若所述多条 AP 指纹的信息强度的均值小于所述在 AP的垂直高度等于第一预设高度时信号强 度阔值, 则所述 AP的垂直高度为第三预设高度。  Finally, determining a vertical height of the AP according to a comparison between an average of information strengths of the plurality of AP fingerprints and a signal strength threshold value when the vertical height of the AP is equal to the first preset height. Specifically, if the average value of the information strengths of the plurality of AP fingerprints is equal to the signal strength threshold when the vertical height of the AP is equal to the first preset height, the vertical height of the AP is the first preset height; The average of the information strengths of the plurality of AP fingerprints is greater than the signal strength threshold when the vertical height of the AP is equal to the first preset height, and the vertical height of the AP is the second preset height; The average value of the information strength of the AP fingerprint is smaller than the signal strength threshold when the vertical height of the AP is equal to the first preset height, and the vertical height of the AP is the third preset height.
例如: 上述查找到的多条 AP指纹的信号强度的均值记为 , 上述在 AP 的垂直高度等于 10米时信号强度阔值记为 。 若 > ¾, 则说明待定位 AP位 于 10米以下, 具体可将 AP定位到 5米处; 若 < , 则说明待定位 AP位于 10米以上, 具体可将 AP定位到 15米处。 For example, the average value of the signal strengths of the multiple AP fingerprints found above is recorded as the signal strength threshold when the vertical height of the AP is equal to 10 meters. If > 3⁄4 , the AP to be located is located below 10 meters, and the AP can be positioned to 5 meters. If < , it means that the AP to be located is located at 10 meters or more, and the AP can be positioned to 15 meters.
需要说明的是, 如果是在室外地面对室内 AP进行测量时, 位于室内 20 米以上的 AP的信号强度非常低, 在室外很难测量到的, 因此可以将 AP的垂 直高度的适用范围设置在 0到 20米之间, 并将 AP的垂直高度分为 10米以下 和 10米以上两部分进行计算。 为了降低垂直高度的平均定位误差, 进一步将 位于 10米以下的 AP定位到 5米, 将位于 10米以上的 AP定位到 15米。  It should be noted that if the indoor AP is measured on the outdoor ground, the signal strength of the AP located indoors of 20 meters or more is very low, which is difficult to measure outdoors, so the applicable range of the vertical height of the AP can be set. Between 0 and 20 meters, the vertical height of the AP is divided into two parts of 10 meters or less and 10 meters or more. In order to reduce the average positioning error of the vertical height, the AP located below 10 meters is further positioned to 5 meters, and the AP located above 10 meters is positioned to 15 meters.
最终, 根据上述计算得到 AP的水平位置以及 AP的垂直高度, 就可以确 定 AP的具体位置。  Finally, according to the above calculation, the horizontal position of the AP and the vertical height of the AP can determine the specific location of the AP.
在本发明实施例中, 通过从预先建立的 AP指纹库中查找与待定位的 AP 的 MAC地址相同的多条 AP指纹, 从而根据查找到的多条 AP指纹对应测量 点的位置信息以及信号强度, 计算查找到的各条 AP指纹的梯度大小和梯度方 向; 最后根据所述各条 AP指纹的梯度大小和梯度方向, 确定所述 AP的水平 位置, 同时可以根据查找到多条 AP指纹的信号强度的均值以及垂直高度确定 的其他 AP的信号强度的高斯分布, 确定 AP的垂直高度, 从而达到提高 AP 定位的精确度的目的。 请参考图 3, 图 3是本发明第三实施例提出的一种定位 AP的方法的流程 图。 如图所示, 本发明实施例中的定位 AP的方法包括: In the embodiment of the present invention, by searching for a plurality of AP fingerprints that are the same as the MAC address of the AP to be located, the location information and the signal strength of the corresponding measurement points are obtained according to the found multiple AP fingerprints. Calculating the gradient size and gradient direction of each AP fingerprint found; finally, determining the horizontal position of the AP according to the gradient size and the gradient direction of each AP fingerprint, and simultaneously finding a signal of multiple AP fingerprints according to the The mean value of the intensity and the Gaussian distribution of the signal strengths of other APs determined by the vertical height determine the vertical height of the AP, thereby achieving the purpose of improving the accuracy of the AP positioning. Please refer to FIG. 3. FIG. 3 is a flowchart of a method for locating an AP according to a third embodiment of the present invention. As shown in the figure, the method for locating an AP in the embodiment of the present invention includes:
S301 , 获取预先建立的 AP指纹库, 所述 AP指纹库包括在多个测量点获 取到的多条 AP指纹, 所述 AP指纹包括对应测量点的位置信息、 AP的 MAC 地址以及该 AP的信号强度。  S301. Acquire a pre-established AP fingerprint database, where the AP fingerprint database includes multiple AP fingerprints acquired at multiple measurement points, where the AP fingerprint includes location information of a corresponding measurement point, a MAC address of the AP, and a signal of the AP. strength.
具体实现中, 在对建筑物内的 AP进行定位时, 可以围绕着建筑物设置多 处测量点, 在每个测量点分别测量该测量点的位置信息, AP的 MAC地址以 及该 AP的信号强度, 其中, 测量点的位置信息可以是测量点的经度和维度, AP指纹还可以包括该 AP的服务集标识, 服务集标识为网络名称, 终端只有 设置服务集标识才能进入到该网络。 在多个测量点获取到多条 AP指纹后, 可 以将这些 AP指纹建立一个指纹库, 按照 AP指纹的信号强度对各条 AP指纹 进行排序。 需要说明的是, 在同一测量点可能获取到不同 AP的信号, 因此, 在该测量点获取到的 AP的 MAC地址, 该 AP的信号强度以及服务集标识都 可能不同。  In the specific implementation, when positioning the AP in the building, multiple measurement points can be set around the building, and the position information of the measurement point, the MAC address of the AP, and the signal strength of the AP are respectively measured at each measurement point. The location information of the measurement point may be the longitude and dimension of the measurement point, and the AP fingerprint may also include the service set identifier of the AP, and the service set identifier is the network name, and the terminal can enter the network only by setting the service set identifier. After obtaining multiple AP fingerprints at multiple measurement points, these AP fingerprints can be built into a fingerprint database, and the AP fingerprints are sorted according to the signal strength of the AP fingerprint. It should be noted that the signals of different APs may be obtained at the same measurement point. Therefore, the signal strength of the AP and the service set identifier of the AP may be different at the MAC address of the AP obtained at the measurement point.
S302, 从所述 AP指纹库中查找与待定位的 AP的 MAC地址相同的多条 AP指纹。  S302. Search for, from the AP fingerprint database, multiple AP fingerprints that are the same as the MAC address of the AP to be located.
具体实现中, 可以首先获取待定位的 AP的 MAC地址, 然后将待定位的 AP的 MAC地址与指纹库中的每条 AP指纹进行对比,若指纹库中的 AP指纹 对应的 AP的 MAC地址与待定位的 AP的 MAC地址相同,则从 AP指纹库中 查找出来。  In a specific implementation, the MAC address of the AP to be located may be obtained first, and then the MAC address of the AP to be located is compared with each AP fingerprint in the fingerprint database, and the MAC address of the AP corresponding to the AP fingerprint in the fingerprint database is If the MAC address of the AP to be located is the same, it is searched from the AP fingerprint database.
S303,根据查找到的所述多条 AP指纹对应测量点的位置信息以及信号强 度, 计算查找到的各条 AP指纹的梯度大小和梯度方向。  S303. Calculate, according to the found location information of the multiple AP fingerprint corresponding measurement points and the signal strength, a gradient size and a gradient direction of the searched AP fingerprints.
可选的, 首先可以根据查找到的各条 AP指纹对应测量点的位置信息, 计 算各条 AP指纹对应测量点之间的间距。 其中, AP指纹对应测量点的位置信 息记录了测量点的经度和维度, 因此可以利用距离计算公式计算其他各条 AP 指纹对应测量点分别到目标 AP指纹对应测量点的距离。  Optionally, the distance between the measurement points of each AP fingerprint may be calculated according to the location information of the corresponding AP fingerprint corresponding to the measured points. The location information of the AP fingerprint corresponding to the measurement point records the longitude and dimension of the measurement point. Therefore, the distance calculation formula can be used to calculate the distance from the corresponding measurement points of the other AP fingerprints to the corresponding measurement points of the target AP fingerprint.
其次, 根据各条 AP指纹对应测量点之间的间距, 从查找到的多条 AP指 纹中查找目标 AP指纹对应测量点的邻近 AP指纹。 具体的, 可以对其他各条 AP指纹对应测量点分别到目标 AP指纹对应测量点的距离进行比较, 从中获 取距离目标 AP指纹对应测量点最近的邻近 AP指纹。 Secondly, according to the spacing between the measurement points of the respective AP fingerprints, the neighboring AP fingerprints corresponding to the measurement points of the target AP fingerprint are searched from the plurality of AP fingerprints found. Specifically, it can be used for other articles The AP fingerprint corresponding measurement points are respectively compared with the distances of the target AP fingerprint corresponding measurement points, and the neighboring AP fingerprints closest to the measurement point of the target AP fingerprint are obtained therefrom.
然后, 根据目标 AP指纹对应测量点的位置信息以及邻近 AP指纹对应测 量点的位置信息, 计算目标 AP指纹对应测量点到邻近 AP指纹对应测量点的 方向, 并根据目标 AP指纹的信号强度以及邻近 AP指纹的信号强度, 计算目 标 AP指纹与邻近 AP指纹的信号强度差。 进而根据目标 AP指纹对应测量点 到邻近 AP指纹对应测量点的方向,确定目标 AP指纹梯度方向,根据目标 AP 指纹与邻近 AP指纹的信号强度差, 确定目标 AP的梯度大小。  Then, according to the location information of the target AP fingerprint corresponding to the measurement point and the location information of the measurement point corresponding to the neighboring AP fingerprint, calculate the direction of the target AP fingerprint corresponding measurement point to the corresponding measurement point of the neighboring AP fingerprint, and according to the signal strength of the target AP fingerprint and the proximity The signal strength of the AP fingerprint calculates the signal strength difference between the target AP fingerprint and the neighboring AP fingerprint. Then, according to the direction of the target AP fingerprint corresponding to the measurement point of the neighboring AP fingerprint, the target AP fingerprint gradient direction is determined, and the gradient of the target AP is determined according to the signal strength difference between the target AP fingerprint and the neighboring AP fingerprint.
例如: 从指纹库中查找到与待定位的 AP的 MAC地址相同的 sum条 AP 指纹, 记为 FSsum, fSl e FSsum , 1^为 sum条 AP指纹中的其中一条指纹, 记为目 标 AP指纹, (Longitud , Latitude )为 fs对应测量点的位置信息, η为 fs的信号强 度; fSj e F SS U II , fSj为 sum 条 AP 指纹中距离 fs'最近的邻近 AP 指纹, (Longitudej , Latitudej )为 fSj对应测量点的位置信息, Pj为 fSj的信号强度, 则 AP 指纹与邻近 AP指纹的信号强度差 = Pi - Pj, fSl对应测量点到 fSj对应测量点 的方向 的计算公式如下: For example: Find the sum-strip AP fingerprint with the same MAC address as the AP to be located from the fingerprint database, and record it as FS sum , f Sl e FS sum , 1^ is one of the sum AP fingerprints, which is recorded as the target. AP fingerprint, (Longitud, Latitude) is the position information of the measurement point corresponding to fs, η is the signal strength of fs; f Sj e FS SU II , f Sj is the nearest neighbor AP fingerprint of distance fs 'in the AP fingerprint, (Longitudej , Latitud ej ) is f Sj corresponding to the position information of the measuring point, Pj is the signal strength of f Sj , then the signal intensity difference between the AP fingerprint and the neighboring AP fingerprint = Pi - Pj, f Sl corresponds to the measuring point of the f Sj corresponding measuring point The formula for calculating the direction is as follows:
calculate(Longitude . , Latitude . , Longitude . , Latitudej )  Calculate(Longitude . , Latitude . , Longitude . , Latitudej )
= arctan  = arctan
calculate(Longitudej , Latitudej , Longitudej , Latitudej ) 其中, calculate(Longitudej , Latitudej , Longitudej , Latitude; )是点 (Longitude , Latitude ) 到点 (Longitudej , Latitudej )的 巨离函数, calculateCLongitudej , Latitudej , Longitude; , Latitudej ) 是点(Longitudej , Latitudej )到点 (Longitude; , Latitudej )的 巨离函数。 Calculate(Longitudej , Latitudej , Longitudej , Latitudej ) where calculate(Longitudej , Latitudej , Longitudej , Latitude ; ) is the macro function of the point (Longitude , Latitude ) to the point ( Longitudej , Latitudej ), calculateCLongitudej , Latitudej , Longitude; , Latitudej ) is the macro function of the point (Longitudej , Latitudej ) to the point (Longitude; , Latitudej ).
进一步可选的, 可以将角度为 2π的圓周空间划分为多个量化区间, 每个 量化区间分别对应一个量化方向; 然后确定目标 ΑΡ指纹对应测量点到邻近 ΑΡ指纹对应测量点的方向所位于的量化区间; 最后才艮据确定的目标 ΑΡ指纹 对应测量点到邻近 ΑΡ指纹对应测量点的方向所位于的量化区间, 将目标 ΑΡ 指纹对应测量点到邻近 ΑΡ指纹对应测量点的方向处理得到一个量化方向。从 而根据所述目标 ΑΡ指纹对应测量点到所述邻近 ΑΡ指纹对应测量点的所述量 化方向, 确定所述目标 ΑΡ指纹的梯度方向。  Further optionally, the circular space with an angle of 2π may be divided into a plurality of quantization intervals, each of which corresponds to a quantization direction; and then the direction of the target ΑΡ fingerprint corresponding to the measurement point to the adjacent measurement point of the fingerprint is determined. Quantization interval; Finally, according to the determined target ΑΡ fingerprint corresponding to the measurement interval to the adjacent ΑΡ fingerprint corresponding measurement point in the quantization interval, the target ΑΡ fingerprint corresponding measurement point to the adjacent ΑΡ fingerprint corresponding measurement point processing to obtain a quantification direction. Therefore, the gradient direction of the target fingerprint is determined according to the quantization direction of the target ΑΡ fingerprint corresponding measurement point to the adjacent ΑΡ fingerprint corresponding measurement point.
例如: 将角度 [0, 2π]平均分为 8个量化区间, 当 fSl对应测量点到 fSj对应测 量点的方向 位于^ < 0≤2;r或 0 < 0≤ 时, 将 量化为 0; 当 fSl对应测量点For example: The angle [0, 2π] is equally divided into 8 quantization intervals, when f Sl corresponds to the measurement point to f Sj The direction of the quantum point is located at ^ < 0 ≤ 2; r or 0 < 0 ≤, it will be quantized to 0; when f Sl corresponds to the measurement point
J 8 8 J 到 fSj对 ≤6时, When J 8 8 J to f Sj is ≤ 6,
J 8 , ^ 8 ^+ 0≤i 将 量化为 J 8 , ^ 8 ^+ 0≤i will be quantified as
1 应测量点的方向 立于 ί^^ 4 1 should be measured in the direction of the point ί ^ ^ 4
(2i+l) * r π_  (2i+l) * r π_
8 + ~8 ° 8 + ~8 °
需要说明的是, 可以将上述查找到的多条 ΑΡ指纹的其中任何一条作为目 标 ΑΡ指纹, 在计算得到其中一条 ΑΡ指纹对应测量点到邻近 ΑΡ指纹对应测 量点的方向以及该 ΑΡ指纹与邻近 ΑΡ指纹的信号强度差之后, 然后依次计算 上述查找到的其他各条 ΑΡ指纹对应测量点到各自邻近 ΑΡ指纹对应测量点的 方向, 以及其他各条 ΑΡ指纹与各自邻近 ΑΡ指纹的信号强度差。  It should be noted that any one of the plurality of fingerprints found above may be used as the target fingerprint, and the direction of one of the fingerprint corresponding measurement points to the corresponding measurement point of the adjacent fingerprint and the fingerprint and the adjacent fingerprint may be calculated. After the difference between the signal strengths of the fingerprints, the direction of the corresponding measurement points of the other detected fingerprints to the corresponding measurement points of the respective fingerprints, and the signal intensity difference between the other fingerprints and the adjacent fingerprints are sequentially calculated.
最后, 可以根据所述目标 ΑΡ指纹与所述邻近 ΑΡ指纹的信号强度差, 确 定所述目标 ΑΡ指纹的梯度大小, 并根据所述目标 ΑΡ指纹对应测量点到所述 邻近 ΑΡ指纹对应测量点的方向, 确定所述目标 ΑΡ指纹的梯度方向。  Finally, the gradient of the target ΑΡ fingerprint may be determined according to the signal strength difference between the target ΑΡ fingerprint and the adjacent ΑΡ fingerprint, and the measurement point is corresponding to the measurement point of the neighbor ΑΡ fingerprint according to the target ΑΡ fingerprint Direction, determining the gradient direction of the target fingerprint.
具体实现中, 上述邻近 ΑΡ指纹包括距离所述目标 ΑΡ指纹对应测量点最 近的预设数目的 ΑΡ指纹, 可以首先按照如上述步骤中相同的计算方法计算目 标 ΑΡ指纹对应测量点到各条邻近 ΑΡ指纹对应测量点的方向,以及该目标 ΑΡ 指纹与各条邻近 ΑΡ指纹的信号强度差, 然后将位于所述目标 ΑΡ指纹对应测 量点相同方向上的所有邻近 ΑΡ指纹的信号强度差求和得到所述目标 ΑΡ指纹 对应测量点在该方向上的信号强度差, 最后比较位于所述目标 ΑΡ指纹对应测 量点不同方向上的信号强度差, 将所述最大的信号强度差作为所述目标 ΑΡ指 纹的梯度大小, 并将该信号强度差所在的方向作为所述目标 ΑΡ指纹的梯度方 向。  In a specific implementation, the neighboring fingerprint includes a preset number of fingerprints closest to the target corresponding to the target fingerprint, and may first calculate the target fingerprint corresponding measurement point to each neighbor according to the same calculation method as in the above steps. The fingerprint corresponds to the direction of the measurement point, and the difference between the target ΑΡ fingerprint and the signal strength of each adjacent ΑΡ fingerprint, and then sums the signal strength differences of all adjacent ΑΡ fingerprints located in the same direction of the target ΑΡ fingerprint corresponding to the measurement point. The target ΑΡ fingerprint corresponds to the signal strength difference of the measurement point in the direction, and finally compares the signal strength difference in different directions of the target ΑΡ fingerprint corresponding measurement point, and the maximum signal strength difference is used as the target ΑΡ fingerprint The gradient size, and the direction in which the signal intensity difference is located is taken as the gradient direction of the target fingerprint.
可选的, 可以根据查找到的多条 ΑΡ指纹对应测量点的位置信息以及信号 强度, 统计出在曲线经过这些测量点时 ΑΡ的信号强度函数, 然后对该 ΑΡ的 信号强度函数进行求导, 计算各条 ΑΡ指纹的梯度方向及梯度大小。  Optionally, according to the position information and the signal strength of the plurality of ΑΡ fingerprints corresponding to the detected points, the signal strength function of the 在 when the curve passes through the measurement points is calculated, and then the signal strength function of the ΑΡ is derivation. Calculate the gradient direction and gradient size of each fingerprint.
S304, 根据所述各条 ΑΡ指纹对应测量点之间的间距, 将查找到的所述多 条 ΑΡ指纹划分为多个聚类。  S304. The plurality of fingerprints that are found are divided into a plurality of clusters according to the spacing between the measurement points corresponding to the respective fingerprints.
具体实现中, 可以将距离相近的测量点对应的 ΑΡ指纹划归为一个类聚, 并按照查找到的多条 ΑΡ指纹对应测量点的具体位置分布, 选择相应的聚类数 量。 如图 5所示, 图中圓点为 AP指纹对应测量点, 五角星为各个类聚中的类 首的参考位置, 将查找到的 AP指纹划分为 3个(至少 3个)聚类, 每个聚类 中的 AP指纹对应测量点距离相近。 In the specific implementation, the fingerprints corresponding to the measuring points with similar distances can be classified into one cluster, and the corresponding position distribution of the measuring points according to the plurality of found fingerprints is selected, and the corresponding cluster number is selected. the amount. As shown in FIG. 5, the dot in the figure is the AP fingerprint corresponding measurement point, and the pentagram is the reference position of the class head in each cluster, and the found AP fingerprint is divided into three (at least three) clusters, each The AP fingerprints in the clusters are close to the measurement points.
5305, 根据各个聚类中各条 AP指纹的梯度大小、 梯度方向以及各条 AP 指纹对应测量点的位置信息, 确定各个聚类中类首的梯度方向和参考位置。  5305. Determine a gradient direction and a reference position of the class head in each cluster according to the gradient size of each AP fingerprint in each cluster, the gradient direction, and the location information of the corresponding measurement points of each AP fingerprint.
具体实现中, 聚类中的每条 AP指纹都有各自的梯度大小和梯度方向, 可 以将所述各个类聚中梯度大小为最大的 AP指纹的梯度方向作为所述各个聚类 中类首的梯度方向。其中,各个聚类中类首的参考位置为到类聚中各条指纹对 应测量点距离之和最近的点。  In a specific implementation, each of the AP fingerprints in the cluster has a respective gradient size and a gradient direction, and the gradient direction of the AP fingerprint with the largest gradient in each of the clusters may be used as the first class in the respective clusters. Gradient direction. The reference position of the class leader in each cluster is the point closest to the sum of the distances of the fingerprints corresponding to the fingerprints in the cluster.
5306, 根据所述各个聚类中类首的梯度方向和参考位置, 确定所述 AP的 水平位置。  5306. Determine a horizontal position of the AP according to a gradient direction and a reference position of the class head in each cluster.
可选的, 若所述各个聚类中类首的梯度方向上交于一点, 则将交点作为所 述 AP的水平位置, 如图 6所示, AP的水平位置为图中 3条射线的交点。  Optionally, if the gradient direction of the class leader in the respective clusters intersects at a point, the intersection point is used as the horizontal position of the AP, as shown in FIG. 6, the horizontal position of the AP is the intersection of the three rays in the figure. .
可选的, 若所述各个聚类中类首的梯度方向上交于多个点, 则确定所述各 个聚类中类首的梯度方向上的交叉区域;在所述交叉区域中确定一点作为所述 AP的水平位置, 所述各个聚类中类首的参考位置到该点的方向与所述各个聚 类中类首的梯度方向的夹角之和最小。具体的, 可以计算各个类聚中的类首的 参考位置到交叉区域中某一点的方向,这样可以得到 k个类首的参考位置到该 点的方向 将 k个类首的梯度方向表示为 ,k = l, 2, ..., K, 计算各个 聚类中类首的梯度方向与类首的参考位置到该点方向的差值,并计算得到差值 之和。 然后依次对交叉区域中的其他各点进行计算, 最小差值之和对应的点作 为待定位 AP的水平位置。  Optionally, if the gradient direction of the class leader in the respective clusters intersects at multiple points, determining an intersection region in a gradient direction of the class leader in each cluster; determining a point in the intersection region The horizontal position of the AP, the sum of the reference position of the class head in the respective clusters to the point and the angle of the gradient direction of the class heads in the respective clusters being the smallest. Specifically, the reference position of the class head in each cluster can be calculated to the direction of a certain point in the intersection region, so that the reference position of the k class heads can be obtained to indicate the gradient direction of the k class heads. k = l, 2, ..., K, calculate the difference between the gradient direction of the class head in each cluster and the reference position of the class head to the point direction, and calculate the sum of the differences. Then, the other points in the intersection area are calculated in turn, and the point corresponding to the sum of the minimum differences is used as the horizontal position of the AP to be located.
可选的, 如图 7所示, 若所述各个聚类中类首的梯度方向上交于多个点, 还可以将 AP可能存在的位置区域划分为多个栅格, 计算各个类聚中的类首的 参考位置到某一栅格 Gddi的方向,这样可以得到 k个类首的参考位置到该栅格 的方向 将 k个类首的梯度方向表示为 ,k = l, 2, ..., K, 计算各个聚 类中类首的梯度方向与类首的参考位置到该栅格的方向的差值,并计算得到差 值之和。 然后依次对其他栅格进行计算, 最小差值之和对应的栅格作为待定位 AP的定位栅格, 最后将定位栅格的中心点作为 AP的水平位置。 在本发明实施例中, 通过从预先建立的 AP指纹库中查找与待定位的 AP 的 MAC地址相同的多条 AP指纹, 从而根据查找到的多条 AP指纹对应测量 点的位置信息以及信号强度, 计算查找到的各条 AP指纹的梯度大小和梯度方 向; 最后根据所述各条 AP指纹的梯度大小和梯度方向, 确定所述 AP的水平 位置, 从而达到提高 AP定位的精确度的目的。 请参考图 4, 图 4是本发明第三实施例提出的一种定位 AP的方法的流程 图。 如图所示, 本发明实施例中的定位 AP的方法包括: Optionally, as shown in FIG. 7 , if the gradient direction of the class leader in the respective clusters intersects at multiple points, the location area where the AP may exist may be divided into multiple grids, and each cluster is calculated. The reference position of the class head to the direction of a grid Gddi, so that the reference position of the k class heads can be obtained to the direction of the grid, and the gradient direction of the k class heads is expressed as k = l, 2, .. ., K, calculate the difference between the gradient direction of the class head in each cluster and the direction of the reference position of the class head to the direction of the grid, and calculate the sum of the differences. Then, the other grids are calculated in sequence, and the grid corresponding to the sum of the minimum differences is used as the positioning grid of the AP to be located, and finally the center point of the positioning grid is taken as the horizontal position of the AP. In the embodiment of the present invention, by searching for a plurality of AP fingerprints that are the same as the MAC address of the AP to be located, the location information and the signal strength of the corresponding measurement points are obtained according to the found multiple AP fingerprints. Calculating the gradient size and gradient direction of each AP fingerprint found; finally, determining the horizontal position of the AP according to the gradient size and the gradient direction of each AP fingerprint, thereby achieving the purpose of improving the accuracy of the AP positioning. Please refer to FIG. 4. FIG. 4 is a flowchart of a method for locating an AP according to a third embodiment of the present invention. As shown in the figure, the method for locating an AP in the embodiment of the present invention includes:
S401 , 获取预先建立的 AP指纹库, 所述 AP指纹库包括在多个测量点获 取到的多条 AP指纹。  S401. Obtain a pre-established AP fingerprint database, where the AP fingerprint database includes multiple AP fingerprints obtained at multiple measurement points.
具体实现中, 在对建筑物内的 AP进行定位时, 可以围绕着建筑物设置多 处测量点, 在每个测量点分别测量该测量点的位置信息, AP的 MAC地址以 及该 AP的信号强度, 其中, 测量点的位置信息可以是测量点的经度和维度。 AP指纹还可以包括该 AP的服务集标识, 服务集标识为网络名称。 在多个测 量点获取到多条 AP指纹后, 可以将这些 AP指纹建立一个指纹库, 按照 AP 指纹的信号强度对各条 AP指纹进行排序。 需要说明的是, 在同一测量点可能 获取到不同 AP的信号, 因此, 在该测量点获取到的 AP的 MAC地址, 该 AP 的信号强度以及服务集标识都可能不同。  In the specific implementation, when positioning the AP in the building, multiple measurement points can be set around the building, and the position information of the measurement point, the MAC address of the AP, and the signal strength of the AP are respectively measured at each measurement point. Wherein, the location information of the measurement point may be the longitude and dimension of the measurement point. The AP fingerprint may also include a service set identifier of the AP, and the service set identifier is a network name. After acquiring multiple AP fingerprints at multiple measurement points, these AP fingerprints can be built into a fingerprint database, and each AP fingerprint is sorted according to the signal strength of the AP fingerprint. It should be noted that the signals of different APs may be obtained at the same measurement point. Therefore, the signal strength of the AP and the service set identifier of the AP may be different at the MAC address of the AP obtained at the measurement point.
S402, 从所述 AP指纹库中查找与待定位的 AP的 MAC地址相同的多条 AP指纹。  S402. Search for, from the AP fingerprint database, multiple AP fingerprints that are the same as the MAC address of the AP to be located.
具体实现中, 可以首先获取待定位的 AP的 MAC地址, 然后将待定位的 AP的 MAC地址与指纹库中的每条 AP指纹进行对比,若指纹库中的 AP指纹 对应的 AP的 MAC地址与待定位的 AP的 MAC地址相同,则从 AP指纹库中 查找出来。  In a specific implementation, the MAC address of the AP to be located may be obtained first, and then the MAC address of the AP to be located is compared with each AP fingerprint in the fingerprint database, and the MAC address of the AP corresponding to the AP fingerprint in the fingerprint database is If the MAC address of the AP to be located is the same, it is searched from the AP fingerprint database.
5403, 根据查找到的各条 AP指纹对应测量点的位置信息, 计算所述各条 AP指纹对应测量点之间的间距。其中, AP指纹对应测量点的位置信息记录了 测量点的经度和维度, 因此可以利用距离计算公式计算各条 AP指纹对应测量 点之间的距离  S403: Calculate, according to the location information of each AP fingerprint corresponding to the measurement point, the spacing between the measurement points of the AP fingerprints. The location information of the AP fingerprint corresponding to the measurement point records the longitude and dimension of the measurement point, so the distance calculation formula can be used to calculate the distance between the measurement points of each AP fingerprint.
5404, 根据所述各条 AP指纹对应测量点之间的间距, 从查找到的所述多 条 AP指纹中查找目标 AP指纹对应测量点的邻近 AP指纹。 5404. According to the spacing between the measurement points corresponding to the pieces of the AP fingerprints, the plurality of Find the neighboring AP fingerprint of the target AP fingerprint corresponding to the measurement point in the AP fingerprint.
具体实现中, 在上述步骤中计算得到查找到的其他各条 AP指纹分别到目 标 AP指纹的间距, 在本步骤中可以对其他各条 AP指纹对应测量点分别到目 标 AP指纹对应测量点的距离进行比较, 从中获取距离目标 AP指纹对应测量 点最近的邻近 AP指纹。  In the specific implementation, the distances of the other AP fingerprints that are found to the target AP fingerprints are calculated in the foregoing steps. In this step, the distances of the corresponding AP fingerprint corresponding measurement points to the target AP fingerprint corresponding measurement points are respectively determined. For comparison, the neighboring AP fingerprint closest to the measurement point corresponding to the target AP fingerprint is obtained therefrom.
S405, 根据所述目标 AP指纹对应测量点的位置信息以及所述邻近 AP指 纹对应测量点的位置信息, 计算所述目标 AP指纹对应测量点到所述邻近 AP 指纹对应测量点的方向, 并根据所述目标 AP指纹的信号强度以及所述邻近 AP指纹的信号强度,计算所述目标 AP指纹与所述邻近 AP指纹的信号强度差。 进而 4艮据目标 AP指纹对应测量点到邻近 AP指纹对应测量点的方向, 确定目 标 AP指纹梯度方向, 根据目标 AP指纹与邻近 AP指纹的信号强度差, 确定 目标 AP的梯度大小。  S405, calculating, according to the location information of the target AP fingerprint corresponding measurement point and the location information of the neighboring AP fingerprint corresponding measurement point, the direction of the target AP fingerprint corresponding measurement point to the neighboring AP fingerprint corresponding measurement point, and according to A signal strength of the target AP fingerprint and a signal strength of the neighboring AP fingerprint, and calculating a signal strength difference between the target AP fingerprint and the neighboring AP fingerprint. Further, according to the direction of the target AP fingerprint corresponding measurement point to the corresponding AP fingerprint corresponding measurement point, the target AP fingerprint gradient direction is determined, and the gradient of the target AP is determined according to the signal strength difference between the target AP fingerprint and the neighboring AP fingerprint.
例如: 从指纹库中查找到与待定位的 AP的 MAC地址相同的 sum条 AP 指纹, 记为 FSsum, fSi e FSsum , ^为 sum条 AP指纹中的其中一条指纹, 记为目 标 AP指纹, (Longitudei , Latitude )为 fs对应测量点的位置信息, η为 fs的信号强 度; fSj e F SSUII , fSj为 sum 条 AP 指纹中距离 fs '最近的邻近 AP 指纹, (Longitudej , Latitudej )为 fSj对应测量点的位置信息, Pj为 fSj的信号强度, 则 AP 指纹与邻近 AP指纹的信号强度差 = Pi - Pj, fSl对应测量点到 fSj对应测量点 的方向 的计算公式如下: For example: Find the sum-strip AP fingerprint with the same MAC address as the AP to be located from the fingerprint database, denoted as FS sum , f Si e FS sum , ^ is one of the fingerprints of the sum AP fingerprint, which is recorded as the target AP. Fingerprint, (Longitudei, Latitude) is the position information of the measurement point corresponding to fs, η is the signal strength of fs; f Sj e FS SUII , f Sj is the nearest neighbor AP fingerprint of distance fs 'in the AP fingerprint, (Longitudej, Latitud Ej ) is f Sj corresponding to the position information of the measuring point, Pj is the signal strength of f Sj , then the signal intensity difference between the AP fingerprint and the neighboring AP fingerprint = Pi - Pj, f Sl corresponds to the direction of the measuring point to the measuring point of f Sj Calculated as follows:
calculate(Longitude . , Latitude. , Longitude. , Latitudej )  Calculate(Longitude . , Latitude. , Longitude. , Latitudej )
= arctan  = arctan
calculate(Longitudej , Latitudej , Longitudej , Latitudej ) 其中, calculate(Longitudej , Latitudej , Longitudej , Latitude )是点 (Longitudej , Latitudej ) 到点 (Longitudej , Latitud )的 巨离函数, calculateiLongitudej , Latitudej , Longitude; , Latitudej ) 是点(Longitudej , Latitude )到点 (Longitud , Latitude )的 巨离函数。  Calculate(Longitudej , Latitudej , Longitudej , Latitudej ) where calculate(Longitudej , Latitudej , Longitudej , Latitude ) is the macro function of the point (Longitudej , Latitudej ) to the point (Longitudej , Latitud ), calculateiLongitudej , Latitudej , Longitude; , Latitudej ) It is the giant function of the point (Longitudej, Latitude) to the point (Longitud, Latitude).
进一步可选的, 可以将角度为 2π的圓周空间划分为多个量化区间, 每个 量化区间分别对应一个量化方向; 然后确定目标 ΑΡ指纹对应测量点到邻近 ΑΡ指纹对应测量点的方向所位于的量化区间; 最后才艮据确定的目标 ΑΡ指纹 对应测量点到邻近 ΑΡ指纹对应测量点的方向所位于的量化区间, 将目标 ΑΡ 指纹对应测量点到邻近 AP指纹对应测量点的方向处理得到一个量化方向。从 而根据所述目标 AP指纹对应测量点到所述邻近 AP指纹对应测量点的所述量 化方向, 确定所述目标 AP指纹的梯度方向。 Further optionally, the circular space with an angle of 2π may be divided into a plurality of quantization intervals, each of which corresponds to a quantization direction; and then the direction of the target ΑΡ fingerprint corresponding to the measurement point to the adjacent measurement point of the fingerprint is determined. Quantization interval; Finally, according to the determined target ΑΡ fingerprint corresponding to the measurement interval to the adjacent ΑΡ fingerprint corresponding measurement point in the quantization interval, the target ΑΡ The fingerprint is processed in the direction corresponding to the measurement point of the adjacent AP fingerprint to obtain a quantization direction. Therefore, determining a gradient direction of the target AP fingerprint according to the quantization direction of the target AP fingerprint corresponding measurement point to the neighboring AP fingerprint corresponding measurement point.
例如: 将角度 [0, 2π]平均分为 8个量化区间, 当 fs对应测量点到 fSj对应测 量点的方向 位于^ < 0≤2;τ或 0 < 0≤ 时, 将 量化为 0; 当 fSl对应测量点 For example: The angle [0, 2π] is equally divided into 8 quantization intervals. When the direction corresponding to the measurement point of fs corresponding to f Sj is located at ^ < 0 ≤ 2; τ or 0 < 0 ≤, it will be quantized to 0; When f Sl corresponds to the measurement point
J 8 8 J J 8 8 J
fSj对应测量点的方向 位于 i±^, 0≤i≤6时, 将 量化为 When the direction corresponding to the measurement point of fSj is at i±^, 0≤i≤6, it will be quantified as
1 J 8 ^± 8^u 4 1 J 8 ^± 8^u 4
(2i+l) * r π_  (2i+l) * r π_
8 + °  8 + °
需要说明的是, 可以将上述查找到的多条 ΑΡ指纹的其中任何一条作为目 标 ΑΡ指纹, 在计算得到其中一条 ΑΡ指纹对应测量点到邻近 ΑΡ指纹对应测 量点的方向以及该 ΑΡ指纹与邻近 ΑΡ指纹的信号强度差之后, 然后依次计算 上述查找到的其他各条 ΑΡ指纹对应测量点到各自邻近 ΑΡ指纹对应测量点的 方向, 以及其他各条 ΑΡ指纹与各自邻近 ΑΡ指纹的信号强度差。  It should be noted that any one of the plurality of fingerprints found above may be used as the target fingerprint, and the direction of one of the fingerprint corresponding measurement points to the corresponding measurement point of the adjacent fingerprint and the fingerprint and the adjacent fingerprint may be calculated. After the difference between the signal strengths of the fingerprints, the direction of the corresponding measurement points of the other detected fingerprints to the corresponding measurement points of the respective fingerprints, and the signal intensity difference between the other fingerprints and the adjacent fingerprints are sequentially calculated.
S406, 根据所述目标 ΑΡ指纹与所述邻近 ΑΡ指纹的信号强度差, 确定所 述目标 ΑΡ指纹的梯度大小, 并根据所述目标 ΑΡ指纹对应测量点到所述邻近 ΑΡ指纹对应测量点的方向, 确定所述目标 ΑΡ指纹的梯度方向。  S406. Determine, according to a signal strength difference between the target fingerprint and the neighboring fingerprint, a gradient size of the target fingerprint, and according to the target fingerprint corresponding to a measurement point to a direction corresponding to the neighboring fingerprint. , determining a gradient direction of the target ΑΡ fingerprint.
具体实现中, 上述邻近 ΑΡ指纹包括距离所述目标 ΑΡ指纹对应测量点最 近的预设数目的 ΑΡ指纹, 可以首先按照如上述步骤中相同的计算方法计算目 标 ΑΡ指纹对应测量点到各条邻近 ΑΡ指纹对应测量点的方向,以及该目标 ΑΡ 指纹与邻近 ΑΡ指纹的信号强度差, 然后将位于所述目标 ΑΡ指纹对应测量点 相同方向上的所有邻近 ΑΡ指纹的信号强度差求和得到所述目标 ΑΡ指纹对应 测量点在该方向上的信号强度差, 最后比较位于所述目标 ΑΡ指纹对应测量点 不同方向上的信号强度差, 将所述最大的信号强度差作为所述目标 ΑΡ指纹的 梯度大小, 并将该信号强度差所在的方向作为所述目标 ΑΡ指纹的梯度方向。  In a specific implementation, the neighboring fingerprint includes a preset number of fingerprints closest to the target corresponding to the target fingerprint, and may first calculate the target fingerprint corresponding measurement point to each neighbor according to the same calculation method as in the above steps. The fingerprint corresponds to the direction of the measurement point, and the signal intensity difference between the target 指纹 fingerprint and the adjacent ΑΡ fingerprint, and then sums the signal strength differences of all adjacent ΑΡ fingerprints located in the same direction of the target ΑΡ fingerprint corresponding to the measurement point to obtain the target The fingerprint corresponds to the difference in signal strength of the measurement point in the direction, and finally compares the signal strength difference in different directions of the target corresponding to the target fingerprint, and the maximum signal strength difference is used as the gradient of the target fingerprint And the direction in which the signal strength difference is located is taken as the gradient direction of the target fingerprint.
可选的, 可以根据查找到的多条 ΑΡ指纹对应测量点的位置信息以及信号 强度, 统计出在曲线经过这些测量点时 ΑΡ的信号强度函数, 然后对该 ΑΡ的 信号强度函数进行求导, 计算各条 ΑΡ指纹的梯度方向及梯度大小。 S407, 根据所述各条 AP指纹的梯度大小和梯度方向, 确定所述 AP的水 平位置。 Optionally, according to the position information and the signal strength of the plurality of ΑΡ fingerprints corresponding to the detected points, the signal strength function of the 在 when the curve passes through the measurement points is calculated, and then the signal strength function of the ΑΡ is derivation. Calculate the gradient direction and gradient size of each fingerprint. S407. Determine a horizontal position of the AP according to a gradient size and a gradient direction of each of the AP fingerprints.
具体实现中, 若步骤 S402从 AP指纹库中查找到与待定位的 AP的 MAC 地址相同的 AP指纹只有三条,并且该三条 AP指纹在其梯度方向上交于一点, 则将交点作为所述 AP的水平位置。  In a specific implementation, if the step S402 finds that there are only three AP fingerprints in the AP fingerprint database that are the same as the MAC address of the AP to be located, and the three AP fingerprints intersect in a gradient direction, the intersection point is used as the AP. The horizontal position.
可选的, 首先根据所述各条 AP指纹对应测量点之间的间距, 将查找到的 所述多条 AP指纹划分为多个聚类。 然后将距离相近的测量点对应的 AP指纹 划归为一个类聚, 并按照查找到的多条 AP指纹对应测量点的具体位置分布, 选择相应的聚类数量。 如图 5所示, 图中圓点为 AP指纹对应测量点, 五角星 为各个类聚中的类首的参考位置,将查找到的 AP指纹划分为 3个(至少 3个) 聚类, 每个聚类中的 AP指纹对应测量点距离相近。  Optionally, the multiple AP fingerprints that are found are divided into multiple clusters according to the spacing between the measurement points of the AP fingerprints. Then, the AP fingerprints corresponding to the measurement points with similar distances are classified into one cluster, and the corresponding clusters are selected according to the specific location distribution of the corresponding AP fingerprints. As shown in FIG. 5, the dot in the figure is the AP fingerprint corresponding measurement point, and the pentagram is the reference position of the class head in each cluster, and the found AP fingerprint is divided into three (at least three) clusters, each The AP fingerprints in the clusters are close to the measurement points.
然后, 根据各个聚类中各条 AP指纹的梯度大小、 梯度方向以及各条 AP 指纹对应测量点的位置信息,确定各个聚类中类首的梯度方向和参考位置。具 体实现中, 聚类中的每条 AP指纹都有各自的梯度大小和梯度方向, 可以将所 述各个类聚中梯度大小为最大的 AP指纹的梯度方向作为所述各个聚类中类首 的梯度方向。其中,各个聚类的类首的参考位置为到类聚中各个指纹对应测量 点距离之和最近的点。  Then, according to the gradient size of each AP fingerprint in each cluster, the gradient direction, and the position information of the corresponding measurement points of each AP fingerprint, the gradient direction and the reference position of the class head in each cluster are determined. In a specific implementation, each of the AP fingerprints in the cluster has a respective gradient size and a gradient direction, and the gradient direction of the AP fingerprint with the largest gradient in each of the clusters may be used as the first class in the respective clusters. Gradient direction. The reference position of the class head of each cluster is the closest to the sum of the distances of the corresponding measurement points of each fingerprint in the cluster.
最后, 根据所述各个聚类中类首的梯度方向和参考位置, 确定所述 AP的 水平位置。  Finally, the horizontal position of the AP is determined according to the gradient direction and the reference position of the class head in each cluster.
进一步可选的, 若所述各个聚类中类首的梯度方向上交于一点, 则将交点 作为所述 AP的水平位置, 如图 6所示, AP的水平位置为图中 3条射线的交 点。  Further, if the gradient direction of the class leader in the respective clusters intersects at a point, the intersection point is taken as the horizontal position of the AP, as shown in FIG. 6, the horizontal position of the AP is 3 rays in the figure. Intersection.
进一步可选的, 若所述各个聚类中类首的梯度方向上交于多个点, 则确定 所述各个聚类中类首的梯度方向上的交叉区域;在所述交叉区域中确定一点作 为所述 AP的水平位置, 所述各个聚类中类首的参考位置到该点的方向与所述 各个聚类中类首的梯度方向的夹角之和最小。具体的, 可以计算各个类聚中的 类首的参考位置到交叉区域中某一点的方向,这样可以得到 k个类首的参考位 置到该点的方向 , 将 k个类首的梯度方向表示为 ,k = l,2, ..., K, 计 算各个聚类中类首的梯度方向与类首的参考位置到该点方向的差值,并计算得 到差值之和。 然后依次对交叉区域中的其他各点进行计算, 最小差值之和对应 的点作为待定位 AP的水平位置。 Further, if the gradient direction of the class leader in the respective clusters intersects a plurality of points, determining an intersection region in a gradient direction of the class leader in each of the clusters; determining a point in the intersection region As a horizontal position of the AP, a sum of a reference position of the head of the cluster to the point of the point and a gradient direction of the head of the cluster in each cluster is the smallest. Specifically, the reference position of the class head in each cluster can be calculated to the direction of a certain point in the intersection region, so that the reference position of the k class heads can be obtained to the direction of the point, and the gradient direction of the k class heads is expressed as , k = l, 2, ..., K, calculate the difference between the gradient direction of the class head in each cluster and the reference position of the class head to the point direction, and calculate The sum of the differences. Then, the other points in the intersection area are sequentially calculated, and the point corresponding to the sum of the minimum differences is taken as the horizontal position of the AP to be located.
进一步可选的,如图 7所示, 若所述各个聚类中类首的梯度方向上交于多 个点, 还可以将 AP可能存在的位置区域划分为多个栅格, 计算各个类聚中的 类首的参考位置到某一栅格 Gddi的方向,这样可以得到 k个类首的参考位置到 该栅格的方向 将 k个类首的梯度方向表示为 ,k = l, 2,..., K, 计算 各个聚类中类首的梯度方向与类首的参考位置到该栅格方向的差值,并计算得 到差值之和。 然后依次对其他栅格进行计算, 最小差值之和对应的栅格作为待 定位 AP的定位栅格, 最后将定位栅格的中心点作为 AP的水平位置。  Further, as shown in FIG. 7 , if the gradient direction of the class leader in the respective clusters intersects at multiple points, the location area where the AP may exist may be divided into multiple grids, and each cluster is calculated. The reference position of the class head in the direction of a certain grid Gddi, so that the reference position of the k class heads can be obtained to the direction of the grid, and the gradient direction of the k class heads is expressed as k = l, 2,. .., K, calculate the difference between the gradient direction of the class head in each cluster and the reference position of the class head to the grid direction, and calculate the sum of the differences. Then, the other grids are calculated in sequence, and the grid corresponding to the sum of the minimum differences is used as the positioning grid of the AP to be located, and finally the center point of the positioning grid is taken as the horizontal position of the AP.
在本发明实施例中, 通过从预先建立的 AP指纹库中查找与待定位的 AP 的 MAC地址相同的多条 AP指纹, 从而根据查找到的多条 AP指纹对应测量 点的位置信息以及信号强度, 计算查找到的各条 AP指纹的梯度大小和梯度方 向; 最后根据所述各条 AP指纹的梯度大小和梯度方向, 确定所述 AP的水平 位置, 从而达到提高 AP定位的精确度的目的。 请参考图 8, 图 8是本发明实施例提供的一种 AP定位 AP装置, 该装置 可以为网络管理设备或者基站。 如图所示, 本发明实施例中的定位 AP的装置 包括:  In the embodiment of the present invention, by searching for a plurality of AP fingerprints that are the same as the MAC address of the AP to be located, the location information and the signal strength of the corresponding measurement points are obtained according to the found multiple AP fingerprints. Calculating the gradient size and gradient direction of each AP fingerprint found; finally, determining the horizontal position of the AP according to the gradient size and the gradient direction of each AP fingerprint, thereby achieving the purpose of improving the accuracy of the AP positioning. Referring to FIG. 8, FIG. 8 is an AP positioning AP device according to an embodiment of the present invention, which may be a network management device or a base station. As shown in the figure, the device for locating an AP in the embodiment of the present invention includes:
信息获取模块 801, 用于获取预先建立的 AP指纹库, 所述 AP指纹库包 括在多个测量点获取到的多条 AP指纹, 所述 AP指纹包括对应测量点的位置 信息、 AP的 MAC地址以及该 AP的信号强度。  The information obtaining module 801 is configured to acquire a pre-established AP fingerprint database, where the AP fingerprint database includes a plurality of AP fingerprints acquired at a plurality of measurement points, where the AP fingerprint includes location information of a corresponding measurement point, and a MAC address of the AP. And the signal strength of the AP.
具体实现中, 在对建筑物内的 AP进行定位时, 可以围绕着建筑物设置多 处测量点, 在每个测量点分别测量该测量点的位置信息, AP的 MAC地址以 及该 AP的信号强度, 其中, 测量点的位置信息可以是测量点的经度和维度, AP指纹还可以包括该 AP的服务集标识, 服务集标识为网络名称, 终端只有 设置服务集标识才能进入到该网络。 在多个测量点获取到多条 AP指纹后, 可 以将这些 AP指纹建立一个指纹库, 按照 AP指纹的信号强度对各条 AP指纹 进行排序。 需要说明的是, 在同一测量点可能获取到不同 AP的信号, 因此, 在该测量点获取到的 AP的 MAC地址, 该 AP的信号强度以及服务集标识都 可能不同。 In the specific implementation, when positioning the AP in the building, multiple measurement points can be set around the building, and the position information of the measurement point, the MAC address of the AP, and the signal strength of the AP are respectively measured at each measurement point. The location information of the measurement point may be the longitude and dimension of the measurement point, and the AP fingerprint may also include the service set identifier of the AP, and the service set identifier is the network name, and the terminal can enter the network only by setting the service set identifier. After obtaining multiple AP fingerprints at multiple measurement points, these AP fingerprints can be built into a fingerprint database, and each AP fingerprint is sorted according to the signal strength of the AP fingerprint. It should be noted that the signals of different APs may be acquired at the same measurement point. Therefore, the MAC address of the AP acquired at the measurement point, the signal strength of the AP, and the service set identifier are both May be different.
信息查找模块 802,用于从所述 AP指纹库中查找与待定位的 AP的 MAC 地址相同的多条 AP指纹。  The information search module 802 is configured to search, from the AP fingerprint database, a plurality of AP fingerprints that are the same as the MAC address of the AP to be located.
具体实现中, 可以首先获取待定位的 AP的 MAC地址, 然后将待定位的 AP的 MAC地址与指纹库中的每条 AP指纹进行对比,若指纹库中的 AP指纹 对应的 AP的 MAC地址与待定位的 AP的 MAC地址相同,则从 AP指纹库中 查找出来。  In a specific implementation, the MAC address of the AP to be located may be obtained first, and then the MAC address of the AP to be located is compared with each AP fingerprint in the fingerprint database, and the MAC address of the AP corresponding to the AP fingerprint in the fingerprint database is If the MAC address of the AP to be located is the same, it is searched from the AP fingerprint database.
信息计算模块 803, 用于根据查找到的所述多条 AP指纹对应测量点的位 置信息以及信号强度, 计算查找到的各条 AP指纹的梯度大小和梯度方向。  The information calculation module 803 is configured to calculate a gradient size and a gradient direction of each of the found AP fingerprints according to the found location information of the plurality of AP fingerprint corresponding measurement points and the signal strength.
可选的, 如图 9所示, 信息计算模块 803可以进一步包括:  Optionally, as shown in FIG. 9, the information calculation module 803 may further include:
指纹间距计算单元 901, 用于根据查找到的各条 AP指纹对应测量点的位 置信息, 计算所述各条 AP指纹对应测量点之间的间距。 其中, AP指纹对应 测量点的位置信息记录了测量点的经度和维度,因此可以利用距离计算公式计 算其他各条 AP指纹对应测量点分别到目标 AP指纹对应测量点的距离。  The fingerprint spacing calculation unit 901 is configured to calculate a spacing between the measurement points of the respective AP fingerprints according to the location information of the corresponding measurement points of the AP fingerprints. The location information of the AP fingerprint corresponding to the measurement point records the longitude and dimension of the measurement point. Therefore, the distance calculation formula can be used to calculate the distance from the corresponding measurement points of the other AP fingerprints to the corresponding measurement points of the target AP fingerprint.
邻近指纹查找单元 902, 用于根据所述各条 AP指纹对应测量点之间的间 距, 从查找到的所述多条 AP指纹中查找目标 AP指纹对应测量点的邻近 AP 指纹。  The proximity fingerprint searching unit 902 is configured to search for a neighboring AP fingerprint corresponding to the measurement point of the target AP fingerprint from the plurality of AP fingerprints that are obtained according to the distance between the measurement points of the respective AP fingerprints.
具体的, 可以对其他各条 AP指纹对应测量点分别到目标 AP指纹对应测 量点的距离进行比较, 从中获取距离目标 AP指纹对应测量点最近的邻近 AP 指纹。  Specifically, the distances of the corresponding AP fingerprint corresponding measurement points to the target AP fingerprint corresponding measurement points are compared, and the neighboring AP fingerprints closest to the target AP fingerprint corresponding measurement points are obtained therefrom.
指纹信息计算单元 903, 用于根据所述目标 AP指纹对应测量点的位置信 息以及所述邻近 AP指纹对应测量点的位置信息, 计算所述目标 AP指纹对应 测量点到所述邻近 AP指纹对应测量点的方向, 并才艮据所述目标 AP指纹的信 号强度以及所述邻近 AP指纹的信号强度, 计算所述目标 AP指纹与所述邻近 AP指纹的信号强度差。进而根据目标 AP指纹对应测量点到邻近 AP指纹对应 测量点的方向, 确定目标 AP指纹梯度方向, 根据目标 AP指纹与邻近 AP指 纹的信号强度差确定目标 AP的梯度大小。  The fingerprint information calculation unit 903 is configured to calculate, according to the location information of the measurement point corresponding to the target AP fingerprint and the location information of the measurement point corresponding to the neighboring AP fingerprint, the corresponding measurement of the target AP fingerprint corresponding measurement point to the neighboring AP fingerprint The direction of the point, and the signal strength difference between the target AP fingerprint and the neighboring AP fingerprint is calculated according to the signal strength of the target AP fingerprint and the signal strength of the neighboring AP fingerprint. Then, according to the direction of the target AP fingerprint corresponding measurement point to the corresponding AP fingerprint corresponding measurement point, the target AP fingerprint gradient direction is determined, and the gradient of the target AP is determined according to the signal strength difference between the target AP fingerprint and the adjacent AP fingerprint.
例如: 从指纹库中查找到与待定位的 AP的 MAC地址相同的 sum条 AP 指纹, 记为 FSsum, fSl e FSsum , 1^为 sum条 AP指纹中的其中一条指纹, 记为目 标 AP指纹, (Longitudei , Latitude )为 fs对应测量点的位置信息, Pt为 fs的信号强 度; fSj e F ¾U II , fSj为 sum 条 AP 指纹中距离 fs '最近的邻近 AP 指纹, (Longitudej , Latitudej )为 fSj对应测量点的位置信息, Pj为 fSj的信号强度, 则 AP 指纹与邻近 AP指纹的信号强度差 = Pi - Pj, fSl对应测量点到 fSj对应测量点 的方向 的计算公式如下: For example: Find the sum-strip AP fingerprint with the same MAC address as the AP to be located from the fingerprint database, and record it as FS sum , f Sl e FS sum , 1^ is one of the sum AP fingerprints, which is recorded as Target AP fingerprint, (Longitudei, Latitude) is the position information of fs corresponding to the measurement point, P t is the signal strength of fs; f Sj e F 3⁄4 U II , f Sj is sum AP fingerprint distance fs ' nearest neighbor AP fingerprint (Longitudej , Latitud ej ) is the position information of f Sj corresponding to the measurement point, Pj is the signal strength of f Sj , then the signal strength difference between the AP fingerprint and the neighboring AP fingerprint = Pi - Pj, f Sl corresponds to the measurement point to f Sj The calculation formula for the direction of the measuring point is as follows:
calculate( Longitude - , Latitudej , Longitudej , Latitude; )  Calculate( Longitude - , Latitudej , Longitudej , Latitude; )
= arctan  = arctan
calculate(Longitudej , Latitudej , Longitude; , Latitudej ) 其中, calculate(Longitudej , Latitudej , Longitudej , Latitude; )是点 (Longitudej , Latitudej ) 到点 (Longitudej , Latitudej )的 巨离函数, calculateiLongitudej , Latitudej , Longitude; , Latitudej ) 是点(Longitudej , Latitude) )到点 (Longitude; , Latitude) )的 巨离函数。 Calculate(Longitudej , Latitudej , Longitude; , Latitudej ) where calculate(Longitudej , Latitudej , Longitudej , Latitude ; ) is the macro function of the point (Longitudej , Latitudej ) to the point (Longitudej , Latitudej ), calculateiLongitudej , Latitudej , Longitude; Latitudej ) is the macro function of the point (Longitude; Latitude) to the point (Longitude; , Latitude).
进一步可选的, 可以将角度为 2π的圓周空间划分为多个量化区间, 每个 量化区间分别对应一个量化方向; 然后确定目标 ΑΡ指纹对应测量点到邻近 ΑΡ指纹对应测量点的方向所位于的量化区间; 最后才艮据确定的目标 ΑΡ指纹 对应测量点到邻近 ΑΡ指纹对应测量点的方向所位于的量化区间, 将目标 ΑΡ 指纹对应测量点到邻近 ΑΡ指纹对应测量点的方向处理得到一个量化方向。从 而根据所述目标 ΑΡ指纹对应测量点到所述邻近 ΑΡ指纹对应测量点的所述量 化方向, 确定所述目标 ΑΡ指纹的梯度方向。  Further optionally, the circular space with an angle of 2π may be divided into a plurality of quantization intervals, each of which corresponds to a quantization direction; and then the direction of the target ΑΡ fingerprint corresponding to the measurement point to the adjacent measurement point of the fingerprint is determined. Quantization interval; Finally, according to the determined target ΑΡ fingerprint corresponding to the measurement interval to the adjacent ΑΡ fingerprint corresponding measurement point in the quantization interval, the target ΑΡ fingerprint corresponding measurement point to the adjacent ΑΡ fingerprint corresponding measurement point processing to obtain a quantification direction. Therefore, the gradient direction of the target fingerprint is determined according to the quantization direction of the target ΑΡ fingerprint corresponding measurement point to the adjacent ΑΡ fingerprint corresponding measurement point.
例如: 将角度 [0, 2π]平均分为 8个量化区间, 当 fSl对应测量点到 fSj对应测 量点的方向 位于^ < 0≤2;τ或 0 < 0≤ 时, 将 量化为 0; 当 fSl对应测量点 到 fSj对应测量点的方向^位于 i±^,^±^+ 0≤i≤6时, 将 量化为For example: The angle [0, 2π] is equally divided into 8 quantization intervals. When f Sl corresponds to the direction of the measurement point to f Sj corresponding to the measurement point is ^ < 0 ≤ 2; τ or 0 < 0 ≤, it will be quantized to 0. When f Sl corresponds to the direction from the measurement point to the corresponding measurement point of fSj ^ is located at i±^, ^±^ + 0 ≤ i ≤ 6, it will be quantified as
1 J 8 8 4 1 J 8 8 4
(2i+l) * ^- π_  (2i+l) * ^- π_
8 + °  8 + °
需要说明的是, 可以将上述查找到的多条 ΑΡ指纹的其中任何一条作为目 标 ΑΡ指纹, 在计算得到其中一条 ΑΡ指纹对应测量点到邻近 ΑΡ指纹对应测 量点的方向以及该 ΑΡ指纹与邻近 ΑΡ指纹的信号强度差之后, 然后依次计算 上述查找到的其他各条 ΑΡ指纹对应测量点到各自邻近 ΑΡ指纹对应测量点的 方向, 以及其他各条 ΑΡ指纹与各自邻近 ΑΡ指纹的信号强度差。 指纹参数计算单元 904, 用于根据所述目标 AP指纹与所述邻近 AP指纹 的信号强度差, 确定所述目标 AP指纹的梯度大小, 并根据所述目标 AP指纹 对应测量点到所述邻近 AP指纹对应测量点的方向, 确定所述目标 AP指纹的 梯度方向。 It should be noted that any one of the plurality of fingerprints found above may be used as the target fingerprint, and the direction of one of the fingerprint corresponding measurement points to the corresponding measurement point of the adjacent fingerprint and the fingerprint and the adjacent fingerprint may be calculated. After the difference between the signal strengths of the fingerprints, the direction of the corresponding measurement points of the other detected fingerprints to the corresponding measurement points of the respective fingerprints, and the signal intensity difference between the other fingerprints and the adjacent fingerprints are sequentially calculated. The fingerprint parameter calculation unit 904 is configured to determine a gradient size of the target AP fingerprint according to a signal strength difference between the target AP fingerprint and the neighboring AP fingerprint, and correspondingly measure points to the neighboring AP according to the target AP fingerprint. The fingerprint corresponds to the direction of the measurement point, and the gradient direction of the target AP fingerprint is determined.
具体实现中, 上述邻近 AP指纹包括距离所述目标 AP指纹对应测量点最 近的预设数目的 AP指纹, 可以首先按照如上述步骤中相同的计算方法计算目 标 AP指纹对应测量点到其他各条邻近 AP指纹对应测量点的方向, 以及该目 标 AP指纹与其他邻近 AP指纹的信号强度差, 然后将位于所述目标 AP指纹 对应测量点相同方向上的所有邻近 AP指纹的信号强度差求和得到所述目标 AP指纹对应测量点在该方向上的信号强度差, 最后比较位于所述目标 AP指 纹对应测量点不同方向上的信号强度差,将所述最大的信号强度差作为所述目 标 AP指纹的梯度大小, 并将该信号强度差所在的方向作为所述目标 AP指纹 的梯度方向。  In a specific implementation, the neighboring AP fingerprint includes a preset number of AP fingerprints that are closest to the measurement point corresponding to the target AP fingerprint, and may first calculate the target AP fingerprint corresponding measurement point to other neighbors according to the same calculation method as in the foregoing steps. The AP fingerprint corresponds to the direction of the measurement point, and the signal strength difference between the target AP fingerprint and other neighboring AP fingerprints, and then sums the signal strength differences of all neighboring AP fingerprints located in the same direction of the target AP fingerprint corresponding to the measurement point. The target AP fingerprint corresponds to the signal strength difference of the measurement point in the direction, and finally compares the signal strength difference in different directions of the target AP fingerprint corresponding measurement point, and uses the maximum signal strength difference as the target AP fingerprint. The gradient size, and the direction in which the signal strength difference is located is the gradient direction of the target AP fingerprint.
可选的, 可以根据查找到的多条 AP指纹对应测量点的位置信息以及信号 强度, 统计出在曲线经过这些测量点时 AP的信号强度函数, 然后对该 AP的 信号强度函数进行求导, 计算各条 AP指纹的梯度方向及梯度大小。  Optionally, the signal strength function of the AP when the curve passes through the measurement points is calculated according to the location information of the plurality of AP fingerprints corresponding to the detected measurement points and the signal strength, and then the signal strength function of the AP is derived. Calculate the gradient direction and gradient size of each AP fingerprint.
位置确定模块 804, 用于根据所述各条 AP指纹的梯度大小和梯度方向, 确定所述 AP的水平位置。  The location determining module 804 is configured to determine a horizontal location of the AP according to a gradient size and a gradient direction of each of the AP fingerprints.
具体实现中, 若信息查找模块 802从 AP指纹库中查找到与待定位的 AP 的 MAC地址相同的 AP指纹只有三条, 并且该三条 AP指纹在其梯度方向上 交于一点, 则将交点作为所述 AP的水平位置。  In a specific implementation, if the information search module 802 finds that there are only three AP fingerprints in the AP fingerprint database that are the same as the MAC address of the AP to be located, and the three AP fingerprints intersect at a point in the gradient direction, the intersection point is used as the location. The horizontal position of the AP.
可选的, 如图 10所示, 位置确定模块 804可以进一步包括:  Optionally, as shown in FIG. 10, the location determining module 804 may further include:
聚类划分单元 1001, 用于根据所述各条 AP指纹对应测量点之间的间距, 将查找到的所述多条 AP指纹划分为多个聚类。  The clustering unit 1001 is configured to divide the plurality of AP fingerprints that are found into multiple clusters according to the spacing between the measurement points of the respective AP fingerprints.
具体的, 可以将距离相近的测量点对应的 AP指纹划归为一个类聚, 并按 照查找到的多条 AP指纹对应测量点的具体位置分布, 选择相应的聚类数量。 如图 5所示, 图中圓点为 AP指纹对应测量点, 五角星为各个类聚中类首的参 考位置, 将查找到的 AP指纹划分为 3个(至少 3个)聚类, 每个聚类中的 AP指纹对应测量点距离相近。 类首信息确定单元 1002, 用于根据各个聚类中各条 AP指纹的梯度大小、 梯度方向以及各条 AP指纹对应测量点的位置信息, 确定各个聚类中类首的梯 度方向和参考位置。 Specifically, the AP fingerprints corresponding to the measurement points with similar distances can be classified into one cluster, and the corresponding clusters are selected according to the specific location distributions of the plurality of AP fingerprints corresponding to the measured points. As shown in FIG. 5, the dot in the figure is the AP fingerprint corresponding measurement point, and the pentagram is the reference position of each class in the cluster, and the found AP fingerprint is divided into three (at least three) clusters, each The AP fingerprints in the cluster correspond to similar measurement points. The class header information determining unit 1002 is configured to determine a gradient direction and a reference position of the class head in each cluster according to the gradient size of each AP fingerprint in each cluster, the gradient direction, and the position information of the corresponding measurement points of each AP fingerprint.
具体的, 聚类中的每条 AP指纹都有各自的梯度大小和梯度方向, 可以将 所述各个类聚中梯度大小为最大的 AP指纹的梯度方向作为所述各个聚类中类 首的梯度方向。其中,各个聚类的类首的参考位置为到类聚中各个指纹对应测 量点距离之和最近的点。  Specifically, each AP fingerprint in the cluster has a respective gradient size and a gradient direction, and the gradient direction of the AP fingerprint with the largest gradient in each of the clusters may be used as the gradient of the first class in each cluster. direction. The reference position of the class head of each cluster is the closest to the sum of the distances of the measurement points corresponding to the fingerprints in the cluster.
水平位置确定单元 1003, 用于根据所述各个聚类中类首的梯度方向和参 考位置, 确定所述 AP的水平位置。  The horizontal position determining unit 1003 is configured to determine a horizontal position of the AP according to a gradient direction and a reference position of the class head in the respective clusters.
进一步可选的, 若所述各个聚类中类首的梯度方向上交于一点, 则将交点 作为所述 AP的水平位置, 如图 6所示, AP的水平位置为图中 3条射线的交 点。  Further, if the gradient direction of the class leader in the respective clusters intersects at a point, the intersection point is taken as the horizontal position of the AP, as shown in FIG. 6, the horizontal position of the AP is 3 rays in the figure. Intersection.
进一步可选的, 若所述各个聚类中类首的梯度方向上交于多个点, 则确定 所述各个聚类中类首的梯度方向上的交叉区域;在所述交叉区域中确定一点作 为所述 AP的水平位置, 所述各个聚类中类首的参考位置到该点的方向与所述 各个聚类中类首的梯度方向的夹角之和最小。具体的, 可以计算各个类聚中的 类首到交叉区域中某一点的方向,这样可以得到 k个类首的参考位置到该点的 方向《H, 将 k个类首的梯度方向表示为 ,k = l, 2,..., K, 计算各个聚类 中类首的梯度方向与类首的参考位置到该点方向的差值, 并计算得到差值之 和。 然后依次对交叉区域中的其他各点进行计算, 最小差值之和对应的点作为 待定位 AP的水平位置。 Further, if the gradient direction of the class leader in the respective clusters intersects a plurality of points, determining an intersection region in a gradient direction of the class leader in each of the clusters; determining a point in the intersection region As a horizontal position of the AP, a sum of a reference position of the head of the cluster to the point of the point and a gradient direction of the head of the cluster in each cluster is the smallest. Specifically, the direction of the class from the first class to the point in the intersection region can be calculated, so that the reference position of the k class heads can be obtained to the direction of the point “ H , and the gradient direction of the k class heads is expressed as k = l, 2,..., K, calculate the difference between the gradient direction of the class head in each cluster and the reference position of the class head to the point direction, and calculate the sum of the differences. Then, the other points in the intersection area are sequentially calculated, and the point corresponding to the sum of the minimum differences is taken as the horizontal position of the AP to be located.
进一步可选的,如图 7所示, 若所述各个聚类中类首的梯度方向上交于多 个点, 还可以将 AP可能存在的位置区域划分为多个栅格, 可以计算各个类聚 中的类首的参考位置到某一栅格 Gridi的方向,这样可以得到 k个类首的参考位 置到该栅格的方向 , 将 k个类首的梯度方向表示为 ,k = l, 2,..., K, 计算各个聚类中类首的梯度方向与类首的参考位置到该栅格方向的差值,并计 算得到差值之和。 然后依次对其他栅格进行计算, 最小差值之和对应的栅格作 为待定位 AP的定位栅格, 最后将定位栅格的中心点作为 AP的水平位置。 Further, as shown in FIG. 7 , if the gradient direction of the class leader in the respective clusters intersects at multiple points, the location area where the AP may exist may be divided into multiple grids, and each class may be calculated. The reference position of the class head in the cluster is in the direction of a certain grid Grid i , so that the reference position of the k class heads can be obtained to the direction of the grid, and the gradient direction of the k class heads is expressed as k = l, 2,..., K, calculate the difference between the gradient direction of the class head in each cluster and the reference position of the class head to the grid direction, and calculate the sum of the differences. Then, the other grids are calculated in sequence, and the grid corresponding to the sum of the minimum differences is used as the positioning grid of the AP to be located, and finally the center point of the positioning grid is taken as the horizontal position of the AP.
信号统计模块 805, 用于从所述 AP指纹库中统计出垂直高度确定的其他 AP的信号强度的高斯分布。 a signal statistics module 805, configured to calculate a vertical height determination from the AP fingerprint database Gaussian distribution of the signal strength of the AP.
具体实现中, 可以从所述 AP指纹库中统计出在 AP的垂直高度高于第一 预设高度时信号强度的高斯分布以及在 AP的垂直高度低于第一预设高度位置 时信号强度的高斯分布。  In a specific implementation, a Gaussian distribution of the signal strength when the vertical height of the AP is higher than the first preset height and a signal strength when the vertical height of the AP is lower than the first preset height position may be calculated from the AP fingerprint database. Gaussian distribution.
例如: 在上述 AP指纹库中, 可以将垂直高度确定的其他 AP对应的 AP 指纹分类两类: AP的垂直高度在 10米以上和 AP的垂直高度在 10米以下。 已知 2)条 AP指纹对应的 AP垂直高度是在 10米以上, n2(n2≥2)条 AP指 纹对应的 AP垂直高度是在 10米以下,可以首先分别统计出在 AP的垂直高度 高于 10米时信号强度的均值和方差, 以及在 AP的垂直高度低于 10米时信号 强度的均值和方差, 然后得到在 AP的垂直高度高于 10米的信号强度的高斯 分布 Gi,以及在 AP的垂直高度低于 10米时信号强度的高斯分布 G2, 和02的 表示公式^口下: For example, in the above AP fingerprint database, the AP fingerprints corresponding to other APs whose vertical height is determined can be classified into two types: the vertical height of the AP is 10 meters or more and the vertical height of the AP is 10 meters or less. It is known that the vertical height of the AP corresponding to the AP fingerprint is more than 10 meters, and the vertical height of the AP corresponding to the AP fingerprint of n 2 (n 2 ≥ 2) is less than 10 meters. The vertical height of the AP can be separately calculated first. The mean and variance of the signal strength above 10 meters, and the mean and variance of the signal strength when the vertical height of the AP is less than 10 meters, and then obtain a Gaussian distribution G i of the signal strength above the 10 meters of the vertical height of the AP, And the Gaussian distribution G 2 of the signal strength when the vertical height of the AP is less than 10 meters, and the expression formula of 0 2 is:
G1 = 和 G2 = e 25 G 1 = and G 2 = e 25
Figure imgf000033_0001
Figure imgf000033_0001
其中, ^、^为在 ΑΡ的垂直高度高于 10米时信号强度的均值和方差; μ 为在 AP的垂直高度低于 10米时信号强度的均值和方差。 Where ^, ^ is the mean and variance of the signal strength when the vertical height of the raft is higher than 10 meters; μ is the mean and variance of the signal strength when the vertical height of the AP is less than 10 meters.
均值计算模块 806, 用于根据查找到的所述多条 AP指纹的信号强度, 计 算查找到的所述多条 AP指纹的信号强度的均值。  The mean value calculation module 806 is configured to calculate an average value of the signal strengths of the plurality of AP fingerprints that are found according to the found signal strengths of the plurality of AP fingerprints.
具体实现中, 可以对查找到的多条 AP指纹的信号强度进行求和, 然后将 求和得到的信号强度之和除以查找到的 AP指纹的个数, 计算得到的平均值作 为查找到的多条 AP指纹的信号强度的均值。  In a specific implementation, the signal strengths of the plurality of AP fingerprints found may be summed, and then the sum of the summed signal strengths is divided by the number of the obtained AP fingerprints, and the calculated average value is used as the found value. The average of the signal strengths of multiple AP fingerprints.
高度确定模块 807, 用于根据查找到所述多条 AP指纹的信号强度的均值 以及所述垂直高度确定的其他 AP的信号强度的高斯分布, 确定所述 AP的垂 直高度。  The height determining module 807 is configured to determine a vertical height of the AP according to a mean value of the signal strengths of the plurality of AP fingerprints and a Gaussian distribution of signal strengths of other APs determined by the vertical height.
可选的, 如图 11所示, 高度确定模块 807还可以进一步包括:  Optionally, as shown in FIG. 11, the height determining module 807 may further include:
阔值计算单元 1101,用于根据所述在 AP的垂直高度高于第一预设高度时 信号强度的高斯分布以及所述在 AP的垂直高度低于第一预设高度时信号强度 的高斯分布, 计算在 AP的垂直高度等于第一预设高度时信号强度阔值。 例如: 由信号统计模块 805计算得到在 AP的垂直高度高于 10米时信号 强度的高斯分布 以及所述在 AP的垂直高度低于 10米时信号强度的高斯分 布 G2, 计算上述两条分布曲线的交点( G, = G2 )得到在 AP的垂直高度等于 10 米时信号强度阔值。 The threshold value calculation unit 1101 is configured to: according to the Gaussian distribution of the signal strength when the vertical height of the AP is higher than the first preset height, and the Gaussian distribution of the signal strength when the vertical height of the AP is lower than the first preset height , Calculate the signal strength threshold when the vertical height of the AP is equal to the first preset height. For example: The Gaussian distribution of the signal strength when the vertical height of the AP is higher than 10 meters and the Gaussian distribution G 2 of the signal strength when the vertical height of the AP is less than 10 meters are calculated by the signal statistics module 805, and the two distributions are calculated. The intersection of the curves (G, = G 2 ) gives the signal strength threshold when the vertical height of the AP is equal to 10 meters.
阔值比较单元 1102,用于对所述多条 AP指纹的信息强度的均值和所述在 AP的垂直高度等于第一预设高度时信号强度阔值进行比较。  The threshold comparison unit 1102 is configured to compare the mean value of the information strengths of the plurality of AP fingerprints with the signal strength threshold when the vertical height of the AP is equal to the first preset height.
高度确定单元 1103,用于根据所述多条 AP指纹的信息强度的均值和所述 在 AP 的垂直高度等于第一预设高度时信号强度阔值的比较结果, 确定所述 AP的垂直高度。  The height determining unit 1103 is configured to determine a vertical height of the AP according to a comparison between an average value of information strengths of the plurality of AP fingerprints and a signal strength threshold value when the vertical height of the AP is equal to the first preset height.
具体实现中, 若所述多条 AP指纹的信息强度的均值等于所述在 AP的垂 直高度等于第一预设高度时信号强度阔值, 则所述 AP的垂直高度为第一预设 高度; 若所述多条 AP指纹的信息强度的均值大于所述在 AP的垂直高度等于 第一预设高度时信号强度阔值, 则所述 AP的垂直高度为第二预设高度; 若所 述多条 AP指纹的信息强度的均值小于所述在 AP的垂直高度等于第一预设高 度时信号强度阔值, 则所述 AP的垂直高度为第三预设高度。  In a specific implementation, if the average value of the information strengths of the plurality of AP fingerprints is equal to the signal strength threshold when the vertical height of the AP is equal to the first preset height, the vertical height of the AP is a first preset height; If the average value of the information strength of the plurality of AP fingerprints is greater than the signal strength threshold when the vertical height of the AP is equal to the first preset height, the vertical height of the AP is the second preset height; The average value of the information strength of the AP fingerprint is smaller than the signal strength threshold when the vertical height of the AP is equal to the first preset height, and the vertical height of the AP is the third preset height.
例如: 将上述查找到的多条 AP指纹的信号强度的均值记为 , 将上述在 AP的垂直高度等于 10米时信号强度阔值记为 。 若 > ¾, 则说明待定位 AP 位于 10米以下, 具体可将 AP定位到 5米处; 若 < , 则说明待定位 AP位 于 10米以上, 具体可将 AP定位到 15米处。 For example: The average value of the signal strengths of the plurality of AP fingerprints found above is recorded as the signal strength threshold when the vertical height of the AP is equal to 10 meters. If > 3⁄4 , the AP to be located is located below 10 meters, and the AP can be positioned to 5 meters. If < , the AP to be located is located at 10 meters or more, and the AP can be positioned to 15 meters.
需要说明的是, 如果是在室外地面对室内 AP进行测量时, 位于室内 20 米以上的 AP的信号强度非常低, 在室外很难测量到的, 因此可以将 AP的垂 直高度的适用范围设置在 0到 20米之间, 并将 AP的垂直高度分为 10米以下 和 10米以上两部分进行计算。 为了降低垂直高度的平均定位误差, 进一步将 位于 10米以下的 AP定位到 5米, 将位于 10米以上的 AP定位到 15米。  It should be noted that if the indoor AP is measured on the outdoor ground, the signal strength of the AP located indoors of 20 meters or more is very low, which is difficult to measure outdoors, so the applicable range of the vertical height of the AP can be set. Between 0 and 20 meters, the vertical height of the AP is divided into two parts of 10 meters or less and 10 meters or more. In order to reduce the average positioning error of the vertical height, the AP located below 10 meters is further positioned to 5 meters, and the AP located above 10 meters is positioned to 15 meters.
最终, 根据上述计算得到 AP的水平位置以及 AP的垂直高度, 就可以确 定 AP的具体位置。  Finally, according to the above calculation, the horizontal position of the AP and the vertical height of the AP can determine the specific location of the AP.
在本发明实施例中, 通过从预先建立的 AP指纹库中查找与待定位的 AP 的 MAC地址相同的多条 AP指纹, 从而根据查找到的多条 AP指纹对应测量 点的位置信息以及信号强度, 计算查找到的各条 AP指纹的梯度大小和梯度方 向; 最后根据所述各条 AP指纹的梯度大小和梯度方向, 确定所述 AP的水平 位置, 同时可以根据查找到多条 AP指纹的信号强度的均值以及垂直高度确定 的其他 AP的信号强度的高斯分布, 确定 AP的垂直高度, 从而达到提高 AP 定位的精确度的目的。 In the embodiment of the present invention, by searching for a plurality of AP fingerprints that are the same as the MAC address of the AP to be located, the location information and the signal strength of the corresponding measurement points are obtained according to the found multiple AP fingerprints. , calculate the gradient size and gradient of each AP fingerprint found. Finally, determining the horizontal position of the AP according to the gradient size and the gradient direction of each of the AP fingerprints, and simultaneously determining the signal strength of other APs according to the average of the signal strengths of the plurality of AP fingerprints and the vertical height. Gaussian distribution, which determines the vertical height of the AP, so as to improve the accuracy of AP positioning.
图 12是本发明实施例中的一种定位 AP装置的结构示意图。 如图所示, 该 定位 AP的装置可以包括: 至少一个处理器 1201, 例如 CPU, 至少一个网络接 口 1203, 存储器 1204, 至少一个通信总线 1202。 其中, 通信总线 1202用于实现 这些组件之间的连接通信。 其中, 本发明实施例中定位 AP的装置的网络接口 1203可以为无线接口, 例如包括天线装置, 用于与其他设备进行信令或数据的 通信。 存储器 1204可以是高速 RAM存储器, 也可以是非不稳定的存储器 ( non-volatile memory ) , 例如至少一个磁盘存储器。 存储器 1204可选的还可 以是至少一个位于远离前述处理器 1201的存储装置。存储器 1204中存储一组程 序代码, 且处理器用于调用存储器中存储的程序代码, 用于执行以下操作: 获取预先建立的 AP指纹库, 所述 AP指纹库包括在多个测量点获取到的多 条 AP指纹, 所述 AP指纹包括对应测量点的位置信息、 AP的 MAC地址以及该 AP的信号强度;  FIG. 12 is a schematic structural diagram of a positioning AP device according to an embodiment of the present invention. As shown, the apparatus for locating an AP may include: at least one processor 1201, such as a CPU, at least one network interface 1203, a memory 1204, and at least one communication bus 1202. Among them, the communication bus 1202 is used to implement connection communication between these components. The network interface 1203 of the device for locating the AP in the embodiment of the present invention may be a wireless interface, for example, including an antenna device, for performing signaling or data communication with other devices. The memory 1204 may be a high speed RAM memory or a non-volatile memory such as at least one disk memory. The memory 1204 can also optionally be at least one storage device located remotely from the aforementioned processor 1201. The memory 1204 stores a set of program codes, and the processor is configured to call the program code stored in the memory, to perform the following operations: acquiring a pre-established AP fingerprint database, where the AP fingerprint database includes multiple acquired at multiple measurement points. An AP fingerprint, where the AP fingerprint includes location information of a corresponding measurement point, a MAC address of the AP, and a signal strength of the AP;
从所述 AP指纹库中查找与待定位的 AP的 MAC地址相同的多条 AP指纹; 根据查找到的所述多条 AP指纹对应测量点的位置信息以及信号强度, 计 算查找到的各条 AP指纹的梯度大小和梯度方向;  Finding, by the AP fingerprint database, a plurality of AP fingerprints that are the same as the MAC address of the AP to be located; and calculating, according to the found location information and signal strength of the plurality of AP fingerprints, the searched APs The gradient size and gradient direction of the fingerprint;
根据所述各条 AP指纹的梯度大小和梯度方向, 确定所述 AP的水平位置。 需要说明的是, 对于前述的各个方法实施例, 为了简单描述, 故将其都表 述为一系列的动作组合,但是本领域技术人员应该知悉, 本发明并不受所描述 的动作顺序的限制, 因为依据本发明, 某一些步骤可以釆用其他顺序或者同时 进行。 其次, 本领域技术人员也应该知悉, 说明书中所描述的实施例均属于优 选实施例, 所涉及的动作和模块并不一定是本发明所必须的。  Determining a horizontal position of the AP according to a gradient size and a gradient direction of each of the AP fingerprints. It should be noted that, for the foregoing various method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should understand that the present invention is not limited by the described action sequence. Because some steps may be performed in other orders or concurrently in accordance with the present invention. In the following, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
在上述实施例中,对各个实施例的描述都各有侧重, 某个实施例中没有详 细描述的部分, 可以参见其他实施例的相关描述。  In the above embodiments, the descriptions of the various embodiments are different, and the parts that are not described in detail in an embodiment can be referred to the related descriptions of other embodiments.
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步 骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读 存储介质中, 存储介质可以包括: 闪存盘、 只读存储器(Read-Only Memory , ROM ), 随机存取器 ( Random Access Memory, RAM ), 磁盘或光盘等。 One of ordinary skill in the art can understand that all or part of the various methods of the above embodiments can be completed by a program to instruct related hardware, and the program can be stored in a computer readable In the storage medium, the storage medium may include: a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like.
以上对本发明实施例所提供的内容下载方法及相关设备、系统进行了详细 施例的说明只是用于帮助理解本发明的方法及其核心思想; 同时,对于本领域 的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改 变之处, 综上所述, 本说明书内容不应理解为对本发明的限制。  The foregoing detailed description of the content downloading method and related devices and systems provided by the embodiments of the present invention is only for assisting in understanding the method of the present invention and its core idea; and, at the same time, those skilled in the art according to the present invention The scope of the present invention is not limited by the scope of the present invention.

Claims

权 利 要 求 Rights request
1、 一种定位 AP的方法, 其特征在于, 所述方法包括:  A method for locating an AP, the method comprising:
获取预先建立的 AP指纹库, 所述 AP指纹库包括在多个测量点获取到的 多条 AP指纹, 所述 AP指纹包括对应测量点的位置信息、 AP的 MAC地址以 及该 AP的信号强度;  Obtaining a pre-established AP fingerprint database, where the AP fingerprint database includes a plurality of AP fingerprints acquired at a plurality of measurement points, where the AP fingerprint includes location information of the corresponding measurement point, a MAC address of the AP, and a signal strength of the AP;
从所述 AP指纹库中查找与待定位的 AP的 MAC地址相同的多条 AP指纹; 根据查找到的所述多条 AP指纹对应测量点的位置信息以及信号强度, 计 算查找到的各条 AP指纹的梯度大小和梯度方向;  Finding, by the AP fingerprint database, a plurality of AP fingerprints that are the same as the MAC address of the AP to be located; and calculating, according to the found location information and signal strength of the plurality of AP fingerprints, the searched APs The gradient size and gradient direction of the fingerprint;
根据所述各条 AP指纹的梯度大小和梯度方向,确定所述 AP的水平位置。  And determining a horizontal position of the AP according to a gradient size and a gradient direction of each of the AP fingerprints.
2、 如权利要求 1所述的方法, 其特征在于, 所述指纹库还包括垂直高度 确定的其他 AP对应 AP指纹, 所述方法还包括: The method of claim 1, wherein the fingerprint database further comprises another AP corresponding to the AP fingerprint determined by the vertical height, the method further comprising:
从所述 AP指纹库中统计出垂直高度确定的其他 AP的信号强度的高斯分 布;  Calculating a Gaussian distribution of signal strengths of other APs determined by the vertical height from the AP fingerprint database;
根据查找到的所述多条 AP指纹的信号强度, 计算查找到的所述多条 AP 指纹的信号强度的均值;  Calculating, according to the signal strengths of the plurality of AP fingerprints, the average value of the signal strengths of the plurality of AP fingerprints that are found;
根据查找到所述多条 AP指纹的信号强度的均值以及所述垂直高度确定的 其他 AP的信号强度的高斯分布, 确定所述 AP的垂直高度。  And determining a vertical height of the AP according to a mean value of the signal strengths of the plurality of AP fingerprints and a Gaussian distribution of signal strengths of the other APs determined by the vertical height.
3、 如权利要求 1所述的方法, 其特征在于, 所述根据查找到的所述多条 AP指纹对应测量点的位置信息以及信号强度, 计算查找到的各条 AP指纹的 梯度大小和梯度方向包括: The method according to claim 1, wherein the calculating the gradient size and gradient of each AP fingerprint found according to the found location information and signal strength of the plurality of AP fingerprint corresponding measurement points Directions include:
根据查找到的各条 AP指纹对应测量点的位置信息, 计算所述各条 AP指 纹对应测量点之间的间 巨;  Calculating, according to the location information of each AP fingerprint corresponding to the measurement point, the inter-macro between the measurement points of the AP fingerprints;
根据所述各条 AP指纹对应测量点之间的间距, 从查找到的所述多条 AP 指纹中查找目标 AP指纹对应测量点的邻近 AP指纹;  And searching, according to the spacing between the measurement points of the AP fingerprints, the neighboring AP fingerprints corresponding to the measurement points of the target AP fingerprints from the plurality of AP fingerprints that are found;
根据所述目标 AP指纹对应测量点的位置信息以及所述邻近 AP指纹对应 测量点的位置信息, 计算所述目标 AP指纹对应测量点到所述邻近 AP指纹对 应测量点的方向, 并根据所述目标 AP指纹的信号强度以及所述邻近 AP指纹 的信号强度, 计算所述目标 AP指纹与所述邻近 AP指纹的信号强度差; Calculating, according to the location information of the target AP fingerprint corresponding measurement point and the location information of the neighboring AP fingerprint corresponding measurement point, the target AP fingerprint corresponding measurement point to the neighboring AP fingerprint pair The direction of the point should be measured, and the signal strength difference between the target AP fingerprint and the neighboring AP fingerprint is calculated according to the signal strength of the target AP fingerprint and the signal strength of the neighboring AP fingerprint;
根据所述目标 AP指纹与所述邻近 AP指纹的信号强度差, 确定所述目标 AP指纹的梯度大小,并根据所述目标 AP指纹对应测量点到所述邻近 AP指纹 对应测量点的方向, 确定所述目标 AP指纹的梯度方向。  Determining, according to a signal strength difference between the target AP fingerprint and the neighboring AP fingerprint, a gradient size of the target AP fingerprint, and determining, according to the direction of the target AP fingerprint corresponding measurement point to the neighboring AP fingerprint corresponding measurement point, The gradient direction of the target AP fingerprint.
4、 如权利要求 3所述的方法, 其特征在于, 所述邻近 AP指纹包括距离 所述目标 AP指纹对应测量点最近的预设数目的 AP指纹, 所述根据所述目标 AP指纹与所述邻近 AP指纹的信号强度差,确定所述目标 AP指纹的梯度大小, 并 居所述目标 AP指纹对应测量点到所述邻近 AP指纹对应测量点的方向, 确定所述目标 AP指纹的梯度方向包括: The method of claim 3, wherein the neighboring AP fingerprint comprises a preset number of AP fingerprints closest to a measurement point corresponding to the target AP fingerprint, the fingerprint according to the target AP and the Determining a gradient of the target AP fingerprint, and determining a gradient of the target AP fingerprint corresponding to the measurement point of the target AP fingerprint to the measurement point of the neighboring AP fingerprint, and determining a gradient direction of the target AP fingerprint includes :
将位于所述目标 AP指纹对应测量点相同方向上的所有邻近 AP指纹的信 号强度差求和得到所述目标 AP指纹对应测量点在该方向上的信号强度差; 比较位于所述目标 AP指纹对应测量点不同方向上的信号强度差, 将所述 最大的信号强度差作为所述目标 AP指纹的梯度大小, 并将该信号强度差所在 的方向作为所述目标 AP指纹的梯度方向。  And summing signal strength differences of all neighboring AP fingerprints in the same direction of the target AP fingerprint corresponding to the measurement point to obtain a signal strength difference of the target AP fingerprint corresponding measurement point in the direction; comparing the fingerprints corresponding to the target AP fingerprints Measuring a signal strength difference in different directions, using the maximum signal strength difference as a gradient of the target AP fingerprint, and using the direction of the signal strength difference as a gradient direction of the target AP fingerprint.
5、 如权利要求 3所述的方法, 其特征在于, 所述根据所述目标 AP指纹 对应测量点的位置信息以及所述邻近 AP指纹对应测量点的位置信息, 计算所 述目标 AP指纹对应测量点到所述邻近 AP指纹对应测量点的方向包括: The method according to claim 3, wherein the calculating the target AP fingerprint corresponding measurement according to the location information of the target AP fingerprint corresponding measurement point and the location information of the neighboring AP fingerprint corresponding measurement point The direction of the measurement point corresponding to the neighboring AP fingerprint includes:
将角度为 2π的圓周空间划分为多个量化区间, 每个量化区间分别对应一 个量化方向;  Dividing a circular space having an angle of 2π into a plurality of quantization intervals, each of which corresponds to a quantization direction;
确定所述目标 ΑΡ指纹对应测量点到所述邻近 ΑΡ指纹对应测量点的方向 所位于的量化区间;  Determining, in the quantization interval in which the target ΑΡ fingerprint corresponds to a direction in which the measurement point to the adjacent ΑΡ fingerprint corresponds to the measurement point;
居确定的所述目标 ΑΡ指纹对应测量点到所述邻近 ΑΡ指纹对应测量点 的方向所位于的量化区间, 将所述目标 ΑΡ指纹对应测量点到所述邻近 ΑΡ指 纹对应测量点的方向处理得到一个量化方向;  Determining the target ΑΡ fingerprint corresponding to the quantization interval in which the direction of the measurement point to the adjacent ΑΡ fingerprint corresponding measurement point is located, and processing the target ΑΡ fingerprint corresponding measurement point to the direction corresponding to the measurement point of the adjacent ΑΡ fingerprint a quantitative direction;
所述 居所述目标 ΑΡ指纹对应测量点到所述邻近 ΑΡ指纹对应测量点的 方向, 确定所述目标 ΑΡ指纹的梯度方向包括: 根据所述目标 AP指纹对应测量点到所述邻近 AP指纹对应测量点的所述 量化方向, 确定所述目标 AP指纹的梯度方向。 Determining, in the direction in which the target ΑΡ fingerprint corresponds to the measurement point of the neighboring ΑΡ fingerprint, determining a gradient direction of the target ΑΡ fingerprint includes: And determining a gradient direction of the target AP fingerprint according to the quantization direction of the target AP fingerprint corresponding measurement point to the neighboring AP fingerprint corresponding measurement point.
6、 如权利要求 3所述的方法, 其特征在于, 所述根据查找到的所述各条 AP指纹的梯度大小和梯度方向, 确定所述 AP的水平位置包括: The method according to claim 3, wherein the determining the horizontal position of the AP according to the obtained gradient size and gradient direction of each of the AP fingerprints includes:
根据所述各条 AP指纹对应测量点之间的间距, 将查找到的所述多条 AP 指纹划分为多个聚类;  Defining the plurality of AP fingerprints that are found into multiple clusters according to the spacing between the measurement points of the AP fingerprints;
根据各个聚类中各条 AP指纹的梯度大小、 梯度方向以及各条 AP指纹对 应测量点的位置信息, 确定各个聚类中类首的梯度方向和参考位置;  Determining the gradient direction and the reference position of the class head in each cluster according to the gradient size of each AP fingerprint in each cluster, the gradient direction, and the position information of each AP fingerprint corresponding to the measurement point;
根据所述各个聚类中类首的梯度方向和参考位置, 确定所述 AP的水平位 置。  The horizontal position of the AP is determined according to the gradient direction and the reference position of the class leader in the respective clusters.
7、 如权利要求 6所述的方法, 其特征在于, 所述根据各个聚类中各条 AP 指纹的梯度大小、 梯度方向以及各条 AP指纹对应测量点的位置信息, 确定各 个聚类中类首的梯度方向和参考位置包括: The method according to claim 6, wherein the determining the class in each cluster according to the gradient size of each AP fingerprint in each cluster, the gradient direction, and the location information of each AP fingerprint corresponding to the measurement point The first gradient direction and reference position include:
将所述各个类聚中梯度大小为最大的 AP指纹的梯度方向作为所述各个聚 类中类首的梯度方向。  The gradient direction of the AP fingerprint having the largest gradient size in each of the clusters is used as the gradient direction of the first class in the respective clusters.
8、 如权利要求 7所述的方法, 其特征在于, 所述根据所述各个聚类中类 首的梯度方向和参考位置, 确定所述 AP的水平位置包括: The method according to claim 7, wherein the determining the horizontal position of the AP according to the gradient direction and the reference position of the class header in the respective clusters comprises:
若所述各个聚类中类首的梯度方向上交于一点, 则将交点作为所述 AP的 水平位置。  If the gradient direction of the class leader in the respective clusters intersects at a point, the intersection point is taken as the horizontal position of the AP.
9、 如权利要求 7所述的方法, 其特征在于, 所述根据所述各个聚类中类 首的梯度方向和参考位置, 确定所述 AP的水平位置还包括: The method according to claim 7, wherein the determining the horizontal position of the AP according to the gradient direction and the reference position of the class header in the respective clusters further includes:
若所述各个聚类中类首的梯度方向上交于多个点,则确定所述各个聚类中 类首的梯度方向上的交叉区域;  If the gradient direction of the class leader in the respective clusters intersects at a plurality of points, determining an intersection region in a gradient direction of the class leader in each of the clusters;
在所述交叉区域中确定一点作为所述 AP的水平位置, 所述各个聚类中类 首的参考位置到该点的方向与所述各个聚类中类首的梯度方向的夹角之和最 小。 Determining a point in the intersection area as a horizontal position of the AP, wherein a sum of a reference position of the class head in the respective clusters to the point of the point and a gradient direction of the class head in the respective clusters is the most small.
10、 如权利要求 2所述的方法, 其特征在于, 所述从所述 AP指纹库中统 计出垂直高度确定的其他 AP的信号强度的高斯分布包括: 10. The method according to claim 2, wherein the Gaussian distribution of signal strengths of other APs determined from the AP fingerprint database is determined by:
从所述 AP指纹库中统计出在 AP的垂直高度高于第一预设高度时信号强 度的高斯分布以及在 AP的垂直高度低于第一预设高度位置时信号强度的高斯 分布;  Calculating a Gaussian distribution of signal strength when the vertical height of the AP is higher than the first preset height from the AP fingerprint database and a Gaussian distribution of signal strength when the vertical height of the AP is lower than the first preset height position;
所述根据所述多条 AP指纹的信号强度的均值以及垂直高度确定的其他 AP的信号强度的高斯分布, 确定所述 AP的垂直高度包括:  Determining, according to a mean value of signal strengths of the plurality of AP fingerprints and a Gaussian distribution of signal strengths of other APs determined by a vertical height, determining a vertical height of the AP includes:
根据所述在 AP的垂直高度高于第一预设高度时信号强度的高斯分布以及 所述在 AP的垂直高度低于第一预设高度时信号强度的高斯分布, 计算在 AP 的垂直高度等于第一预设高度时信号强度阔值;  Calculating the Gaussian distribution of the signal strength when the vertical height of the AP is higher than the first preset height and the Gaussian distribution of the signal strength when the vertical height of the AP is lower than the first preset height, and calculating the vertical height at the AP is equal to Signal strength threshold at the first preset height;
对所述多条 AP指纹的信息强度的均值和所述在 AP的垂直高度等于第一 预设高度时信号强度阈值进行比较;  Comparing an average of information strengths of the plurality of AP fingerprints with a signal strength threshold when the vertical height of the AP is equal to the first preset height;
根据所述多条 AP指纹的信息强度的均值和所述在 AP的垂直高度等于第 一预设高度时信号强度阔值的比较结果, 确定所述 AP的垂直高度。  And determining a vertical height of the AP according to a comparison between an average of information strengths of the plurality of AP fingerprints and a comparison of the signal strength thresholds when the vertical height of the AP is equal to the first preset height.
11、 如权利要求 10所述的方法, 其特征在于, 所述根据所述多条 AP指 纹的信息强度的均值和所述在 AP的垂直高度等于第一预设高度时信号强度阔 值的比较结果, 确定所述 AP的垂直高度包括: The method according to claim 10, wherein the comparison between the average of the information strengths of the plurality of AP fingerprints and the signal strength threshold when the vertical height of the AP is equal to the first preset height As a result, determining the vertical height of the AP includes:
若所述多条 AP指纹的信息强度的均值等于所述在 AP的垂直高度等于第 一预设高度时信号强度阔值, 则所述 AP的垂直高度为第一预设高度;  If the average value of the information strength of the plurality of AP fingerprints is equal to the signal strength threshold when the vertical height of the AP is equal to the first preset height, the vertical height of the AP is a first preset height;
若所述多条 AP指纹的信息强度的均值大于所述在 AP的垂直高度等于第 一预设高度时信号强度阔值, 则所述 AP的垂直高度为第二预设高度;  If the average value of the information strength of the plurality of AP fingerprints is greater than the signal strength threshold when the vertical height of the AP is equal to the first preset height, the vertical height of the AP is a second preset height;
若所述多条 AP指纹的信息强度的均值小于所述在 AP的垂直高度等于第 一预设高度时信号强度阔值, 则所述 AP的垂直高度为第三预设高度。  And if the average value of the information strengths of the plurality of AP fingerprints is smaller than the signal strength threshold when the vertical height of the AP is equal to the first preset height, the vertical height of the AP is a third preset height.
12、 一种定位 AP的装置, 其特征在于, 所述装置包括: 12. A device for locating an AP, the device comprising:
信息获取模块, 用于获取预先建立的 AP指纹库, 所述 AP指纹库包括在 多个测量点获取到的多条 AP指纹,所述 AP指纹包括对应测量点的位置信息、 AP的 MAC地址以及该 AP的信号强度; An information obtaining module, configured to acquire a pre-established AP fingerprint database, where the AP fingerprint database is included in a plurality of AP fingerprints obtained by the plurality of measurement points, where the AP fingerprint includes location information of the corresponding measurement point, a MAC address of the AP, and a signal strength of the AP;
信息查找模块, 用于从所述 AP指纹库中查找与待定位的 AP的 MAC地 址相同的多条 AP指纹;  An information finding module, configured to search, by using the AP fingerprint database, a plurality of AP fingerprints that are the same as the MAC address of the AP to be located;
信息计算模块, 用于根据查找到的所述多条 AP指纹对应测量点的位置信 息以及信号强度, 计算查找到的各条 AP指纹的梯度大小和梯度方向;  An information calculation module, configured to calculate a gradient size and a gradient direction of each AP fingerprint that is found according to the found location information of the multiple AP fingerprint corresponding measurement points and the signal strength;
位置确定模块, 用于根据所述各条 AP指纹的梯度大小和梯度方向, 确定 所述 AP的水平位置。  And a location determining module, configured to determine a horizontal location of the AP according to a gradient size and a gradient direction of each of the AP fingerprints.
13、 如权利要求 12所述的装置, 其特征在于, 所述指纹库还包括垂直高 度确定的其他 AP对应 AP指纹, 所述终端还包括: The apparatus of claim 12, wherein the fingerprint database further comprises another AP corresponding AP fingerprint determined by a vertical height, the terminal further comprising:
信号统计模块, 用于从所述 AP指纹库中统计出垂直高度确定的其他 AP 的信号强度的高斯分布;  a signal statistics module, configured to calculate, from the AP fingerprint database, a Gaussian distribution of signal strengths of other APs determined by a vertical height;
均值计算模块, 用于根据查找到的所述多条 AP指纹的信号强度, 计算查 找到的所述多条 AP指纹的信号强度的均值;  And a mean value calculation module, configured to calculate, according to the found signal strengths of the plurality of AP fingerprints, an average value of the signal strengths of the plurality of AP fingerprints found;
高度确定模块, 用于根据查找到所述多条 AP指纹的信号强度的均值以及 所述垂直高度确定的其他 AP的信号强度的高斯分布, 确定所述 AP的垂直高 度。  And a height determining module, configured to determine a vertical height of the AP according to a mean value of the signal strengths of the plurality of AP fingerprints and a Gaussian distribution of signal strengths of other APs determined by the vertical height.
14、 如权利要求 12所述的装置, 其特征在于, 所述信息计算模块包括: 指纹间距计算单元, 用于根据查找到的各条 AP指纹对应测量点的位置信 息, 计算所述各条 AP指纹对应测量点之间的间距; The device of claim 12, wherein the information calculation module comprises: a fingerprint spacing calculation unit, configured to calculate the pieces of AP according to the found location information of each AP fingerprint corresponding measurement point The fingerprint corresponds to the spacing between the measurement points;
邻近指纹查找单元, 用于根据所述各条 AP指纹对应测量点之间的间距, 从查找到的所述多条 AP指纹中查找目标 AP指纹对应测量点的邻近 AP指纹; 指纹信息计算单元, 用于根据所述目标 AP指纹对应测量点的位置信息以 及所述邻近 AP指纹对应测量点的位置信息, 计算所述目标 AP指纹对应测量 点到所述邻近 AP指纹对应测量点的方向, 并才艮据所述目标 AP指纹的信号强 度以及所述邻近 AP指纹的信号强度, 计算所述目标 AP指纹与所述邻近 AP 指纹的信号强度差; 指纹参数计算单元, 用于根据所述目标 AP指纹与所述邻近 AP指纹的信 号强度差, 确定所述目标 AP指纹的梯度大小, 并根据所述目标 AP指纹对应 测量点到所述邻近 AP指纹对应测量点的方向, 确定所述目标 AP指纹的梯度 方向。 The proximity fingerprint searching unit is configured to search for a neighboring AP fingerprint corresponding to the measurement point of the target AP fingerprint from the plurality of AP fingerprints that are found according to the spacing between the measurement points of the respective AP fingerprints; the fingerprint information calculation unit, And calculating, according to the location information of the target AP fingerprint corresponding measurement point and the location information of the neighboring AP fingerprint corresponding measurement point, the direction of the target AP fingerprint corresponding measurement point to the neighboring AP fingerprint corresponding measurement point, and Calculating a signal strength difference between the target AP fingerprint and the neighboring AP fingerprint according to the signal strength of the target AP fingerprint and the signal strength of the neighboring AP fingerprint; a fingerprint parameter calculation unit, configured to determine a gradient size of the target AP fingerprint according to a signal strength difference between the target AP fingerprint and the neighboring AP fingerprint, and correspondingly measure a point to the neighboring AP fingerprint according to the target AP fingerprint Corresponding to the direction of the measurement point, the gradient direction of the target AP fingerprint is determined.
15、 如权利要求 14所述的装置, 其特征在于, 所述邻近 AP指纹包括距 离所述目标 AP指纹对应测量点最近的预设数目的 AP指纹, The device according to claim 14, wherein the neighboring AP fingerprint comprises a preset number of AP fingerprints closest to a measurement point corresponding to the target AP fingerprint,
所述指纹参数计算单元, 具体用于将位于所述目标 AP指纹对应测量点相 同方向上的所有邻近 AP指纹的信号强度差求和得到所述目标 AP指纹对应测 量点在该方向上的信号强度差; 比较位于所述目标 AP指纹对应测量点不同方 向上的信号强度差, 将所述最大的信号强度差作为所述目标 AP指纹的梯度大 小, 并将该信号强度差所在的方向作为所述目标 AP指纹的梯度方向。  The fingerprint parameter calculation unit is specifically configured to obtain a signal strength difference of all neighboring AP fingerprints in the same direction of the target AP fingerprint corresponding to the measurement point, and obtain a signal strength of the target AP fingerprint corresponding measurement point in the direction. Comparing a signal strength difference in different directions of the target AP fingerprint corresponding to the measurement point, using the maximum signal strength difference as the gradient size of the target AP fingerprint, and using the direction of the signal strength difference as the The gradient direction of the target AP fingerprint.
16、 如权利要求 14所述的装置, 其特征在于, 16. Apparatus according to claim 14 wherein:
所述指纹信息计算单元, 还用于将角度为 2π的圓周空间划分为多个量化 区间, 每个量化区间分别对应一个量化方向; 确定所述目标 ΑΡ指纹对应测量 点到所述邻近 ΑΡ指纹对应测量点的方向所位于的量化区间; 才艮据确定的所述 目标 ΑΡ指纹对应测量点到所述邻近 ΑΡ指纹对应测量点的方向所位于的量化 区间, 将所述目标 ΑΡ指纹对应测量点到所述邻近 ΑΡ指纹对应测量点的方向 处理得到一个量化方向;  The fingerprint information calculation unit is further configured to divide a circular space with an angle of 2π into a plurality of quantization intervals, each of the quantization intervals respectively corresponding to one quantization direction; and determining that the target ΑΡ fingerprint corresponding measurement point corresponds to the adjacent ΑΡ fingerprint a quantization interval in which the direction of the measurement point is located; wherein the target ΑΡ fingerprint corresponds to the quantization interval in which the measurement point is located in the direction corresponding to the measurement point of the adjacent ΑΡ fingerprint, and the target ΑΡ fingerprint corresponds to the measurement point The adjacent ΑΡ fingerprint corresponds to the direction of the measurement point to obtain a quantization direction;
所述指纹参数计算单元, 还用于根据所述目标 ΑΡ指纹对应测量点到所述 邻近 ΑΡ指纹对应测量点的所述量化方向,确定所述目标 ΑΡ指纹的梯度方向。  The fingerprint parameter calculation unit is further configured to determine a gradient direction of the target ΑΡ fingerprint according to the quantization direction of the target ΑΡ fingerprint corresponding measurement point to the adjacent ΑΡ fingerprint corresponding measurement point.
17、 如权利要求 14所述的装置, 其特征在于, 所述位置确定模块包括: 聚类划分单元, 用于根据所述各条 ΑΡ指纹对应测量点之间的间距, 将查 找到的所述多条 ΑΡ指纹划分为多个聚类; The apparatus according to claim 14, wherein the location determining module comprises: a clustering unit, configured to: according to the spacing between the measurement points corresponding to the strips of fingerprints, Multiple fingerprints are divided into multiple clusters;
类首信息确定单元, 用于根据各个聚类中各条 ΑΡ指纹的梯度大小、 梯度 方向以及各条 ΑΡ指纹对应测量点的位置信息, 确定各个聚类中类首的梯度方 向和参考位置; 水平位置确定单元, 用于根据所述各个聚类中类首的梯度方向和参考位 置, 确定所述 AP的水平位置。 a class header information determining unit, configured to determine a gradient direction and a reference position of the class head in each cluster according to a gradient size of each of the fingerprints in each cluster, a gradient direction, and position information of the corresponding measurement points of each of the fingerprints; And a horizontal position determining unit, configured to determine a horizontal position of the AP according to a gradient direction and a reference position of the class head in the respective clusters.
18、 如权利要求 17所述的装置, 其特征在于, 18. Apparatus according to claim 17 wherein:
所述类首信息确定单元, 具体用于将所述各个类聚中梯度大小为最大的 AP指纹的梯度方向作为所述各个聚类中类首的梯度方向。  The class header information determining unit is specifically configured to use a gradient direction of the AP fingerprint having the largest gradient size in each of the clusters as a gradient direction of the class head in each cluster.
19、 如权利要求 18所述的装置, 其特征在于, 19. Apparatus according to claim 18, wherein:
所述水平位置确定单元,具体用于若所述各个聚类中类首的梯度方向上交 于一点, 则将交点作为所述 AP的水平位置。  The horizontal position determining unit is specifically configured to use the intersection point as the horizontal position of the AP if the gradient direction of the class head in the respective clusters intersects at one point.
20、 如权利要求 18所述的装置, 其特征在于, 20. Apparatus according to claim 18, wherein:
所述水平位置确定单元,具体用于若所述各个聚类中类首的梯度方向上交 于多个点, 则确定所述各个聚类中类首的梯度方向上的交叉区域; 在所述交叉 区域中确定一点作为所述 AP的水平位置, 所述各个聚类中类首的参考位置到 该点的方向与所述各个聚类中类首的梯度方向的夹角之和最小。  The horizontal position determining unit is configured to determine, if the gradient direction of the class head in the respective clusters intersects a plurality of points, determine an intersection area in a gradient direction of the class head in each of the clusters; A point is determined in the intersection area as a horizontal position of the AP, and a sum of a reference position of the class head in the respective clusters to the point and a direction of the gradient direction of the class heads in the respective clusters is the smallest.
21、 如权利要求 13所述的装置, 其特征在于, 21. Apparatus according to claim 13 wherein:
所述信号统计模块, 具体用于从所述 AP指纹库中统计出在 AP的垂直高 度高于第一预设高度时信号强度的高斯分布以及在 AP的垂直高度低于第一预 设高度位置时信号强度的高斯分布;  The signal statistics module is configured to calculate, from the AP fingerprint database, a Gaussian distribution of signal strength when the vertical height of the AP is higher than the first preset height, and a vertical height of the AP is lower than the first preset height position. Gaussian distribution of signal strength;
所述高度确定模块包括:  The height determination module includes:
阔值计算单元, 用于根据所述在 AP的垂直高度高于第一预设高度时信号 强度的高斯分布以及所述在 AP的垂直高度低于第一预设高度时信号强度的高 斯分布, 计算在 AP的垂直高度等于第一预设高度时信号强度阔值;  a threshold value calculation unit, configured to: according to the Gaussian distribution of the signal strength when the vertical height of the AP is higher than the first preset height, and the Gaussian distribution of the signal strength when the vertical height of the AP is lower than the first preset height, Calculating a signal strength threshold when the vertical height of the AP is equal to the first preset height;
阔值比较单元, 用于对所述多条 AP指纹的信息强度的均值和所述在 AP 的垂直高度等于第一预设高度时信号强度阔值进行比较;  a threshold value comparison unit, configured to compare an average value of information strengths of the plurality of AP fingerprints with a signal strength threshold value when the vertical height of the AP is equal to the first preset height;
高度确定单元, 用于根据所述多条 AP指纹的信息强度的均值和所述在 AP 的垂直高度等于第一预设高度时信号强度阔值的比较结果, 确定所述 AP 的垂直高度。 a height determining unit, configured to determine the AP according to an average value of information strengths of the plurality of AP fingerprints and a comparison result of the signal strength threshold when the vertical height of the AP is equal to the first preset height The vertical height.
22、 如权利要求 21所述的装置, 其特征在于, 22. Apparatus according to claim 21 wherein:
所述高度确定单元, 具体用于若所述多条 AP指纹的信息强度的均值等于 所述在 AP的垂直高度等于第一预设高度时信号强度阔值, 则所述 AP的垂直 高度为第一预设高度; 若所述多条 AP指纹的信息强度的均值大于所述在 AP 的垂直高度等于第一预设高度时信号强度阔值, 则所述 AP的垂直高度为第二 预设高度; 若所述多条 AP指纹的信息强度的均值小于所述在 AP的垂直高度 等于第一预设高度时信号强度阔值, 则所述 AP的垂直高度为第三预设高度。  The height determining unit is specifically configured to: if the average value of the information strengths of the plurality of AP fingerprints is equal to the signal strength threshold when the vertical height of the AP is equal to the first preset height, the vertical height of the AP is a preset height; if the average of the information strengths of the plurality of AP fingerprints is greater than the signal strength threshold when the vertical height of the AP is equal to the first preset height, the vertical height of the AP is the second preset height And if the average value of the information strengths of the plurality of AP fingerprints is smaller than the signal strength threshold when the vertical height of the AP is equal to the first preset height, the vertical height of the AP is a third preset height.
23、 一种定位 AP装置, 其特征在于, 所述定位 AP装置包括网络接口、 存储器以及处理器, 其中, 存储器中存储一组程序代码, 且处理器用于调用存 储器中存储的程序代码, 用于执行以下操作: 23, a positioning AP device, wherein the positioning AP device comprises a network interface, a memory and a processor, wherein the memory stores a set of program codes, and the processor is configured to call the program code stored in the memory, Do the following:
获取预先建立的 AP指纹库, 所述 AP指纹库包括在多个测量点获取到的 多条 AP指纹, 所述 AP指纹包括对应测量点的位置信息、 AP的 MAC地址以 及该 AP的信号强度;  Obtaining a pre-established AP fingerprint database, where the AP fingerprint database includes a plurality of AP fingerprints acquired at a plurality of measurement points, where the AP fingerprint includes location information of the corresponding measurement point, a MAC address of the AP, and a signal strength of the AP;
从所述 AP指纹库中查找与待定位的 AP的 MAC地址相同的多条 AP指纹; 根据查找到的所述多条 AP指纹对应测量点的位置信息以及信号强度, 计 算查找到的各条 AP指纹的梯度大小和梯度方向;  Finding, by the AP fingerprint database, a plurality of AP fingerprints that are the same as the MAC address of the AP to be located; and calculating, according to the found location information and signal strength of the plurality of AP fingerprints, the searched APs The gradient size and gradient direction of the fingerprint;
根据所述各条 AP指纹的梯度大小和梯度方向,确定所述 AP的水平位置。  And determining a horizontal position of the AP according to a gradient size and a gradient direction of each of the AP fingerprints.
PCT/CN2014/084262 2014-08-13 2014-08-13 Method and device for locating ap WO2016023190A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2014/084262 WO2016023190A1 (en) 2014-08-13 2014-08-13 Method and device for locating ap
CN201480019518.8A CN105519140B (en) 2014-08-13 2014-08-13 A kind of method and apparatus positioning AP

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/084262 WO2016023190A1 (en) 2014-08-13 2014-08-13 Method and device for locating ap

Publications (1)

Publication Number Publication Date
WO2016023190A1 true WO2016023190A1 (en) 2016-02-18

Family

ID=55303793

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/084262 WO2016023190A1 (en) 2014-08-13 2014-08-13 Method and device for locating ap

Country Status (2)

Country Link
CN (1) CN105519140B (en)
WO (1) WO2016023190A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108195379A (en) * 2017-12-25 2018-06-22 浙江大学 A kind of indoor navigation method based on WiFi received signal strength Grad
CN108834044A (en) * 2018-05-29 2018-11-16 江苏大学 A kind of shared bicycle WiFi localization method based on three-dimensional scaling
CN111988728A (en) * 2019-05-21 2020-11-24 北京京东尚科信息技术有限公司 Indoor positioning method, device and equipment based on position fingerprint and storage medium
CN112533144A (en) * 2019-09-19 2021-03-19 中国移动通信集团辽宁有限公司 Indoor positioning method and device, computing equipment and computer storage medium
EP4187962A1 (en) * 2021-11-30 2023-05-31 Juniper Networks, Inc. Determining orientation of deployed access points

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108882361B (en) * 2017-05-12 2023-01-03 中兴通讯股份有限公司 Indoor floor height positioning method and device
CN107702712A (en) * 2017-09-18 2018-02-16 哈尔滨工程大学 Indoor pedestrian's combined positioning method based on inertia measurement bilayer WLAN fingerprint bases
CN108738066A (en) * 2018-05-10 2018-11-02 北京星网锐捷网络技术有限公司 It is a kind of obtain AP between physical topology method, equipment and wireless network

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101778399A (en) * 2010-01-18 2010-07-14 哈尔滨工业大学 Method for optimizing WLAN (Wireless Local Area Network) indoor ANN (Artificial Neural Network) positioning based on FCM (fuzzy C-mean) and least-squares curve surface fitting methods
US20120195215A1 (en) * 2011-01-31 2012-08-02 Kt Corporation Indoor location measuring method and apparatus using access point
CN103913720A (en) * 2014-04-08 2014-07-09 上海交通大学 Indoor locating method oriented to non-specific Wi-Fi equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102984745B (en) * 2012-11-29 2014-12-31 清华大学深圳研究生院 Combined estimation method for Wi-Fi AP (wireless fidelity access point) position and path loss model

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101778399A (en) * 2010-01-18 2010-07-14 哈尔滨工业大学 Method for optimizing WLAN (Wireless Local Area Network) indoor ANN (Artificial Neural Network) positioning based on FCM (fuzzy C-mean) and least-squares curve surface fitting methods
US20120195215A1 (en) * 2011-01-31 2012-08-02 Kt Corporation Indoor location measuring method and apparatus using access point
CN103913720A (en) * 2014-04-08 2014-07-09 上海交通大学 Indoor locating method oriented to non-specific Wi-Fi equipment

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108195379A (en) * 2017-12-25 2018-06-22 浙江大学 A kind of indoor navigation method based on WiFi received signal strength Grad
CN108195379B (en) * 2017-12-25 2020-10-09 浙江大学 Indoor navigation method based on WiFi received signal strength gradient value
CN108834044A (en) * 2018-05-29 2018-11-16 江苏大学 A kind of shared bicycle WiFi localization method based on three-dimensional scaling
CN108834044B (en) * 2018-05-29 2020-06-26 江苏大学 Shared bicycle WiFi positioning method based on three-dimensional calibration
CN111988728A (en) * 2019-05-21 2020-11-24 北京京东尚科信息技术有限公司 Indoor positioning method, device and equipment based on position fingerprint and storage medium
CN112533144A (en) * 2019-09-19 2021-03-19 中国移动通信集团辽宁有限公司 Indoor positioning method and device, computing equipment and computer storage medium
CN112533144B (en) * 2019-09-19 2023-07-18 中国移动通信集团辽宁有限公司 Indoor positioning method, device, computing equipment and computer storage medium
EP4187962A1 (en) * 2021-11-30 2023-05-31 Juniper Networks, Inc. Determining orientation of deployed access points

Also Published As

Publication number Publication date
CN105519140B (en) 2019-10-22
CN105519140A (en) 2016-04-20

Similar Documents

Publication Publication Date Title
WO2016023190A1 (en) Method and device for locating ap
CN106993299B (en) Method and device for positioning optimal direction angle of antenna
KR101606382B1 (en) Method for building database of fingerprinting positioning and fingerprinting position method using the built database
EP2111721B1 (en) System and method for generating non-uniform grid points from calibration data
Moghtadaiee et al. WiFi fingerprinting signal strength error modeling for short distances
US10088548B2 (en) Determining access point orientation based on neighbor access point locations
JP6395840B2 (en) Method and apparatus for ToF fingerprinting and geolocation
JP2010160158A (en) Method and device for estimating position of mobile station
US20150212191A1 (en) Method and apparatus for optimizing positioning based on positioning compatibility classification
WO2014180219A1 (en) Locating method, device and terminal and computer storage medium
CN103901398A (en) Position fingerprint positioning method based on combination ordering classification
WO2016000179A1 (en) Method and device for indoor positioning
KR101749098B1 (en) System for assuming position of base station and method for assuming position of base station thereof
Podevijn et al. Performance comparison of rss algorithms for indoor localization in large open environments
EP3391073A1 (en) Positioning of mobile device
Su et al. A hybrid indoor-position mechanism based on bluetooth and WiFi communications for smart mobile devices
KR101268564B1 (en) Apparatus, method and recoding media for tracking location of mobile device based on particle filter
CN112462325A (en) Spatial positioning method and device and storage medium
CN108419248B (en) Test data processing method and device
CN105898710B (en) Positioning method and device based on virtual positioning node
WO2017020273A1 (en) Method and device for positioning and method of generating a positioning database in multicarrier network
KR102055001B1 (en) Method And Apparatus for Positioning by Using Grouping
Li et al. Measurement-based AP deployment mechanism for fingerprint-based indoor location systems
WO2020134782A1 (en) Lte signal-based positioning method and device, and readable storage medium
CN115734152A (en) Positioning method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14899566

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14899566

Country of ref document: EP

Kind code of ref document: A1