A method and device for WiFi fingerprint positioning

By constructing a two-dimensional array linked list structure and hash algorithm mapping, combining weight adjustment and edge point processing, the problem of global optimal solution in WiFi fingerprint positioning is solved, and positioning efficiency and accuracy are improved.

CN115706924BActive Publication Date: 2025-08-26CHINA MOBILE M2M +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110909676.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-09
Publication Date
2025-08-26
Estimated Expiration
2041-08-09

AI Technical Summary

Technical Problem

The existing WiFi fingerprint positioning technology is difficult to find the global optimal solution in the huge fingerprint library, resulting in inefficient positioning.

Method used

The hash algorithm mapping and binary search algorithm are used to construct a two-dimensional array linked list structure. By calculating the hash value and rssi value subscript of WiFi information, the target subscript with the most occurrences is found to locate the acquisition point, and combined with weight adjustment and edge point processing, the positioning accuracy is improved.

Benefits of technology

While ensuring that fingerprint information is not lost, the time complexity and positioning accuracy of fingerprint matching are improved, faster fingerprint data query and higher positioning accuracy are achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115706924B_ABST
    Figure CN115706924B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for WiFi fingerprint positioning. The method comprises: obtaining a fingerprint library, the fingerprint library containing collection points, each collection point including k WiFi information, the WiFi information including RSSI information corresponding to the MAC information of the wireless access point; constructing a two-dimensional array consisting of multiple linked lists based on the WiFi information; obtaining first WiFi information of a device to be located; calculating a first hash value, and searching for a target linked list with the same hash value in the column elements of the two-dimensional array based on the first hash value; forming a k×2r matrix vector by combining the subscripts h of the 2r RSSI values ​​of the k MAC information; finding the target subscript h with the highest number of occurrences, and using the target subscript h to locate the corresponding collection point in the fingerprint library, thereby completing WiFi fingerprint positioning. In the present invention, the existing fingerprint library is modified to perform calculations without reducing positioning accuracy, thereby improving positioning efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of high-precision positioning and pattern recognition, and in particular to a method and device for WiFi fingerprint positioning. Background Art

[0002] In the field of high-precision positioning, WiFi fingerprint positioning uses a fingerprint database to collect WiFi information from the actual environment and achieve positioning. Because the WiFi information received at different locations varies, this collected information can be uniquely matched to the actual location. However, in practice, WiFi signals are affected by numerous environmental factors, and WiFi information collected at the same location can vary significantly.

[0003] One of the main challenges in WiFi fingerprint positioning is how to quickly find the exact location of an observation within a vast WiFi fingerprint database. To address this issue, mainstream matching algorithms in existing technologies include the Euclidean distance algorithm, the KNN matching algorithm, random forests, and their improved versions. Most of these improved algorithms improve positioning efficiency by reducing the number of matches or by dividing the fingerprint database into multiple sub-regions for matching. However, finding the optimal solution within a sub-region is a local optimal solution, not a global optimal solution. Summary of the Invention

[0004] The embodiments of the present invention provide a method and apparatus for WiFi fingerprint positioning, which are used to solve the problem in the prior art that, while reducing the number of matches or dividing a fingerprint library into multiple sub-areas to improve positioning efficiency, a global optimal solution cannot be found.

[0005] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:

[0006] In a first aspect, the present invention provides a method for WiFi fingerprint positioning, comprising:

[0007] Obtain a fingerprint library, the fingerprint library including m×n collection points, each of the collection points including k WiFi information, the WiFi information including: RSSI information corresponding to the MAC information of the wireless access point;

[0008] Constructing a two-dimensional array consisting of multiple linked lists based on the Wi-Fi information of the m×n collection points, wherein the header of each linked list is a hash value of the MAC information of a wireless access point, and the linked list elements include: all RSSI information corresponding to the MAC information in the Wi-Fi information of the m×n collection points and the subscript of the corresponding collection point; the MAC information in each linked list is different;

[0009] Obtain first WIFI information of the device to be located, where the first WIFI information includes: k first MAC information and corresponding first RSSI information;

[0010] For each first MAC information, calculate a first hash value of the first MAC information, and search for a target linked list with the same first hash value in the column elements of the two-dimensional array according to the first hash value; search for a preset RSSI interval where the first RSSI information is located in the linked list elements of the target linked list, select the RSSI values ​​of the r elements before and after the first RSSI information from the preset RSSI interval, obtain 2r RSSI values, and determine the subscript h of the 2r RSSI values; form a k×2r matrix vector with the subscript h of the 2r RSSI values ​​of the k first MAC information;

[0011] The target subscript h that appears the most times is found in the k×2r matrix vector, and the corresponding collection point is found in the fingerprint library through the target subscript h to complete the WiFi fingerprint positioning.

[0012] Optionally, searching the linked list element of the target linked list for a preset RSSI interval where the first RSSI information is located includes:

[0013] Using a binary search method in the linked list elements of the target linked list to find the preset RSSI interval where the first RSSI information is located;

[0014] Multiplying the preset RSSI interval by the preset weight value to obtain a revised preset RSSI interval;

[0015] The preset RSSI interval is a 2×k unit matrix composed of RSSI values ​​determined according to the first RSSI information, and the weight value is a 2×k unit matrix.

[0016] Optionally, the step of training weights includes:

[0017] Select at least one collection point with a known actual location as a test collection point; each of the test collection points includes k WiFi information, and the WiFi information includes: the second MAC information of the wireless access point and the corresponding second RSSI information;

[0018] For each test collection point, perform the following steps:

[0019] For each second MAC information of the test collection point, calculate a second hash value of the second MAC information, and search for a target linked list with the same second hash value in the column elements of the two-dimensional array according to the second hash value; and use a binary search method in the linked list elements of the target linked list to find a preset RSSI interval where the second RSSI information is located, select the RSSI values ​​of the r elements before and after the second RSSI information from the preset RSSI interval to obtain 2r RSSI values, and determine the subscript h of the 2r RSSI values; form a k×2r matrix vector with the subscript h of the 2r RSSI values ​​of the k second MAC information; the preset RSSI interval is a 2×k unit matrix composed of RSSI values ​​determined according to the second RSSI information;

