Bluetooth distance measurement method, control device and distance measurement equipment

By deploying Bluetooth devices in indoor spaces and calibrating their relative positions and distances, combined with signal transmission time and mapping relationships, the problem of low accuracy of Bluetooth ranging in complex environments is solved, and high-precision and stable indoor ranging effects are achieved.

CN119179067BActive Publication Date: 2025-10-03CHANGSHA FEIYITONG TECHNOLOGY CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411518225.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-10-03
Estimated Expiration
2044-10-29

AI Technical Summary

Technical Problem

Existing Bluetooth ranging methods have low and unstable ranging accuracy in complex indoor environments, making it difficult to meet high-precision requirements and are greatly affected by environmental factors and differences between devices.

Method used

The first Bluetooth and the second Bluetooth are respectively deployed at the measured position in the indoor space. The first Bluetooth is set as the reference position Bluetooth, and its relative spatial position and distance are calibrated. The signal transmission time is obtained through the ranging request signal. The distance is determined by combining the preset time-distance mapping relationship. The clustering algorithm and signal quality evaluation are used to screen the signal transmission time, and the ranging parameters are adjusted to improve accuracy and stability.

Benefits of technology

It achieves high-precision and stable indoor ranging, reduces the impact of environmental factors, improves the accuracy and stability of ranging, and is suitable for positioning and distance measurement in complex indoor environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119179067B_ABST
    Figure CN119179067B_ABST
Patent Text Reader

Abstract

This application proposes a Bluetooth ranging method, control device, and ranging equipment, relating to the field of communications technology. The Bluetooth ranging method includes setting a first Bluetooth as a reference position Bluetooth, setting the first end of the position to be measured as a reference point, and calibrating the relative spatial position and relative spatial distance between the first Bluetooth and the second Bluetooth; after the relative spatial position and relative spatial distance calibration are completed, installing the second Bluetooth to the second end of the position to be measured, and controlling the second Bluetooth to send a ranging request signal to the first Bluetooth; based on the ranging request signal, controlling the first Bluetooth to receive and generate a signal transmission time; and obtaining a first distance corresponding to the signal transmission time based on the signal transmission time and a preset time-distance mapping relationship. This application can achieve high-precision and stable indoor ranging.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a Bluetooth ranging method, a control device, and a ranging device. Background Art

[0002] With the rise of concepts like the Internet of Things and smart cities, indoor positioning technology is playing an increasingly important role in our daily lives and work. In particular, in complex indoor environments like museums, hospitals, large shopping malls, underground parking lots, and mines, the demand for people positioning, object tracking, and area monitoring is growing.

[0003] These scenarios often present complex challenges such as signal obstruction, multipath effects, and signal attenuation. Existing Bluetooth ranging methods primarily rely on changes in signal strength (RSSI) to estimate distance. However, this method is highly susceptible to environmental factors such as obstacles and signal interference, resulting in low and unstable ranging accuracy, making it difficult to meet the requirements for high-precision ranging. Furthermore, RSSI-based ranging also faces issues such as signal strength drift and significant differences between devices, making it difficult to meet the requirements for high-precision indoor positioning. Summary of the Invention

[0004] The main purpose of the present invention is to provide a Bluetooth distance measurement method, aiming to achieve high-precision and stable indoor distance measurement.

[0005] To achieve the above object, the present invention provides a Bluetooth ranging method, which is applied to an indoor space, wherein a first Bluetooth device and a second Bluetooth device are respectively arranged at a first end and a second end of a position to be measured in the indoor space, and the method comprises:

[0006] Setting the first Bluetooth as the reference position Bluetooth, setting the first end of the position to be measured as the reference point, and calibrating the relative spatial position and relative spatial distance between the first Bluetooth and the second Bluetooth;

[0007] After the relative spatial position and the relative spatial distance are calibrated, a second Bluetooth is installed at a second end of the position to be measured, and the second Bluetooth is controlled to send a distance measurement request signal to the first Bluetooth;

[0008] Controlling the first Bluetooth receiver and generating a signal transmission time according to the ranging request signal;

[0009] Acquire a first distance corresponding to the signal transmission time according to the signal transmission time and a preset time-distance mapping relationship;

[0010] The step of controlling the first Bluetooth receiver and generating a signal transmission time according to the ranging request signal includes:

[0011] According to the ranging request signal, control the first Bluetooth to return a ranging permission signal, and control the first Bluetooth to start a timer;

[0012] Controlling the first Bluetooth to continuously receive multiple response signals sent by the second Bluetooth after the timer is started, and recording the transmission time of the multiple response signals;

[0013] Based on the clustering algorithm and the transmission time of the response signal, the duration of the most response signals is screened out as the signal transmission time.

[0014] Optionally, the step of screening out the response signals having the longest duration equal to the signal transmission time based on the clustering algorithm and the transmission time of the response signals comprises:

[0015] Grouping the transmission times of the response signals based on the clustering algorithm to generate a plurality of corresponding transmission duration groups, and determining the number of response signals in each transmission duration group;

[0016] Identify the transmission duration group with the largest number of response signals, and select the transmission time of the corresponding response signal in the transmission duration group as the signal transmission time;

[0017] If there are multiple transmission duration groups with the largest number of response signals, the response signal qualities in each transmission duration group are compared, and the transmission time of the response signal in the transmission duration group with the highest signal quality is determined as the signal transmission time.

[0018] Optionally, if there are multiple transmission duration groups with the largest number of response signals, the step of comparing the quality of the response signals in each of the transmission duration groups and determining the transmission time of the response signal of the transmission duration group with the highest signal quality as the signal transmission time includes:

[0019] If there are multiple transmission duration groups with the largest number of response signals, obtaining the signal strength and signal-to-noise ratio of the response signals in each transmission duration group;

[0020] evaluating the response signal quality in each transmission duration group according to the signal strength and the signal-to-noise ratio;

[0021] Determining a target transmission duration group with the best response signal quality among the transmission duration groups based on the sorting algorithm and the response signal quality in each transmission duration group;

[0022] Determine the transmission time of the response signal corresponding to the target transmission duration group as the signal transmission time.

[0023] Optionally, the step of determining a target transmission duration group having the best response signal quality among the transmission duration groups based on the sorting algorithm and the response signal qualities in each transmission duration group includes:

[0024] Based on the sorting algorithm, the response signal qualities in each transmission duration group are sorted one by one from high to low according to the quality, so as to determine the transmission duration group at the top of the sorting list;

[0025] The transmission duration group at the first place in the sorted list is determined as the target transmission duration group.

[0026] Optionally, the step of setting the first Bluetooth as the reference position Bluetooth includes:

[0027] Obtaining first spatial position coordinates and identification information of the first Bluetooth;

[0028] According to the first spatial position coordinates, setting the position of the first Bluetooth as the origin or reference point of the indoor space;

[0029] According to the identification information, configure the first Bluetooth as a ranging master node;

[0030] After the configuration of the first Bluetooth is completed, calibrating the first spatial position coordinates of the first Bluetooth according to preset reference information so that the first Bluetooth is at the origin;

[0031] According to the configured first Bluetooth and the calibrated first spatial position coordinates, the first Bluetooth is identified as the reference position Bluetooth.

