Bluetooth distance measurement method, control device and distance measurement equipment
By calibrating the relative position and distance of Bluetooth devices in indoor space, combining signal transmission time and time-distance mapping relationship, using clustering and sorting algorithms, the problem of low accuracy of Bluetooth ranging in complex environments is solved, and high accuracy is achieved and stable indoor distance measurement.
Patent Information
- Application Number
- CN202411518225.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2044-10-29
AI Technical Summary
The existing Bluetooth ranging method is easily affected by environmental factors in complex indoor scenarios, resulting in low and unstable distance measurement accuracy, making it difficult to meet high-precision requirements.
By arranging the first Bluetooth and the second Bluetooth in the indoor space, setting the first Bluetooth as the reference position Bluetooth, calibrating its relative spatial position and distance, and using the signal transmission time and the preset time-distance mapping relationship, combining clustering and sorting algorithm filter signal transmission time to achieve high-precision distance measurement.
It realizes high-precision and stable indoor distance measurement, reduces the influence of environmental factors, and improves distance measurement accuracy and stability.
Smart Images

Figure CN119179067A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a Bluetooth distance measurement method, a control device and a distance measurement device. Background Art
[0002] With the rise of concepts such as the Internet of Things and smart cities, indoor positioning technology plays an increasingly important role in daily life and work. Especially in complex indoor scenes such as museums, hospitals, large shopping malls, underground parking lots, mines, etc., the demand for personnel positioning, object tracking and area monitoring is growing.
[0003] These scenarios often have complex problems such as signal blocking, multipath effects, and signal attenuation. However, the existing Bluetooth ranging method mainly relies on the change of signal strength (RSSI) to estimate the distance, but this method is extremely susceptible to environmental factors in the above scenarios, such as obstacles and signal interference, resulting in low ranging accuracy and instability, making it difficult to meet the needs of high-precision ranging. In addition, ranging based on RSSI also faces problems such as easy drift of signal strength and large differences between devices, making it difficult to meet the needs of 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 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, and 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; When the relative spatial position and the relative spatial distance are calibrated, 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; According to the ranging request signal, control the first Bluetooth to receive and generate a signal transmission time; According to the signal transmission time and a preset time-distance mapping relationship, obtaining a first distance corresponding to the signal transmission time; The step of controlling the first Bluetooth receiving and generating a signal transmission time according to the ranging request signal comprises: 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 screened out as the signal transmission time.
[0006] Optionally, the step of screening out the response signals having the longest duration as the signal transmission time based on the clustering algorithm and the transmission time of the response signals comprises: Grouping the transmission time 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 time length groups with the largest number of response signals, the response signal qualities in each transmission time length group are compared, and the transmission time of the response signal in the transmission time length group with the highest signal quality is determined as the signal transmission time.
[0007] 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: 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; evaluating the quality of the response signal in each transmission duration group according to the signal strength and the signal-to-noise ratio; Based on the sorting algorithm and the response signal quality in each transmission duration group, determining a target transmission duration group with the best response signal quality in the transmission duration groups; Determine the transmission time of the response signal corresponding to the target transmission duration group as the signal transmission time.
[0008] Optionally, the step of determining a target transmission duration group with the best response signal quality in 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 position in the sorted list is determined as the target transmission duration group.
[0009] Optionally, the step of setting the first Bluetooth as the reference location Bluetooth includes: Acquire the 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; When the first Bluetooth is configured, 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.
[0010] Optionally, 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; Based on the arrival angle method, obtain the test azimuth of the second Bluetooth relative to the first Bluetooth, and compare it with the relative azimuth to determine the azimuth deviation; According to the distance deviation and the azimuth deviation, the ranging parameters of the second Bluetooth are adjusted to calibrate the relative spatial position and relative spatial distance between the first Bluetooth and the second Bluetooth.
[0011] Optionally, the method further comprises: Obtain regional environmental factors of the location to be measured; According to the regional environmental factors, a deviation coefficient of the first distance is determined, and the first distance is corrected according to the deviation coefficient to generate an actual distance.
[0012] Optionally, the method further comprises: The first Bluetooth is set at the reference point, and the second Bluetooth is set at a plurality of different spatial positions to generate a plurality of corresponding signal transmission times; Determine, according to the plurality of spatial positions, a target distance of the second Bluetooth relative to the first Bluetooth; According to the target distance and the corresponding signal transmission time, a mapping relationship between the Bluetooth signal transmission time and the distance is fitted; Determine that the mapping relationship is a preset time-distance mapping relationship.
[0013] 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 as described above.
[0014] In addition, to achieve the above object, the present invention also provides a distance measuring device, including the control device as described above.
[0015] The embodiment of the present invention arranges a first Bluetooth at the first end of the position to be measured in an indoor space, arranges a second Bluetooth at the second end of the position to be measured, sets the first Bluetooth as a reference position Bluetooth, sets the first end of the position to be measured as a reference point, calibrates the relative spatial position and relative spatial distance of the first Bluetooth and the second Bluetooth after the reference position Bluetooth and the reference point are set, and installs the second Bluetooth to the second end of the position to be measured after the calibration of the relative spatial position and the relative spatial distance is completed. After the installation of the second Bluetooth is completed, 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, and finally, in combination with a preset time-distance mapping relationship, the first distance between the first Bluetooth and the second Bluetooth is determined, thereby realizing high-precision and stable indoor ranging. The method is not affected by environmental factors, has high ranging accuracy, and strong stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] 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.
[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 creative labor.
[0018] Figure 1 It is a schematic diagram of the flow of a Bluetooth ranging method according to an embodiment of the present invention; Figure 2 for Figure 1 Schematic diagram of the method flow of step S300; Figure 3 for Figure 2 Schematic diagram of the method flow of step S330; Figure 4 for Figure 3Schematic diagram of the method flow of step S333; Figure 5 for Figure 4 Schematic diagram of the method flow of step S3333; Figure 6 for Figure 1 Schematic diagram of the first part of the method flow of step S100; Figure 7 for Figure 1 The second part of the method flow chart of step S100; Figure 8 A schematic diagram of a Bluetooth distance measurement method flow chart according to another embodiment of the present invention; Fig. 9 The present invention is a flowchart of a Bluetooth distance measurement method according to another embodiment of the present invention.
[0019] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 not for limiting 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 in 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.
[0021] The limitations of various nouns or methods referred to 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 understanding, the various specific subordinate specific limitations of the nouns or methods should be regarded as the inventive content of the present invention, and should not be understood narrowly or interpreted in a biased manner on the grounds that the specification does not disclose the specific limitations. Similarly, under the premise that it can be implemented logically, the order of the steps in the method is flexible and changeable, and the specific subordinate specific limitations in the broad concepts of various nouns or methods all fall within the scope of protection of the present invention.
[0022] 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 between the first Bluetooth and the second Bluetooth, and after the calibration of the relative spatial position and the 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.
[0023] In this embodiment, for the convenience of description, the following description is made with the control device as the execution subject.
[0024] The existing RSSI-based ranging technology faces problems such as easy drift of signal strength and large differences between devices, and is therefore unable to meet the needs of high-precision indoor positioning.
[0025] The present application provides a solution to achieve high-precision and stable indoor ranging, and the method is not affected by environmental factors, has high ranging accuracy, and strong stability.
[0026] 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 MCU (Microcontroller Unit), DSP (Digital Signal Process), FPGA (Field Programmable Gate Array), SOC (System On Chip), etc.
[0027] It should be understood that the Bluetooth ranging method in the embodiment of the present invention is applied to an indoor space, and 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.
[0028] Reference Figure 1 , Figure 1 1 is a flow chart of a Bluetooth distance measurement method according to an embodiment of the present invention. In an embodiment of the present invention, the Bluetooth distance measurement method includes steps S100-S400, wherein: 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; S200, when the relative spatial position and the relative spatial distance are calibrated, the second Bluetooth is installed to 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; S300, controlling the first Bluetooth receiver to generate a signal transmission time according to the ranging request signal; S400: Acquire a first distance corresponding to the signal transmission time according to the signal transmission time and a preset time-distance mapping relationship.
[0029] In this embodiment, the first Bluetooth is first fixed at a reference point, and then the relative spatial position and relative spatial distance between 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 deviations are determined, and corrections are made accordingly.
[0030] In this embodiment, after the relative spatial position and relative spatial distance of the first Bluetooth and the second Bluetooth are installed and calibrated, the control device will automatically record and store the calibration results as reference data for subsequent distance measurement. Thereafter, no matter how the indoor environment changes, as long as the second Bluetooth remains at the second end of the position to be measured and works normally, the control device can achieve high-precision and stable distance measurement based on the calibrated data.
[0031] 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 signal of the first Bluetooth 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 an ideal environment, and correcting the distance by empirical means, so that in actual distance measurement, only the measured signal transmission time needs to be compared with the mapping relationship table to quickly and accurately obtain the first distance.
[0032] It is understandable that the present application uses the method of calculating the first Bluetooth reception and generating the signal transmission time. Unlike the traditional acoustic ranging, the acoustic ranging measurement accuracy is greatly affected by the environment (such as temperature, humidity, etc.), and it is easy to produce large errors in a multipath environment. 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 the current acoustic ranging scheme, in order to eliminate the influence of multipath effects, it is often necessary to combine wireless signal equipment as an auxiliary implementation. Its implementation method is relatively complicated, which is not conducive to the simplification of the test process. Moreover, due to the combination of multiple devices, once any device fails, it will cause large errors. However, the Bluetooth ranging scheme of the present application will not, and is less affected by physical obstacles.
[0033] 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 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.
[0034] In addition, since the present embodiment performs calibration before ranging, it can make more accurate and reliable measurements when the received signal strength values of mobile phones with different hardware configurations or mobile phones under different business data are different due to different hardware (e.g., antenna) configuration conditions of devices with Bluetooth functions (e.g., mobile phones) and different current business data (e.g., Wi-Fi business data).
[0035] In practical applications, for example, to measure the distance between two corners of an indoor warehouse, the user can fix the first Bluetooth device in one corner as a reference point, and install the second Bluetooth device in another corner. After the Bluetooth device is correctly installed, the first Bluetooth is controlled to be defined as the reference position Bluetooth. It can be controlled automatically or manually, for example, a code defined as the reference for power-on is written in the first Bluetooth, so that after the first Bluetooth is installed, it automatically becomes the reference position Bluetooth as soon as it is started. It can also be manually adjusted by the user to determine the reference position Bluetooth. After the first Bluetooth and the second Bluetooth are calibrated, the user can trigger the start of the distance measurement process through an external trigger button, or set the corresponding delay time in the second Bluetooth. When the second Bluetooth is started, the control device starts timing, and after the timing ends, the distance measurement process is automatically started. The control device will control the second Bluetooth to send a distance measurement request signal to the first Bluetooth, and time the time interval from the request signal being sent to the first Bluetooth being received, for example, 2s, and then determine the first distance between the two Bluetooth devices by combining the preset time-distance mapping relationship. This process can be repeated many 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.
[0036] In practical applications, it can be applied to the fields of warehousing and logistics, and the Bluetooth ranging method implemented in this embodiment can be used to achieve accurate positioning and tracking of goods. For example, the first Bluetooth can be set as a Bluetooth beacon, and the first Bluetooth can be connected and communicated with multiple second Bluetooths. The first Bluetooth can also be used as a Bluetooth server, and then the second Bluetooth can be 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 and misplaced. At the same time, this technology can also be combined with automated handling equipment to achieve automated sorting and handling of goods.
[0037] In practical applications, it can be applied to smart home scenarios. The Bluetooth distance measurement method implemented in this embodiment can be used to realize the intelligent linkage and scene control of smart home devices. A corresponding first Bluetooth is set on each smart home device, and the Bluetooth of the user's smart terminal is set as the second Bluetooth. For example, by measuring the distance between the user and the smart home device (such as lights, air conditioners, curtains, etc.), the state of the device can be automatically adjusted to meet the needs of the user. When the user approaches a room, the lights can be automatically turned on; when the user leaves the room, the lights and air conditioners can be automatically turned off to save energy.
[0038] In practical applications, it can be applied in museums. The Bluetooth distance measurement method implemented in this embodiment can be used to enhance the visitor experience and ensure the safety of exhibits, and realize the accurate positioning of visitors. By setting the first Bluetooth at any location in the museum, and setting the first Bluetooth as the museum 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 Bluetooth beacon, and by measuring the distance between the Bluetooth device carried by the visitor and the museum Bluetooth beacon, the location of the visitor can be tracked in real time, and personalized guide services can be provided for them, while preventing visitors from approaching sensitive or fragile exhibits.
[0039] In practical applications, it can be applied in shopping malls. The Bluetooth ranging method implemented in this embodiment can be used to help customers quickly find public facilities such as shops, toilets or elevators. By setting the first Bluetooth at any location in the shopping mall, and setting the first Bluetooth as the shopping mall Bluetooth beacon, and setting the Bluetooth of the customer's smart terminal as the second Bluetooth, when the customer enters the shopping mall, the Bluetooth of the customer's smart terminal can interact with the shopping mall Bluetooth beacon, and guide the customer to the destination through the ranging results. In addition, this technology can also be used to analyze the behavior patterns of customers in the shopping mall, providing merchants with a basis for precision marketing.
[0040] In addition, in order to further improve the ranging accuracy and stability, this embodiment can also be combined with other sensors or devices, such as inertial measurement units (IMUs), accelerometers, gyroscopes, etc., to assist in determining the precise position and attitude of Bluetooth devices. These sensors can provide information about the motion state, direction, acceleration, etc. of the device, thereby helping the control device to more accurately determine the relative position and distance between Bluetooth devices, so as to meet the personalized needs of different users and provide effective technical support for indoor positioning, distance measurement and other fields.
[0041] 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 the transfer of the third Bluetooth, the fourth Bluetooth and other devices to improve the ranging accuracy.
[0042] 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 between the first Bluetooth and the second Bluetooth are calibrated. After the relative spatial position and relative spatial distance are calibrated, 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 strong stability.
[0043] Further, see 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: S1010, obtaining first spatial position coordinates and identification information of a first Bluetooth; 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; S1030. Configure the first Bluetooth as a ranging master node according to the identification information; S1040: When the first Bluetooth is configured, calibrate the first spatial position coordinates of the first Bluetooth according to preset reference information so that the first Bluetooth is at the origin; S1050: Identify the first Bluetooth as a reference position Bluetooth according to the configured first Bluetooth and the calibrated first spatial position coordinates.
[0044] In this implementation, the first spatial position coordinates may include three coordinate values of x, y, and z of the first Bluetooth device in three-dimensional space, which may be obtained through various positioning technologies, such as using a global positioning system (GPS) or a Beidou positioning system in combination with indoor map positioning, or using other indoor positioning technologies such as Wi-Fi positioning, ultrasonic positioning, etc. The identification information may be a unique identification code (such as a MAC address) of the first Bluetooth device, or a specific identification set by a user for the first Bluetooth device.
[0045] In this embodiment, the control device sets the position of the first Bluetooth as the origin or reference point of the indoor space according to the acquired first spatial position coordinates, and uses the first Bluetooth as the reference point for all distance measurements. The positions of other Bluetooth devices or objects will be determined relative to the first Bluetooth, and then the first Bluetooth is configured as the distance measurement master node according to the set origin or reference point and identification information. The configuration process may include setting a specific working mode, parameter setting, communication protocol, etc. of the first Bluetooth to ensure that it can be used as the main device for distance measurement and communicate and exchange data with other Bluetooth devices. After the configuration is completed, the first spatial position coordinates of the first Bluetooth are calibrated according to the preset reference information. This step is to ensure that the position coordinates of the first Bluetooth device are accurate, so as to serve as the reference for subsequent distance measurement. The preset reference information may include known indoor map information, known reference point positions, etc., and more accurate first Bluetooth position coordinates can be obtained by comparing and correcting these information. Finally, according to the configured first Bluetooth and the calibrated first spatial position coordinates, the first Bluetooth is identified as the reference position Bluetooth. In this way, in the entire distance measurement process, the first Bluetooth will be used as the reference point, and the positions of other Bluetooth devices or objects will be determined relative to the first Bluetooth, thereby ensuring the accuracy and stability of the distance measurement. The control device identifies the first Bluetooth device as the reference position Bluetooth. This method of setting the reference position Bluetooth is not only simple and easy, but also can ensure that the reference point of the distance measurement is clear and unique, thereby improving the accuracy and stability of the distance measurement. Since the reference position Bluetooth is set using spatial position coordinates and identification information, it can also adapt to various complex indoor environments.
[0046] In actual applications, a GPS device or a Beidou positioning device is installed on the first Bluetooth to locate the first Bluetooth, the ground of the indoor space is set as the origin of the z-axis, and a corner of the room is set as the origin of the x-axis and y-axis, for example, the ground in the southwest corner is the origin of the three-dimensional space, and then the first Bluetooth is installed at one end of a certain position to be tested in the indoor space. After installation, the first Bluetooth is started, and the control device will obtain the three coordinate values of x, y, and z of the first Bluetooth in the three-dimensional space, as well as the unique identification code (MAC address) of the first Bluetooth. Then, the control device will set the first Bluetooth as the reference point of the indoor space according to these coordinate values and the unique identification code, and configure it as the ranging master node. At the same time, according to the preset indoor map information and the known reference point position, the position coordinates of the first Bluetooth are calibrated to ensure that they are accurate. Finally, the first Bluetooth is officially identified as the reference position Bluetooth. When setting the reference position Bluetooth, in addition to using the spatial position coordinates and identification information, multiple data sources such as indoor map information and environmental obstacle information can also be combined for more refined settings. For example, when setting the first Bluetooth as the reference position Bluetooth, obstacles such as walls and pillars that may exist in the indoor environment can be taken into consideration to avoid using these obstacles as reference points for distance measurement, thereby reducing errors and interference. That is, all distance measurement operations will be performed based on the first Bluetooth, so that the distance measurement results have a unified reference reference.
[0047] Further, see 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: S1060, obtaining the second spatial position coordinates of the second Bluetooth; S1070, determining a spatial distance and a relative orientation of the second Bluetooth relative to the first Bluetooth according to the first spatial position coordinates and the second spatial position coordinates; S1080, controlling the second Bluetooth to send a distance calibration request to the first Bluetooth, and obtaining the transmission time of the first Bluetooth receiving and generating a corresponding calibration signal, so as to generate a corresponding test distance; S1090, determining a distance deviation according to the spatial distance and the test distance; S1100, based on the arrival angle method, obtaining the test azimuth of the second Bluetooth relative to the first Bluetooth, and comparing it with the relative azimuth to determine the azimuth deviation; 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.
[0048] In this implementation, after the first Bluetooth is set as the reference position Bluetooth, the user can install the second Bluetooth at a calibration test position as needed. The calibration test position can be any point with known coordinates in the indoor space, but usually a position close to the first Bluetooth and convenient for measurement is selected. Unlike the first Bluetooth, the precise coordinate position of the second Bluetooth in three-dimensional space is in a coordinate system based on the spatial coordinates of the first Bluetooth as the origin, and its spatial position is relative to the first Bluetooth. The location where the second Bluetooth is placed is a preset location, and the spatial coordinates of the location are known to obtain its precise position in three-dimensional space.
[0049] The second spatial position coordinates may include the x, y, and z coordinate values of the second Bluetooth device in three-dimensional space, which may be obtained by positioning technology similar to that of the first Bluetooth device. Since we are mainly concerned with the relative position and distance between the first Bluetooth device and the second Bluetooth device, the accuracy of these coordinate values may not be as high as that of the first Bluetooth device.
[0050] After determining the spatial position coordinates of the first Bluetooth and the second Bluetooth, these coordinate values can be used to calculate the spatial distance and relative orientation of the second Bluetooth relative to the first Bluetooth. This calculation process can be completed by simple three-dimensional space geometry formulas, such as using the Euclidean distance formula to calculate the straight-line distance between two points, and using methods such as the direction cosine theorem or quaternions to determine the relative orientation.
[0051] The second Bluetooth sends a distance calibration request to the first Bluetooth. This request contains the current timestamp of the second Bluetooth and a unique calibration request identifier. When the first Bluetooth receives this request, it immediately records the receiving timestamp and generates a corresponding calibration signal, which also contains the current timestamp and request identifier. Subsequently, the first Bluetooth sends this calibration signal back to the second Bluetooth. After receiving the calibration signal, the second Bluetooth calculates the total time of signal transmission (i.e., the time difference from sending the calibration request to receiving the calibration signal). Since the propagation speed of the signal in the air is known, the second Bluetooth can calculate the test distance between it and the first Bluetooth based on this time difference. This test distance is estimated based on the signal transmission time, but due to various factors (such as signal attenuation, multipath effect, etc.), this distance may deviate from the actual distance.
[0052] Then, the spatial distance (called the first distance) calculated based on the known spatial position coordinates of the first Bluetooth and the second Bluetooth is compared with the above test distance to determine the distance deviation. This deviation reflects the possible errors in the hardware or algorithm of our distance measurement system.
[0053] In addition, it is also necessary to calibrate the direction of the second Bluetooth relative to the first Bluetooth. This can be achieved through 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, and measure the phase difference between the signals sent by the second Bluetooth arriving at these antennas, thereby estimating the direction of the second Bluetooth relative to the first Bluetooth. This test direction is compared with the relative direction calculated by the spatial position coordinates in step S1070 to determine the direction deviation.
[0054] Finally, the control device adjusts the ranging parameters of the second Bluetooth according to the distance deviation and the azimuth deviation. These parameters may include signal transmission power, receiving sensitivity, antenna gain, etc. By adjusting these parameters, the ranging error can be greatly reduced and the ranging accuracy can be improved. In addition, this calibration process can also be repeated regularly to adapt to the impact of changes in the indoor environment (such as personnel flow, changes in furniture placement, etc.) on the ranging accuracy, so as to ensure that the relative position and distance measurement between the first Bluetooth and the second Bluetooth have sufficient accuracy and stability.
[0055] In actual applications, the calibration process can be performed automatically after the device is installed, or it can be triggered manually by the user. In the 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 the 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.
[0056] Further, see Figure 2 Another embodiment of the present invention provides a Bluetooth distance measurement method based on the above Figure 1 In the embodiment shown, the steps of controlling the first Bluetooth receiver and generating the signal transmission time according to the ranging request signal include S310-S330, wherein: S310, according to the ranging request signal, controlling the first Bluetooth to return a ranging permission signal, and controlling the first Bluetooth to start a timer; S320, 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; 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.
[0057] In this embodiment, the ranging request signal can be triggered by the user through an external trigger component, or it can be automatically triggered after the control device reads the status of the first Bluetooth and the second Bluetooth. When the first Bluetooth receives the ranging request signal, it will first return a ranging permission signal to inform the second Bluetooth device that it can start sending a response signal. At the same time, the first Bluetooth will start an internal timer to record the time from receiving the ranging request signal to receiving the second Bluetooth response signal.
[0058] After the timer starts, the first Bluetooth will continue to receive multiple response signals sent by the second Bluetooth. Due to the complexity of the indoor environment, such as the presence of objects such as walls and furniture, and the characteristics of the Bluetooth signal itself, such as signal attenuation and multipath effects, the response signal sent by the second Bluetooth may reach the first Bluetooth through different paths, resulting in time differences in the received response signals.
[0059] In order to filter out the most accurate signal transmission time from multiple response signals, the present invention adopts a clustering algorithm. A clustering algorithm is an unsupervised learning method that can cluster similar data points together to form different clusters. In this embodiment, the clustering algorithm clusters the response signals based on their transmission time, classifies the response signals with similar transmission time into the same cluster, and considers that the response signals in this cluster represent the most direct signal transmission path.
[0060] Then, the control device will select the cluster containing the most response signals from these clusters, and consider that the response signals in this cluster represent the most reliable signal transmission path. Finally, the average or median of the transmission time of the response signals in this cluster is taken as the final signal transmission time, which can better handle the problem of response signal transmission time differences caused by the complexity of the indoor environment and the characteristics of the Bluetooth signal, thereby selecting the most accurate signal transmission time. This not only improves the accuracy of Bluetooth ranging, but also enhances the stability and reliability of ranging.
[0061] 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 the signal transmission time according to specific requirements and environmental characteristics.
[0062] Further, see 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 being the signal transmission time includes S331-S333, wherein: S331, grouping the transmission time of the response signal 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; 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; S333: If there are multiple transmission time groups with the largest number of response signals, compare the quality of the response signals in each transmission time group, and determine the transmission time of the response signal of the transmission time group with the highest signal quality as the signal transmission time.
[0063] In this implementation, the transmission time is first grouped to obtain a corresponding transmission time group. The transmission time group can be divided according to the difference in transmission time using a clustering algorithm. For example, response signals with transmission time within a certain range are grouped together. Next, the number of response signals in each transmission time group is counted to determine which group has the most response signals. This step can help us identify which transmission time periods have more dense response signals and are more likely to represent the actual signal transmission path.
[0064] However, in actual applications, there may be a situation where the number of response signals in multiple transmission duration groups is the same. In this case, not only the number of response signals but also the quality of the response signals need to be considered. Therefore, after identifying the transmission duration group with the largest number of response signals, it is necessary to further compare the quality of the response signals in these groups. The quality of the response signal can be measured by factors such as signal strength, stability, and consistency.
[0065] In this embodiment, the transmission duration group with the highest signal strength, the best stability, and the strongest consistency can be selected as the final signal transmission time. Since the quantity and quality of the response signal are comprehensively considered, the most reliable signal transmission time can be screened out more accurately. This can not only improve the accuracy of Bluetooth ranging, but also enhance the stability and reliability of ranging. Especially in the case of complex indoor environment and interference of Bluetooth signal, this method can effectively eliminate interference and ensure the accuracy of ranging results.
[0066] Further, see Figure 4 Another embodiment of the present invention provides a Bluetooth distance measurement method based on the above Figure 3 In the embodiment shown, if there are multiple transmission time groups with the largest number of response signals, the step of comparing the quality of the response signals in each transmission time group and determining the transmission time of the response signal of the transmission time group with the highest signal quality as the signal transmission time includes S3331-S3334, wherein: 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; S3332. Evaluate the quality of the response signal in each transmission duration group according to the signal strength and the signal-to-noise ratio; 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; S3334. Determine the transmission time of the response signal corresponding to the target transmission duration group as the signal transmission time.
[0067] In this implementation, when there are multiple transmission duration groups with the same number, the signal quality needs to be evaluated by the signal strength and signal-to-noise ratio of the response signal, where the signal strength can reflect the transmission capability and penetration capability of the signal, and the signal-to-noise ratio reflects the degree of interference to the signal during transmission. The higher the signal strength and the larger the signal-to-noise ratio, the better the signal quality and the more likely it is to represent the real signal transmission path.
[0068] In addition, in order to more accurately evaluate the signal quality, the response signal quality is sorted by using a sorting algorithm. The sorting algorithm is a commonly used data processing method, which can arrange the data in a certain order according to one or more characteristic values of the data.
[0069] In this embodiment, the response signal quality is sorted according to the signal strength and signal-to-noise ratio of the response signal in each transmission duration group by using a sorting algorithm. The sorted result will help us determine which transmission duration group has the best response signal quality, thereby determining the final signal transmission time.
[0070] Among them, the average signal strength and signal-to-noise ratio of the response signal in each transmission duration group can be calculated first, and then these two average values can be used as evaluation indicators of the signal quality of the transmission duration group. Then, a sorting algorithm, such as bubble sort, quick sort, etc., is used to sort the transmission duration groups according to these evaluation indicators. The sorted results will be arranged in order from high to low signal quality, so that the control device can 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, which can effectively eliminate interference and improve the accuracy and stability of Bluetooth ranging.
[0071] Further, see Figure 5 Another embodiment of the present invention provides a Bluetooth distance measurement method based on the above Figure 4In the embodiment shown, based on the sorting algorithm and the response signal quality in each transmission duration group, the step of determining the target transmission duration group with the best response signal quality in the transmission duration group includes S33331-S33332, wherein: S33331. Based on a sorting algorithm, sort the response signal qualities in each transmission duration group 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; S33332. Determine the transmission duration group at the first position in the sorted list as the target transmission duration group.
[0072] In this implementation, 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, 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.
[0073] In addition, in practical applications, the choice of sorting algorithm may be adjusted according to specific needs and scenarios. For example, in some occasions where time efficiency is very high, we may choose a sorting algorithm with lower time complexity; and in some occasions where high precision is required, we may choose an algorithm with better sorting effect. But no matter which algorithm is chosen, its core purpose is to more accurately determine the transmission time of the signal, thereby improving the performance of Bluetooth ranging. This can effectively eliminate interference, improve the accuracy and stability of Bluetooth ranging, and adapt to various different environments and scenario requirements. This makes our Bluetooth ranging method more applicable and flexible, and can meet the needs of more different fields and occasions.
[0074] Further, see 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 distance measurement method further includes S500-S600, wherein: S500, obtaining regional environmental factors of the location to be measured; S600: Determine a deviation coefficient of the first distance according to regional environmental factors, and correct the first distance according to the deviation coefficient to generate an actual distance.
[0075] In this implementation, Figure 1 The first distance in the illustrated embodiment is obtained without considering any interference from environmental factors. However, since Bluetooth is also interfered 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 the first distance is corrected in combination with this environmental factor to generate the actual distance. Among them, the deviation coefficient can be obtained by statistically analyzing a large amount of experimental data, or by predicting using a mathematical model based on the changing law of environmental factors. The size of the deviation coefficient reflects the degree of influence of environmental factors on the accuracy of Bluetooth distance measurement. Among them, 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 actual distance value.
[0076] 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.
[0077] In this implementation, since the location to be measured is in an indoor space, the indoor environment may have multipath effects, signal attenuation and other factors that affect the signal. It can be seen that regional environmental factors include but are not limited to temperature, humidity, air pressure, building materials and obstacles, etc. These factors may affect the propagation speed and path of the Bluetooth signal, thereby affecting the accuracy of Bluetooth ranging. Therefore, when determining the actual distance, it is necessary to fully consider these regional environmental factors and correct the first distance.
[0078] First, the regional environmental factors of the location to be measured, such as temperature, humidity, etc., are obtained through sensors or other detection devices. Then, the first distance is corrected according to the obtained environmental factors and the correspondence between the pre-set environmental factors and the signal propagation characteristics. For example, when the temperature rises, the air density decreases, and the signal propagation speed may increase, so the first distance needs to be corrected to decrease accordingly; on the contrary, when the temperature decreases, the first distance needs to be corrected to increase.
[0079] In addition, the materials and structures of buildings, indoor obstacles, etc. will also affect the propagation of Bluetooth signals. For example, metal obstacles will absorb or reflect Bluetooth signals, causing the signal propagation path to change, thereby affecting the accuracy of ranging. Therefore, when correcting the first distance, it is also necessary to consider the influence of these factors and make corresponding adjustments to the first distance to obtain a more accurate actual distance, which can effectively eliminate the interference of the indoor environment on Bluetooth ranging and improve the accuracy and stability of ranging.
[0080] In actual application, for example, the distance between two points in an indoor space needs to be measured, but there is a 6-centimeter brick wall between the two points. 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.
[0081] In actual application, for example, if the distance between two points 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 distance measurement results. Among them, the increase in temperature may cause the air density to decrease, so that the signal propagation speed is accelerated, 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 is accelerated and the signal attenuation is slowed down. At this time, the propagation time needs to be corrected. According to the changed temperature and the proportional relationship between 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.
[0082] Further, see Fig. 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 also includes S700-S1000, wherein: S700, setting the first Bluetooth at a reference point, and setting the second Bluetooth at a plurality of different spatial positions to generate a plurality of corresponding signal transmission times; S800, determining a target distance of the second Bluetooth relative to the first Bluetooth according to a plurality of spatial positions; S900, fitting a mapping relationship between Bluetooth signal transmission time and distance according to the target distance and the corresponding signal transmission time; S1000: Determine that the mapping relationship is a preset time-distance mapping relationship.
[0083] In this embodiment, by setting the second Bluetooth at multiple different spatial positions and recording the signal transmission time of 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 Bluetooth signals in a specific environment, including the influence of factors such as signal attenuation and multipath effects on signal transmission time. This mapping relationship will serve as an important reference in the subsequent ranging process to convert signal transmission time into actual distance.
[0084] In addition, due to the complexity and variability of the indoor environment, the fitted mapping relationship may need to be updated and adjusted in different time periods or under different environmental conditions. Therefore, in practical applications, the transmission time measurement of the Bluetooth signal and the fitting of the mapping relationship can be re-performed in combination with the current changes in the environment to ensure the accuracy and reliability of the ranging results.
[0085] After the mapping relationship is fitted, the mapping relationship can be stored in the control device or a related database, thereby forming a preset time-distance mapping relationship, so as to facilitate quick call and query in the subsequent Bluetooth ranging process. In this way, whenever Bluetooth ranging is required, the control device only needs to find the corresponding actual distance in the mapping relationship according to the measured signal transmission time, without the need for complex calculations and corrections, which greatly improves the efficiency and accuracy of ranging.
[0086] 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.
[0087] 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, the Bluetooth ranging program being configured to implement the above Bluetooth ranging method.
[0088] 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.
[0089] The present invention further provides a distance measuring device, which includes the control device as described in the above embodiment.
[0090] 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.
[0091] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0092] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0093] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of various embodiments of the present invention.
[0094] 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 specification 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 distance measurement 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; When the relative spatial position and the relative spatial distance are calibrated, 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; According to the ranging request signal, control the first Bluetooth to receive and generate a signal transmission time; According to the signal transmission time and a preset time-distance mapping relationship, obtaining a first distance corresponding to the signal transmission time; The step of controlling the first Bluetooth receiving and generating a signal transmission time according to the ranging request signal comprises: 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 screened out as the signal transmission time.
2. The Bluetooth distance measurement method according to claim 1, characterized in that: The step of screening out the response signals having the longest duration as the signal transmission time based on the clustering algorithm and the transmission time of the response signals comprises: Grouping the transmission time 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 time length groups with the largest number of response signals, the response signal qualities in each transmission time length group are compared, and the transmission time of the response signal in the transmission time length group with the highest signal quality is determined as the signal transmission time.
3. The Bluetooth distance measurement method according to claim 2, characterized in that: If there are multiple transmission time length groups with the largest number of response signals, the step of comparing the quality of the response signals in each of the transmission time length groups and determining the transmission time of the response signal of the transmission time length 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, obtain the signal strength and signal-to-noise ratio of the response signals in each transmission duration group; evaluating the quality of the response signal in each transmission duration group according to the signal strength and the signal-to-noise ratio; Based on the sorting algorithm and the response signal quality in each transmission duration group, determining a target transmission duration group with the best response signal quality in the transmission duration groups; Determine the transmission time of the response signal corresponding to the target transmission duration group as the signal transmission time.
4. The Bluetooth distance measurement method according to claim 3, characterized in that: The step of determining a target transmission duration group with the best response signal quality in the transmission duration groups based on the sorting algorithm and the response signal quality in each transmission duration group comprises: 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 position in the sorted list is determined as the target transmission duration group.
5. The Bluetooth distance measurement method according to claim 1, characterized in that: The step of setting the first Bluetooth as the reference location Bluetooth includes: Acquire the 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; When the first Bluetooth is configured, 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.
6. The Bluetooth distance measurement method according to claim 5, 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; Based on the arrival angle method, obtain the test azimuth of the second Bluetooth relative to the first Bluetooth, and compare it with the relative azimuth to determine the azimuth deviation; According to the distance deviation and the azimuth deviation, the ranging parameters of the second Bluetooth are adjusted to calibrate the relative spatial position and relative spatial distance between the first Bluetooth and the second Bluetooth.
7. The Bluetooth distance measurement method according to claim 1, characterized in that: The method further comprises: Obtain regional environmental factors of the location to be measured; According to the regional environmental factors, a deviation coefficient of the first distance is determined, and the first distance is corrected according to the deviation coefficient to generate an actual distance.
8. The Bluetooth distance measurement method according to any one of claims 1 to 7, characterized in that: The method further comprises: The first Bluetooth is set at the reference point, and the second Bluetooth is set at a plurality of different spatial positions to generate a plurality of corresponding signal transmission times; Determine, according to the plurality of spatial positions, a target distance of the second Bluetooth relative to the first Bluetooth; According to the target distance and the corresponding signal transmission time, a mapping relationship between the Bluetooth signal transmission time and the distance is fitted; Determine that the mapping relationship is a preset time-distance mapping relationship.
9. A control device, characterized in that: The control device comprises: a memory, a processor, and a Bluetooth distance measurement program stored in the memory and executable on the processor, wherein the Bluetooth distance measurement program is configured to implement the Bluetooth distance measurement method according to any one of claims 1 to 8.
10. A distance measuring device, characterized in that: Comprising a control device as claimed in claim 9.
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
A system for dynamic spatiotemporal beam shaping with self-calibration.
DE102021214777A1
Ultrasonic type device for detecting distance
JP1994300833A