[0020] Find the target subscript h that appears the most times in the k×2r matrix vector, find the corresponding collection point in the fingerprint library using the target subscript h, and obtain the estimated position of the test collection point;

[0021] The preset RSSI interval in which the second RSSI information is corrected by adjusting the weight is used so that the RSSI value of the collection point at the actual position is within the preset RSSI interval;

[0022] Traverse all test collection points to obtain the trained weights.

[0023] Optionally, q collection points greater than a preset threshold are selected in the preset RSSI interval;

[0024] Obtaining the center points of the q collection points in a preset coordinate system, where the horizontal axis of the preset coordinate system is the nth row in the m×n grid points formed by the m×n collection points in the fingerprint library, and the vertical axis is the first column in the m×n grid points formed by the m×n collection points in the fingerprint library;

[0025] Excluding the collection points whose Euclidean distance from the center point exceeds a preset range from the q collection points;

[0026] The remaining collection points are combined together, and the center points of the remaining collection points are calculated as the estimated position of the device to be located.

[0027] Optionally, the calculation of the center point includes:

[0028] According to the horizontal and vertical coordinates of the acquisition point according to the formula Calculating the center point;

[0029] Wherein, x is the horizontal coordinate of the center point; y is the vertical coordinate of the center point; q is the q collection points; x i is the horizontal coordinate of the i-th acquisition point; yi is the vertical coordinate of the i-th collection point.

[0030] Optionally, if there are edge points among the remaining collection points when calculating the center points of the remaining collection points, the edge points are flipped; the edge points are collection points located on the horizontal axis and the vertical axis;

[0031] The flipping process includes:

[0032] Determine whether there is an edge point on the horizontal axis. If there is an edge point on the horizontal axis, flip the edge point coordinates 180 degrees around the axis, with the center point before flipping as the center and a line parallel to the horizontal axis as the axis.

[0033] Determine whether there is an edge point located on the vertical axis. If there is an edge point located on the vertical axis, flip the edge point coordinates 180 degrees around the axis, with the center point before flipping as the center and a line parallel to the vertical axis as the axis.

[0034] If the coordinates of the edge point after flipping are beyond the range of the horizontal axis or vertical axis, the edge point coordinates are assigned to obtain the flipped collection point, and then the center point is calculated to complete the WiFi fingerprint positioning.

[0035] Optionally, the k WiFi information of the collection points are the first k WiFi information after sorting all the WiFi information of the collection points from high to low according to signal strength.

[0036] In a second aspect, the present invention provides a device for WiFi fingerprint positioning, comprising:

[0037] The first acquisition module is used to acquire a fingerprint library, wherein the fingerprint library includes m×n collection points, each of which includes k WiFi information, and the WiFi information includes: RSSI information corresponding to the MAC information of the wireless access point;

[0038] A first processing module is configured to construct a two-dimensional array consisting of a plurality of linked lists based on the Wi-Fi information of the m×n collection points, wherein the header of each linked list is a hash value of the MAC information of a wireless access point, and the linked list elements include: all RSSI information corresponding to the MAC information in the Wi-Fi information of the m×n collection points and the subscript of the corresponding collection point; the MAC information in each linked list is different;

[0039] The second acquisition module is used to obtain first WIFI information of the device to be located, where the first WIFI information includes: k first MAC information and corresponding first RSSI information;

[0040] A second processing module is configured to calculate, for each first MAC information, a first hash value of the first MAC information, and search, according to the first hash value, a target linked list having the same first hash value in the column elements of the two-dimensional array; and search, in the linked list elements of the target linked list, a preset RSSI interval where the first RSSI information is located, select RSSI values ​​of r elements before and after the first RSSI information from the preset RSSI interval to obtain 2r RSSI values, and determine a subscript h of the 2r RSSI values; and form a k×2r matrix vector with the subscript h of the 2r RSSI values ​​of the k first MAC information;

[0041] The positioning module is used to find the target subscript h that appears the most times in the k×2r matrix vector, find the corresponding collection point in the fingerprint library through the target subscript h, and complete WiFi fingerprint positioning.

[0042] Optionally, the second processing module includes:

[0043] A weight correction submodule is used to use a binary search method to find the preset RSSI interval where the first RSSI information is located in the list elements of the target list; multiply the preset RSSI interval by a preset weight to obtain a corrected preset RSSI interval; the preset RSSI interval is a 2×k unit matrix composed of RSSI values ​​determined according to the first RSSI information, and the weight is a 2×k unit matrix.

[0044] Optionally, a weight training submodule is used for weight training steps, and the weight training steps include:

[0045] Select at least one collection point with a known actual location as a test collection point; each of the test collection points includes k WiFi information, and the WiFi information includes: the second MAC information of the wireless access point and the corresponding second RSSI information;

[0046] For each test collection point, perform the following steps:

[0047] For each second MAC information of the test collection point, calculate a second hash value of the second MAC information, and search for a target linked list with the same second hash value in the column elements of the two-dimensional array according to the second hash value; and use a binary search method in the linked list elements of the target linked list to find a preset RSSI interval where the second RSSI information is located, select the RSSI values ​​of the r elements before and after the second RSSI information from the preset RSSI interval to obtain 2r RSSI values, and determine the subscript h of the 2r RSSI values; form a k×2r matrix vector with the subscript h of the 2r RSSI values ​​of the k second MAC information; the preset RSSI interval is a 2×k unit matrix composed of RSSI values ​​determined according to the second RSSI information;

[0048] Find the target subscript h that appears the most times in the k×2r matrix vector, find the corresponding collection point in the fingerprint library using the target subscript h, and obtain the estimated position of the test collection point;

[0049] The preset RSSI interval in which the second RSSI information is corrected by adjusting the weight is used so that the RSSI value of the collection point at the actual position is within the preset RSSI interval;