[0032] Optionally, the step of calibrating the relative spatial position and relative spatial distance between the first Bluetooth and the second Bluetooth includes:

[0033] Obtain the second spatial position coordinates of the second Bluetooth;

[0034] Determine the spatial distance and relative orientation of the second Bluetooth relative to the first Bluetooth according to the first spatial position coordinates and the second spatial position coordinates;

[0035] Control the second Bluetooth to send a distance calibration request to the first Bluetooth, and obtain the transmission time of the first Bluetooth receiving and generating a corresponding calibration signal to generate a corresponding test distance;

[0036] Determining a distance deviation according to the spatial distance and the test distance;

[0037] Obtaining a test bearing of the second Bluetooth device relative to the first Bluetooth device based on an angle of arrival method, and comparing the bearing with the relative bearing to determine a bearing deviation;

[0038] Adjust the ranging parameters of the second Bluetooth according to the distance deviation and the orientation deviation to calibrate the relative spatial position and relative spatial distance between the first Bluetooth and the second Bluetooth.

[0039] Optionally, the method further includes:

[0040] Obtain regional environmental factors of the location to be measured;

[0041] A deviation coefficient of the first distance is determined according to the regional environmental factors, and the first distance is corrected according to the deviation coefficient to generate an actual distance.

[0042] Optionally, the method further includes:

[0043] The first Bluetooth is set at the reference point, and the second Bluetooth is set at multiple different spatial positions to generate corresponding multiple signal transmission times;

[0044] determining a target distance of the second Bluetooth device relative to the first Bluetooth device according to the plurality of spatial positions;

[0045] According to the target distance and the corresponding signal transmission time, a mapping relationship between Bluetooth signal transmission time and distance is fitted;

[0046] The mapping relationship is determined to be a preset time-distance mapping relationship.

[0047] In addition, to achieve the above-mentioned purpose, the present invention also provides a control device, which includes: a memory, a processor, and a Bluetooth ranging program stored in the memory and executable on the processor, wherein the Bluetooth ranging program is configured to implement the Bluetooth ranging method described above.

[0048] In addition, to achieve the above-mentioned purpose, the present invention also provides a distance measuring device, including the control device as described above.

[0049] The embodiment of the present invention deploys a first Bluetooth at the first end of the position to be measured in an indoor space, deploys a second Bluetooth at the second end of the position to be measured, sets the first Bluetooth as the reference position Bluetooth, sets the first end of the position to be measured as the reference point, and after the reference position Bluetooth and the reference point are set, calibrates the relative spatial position and relative spatial distance of the first Bluetooth and the second Bluetooth, and after the calibration of the relative spatial position and relative spatial distance is completed, installs the second Bluetooth to the second end of the position to be measured, and after the second Bluetooth is installed, controls the second Bluetooth to send a ranging request signal to the first Bluetooth, and controls the first Bluetooth to receive and generate a signal transmission time according to the ranging request signal, and finally determines the first distance between the first Bluetooth and the second Bluetooth in combination with a preset time-distance mapping relationship, thereby achieving high-precision and stable indoor ranging, and the method is not affected by environmental factors, has high ranging accuracy, and strong stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0052] Figure 1 This is a flowchart of a Bluetooth ranging method according to an embodiment of the present invention;

[0053] Figure 2 for Figure 1 Schematic diagram of the method flow of step S300;

[0054] Figure 3 for Figure 2 Schematic diagram of the method flow of step S330;

[0055] Figure 4 for Figure 3 Schematic diagram of the method flow of step S333;

[0056] Figure 5 for Figure 4 Schematic diagram of the method flow of step S3333;

[0057] Figure 6 for Figure 1 Flow chart of the first part of the method of step S100;

[0058] Figure 7 for Figure 1 Flow chart of the second part of the method of step S100;

[0059] Figure 8 A schematic flow chart of a Bluetooth ranging method according to another embodiment of the present invention;

[0060] Figure 9 This is a flowchart of a Bluetooth ranging method according to another embodiment of the present invention.

[0061] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0062] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments, and the well-known modules, units and their connections, links, communications or operations are not shown or described in detail. In addition, the described features, architectures or functions can be combined in any way in one or more embodiments. It should be understood by those skilled in the art that the various embodiments described below are only for illustration and are not intended to limit the scope of protection of the present invention. It can also be easily understood that the modules or units or processing methods in the various embodiments described herein and shown in the drawings can be combined and designed according to various different configurations. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0063] The definitions of various nouns or methods in the following embodiments, except for those that are logically untenable, are generally based on the broad concepts that can be implemented under the premise of the disclosure in the embodiments. Under such an understanding, the various specific subordinate specific definitions of the nouns or methods should be regarded as the inventive content of the present invention, and should not be narrowly understood or interpreted in a biased manner on the grounds that the specification does not disclose such specific definitions. Similarly, under the premise that it can be logically implemented, the order of the steps in the method is flexible and changeable, and the specific subordinate specific definitions of the broad concepts of various nouns or methods are all within the scope of protection of the present invention.

[0064] The main solution of the embodiment of the present application is: by deploying a first Bluetooth at the first end of the position to be measured in the indoor space, deploying a second Bluetooth at the second end of the position to be measured, and setting the first Bluetooth as the reference position Bluetooth, setting the first end of the position to be measured as the reference point, after the reference position Bluetooth and the reference point are set, calibrating the relative spatial position and relative spatial distance of the first Bluetooth and the second Bluetooth, and after the calibration of the relative spatial position and relative spatial distance is completed, installing the second Bluetooth to the second end of the position to be measured, after the second Bluetooth is installed, controlling the second Bluetooth to send a ranging request signal to the first Bluetooth, and according to the ranging request signal, controlling the first Bluetooth to receive and generate a signal transmission time, and finally determining the first distance between the first Bluetooth and the second Bluetooth in combination with a preset time-distance mapping relationship.

[0065] In this embodiment, for ease of description, the following description will be made with the control device as the execution entity.

[0066] Because existing RSSI-based ranging technologies face problems such as easy drift of signal strength and large differences between devices, they are difficult to meet the needs of high-precision indoor positioning.

[0067] This application provides a solution to achieve high-precision and stable indoor ranging. This method is not affected by environmental factors, has high ranging accuracy, and is highly stable.

[0068] To this end, the present invention proposes a Bluetooth ranging method; it can be understood that a control device for storing and executing the following method is provided in the ranging device, and the control device can be implemented by a main controller, such as an MCU (Microcontroller Unit), a DSP (Digital Signal Process), an FPGA (Field Programmable Gate Array), a SOC (System On Chip), etc.

[0069] It should be understood that the Bluetooth ranging method in the embodiment of the present invention is applied to an indoor space, where a first Bluetooth and a second Bluetooth are respectively deployed at a first end and a second end of a position to be measured.

[0070] Reference Figure 1 , Figure 1 1 is a flow chart of a Bluetooth ranging method according to an embodiment of the present invention. In an embodiment of the present invention, the Bluetooth ranging method includes steps S100-S400, wherein:

[0071] S100, setting the first Bluetooth as the reference position Bluetooth, setting the first end of the position to be measured as the reference point, and calibrating the relative spatial position and relative spatial distance between the first Bluetooth and the second Bluetooth;

