-
APIT定位算法是由弗吉尼亚大学HE等人提出的一种定位算法。如图 1所示,在该定位算法中,未知节点收集所有能与之通信的信标节点,然后从这些信标节点中任取3个组成信标三角形,假设与未知节点通信的信标节点共有n个,那么就有Cn3个信标三角形,并筛选出包含未知节点的信标三角形,将这些信标三角形重叠区域求质心,即为未知节点的位置。
-
APIT定位算法的理论基础是PIT测试法,通过PIT测试法筛选出包含未知节点的信标三角形,如图 2所示。M为未知节点,A, B, C为信标节点,假设M沿某方向移动时,同时远离或靠近A, B, C这3个点,则点M在△ABC外面,相反点M在△ABC内部。
由于在静态网络中节点是固定的,因此通过未知节点与其邻节点间的信息交换来模拟未知节点移动。假设未知节点M接收到信标节点A, B, C的RSSI值分别为RA, RB, RC,那么未知节点M移动至某一邻居节点时,收到A, B, C的RSSI值就是该邻居节点在此处收到A, B, C的RSSI值,分别为RA′, RB′, RC′,当存在某一邻居节点使得下面(1)式或(2)式成立时,则点M在△ABC外面,相反点M在△ABC内部。
$ \left\{ \begin{array}{l} {R_A} > {{R'}_A}\\ {R_B} > {{R'}_B}\\ {R_C} > {{R'}_C} \end{array} \right. $
(1) $ \left\{ \begin{array}{l} {R_A} < {{R'}_A}\\ {R_B} < {{R'}_B}\\ {R_C} < {{R'}_C} \end{array} \right. $
(2) -
在节点分布稀疏或不均匀时PIT测试法很容易产生误判。如图 3a所示,当未知节点M与邻居节点3交换信息时,判断M在三角形外面,产生内判外(in-to-out)的误判;如图 3b所示,当未知节点M与邻居节点3或4交换信息时,判断M在三角形里面,产生外判内(out-to-in)的误判。而in-to-out和out-to-in是造成APIT定位误差的主要因素,因此,对APIT定位算法进行改进的关键是解决PIT测试法的误判问题。
-
(1) 信标节点以广播的方式发送自身信息(坐标、信号强度等),然后未知节点收集所有能与之通信的节点的信息;(2)未知节点与邻节点之间交换信息,筛选出包含未知节点的信标三角形;(3)求出筛选出的信标三角形重叠区域,计算出其质心位置作为未知节点的位置;(4)完成定位。
-
针对in-to-out和out-to-in误判问题,本文中提出一种利用向量积方向是否相同来判断未知节点是否在信标三角形内部的改进APIT定位算法。
定义1:如图 4所示,A, B, C为信标三角形的3个顶点,M为未知节点,当同时满足以下3个条件时,未知节点M在信标三角形ABC内部,否则未知节点M在信标三角形ABC外面:(1)点M和点A在BC的同一侧;(2)点M和点B在AC的同一侧;(3)点M和点C在AB的同一侧。
定义2:如图 5所示,⊙表示叉乘结果的方向由内向外,$ \otimes $表示叉乘结果的方向由外向内,A, B, C为平面内3个点,以判断点M和点C在AB的同一侧为例,分别构造$\overrightarrow {AC} , \overrightarrow {AM} , \overrightarrow {AB} $3个向量,然后根据右手定则,如果$\overrightarrow {AB} \times \overrightarrow {AM} $和$\overrightarrow {AB} \times \overrightarrow {AC} $叉乘结果方向一致(符号相同),则点M和点C在AB的同一侧,否则点M和点C在AB的两侧。
如图 6所示,A, B, C为信标三角形3个顶点,M为未知节点,假设A, B, C, M坐标分别为(xA, yA), (xB, yB), (xC, yC),(xM, yM),判断M是否在△ABC内,主要分以下3个步骤。
-
$ \overrightarrow {AB} = \left( {{x_B} - {x_A}, {y_B} - {y_A}} \right) $
(3) $ \overrightarrow {AM} = \left( {{x_M} - {x_A}, {y_M} - {y_A}} \right) $
(4) $ \overrightarrow {AC} = \left( {{x_C} - {x_A}, {y_C} - {y_A}} \right) $
(5) $ \begin{array}{*{20}{c}} {\overrightarrow {AB} \times \overrightarrow {AM} = \left( {{x_B} - {x_A}} \right)\left( {{y_M} - {y_A}} \right) - }\\ {\left( {{y_B} - {y_A}} \right)\left( {{x_M} - {x_A}} \right)} \end{array} $
(6) $ \begin{array}{*{20}{c}} {\overrightarrow {AB} \times \overrightarrow {AC} = \left( {{x_B} - {x_A}} \right)\left( {{y_C} - {y_A}} \right) - }\\ {\left( {{y_B} - {y_A}} \right)\left( {{x_C} - {x_A}} \right)} \end{array} $
(7) 根据定义2,如果$\overrightarrow {AB} \times \overrightarrow {AM} $和$\overrightarrow {AB} \times \overrightarrow {AC} $的符号相同,即$\overrightarrow {AB} \times \overrightarrow {AM} $和$\overrightarrow {AB} \times \overrightarrow {AC} $叉乘结果方向一致,那么点M和点C则在AB同一侧,否则点M和点C在AB的两侧。
-
$ \overrightarrow {CA} = \left( {{x_A} - {x_C}, {y_A} - {y_C}} \right) $
(8) $ \overrightarrow {CM} = \left( {{x_M} - {x_C}, {y_M} - {y_C}} \right) $
(9) $ \overrightarrow {CB} = \left( {{x_B} - {x_C}, {y_B} - {y_C}} \right) $
(10) $ \begin{array}{*{20}{c}} {\overrightarrow {CA} \times \overrightarrow {CM} = \left( {{x_A} - {x_C}} \right)\left( {{y_M} - {y_C}} \right) - }\\ {\left( {{y_A} - {y_C}} \right)\left( {{x_M} - {x_C}} \right)} \end{array} $
(11) $ \begin{array}{*{20}{c}} {\overrightarrow {CA} \times \overrightarrow {CB} = \left( {{x_A} - {x_C}} \right)\left( {{y_B} - {y_C}} \right) - }\\ {\left( {{y_A} - {y_C}} \right)\left( {{x_B} - {x_C}} \right)} \end{array} $
(12) 根据定义2,如果$\overrightarrow {CA} \times \overrightarrow {CM} $和$\overrightarrow {CA} \times \overrightarrow {CB} $的符号相同,即$\overrightarrow {CA} \times \overrightarrow {CM} $和$\overrightarrow {CA} \times \overrightarrow {CB} $叉乘结果方向一致,那么点M和点B则在AC同一侧,否则点M和点B在AC的两侧。
-
$ \overrightarrow {BC} = \left( {{x_C} - {x_B}, {y_C} - {y_B}} \right) $
(13) $ \overrightarrow {BM} = \left( {{x_M} - {x_B}, {y_M} - {y_B}} \right) $
(14) $ \overrightarrow {BA} = \left( {{x_A} - {x_B}, {y_A} - {y_B}} \right) $
(15) $ \begin{array}{*{20}{c}} {\overrightarrow {BC} \times \overrightarrow {BM} = \left( {{x_C} - {x_B}} \right)\left( {{y_M} - {y_B}} \right) - }\\ {\left( {{y_C} - {y_B}} \right)\left( {{x_M} - {x_B}} \right)} \end{array} $
(16) $ \begin{array}{*{20}{c}} {\overrightarrow {BC} \times \overrightarrow {BA} = \left( {{x_C} - {x_B}} \right)\left( {{y_A} - {y_B}} \right) - }\\ {\left( {{y_C} - {y_B}} \right)\left( {{x_A} - {x_B}} \right)} \end{array} $
(17) 根据定义2,如果$\overrightarrow {BC} \times \overrightarrow {BM} $和$\overrightarrow {BC} \times \overrightarrow {BA} $的符号相同,即$\overrightarrow {BC} \times \overrightarrow {BM} $和$\overrightarrow {BC} \times \overrightarrow {BA} $叉乘结果方向一致,那么点M和点A则在BC同一侧,否则点M和点A在BC的两侧。
根据定义1,如果点M和点A在BC的同一侧;点M和点B在AC的同一侧;点M和点C在AB的同一侧。那么未知节点M则在信标三角形内部,否则未知节点M在信标三角形外面。
如图 6a所示,满足定义1和定义2,故未知节点M在信标三角形内部;如图 6b所示,不满足定义1和定义2,故未知节点M在信标△ABC外面。
本文中提出的改进APIT算法最大优势是避免了未知节点与邻居节点信息交换时产生的in-to-out和out-to-in误判,并且不存在边界点误判的问题。
-
改进的APIT定位算法从RSSI测距和向量积同向法两方面来提高节点的定位精度,详细步骤如下:(1)信标节点以广播的方式发送自身信息(坐标、信号强度等),未知节点M收集能与之通信的信标节点的信息,假设与未知节点M通信的信标节点个数为n,若n≥3,执行下一步,否则结束定位; (2)未知节点M收集信标节点的坐标信息和RSSI值,利用极大似然估计法求出未知节点的初步定位位置; (3)从n个信标节点中任选3个组成信标三角形Ai(i=1, 2, 3, …, Cn3),根据初步定位位置、定义1和定义2筛选出包含未知节点M的信标三角形; (4)求出筛选后信标三角形重叠区域,其重叠区域质心即为未知节点M的定位位置; (5)完成未知节点M的定位。
基于向量积同向技术的改进APIT定位算法
An improved APIT localization algorithm based on the same side technique of vector product
-
摘要: 近似三角形内点测试(APIT)定位算法在用最佳三角形内点测试法测试时容易产生in-to-out和out-to-in错误,影响定位精度。为了解决这一问题,提出了一种基于向量积同向技术的改进APIT定位算法。采用接收信号强度指示定位算法实现节点的初步定位,然后用向量积同向技术代替内点测试法,提高了定位效率;在MATLAB仿真平台上进行仿真,取得了APIT定位算法和改进APIT定位算法各自产生的定位误差数据。结果表明,在信标节点比例不同的情况下,改进的APIT算法定位精度明显优于APIT算法。Abstract: The approximate point-in-triangulation (APIT) localization algorithm was prone to in-to-out and out-to-in errors during the measurement using the optimal point-in-triangulation method, and it would has bad effect on positioning accuracy. In order to solve the problem, an improved APIT localization algorithm based on same side technique of vector product was proposed. A received signal strength indicator localization algorithm was used to realize the initial positioning of the node. And the same side technique of vector product was used to replace the inner point test method. Both of them improved the positioning efficiency. After the simulation on MATLAB, the positioning error data of APIT localization algorithm and the improved APIT localization algorithm were gotten. The results demonstrate that, on positioning accuracy, the improved APIT localization algorithm performs better than APIT algorithm.
-
-
[1] WU M, CHENG L L.Wireless sensor network node and realization method[J]. Instrument Technique and Sensor, 2008, 37(12):14-16(in Chinese). [2] LONG L, LI Z F. 3-D position measurement algorithm based on laser displacement sensors[J].Laser Technology, 2017, 41(4):531-536(in Chinese). [3] WU Ch, YUAN Y B, ZHANG M Y. Plane target positioning based on reflection intensity and K-means clustering method[J].Laser Technology, 2015, 39(3):341-343(in Chinese). [4] JIN R Ch, CHE Zh P, XU H, et al.RSSI-based localization algorithm for outliers suppression in wireless sensor networks.[J].Wireless Networks, 2015, 21(8):2561-2569. doi: 10.1007/s11276-015-0936-x [5] HE T, HUANG Ch D, BLUM B M, et al. Range-free localization schemes in large scale sensor networks[C]//Proceedings of the 9th Annual International Conference on Mobile Computing and Networking, MOBICOM'2003.New York, USA: ACM Press, 2003: 81-95. [6] YAO Y, HAN Q, XU X, et al. A RSSI-based distributed weighted search localization algorithm for WSNs[J].International Journal of Distributed Sensor Networks, 2015, 11(4):1-11. [7] XIONG H, CHEN Z, AN W, et al. Robust TDOA localization algorithm for asynchronous wireless sensor networks[J].International Journal of Distributed Sensor Networks, 2015, 11(5):1-10. [8] YANG T Ch, JIN L, CHENG J.An improvement CHAN algorithm based on TOA position[J].Acta Electronica Sinica, 2009, 37(4):819-822(in Chinese). [9] MAO Y Y, LI M Y, ZHANG B J. AOA location algorithm based on RBF neural network[J].Journal of Computer Applications, 2008, 28(1):1-3(in Chinese). [10] ZENG Zh L, GAO J M, WANG J H.Corrected range weighted centroid localization algorithm based on RSSI for WSN[M].Melbourne, Australia:Information Systems and Computer Engineering, 2010:453-460. [11] TOMIC S, MEZEI I. Improvements of DV-Hop localization algorithm for wireless sensor networks[J].Telecommunication Systems, 2015, 61(1):93-106. [12] LIU Y, CHEN J, XU Z.Improved DV-Hop localization algorithm based on bat algorithm in wireless sensor networks[J].KSⅡ Transactions on Internet and Information Systems, 2016, 11(1):215-236. [13] KUMAR S, LOBIYAL D K.Novel DV-Hop localization algorithm for wireless sensor networks[J].Telecommunication Systems, 2016, 64(3):509-524. [14] LI X, YAN L, PAN W, et al. Optimization of DV-Hop localization algorithm in hybrid optical wireless sensor networks[J].Journal of Heuristics, 2014, 21(2):177-195. [15] AN W X, ZHAO J M, LI D A.Research of localization algorithm for wireless sensor networks based on Amorphous[J].Transducer and Microsystem Technologies, 2013, 32(2):33-35(in Chinese). [16] DOHERTY L, PISTER K S J, GHAOUI L E.Convex position estimation in wireless sensor networks[J].Infocom Twentieth Joint Conference of the IEEE Computer & Communications Societies, 2001, 3(3):1655-1663.