[0050] Traverse all test collection points to obtain the trained weights.

[0051] Optionally, an accuracy calibration module is used to select q collection points greater than a preset threshold in the preset RSSI interval; obtain the center point of the q collection points in a preset coordinate system, where the horizontal axis of the preset coordinate system is the nth row in the m×n grid points formed by the m×n collection points in the fingerprint library, and the vertical axis is the first column in the m×n grid points formed by the m×n collection points in the fingerprint library; exclude the collection points whose Euclidean distance from the center point exceeds a preset range among the q collection points; combine the remaining collection points together, and calculate the center point of the remaining collection points as the estimated position of the device to be located.

[0052] Optionally, the accuracy calibration module includes: a center point calculation module for calculating the center point according to the horizontal and vertical coordinates of the acquisition point according to the formula Calculating the center point;

[0053] Wherein, x is the horizontal coordinate of the center point; y is the vertical coordinate of the center point; q is the q collection points; x i is the horizontal coordinate of the i-th collection point; y i is the vertical coordinate of the i-th collection point.

[0054] Optionally, the accuracy calibration module further includes: an edge point calculation submodule, configured to flip the edge point if an edge point exists among the remaining acquisition points when calculating the center point of the remaining acquisition points; the edge point is a acquisition point located on the horizontal axis and the vertical axis;

[0055] The flipping process includes:

[0056] Determine whether there is an edge point on the horizontal axis. If there is an edge point on the horizontal axis, flip the edge point coordinates 180 degrees around the axis, with the center point before flipping as the center and a line parallel to the horizontal axis as the axis.

[0057] Determine whether there is an edge point located on the vertical axis. If there is an edge point located on the vertical axis, flip the edge point coordinates 180 degrees around the axis, with the center point before flipping as the center and a line parallel to the vertical axis as the axis.

[0058] If the coordinates of the edge point after flipping are beyond the range of the horizontal axis or vertical axis, the edge point coordinates are assigned to obtain the flipped collection point, and then the center point is calculated to complete the WiFi fingerprint positioning.

[0059] Optionally, the k WiFi information of the collection points are the first k WiFi information after sorting all the WiFi information of the collection points from high to low according to signal strength.

[0060] In a third aspect, the present invention provides a server comprising: a processor, a memory, and a program stored on the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the WiFi fingerprint positioning method as described in any one of the first aspects are implemented.

[0061] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for WiFi fingerprint positioning as described in any one of the first aspects are implemented.

[0062] In the present invention, by transforming the existing fingerprint library structure, using hash value algorithm mapping and binary search algorithm, the fingerprint data most similar to the observed value is found, the time complexity of fingerprint matching is improved, and while ensuring that fingerprint information is not lost, it is better adapted to the rapid query of fingerprint data and improves positioning accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:

[0064] Figure 1 A flowchart of a WiFi fingerprint positioning method provided by an embodiment of the present invention;

[0065] Figure 2 A fingerprint library discount diagram in a WiFi fingerprint positioning method provided by an embodiment of the present invention;

[0066] Figure 3 A schematic diagram of edge points in a WiFi fingerprint positioning method provided by an embodiment of the present invention;

[0067] Figure 4 A schematic diagram of the structure of a device for WiFi fingerprint positioning provided by an embodiment of the present invention;

[0068] Figure 5 A server architecture diagram provided for an embodiment of the present invention. DETAILED DESCRIPTION

[0069] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0070] Please refer to Figure 1 , an embodiment of the present invention provides a WiFi fingerprint positioning method, comprising:

[0071] Step 11: Obtain a fingerprint library, the fingerprint library includes m×n collection points, each of the collection points includes k WiFi information, and the WiFi information includes: RSSI information corresponding to the MAC information of the wireless access point;

[0072] Step 12: Construct a two-dimensional array consisting of multiple linked lists based on the Wi-Fi information of the m×n collection points, wherein the header of each linked list is a hash value of the MAC information of a wireless access point, and the linked list elements include: all RSSI information corresponding to the MAC information in the Wi-Fi information of the m×n collection points and the subscript of the corresponding collection point; the MAC information in each linked list is different;

[0073] Step 13: Obtain first WIFI information of the device to be located, where the first WIFI information includes: k first MAC information and corresponding first RSSI information;

[0074] Step 14: For each first MAC information, calculate the first hash value of the first MAC information, and search the target linked list with the same first hash value in the column elements of the two-dimensional array according to the first hash value; and search the preset RSSI interval where the first RSSI information is located in the linked list elements of the target linked list, select the RSSI values ​​of the r elements before and after the first RSSI information from the preset RSSI interval, obtain 2r RSSI values, and determine the subscript h of the 2r RSSI values; form a k×2r matrix vector with the subscript h of the 2r RSSI values ​​of the k first MAC information;

[0075] Step 15: Find the target subscript h that appears the most times in the k×2r matrix vector, find the corresponding collection point in the fingerprint library through the target subscript h, and complete the WiFi fingerprint positioning.

[0076] In an embodiment of the present invention, WiFi fingerprint positioning in the field of high-precision positioning is a method for achieving positioning by collecting WiFi information in the actual environment as a fingerprint library. When building the fingerprint library, a large amount of WiFi information is collected at the same location and processed to obtain a set of WiFi features representing the location, namely, the WiFi fingerprint. In the same place, WiFi fingerprints need to be collected at different locations in the place. The place is usually divided into multiple grids, and the intersection points of the grids are used as collection points. Therefore, the WiFi fingerprint library of a place is composed of multiple collection points, each of which is composed of the location coordinates of the collection point and a set of WiFi fingerprints. The location coordinates are the MAC information, and the WiFi fingerprints are the corresponding RSSI values.