[0072] S200: After the relative spatial position and relative spatial distance calibration are completed, the second Bluetooth is installed at the second end of the position to be measured, and the second Bluetooth is controlled to send a distance measurement request signal to the first Bluetooth;

[0073] S300, controlling the first Bluetooth receiver and generating a signal transmission time according to the ranging request signal;

[0074] S400: Acquire a first distance corresponding to the signal transmission time according to the signal transmission time and a preset time-distance mapping relationship.

[0075] In this embodiment, the first Bluetooth is first fixed at a reference point, and then the relative spatial position and relative spatial distance of the first Bluetooth and the second Bluetooth are calibrated. For example, the second Bluetooth is set at the same height directly in front of the first Bluetooth, and the relative spatial distance is 10 meters. Then, the position data and distance data read from the first Bluetooth are obtained, the existing deviation is determined, and correction is performed accordingly.

[0076] In this embodiment, after installing and calibrating the relative spatial positions and distances between the first and second Bluetooth devices, the control device automatically records and stores the calibration results, which serve as baseline data for subsequent distance measurements. Thereafter, regardless of changes in the indoor environment, as long as the second Bluetooth device remains at the second end of the measured position and operates normally, the control device can achieve highly accurate and stable distance measurements based on this calibrated data.

[0077] During the distance measurement process, the control device will first ensure that the communication connection between the first Bluetooth and the second Bluetooth is normal. Then, when the second Bluetooth is at the second end of the position to be measured, the user can start the distance measurement process through an external trigger button or a preset delay time. Once the distance measurement process is started, the second Bluetooth is controlled to send a distance measurement request signal to the first Bluetooth, and the transmission time of the first Bluetooth signal is timed, and the time interval from the distance measurement signal being sent from the second Bluetooth to the first Bluetooth being received is recorded, that is, the signal transmission time. After the signal transmission time is determined, the actual distance is determined in combination with the preset time-distance mapping relationship, and the actual distance can be quickly and accurately obtained. Among them, the time-distance mapping relationship is established by testing and calibrating the signal transmission time and actual distance of the first Bluetooth and the second Bluetooth under ideal conditions, and correcting the distance through empirical methods, so that during actual distance measurement, it is only necessary to compare the measured signal transmission time with the mapping relationship table to quickly and accurately obtain the first distance.

[0078] It is understandable that the present application uses the method of calculating the first Bluetooth reception and generating the signal transmission time. Unlike traditional acoustic ranging, the measurement accuracy of acoustic ranging is greatly affected by the environment (such as temperature, humidity, etc.), and is prone to large errors in multipath environments. Therefore, acoustic ranging is often used in short-range test scenarios with relatively limited measurement ranges, such as robot obstacle avoidance and car reversing radar. In addition, in order to eliminate the influence of multipath effects, current acoustic ranging solutions often need to be combined with wireless signal equipment as an auxiliary implementation. The implementation method is relatively complex and is not conducive to simplifying the test process. Moreover, due to the combination of multiple devices, once any device fails, it will lead to large errors. However, the Bluetooth ranging solution of the present application will not have this problem and is less affected by physical obstacles.

[0079] In addition, since both smart devices and wearable devices at the current stage have Bluetooth modules, and the penetration rate of smart devices is already very high, when using this method, you can use dedicated tools to measure distance, or you can use existing devices at hand to measure distance. For example, the same person has both a mobile phone and a smart watch. He can use the smart watch as the first Bluetooth and the mobile phone as the second Bluetooth to implement the distance measurement method of this application. Or if a person has two mobile phones or two smart watches at the same time, or two people need to measure the relative distance, they only need to start the mobile phone Bluetooth at the same time to perform the test. Compared with measurement methods such as sound waves and infrared, it is more convenient.

[0080] In addition, since this embodiment performs calibration before ranging, it can make measurements more accurate and reliable when devices with Bluetooth functions (e.g., mobile phones) have different hardware (e.g., antenna) configuration conditions and different current service data (e.g., Wi-Fi service data), which may result in different received signal strength values ​​for mobile phones with different hardware configurations or mobile phones under different service data.

[0081] In practical applications, for example, to measure the distance between two corners of an indoor warehouse, a user can fix a first Bluetooth device to one corner as a reference point and install a second Bluetooth device in the other corner. After the Bluetooth devices are properly installed, the first Bluetooth device is controlled to be defined as the reference location Bluetooth. This can be controlled automatically or manually, for example, by programming a power-on code into the first Bluetooth device to automatically set it as the reference location Bluetooth upon startup. Alternatively, the user can manually adjust the reference location Bluetooth. After the first and second Bluetooth devices are calibrated, the user can trigger the distance measurement process using an external trigger button or set a corresponding delay time in the second Bluetooth device. When the second Bluetooth device is activated, the control device begins timing, and after the timer expires, the distance measurement process automatically begins. The control device controls the second Bluetooth device to send a distance measurement request signal to the first Bluetooth device and measures the time interval from the request signal being sent to the first Bluetooth device receiving the signal (e.g., 2 seconds). The control device then determines the first distance between the two Bluetooth devices by combining a preset time-distance mapping relationship. This process can be repeated multiple times to improve the accuracy and stability of the distance measurement. This first distance will accurately reflect the distance between the two corners, thereby providing accurate data support for warehouse management, item positioning, etc. It has the advantages of high precision and high stability and can be applied to ranging needs in various indoor environments.

[0082] In practical applications, it can be applied to the fields of warehousing and logistics. The Bluetooth ranging method implemented in this embodiment can be used to achieve accurate positioning and tracking of goods. For example, by setting the first Bluetooth as a Bluetooth beacon, the first Bluetooth can be used to connect and communicate with multiple second Bluetooths. The first Bluetooth can also be used as a Bluetooth server. Then, the second Bluetooth is placed on the goods. The distance between the Bluetooth tag carried by the goods and the beacon can be measured to determine the specific location of the goods. This helps to improve the efficiency of warehouse management and reduce the risk of goods being lost or misplaced. At the same time, this technology can also be combined with automated handling equipment to achieve automated sorting and handling of goods.

[0083] In practical applications, the Bluetooth ranging method of this embodiment can be applied in smart home scenarios to achieve intelligent linkage and scene control of smart home devices. Each smart home device is equipped with a corresponding primary Bluetooth, and the user's smart terminal's Bluetooth is set as the secondary Bluetooth. For example, by measuring the distance between the user and smart home devices (such as lights, air conditioners, curtains, etc.), the device status can be automatically adjusted to meet the user's needs. When the user approaches a room, the lights can automatically turn on; when the user leaves the room, the lights and air conditioner can automatically turn off to save energy.

[0084] In practical applications, the Bluetooth ranging method implemented in this paper can be used in museums to enhance the visitor experience and ensure the safety of exhibits, thereby achieving accurate positioning of visitors. By setting a first Bluetooth at any location in the museum and setting the first Bluetooth as the museum's Bluetooth beacon, and setting the Bluetooth of the visitor's smart terminal as the second Bluetooth, when the user enters the museum, the Bluetooth of the user's smart terminal is connected to the museum's Bluetooth beacon. By measuring the distance between the Bluetooth device carried by the visitor and the museum's Bluetooth beacon, the visitor's location can be tracked in real time, providing them with personalized guided tours while preventing them from approaching sensitive or fragile exhibits.

