[go: up one dir, main page]

CN105182288A - Indoor-positioning-system-based RSSI Kalman filtering method - Google Patents

Indoor-positioning-system-based RSSI Kalman filtering method Download PDF

Info

Publication number
CN105182288A
CN105182288A CN201510587515.0A CN201510587515A CN105182288A CN 105182288 A CN105182288 A CN 105182288A CN 201510587515 A CN201510587515 A CN 201510587515A CN 105182288 A CN105182288 A CN 105182288A
Authority
CN
China
Prior art keywords
rssi
channel
matrix
time
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510587515.0A
Other languages
Chinese (zh)
Other versions
CN105182288B (en
Inventor
孙兵
张施雨
聂琦
张新良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beihang University
Original Assignee
Beihang University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beihang University filed Critical Beihang University
Priority to CN201510587515.0A priority Critical patent/CN105182288B/en
Publication of CN105182288A publication Critical patent/CN105182288A/en
Application granted granted Critical
Publication of CN105182288B publication Critical patent/CN105182288B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S5/00Position-fixing by co-ordinating two or more direction or position line determinations; Position-fixing by co-ordinating two or more distance determinations
    • G01S5/02Position-fixing by co-ordinating two or more direction or position line determinations; Position-fixing by co-ordinating two or more distance determinations using radio waves
    • G01S5/0294Trajectory determination or predictive filtering, e.g. target tracking or Kalman filtering
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S5/00Position-fixing by co-ordinating two or more direction or position line determinations; Position-fixing by co-ordinating two or more distance determinations
    • G01S5/02Position-fixing by co-ordinating two or more direction or position line determinations; Position-fixing by co-ordinating two or more distance determinations using radio waves
    • G01S5/10Position of receiver fixed by co-ordinating a plurality of position lines defined by path-difference measurements, e.g. omega or decca systems

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

Disclosed in the invention is an indoor-positioning-system-based received signal strength indication (RSSI) Kalman filtering method. The method comprises the following steps: step one, constructing a bluetooth Beacon environment of an indoor scene and establishing a signal strength map (SSMap); step two, selecting an actual measurement point, obtaining RSSI data from N bluetooth Beacons and storing the data into N channels; and step three, configuring a Kalman filter to carry out filtering processing on the received signal RSSI of the N channels. With the method, a defect that RSSI fluctuation dynamic ranges of all bluetooth Beacons received by a client are large due to the indoor electromagnetic environment influence can be overcome; and with control of the dynamic ranges of RSSI of all channels, the indoor positioning precision is effectively improved.

Description

一种基于室内定位系统的RSSI卡尔曼滤波方法A RSSI Kalman Filter Method Based on Indoor Positioning System

技术领域technical field

本发明涉及室内精确定位领域,提出一种基于室内定位系统的RSSI(ReceivedSignalStrengthIndication接收的信号强度指示)卡尔曼滤波方法。The invention relates to the field of indoor precise positioning, and proposes an RSSI (Received Signal Strength Indication received signal strength indication) Kalman filtering method based on an indoor positioning system.

背景技术Background technique

室内定位是指在室内环境中实现位置定位,主要采用无线通讯、基站定位、惯导定位等多种技术集成形成一套室内位置定位体系,从而实现人员、物体等在室内空间中的位置监控。常见的室内无线定位的技术有:Wi-Fi、蓝牙、红外线、超宽带、RFID(RadioFrequencyIdentification射频识别)、ZigBee(紫蜂)和超声波。然而Wi-Fi信号容易受到其他信号干扰,红外信号传输距离短容易被墙壁等障碍物干扰的特点限制了它们在传统移动终端上的应用;而超带宽、RFID、ZigBee和超声波信号在现有的移动终端中暂时难以搭载。因而综合性价比和可行性分析,北京乐高乐华有限公司开发了基于蓝牙信号的室内定位导航STARnet基础网络系统。就如同GPS导航需要向近地轨道发射几十颗信号传输卫星一样,STARnet系统也是通过铺设全面覆盖的蓝牙Beacon来实现精确定位和导航服务。用户在客户端安装了室内定位的软件后,将接收到来自于附近蓝牙Beacon发出的信号,通过对该信号的RSSI进行分析进而解算出用户在室内的精确位置。然而客户端接收到的每个Beacon的RSSI受到复杂室内电磁环境的影响,存在很大的波动,进而影响到客户端对室内精确位置的估算,使得整个定位系统稳定性下降。Indoor positioning refers to the realization of position positioning in the indoor environment. It mainly adopts wireless communication, base station positioning, inertial navigation positioning and other technologies to form an indoor position positioning system, so as to realize the position monitoring of people and objects in the indoor space. Common indoor wireless positioning technologies include: Wi-Fi, Bluetooth, infrared, ultra-wideband, RFID (Radio Frequency Identification), ZigBee (Zigbee) and ultrasound. However, Wi-Fi signals are easily interfered by other signals, and the short transmission distance of infrared signals is easily interfered by obstacles such as walls, which limits their application in traditional mobile terminals; while ultra-bandwidth, RFID, ZigBee and ultrasonic signals are in existing It is temporarily difficult to install in mobile terminals. Therefore, based on cost performance and feasibility analysis, Beijing Lego Leroy Co., Ltd. developed the STARnet basic network system for indoor positioning and navigation based on Bluetooth signals. Just as GPS navigation needs to launch dozens of signal transmission satellites into low-earth orbit, the STARnet system also implements precise positioning and navigation services by laying comprehensive coverage of Bluetooth Beacons. After the user installs the indoor positioning software on the client terminal, he will receive the signal from the nearby Bluetooth Beacon, and analyze the RSSI of the signal to calculate the precise indoor location of the user. However, the RSSI of each Beacon received by the client is affected by the complex indoor electromagnetic environment, and there are large fluctuations, which in turn affects the client's estimation of the precise indoor position, making the entire positioning system less stable.

发明内容Contents of the invention

本发明的目的是为了解决室内定位客户端接收到的蓝牙信号受室内电磁环境干扰波动动态范围过大的问题,通过将客户端接收到的来自各个Beacon的RSSI进行卡尔曼滤波处理,达到减小其动态范围的目的,进而提高室内定位的稳定性。本发明首先需要搭载了一个室内定位的实验场景,并将此场景均匀划分成坐标网格;然后按照星型网与链型网混合的方式在该场景内布置N个蓝牙Beacon;首先通过设备客户端在试验场景中各个坐标位置分别接收来自N个蓝牙Beacon的信号并制作成SSMap(SignalStrengthMap信号强度地图)数据库,根据SSMap数据库信息获得系统状态方差和距离与信号强度解算关系式;然后进入实测阶段,在室内任意位置通过设备客户端接收来自N个Beacon的信号,将这些信号RSSI分N个通道储存后设计卡尔曼滤波器进行滤波处理;最后将卡尔曼滤波后的RSSI通过距离与信号强度关系式解算出当前设备客户端距离各个Beacon位置,通过三点定位法实现定位。The purpose of the present invention is to solve the problem that the bluetooth signal received by the indoor positioning client is too large due to the interference of the indoor electromagnetic environment. The purpose of its dynamic range, thereby improving the stability of indoor positioning. The present invention first needs to be equipped with an experimental scene of indoor positioning, and divide the scene evenly into a coordinate grid; Each coordinate position of the terminal in the test scene receives signals from N Bluetooth Beacons and makes it into a SSMap (SignalStrengthMap signal strength map) database, and obtains the system state variance and the relationship between distance and signal strength according to the SSMap database information; then enter the actual measurement In the stage, the signals from N Beacons are received through the device client at any position in the room, the RSSI of these signals is divided into N channels and stored, and then the Kalman filter is designed for filtering; finally, the Kalman filtered RSSI is passed through the distance and signal strength The relationship formula is used to calculate the distance between the current device client and each Beacon, and the positioning is realized by the three-point positioning method.

本发明的一种基于室内定位系统的RSSI卡尔曼滤波方法,包括以下几个步骤:A kind of RSSI Kalman filtering method based on indoor positioning system of the present invention comprises the following steps:

步骤一、搭建室内场景的蓝牙Beacon环境并构建SSMap;Step 1. Build the Bluetooth Beacon environment of the indoor scene and construct the SSMap;

步骤二、选取实测点,获得来自N个蓝牙Beacon的RSSI数据,分N个通道储存;Step 2. Select the actual measurement point, obtain the RSSI data from N Bluetooth Beacons, and store them in N channels;

步骤三、设计卡尔曼滤波器对接收到信号N个通道的RSSI进行滤波处理。Step 3: Design a Kalman filter to filter the RSSI of the N channels of the received signal.

本发明的优点在于:The advantages of the present invention are:

本发明克服了室内电磁环境影响所带来的客户端接收到各个蓝牙Beacon的RSSI波动动态范围大的缺点,通过控制各通道RSSI的动态范围,有效地提高了室内定位的精度。The present invention overcomes the shortcoming of the large dynamic range of RSSI fluctuations received by the client from each Bluetooth Beacon caused by the influence of the indoor electromagnetic environment, and effectively improves the accuracy of indoor positioning by controlling the dynamic range of the RSSI of each channel.

附图说明Description of drawings

图1是本发明的系统流程图;Fig. 1 is a system flow chart of the present invention;

图2是本发明所搭建的室内场景图;Fig. 2 is the indoor scene diagram that the present invention builds;

图3是本发明中minor30Beacon在整个室内环境中的SSMap分布;Fig. 3 is the SSMap distribution of minor30Beacon in the whole indoor environment in the present invention;

图4是本发明中网格坐标(16,9)位置处第1通道蓝牙BeaconRSSI经过卡尔曼滤波处理前后的效果图;Fig. 4 is the rendering of the first channel Bluetooth BeaconRSSI at the grid coordinate (16,9) position before and after Kalman filter processing in the present invention;

图5是本发明中网格坐标(16,9)位置处第2通道蓝牙BeaconRSSI经过卡尔曼滤波处理前后的效果图;Fig. 5 is the rendering of the second channel Bluetooth BeaconRSSI before and after Kalman filter processing at the position of grid coordinates (16,9) in the present invention;

图6是本发明中网格坐标(16,9)位置处第3通道蓝牙BeaconRSSI经过卡尔曼滤波处理前后的效果图;Fig. 6 is the rendering of the third channel Bluetooth BeaconRSSI before and after Kalman filter processing at the grid coordinate (16,9) position in the present invention;

图7是本发明中网格坐标(16,9)位置处第4通道蓝牙BeaconRSSI经过卡尔曼滤波处理前后的效果图;Fig. 7 is the effect diagram before and after the Kalman filter processing of the 4th channel Bluetooth BeaconRSSI at the grid coordinate (16,9) position in the present invention;

图8是本发明中网格坐标(16,9)位置处第5通道蓝牙BeaconRSSI经过卡尔曼滤波处理前后的效果图;Fig. 8 is the rendering of the fifth channel Bluetooth BeaconRSSI before and after Kalman filter processing at the grid coordinate (16,9) position in the present invention;

图9是本发明中网格坐标(16,9)位置处第6通道蓝牙BeaconRSSI经过卡尔曼滤波处理前后的效果图;Fig. 9 is an effect diagram before and after the Kalman filter processing of the sixth channel Bluetooth BeaconRSSI at the grid coordinate (16,9) position in the present invention;

图10是本发明中网格坐标(16,9)位置处第7通道蓝牙BeaconRSSI经过卡尔曼滤波处理前后的效果图;Fig. 10 is the effect diagram before and after the Kalman filter processing of the 7th channel Bluetooth BeaconRSSI at the grid coordinate (16,9) position in the present invention;

图11是本发明中网格坐标(16,9)位置处第8通道蓝牙BeaconRSSI经过卡尔曼滤波处理前后的效果图。FIG. 11 is an effect diagram of the eighth channel Bluetooth BeaconRSSI at the grid coordinate (16,9) before and after Kalman filter processing in the present invention.

具体实施方式Detailed ways

下面将结合附图和实施例对本发明作进一步的详细说明。The present invention will be further described in detail with reference to the accompanying drawings and embodiments.

本发明是一种基于室内定位系统的RSSI卡尔曼滤波方法,其流程图如图1所示,包括以下几个步骤:The present invention is a kind of RSSI Kalman filtering method based on indoor positioning system, and its flow chart is as shown in Figure 1, comprises the following steps:

步骤一、搭建室内场景的蓝牙Beacon环境并构建SSMap。Step 1: Set up the Bluetooth Beacon environment of the indoor scene and construct the SSMap.

具体为:Specifically:

第一步,搭建室内场景。The first step is to build the indoor scene.

假定该场景有M个楼层,并且每一个楼层按照W×L×H的空间分布均匀布局,其中:W是楼层的宽度,L是楼层长度,H是楼层净高;然后将每一层的水平面按照长宽均匀间距划分成A×B个坐标网格;在每一层场景的屋顶上按照星型网与链型网混合的方式等间隔地部署共计N个具有相同的信号发射功率的蓝牙Beacon,且每个蓝牙Beacon的广播信号中包含了记载其层数信息的majorID与记载其位置信息的minorID。Assume that the scene has M floors, and each floor is evenly distributed according to the spatial distribution of W×L×H, where: W is the width of the floor, L is the length of the floor, and H is the clear height of the floor; then the horizontal plane of each floor Divide into A×B coordinate grids according to the uniform spacing of length and width; deploy a total of N Bluetooth Beacons with the same signal transmission power at equal intervals on the roof of each floor scene in a mixed manner of star network and chain network , and the broadcast signal of each Bluetooth Beacon includes the majorID recording its layer number information and the minorID recording its location information.

第二步,构建SSMap。The second step is to build SSMap.

搭载一个高度为h1设备接收平台,将平台依次置于每一层A×B坐标网格的中心,然后分N个通道分别对N个蓝牙Beacon进行RSSI的数据获取并记录;同时,要求在同一个坐标网格的RSSI数据获取至少需要t1的采样时间积累以获得该坐标位置处单个通道的100个的数据积累;这样以来,通过A×B×N×M×100的RSSI数据库可以有效建立SSMap。Equipped with a device receiving platform with a height of h 1 , place the platform in the center of each layer of A×B coordinate grid in turn, and then divide N channels to acquire and record RSSI data for N Bluetooth Beacons respectively; at the same time, it is required to The RSSI data acquisition of the same coordinate grid requires at least t 1 sampling time accumulation to obtain 100 data accumulations of a single channel at the coordinate position; in this way, the RSSI database of A×B×N×M×100 can be effectively Create an SSMap.

第三步,计算系统状态方差与观测方差。The third step is to calculate the system state variance and observation variance.

首先调用i通道下的SSMap的所有RSSI数据存成Pow矩阵,用Matlab中var函数求得该通道下所有RSSI数据的方差,用Q(i)记录,然后用观测设备误差分度值的平方为参考值建立系统的观测方差,用R(i)记录,最后将i从1到N进行遍历。First call all the RSSI data of the SSMap under the i channel and save it as a Pow matrix, use the var function in Matlab to obtain the variance of all the RSSI data under the channel, use Q(i) to record, and then use the square of the error scale value of the observation equipment as The reference value establishes the observation variance of the system, records it with R(i), and finally traverses i from 1 to N.

步骤二、选取实测点,获得来自N个蓝牙Beacon的RSSI数据,分N个通道储存。Step 2: Select actual measurement points, obtain RSSI data from N Bluetooth Beacons, and store them in N channels.

具体为:Specifically:

在室内场景A×B坐标网格中选取任一坐标位置的实测点,通过客户端接收来自N个蓝牙Beacon分别的RSSI数据。要求在该实测点的RSSI数据获取至少需要t2的采样时间积累以获得该实测点位置处单个通道下的g个RSSI数据积累;然后计算该实测点各通道下的RSSI数据的波动最大值、波动最小值以及波动动态范围,连同RSSI数据本身以xml文件格式传递给后续的卡尔曼滤波器的处理。Select the measured point at any coordinate position in the indoor scene A×B coordinate grid, and receive the RSSI data from N Bluetooth Beacons respectively through the client. It is required that the acquisition of RSSI data at the actual measurement point requires at least t2 sampling time accumulation to obtain g RSSI data accumulations under a single channel at the actual measurement point; then calculate the maximum fluctuation of the RSSI data under each channel of the actual measurement point, The fluctuation minimum value and the fluctuation dynamic range, together with the RSSI data itself, are passed to the subsequent Kalman filter processing in the xml file format.

步骤三、设计卡尔曼滤波器对接收到信号N个通道的RSSI进行滤波处理。Step 3: Design a Kalman filter to filter the RSSI of the N channels of the received signal.

具体为:Specifically:

第一步,卡尔曼滤波器模型建立。卡尔曼滤波器的设计分为系统状态方程的预测和校正。首先列出系统的状态方程,先从系统状态方程一般式入手:In the first step, the Kalman filter model is established. The design of the Kalman filter is divided into prediction and correction of the system state equation. First list the state equation of the system, starting with the general formula of the system state equation:

X(i,k+1)=AX(i,k)+W(i,k)(1)X(i,k+1)=AX(i,k)+W(i,k)(1)

S(i,k)=CX(i,k)+V(i,k)(2)S(i,k)=CX(i,k)+V(i,k)(2)

式中,X(i,k)和X(i,k+1)为系统状态向量,分别代表着实测点分别在k时刻与k+1时刻接收信号第i个通道中待优化的RSSI估计值;S(i,k)为系统观测向量,代表着实测点在k时刻接收信号第i个通道中RSSI的观测值;而A为系统矩阵,C为系统输出矩阵;W(i,k)和V(i,k)分别为在k时刻第i个通道的系统状态噪声与观测噪声,且近似认为W(i,k)和V(i,k)是相互独立的零均值白噪声序列,满足:In the formula, X(i,k) and X(i,k+1) are system state vectors, which respectively represent the estimated RSSI values to be optimized in the i-th channel of the received signal at time k and k+1 at the measured point ; S(i,k) is the system observation vector, which represents the observed value of RSSI in the i-th channel of the received signal at the measured point at time k; and A is the system matrix, C is the system output matrix; W(i,k) and V(i,k) are the system state noise and observation noise of the i-th channel at time k, respectively, and it is approximately considered that W(i,k) and V(i,k) are mutually independent zero-mean white noise sequences, satisfying :

E[W(i,k)]=E[V(i,k)]=0(3)E[W(i,k)]=E[V(i,k)]=0(3)

E[W(i,k)W(i,k)T]=Q(i)(4)E[W(i,k)W(i,k) T ]=Q(i)(4)

E[V(i,k)V(i,k)T]=R(i)(5)E[V(i,k)V(i,k) T ]=R(i)(5)

由此状态方程,可以列出卡尔曼滤波器方程的预测过程:From this state equation, the prediction process of the Kalman filter equation can be listed:

P(i,k|k-1)=AP(i,k-1|k-1)AT+Q(i)(6)P(i,k|k-1)=AP(i,k-1|k-1) AT +Q(i)(6)

Xx (( ii ,, kk || kk -- 11 )) == AA Xx ^^ (( ii ,, kk -- 11 || kk -- 11 )) ++ BB Uu (( ii ,, kk )) -- -- -- (( 77 ))

式中,X(i,k|k-1)是第i个通道中在k时刻利用k-1时刻状态预测的结果,是第i个通道中在k时刻利用k-1时刻状态最优的结果,U(i,k)是在k时刻第i个通道中的状态控制量,而P(i,k|k-1)是对应的协方差矩阵,P(i,k-1|k-1)是对应的协方差矩阵。In the formula, X(i,k|k-1) is the result of state prediction at time k in the i-th channel using time k-1, is the optimal result of using the state at time k-1 in the i-th channel at time k, U(i,k) is the state control quantity in the i-th channel at time k, and P(i,k|k-1 )yes The corresponding covariance matrix, P(i,k-1|k-1) is The corresponding covariance matrix.

进一步,可以列出卡尔曼滤波器方程的校正过程:Further, the correction process of the Kalman filter equation can be listed:

K(i,k)=P(i,k|k-1)CT[CP(i,k|k-1)CT+R(i)]-1(8)K(i,k)=P(i,k|k-1)C T [CP(i,k|k-1)C T +R(i)] -1 (8)

Xx ^^ (( ii ,, kk || kk )) == Xx (( ii ,, kk -- 11 || kk -- 11 )) ++ KK kk (( SS (( ii ,, kk )) -- CC Xx (( ii ,, kk || kk -- 11 )) )) -- -- -- (( 99 ))

P(i,k|k)=[I(i)-K(i,k)C]P(i,k|k-1)(10)P(i,k|k)=[I(i)-K(i,k)C]P(i,k|k-1)(10)

式中,K(i,k)为第i个通道中的卡尔曼增益,它的作用是使得后验估计误差协方差最小。In the formula, K(i,k) is the Kalman gain in the i-th channel, and its function is to minimize the covariance of the posterior estimation error.

具体到室内定位对蓝牙BeaconRSSI进行滤波处理的问题上,由于系统设计对同一个实测点接收信号处理有t2采样时间g个RSSI数据的积累,因而在同一个实测点位置处系统状态参数不发生变化,这就意味着系统矩阵A和系统输出矩阵C均为单位阵,因而系统预测过程可以改写为:Specific to the issue of filtering and processing Bluetooth Beacon RSSI for indoor positioning, since the system design has t 2 sampling time g RSSI data accumulation for the receiving signal processing of the same actual measurement point, the system state parameters do not occur at the same actual measurement point. changes, which means that the system matrix A and the system output matrix C are both unit matrices, so the system prediction process can be rewritten as:

P(i,k|k-1)=P(i,k-1|k-1)+Q(i)(11)P(i,k|k-1)=P(i,k-1|k-1)+Q(i)(11)

Xx (( ii ,, kk || kk -- 11 )) == Xx ^^ (( ii ,, kk -- 11 || kk -- 11 )) -- -- -- (( 1212 ))

系统校正过程可以改写为:The system calibration process can be rewritten as:

K(i,k)=P(i,k|k-1)[P(i,k|k-1)+R(i)]-1(13)K(i,k)=P(i,k|k-1)[P(i,k|k-1)+R(i)] -1 (13)

Xx ^^ (( ii ,, kk || kk )) == Xx (( ii ,, kk -- 11 || kk -- 11 )) ++ KK kk (( SS (( ii ,, kk )) -- Xx (( ii ,, kk || kk -- 11 )) )) -- -- -- (( 1414 ))

P(i,k|k)=[I(i)-K(i,k)]P(i,k|k-1)(15)P(i,k|k)=[I(i)-K(i,k)]P(i,k|k-1)(15)

第二步,卡尔曼滤波器的程序实现。本发明用Karman_Filter.m程序实现了对搭建的室内环境中任何给定位置设备接收到的RSSI信号卡尔曼滤波的处理。首先利用Matlab中的xmlread函数将设备接收到的N个通道各g组RSSI数据转化为[N×g]的矩阵数据z形式读取;之后对矩阵数据进行初始化,需要说明的是这里程序各初值的意义:The second step is the program realization of the Kalman filter. The present invention uses the Karman_Filter.m program to realize the Kalman filter processing of the RSSI signal received by any given location device in the built indoor environment. First, use the xmlread function in Matlab to convert the RSSI data received by the device into the matrix data z of [N×g] for each g group of N channels received by the device; then initialize the matrix data. The meaning of the value:

字母k代表系统状态变化的时间节点,字母i代表观测的通道编码,每一个通道编码传递的数值指示了来自该通道接收到的蓝牙Beacon的RSSI。The letter k represents the time node of the system state change, the letter i represents the observed channel code, and the value passed by each channel code indicates the RSSI from the Bluetooth Beacon received by the channel.

xhat是[N×g]矩阵,表示对RSSI的后验估计值,即在k时刻,结合当前RSSI的测量值与k-1时刻RSSI先验估计,得到的估计值更新,对应于状态方程中的X,初始化时候将该矩阵第一个元素置零;xhat is a [N×g] matrix, which represents the posterior estimated value of RSSI, that is, at time k, combined with the measured value of current RSSI and the prior estimate of RSSI at time k-1, the estimated value is updated, corresponding to the state equation X, the first element of the matrix is set to zero during initialization;

xhatminus是[N×g]矩阵,表示RSSI的先验估计,即在k-1时刻,对k时刻RSSI做出的估计,对应于状态方程中的X,初始化时候将该矩阵第一个元素置零;xhatminus is a [N×g] matrix, which represents the prior estimation of RSSI, that is, at time k-1, the estimation of RSSI at time k corresponds to X in the state equation, and the first element of the matrix is set to zero;

P是[N×g]矩阵,表示后验估计的方差,初始化时候将该矩阵第一个元素置零;P is a [N×g] matrix, which represents the variance of the posterior estimate, and the first element of the matrix is set to zero during initialization;

Pminus是[N×g]矩阵,表示先验估计的方差,初始化时候将该矩阵第一个元素置零;Pminus is a [N×g] matrix, which represents the variance of the prior estimate, and the first element of the matrix is set to zero during initialization;

K是[N×g]矩阵,表示卡尔曼增益量,初始化时候将该矩阵第一个元素置零;K is a [N×g] matrix, which represents the Kalman gain, and the first element of the matrix is set to zero during initialization;

接下来本发明先从第i个通道着手处理,将第i个通道中xhat(i,1)赋值为输入信号对应通道的第一个值,再将该通道中P(i,1)赋值为1;到此为止程序中矩阵数据初始化完成。然后在同一个通道i中,按照系统改写的预测方程和校正方程。Next, the present invention starts with the i-th channel, assigns xhat(i,1) in the i-th channel as the first value of the channel corresponding to the input signal, and then assigns P(i,1) in the channel to 1; So far, the matrix data initialization in the program is completed. Then in the same channel i, follow the system rewritten prediction equation and correction equation.

代码中系统预测方程:The system prediction equation in the code:

xhatminus(i,k)=xhat(i,k-1)(16)xhatminus(i,k)=xhat(i,k-1)(16)

Pminus(i,k)=P(i,k-1)+Q(i)(17)Pminus(i,k)=P(i,k-1)+Q(i)(17)

代码中系统校正方程:The system correction equation in the code:

K(i,k)=Pminus(i,k)/(Pminus(i,k)+R(i))(18)K(i,k)=Pminus(i,k)/(Pminus(i,k)+R(i))(18)

xhat(i,k)=xhatminus(i,k)+K(i,k)*(z(i,k)-xhatminus(i,k)(19)xhat(i,k)=xhatminus(i,k)+K(i,k)*(z(i,k)-xhatminus(i,k)(19)

P(i,k)=(1-K(i,k))*Pminus(i,k)(20)P(i,k)=(1-K(i,k))*Pminus(i,k)(20)

将k从2到g进行遍历,可以得出第i个通道RSSI后验估计值随着时刻点的变化,即反应了卡尔曼滤波效果;最后将i从1到N进行遍历,可以得到各个通道RSSI卡尔曼滤波效果;作图输出该实测点位置处各个通道蓝牙BeaconRSSI经过卡尔曼滤波处理后的效果图。By traversing k from 2 to g, we can get the change of the i-th channel RSSI posterior estimate with the time point, which reflects the effect of Kalman filtering; finally, by traversing i from 1 to N, we can get each channel RSSI Kalman filter effect; draw and output the effect map of each channel Bluetooth Beacon RSSI at the position of the measured point after Kalman filter processing.

第三步,比较卡尔曼滤波前后该实测点处RSSI动态范围变化。调用judgeparaments.m文件,其中preinput配置滤波前的N个通道RSSI数据(单位dB),folinput配置滤波后的N个通道RSSI数据(单位dB);程序输出卡尔曼滤波前后N个通道分别的最大值、最小值以及其波动的动态范围。The third step is to compare the change of RSSI dynamic range at the measured point before and after Kalman filtering. Call the judgeparaments.m file, where preinput configures the RSSI data of N channels before filtering (in dB), and folinput configures the RSSI data of N channels after filtering (in dB); the program outputs the maximum values of the N channels before and after Kalman filtering , the minimum value and the dynamic range of its fluctuation.

最后,将卡尔曼滤波处理后的RSSI通过距离与信号强度的关系式解算出RSSI对应的距离。显然对于每个通道的蓝牙Beacon会解算出其距离上限与距离下限(分别对应该通道下RSSI最大值与最小值),再利用测量学中的空间距离后方交会法可以推算出实测点在搭建场景中距离位置范围。Finally, the Kalman filter-processed RSSI is solved to calculate the distance corresponding to the RSSI through the relationship between distance and signal strength. Obviously, for the Bluetooth Beacon of each channel, the upper limit and the lower limit of the distance will be calculated (corresponding to the maximum and minimum values of RSSI under the channel respectively), and then the spatial distance resection method in metrology can be used to calculate the actual measurement point in the construction scene. Mid distance position range.

实施例:Example:

本发明是一种基于室内定位系统的RSSI卡尔曼滤波方法,借助北京乐高乐华技术有限公司搭载的平台,其具体实施例如下:The present invention is an RSSI Kalman filtering method based on an indoor positioning system, with the help of a platform carried by Beijing Lego Lehua Technology Co., Ltd., its specific implementation examples are as follows:

步骤一、搭建室内场景的蓝牙Beacon环境并构建SSMap。Step 1: Set up the Bluetooth Beacon environment of the indoor scene and construct the SSMap.

具体为:Specifically:

第一步,搭建室内场景。如图2所示,该场景区域采用13m×7.579m×2.78m的空间布局,首先将室内场景水平面按照0.5m×0.5m的间距划分为26×16的二维平面坐标系,在此坐标系的基础上于场景的顶部设置8个蓝牙Beacon,其具体平面分布参数如下所示。The first step is to build the indoor scene. As shown in Figure 2, the scene area adopts a spatial layout of 13m×7.579m×2.78m. First, the horizontal plane of the indoor scene is divided into a two-dimensional plane coordinate system of 26×16 according to the interval of 0.5m×0.5m. Set up 8 Bluetooth Beacons on the top of the scene based on , and the specific plane distribution parameters are as follows.

majormajor minorminor X坐标X coordinate Y坐标Y coordinate 1414 2929 12.6012.60 7.307.30 1414 3030 6.506.50 7.307.30 1414 3131 1.001.00 7.307.30 1414 3232 3.353.35 3.703.70 1414 3333 9.679.67 3.703.70 1414 3434 12.7012.70 0.300.30 1414 3535 6.506.50 0.300.30 1414 3636 0.300.30 0.300.30

需要说明的是这8个Beacon具有相同的的uuid编号(即F62D3F65-2FCB-AB76-00AB-681819202122),作为搭建平台系统的硬件号;同时major14代表着室内环境的楼层,由于本项目的测试环境都在同一水平面(即楼层数M=1)上,故而major不发生改变;而minor各不相同,用作客户端接收机区分每个Beacon的依据。此外每个Beacon在向室内空间发送蓝牙信号同时也会广播自己的uuid、major、minor以及坐标位置等特有信息。It should be noted that these 8 Beacons have the same uuid number (namely F62D3F65-2FCB-AB76-00AB-681819202122), which is used as the hardware number for building the platform system; at the same time, major14 represents the floor of the indoor environment. Due to the test environment of this project They are all on the same level (that is, the number of floors M=1), so the major does not change; while the minor is different, which is used as a basis for the client receiver to distinguish each Beacon. In addition, each Beacon will broadcast its own unique information such as uuid, major, minor, and coordinate position while sending Bluetooth signals to the indoor space.

第二步,构建SSMap。首先搭建一个高度为1.41m,占地0.5m×0.5m的测试平台,将IOS设备放置于平台中心;然后从坐标系的(0,0)位置开始,通过IOS设备每秒1次的频率指示出8个蓝牙Beacon分别到该设备终端的蓝牙信号RSSI,并积累100s的观测时间获得每个Beacon在该坐标位置处的共计100×8个数据;按照同样方法遍历网格中每一坐标(26×16)处来自8个蓝牙Beacon的RSSI数据制成xml格式文档。图3展示了由uuid为F62D3F65-2FCB-AB76-00AB-681819202122,major14,minor30,位于X坐标6.50,Y坐标7.30位置处蓝牙Beacon产生的信号构成的SSMap。The second step is to build SSMap. First build a test platform with a height of 1.41m and an area of 0.5m×0.5m, place the IOS device in the center of the platform; then start from the (0,0) position of the coordinate system, and pass the frequency indication of the IOS device once per second Send 8 Bluetooth Beacons to the Bluetooth signal RSSI of the device terminal respectively, and accumulate 100s of observation time to obtain a total of 100×8 data of each Beacon at the coordinate position; traverse each coordinate in the grid according to the same method (26 ×16) RSSI data from 8 Bluetooth Beacons are made into xml format documents. Figure 3 shows the SSMap composed of the signal generated by the Bluetooth Beacon at the position of X coordinate 6.50 and Y coordinate 7.30 with uuid F62D3F65-2FCB-AB76-00AB-681819202122, major14, minor30.

第三步,计算系统状态方差与观测方差。首先调用i通道下的SSMap的所有RSSI数据存成Pow矩阵,用Matlab中var函数求得该通道下所有RSSI数据的方差,用Q(i)记录;然后用观测设备误差分度值的平方为参考值建立系统的观测方差,用R(i)记录;最后将i从1到8进行遍历。The third step is to calculate the system state variance and observation variance. First call all the RSSI data of the SSMap under the i channel and save it into a Pow matrix, use the var function in Matlab to obtain the variance of all the RSSI data under the channel, and record it with Q(i); then use the square of the error scale value of the observation equipment as The reference value establishes the observation variance of the system, which is recorded by R(i); finally, i is traversed from 1 to 8.

步骤二、选取实测点,获得来自8个蓝牙Beacon的RSSI数据,分8个通道储存。Step 2: Select the actual measurement point, obtain the RSSI data from 8 Bluetooth Beacons, and store them in 8 channels.

具体为:Specifically:

在室内场景中选取坐标为(16,9)的实测点,获得来自8个蓝牙Beacon的RSSI数据。同样利用到IOS设备平台以每秒1次指示蓝牙BeaconRSSI的频率,进行30s的积累后得到8个通道分别的30组RSSI数据,并存成xml文件格式传递给后期处理。需要说明的是乐高乐华公司正在研制的蓝牙BeaconRSSI指示软件的设计标准是每秒10次的频率指示蓝牙BeaconRSSI,通过3秒的积累也可以得到8个通道分别30组RSSI数据。目前受设备限制本发明只能用当前IOS设备下的实测数据对设计产品数据进行仿真,然而本发明用的实测的数据仿真设计产品数据只是存在着输入时间的滞后,并不会带来数据本身的改变。Select the measured point with coordinates (16,9) in the indoor scene, and obtain the RSSI data from 8 Bluetooth Beacons. Also use the IOS device platform to indicate the frequency of the Bluetooth Beacon RSSI once per second. After 30 seconds of accumulation, 30 sets of RSSI data for 8 channels are obtained, and they are stored in an xml file format for post-processing. It should be noted that the design standard of the Bluetooth BeaconRSSI indicator software being developed by Lego Leroy is to indicate the Bluetooth BeaconRSSI at a frequency of 10 times per second. After 3 seconds of accumulation, 30 sets of RSSI data for 8 channels can be obtained. Currently limited by equipment, the present invention can only use the measured data under the current IOS device to simulate the design product data. However, the measured data used in the present invention to simulate the design product data only has a lag in the input time, and does not bring the data itself. change.

步骤三、设计卡尔曼滤波器对接收到信号8个通道的RSSI进行滤波处理。Step 3: Design a Kalman filter to filter the RSSI of the 8 channels of the received signal.

具体为:Specifically:

本发明用Karman_Filter.m程序实现了对任何给定位置的RSSI信号卡尔曼滤波处理。The present invention uses the Karman_Filter.m program to realize the Kalman filter processing of the RSSI signal at any given position.

第一步,卡尔曼滤波前数据提取。利用xmlread函数将IOS设备接收到的8个通道各30组RSSI数据转化为[8×30]的矩阵数据z读取。The first step is data extraction before Kalman filtering. Use the xmlread function to convert the 30 groups of RSSI data received by the IOS device into [8×30] matrix data z for reading.

第二步,矩阵数据的初始化。需要说明的是这里程序各初值的意义:The second step is the initialization of matrix data. What needs to be explained is the meaning of each initial value of the program here:

xhat矩阵是对RSSI的后验估计值,即在k时刻,结合当前RSSI的测量值与k-1时刻RSSI先验估计,得到的估计值更新,对应于状态方程中的X,初始化为[8×30]的零矩阵;然后将每个通道的第一个元素赋值为输入信号在该通道的第一个RSSI数据;The xhat matrix is the posterior estimate of RSSI, that is, at time k, the estimated value is updated by combining the measured value of current RSSI with the prior estimate of RSSI at time k-1, which corresponds to X in the state equation and is initialized to [8 ×30] zero matrix; then assign the first element of each channel to the first RSSI data of the input signal in the channel;

xhat(i,1)=z(i,1)(21)xhat(i,1)=z(i,1)(21)

xhatminus矩阵是RSSI的先验估计,即在k-1时刻,对k时刻RSSI做出的估计,对应于状态方程中的X,初始化为[8×30]的零矩阵;The xhatminus matrix is the prior estimate of RSSI, that is, at time k-1, the estimate of RSSI at time k, corresponding to X in the state equation, initialized to a zero matrix of [8×30];

P矩阵是后验估计的方差,初始化为[8×30]的零矩阵;然后将每个通道的第一个元素赋值为1;The P matrix is the variance of the posterior estimate, initialized to a [8×30] zero matrix; then assign the first element of each channel to 1;

P(i,1)=1(22)P(i,1)=1(22)

Pminus矩阵是先验估计的方差,初始化为[8×30]的零矩阵;The Pminus matrix is the variance of the prior estimate, initialized to a [8×30] zero matrix;

K矩阵是卡尔曼增益量,初始化为[8×30]的零矩阵;The K matrix is the Kalman gain, initialized to a [8×30] zero matrix;

第三步,改写的预测方程和校正方程。在同一个通道i中,按照系统状态方程改写迭代方程。The third step is to rewrite the prediction equation and correction equation. In the same channel i, rewrite the iterative equation according to the system state equation.

代码中系统预测方程:The system prediction equation in the code:

xhatminus(i,k)=xhat(i,k-1)(23)xhatminus(i,k)=xhat(i,k-1)(23)

Pminus(i,k)=P(i,k-1)+Q(i)(24)Pminus(i,k)=P(i,k-1)+Q(i)(24)

代码中系统校正方程:The system correction equation in the code:

K(i,k)=Pminus(i,k)/(Pminus(i,k)+R(i))(25)K(i,k)=Pminus(i,k)/(Pminus(i,k)+R(i))(25)

xhat(i,k)=xhatminus(i,k)+K(i,k)*(z(i,k)-xhatminus(i,k)(26)xhat(i,k)=xhatminus(i,k)+K(i,k)*(z(i,k)-xhatminus(i,k)(26)

P(i,k)=(1-K(i,k))*Pminus(i,k)(27)P(i,k)=(1-K(i,k))*Pminus(i,k)(27)

第四步,将k从2到30遍历。遍历后得到同一通道i中RSSI经卡尔曼滤波处理后的效果。The fourth step is to traverse k from 2 to 30. After traversal, the effect of RSSI in the same channel i after Kalman filtering is obtained.

第五步,将i从1到8遍历。遍历后得到8个通道中RSSI经卡尔曼滤波处理后的效果。The fifth step is to traverse i from 1 to 8. After traversal, the effect of RSSI in the 8 channels after Kalman filtering is obtained.

第六步,作图输出网格坐标(16,9)位置处各个通道蓝牙BeaconRSSI经过卡尔曼滤波处理后的效果图,由图4-11所示。The sixth step is to draw and output the effect diagram of each channel Bluetooth BeaconRSSI at the position of grid coordinates (16,9) after Kalman filter processing, as shown in Figure 4-11.

图4是本发明中网格坐标(16,9)位置处第1通道蓝牙BeaconRSSI经过卡尔曼滤波处理前后的效果图;Fig. 4 is the rendering of the first channel Bluetooth BeaconRSSI at the grid coordinate (16,9) position before and after Kalman filter processing in the present invention;

图5是本发明中网格坐标(16,9)位置处第2通道蓝牙BeaconRSSI经过卡尔曼滤波处理前后的效果图;Fig. 5 is the rendering of the second channel Bluetooth BeaconRSSI before and after Kalman filter processing at the position of grid coordinates (16,9) in the present invention;

图6是本发明中网格坐标(16,9)位置处第3通道蓝牙BeaconRSSI经过卡尔曼滤波处理前后的效果图;Fig. 6 is the rendering of the third channel Bluetooth BeaconRSSI before and after Kalman filter processing at the grid coordinate (16,9) position in the present invention;

图7是本发明中网格坐标(16,9)位置处第4通道蓝牙BeaconRSSI经过卡尔曼滤波处理前后的效果图;Fig. 7 is the effect diagram before and after the Kalman filter processing of the 4th channel Bluetooth BeaconRSSI at the grid coordinate (16,9) position in the present invention;

图8是本发明中网格坐标(16,9)位置处第5通道蓝牙BeaconRSSI经过卡尔曼滤波处理前后的效果图;Fig. 8 is the rendering of the fifth channel Bluetooth BeaconRSSI before and after Kalman filter processing at the grid coordinate (16,9) position in the present invention;

图9是本发明中网格坐标(16,9)位置处第6通道蓝牙BeaconRSSI经过卡尔曼滤波处理前后的效果图;Fig. 9 is an effect diagram before and after the Kalman filter processing of the sixth channel Bluetooth BeaconRSSI at the grid coordinate (16,9) position in the present invention;

图10是本发明中网格坐标(16,9)位置处第7通道蓝牙BeaconRSSI经过卡尔曼滤波处理前后的效果图;Fig. 10 is the effect diagram before and after the Kalman filter processing of the 7th channel Bluetooth BeaconRSSI at the grid coordinate (16,9) position in the present invention;

图11是本发明中网格坐标(16,9)位置处第8通道蓝牙BeaconRSSI经过卡尔曼滤波处理前后的效果图。FIG. 11 is an effect diagram of the eighth channel Bluetooth BeaconRSSI at the grid coordinate (16,9) before and after Kalman filter processing in the present invention.

第七步,比较卡尔曼滤波前后该实测点处RSSI动态范围变化。调用judgeparaments.m文件,其中preinput配置滤波前的8个通道各30个RSSI数据(单位dB),folinput配置滤波后的8个通道各10个RSSI数据(单位dB);程序输出卡尔曼滤波前后8个通道分别的最大值、最小值以及其波动的动态范围。需要说明的是本实例中认为卡尔曼滤波在经过20个时间节点后趋于稳定(即对应理想设备2s后实现RSSI读数稳定),因而我们做下表展示进过卡尔曼滤波后(即从第20个时间节点开始到最后)对系统波动动态范围的优化程度:The seventh step is to compare the change of RSSI dynamic range at the measured point before and after Kalman filtering. Call the judgeparaments.m file, where preinput configures 30 RSSI data (in dB) for each of the 8 channels before filtering, and folinput configures 10 RSSI data (in dB) for each of the 8 channels after filtering; the program outputs 8 before and after Kalman filtering The maximum and minimum values of each channel and the dynamic range of their fluctuations. It should be noted that in this example, it is considered that the Kalman filter tends to be stable after 20 time nodes (that is, the RSSI reading is stable after 2 seconds corresponding to the ideal device), so we make the following table to show that after the Kalman filter (that is, from the first 20 time nodes from the beginning to the end) the degree of optimization of the dynamic range of system fluctuations:

由上表可以看出,设备接收到的来自8个通道蓝牙BeaconRSSI在经过卡尔曼滤波处理以后动态范围明显减小,而这将极大地有利于我们通过距离与RSSI的解算关系实现室内精确定位的后续工作。It can be seen from the above table that the dynamic range of the Bluetooth Beacon RSSI received by the device from 8 channels is significantly reduced after Kalman filtering processing, which will greatly help us achieve indoor accurate positioning through the relationship between distance and RSSI follow-up work.

最后,将卡尔曼滤波处理后的RSSI通过距离与信号强度的关系式解算出RSSI对应的距离。显然对于每个通道的蓝牙Beacon我们会解算出其距离上限与距离下限(分别对应该通道下RSSI最大值与最小值),再利用测量学中的空间距离后方交会法可以推算出实测点在搭建场景中距离位置范围。Finally, the Kalman filter-processed RSSI is solved to calculate the distance corresponding to the RSSI through the relationship between distance and signal strength. Obviously, for the Bluetooth Beacon of each channel, we will calculate the upper limit and the lower limit of the distance (respectively corresponding to the maximum and minimum values of RSSI under the channel), and then use the spatial distance resection method in metrology to calculate the actual measurement point in the building. Range of distance positions in the scene.

本发明主要针对室内精确定位中遇到的设备终端接收到蓝牙BeaconRSSI波动动态范围过大的问题,设计出卡尔曼滤波器对RSSI进行处理,有效地控制了其动态范围,进而达到提高设备终端定位精度的目的。通过实例分析,各通道的RSSI在经过卡尔曼滤波器后动态范围有了明显的改善。The present invention mainly aims at the problem that the equipment terminal receives the Bluetooth Beacon RSSI fluctuation dynamic range is too large encountered in the indoor precise positioning, and designs a Kalman filter to process the RSSI, effectively controlling its dynamic range, thereby improving the positioning of the equipment terminal purpose of precision. Through example analysis, the dynamic range of the RSSI of each channel has been significantly improved after passing through the Kalman filter.

Claims (1)

1.一种基于室内定位系统的RSSI卡尔曼滤波方法,包括以下几个步骤:1. A kind of RSSI Kalman filtering method based on indoor positioning system, comprises the following steps: 步骤一、搭建室内场景的蓝牙Beacon环境并构建SSMap;Step 1. Build the Bluetooth Beacon environment of the indoor scene and construct the SSMap; 具体为:Specifically: 第一步,搭建室内场景;The first step is to build the indoor scene; 假定该场景有M个楼层,并且每一个楼层按照W×L×H的空间分布均匀布局,其中:W是楼层的宽度,L是楼层长度,H是楼层净高,然后将每一层的水平面按照长宽均匀间距划分成A×B个坐标网格,在每一层场景的屋顶上按照星型网与链型网混合的方式等间隔地部署共计N个具有相同的信号发射功率的蓝牙Beacon,且每个蓝牙Beacon的广播信号中包含了记载其层数信息的majorID与记载其位置信息的minorID;Assume that the scene has M floors, and each floor is evenly distributed according to the spatial distribution of W×L×H, where: W is the width of the floor, L is the length of the floor, H is the clear height of the floor, and then the horizontal plane of each floor Divide into A×B coordinate grids according to the uniform spacing of length and width, and deploy a total of N Bluetooth Beacons with the same signal transmission power at equal intervals on the roof of each scene in a mixed manner of star network and chain network , and the broadcast signal of each Bluetooth Beacon contains the majorID recording its layer information and the minorID recording its location information; 第二步,构建SSMap;The second step is to build SSMap; 搭载一个高度为h1设备接收平台,将平台依次置于每一层A×B坐标网格的中心,然后分N个通道分别对N个蓝牙Beacon进行RSSI的数据获取并记录;同时,要求在同一个坐标网格的RSSI数据获取至少需要t1的采样时间积累以获得该坐标位置处单个通道的100个的数据积累,最终,通过A×B×N×M×100的RSSI数据库建立SSMap;Equipped with a device receiving platform with a height of h 1 , place the platform in the center of each layer of A×B coordinate grid in turn, and then divide N channels to acquire and record RSSI data for N Bluetooth Beacons respectively; at the same time, it is required to The acquisition of RSSI data of the same coordinate grid requires at least t 1 sampling time accumulation to obtain 100 data accumulations of a single channel at the coordinate position, and finally, establish SSMap through the RSSI database of A×B×N×M×100; 第三步,计算系统状态方差与观测方差;The third step is to calculate the system state variance and observation variance; 首先调用i通道下的SSMap的所有RSSI数据存成Pow矩阵,获取该通道下所有RSSI数据的方差,用Q(i)记录,然后用观测设备误差分度值的平方为参考值建立系统的观测方差,用R(i)记录,最后将i从1到N进行遍历;First call all the RSSI data of the SSMap under the i channel and save it into a Pow matrix, obtain the variance of all the RSSI data under the channel, record it with Q(i), and then use the square of the error scale value of the observation equipment as a reference value to establish a systematic observation Variance, recorded with R(i), and finally traverse i from 1 to N; 步骤二、选取实测点,获得来自N个蓝牙Beacon的RSSI数据,分N个通道储存;Step 2. Select the actual measurement point, obtain the RSSI data from N Bluetooth Beacons, and store them in N channels; 具体为:Specifically: 在室内场景A×B坐标网格中选取任一坐标位置的实测点,通过客户端接收来自N个蓝牙Beacon分别的RSSI数据,在该实测点的RSSI数据获取至少需要t2的采样时间积累以获得该实测点位置处单个通道下的g个RSSI数据积累;然后计算该实测点各通道下的RSSI数据的波动最大值、波动最小值以及波动动态范围,连同RSSI数据以xml文件格式传递给后续的卡尔曼滤波器的处理;Select an actual measurement point at any coordinate position in the indoor scene A×B coordinate grid, and receive RSSI data from N Bluetooth Beacons respectively through the client. The acquisition of RSSI data at the actual measurement point requires at least t2 sampling time accumulation. Obtain g RSSI data accumulations under a single channel at the measured point; then calculate the fluctuation maximum, fluctuation minimum and fluctuation dynamic range of the RSSI data under each channel of the measured point, and pass the RSSI data to the follow-up in xml file format The processing of the Kalman filter; 步骤三、设计卡尔曼滤波器对接收到信号N个通道的RSSI进行滤波处理;Step 3, designing a Kalman filter to filter the RSSI of the received signal N channels; 具体为:Specifically: 第一步,卡尔曼滤波器模型建立;In the first step, the Kalman filter model is established; 系统的状态方程为:The state equation of the system is: X(i,k+1)=AX(i,k)+W(i,k)(1)X(i,k+1)=AX(i,k)+W(i,k)(1) S(i,k)=CX(i,k)+V(i,k)(2)S(i,k)=CX(i,k)+V(i,k)(2) 式中,X(i,k)和X(i,k+1)为系统状态向量,分别代表着实测点分别在k时刻与k+1时刻接收信号第i个通道中待优化的RSSI估计值;S(i,k)为系统观测向量,代表着实测点在k时刻接收信号第i个通道中RSSI的观测值;而A为系统矩阵,C为系统输出矩阵;W(i,k)和V(i,k)分别为在k时刻第i个通道的系统状态噪声与观测噪声,且设W(i,k)和V(i,k)是相互独立的零均值白噪声序列,满足:In the formula, X(i,k) and X(i,k+1) are system state vectors, which respectively represent the estimated RSSI values to be optimized in the i-th channel of the received signal at time k and k+1 at the measured point ; S(i,k) is the system observation vector, which represents the observed value of RSSI in the i-th channel of the received signal at the measured point at time k; and A is the system matrix, C is the system output matrix; W(i,k) and V(i,k) are the system state noise and observation noise of the i-th channel at time k, respectively, and W(i,k) and V(i,k) are assumed to be mutually independent zero-mean white noise sequences, satisfying: E[W(i,k)]=E[V(i,k)]=0(3)E[W(i,k)]=E[V(i,k)]=0(3) E[W(i,k)W(i,k)T]=Q(i)(4)E[W(i,k)W(i,k) T ]=Q(i)(4) E[V(i,k)V(i,k)T]=R(i)(5)E[V(i,k)V(i,k) T ]=R(i)(5) 得到卡尔曼滤波器方程的预测过程:Get the prediction process of the Kalman filter equation: P(i,k|k-1)=AP(i,k-1|k-1)AT+Q(i)(6)P(i,k|k-1)=AP(i,k-1|k-1) AT +Q(i)(6) Xx (( ii ,, kk || kk -- 11 )) == AA Xx ^^ (( ii ,, kk -- 11 || kk -- 11 )) ++ BB Uu (( ii ,, kk )) -- -- -- (( 77 )) 式中,X(i,k|k-1)是第i个通道中在k时刻利用k-1时刻状态预测的结果,是第i个通道中在k时刻利用k-1时刻状态最优的结果,U(i,k)是在k时刻第i个通道中的状态控制量,而P(i,k|k-1)是对应的协方差矩阵,P(i,k-1|k-1)是对应的协方差矩阵;In the formula, X(i,k|k-1) is the result of state prediction at time k in the i-th channel using time k-1, is the optimal result of using the state at time k-1 in the i-th channel at time k, U(i,k) is the state control quantity in the i-th channel at time k, and P(i,k|k-1 )yes The corresponding covariance matrix, P(i,k-1|k-1) is The corresponding covariance matrix; 列出卡尔曼滤波器方程的校正过程:List the correction procedure for the Kalman filter equation: K(i,k)=P(i,k|k-1)CT[CP(i,k|k-1)CT+R(i)]-1(8)K(i,k)=P(i,k|k-1)C T [CP(i,k|k-1)C T +R(i)] -1 (8) Xx ^^ (( ii ,, kk || kk )) == Xx (( ii ,, kk -- 11 || kk -- 11 )) ++ KK kk (( SS (( ii ,, kk )) -- CC Xx (( ii ,, kk || kk -- 11 )) )) -- -- -- (( 99 )) P(i,k|k)=[I(i)-K(i,k)C]P(i,k|k-1)(10)P(i,k|k)=[I(i)-K(i,k)C]P(i,k|k-1)(10) 式中,K(i,k)为第i个通道中的卡尔曼增益;where K(i,k) is the Kalman gain in the i-th channel; 设系统矩阵A和系统输出矩阵C均为单位阵,则系统预测过程为:Assuming that the system matrix A and the system output matrix C are unit matrices, the system prediction process is: P(i,k|k-1)=P(i,k-1|k-1)+Q(i)(11)P(i,k|k-1)=P(i,k-1|k-1)+Q(i)(11) Xx (( ii ,, kk || kk -- 11 )) == Xx ^^ (( ii ,, kk -- 11 || kk -- 11 )) -- -- -- (( 1212 )) 系统校正过程为:The system calibration process is: K(i,k)=P(i,k|k-1)[P(i,k|k-1)+R(i)]-1(13)K(i,k)=P(i,k|k-1)[P(i,k|k-1)+R(i)] -1 (13) Xx ^^ (( ii ,, kk || kk )) == Xx (( ii ,, kk -- 11 || kk -- 11 )) ++ KK kk (( SS (( ii ,, kk )) -- Xx (( ii ,, kk || kk -- 11 )) )) -- -- -- (( 1414 )) P(i,k|k)=[I(i)-K(i,k)]P(i,k|k-1)(15)P(i,k|k)=[I(i)-K(i,k)]P(i,k|k-1)(15) 第二步,卡尔曼滤波器的程序实现;The second step is the program realization of the Kalman filter; 首先将设备接收到的N个通道各g组RSSI数据转化为[N×g]的矩阵数据z形式读取;之后对矩阵数据进行初始化,设:First, convert the RSSI data of each group g of N channels received by the device into [N×g] matrix data z and read it; then initialize the matrix data, set: k:代表系统状态变化的时间节点;k: represents the time node of the system state change; i:代表观测的通道编码,每一个通道编码传递的数值指示了来自该通道接收到的蓝牙Beacon的RSSI;i: Represents the observed channel code, and the value passed by each channel code indicates the RSSI from the Bluetooth Beacon received by the channel; Xhat:为[N×g]矩阵,表示对RSSI的后验估计值,即在k时刻,结合当前RSSI的测量值与k-1时刻RSSI先验估计,得到的估计值更新,对应于状态方程中的X,初始化时候将该矩阵第一个元素置零;Xhat: It is a [N×g] matrix, which represents the posterior estimated value of RSSI, that is, at time k, combined with the measured value of current RSSI and the prior estimation of RSSI at time k-1, the estimated value is updated, corresponding to the state equation In X, the first element of the matrix is set to zero during initialization; Xhatminus:为[N×g]矩阵,表示RSSI的先验估计,即在k-1时刻,对k时刻RSSI做出的估计,对应于状态方程中的X,初始化时候将该矩阵第一个元素置零;Xhatminus: It is a [N×g] matrix, which represents the prior estimation of RSSI, that is, at time k-1, the estimation of RSSI at time k corresponds to X in the state equation, and the first element of the matrix is initialized Zero; P:为[N×g]矩阵,表示后验估计的方差,初始化时候将该矩阵第一个元素置零;P: It is a [N×g] matrix, which represents the variance of the posterior estimate, and the first element of the matrix is set to zero during initialization; Pminus:为[N×g]矩阵,表示先验估计的方差,初始化时候将该矩阵第一个元素置零;Pminus: It is a [N×g] matrix, which represents the variance of the prior estimate, and the first element of the matrix is set to zero during initialization; K:为[N×g]矩阵,表示卡尔曼增益量,初始化时候将该矩阵第一个元素置零;K: It is a [N×g] matrix, which represents the Kalman gain, and the first element of the matrix is set to zero during initialization; 针对第i个通道,将第i个通道中xhat(i,1)赋值为输入信号对应通道的第一个值,再将该通道中P(i,1)赋值为1,矩阵数据初始化完成;For the i-th channel, assign xhat(i,1) in the i-th channel to the first value of the channel corresponding to the input signal, and then assign P(i,1) in the channel to 1, and the matrix data initialization is completed; 在同一个通道i中,系统预测方程:In the same channel i, the system predicts the equation: xhatminus(i,k)=xhat(i,k-1)(16)xhatminus(i,k)=xhat(i,k-1)(16) Pminus(i,k)=P(i,k-1)+Q(i)(17)Pminus(i,k)=P(i,k-1)+Q(i)(17) 系统校正方程:System correction equation: K(i,k)=Pminus(i,k)/(Pminus(i,k)+R(i))(18)K(i,k)=Pminus(i,k)/(Pminus(i,k)+R(i))(18) xhat(i,k)=xhatminus(i,k)+K(i,k)*(z(i,k)-xhatminus(i,k)(19)xhat(i,k)=xhatminus(i,k)+K(i,k)*(z(i,k)-xhatminus(i,k)(19) P(i,k)=(1-K(i,k))*Pminus(i,k)(20)P(i,k)=(1-K(i,k))*Pminus(i,k)(20) 将k从2到g进行遍历,得出第i个通道RSSI后验估计值随着时刻点的变化,即反应了卡尔曼滤波效果,最后将i从1到N进行遍历,得到各个通道RSSI卡尔曼滤波效果,作图输出该实测点位置处各个通道蓝牙BeaconRSSI经过卡尔曼滤波处理后的效果图;Traverse k from 2 to g to obtain the change of the i-th channel RSSI posterior estimate with the time point, which reflects the effect of Kalman filtering, and finally traverse i from 1 to N to obtain the RSSI Kal of each channel Mann filter effect, plotting and outputting the effect map of each channel Bluetooth BeaconRSSI at the position of the measured point after Kalman filter processing; 第三步,比较卡尔曼滤波前后该实测点处RSSI动态范围变化;The third step is to compare the change of RSSI dynamic range at the measured point before and after Kalman filtering; 根据滤波前的N个通道RSSI数据,滤波后的N个通道RSSI数据,输出卡尔曼滤波前后N个通道分别的最大值、最小值以及其波动的动态范围;According to the RSSI data of N channels before filtering and the RSSI data of N channels after filtering, output the maximum value, minimum value and dynamic range of fluctuations of the N channels before and after Kalman filtering; 最后,将卡尔曼滤波处理后的RSSI通过距离与信号强度的关系式解算出RSSI对应的距离,对于每个通道的蓝牙Beacon解算出其距离上限与距离下限,分别对应该通道下RSSI最大值与最小值,得到实测点在搭建场景中距离位置范围。Finally, the Kalman filter-processed RSSI is calculated by the relationship between distance and signal strength to calculate the distance corresponding to RSSI. For each channel of Bluetooth Beacon, the upper limit and lower limit of the distance are calculated, which correspond to the maximum value and maximum value of RSSI under the channel respectively. The minimum value is used to obtain the distance position range of the measured point in the construction scene.
CN201510587515.0A 2015-09-15 2015-09-15 A kind of RSSI kalman filter methods based on indoor locating system Active CN105182288B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510587515.0A CN105182288B (en) 2015-09-15 2015-09-15 A kind of RSSI kalman filter methods based on indoor locating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510587515.0A CN105182288B (en) 2015-09-15 2015-09-15 A kind of RSSI kalman filter methods based on indoor locating system

Publications (2)

Publication Number Publication Date
CN105182288A true CN105182288A (en) 2015-12-23
CN105182288B CN105182288B (en) 2017-09-29

Family

ID=54904489

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510587515.0A Active CN105182288B (en) 2015-09-15 2015-09-15 A kind of RSSI kalman filter methods based on indoor locating system

Country Status (1)

Country Link
CN (1) CN105182288B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106454892A (en) * 2016-08-30 2017-02-22 衢州学院 Set-valued Kalman filtering method based on quantification and events
CN107657794A (en) * 2017-09-29 2018-02-02 深圳市深层互联科技有限公司 Emergency warning system based on indoor positioning technologies
CN109041087A (en) * 2018-07-31 2018-12-18 复旦大学 WiFi signal acquisition, visualization and fault location system towards campus network
CN109283489A (en) * 2018-11-29 2019-01-29 广东电网有限责任公司 A UWB precise positioning method, apparatus, device and computer-readable storage medium
CN109917404A (en) * 2019-02-01 2019-06-21 中山大学 A method for extracting feature points of indoor positioning environment
CN109978944A (en) * 2017-12-27 2019-07-05 财团法人工业技术研究院 Coordinate system formulating method, device and data structure product
CN110133587A (en) * 2018-02-08 2019-08-16 上海询诺通信科技发展有限公司 A kind of comprehensive bluetooth localization method and system
EP3614348A1 (en) * 2018-08-23 2020-02-26 Nxp B.V. System for securing keyless entry systems
CN112964159A (en) * 2021-03-12 2021-06-15 烟台铁中宝钢铁加工有限公司 Detection sample plate, detection method and evaluation method of rack
CN113702959A (en) * 2021-08-17 2021-11-26 泰凌微电子(上海)股份有限公司 Wireless ranging method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104507159A (en) * 2014-11-24 2015-04-08 北京航空航天大学 A method for hybrid indoor positioning based on WiFi (Wireless Fidelity) received signal strength
CN104619016A (en) * 2015-01-22 2015-05-13 南京邮电大学 RSSI (Received Signal Strength Indicator)-based indoor positioning method
US20150145727A1 (en) * 2010-10-08 2015-05-28 HJ Laboratories, LLC Tracking a mobile computer indoors using wi-fi and motion sensor information

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150145727A1 (en) * 2010-10-08 2015-05-28 HJ Laboratories, LLC Tracking a mobile computer indoors using wi-fi and motion sensor information
CN104507159A (en) * 2014-11-24 2015-04-08 北京航空航天大学 A method for hybrid indoor positioning based on WiFi (Wireless Fidelity) received signal strength
CN104619016A (en) * 2015-01-22 2015-05-13 南京邮电大学 RSSI (Received Signal Strength Indicator)-based indoor positioning method

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106454892A (en) * 2016-08-30 2017-02-22 衢州学院 Set-valued Kalman filtering method based on quantification and events
CN106454892B (en) * 2016-08-30 2020-02-11 衢州学院 Integrated value Kalman filtering method based on quantization and event
CN107657794A (en) * 2017-09-29 2018-02-02 深圳市深层互联科技有限公司 Emergency warning system based on indoor positioning technologies
CN109978944B (en) * 2017-12-27 2021-06-18 财团法人工业技术研究院 Coordinate system formulation method, device and data structure product
CN109978944A (en) * 2017-12-27 2019-07-05 财团法人工业技术研究院 Coordinate system formulating method, device and data structure product
CN110133587B (en) * 2018-02-08 2024-04-26 上海询诺通信科技发展有限公司 Comprehensive Bluetooth positioning method and system
CN110133587A (en) * 2018-02-08 2019-08-16 上海询诺通信科技发展有限公司 A kind of comprehensive bluetooth localization method and system
CN109041087A (en) * 2018-07-31 2018-12-18 复旦大学 WiFi signal acquisition, visualization and fault location system towards campus network
EP3614348A1 (en) * 2018-08-23 2020-02-26 Nxp B.V. System for securing keyless entry systems
CN109283489A (en) * 2018-11-29 2019-01-29 广东电网有限责任公司 A UWB precise positioning method, apparatus, device and computer-readable storage medium
CN109917404B (en) * 2019-02-01 2023-02-03 中山大学 A Method for Extracting Feature Points of Indoor Positioning Environment
CN109917404A (en) * 2019-02-01 2019-06-21 中山大学 A method for extracting feature points of indoor positioning environment
CN112964159A (en) * 2021-03-12 2021-06-15 烟台铁中宝钢铁加工有限公司 Detection sample plate, detection method and evaluation method of rack
CN113702959A (en) * 2021-08-17 2021-11-26 泰凌微电子(上海)股份有限公司 Wireless ranging method and device

Also Published As

Publication number Publication date
CN105182288B (en) 2017-09-29

Similar Documents

Publication Publication Date Title
CN105182288B (en) A kind of RSSI kalman filter methods based on indoor locating system
CN106502264B (en) The operating system of plant protection unmanned plane
US10111048B2 (en) 3D sectorized path-loss models for 3D positioning of mobile terminals
Lymberopoulos et al. Microsoft indoor localization competition: Experiences and lessons learned
CN108107461B (en) Indoor and outdoor positioning seamless switching method based on mobile terminal
CN106550331B (en) An indoor positioning method and device
KR20190053470A (en) Positioning system based on deep learnin and construction method thereof
JP7163438B2 (en) Updating radio maps based on arrays of radio fingerprints
KR101974002B1 (en) Method of positioning mobile device with seamless, high precision scheme
CN110418283B (en) WiFi data-based location fingerprint database creation method
CN110941284A (en) Relay network deployment method based on unmanned aerial vehicle and ground station equipment
Abdelhadi et al. Position estimation of robotic mobile nodes in wireless testbed using GENI
JP2012518170A (en) Method and apparatus for determining real time difference in location of mobile terminal
CN107911786A (en) A kind of mixing indoor orientation method based on road network correction
CN105188131A (en) Grid-based indoor area location and navigation method
US11448719B2 (en) Obtaining fingerprints for indoor navigation systems
CN106211327A (en) A kind of method automatically generating location fingerprint data
CN105228244B (en) A kind of wireless location method and system
CN105323794A (en) Method and device for determining position of access point
CN108307311A (en) Internal home network signal acquisition method, device and navigating robot
US11125851B2 (en) Generate a radio map for indoor navigation
Neges et al. Improving indoor location tracking quality for construction and facility management
CN105898773B (en) The bearing calibration and system of propagation model
CN104202725A (en) Indoor fingerprint collection method, device and apparatus
CN113514797B (en) Automatic calibration method of UWB base station

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20151223

Assignee: Beijing Qiangwang Technology Co.,Ltd.

Assignor: BEIHANG University

Contract record no.: X2023990000710

Denomination of invention: A Method of RSSI Kalman filter Filtering Based on Indoor Positioning System

Granted publication date: 20170929

License type: Common License

Record date: 20230714

EE01 Entry into force of recordation of patent licensing contract