Disclosure of Invention
The present invention is directed to provide an indoor positioning method based on received signal strength clustering and reference point position clustering to improve indoor positioning accuracy.
The technical idea for realizing the invention is as follows: the reference points are effectively clustered by adopting a dual-clustering technology of received signal strength clustering and reference point position clustering to form a certain number of clustering centers and class members thereof, so that the calculated amount in the positioning stage is reduced, and the positioning accuracy is improved. The implementation scheme is as follows:
1) An off-line stage:
1a) Selecting an area provided with Wi-Fi access points APs;
1b) N reference points R are selected in this regionPs and measuring the received signal strength RSS from surrounding access points received in four directions by the N reference points, storing it to a database beta (o) Performing the following steps;
1c) Performing first clustering on all reference points RPs according to the received signal strength RSS by adopting an attractor propagation algorithm AP;
1d) Performing secondary clustering on each cluster obtained by the primary clustering by adopting an attractor propagation algorithm AP according to the geographic position;
1e) Judging the number of clusters of the second clustering: if the number of clusters obtained by the second clustering is a positive integer which is more than or equal to 2, the distance between every two clusters is calculated, the clusters with the distance less than 4 meters are combined into one cluster, the clustering result is recorded into a database, otherwise, the clustering result is directly recorded into the database, and the construction of the fingerprint database is completed;
2) An online stage:
2a) Measuring received signal strength RSS vectors from the surrounding L access points APs at the point to be located:
χ r =[χ 1,r ,...,χ k,r ,...,χ L,r ] T ,
wherein { χ k,r K =1, 2.. -, L } is data from the kth access point APs acquired by the mobile device in either direction;
2b) Coarse positioning:
calculating the RSS vector x of the received signal strength of the point to be positioned r Similarity with the received signal strength RSS vector of the cluster center of each cluster in the fingerprint database, the similarity being defined as:
whereinThe received signal strength RSS vector in the direction o for the cluster center of the jth cluster, H is the set of cluster centers of all clusters, o = {0 °,90 °,180 °,270°};
Setting a threshold value:wherein alpha is 1 +α 2 =1;
Similarity s (r, j) (o) The cluster larger than the threshold value alpha is used as a cluster for coarse positioning matching;
2c) And (3) accurate positioning: randomly selecting 8 access points APs, utilizing the 8 access points APs and the cluster member received signal strength RSS obtained by coarse positioning matching, and calculating the accurate position of the point to be positioned through a compressed sensing algorithm to complete the positioning of the point to be positioned.
Compared with the prior art, the invention has the following advantages:
firstly, because the invention adopts the double clustering technology of received signal strength clustering and reference point position clustering, and the members with the geographical position far away from other cluster members in the original cluster are independently divided into a cluster, the condition that the reference points with the geographical position far away but with received signal strength RSS close to each other are clustered into the same cluster is avoided;
secondly, because the invention adopts the double clustering technology of the received signal strength clustering and the reference point position clustering, and the clusters which should not be disassembled are combined into one cluster, the integrity of the original cluster can be ensured while the singular point processing is completed, thereby achieving better clustering effect.
Detailed Description
Preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
Referring to fig. 1, the implementation steps of the present invention are divided into an offline stage and an online stage, a fingerprint database is established in the offline stage, and the online stage is used for real-time positioning, and the implementation steps are as follows:
step 1, establishing a fingerprint database in an off-line stage.
1a) Selecting a region provided with Wi-Fi access points APs, wherein the region is a partial region of a main building II of the university of Sigan electronic technology, the length of the partial region is about 21 meters, and the width of the partial region is about 8 meters, as shown in FIG. 2;
1b) N =37 reference points RPs are selected in the area of fig. 2, as shown in fig. 3, and the received signal strengths RSS from the surrounding L =36 access points APs, received in four directions by these 37 reference points, are measured and stored in a database, which is denoted as beta (o) :
WhereinIs the average of the received signal strengths RSS from the i-th access point APs acquired in the direction o of the j-th reference point RPs, i =1,2, \8230; 36,j =1,2, \8230; 37,o e o = {0 °,90 °,180 °,270 ° }, q =25 denotes the number of samples on each reference pointNumber, once per second;
1c) Performing first clustering on all reference points RPs by adopting an attractor propagation algorithm AP according to the received signal strength RSS:
the attractor propagation algorithm AP refers to documents Clustering by visiting Messages Between Data Points, frey, bredan J.1, dueck and Detbert1, clustering is carried out according to the similarity Between Data Points, the number of clusters obtained by Clustering does not need to be specified in advance, and on the contrary, all the Data Points are used as potential Clustering centers. The cluster number of the clustering is influenced by the reference degree, if the median of the similarity of the input data is taken as the value of the reference degree, the cluster number obtained by clustering is medium, and if the reference degree is small, the cluster number obtained by clustering is small. The algorithm continuously updates the values of the attraction degrees and the attribution degrees of all the data points through an iteration process, if the sum of the attribution degrees and the attraction degrees of a certain data point is larger than a preset value, the data point is a clustering center, otherwise, the data point is not the clustering center, and the clustering is completed when the clustering result converges or reaches a preset maximum iteration frequency. The method comprises the following specific steps:
1c1) Calculating a reference p using the received signal strength RSS vectors of all reference points RPs (o) ;
1c2) Using reference p (o) And iteratively solving clustering centers by using reference point Received Signal Strength (RSS) vectors, wherein each clustering center represents a cluster:
1c 2-1), calculating a reference p using the received signal strength RSS vectors of all reference points RPs (o) The calculation formula is as follows:
wherein gamma is (o) Is an experimentally determined real number, in this example, taken as γ (o) =0.95,s(i,j) (o) For the similarity of the received signal strength RSS vectors for the ith and jth reference points, N is the total number of reference points RPs, which in this example is 37,o e O = {0 °,90 °,180 °,270 °And (4) mean represents a median operation.
1c 2-2), let s (i, i) (o) =p (o) Creating an N-row N-column attraction matrix r (o) And an attribution matrix a of N rows and N columns (o) Where i =1, 2.. Ang., N, the two matrix initial elements are all zero;
1c 2-3), updating and calculating an attraction degree matrix r (o) And a degree of ownership matrix a (o) Element value of (2):
wherein j =1,2, \8230, N, i '=1,2, \8230, N, j' =1,2, \8230, N, r (i, j) (o) Is an attraction degree matrix r (o) Row ith and column jth element of (a, j) (o) Is a membership matrix a (o) Row ith and column jth element of (e), s (i, j) (o) Similarity of Received Signal Strength (RSS) vectors of an ith reference point and a jth reference point;
1c 2-4), defining an N-dimensional vector c, calculating the value of the ith element of the vector c: c (i) = a (i, i) (o) +r(i,i) (o) Judging the size of c (i): if c (i)&0, the ith reference point is a clustering center, otherwise, the ith reference point is not the clustering center;
1c 2-5), judging whether the clustering result is converged: if convergence, directly entering the step 1c 3), otherwise, updating and calculating the attraction degree matrix r (o) And attribution degree matrix a (o) Until the clustering result converges or the preset maximum iteration number is reached, and then step 1c 3) is carried out.
1c3) All the reference points are divided into corresponding clusters, the first attractor propagation algorithm AP clustering is completed, the clustering result is shown in fig. 3, the points with the same shape in fig. 3 belong to the same cluster, and 37 reference points are clustered into 6 clusters. It can be seen that the cluster represented by the diamond is divided geographically into two parts, the lowermost point of the cluster represented by the star is a singular point;
1d) And performing secondary clustering on each cluster obtained by the primary clustering by adopting an attractor propagation algorithm AP according to the geographic position:
1d1) Calculating reference degree p by using Received Signal Strength (RSS) vector of reference point RPs of each cluster obtained by first clustering d (o) ;
1d2) Using reference p d (o) And iteration is carried out on reference point Received Signal Strength (RSS) vectors to obtain clustering centers, each clustering center represents a cluster, and the method comprises the following steps:
1d 2-1), calculating a reference degree p by using the received signal strength RSS vector of the reference point RPs of each cluster obtained by first clustering d (o) The calculation formula is
Wherein gamma is d (o) Is an experimentally determined real number, in this example, taken as γ d (o) =1.2,d(i,j) (o) The opposite number of the Euclidean distance between the ith reference point and the jth reference point, M is the number of reference points RPs to be clustered, o e O = {0 °,90 °,180 °,270 ° }, and median represents the median operation.
1d 2-2), let s (i, i) d (o) =p d (o) Creating an attraction matrix r of M rows and M columns d (o) And M rows and M columns of attribution degree matrix a d (o) Where i =1, 2.... M, the two matrix initial elements are all zero;
1d 2-3), updating and calculating an attraction degree matrix r d (o) And attribution degree matrix a d (o) Element value of (2):
wherein j =1,2, \8230, M, i '=1,2, \8230, M, j' =1,2, \8230, M, r (i, j) d (o) Is an attraction degree matrix r d (o) Row ith and column jth element of (a, j) d (o) Is a membership matrix a d (o) Row ith and column jth element of (e), s (i, j) d (o) The number is the opposite number of the Euclidean distance between the ith reference point and the jth reference point;
1d 2-4), defining an M-dimensional vector c d Calculating the vector c d The value of the ith element of (c): c. C d (i)=a(i,i) d (o) +r(i,i) d (o) Judgment c d (i) The size of (2): if c is d (i) If the number is more than 0, the ith reference point is a clustering center, otherwise, the ith reference point is not the clustering center;
1d 2-5), judging whether the clustering result is converged: if convergence, directly entering step 1d 3), otherwise, referring to the degree p d (o) Changing the degree of reference to 1.5 times of the original degree of reference, and updating and calculating the attraction matrix r d (o) And a degree of ownership matrix a d (o) Until the clustering result converges, and then step 1d 3).
1d3) Dividing all reference points into corresponding clusters;
1e) Judging the number of clusters obtained by the second clustering: and if the number of clusters obtained by the second clustering is a positive integer which is more than or equal to 2, the distance between every two clusters is obtained, and the distance between the two clusters is the average value of the Euclidean distances between all the members of one cluster and all the members of the other cluster. And merging the clusters with the distance less than 4 meters into one cluster to finish the AP clustering of the second attractor propagation algorithm, wherein the clustering result is shown in figure 4.
The partial results produced during the second clustering are shown in fig. 5 to 8, in which:
FIG. 5 shows two clusters generated during the second clustering, which are 7.9615 meters apart and are not merged;
FIG. 6 shows that the singular point in the cluster obtained by the second clustering, i.e., the triangular point in FIG. 6, is successfully found, and the singular point is separately divided into a cluster;
fig. 7 shows two clusters obtained in the second clustering process, which are 2.9566 meters apart, combined into one cluster,
FIG. 8 is a graph of the results of the merging of two clusters in FIG. 7;
and recording the clustering result into a database, and finishing the construction of the fingerprint database.
And 2, positioning in real time in an online stage.
2a) The received signal strength RSS vector from the surrounding L =36 access points APs is measured at the point to be positioned:
χ r =[χ 1,r ,...,χ k,r ,...,χ L,r ] T
wherein { χ k,r K =1, 2.., 36} is data acquired by the mobile device in either direction.
2b) Calculating the RSS vector x of the received signal strength of the point to be positioned r Similarity with the received signal strength RSS vector of the cluster center of each cluster in the fingerprint database, the similarity being defined as:
whereinIs the received signal strength RSS vector of the cluster center of the jth cluster in the direction o, H is the set of cluster centers of all clusters, o = {0 °,90 °,180 °,270 ° };
setting a threshold value:wherein alpha is 1 +α 2 =1, present example α 1 =0.95;
Similarity s (r, j) (o) The cluster larger than the threshold value alpha is used as a cluster for coarse positioning matching;
2c) And (3) accurate positioning: randomly selecting 8 access points APs, obtaining the received signal strength RSS of the cluster member of the cluster by using the 8 access points APs and the rough positioning matching, and calculating the accurate position of the point to be positioned through a compressed sensing algorithm to complete the positioning of the point to be positioned.
The effects of the present invention can be further described in detail by the following experiments.
The invention is used for positioning with the existing Wi-Fi indoor positioning technology.
The existing Wi-Fi indoor positioning technology comprises the following steps:
collecting received signal strength RSS fingerprint data of a reference point in an off-line stage, clustering the reference point once according to the received signal strength RSS, and constructing a fingerprint database without clustering for the second time; and in the accurate positioning stage, clusters obtained by matching in the coarse positioning stage are utilized, and the position of the point to be positioned is obtained through a compressed sensing algorithm.
Selecting 10 points to be positioned, respectively positioning each point 10 times by adopting the method and the prior art, recording the actual position of the point to be positioned and the result of each positioning, and calculating the positioning error, wherein the positioning error is the Euclidean distance between the actual position of the point to be positioned and the positioning result. The average positioning error of the present invention and the prior art is calculated, and the probability distribution of the error is calculated, and the result is shown in fig. 9.
As can be seen from fig. 9: the solid line with the circle is far above the solid line with the star flowers except for the initial 1 m, which shows that under the same environmental conditions, the positioning precision of the invention is obviously higher than that of the prior art.
As can also be seen from fig. 9: the probability of the positioning error within 3 meters in the prior art is 0.5, while the probability of the positioning error within 3 meters in the invention is 0.7; the probability of the positioning error within 4 meters in the prior art is 0.66, while the probability of the positioning error within 4 meters in the invention is 0.88; the maximum positioning error of the prior art is about 11 meters, while the maximum positioning error of the present invention is about 5 meters.
The average positioning error of the prior art is 3.2919 meters, and the average positioning error of the invention is 2.4225 meters.
In conclusion, the positioning accuracy of the present invention is higher than that of the prior art.