[0085] In practical applications, the Bluetooth ranging method implemented in this paper can be used within shopping malls to help customers quickly find public facilities such as stores, restrooms, and elevators. By setting a first Bluetooth beacon at any location within the shopping mall and setting the Bluetooth beacon on the customer's smart terminal as the second Bluetooth beacon, when a customer enters the shopping mall, the Bluetooth on the customer's smart terminal can interact with the shopping mall's Bluetooth beacon, guiding the customer to their destination based on the ranging results. Furthermore, this technology can be used to analyze customer behavior patterns within the shopping mall, providing merchants with a basis for precision marketing.

[0086] Furthermore, to further improve ranging accuracy and stability, this embodiment can also incorporate other sensors or devices, such as inertial measurement units (IMUs), accelerometers, and gyroscopes, to assist in determining the precise location and attitude of Bluetooth devices. These sensors can provide information about the device's motion state, direction, acceleration, and other information, thereby helping the control device more accurately determine the relative position and distance between Bluetooth devices. This can meet the personalized needs of different users and provide effective technical support for indoor positioning, distance measurement, and other fields.

[0087] In addition, when the second Bluetooth sends a ranging request signal to the first Bluetooth, it can also continuously obtain the signal strength of the current ranging request signal. When the signal strength does not meet the preset ranging conditions, multiple Bluetooths for transfer can be deployed in the indoor space, such as the third Bluetooth, the fourth Bluetooth, etc., and the first Bluetooth device can be controlled to send a transfer instruction to the second Bluetooth device, instructing the second Bluetooth to transfer to the third Bluetooth, the fourth Bluetooth, etc., to overcome the problem of low strength, or when there are obstructing objects, the signal blocking problem can be overcome through transfer of the third Bluetooth, the fourth Bluetooth and other devices to improve the ranging accuracy.

[0088] In this embodiment, a first Bluetooth is deployed at the first end of the position to be measured in the indoor space, a second Bluetooth is deployed at the second end of the position to be measured, and the first Bluetooth is set as the reference position Bluetooth, and the first end of the position to be measured is set as the reference point. After the reference position Bluetooth and the reference point are set, the relative spatial position and relative spatial distance of the first Bluetooth and the second Bluetooth are calibrated. After the calibration of the relative spatial position and relative spatial distance is completed, the second Bluetooth is installed to the second end of the position to be measured. After the second Bluetooth is installed, the second Bluetooth is controlled to send a ranging request signal to the first Bluetooth, and according to the ranging request signal, the first Bluetooth is controlled to receive and generate a signal transmission time. Finally, in combination with a preset time-distance mapping relationship, the first distance between the first Bluetooth and the second Bluetooth is determined to achieve high-precision and stable indoor ranging. The method is not affected by environmental factors, has high ranging accuracy, and is highly stable.

[0089] Further, refer to Figure 6 Another embodiment of the present invention provides a Bluetooth distance measurement method based on the above Figure 1 In the illustrated embodiment, the step of setting the first Bluetooth as the reference location Bluetooth includes S1010-S1050, wherein:

[0090] S1010: Obtain first spatial position coordinates and identification information of a first Bluetooth;

[0091] S1020: Setting the position of the first Bluetooth as the origin or reference point of the indoor space according to the first spatial position coordinates;

[0092] S1030. Configure the first Bluetooth as a ranging master node according to the identification information;

[0093] S1040: After the configuration of the first Bluetooth is completed, calibrate the first spatial position coordinates of the first Bluetooth according to the preset reference information so that the first Bluetooth is at the origin;

[0094] S1050: Identify the first Bluetooth as a reference position Bluetooth according to the configured first Bluetooth and the calibrated first spatial position coordinates.

[0095] In this embodiment, the first spatial location coordinates may include the x, y, and z coordinate values ​​of the first Bluetooth device in three-dimensional space. These coordinate values ​​may be obtained through various positioning technologies, such as using the Global Positioning System (GPS) or the Beidou positioning system in combination with indoor map positioning, or using other indoor positioning technologies such as Wi-Fi positioning and ultrasonic positioning. The identification information may be a unique identification code of the first Bluetooth device (such as a MAC address) or a specific identifier set by the user for the first Bluetooth device.

[0096] In this embodiment, based on the acquired first spatial position coordinates, the control device sets the position of the first Bluetooth device as the origin or reference point of the indoor space. This serves as the reference point for all distance measurements, and the positions of other Bluetooth devices or objects are determined relative to the first Bluetooth device. The control device then configures the first Bluetooth device as the primary distance measurement node based on the set origin or reference point and identification information. The configuration process may include setting specific operating modes, parameters, and communication protocols for the first Bluetooth device to ensure it can function as the primary distance measurement device and communicate and exchange data with other Bluetooth devices. After configuration is complete, the first spatial position coordinates of the first Bluetooth device are calibrated based on preset reference information. This step ensures the accuracy of the first Bluetooth device's position coordinates, serving as a reference for subsequent distance measurements. The preset reference information may include known indoor map information, known reference point locations, and other information. By comparing and correcting this information with the known indoor map information, more accurate first Bluetooth device position coordinates can be obtained. Finally, based on the configured first Bluetooth device and the calibrated first spatial position coordinates, the first Bluetooth device is identified as the reference location Bluetooth device. This way, throughout the entire distance measurement process, the first Bluetooth device serves as the reference point, and the positions of other Bluetooth devices or objects are determined relative to the first Bluetooth device, ensuring the accuracy and stability of distance measurements. The control device identifies the first Bluetooth device as the reference location Bluetooth. This method of setting the reference location Bluetooth is not only simple and easy, but also ensures a clear and unique reference point for ranging, improving the accuracy and stability of ranging. Because the reference location Bluetooth is set using spatial coordinates and identification information, it can also adapt to various complex indoor environments.

[0097] In actual application, a GPS or Beidou positioning device is installed on the first Bluetooth device to locate it. The indoor floor is set as the z-axis origin, and a corner of the room is set as the x- and y-axis origins. For example, the southwest corner of the room is set as the three-dimensional origin. The first Bluetooth device is then installed at one end of a location in the indoor space to be tested. After installation, the first Bluetooth device is activated. The control device then obtains the x, y, and z coordinates of the first Bluetooth device in three-dimensional space, as well as its unique identification code (MAC address). Based on these coordinates and unique identification code, the control device then sets the first Bluetooth device as the reference point in the indoor space and configures it as the ranging master node. Simultaneously, the first Bluetooth device's location coordinates are calibrated based on pre-set indoor map information and known reference point locations to ensure accuracy. Finally, the first Bluetooth device is officially identified as the reference location Bluetooth device. When setting the reference location Bluetooth device, in addition to using spatial location coordinates and identification information, multiple data sources such as indoor map information and environmental obstacle information can be combined for more refined configuration. For example, when setting the first Bluetooth as the reference location Bluetooth, possible obstacles such as walls and pillars in indoor environments can be taken into account, and these obstacles can be avoided as reference points for ranging, thereby reducing errors and interference. In other words, all ranging operations will be performed based on the first Bluetooth as the reference, so that the ranging results have a unified reference base.

[0098] Further, refer to Figure 7 Another embodiment of the present invention provides a Bluetooth distance measurement method based on the above Figure 6 In the illustrated embodiment, the step of calibrating the relative spatial position and relative spatial distance of the first Bluetooth and the second Bluetooth includes S1060-S1110, wherein:

[0099] S1060: Obtain the second spatial position coordinates of the second Bluetooth;

[0100] S1070: Determine the spatial distance and relative orientation of the second Bluetooth device relative to the first Bluetooth device based on the first spatial position coordinates and the second spatial position coordinates;

[0101] S1080: Control the second Bluetooth to send a distance calibration request to the first Bluetooth, and obtain the transmission time of the first Bluetooth receiving and generating the corresponding calibration signal to generate a corresponding test distance;

[0102] S1090. Determine a distance deviation based on the spatial distance and the test distance;

[0103] S1100: Obtain a test direction of the second Bluetooth device relative to the first Bluetooth device based on an angle of arrival method, and compare the direction with the relative direction to determine a direction deviation.

[0104] S1110: Adjust the ranging parameters of the second Bluetooth according to the distance deviation and the azimuth deviation to calibrate the relative spatial position and relative spatial distance between the first Bluetooth and the second Bluetooth.

[0105] In this implementation, after the first Bluetooth is set as the reference Bluetooth, the user can optionally install the second Bluetooth at a calibration test location. This calibration test location can be any known coordinate location in the indoor space, but is typically located close to the first Bluetooth and easily accessible for measurement. Unlike the first Bluetooth, the second Bluetooth's precise three-dimensional coordinate position is located in a coordinate system based on the spatial coordinates of the first Bluetooth as its origin. Its spatial position is relative to the first Bluetooth. The second Bluetooth is placed at a predetermined location with known spatial coordinates, allowing its precise three-dimensional position to be determined.

[0106] The second spatial location coordinates may include the x, y, and z coordinates of the second Bluetooth device in three-dimensional space. These coordinates may be obtained using similar positioning technology as the first Bluetooth device. Since we are primarily concerned with the relative position and distance between the first Bluetooth device and the second Bluetooth device, the accuracy of these coordinates does not need to be as high as that of the first Bluetooth device.

[0107] After determining the spatial coordinates of the first and second Bluetooth devices, these coordinates can be used to calculate the spatial distance and relative orientation of the second Bluetooth device relative to the first. This calculation can be accomplished using simple three-dimensional geometry formulas, such as the Euclidean distance formula to calculate the straight-line distance between two points, and methods such as the direction cosine theorem or quaternions to determine relative orientation.

[0108] The second Bluetooth device sends a distance calibration request to the first Bluetooth device. This request includes the second Bluetooth device's current timestamp and a unique calibration request identifier. Upon receiving this request, the first Bluetooth device immediately records the reception timestamp and generates a corresponding calibration signal, which also includes the current timestamp and request identifier. The first Bluetooth device then sends this calibration signal back to the second Bluetooth device. Upon receiving the calibration signal, the second Bluetooth device calculates the total signal transmission time (i.e., the time difference between sending the calibration request and receiving the calibration signal). Since the speed of signal propagation in air is known, the second Bluetooth device can use this time difference to calculate the test distance between itself and the first Bluetooth device. This test distance is estimated based on the signal transmission time, but due to various factors (such as signal attenuation and multipath effects), this distance may deviate from the actual distance.

[0109] The spatial distance calculated based on the known spatial coordinates of the first and second Bluetooth devices (called the first distance) is then compared with the test distance to determine the distance deviation. This deviation reflects possible errors in the hardware or algorithm of our ranging system.

[0110] In addition, the orientation of the second Bluetooth device relative to the first Bluetooth device needs to be calibrated. This can be achieved using the Angle of Arrival (AOA) method. The Angle of Arrival method is a technology that uses a multi-antenna array to receive signals and estimates the direction of signal arrival by measuring the phase difference between the signals arriving at each antenna. In this embodiment, the control device can install multiple antennas on the first Bluetooth device and measure the phase difference between the signals sent by the second Bluetooth device arriving at these antennas, thereby estimating the orientation of the second Bluetooth device relative to the first Bluetooth device. This test orientation is compared with the relative orientation calculated using the spatial position coordinates in step S1070 to determine the orientation deviation.

[0111] Finally, the control device adjusts the ranging parameters of the second Bluetooth device based on the distance and azimuth deviations. These parameters may include signal transmission power, receiving sensitivity, antenna gain, and other parameters. By adjusting these parameters, ranging errors can be significantly reduced and ranging accuracy improved. Furthermore, this calibration process can be repeated regularly to adapt to changes in the indoor environment (such as the movement of people and changes in furniture placement) that may affect ranging accuracy, ensuring sufficient accuracy and stability in the relative position and distance measurements between the first and second Bluetooth devices.

[0112] In actual application, the calibration process can be performed automatically after the device is installed, or it can be triggered manually by the user. In automatic calibration mode, the control device will automatically obtain the coordinates of the second spatial position to calculate the spatial distance and relative orientation, and automatically send a distance calibration request to generate the corresponding test distance and determine the distance deviation. It can also automatically determine the orientation deviation based on the arrival angle method, and finally adjust the ranging parameters of the second Bluetooth to calibrate the relative spatial position and relative spatial distance. In manual calibration mode, the user can trigger the calibration operation at any time as needed, and complete the calibration process according to the prompts of the control device. By using real-time data to calibrate the relative position and distance, the accuracy and stability of Bluetooth ranging can be improved to meet the personalized needs of users in different scenarios.

[0113] Further, refer to Figure 2 Another embodiment of the present invention provides a Bluetooth distance measurement method based on the above Figure 1 In the illustrated embodiment, the steps of controlling the first Bluetooth receiver and generating the signal transmission time according to the ranging request signal include S310-S330, wherein:

[0114] S310: Control the first Bluetooth to return a ranging permission signal according to the ranging request signal, and control the first Bluetooth to start a timer;

[0115] S320: Control the first Bluetooth to continuously receive multiple response signals sent by the second Bluetooth after the timer starts, and record the transmission time of the multiple response signals;

[0116] S330 : Based on the clustering algorithm and the transmission time of the response signal, the duration of the most response signals is selected as the signal transmission time.

[0117] In this embodiment, the ranging request signal can be triggered by the user via an external trigger component, or automatically by the control device after reading the status of the first and second Bluetooth devices. When the first Bluetooth device receives the ranging request signal, it first returns a ranging permission signal, informing the second Bluetooth device that it can begin sending a response signal. At the same time, the first Bluetooth device starts an internal timer to record the time from receiving the ranging request signal to receiving the second Bluetooth device's response signal.

[0118] After the timer starts, the first Bluetooth will continue to receive multiple response signals from the second Bluetooth. Due to the complexity of the indoor environment, such as the presence of objects like walls and furniture, as well as the characteristics of Bluetooth signals, such as signal attenuation and multipath effects, the response signals sent by the second Bluetooth may reach the first Bluetooth via different paths, resulting in time differences in the received response signals.

[0119] To identify the most accurate signal transmission time from multiple response signals, the present invention employs a clustering algorithm. A clustering algorithm is an unsupervised learning method that clusters similar data points. In this embodiment, the clustering algorithm clusters response signals based on their transmission time, grouping response signals with similar transmission times into the same cluster and assuming that the response signals in this cluster represent the most direct signal transmission path.