[0077] In step 11, a fingerprint library in a certain scene is obtained. The fingerprint library contains m×n collection points, forming an m×n k-dimensional matrix vector U. The matrix vector U can be expressed as: in It is a 2×k WiFi fingerprint vector, and the mac information in the vector is different; mac i and rssi i They are the MAC information and the corresponding RSSI value of the i-th wireless access point respectively; each of the collection points includes k WiFi information, and the WiFi information includes: the RSSI information corresponding to the MAC information of the wireless access point, and the k WiFi information of the collection point is the first k WiFi information after sorting all the WiFi information of the collection point from high to low according to signal strength.

[0078] In step 12, the fingerprint library is traversed to convert the matrix vector U into a two-dimensional array consisting of multiple linked lists; the conversion process includes: initializing a two-dimensional array Link, traversing the matrix U, taking the first acquisition point vector α 1,1 , traverse the vector α 1,1 , calculate the hash value of mac1 as H 1,1 (mac1), and store the rssi corresponding to mac1 into the two-dimensional array Link(1,1)=[H 1,1 (mac1),rssi1], and so on, 1,1 All fingerprint information mac i and rssi i Store Link(i,1)=[H 1,1 (mac i ),rssi i ],1≤i≤k. Similarly, take the second fingerprint vector α 1,2 , calculate the hash value of each mac as H 1,2 (ma j c) If H 1,2 (mac j )=H 1,1 (mac i ),1≤i,j≤k, then Link(i,2)=[H 1,1 (mac i ),rssi j ], Link(i,1) and Link(i,2) are sorted in ascending order by rssi value, otherwise Link(l+1,1)=[H 1,2 (mac j ),rssi j ], where l = length(Link), i.e. the length of Link; take the hth fingerprint vector α h , 1≤h≤m×n, calculate the hash value of each mac as H h (mac i ),1≤i≤k, if H h (cma i )=kniL(j,1).H(cma),1≤i≤k,1≤j≤l, then Link(j,p)=[H h (mac i ),rssi i ], 1≤p≤m×n, and sort by the rssi value from Link(j,1) to Link(j,p) from small to large, otherwise Link(l+1,1)=[H h (mac i ),rssii ]; In the above conversion process, record α h The subscript is added to the Link = [H (mac), rssi, h] array, that is, each rssi value in the two-dimensional array can know which fingerprint vector in the matrix vector U it belongs to; after conversion, a two-dimensional array composed of multiple linked lists constructed according to the WiFi information of the m × n collection points can be expressed as:

[0079]

[0080] The header of each linked list is the hash value of the MAC information of a wireless access point, and the linked list elements include: all the RSSI information corresponding to the MAC information in the WIFI information of the m×n collection points and the subscript of the corresponding collection point; the MAC information in each linked list is different; each row is a row array, and the length of each row array is not necessarily the same. The fingerprint library can be used as follows Figure 2 The line graph shows that each line is a WiFi fingerprint; the X axis is the MAC information, the Y axis is the corresponding RSSI value, and the line is connected by multiple discrete points. The same line type of line represents the same α i,j WiFi fingerprint information.

[0081] In step 13 and step 14, the first WIFI information of the device to be located is obtained, where the first WIFI information includes: k first MAC information and corresponding first RSSI information. The first WiFi information of the device to be located is: Traverse the Calculate the first hash value H1(mac1) of the first mac information, and search the target linked list with the same first hash value H1(mac1) in the column elements of the two-dimensional array Link according to the first hash value; and use the binary search method to search the preset rssi interval [rssi] where the first rssi information is located in the linked list elements of the target linked list. a1 ,rssi b1 ], sequentially select the rssi values ​​of the r elements before and after the first rssi information from the preset rssi interval to obtain 2r rssi values, and determine the subscripts h of the 2r rssi values ​​= [h1 ... h 2r ]; The subscripts h of the 2r RSSI values ​​of the k first MAC information form a k×2r matrix vector as follows

[0082] In step 15, find the target subscript h that appears the most times in the k×2r matrix vector H i ,1≤i≤2r×k, through the target subscript hi Find the corresponding collection point in the fingerprint database to complete WiFi fingerprint positioning.

[0083] In the embodiment of the present invention, by transforming the existing fingerprint library structure, a hash value algorithm mapping and a binary search algorithm are used to find the fingerprint data most similar to the observed value, thereby improving the time complexity of fingerprint matching. While ensuring that fingerprint information is not lost, it is better adapted to the rapid query of fingerprint data and improves positioning accuracy.

[0084] In the embodiment of the present invention, optionally, searching the linked list element of the target linked list for a preset RSSI interval where the first RSSI information is located includes:

[0085] Using a binary search method in the linked list elements of the target linked list to find the preset RSSI interval where the first RSSI information is located;

[0086] Multiplying the preset RSSI interval by the preset weight value to obtain a revised preset RSSI interval;

[0087] The preset RSSI interval is a 2×k unit matrix composed of RSSI values ​​determined according to the first RSSI information, and the weight value is a 2×k unit matrix.

[0088] In the embodiment of the present invention, the closest collection point to the device to be located is found in the fingerprint database. In order to improve the positioning accuracy, when selecting the RSSI values ​​of the rth element before and after rssi1, in order to screen out some RSSIs with high confidence and eliminate RSSIs with relatively large errors, the interval [rssi a1 ,rssi b1 ]Add weight, that is, [w i rssi ai ,v i rssi bi ], 1≤i≤k, the weight needs to be repeatedly trained in the test data; set the initial weight before training the weight The initialization weight is a 2×k unit matrix; the RSSI value of the device to be located in all preset intervals of Link can be expressed as:

[0089]

[0090] Then the Hadamard product of the weight W and the preset interval R is:

[0091]

[0092] The weight W needs to be optimized during training to minimize the positioning error.

[0093] In the embodiment of the present invention, the step of training weights is optional, and the step of training weights includes:

[0094] Select at least one collection point with a known actual location as a test collection point; each of the test collection points includes k WiFi information, and the WiFi information includes: the second MAC information of the wireless access point and the corresponding second RSSI information;

[0095] For each test collection point, perform the following steps:

[0096] For each second MAC information of the test collection point, calculate a second hash value of the second MAC information, and search for a target linked list with the same second hash value in the column elements of the two-dimensional array according to the second hash value; and use a binary search method in the linked list elements of the target linked list to find a preset RSSI interval where the second RSSI information is located, select the RSSI values ​​of the r elements before and after the second RSSI information from the preset RSSI interval to obtain 2r RSSI values, and determine the subscript h of the 2r RSSI values; form a k×2r matrix vector with the subscript h of the 2r RSSI values ​​of the k second MAC information; the preset RSSI interval is a 2×k unit matrix composed of RSSI values ​​determined according to the second RSSI information;

[0097] Find the target subscript h that appears the most times in the k×2r matrix vector, find the corresponding collection point in the fingerprint library using the target subscript h, and obtain the estimated position of the test collection point;

[0098] The preset RSSI interval in which the second RSSI information is corrected by adjusting the weight is used so that the RSSI value of the collection point at the actual position is within the preset RSSI interval;

[0099] Traverse all test collection points to obtain the trained weights.

[0100] In the embodiment of the present invention, the test data selected by the training weight W is a batch of WiFi information with known actual locations. The WiFi information of the test is matched in the above WiFi fingerprint positioning method to obtain the estimated location. Combined with the above WiFi fingerprint positioning method, the RSSI value of each WiFi fingerprint information at the actual location is made to fall within the preset range [RSSI a1 ,rssi b1 ]. Therefore, adjust [w i rssi ai ,v i rssi bi], w and v in 1≤i≤k, so that the WiFi fingerprint rssi corresponding to the actual location i ∈[w i rssi ai ,v i rssi bi ] until the test data is traversed. Finally, the weights are obtained by training The preset RSSI interval is adjusted through multiple trainings so that the RSSI of the actual position falls within the preset RSSI interval of the test collection point. When counting h in the test collection point, the h at the actual position appears the most times.

[0101] In the embodiment of the present invention, weighting is used to adjust the adjacent intervals, and the weights are trained using test data, so that the matching algorithm is optimized.

[0102] In the embodiment of the present invention, optionally, q collection points greater than a preset threshold are selected in the preset RSSI interval;

[0103] Obtaining the center points of the q collection points in a preset coordinate system, where the horizontal axis of the preset coordinate system is the nth row in the m×n grid points formed by the m×n collection points in the fingerprint library, and the vertical axis is the first column in the m×n grid points formed by the m×n collection points in the fingerprint library;

[0104] Excluding the collection points whose Euclidean distance from the center point exceeds a preset range from the q collection points;

[0105] The remaining collection points are combined together, and the center points of the remaining collection points are calculated as the estimated position of the device to be located.

[0106] In the embodiment of the present invention, in order to obtain the position of the device to be located more accurately, after traversing a set of test data in the above embodiment, the preset interval [rssi a1 ,rssi b1 ] to process the data in the fingerprint database and find the rssi value in the interval [rssi a1 ,rssi b1 ] and greater than the preset threshold, count the number of collection points that meet the conditions, and finally count the top q collection points that meet the conditions among all collection points, that is, the RSSI values ​​collected by the same MAC at different times. If they have a certain signal strength and the strength values ​​are relatively close, it is believed that the two collections are at the same location with a higher confidence, so it is believed that the device to be located is most likely near the location of these q collection points; the collection area of ​​the collection point is composed of m×n grid points, so the horizontal axis x and vertical axis y of the q collection points are calculated according to the following formula to find the center point: Wherein, x is the horizontal coordinate of the center point; y is the vertical coordinate of the center point; q is the q collection points; x i is the horizontal coordinate of the i-th acquisition point; y i is the ordinate of the i-th collection point; and in order to eliminate the influence of noise points on the position estimation, the points whose Euclidean distance from the center point exceeds a certain value among the q collection points are deleted, and the first q collection points with the largest number of occurrences are found in a k×2r matrix vector H composed of the subscript h. After deleting the noise points, the matrix vectors are combined with the remaining collection points after screening in this embodiment, and then the center point of the remaining collection points is calculated, that is, the position of the device to be located. In this embodiment, the same position can also be estimated multiple times, and the historical estimated position and the current estimated position are weighted averaged, and the multiple estimated positions are averaged according to the formula Find the center point, delete the points whose Euclidean distance from the center point exceeds a certain value, and then calculate the center point of the remaining estimated position, which is the final estimated point of the device to be positioned.

[0107] In the embodiment of the present invention, by counting the fingerprints in the adjacent interval of the observed value RSSI, the value with the largest count is selected in the manner of minority obeying majority, which can effectively filter out certain abnormal or fluctuating RSSI values ​​in the observed value or fingerprint library, and use multiple methods to find possible similar fingerprints, and finally calculate the center point of these points. Compared with searching for similar fingerprints based on a single condition, the method in this embodiment is more stable.

[0108] In the embodiment of the present invention, optionally, if there are edge points among the remaining collection points when calculating the center points, the edge points are flipped; the edge points are collection points located on the horizontal axis and the vertical axis;

[0109] The flipping process includes:

[0110] Determine whether there is an edge point on the horizontal axis. If there is an edge point on the horizontal axis, flip the edge point coordinates 180 degrees around the axis, with the center point before flipping as the center and a line parallel to the horizontal axis as the axis.

[0111] Determine whether there is an edge point located on the vertical axis. If there is an edge point located on the vertical axis, flip the edge point coordinates 180 degrees around the axis, with the center point before flipping as the center and a line parallel to the vertical axis as the axis.

[0112] If the coordinates of the edge point after flipping are beyond the range of the horizontal axis or vertical axis, the edge point coordinates are assigned to obtain the flipped collection point, and then the center point is calculated to complete the WiFi fingerprint positioning.

