Bluetooth positioning method, terminal device, electronic device and storage medium
View Patent ↗Provided are a Bluetooth positioning method, a terminal device, an electronic device and a storage medium The Bluetooth positioning method includes: acquiring a sampled message, wherein the sampled message includes a sampled IQ data and a data signal strength indicator, and the sampled IQ data includes a plurality of sampled IQ values obtained by sequentially sampling signals received or transmitted by a plurality of antennas in a Bluetooth antenna array according to a preset order, wherein the signals received or transmitted by the plurality of antennas are signals transmitted by an identical signal source; and judging whether the data signal strength indicator is greater than a preset threshold, wherein if the data signal strength indicator is greater than the preset threshold, a position angle of the signals is obtained based on the sampled IQ data in the sampled message.
1 . A Bluetooth positioning method, comprising steps of:
acquiring a sampled message, wherein the sampled message comprises a sampled IQ data and a data signal strength indicator, and the sampled IQ data comprises a plurality of sampled IQ values obtained by sequentially sampling, according to a preset order, signals received or transmitted by a plurality of antennas in a Bluetooth antenna array, wherein the signals received or transmitted by the plurality of antennas are signals transmitted by an identical signal source; and
judging whether the data signal strength indicator is greater than a preset threshold,
wherein when the data signal strength indicator is greater than the preset threshold, a position angle of the signals is obtained based on the sampled IQ data in the sampled message;
the step of a position angle of the signals is obtained based on the sampled IQ data in the sampled message comprises steps of:
acquiring, based on the sampled IQ data, phase differences between adjacent antennas in the Bluetooth antenna array, to obtain a plurality of phase differences;
acquiring based on the sampled IQ data, phase differences corresponding to IQ values at different time points corresponding to an identical antenna;
performing, based on the phase differences between the IQ values at different time points corresponding to the identical antenna, a phase compensation processing on the plurality of phase differences; and
obtaining, based on the plurality of phase differences after the phase compensation processing, the position angle at a current time point.
2 . The method according to claim 1 , wherein the method further comprises, before the step of obtaining based on the plurality of phase differences after the phase compensation processing the position angle at a current time point, a step of:
determining that a standard deviation of the plurality of phase differences is smaller than a preset standard deviation threshold.
3 . The method according to claim 2 , further comprising:
acquiring number of the sampled messages whose data signal strength indicator is lower than the preset threshold within a preset duration; and
adjusting the preset threshold according to the number of the sampled messages whose data signal strength indicator is lower than the preset threshold.
4 . The method according to claim 1 , wherein the method further comprises, after the step of obtaining the position angle at a current time point, a step of:
determining a target position angle based on the position angle and a plurality of position angles adjacent to the position angle.
5 . The method according to claim 4 , wherein when the signal source and the Bluetooth antenna array are relatively stationary, the step of determining a target position angle based on the position angle and a plurality of position angles adjacent to the position angle comprises:
acquiring a first average value of the position angle and a plurality of position angles adjacent to the position angle; and
removing, among the position angle and the plurality of position angles adjacent to the position angle, an angle whose difference from the first average value is greater than a preset angle threshold, and calculating a second average value of the remaining angles, wherein the second average value is the target position angle at the current time point.
6 . The method according to claim 5 , further comprising:
acquiring number of the sampled messages whose data signal strength indicator is lower than the preset threshold within a preset duration; and
adjusting the preset threshold according to the number of the sampled messages whose data signal strength indicator is lower than the preset threshold.
7 . The method according to claim 4 , wherein when the signal source and the Bluetooth antenna array are relatively moving, the step of determining a target position angle based on the position angle and a plurality of position angles adjacent to the position angle comprises:
performing, based on preset weights, a weighted average processing on the position angle and the plurality of position angles adjacent to the position angle, to obtain the target position angle at the current time point, wherein a weight value of a position angle corresponding to a time point closer to the current time point is greater, and a weight value of a position angle corresponding to a time point farther away from the current time point is smaller.
8 . The method according to claim 7 , further comprising:
acquiring number of the sampled messages whose data signal strength indicator is lower than the preset threshold within a preset duration; and
adjusting the preset threshold according to the number of the sampled messages whose data signal strength indicator is lower than the preset threshold.
9 . The method according to claim 4 , further comprising:
acquiring number of the sampled messages whose data signal strength indicator is lower than the preset threshold within a preset duration; and
adjusting the preset threshold according to the number of the sampled messages whose data signal strength indicator is lower than the preset threshold.
10 . The method according to claim 1 , further comprising:
acquiring number of the sampled messages whose data signal strength indicator is lower than the preset threshold within a preset duration; and
adjusting the preset threshold according to the number of the sampled messages whose data signal strength indicator is lower than the preset threshold.
11 . An electronic device, comprising a memory and a processor, wherein non-transitory computer-readable instructions are stored in the memory, and the non-transitory computer-readable instructions, when executed by the processor, cause the processor to perform the method according to claim 1 .
12 . The electronic device according to claim 11 , wherein the step of a position angle of the signals is obtained based on the sampled IQ data in the sampled message comprises steps of:
acquiring, based on the sampled IQ data, phase differences between adjacent antennas in the Bluetooth antenna array, to obtain a plurality of phase differences;
acquiring, based on the sampled IQ data, phase differences corresponding to IQ values at different time points corresponding to an identical antenna;
performing, based on the phase differences between the IQ values at different time points corresponding to the identical antenna, a phase compensation processing on the plurality of phase differences; and
obtaining, based on the plurality of phase differences after the phase compensation processing, the position angle at a current time point.
13 . The electronic device according to claim 11 , wherein the method further comprises, before the step of obtaining based on the plurality of phase differences after the phase compensation processing the position angle at a current time point, a step of:
determining that a standard deviation of the plurality of phase differences is smaller than a preset standard deviation threshold.
14 . The electronic device according to claim 11 , wherein the method further comprises, after the step of obtaining the position angle at a current time point, a step of:
determining a target position angle based on the position angle and a plurality of position angles adjacent to the position angle.
15 . The electronic device according to claim 11 , wherein when the signal source and the Bluetooth antenna array are relatively stationary, the step of determining a target position angle based on the position angle and a plurality of position angles adjacent to the position angle comprises:
acquiring a first average value of the position angle and a plurality of position angles adjacent to the position angle; and
removing, among the position angle and the plurality of position angles adjacent to the position angle, an angle whose difference from the first average value is greater than a preset angle threshold, and calculating a second average value of the remaining angles, wherein the second average value is the target position angle at the current time point.
16 . The electronic device according to claim 11 , wherein when the signal source and the Bluetooth antenna array are relatively moving, the step of determining a target position angle based on the position angle and a plurality of position angles adjacent to the position angle comprises:
performing, based on preset weights, a weighted average processing on the position angle and the plurality of position angles adjacent to the position angle, to obtain the target position angle at the current time point, wherein a weight value of a position angle corresponding to a time point closer to the current time point is greater, and a weight value of a position angle corresponding to a time point farther away from the current time point is smaller.
17 . The electronic device according to claim 11 , further comprising:
acquiring number of the sampled messages whose data signal strength indicator is lower than the preset threshold within a preset duration; and
adjusting the preset threshold according to the number of the sampled messages whose data signal strength indicator is lower than the preset threshold.
18 . The method according to claim 1 , further comprising:
acquiring number of the sampled messages whose data signal strength indicator is lower than the preset threshold within a preset duration; and
adjusting the preset threshold according to the number of the sampled messages whose data signal strength indicator is lower than the preset threshold.