[0120] The control device then selects the cluster containing the most response signals from these clusters, deeming the response signals in this cluster to represent the most reliable signal transmission path. Finally, the average or median transmission time of the response signals in this cluster is taken as the final signal transmission time. This effectively accounts for variations in response signal transmission times due to the complexity of indoor environments and the characteristics of Bluetooth signals, thereby selecting the most accurate signal transmission time. This not only improves the accuracy of Bluetooth ranging, but also enhances its stability and reliability.

[0121] It should be noted that the clustering algorithm in this embodiment is only an exemplary method. In actual applications, other suitable algorithms or methods may be selected to screen and calculate signal transmission time according to specific requirements and environmental characteristics.

[0122] Further, refer to Figure 3 Another embodiment of the present invention provides a Bluetooth distance measurement method based on the above Figure 2 In the embodiment shown, based on the clustering algorithm and the transmission time of the response signal, the step of screening out the response signal with the longest duration equal to the signal transmission time includes S331-S333, wherein:

[0123] S331. Grouping the transmission time of the response signals based on a clustering algorithm to generate a plurality of corresponding transmission duration groups, and determining the number of response signals in each transmission duration group;

[0124] S332, identifying the transmission duration group with the largest number of response signals, and selecting the transmission time of the corresponding response signal in the transmission duration group as the signal transmission time;

[0125] S333: If there are multiple transmission duration groups with the largest number of response signals, compare the response signal qualities in each transmission duration group and determine the transmission time of the response signal in the transmission duration group with the highest signal quality as the signal transmission time.

[0126] In this implementation, the transmission times are first grouped to create corresponding transmission duration groups. These groups can then be divided using a clustering algorithm based on transmission time differences. For example, response signals with transmission times within a certain range can be grouped together. Next, the number of response signals within each transmission duration group is counted to determine which group has the most response signals. This step helps identify which transmission time periods have the highest concentration of response signals, making them more likely to represent the actual signal transmission path.

[0127] However, in actual applications, multiple transmission duration groups may have the same number of response signals. In this case, it's important to consider not only the number of response signals but also their quality. Therefore, after identifying the transmission duration groups with the largest number of response signals, it's necessary to further compare the quality of the response signals within these groups. Response signal quality can be measured through factors such as signal strength, stability, and consistency.

[0128] In this embodiment, the transmission duration group with the highest signal strength, best stability, and strongest consistency can be selected as the final signal transmission time. By comprehensively considering the quantity and quality of response signals, the most reliable signal transmission time can be more accurately screened. This not only improves the accuracy of Bluetooth ranging, but also enhances the stability and reliability of ranging. Especially in complex indoor environments where Bluetooth signals are subject to interference, this method can effectively eliminate interference and ensure the accuracy of ranging results.

[0129] Further, refer to Figure 4Another embodiment of the present invention provides a Bluetooth distance measurement method based on the above Figure 3 In the illustrated embodiment, if there are multiple transmission duration groups with the largest number of response signals, the steps of comparing the quality of the response signals in each transmission duration group and determining the transmission time of the response signal of the transmission duration group with the highest signal quality as the signal transmission time include S3331-S3334, wherein:

[0130] S3331. If there are multiple transmission duration groups with the largest number of response signals, obtain the signal strength and signal-to-noise ratio of the response signals in each transmission duration group;

[0131] S3332. Evaluate the response signal quality in each transmission duration group based on the signal strength and signal-to-noise ratio;

[0132] S3333. Determine a target transmission duration group with the best response signal quality among the transmission duration groups based on the sorting algorithm and the response signal quality in each transmission duration group.

[0133] S3334. Determine the transmission time of the response signal corresponding to the target transmission duration group as the signal transmission time.

[0134] In this implementation, when multiple transmission duration groups have the same number of transmission durations, the signal quality is evaluated based on the response signal's signal strength and signal-to-noise ratio. Signal strength reflects the signal's transmission capability and penetration, while the signal-to-noise ratio reflects the degree of interference encountered during transmission. Higher signal strength and a higher signal-to-noise ratio indicate better signal quality and a higher likelihood of representing the true signal transmission path.

[0135] In addition, in order to more accurately evaluate the signal quality, the response signal quality is sorted by using a sorting algorithm. Sorting algorithm is a commonly used data processing method that can arrange data in a certain order based on one or more characteristic values ​​of the data.

[0136] In this embodiment, a sorting algorithm is used to sort the response signal quality based on the signal strength and signal-to-noise ratio of the response signals in each transmission duration group. The sorting result helps us determine which transmission duration group has the best response signal quality, thereby determining the final signal transmission time.

[0137] The average signal strength and signal-to-noise ratio of the response signals in each transmission duration group can be calculated first, and then these two averages can be used as evaluation indicators for the signal quality of the transmission duration group. Then, a sorting algorithm, such as bubble sort or quick sort, can be used to sort the transmission duration groups based on these evaluation indicators. The sorted results are arranged in descending order of signal quality, allowing the control device to easily select the transmission duration group with the highest signal quality as the target transmission duration group and use the corresponding response signal transmission time as the final signal transmission time. This can effectively eliminate interference and improve the accuracy and stability of Bluetooth ranging.

[0138] Further, refer to Figure 5 Another embodiment of the present invention provides a Bluetooth distance measurement method based on the above Figure 4 In the illustrated embodiment, the step of determining a target transmission duration group having the best response signal quality among the transmission duration groups based on the sorting algorithm and the response signal quality in each transmission duration group includes S33331-S33332, wherein:

[0139] S33331. Based on a sorting algorithm, sort the response signal qualities in each transmission duration group one by one from high to low in order of quality, to determine a transmission duration group at the top of the sorting list;

[0140] S33332. Determine the transmission duration group at the first position in the sorted list as the target transmission duration group.

[0141] In this embodiment, the application of the sorting algorithm is to ensure that we can select the best one from multiple possible signal transmission times. The control device first sorts the response signal quality in each transmission duration group from high to low according to quality. The sorting process takes into account multiple factors such as signal strength, stability, consistency, etc., and calculates a comprehensive signal quality evaluation value based on these factors. This process ensures that the signals in all transmission duration groups are accurately sorted according to their quality. Then directly select the transmission duration group at the top of the sorting list as the target transmission duration group. This is because the first place in the sorting list represents the transmission duration group with the highest signal quality, and its response signal is most likely to represent the actual signal transmission path. Selecting this group as the target transmission duration group can more accurately determine the signal transmission time, thereby further improving the accuracy and reliability of Bluetooth ranging.

[0142] Furthermore, in practical applications, the choice of sorting algorithm may be adjusted based on specific needs and scenarios. For example, in situations where time efficiency is paramount, a sorting algorithm with lower time complexity may be chosen; in situations where high precision is required, an algorithm with better sorting performance may be selected. Regardless of the algorithm chosen, its core purpose is to more accurately determine signal transmission time, thereby improving Bluetooth ranging performance. This effectively eliminates interference, improves the accuracy and stability of Bluetooth ranging, and adapts to a variety of environments and scenarios. This makes our Bluetooth ranging method more applicable and flexible, capable of meeting the needs of a wider range of fields and scenarios.

[0143] Further, refer to Figure 8 Another embodiment of the present invention provides a Bluetooth distance measurement method based on the above Figure 1 In the illustrated embodiment, the Bluetooth ranging method further includes S500-S600, wherein:

[0144] S500, obtaining regional environmental factors of the location to be measured;

[0145] S600: Determine a deviation coefficient of the first distance based on regional environmental factors, and correct the first distance according to the deviation coefficient to generate an actual distance.

[0146] In this implementation, Figure 1 The first distance in the illustrated embodiment is obtained without considering any interference from environmental factors. However, since Bluetooth may be interfered with by environmental factors during the distance measurement process, the regional environmental factors of the location to be measured, that is, the regional environmental factors where the first Bluetooth and the second Bluetooth are located, are obtained, and combined with these environmental factors to correct the first distance, thereby generating the actual distance. The deviation coefficient can be obtained by statistically analyzing a large amount of experimental data, or by using a mathematical model for prediction based on the changing patterns of environmental factors. The magnitude of the deviation coefficient reflects the degree of influence of environmental factors on the accuracy of Bluetooth distance measurement. After determining the deviation coefficient, the first distance value is multiplied by the deviation coefficient to obtain the corrected actual distance. This actual distance value takes into account the interference of environmental factors and is therefore closer to the true distance value.

[0147] It should be noted that in actual applications, the changes in environmental factors are complex and changeable, so the determination of the deviation coefficient also needs to be adjusted and optimized according to actual conditions.

[0148] In this implementation, the location being measured is indoors, where factors such as multipath and signal attenuation may affect the signal. Regional environmental factors include, but are not limited to, temperature, humidity, air pressure, building materials, and obstacles. These factors can affect the propagation speed and path of Bluetooth signals, thereby affecting the accuracy of Bluetooth ranging. Therefore, when determining the actual distance, it is necessary to fully consider these regional environmental factors and adjust the initial distance.

[0149] First, a sensor or other detection device is used to obtain environmental factors of the area to be measured, such as temperature and humidity. Then, based on the obtained environmental factors and the pre-set correspondence between environmental factors and signal propagation characteristics, the first distance is corrected. For example, when the temperature rises, the air density decreases, and the signal propagation speed may increase, so the first distance needs to be reduced accordingly. Conversely, when the temperature drops, the first distance needs to be increased.

[0150] Furthermore, factors such as building materials and structures, as well as indoor obstacles, can also affect Bluetooth signal propagation. For example, metal obstacles can absorb or reflect Bluetooth signals, altering the signal propagation path and affecting ranging accuracy. Therefore, when revising the initial distance, these factors must be considered and adjusted accordingly to obtain a more accurate actual distance. This effectively eliminates interference from the indoor environment on Bluetooth ranging, improving ranging accuracy and stability.

[0151] In actual application, for example, the distance between two locations in an indoor space needs to be measured, but there is a 6-centimeter brick wall between the two locations. At this time, due to the existence of the brick wall, the measured first distance will have a large deviation. For example, the actual distance is 1 meter, but due to the interference of the brick wall, the first distance measured is approximately 85 centimeters. At this time, it is necessary to correct the missing 15 centimeters of distance. At this time, the 15-centimeter distance deviation can be corrected according to the deviation coefficient of the wall on the Bluetooth signal transmission time, so as to obtain a true actual distance.

[0152] In actual applications, for example, if the distance between two locations in an indoor space needs to be measured, the distance is measured under the originally set environmental conditions of 25°C and 40% relative humidity. However, if the test is to be measured at 40°C and 30% relative humidity, the deviation coefficient needs to be determined; because changes in temperature and humidity will affect the propagation characteristics of the Bluetooth signal, thereby affecting the ranging results. Among them, the increase in temperature may cause the air density to decrease, thereby accelerating the signal propagation speed, while the increase in humidity may cause the signal attenuation to increase. Because when the temperature increases significantly and the relative humidity decreases, the signal propagation speed increases and the signal attenuation slows down. At this time, the propagation time needs to be corrected. After determining the proportional relationship between the changed temperature and the temperature change and the signal propagation time, the measured distance is adjusted. For example, the distance measured under the set temperature of 25°C and the relative humidity of 40% is 10 meters, but the distance measured under the temperature of 40°C and the relative humidity of 30% is 15 meters. At this time, the distance of 15 meters needs to be reduced accordingly to achieve the standard distance range of 10 meters, so that the distance can be measured more accurately and reliably.

[0153] Further, refer to Figure 9 Another embodiment of the present invention provides a Bluetooth distance measurement method based on the above Figures 1 to 7 As shown in any embodiment, the Bluetooth ranging method further includes S700-S1000, wherein:

[0154] S700, setting the first Bluetooth at a reference point and the second Bluetooth at multiple different spatial positions to generate corresponding multiple signal transmission times;

[0155] S800: Determine a target distance of the second Bluetooth device relative to the first Bluetooth device based on multiple spatial positions;

[0156] S900: fitting a mapping relationship between Bluetooth signal transmission time and distance based on the target distance and the corresponding signal transmission time;

[0157] S1000: Determine that the mapping relationship is a preset time-distance mapping relationship.

[0158] In this embodiment, by placing the second Bluetooth at multiple different spatial positions and recording the signal transmission time at each position, a detailed data set of the relationship between Bluetooth signal transmission time and spatial position can be generated. This data set contains the time required for the Bluetooth signal to be transmitted from the first Bluetooth to the second Bluetooth at various spatial positions. Next, these data points can be used to establish a mapping relationship between Bluetooth signal transmission time and distance through mathematical methods such as linear regression, polynomial fitting or nonlinear fitting. The fitted mapping relationship can reflect the propagation characteristics of the Bluetooth signal in a specific environment, including the impact of factors such as signal attenuation and multipath effects on the signal transmission time. This mapping relationship will serve as an important reference in the subsequent ranging process and is used to convert the signal transmission time into the actual distance.

[0159] Furthermore, due to the complexity and variability of indoor environments, the fitted mapping relationship may need to be updated and adjusted at different time periods or under different environmental conditions. Therefore, in practical applications, the Bluetooth signal transmission time measurement and mapping relationship fitting can be re-performed based on the current environmental changes to ensure the accuracy and reliability of the ranging results.

[0160] After the mapping relationship is fitted, it can be stored in the control device or a related database, forming a preset time-distance mapping relationship, which can be quickly called up and queried during subsequent Bluetooth ranging processes. In this way, whenever Bluetooth ranging is required, the control device only needs to find the corresponding actual distance in the mapping relationship based on the measured signal transmission time, eliminating the need for complex calculations and corrections, greatly improving the efficiency and accuracy of ranging.

[0161] Among them, after the preset time-distance mapping relationship is fitted, the size of the data packet transmitted during ranging is fixed and known, and the data transmission rate in the indoor space is also fixed and known. When in use, for example, when the time is 0.4 milliseconds, the control device will import 0.4 milliseconds of data into the preset time-distance mapping relationship for query, and find the distance corresponding to 0.4 milliseconds, for example, 10 meters; if the time is 1 millisecond, the control device will import 1 millisecond of data into the preset time-distance mapping relationship for query, to find the distance corresponding to 1 millisecond, for example, 25 meters, so that the precise position of Bluetooth in the ranging process can be determined quickly and accurately, greatly improving the efficiency and accuracy of ranging.

