An indoor positioning method based on multi-sensor of smart phone
Through the multi-sensor of smartphones, data acquisition and combined with filtering and step length estimation calculation, the error problem caused by small direction deviations in indoor positioning is solved, and positioning accuracy and motion state recognition ability are improved.
Patent Information
- Application Number
- CN202310408378.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-17
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2043-04-17
AI Technical Summary
Small deviations in the calculation of direction by existing indoor positioning techniques may lead to large errors in position estimation, and the judgment of pedestrian motion state and step length estimation are not accurate enough.
Through multi-sensors of smartphones, data are collected by accelerometers, gyroscopes and magnetometers, filtering methods are used to filter and noise reduction, combined with step frequency detection and improved step length estimation calculation method, the heading angle, step frequency and step length are calculated, and then the heading angle, step frequency and step length are estimated. Pedestrian movement trajectory.
It improves the accuracy and accuracy of indoor positioning, reduces the accumulation of errors, and enhances the ability to identify pedestrian motion states and step length estimation.
Smart Images

Figure CN116437003B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an indoor positioning method, and in particular to an indoor positioning method based on multiple sensors of a smart phone. Background Art
[0002] Today's society is an era of mature Internet development, and smart phones are also popular. With the popularization of smart phones, people's lives have changed greatly. Social, shopping, entertainment and other activities in people's lives are inseparable from smart phones. Indoor positioning is one of the most challenging technologies in location-based services. Compared with outdoor positioning, which can directly call GPS signals for positioning, indoor positioning can be divided into active signal positioning and inertial positioning technology.
[0003] Daniel Broyles et al. developed a software that uses particle filtering to integrate sensor data with random pedestrian motion patterns to predict pedestrian positions. The system positioning accuracy is within ten meters and does not increase over time. Lee et al. relied on special foot-worn IMU (Inertial Measurement Unit) equipment to analyze the causes of symmetrical position drift and proposed a "zero-speed update" method to correct the errors caused by inertial sensors. However, the special equipment used is expensive and not easy to promote and popularize. Ying Guo proposed an improved heuristic drift elimination method to correct the heading error of smartphone gyroscopes. On the basis of analyzing the improved heuristic drift elimination algorithm and the improved heuristic drift elimination algorithm, the quaternion method was used to update the attitude and angle threshold judgment conditions, and the correction quaternion method was added to eliminate the heading error caused by random gyroscope errors. Experiments showed that the new method improved the ability to identify and correct walking paths, and the heading accuracy was improved by more than 90%. Qu Wang et al. proposed an adaptive stride estimation algorithm that can identify five behavior patterns of pedestrians, namely fast walking, normal walking, slow walking, running, and jumping.
[0004] Inertial technology uses inertial sensors such as accelerometers and gyroscopes to sample pedestrian motion information, and the data fusion of magnetometers and gyroscopes can be used to determine the speed and orientation of the target. Based on the known initial position, the relative position of the pedestrian in the room can be calculated. One advantage of this technology is that most modern smartphones have all the sensors required for dead reckoning, and with the advancement of technology, the accuracy of the sensors has also improved. Its disadvantages are that small deviations in calculating the direction may lead to large errors in position estimation at long distances, the accumulation of errors, and the judgment of the pedestrian's motion state, and the inability to estimate the pedestrian's step length well after determining the motion state.
[0005] By identifying and processing the common motion states of pedestrians, and improving and correcting the existing inertial navigation and positioning technology, accurate navigation and positioning of pedestrians in various motion states can be achieved. According to the existing research plan on inertial navigation, there are mainly the following methods for calculating mobile displacement. One is to directly perform secondary integration of acceleration data to calculate displacement. However, since acceleration changes at any time and errors occur at any time, and the inertial sensor itself also has random errors, under the premise that the error has accumulated a lot, the acceleration is used for secondary integration to obtain displacement. This method not only fails to eliminate the error, but makes the error of the integration result larger. The second method is the pedestrian dead reckoning algorithm. The algorithm is divided into three steps: cadence detection, step length measurement and direction judgment. Based on the traditional PDR algorithm, the cadence data is not accurate. The method of combining the filtering algorithm with the dynamic threshold judgment method is used to judge the pedestrian's cadence and classify the pedestrian's motion state.
[0006] An improved inertial positioning algorithm is proposed based on the second method. Inertial sensors such as accelerometers and gyroscopes can be used to sample pedestrian motion information, and the data fusion of magnetometers and gyroscopes can be used to determine the speed and orientation of the target. Based on the known initial position, the relative position information of the pedestrian in the room can be calculated. Summary of the invention
[0007] To solve the above problems, the present invention discloses an indoor positioning method based on a smart phone multi-sensor. The method reads the accelerometer, gyroscope and magnetometer data collected by the smart phone sensor module, filters and reduces noise by a filtering method, and performs step frequency detection. At the same time, the data collected by the built-in multi-sensor of the smart phone is transmitted to a human activity recognition model to classify and predict the current motion state of the pedestrian. An improved step length estimation algorithm is used to calculate the step length under different states. The obtained data is fused and the heading angle, step frequency and step length of the pedestrian's motion are calculated, so as to estimate and locate the motion trajectory of the pedestrian indoors.
[0008] An indoor positioning method based on multiple sensors of a smartphone, the steps are as follows:
[0009] Step 101: Read the accelerometer, gyroscope and magnetometer data collected by the smartphone sensor module, where the accelerometer obtains the x-axis acceleration v x , y-axis acceleration v y , z-axis acceleration v z ;
[0010] Step 102: Preprocess the raw data. Use filtering methods to filter and reduce noise on the data. Set the sliding window size to 8 and use the moving average filtering method to calculate each axis, i.e., x, y, z axis: v i =(vi-3 +v i-2 +…+v i+3 +v i+4 ) / 8, the calculated result is used as preprocessing data for the next step of calculation.
[0011] Step 103: Step frequency detection. Calculate the total acceleration through the pre-processed data obtained in step 102 The calculation uses the dynamic threshold peak detection method to control the peak detection result, filter out the influence of pseudo peaks, calculate the number of steps, and the maximum value of each step acceleration acc max , minimum value acc min , the peak time point of the current step t peek , the peak time point t of the previous step last peek , the duration of the current step t step , the average acceleration of each axis in the current step is recorded as acc x ,acc y ,acc z ;
[0012] Step 104: Step length calculation. According to the pedestrian's behavior pattern, the step length L in different modes is calculated;
[0013] Step 105: Calculate the motion trajectory. According to the heading angle α and step length L of the pedestrian, the current position is (Pos x ,Pos y ), estimate and locate the motion trajectory of pedestrians indoors (Pos endX ,Pos endY ), Pos endX =Pos x +L*cosα,Pos endY =Pos y +L*sinα.
[0014] In the step 103, the step frequency detection obtains the fast and slow rhythm of the steps, which is specifically implemented as follows;
[0015] Step 1031: Initialize variables. Use the preprocessed data to perform calculations in this step, set tempValue[] to store the peak-to-valley difference of the calculated threshold, set isUpFlag to indicate whether it is rising, set stillUpNum to the number of continuous rises, set stillUpLastNum to the number of continuous rises of the previous point, set the state of the previous point lastSta to record the number of rises of the peak, set peakWave to record the peak value, set valleyWave to record the valley value, set datax[], datay[], dataz[] to store all the data from the previous step peak to the current step peak of the x, y, z axis acceleration, set initialValue to record the variable dynamic threshold, and then perform step frequency detection based on the combined acceleration.
[0016] Step 1032: Peak detection. The following conditions must be met: (1) The current point is a downward trend, isUpFlag is false; (2) The previous record point is an upward trend, then lastSta is true; (3) At the sampling point before the current peak, the variable stillUpNum is greater than or equal to 5; (4) The peak value is greater than 1.2g and less than 4g; (5) ValleyWave is recorded at the same time for comparison with the next peakWave.
[0017] Step 1033: Threshold calculation. The threshold initialValue is calculated by the difference between the peak and the trough, that is, tempValue[]. n values are recorded and stored in the tempValue[] array. The array is used to calculate the average value, and the threshold is gradiented into a range by the average value to define the threshold range.
[0018] Step 1034: Movement is detected. The system performs positioning initialization for 1 second. The step count will not be displayed within 1 second to shield the slight fluctuation. After 1 second, the step count will start and the data in the sensor will be collected. If a peak is detected and meets the time difference and is within the range of the threshold initialValue, it is determined to be 1 step. If the time difference condition is met and the peak-to-trough difference tempValue[] is greater than initialValue, the difference will be included in the calculation of the threshold.
[0019] This step can get the maximum value of each step acceleration, recorded as acc max , the minimum value is recorded as acc min , the peak time point of the current step is recorded as t peek , the peak time point of the previous step is recorded as t last peek , the duration of the current step is recorded as t step , the calculation formula is: step =tpeek -t last peek , the average acceleration of each axis in the current step is recorded as acc x ,acc y ,acc z The calculation formula is: acc = (data[0] + data[1] + ... + data[n-1] + data[n]) / n, using the following step calculation.
[0020] Step 104: Step length calculation determines the pedestrian's stride size, which is specifically implemented as follows:
[0021] By classifying pedestrian movement states into six categories, namely walking, stopping, jogging, going up / down stairs, walking backward, and taking steps left and right, and dividing the mobile phone placement states into three categories, namely holding, swinging hands, and pocket, the combinations are classified into the following behavior patterns: (1) holding and walking, jogging, or standing; (2) swinging hands—walking, jogging; (3) walking backward; and (4) pocket.
[0022] Calculate the step length. Based on the data obtained in the previous step, the step length model frequency parameter A (generally set to 0.1 in the hand-held state and 0.05 in the hand-flipping state) is used to consider the frequency factor, the motion state identification parameter P (generally set to 0.2 in the hand-held state and 0.1 in the hand-flipping state) is used to distinguish the calculation of different motion states, and the step length model parameter K (generally set to 0.25). The step length L of each behavior is calculated as follows:
[0023] (1) Holding and walking, jogging or standing:
[0024]
[0025] (2) Hand shaking state—walking, jogging:
[0026]
[0027] (3) Backward:
[0028]
[0029] (4) Pocket.
[0030]
[0031] (5) Going up and down stairs, judging the movement state, but not calculating the step length.
[0032]
[0033] Beneficial effects of the present invention:
[0034] (1) The present invention divides human activity states into: movement states: walking, standing, jogging, going up / down stairs, walking backward, and stepping left and right; behavior states: holding hands, shaking hands, and holding pockets; and further proposes a refined adaptive dynamic step length model.
[0035] (2) The advantage of the stride length estimation model proposed in the invention is that the stride frequency parameter of the stride length model is added to consider the factors of the stride frequency, and the motion state identification parameter is added to consider the factors of different motion states, which refines the classification of pedestrian motion states and improves the accuracy of step length estimation.
[0036] (3) The present invention can be applied to indoor positioning and navigation in large places such as shopping malls, teaching buildings, underground parking lots, residential buildings, and other indoor places where active signals such as GPS signals cannot be used for positioning. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 : Flow chart of the indoor positioning method based on multi-sensor of smart phone in the present invention;
[0038] Figure 2 : Schematic diagram of data collection and preprocessing of the present invention;
[0039] Figure 3 : Schematic diagram of the PDR positioning module of the present invention;
[0040] Figure 4 : Schematic diagram of the results of the present invention (wherein Figure (a) shows the initial state with the number of steps being 0, direction 81, and travel distance 0; Figure (b) shows that after one step, the number of steps is 1, direction 82, and travel distance is 0.55m). DETAILED DESCRIPTION
[0041] The present invention is further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention. It should be noted that the words "front", "rear", "left", "right", "upper" and "lower" used in the following description refer to directions in the accompanying drawings, and the words "inner" and "outer" refer to directions toward or away from the geometric center of a specific component, respectively.
[0042] like Figure 1-3 As shown, an indoor positioning method based on a smart phone multi-sensor of this embodiment includes the following steps:
[0043] 1) Read the accelerometer, gyroscope and magnetometer data collected by the smartphone sensor module, where the accelerometer obtains the x-axis acceleration v x , y-axis acceleration v y , z-axis acceleration v z .
[0044] 2) Preprocess the raw data. Use filtering methods to filter and reduce noise on the data. Set the sliding window size to 8 and use the moving average filtering method to calculate each axis, i.e. x, y, z axis: v i =(v i-3 +v i-2 +…+v i+3 +v i+4 ) / 8, the calculated result is used as preprocessing data for the next step of calculation.
[0045] 3) Cadence detection. Calculate the total acceleration using the pre-processed data obtained in step 102 The calculation uses the dynamic threshold peak detection method to control the peak detection result, filter out the influence of pseudo peaks, calculate the number of steps, and the maximum value of each step acceleration acc max , minimum value acc min , the peak time point t of the current step peek , the peak time point t of the previous step last peek , the duration of the current step t step , the average acceleration of each axis in the current step is recorded as acc x ,acc y ,acc z ;
[0046] 4) Step length calculation. According to the pedestrian's behavior pattern, calculate the step length L in different modes;
[0047] 5) Calculate the motion trajectory. According to the heading angle α and step length L of the pedestrian, let the current position be (Pos x ,Pos y ), estimate and locate the motion trajectory of pedestrians indoors (Pos endX ,Pos endY ), Pos endX =Pos x +L*cosα,Pos endY =Pos y +L*sinα.
[0048] 2. According to the indoor positioning algorithm, the specific implementation method of cadence detection is as follows:
[0049] (1) Use the preprocessed data to perform the calculations in this step to determine the difference between the peak and the trough, the rising flag, the number of continuous rises, the number of continuous rises of the previous point, the state of the previous point, the peak value, the trough value, and the variable dynamic thresholds of the x, y, and z axis accelerations, and perform step frequency detection based on the combined acceleration.
[0050] (2) Peak detection. 1) If the current point is a downward trend, isUpFlag is false; 2) If the previous record point is an upward trend, lastSta is true; 3) At the sampling point before the current peak, the variable stillUpNum is greater than or equal to 5; 4) The peak value is greater than 1.2g and less than 4g; 5) Record valleyWave at the same time and compare it with the next peakWave.
[0051] (3) Threshold calculation: Calculate the threshold initialValue by the difference between the peak and the trough, record n values and calculate the average, and use the average to gradient the threshold into a range to define the threshold range.
[0052] (4) Movement is detected. The system starts counting steps and collecting data from the sensor after 1 second. If a peak is detected and meets the time difference and is within the threshold initialValue, it is considered as 1 step. If the time difference condition is met and the difference between the peak and the trough is greater than initialValue, the difference is included in the calculation of the threshold.
[0053] This step can get the maximum value of each step acceleration, recorded as acc max , the minimum value is recorded as acc min , the peak time point of the current step is recorded as t peek , the peak time point of the previous step is recorded as t last peek , the duration of the current step is recorded as t step , the calculation formula is: step =t peek -t last peek , the average acceleration of each axis in the current step is recorded as acc x ,acc y ,acc z The calculation formula is: acc = (data[0] + data[1] + ... + data[n-1] + data[n]) / n, using the following step calculation.
[0054] 3. Calculate the step length according to the indoor positioning algorithm. According to the pedestrian in hand-held walking state, the step frequency parameter A = 0.1, the motion state identification parameter P = 0.2, and the step length model parameter K = 0.25, then the step length L is calculated as follows:
[0055]
[0056] like Figure 4 As shown, the results are shown as follows: Figure (a) shows that the initial state has 0 steps, direction 81, and travel distance 0; Figure (b) shows that after one step, the step number is 1, direction 82, and travel distance is 0.55m.
[0057] The technical means disclosed in the scheme of the present invention are not limited to the technical means disclosed in the above-mentioned implementation mode, but also include technical schemes composed of any combination of the above technical features.
Claims
1. An indoor positioning method based on multiple sensors of a smart phone, characterized in that: The following steps are involved: Step 101: Read the accelerometer, gyroscope and magnetometer data collected by the smartphone sensor module, where the accelerometer obtains the x-axis acceleration v x , y-axis acceleration v y , z-axis acceleration v z ; Step 102: Preprocess the accelerometer, gyroscope and magnetometer data collected by the module of the smartphone sensor; filter and reduce noise by using a filtering method, and set the moving average filtering method with a sliding window size of 8 to calculate each axis, i.e., x, y, z axis: v i =(v i-3 +v i-2 +…+v i+3 +v i+4 ) / 8, the calculated result is used as preprocessing data for the next step of calculation; Step 103: Cadence detection; Calculate the total acceleration using the pre-processed data obtained in step 102 The calculation uses the dynamic threshold peak detection method to control the peak detection result, filter out the influence of pseudo peaks, calculate the number of steps, and the maximum value of each step acceleration acc max , minimum value acc min , the peak time point t of the current step peek , the peak time point t of the previous step lastpeek , the duration of the current step t step , the average acceleration of each axis in the current step is recorded as acc x ,acc y ,acc z ; The specific implementation of step 103 is: Step 1031: Initialize variables; use the preprocessed data to perform calculations in this step, set tempValue[] to store the peak-to-valley difference of the calculated threshold, set isUpFlag to indicate whether it is rising, set stillUpNum to the number of continuous rises, set stillUpLastNum to the number of continuous rises of the previous point, in order to record the number of rises of the peak, set the state of the previous point lastSta, set peakWave to record the peak value, set valleyWave to record the valley value, set datax[], datay[], dataz[] to store all the data from the previous step peak to the current step peak of the x, y, z axis acceleration respectively, set initialValue to record the variable dynamic threshold, and then perform step frequency detection based on the combined acceleration; Step 1032: Peak detection; the following conditions must be met: 1) The current point is a downward trend, isUpFlag is false; 2) If the previous record point shows an upward trend, lastSta is true; 3) At the sampling point before the currently determined peak, the variable stillUpNum is greater than or equal to 5; 4) The peak value is greater than 1.2g and less than 4g; 5) Record the valley Wave and compare it with the next peak Wave; Step 1033: threshold calculation; calculate the threshold initialValue through the difference between the peak and the trough, that is, tempValue[], record n values, store them in the tempValue[] array, use the array to calculate the average, and use the average to gradient the threshold into a range to define the threshold range; Step 1034: Movement is detected; the system performs positioning initialization for 1 second, and the step count will not be displayed within 1 second to shield minor fluctuations. After 1 second, the step count starts and the data in the sensor is collected. If a peak is detected and meets the time difference and is within the range of the threshold initialValue, it is determined to be 1 step, meets the time difference condition, and the peak and trough difference tempValue[] is greater than initialValue, then the difference is included in the calculation of the threshold; Step 104: Step length calculation: Calculate the step length L in different modes according to the pedestrian's behavior mode; The specific implementation of step 104 is as follows: Step 1041: Determine the behavior mode; by classifying the pedestrian's movement state into six types, namely walking, stopping, jogging, going up / down stairs, backing up, and stepping left and right, and the mobile phone placement state into three types, namely, holding, swinging hands, and pocket, the combination is divided into the following behavior modes: 1) holding and walking, jogging, or standing; 2) swinging hands - walking, jogging; 3) backing up; 4) pocket; Step 1042: Calculate the step length; according to the data obtained in the previous step, obtain the step length model frequency parameter A; the hand-held walking state is set to 0.1, and the hand-swinging state is set to 0.05 to consider the frequency factor, the motion state identification parameter P; the hand-held walking state is set to 0.2, and the hand-swinging state is set to 0.1 to distinguish the calculation of different motion states, and the step length model parameter K; set to 0.25, the step length L of each behavior is calculated as follows: 1)Handheld and walking or jogging: 2) Hand shaking state - walking, jogging: 3) Backward: 4) Pockets: 5) Going up and down stairs: It is judged as going up and down stairs, and the step length is not calculated; (5) No need to calculate step length when going up and down stairs; Step 105: Calculate the motion trajectory; according to the heading angle α and step length L of the pedestrian's motion, set the current position as (Pos x ,Pos y ), estimate and locate the motion trajectory of pedestrians indoors (Pos endX ,Pos endY ), Pos endX =Pos x +L*cosα,Pos endY =Pos y +L*sinα.
2. The indoor positioning method based on multiple sensors of a smart phone according to claim 1, characterized in that: The maximum value of the combined acceleration of each step obtained in step 103 is recorded as acc max , the minimum value is recorded as acc min , the peak time point of the current step is recorded as t peek , the peak time point of the previous step is recorded as t lastpeek , the duration of the current step is recorded as t step , the calculation formula is: step =t peek -t lastpeek , the average acceleration of each axis in the current step is recorded as acc x ,acc y ,acc z The calculation formula is: acc = (data[0] + data[1] + ... + data[n-1] + data[n]) / n, using the following step calculation.
Citation Information
Patent Citations
Indoor positioning device and method based on motion capture and method
CN104964686A
Sensor-based indoor pedestrian positioning method
CN105043393A