[0113] In an embodiment of the present invention, considering that the estimated position is obtained by calculating the center point, this method is disadvantageous for edge points because all estimated points will be on the same side of the edge point, so calculating the center point will cause a large error in the estimation of the edge point; therefore, it is necessary to use an axisymmetric edge point positioning method; the edge point positioning method includes: calculating the center point through the first q acquisition points; detecting whether there is an edge point among the q acquisition points; if so, taking the center point before flipping as the center and a line parallel to the horizontal axis or the vertical axis as the axis, if there is an edge point located on the horizontal x-axis, the axis is parallel to the x-axis, and if there is an edge point located on the y-axis, the axis is parallel to the y-axis, and then the coordinates of the non-edge points are flipped 180 degrees with the axis as the center axis, and the coordinates of the non-edge edge points are also flipped 180 degrees with the axis as the center axis, and if the flipped coordinates exceed the edge coordinates, they are assigned according to the edge coordinates.

[0114] Please refer to Figure 3 , the small dots in the figure are the q collection points before the flipping process, the pentagon is the center point of the q collection points before the flipping process; the triangle is the collection point after the flipping process, and the square is the center point after the flipping process; for example, the q similar points are: (3, 2) (2, 3) (1, 2) (2, 1) (1, 1) (1, 4) (2, 5), and the center point before the flipping process is (1.8, 2.7). First, traverse the q similar points to determine whether there are any on the x and y axes. Edge points, where (1, 2) (1, 1) (1, 4) are edge points on the y-axis, and (2, 1) (1, 1) are edge points on the x-axis. Then the coordinates of the non-edge point (3, 2) need to be flipped along the x-axis and y-axis, x1 = 1.8-(3-1.8) = 0.6, y1 = 2.7-(2-2.7), resulting in the flipped point (0.6, 3.466). Since 0.6 is less than the edge coordinate 1, x1 is assigned a value of 1, so the final point is (1, 3.466). For another example, (1, 2), since 1 is already an edge point, it is not flipped, x2 = 1, and only 2 is flipped, then y2 = 2.7-(2-2.7), so the final coordinates are (1, 3.466); and so on, finally obtaining q similar points after flipping, and then calculating the center point.

[0115] In the embodiment of the present invention, the collection point most similar to the observed value can be found by counting adjacent RSSI values. At the same time, the center point can be calculated using the Euclidean distance of these k collection points, so that the positioning accuracy is higher. The edge point processing algorithm is used to effectively reduce the error caused by the weighted average of the edge points and improve the positioning accuracy.

[0116] In the embodiment of the present invention, by transforming the existing fingerprint library structure, a hash value algorithm mapping and a binary search algorithm are used to find the fingerprint data most similar to the observed value, thereby improving the time complexity of fingerprint matching. While ensuring that fingerprint information is not lost, it is better adapted to the rapid query of fingerprint data and improves positioning accuracy.

[0117] Please refer to Figure 4 The present invention provides a device for WiFi fingerprint positioning, comprising:

[0118] The first acquisition module 41 is used to acquire a fingerprint library, wherein the fingerprint library includes m×n collection points, each of which includes k WiFi information, and the WiFi information includes: RSSI information corresponding to the MAC information of the wireless access point;

[0119] A first processing module 42 is configured to construct a two-dimensional array consisting of a plurality of linked lists based on the Wi-Fi information of the m×n collection points, wherein the header of each linked list is a hash value of the MAC information of a wireless access point, and the linked list elements include: all RSSI information corresponding to the MAC information in the Wi-Fi information of the m×n collection points and the subscript of the corresponding collection point; the MAC information in each linked list is different;

[0120] The second acquisition module 43 is used to obtain the first WIFI information of the device to be located, where the first WIFI information includes: k first MAC information and corresponding first RSSI information;

[0121] The second processing module 44 is configured to calculate, for each first MAC information, a first hash value of the first MAC information, and search, according to the first hash value, a target linked list having the same first hash value in the column elements of the two-dimensional array; search, among the linked list elements of the target linked list, a preset RSSI interval where the first RSSI information is located, select RSSI values ​​of r elements before and after the first RSSI information from the preset RSSI interval to obtain 2r RSSI values, and determine subscripts h of the 2r RSSI values; and form a k×2r matrix vector with the subscripts h of the 2r RSSI values ​​of the k first MAC information;

[0122] The positioning module 45 is used to find the target subscript h that appears the most times in the k×2r matrix vector, and find the corresponding collection point in the fingerprint library based on the target subscript h to complete WiFi fingerprint positioning.

[0123] In an embodiment of the present invention, optionally, the second processing module includes:

[0124] A weight correction submodule is used to use a binary search method to find the preset RSSI interval where the first RSSI information is located in the list elements of the target list; multiply the preset RSSI interval by a preset weight to obtain a corrected preset RSSI interval; the preset RSSI interval is a 2×k unit matrix composed of RSSI values ​​determined according to the first RSSI information, and the weight is a 2×k unit matrix.

[0125] In the embodiment of the present invention, the weight training submodule is optionally used for the step of training weights, and the step of training weights includes:

[0126] Select at least one collection point with a known actual location as a test collection point; each of the test collection points includes k WiFi information, and the WiFi information includes: the second MAC information of the wireless access point and the corresponding second RSSI information;

[0127] For each test collection point, perform the following steps:

[0128] For each second MAC information of the test collection point, calculate a second hash value of the second MAC information, and search for a target linked list with the same second hash value in the column elements of the two-dimensional array according to the second hash value; and use a binary search method in the linked list elements of the target linked list to find a preset RSSI interval where the second RSSI information is located, select the RSSI values ​​of the r elements before and after the second RSSI information from the preset RSSI interval to obtain 2r RSSI values, and determine the subscript h of the 2r RSSI values; form a k×2r matrix vector with the subscript h of the 2r RSSI values ​​of the k second MAC information; the preset RSSI interval is a 2×k unit matrix composed of RSSI values ​​determined according to the second RSSI information;

[0129] Find the target subscript h that appears the most times in the k×2r matrix vector, find the corresponding collection point in the fingerprint library using the target subscript h, and obtain the estimated position of the test collection point;

[0130] The preset RSSI interval in which the second RSSI information is corrected by adjusting the weight is used so that the RSSI value of the collection point at the actual position is within the preset RSSI interval;