[0162] The present invention also proposes a control device, which includes: the control device includes: a memory, a processor, and a Bluetooth ranging program stored in the memory and executable on the processor, wherein the Bluetooth ranging program is configured to implement the above Bluetooth ranging method.

[0163] It is worth noting that since the control device of the present invention is based on the above-mentioned Bluetooth ranging method, the embodiments of the control device of the present invention include all technical solutions of all embodiments of the above-mentioned Bluetooth ranging method, and the technical effects achieved are also exactly the same, which will not be repeated here.

[0164] The present invention also provides a distance measuring device, which includes the control device according to the above embodiment.

[0165] It is worth noting that since the distance measuring device of the present invention is based on the above-mentioned control device, the embodiments of the distance measuring device of the present invention include all technical solutions of all embodiments of the above-mentioned control device, and the technical effects achieved are also exactly the same, which will not be repeated here.

[0166] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.

[0167] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0168] Through the above description of the embodiments, those skilled in the art will clearly understand that the methods of the above embodiments can be implemented using software plus the necessary general-purpose hardware platform. Of course, hardware can also be used, but in many cases the former is a more preferred implementation method. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, or optical disk) as described above and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0169] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A Bluetooth ranging method, applied to an indoor space, wherein a first Bluetooth and a second Bluetooth are respectively arranged at a first end and a second end of a position to be measured in the indoor space, characterized in that: The method comprises: Setting the first Bluetooth as the reference position Bluetooth, setting the first end of the position to be measured as the reference point, and calibrating the relative spatial position and relative spatial distance between the first Bluetooth and the second Bluetooth; After the relative spatial position and the relative spatial distance are calibrated, a second Bluetooth is installed at a second end of the position to be measured, and the second Bluetooth is controlled to send a distance measurement request signal to the first Bluetooth; Controlling the first Bluetooth receiver and generating a signal transmission time according to the ranging request signal; Acquire a first distance corresponding to the signal transmission time according to the signal transmission time and a preset time-distance mapping relationship; The step of controlling the first Bluetooth receiver and generating a signal transmission time according to the ranging request signal includes: According to the ranging request signal, control the first Bluetooth to return a ranging permission signal, and control the first Bluetooth to start a timer; Controlling the first Bluetooth to continuously receive multiple response signals sent by the second Bluetooth after the timer is started, and recording the transmission time of the multiple response signals; Based on the clustering algorithm and the transmission time of the response signal, the duration of the most response signals is selected as the signal transmission time; The step of screening out the response signals having the longest duration equal to the signal transmission time based on the clustering algorithm and the transmission time of the response signals comprises: Grouping the transmission times of the response signals based on the clustering algorithm to generate a plurality of corresponding transmission duration groups, and determining the number of response signals in each transmission duration group; Identify the transmission duration group with the largest number of response signals, and select the transmission time of the corresponding response signal in the transmission duration group as the signal transmission time; If there are multiple transmission duration groups with the largest number of response signals, compare the response signal qualities in each of the transmission duration groups, and determine the transmission time of the response signal of the transmission duration group with the highest signal quality as the signal transmission time; The method further comprises: Obtain regional environmental factors of the location to be measured; A deviation coefficient of the first distance is determined according to the regional environmental factors, and the first distance is corrected according to the deviation coefficient to generate an actual distance.

2. The Bluetooth distance measurement method according to claim 1, wherein: If there are multiple transmission duration groups with the largest number of response signals, the step of comparing the quality of the response signals in the transmission duration groups and determining the transmission time of the response signal of the transmission duration group with the highest signal quality as the signal transmission time includes: If there are multiple transmission duration groups with the largest number of response signals, obtaining the signal strength and signal-to-noise ratio of the response signals in each transmission duration group; evaluating the response signal quality in each transmission duration group according to the signal strength and the signal-to-noise ratio; Determining a target transmission duration group with the best response signal quality among the transmission duration groups based on the sorting algorithm and the response signal quality in each transmission duration group; Determine the transmission time of the response signal corresponding to the target transmission duration group as the signal transmission time.

3. The Bluetooth distance measurement method according to claim 2, wherein: The step of determining a target transmission duration group with the best response signal quality among the transmission duration groups based on the sorting algorithm and the response signal quality in each transmission duration group includes: Based on the sorting algorithm, the response signal qualities in each transmission duration group are sorted one by one from high to low according to the quality, so as to determine the transmission duration group at the top of the sorting list; The transmission duration group at the first place in the sorted list is determined as the target transmission duration group.

4. The Bluetooth distance measurement method according to claim 1, wherein: The step of setting the first Bluetooth as the reference position Bluetooth includes: Obtaining first spatial position coordinates and identification information of the first Bluetooth; According to the first spatial position coordinates, setting the position of the first Bluetooth as the origin or reference point of the indoor space; According to the identification information, configure the first Bluetooth as a ranging master node; After the configuration of the first Bluetooth is completed, calibrating the first spatial position coordinates of the first Bluetooth according to preset reference information so that the first Bluetooth is at the origin; According to the configured first Bluetooth and the calibrated first spatial position coordinates, the first Bluetooth is identified as the reference position Bluetooth.

5. The Bluetooth distance measurement method according to claim 4, characterized in that: The step of calibrating the relative spatial position and relative spatial distance between the first Bluetooth and the second Bluetooth includes: Obtain the second spatial position coordinates of the second Bluetooth; Determine the spatial distance and relative orientation of the second Bluetooth relative to the first Bluetooth according to the first spatial position coordinates and the second spatial position coordinates; Control the second Bluetooth to send a distance calibration request to the first Bluetooth, and obtain the transmission time of the first Bluetooth receiving and generating a corresponding calibration signal to generate a corresponding test distance; Determining a distance deviation according to the spatial distance and the test distance; Obtaining a test bearing of the second Bluetooth device relative to the first Bluetooth device based on an angle of arrival method, and comparing the bearing with the relative bearing to determine a bearing deviation; Adjust the ranging parameters of the second Bluetooth according to the distance deviation and the orientation deviation to calibrate the relative spatial position and relative spatial distance between the first Bluetooth and the second Bluetooth.

6. The Bluetooth distance measurement method according to any one of claims 1 to 5, characterized in that: The method further comprises: The first Bluetooth is set at the reference point, and the second Bluetooth is set at multiple different spatial positions to generate corresponding multiple signal transmission times; determining a target distance of the second Bluetooth device relative to the first Bluetooth device according to the plurality of spatial positions; According to the target distance and the corresponding signal transmission time, a mapping relationship between Bluetooth signal transmission time and distance is fitted; The mapping relationship is determined to be a preset time-distance mapping relationship.

7. A control device, characterized in that: The control device includes: a memory, a processor, and a Bluetooth ranging program stored in the memory and executable on the processor, wherein the Bluetooth ranging program is configured to implement the Bluetooth ranging method according to any one of claims 1 to 6.

8. A distance measuring device, characterized in that: Comprising the control device as claimed in claim 7.

Citation Information

Patent Citations

  • Bluetooth distance measuring method and Bluetooth equipment

    CN111741424A

  • Three-dimensional imaging system and method for fusing single-photon laser radar and short-wave infrared image

    CN112731443A

  • Unmanned vehicle positioning method based on TOF ranging and terminal

    CN117761724A

  • Ultrasonic type device for detecting distance

    JP1994300833A