| People spend 80% time indoors in their daily life and the demand of indoor positioning is increasing,such as emergency assistance and safety precautions.WiFi fingerprint positioning method has become a hot research because it is not affected by indoor multipath effects and can obtain high accuracy.Firstly,the fingerprint database is greatly large leads to low efficiency,so the K-means clustering algorithm is introduced to cluster it.The traditional K-means algorithm randomly initializes the clustering centers,resulting in the clustering converging to the local minimum.We proposes an improved K-means algorithm,which uses the particle swarm optimization(PSO)technology with global optimization ability to select the initial clustering centers,and improves the fixed weight and learning factors to the values that change dynamically with the iterations,so as to improve the global optimization ability of the algorithm.At the same time,clustering is based on the Received Signal Strength Indicator(RSSI)Euclidean distance,which takes no account of the influence of fingerprint position coordinates on clustering,leading to discrete points in clustering.Therefore,the dual distance of RSSI and position coordinates between fingerprint and cluster center is presented to cluster.Secondly,the Weighted K-Nearest Neighbors(WKNN)algorithm commonly used in the online matching stage.The traditional WKNN algorithm utilizes the Euclidean distance of RSSI to indicate the coordinate similarity between the point to be tested and the reference point in the fingerprint database.The impact of RSSI fluctuation is not considered and the signal strength similarity is not completely consistent with the position similarity,causing to large positioning error.In this paper,we introduce the RSSI weighted Mahalanobis distance to replace the Euclidean distance.The covariance matrix reflects the characteristics of fingerprint data and the influence of RSSI fluctuation is reduced,and the weight is introduced to approximate the position relationship between the point to be measured and the reference point.In addition,the number of nearest neighbors K of WKNN in different locations is a fixed value,so a dynamic K value is proposed to replace the fixed value for different points,which further improves the positioning accuracy.Finally,the proposed indoor positioning method based on improved K-means clustering and WKNN algorithm is simulated and analyzed.The simulation results show that the average positioning error of the improved algorithm is 1.35 m,which is32% better than WKNN,and the online positioning time is 0.57 s,which is 65% better.Therefore,the proposed algorithm is a high-precision and high-efficiency indoor positioning method. |