[0131] Traverse all test collection points to obtain the trained weights.

[0132] In an embodiment of the present invention, optionally, an accuracy calibration module is configured to select q collection points greater than a preset threshold value in the preset RSSI interval; obtain the center point of the q collection points in a preset coordinate system, where the horizontal axis of the preset coordinate system is the nth row in the m×n grid points formed by the m×n collection points in the fingerprint library, and the vertical axis is the first column in the m×n grid points formed by the m×n collection points in the fingerprint library; exclude collection points whose Euclidean distance from the center point exceeds a preset range from the q collection points; combine the remaining collection points together, and calculate the center point of the remaining collection points as the estimated position of the device to be located.

[0133] In the embodiment of the present invention, optionally, the accuracy calibration module includes: a center point calculation module for calculating the center point according to the horizontal coordinate and the vertical coordinate of the acquisition point according to the formula Calculating the center point;

[0134] Wherein, x is the horizontal coordinate of the center point; y is the vertical coordinate of the center point; q is the q collection points; x i is the horizontal coordinate of the i-th collection point; y i is the vertical coordinate of the i-th collection point.

[0135] In an embodiment of the present invention, the accuracy calibration module may optionally further include: an edge point calculation submodule configured to flip the edge point if an edge point exists among the remaining acquisition points when calculating the center point of the remaining acquisition points; the edge point is a acquisition point located on the horizontal axis and the vertical axis;

[0136] The flipping process includes:

[0137] Determine whether there is an edge point on the horizontal axis. If there is an edge point on the horizontal axis, flip the edge point coordinates 180 degrees around the axis, with the center point before flipping as the center and a line parallel to the horizontal axis as the axis.

[0138] Determine whether there is an edge point located on the vertical axis. If there is an edge point located on the vertical axis, flip the edge point coordinates 180 degrees around the axis, with the center point before flipping as the center and a line parallel to the vertical axis as the axis.

[0139] If the coordinates of the edge point after flipping are beyond the range of the horizontal axis or vertical axis, the edge point coordinates are assigned to obtain the flipped collection point, and then the center point is calculated to complete the WiFi fingerprint positioning.

[0140] In the embodiment of the present invention, optionally, the k pieces of WiFi information of the collection points are first k pieces of WiFi information after sorting all WiFi information of the collection points from high to low according to signal strength.

[0141] The device for WiFi fingerprint positioning provided by the embodiment of the present invention can realize Figure 1 In order to avoid repetition, the various processes of the method for WiFi fingerprint positioning in the method embodiment are not described here.

[0142] Please refer to Figure 5 The embodiment of the present invention further provides a server 50, including a processor 51, a memory 52, and a computer program stored in the memory 52 and executable on the processor 51. When the computer program is executed by the processor 51, each process of the above-mentioned WiFi fingerprint positioning method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0143] The embodiment of the present invention further provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the computer program implements the various processes of the above-mentioned WiFi fingerprint positioning method embodiment and can achieve the same technical effect. To avoid repetition, it is not described here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0144] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0145] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, air conditioner, or server, etc.) to execute the methods described in each embodiment of the present invention.

[0146] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are protected by the present invention.

Claims

1. A WiFi fingerprint positioning method, characterized in that: include: Obtain a fingerprint library, the fingerprint library including m×n collection points, each of the collection points including k WiFi information, the WiFi information including: RSSI information corresponding to the MAC information of the wireless access point; Constructing a two-dimensional array consisting of multiple linked lists based on the Wi-Fi information of the m×n collection points, wherein the header of each linked list is a hash value of the MAC information of a wireless access point, and the linked list elements include: all RSSI information corresponding to the MAC information in the Wi-Fi information of the m×n collection points and the subscript of the corresponding collection point; the MAC information in each linked list is different; Obtain first WIFI information of the device to be located, where the first WIFI information includes: k first MAC information and corresponding first RSSI information; For each first MAC information, calculate a first hash value of the first MAC information, and search for a target linked list with the same first hash value in the column elements of the two-dimensional array according to the first hash value; search for a preset RSSI interval where the first RSSI information is located in the linked list elements of the target linked list, select the RSSI values ​​of the r elements before and after the first RSSI information from the preset RSSI interval, obtain 2r RSSI values, and determine the subscript h of the 2r RSSI values; form a k×2r matrix vector with the subscript h of the 2r RSSI values ​​of the k first MAC information; Find the target subscript h that appears the most times in the k×2r matrix vector, and find the corresponding collection point in the fingerprint library through the target subscript h to complete WiFi fingerprint positioning; The step of searching the linked list element of the target linked list for the preset RSSI interval where the first RSSI information is located includes: Using a binary search method in the linked list elements of the target linked list to find the preset RSSI interval where the first RSSI information is located; Also includes: Select q collection points greater than a preset threshold in the preset RSSI interval; Obtaining the center points of the q collection points in a preset coordinate system, where the horizontal axis of the preset coordinate system is the nth row in the m×n grid points formed by the m×n collection points in the fingerprint library, and the vertical axis is the first column in the m×n grid points formed by the m×n collection points in the fingerprint library; Excluding the collection points whose Euclidean distance from the center point exceeds a preset range from the q collection points; The remaining collection points are combined together, and the center points of the remaining collection points are calculated as the estimated position of the device to be located; Also includes: If there are edge points among the remaining collection points when calculating the center points of the remaining collection points, the edge points are flipped; the edge points are collection points located on the horizontal axis and the vertical axis; The flipping process includes: Determine whether there is an edge point on the horizontal axis. If there is an edge point on the horizontal axis, flip the edge point coordinates 180 degrees around the axis, with the center point before flipping as the center and a line parallel to the horizontal axis as the axis. Determine whether there is an edge point located on the vertical axis. If there is an edge point located on the vertical axis, flip the edge point coordinates 180 degrees around the axis, with the center point before flipping as the center and a line parallel to the vertical axis as the axis. If the coordinates of the edge point after flipping are beyond the range of the horizontal axis or vertical axis, the edge point coordinates are assigned to obtain the flipped collection point, and then the center point is calculated to complete the WiFi fingerprint positioning.

2. The method for WiFi fingerprint positioning according to claim 1, characterized in that: The step of searching the linked list element of the target linked list for the preset RSSI interval where the first RSSI information is located includes: Using a binary search method in the linked list elements of the target linked list to find the preset RSSI interval where the first RSSI information is located; Multiplying the preset RSSI interval by the preset weight value to obtain a revised preset RSSI interval; The preset RSSI interval is a 2×k unit matrix composed of RSSI values ​​determined according to the first RSSI information, and the weight value is a 2×k unit matrix.

3. The method for WiFi fingerprint positioning according to claim 2, characterized in that: Also includes: The steps of training weights include: Select at least one collection point with a known actual location as a test collection point; each of the test collection points includes k WiFi information, and the WiFi information includes: the second MAC information of the wireless access point and the corresponding second RSSI information; For each test collection point, perform the following steps: For each second MAC information of the test collection point, calculate a second hash value of the second MAC information, and search for a target linked list with the same second hash value in the column elements of the two-dimensional array according to the second hash value; and use a binary search method in the linked list elements of the target linked list to find a preset RSSI interval where the second RSSI information is located, select the RSSI values ​​of the r elements before and after the second RSSI information from the preset RSSI interval to obtain 2r RSSI values, and determine the subscript h of the 2r RSSI values; form a k×2r matrix vector with the subscript h of the 2r RSSI values ​​of the k second MAC information; the preset RSSI interval is a 2×k unit matrix composed of RSSI values ​​determined according to the second RSSI information; Find the target subscript h that appears the most times in the k×2r matrix vector, find the corresponding collection point in the fingerprint library using the target subscript h, and obtain the estimated position of the test collection point; The preset RSSI interval in which the second RSSI information is corrected by adjusting the weight is used so that the RSSI value of the collection point at the actual position is within the preset RSSI interval; Traverse all test collection points to obtain the trained weights.

4. The method for WiFi fingerprint positioning according to claim 1, characterized in that: The calculation of the center point includes: Calculate the center point according to the formula based on the horizontal coordinate and the vertical coordinate of the collection point; Wherein, x is the horizontal coordinate of the center point; y is the vertical coordinate of the center point; q is the q collection points; x i is the horizontal coordinate of the i-th collection point; y i is the vertical coordinate of the i-th collection point.

5. The method for WiFi fingerprint positioning according to claim 1, characterized in that: The k WiFi information of the collection points are the first k WiFi information after sorting all the WiFi information of the collection points from high to low according to signal strength.

6. A device for WiFi fingerprint positioning, characterized in that: include: The first acquisition module is used to acquire a fingerprint library, wherein the fingerprint library includes m×n collection points, each of which includes k WiFi information, and the WiFi information includes: RSSI information corresponding to the MAC information of the wireless access point; A first processing module is configured to construct a two-dimensional array consisting of a plurality of linked lists based on the Wi-Fi information of the m×n collection points, wherein the header of each linked list is a hash value of the MAC information of a wireless access point, and the linked list elements include: all RSSI information corresponding to the MAC information in the Wi-Fi information of the m×n collection points and the subscript of the corresponding collection point; the MAC information in each linked list is different; The second acquisition module is used to obtain first WIFI information of the device to be located, where the first WIFI information includes: k first MAC information and corresponding first RSSI information; A second processing module is configured to calculate, for each first MAC information, a first hash value of the first MAC information, and search, according to the first hash value, a target linked list having the same first hash value in the column elements of the two-dimensional array; and search, in the linked list elements of the target linked list, a preset RSSI interval where the first RSSI information is located, select RSSI values ​​of r elements before and after the first RSSI information from the preset RSSI interval to obtain 2r RSSI values, and determine a subscript h of the 2r RSSI values; and form a k×2r matrix vector with the subscript h of the 2r RSSI values ​​of the k first MAC information; A positioning module is used to find the target subscript h that appears the most times in the k×2r matrix vector, and find the corresponding collection point in the fingerprint library based on the target subscript h to complete WiFi fingerprint positioning; The second processing module further includes: a weight correction submodule, configured to use a binary search method to find the preset RSSI interval where the first RSSI information is located in the linked list elements of the target linked list; an accuracy calibration module, configured to select q collection points greater than a preset threshold value in the preset RSSI interval; obtain a center point of the q collection points in a preset coordinate system, where the horizontal axis of the preset coordinate system is the nth row in the m×n grid points formed by the m×n collection points in the fingerprint library, and the vertical axis is the first column in the m×n grid points formed by the m×n collection points in the fingerprint library; exclude collection points whose Euclidean distance from the center point exceeds a preset range from the q collection points; combine the remaining collection points together, and calculate the center point of the remaining collection points as the estimated position of the device to be located; The precision calibration module further includes: an edge point calculation submodule, configured to perform a flipping process on the edge point if an edge point exists among the remaining collection points when calculating the center point of the remaining collection points; the edge point is a collection point located on the horizontal axis and the vertical axis; the flipping process includes: determining whether there is an edge point located on the horizontal axis; if there is an edge point located on the horizontal axis, flipping the edge point coordinates 180 degrees around the axis with the center point before the flipping process as the center and a line parallel to the horizontal axis as the axis; determining whether there is an edge point located on the vertical axis; if there is an edge point located on the vertical axis, flipping the edge point coordinates 180 degrees around the axis with the center point before the flipping process as the center and a line parallel to the vertical axis as the axis; if the flipped edge point coordinates exceed the range of the horizontal axis or the vertical axis, assigning a value according to the edge point coordinates to obtain the flipped collection point, and then calculating the center point to complete the WiFi fingerprint positioning.

7. A server, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the WiFi fingerprint positioning method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the WiFi fingerprint positioning method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Positioning system and positioning method based on WI-FI fingerprints

    US20210274496A1