Ranging method and device, electronic equipment and storage medium
By enabling the UWB module under Bluetooth connection and combining Bluetooth and UWB signal ranging, the problems of insufficient Bluetooth accuracy and high UWB power consumption are solved, realizing high-precision and low-power indoor positioning and ranging.
Patent Information
- Application Number
- CN202610096707.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-23
- Publication Date
- 2026-04-28
AI Technical Summary
In indoor positioning, existing technologies such as Bluetooth channel detection and ranging have insufficient accuracy and low power consumption, while ultra-wideband (UWB) technology has high accuracy but high power consumption, making it difficult to meet the requirements of high accuracy and low power consumption at the same time.
With Bluetooth connected, the UWB module is enabled, and Bluetooth signals are sent through the Bluetooth module, combined with UWB signals sent through the UWB module to measure the distance between devices. The combination of Bluetooth and UWB signals improves ranging accuracy and reduces power consumption.
It achieves a significant reduction in device power consumption while maintaining high-precision ranging, making it suitable for indoor positioning scenarios such as opening smart door locks.
Smart Images

Figure CN121940861A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of wireless communication technology, specifically relating to a ranging method, device, electronic device, and storage medium. Background Technology
[0002] Currently, with the advancement of technology and changes in people's lifestyles, most of people's activities take place indoors. Therefore, the widespread development of indoor positioning technology has become essential.
[0003] Indoor positioning typically employs Bluetooth channel sensing and ultra-wideband (UWB) technology. Bluetooth channel sensing relies primarily on the phase difference or RSSI (Received Signal Strength Indicator) of the Bluetooth signal. While Bluetooth channel sensing offers low power consumption, its measurement accuracy is limited to only 1-3 meters due to the narrowband characteristics and multipath effects of the 2.4 GHz band, making it insufficient for high-precision positioning. Ultra-wideband (UWB) technology achieves centimeter-level ranging accuracy through nanosecond-level pulse signals, but its power consumption is high during continuous operation.
[0004] Therefore, a new ranging method is urgently needed to improve positioning accuracy and reduce power consumption. Summary of the Invention
[0005] The purpose of this application is to provide a ranging method, device, storage medium, and electronic device that can improve positioning accuracy and reduce power consumption.
[0006] In a first aspect, embodiments of this application provide a ranging method applied to a first electronic device including a Bluetooth module and an ultra-wideband (UWB) module, the method comprising:
[0007] Enable the UWB module when a Bluetooth connection is established between the first electronic device and the second electronic device;
[0008] The system transmits a second Bluetooth signal via the Bluetooth module and a first UWB signal via the UWB module, and measures a second distance between the first electronic device and the second electronic device based on the second Bluetooth signal and the first UWB signal.
[0009] Secondly, embodiments of this application provide a ranging method applied to a first electronic device including a Bluetooth module and an ultra-wideband (UWB) module, the device comprising:
[0010] The enable module is used to enable the UWB module when a Bluetooth connection is established between the first electronic device and the second electronic device.
[0011] The ranging module is used to send a second Bluetooth signal via a Bluetooth module and a first UWB signal via a UWB module, and to measure a second distance between a first electronic device and a second electronic device based on the second Bluetooth signal and the first UWB signal.
[0012] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions being executed by the processor to implement the steps of the ranging method as described in the first aspect.
[0013] Fourthly, embodiments of this application provide a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the ranging method as described in the first aspect.
[0014] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the ranging method as described in the first aspect.
[0015] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the ranging method as described in the first aspect.
[0016] In this embodiment, when a Bluetooth connection is established between the first electronic device and the second electronic device, the UWB module is enabled. A second Bluetooth signal is transmitted via the Bluetooth module, and a first UWB signal is transmitted via the UWB module. Based on the second Bluetooth signal and the first UWB signal, a second distance between the first and second electronic devices is measured. Thus, the electronic device can enable the UWB module when a Bluetooth connection is established between the first and second electronic devices. Therefore, the electronic device can measure the second distance between the first and second electronic devices using the second Bluetooth signal transmitted by the Bluetooth module and the first UWB signal transmitted by the UWB module, which improves ranging accuracy and reduces the power consumption of the electronic device. Attached Figure Description
[0017] Figure 1 This is a schematic flowchart of a ranging method provided in an embodiment of this application;
[0018] Figure 2 This is a schematic flowchart of a ranging method provided in an embodiment of this application;
[0019] Figure 3 This is a schematic flowchart of a ranging method provided in an embodiment of this application;
[0020] Figure 4 This is a schematic diagram of the hardware architecture of the electronic device provided in the embodiments of this application;
[0021] Figure 5 This is a schematic diagram of a signal frame provided in an embodiment of this application;
[0022] Figure 6 This is a schematic flowchart of a ranging method provided in an embodiment of this application;
[0023] Figure 7 This is a schematic diagram of the structure of a ranging method device provided in an embodiment of this application;
[0024] Figure 8 This is a schematic diagram of the structure of a ranging method device provided in an embodiment of this application;
[0025] Figure 9 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;
[0026] Figure 10 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0027] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0028] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0029] The terms "at least one," "at least one of," etc., used in the specification and claims of this application refer to any one, any two, or a combination of two or more of the included items. For example, at least one of a, b, and c can mean: "a," "b," "c," "a and b," "a and c," "b and c," and "a, b, and c," where a, b, and c can be single or multiple. Similarly, "at least two" refers to two or more items, and its meaning is similar to that of "at least one."
[0030] The ranging method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0031] The ranging method provided in this application can be applied to indoor positioning scenarios, such as when using a mobile phone to unlock a smart door lock.
[0032] Currently, in scenarios where smartphones are used to unlock smart locks, the distance between the phone and the smart lock needs to be measured in real time as the phone approaches the lock. The phone can unlock the smart lock when the distance is less than a certain threshold.
[0033] In related technologies, mobile phones can use channel sounding ranging (SMR) and ultra-wideband (UWB) technology to measure the distance between themselves and smart door locks. Bluetooth SMR primarily relies on the phase difference or RSSI (Received Signal Strength Indicator) of the Bluetooth signal. While Bluetooth SMR has low power consumption, its measurement accuracy is limited by the narrowband characteristics and multipath effects of the 2.4GHz band, typically only reaching 1-3 meters, which is insufficient for high-precision positioning requirements. Ultra-wideband (UWB) technology achieves centimeter-level ranging accuracy through nanosecond-level pulse signals, but its power consumption is high during continuous operation.
[0034] Therefore, this application provides a ranging method applied to a first electronic device including a Bluetooth module and an ultra-wideband (UWB) module. The method enables the UWB module when a Bluetooth connection is established between the first and second electronic devices. It transmits a second Bluetooth signal via the Bluetooth module and a first UWB signal via the UWB module, and measures a second distance between the first and second electronic devices based on the second Bluetooth signal and the first UWB signal. Thus, the electronic device can enable the UWB module when a Bluetooth connection is established between the first and second electronic devices. Therefore, the electronic device can measure the second distance between the first and second electronic devices using the second Bluetooth signal transmitted by the Bluetooth module and the first UWB signal transmitted by the UWB module, which improves ranging accuracy and reduces the power consumption of the electronic device.
[0035] The ranging method provided in this application can be executed by a ranging device. Exemplarily, the ranging device can be an electronic device, or a functional component or entity within that electronic device. The ranging method provided in this application will be described below using an electronic device as an example.
[0036] Figure 1 This is a flowchart illustrating the ranging method provided in the embodiments of this application, as shown below. Figure 1 As shown, the ranging method provided in this application embodiment may include the following steps 101 to 102.
[0037] Step 101: When the first electronic device and the second electronic device have established a Bluetooth connection, enable the UWB module.
[0038] In some embodiments of this application, the Bluetooth module is enabled because the first electronic device and the second electronic device have established a Bluetooth connection.
[0039] In some embodiments of this application, after the Bluetooth module is enabled, the Bluetooth module can send and receive Bluetooth signals.
[0040] In some embodiments of this application, after the UWB module is enabled, the UWB module can send and receive UWB signals.
[0041] In some embodiments of this application, the "enabling the UWB module" in step 101 above can be achieved through the following step 101a:
[0042] Step 101a: If the first information satisfies the first ranging mode switching condition, the electronic device enables the UWB module.
[0043] In some embodiments of this application, the first information mentioned above includes at least one of the following: a first distance, location information of a first electronic device, and signal strength measured by a Bluetooth module.
[0044] In some embodiments of this application, the first distance is the distance between the first electronic device and the second electronic device determined based on the first Bluetooth signal sent by the Bluetooth module.
[0045] In some embodiments of this application, the first ranging mode switching condition mentioned above includes at least one of the following:
[0046] The first distance is greater than or equal to the first distance threshold and less than or equal to the second distance threshold;
[0047] The aforementioned location information indicates that the first electronic device is located in the buffer zone of the target location;
[0048] The signal strength measured by the Bluetooth module is greater than or equal to the first signal strength threshold and less than or equal to the second signal strength threshold.
[0049] Wherein, the second signal strength threshold is greater than the first signal strength threshold, and the second distance threshold is less than the first distance threshold.
[0050] In some embodiments of this application, the target location can be an indoor location, such as a supermarket, subway station, shopping mall, etc.
[0051] In some embodiments of this application, the target location may include an edge region, a buffer region, and a central region. The edge region may surround the buffer region, and the buffer region may surround the central region.
[0052] In some embodiments of this application, the aforementioned edge region surrounds the aforementioned buffer region, which can be understood as: the distance between any coordinate position in the aforementioned edge region and the center position of the aforementioned target location is greater than the distance between any coordinate position in the aforementioned buffer region and the center position of the aforementioned target location.
[0053] In some embodiments of this application, the buffer area surrounds the central area, which can be understood as: the distance between any coordinate position in the buffer area and the center position of the target location is greater than the distance between any coordinate position in the central area and the center position of the target location.
[0054] In some embodiments of this application, the second electronic device may be an electronic device located at the center of the target location. For example, a cash register at a supermarket or shopping mall checkout, or a turnstile at a subway station.
[0055] In some embodiments of this application, the first information satisfies the first ranging mode switching condition, indicating that the distance between the first electronic device and the second electronic device is moderate. In a moderate distance scenario, if the electronic device only enables the Bluetooth module and measures the distance between the first and second electronic devices using the first Bluetooth signal sent by the Bluetooth module, while this effectively reduces the power consumption of the electronic device, the ranging accuracy is low. If the electronic device only enables the UWB module and measures the distance between the first and second electronic devices using the second UWB signal sent by the UWB module, while this effectively improves the ranging accuracy, the power consumption of the electronic device is high. Therefore, in a moderate distance scenario, the electronic device can enable both the Bluetooth module and the UWB module, measuring the second distance between the first and second electronic devices using the second Bluetooth signal sent by the Bluetooth module and the first UWB signal sent by the UWB module. This improves ranging accuracy while reducing the power consumption of the electronic device.
[0056] Step 102: The electronic device sends a second Bluetooth signal through the Bluetooth module and a first UWB signal through the UWB module, and measures a second distance between the first electronic device and the second electronic device based on the second Bluetooth signal and the first UWB signal.
[0057] In some embodiments of this application, combined with Figure 1 ,like Figure 2 As shown, the second Bluetooth signal includes M first Bluetooth sub-signals. The step 102 above, "measuring the second distance between the first electronic device and the second electronic device based on the second Bluetooth signal and the first UWB signal," can be accomplished through the following steps 102a to 102d:
[0058] Step 102a: The electronic device receives the third Bluetooth signal fed back by the second electronic device based on the second Bluetooth signal and the third UWB signal fed back by the second electronic device based on the first UWB signal.
[0059] In some embodiments of this application, the third Bluetooth signal includes M second Bluetooth sub-signals, each of which is a Bluetooth signal fed back by a second electronic device based on one of the M first Bluetooth sub-signals;
[0060] Step 102b: The electronic device determines the fourth distance based on the first target Bluetooth sub-signal and the second target Bluetooth sub-signal.
[0061] In some embodiments of this application, the first target Bluetooth sub-signal is any one of the M first Bluetooth sub-signals, and the second target Bluetooth sub-signal is the Bluetooth signal corresponding to the first target Bluetooth sub-signal among the M second Bluetooth sub-signals.
[0062] In some embodiments of this application, the frequency of the first target Bluetooth sub-signal can be a first frequency, the frequency of the second target Bluetooth sub-signal can be a second frequency, and the second target Bluetooth sub-signal can carry phase information. The phase information is used to indicate the first phase of the first target Bluetooth sub-signal detected by the second electronic device when it receives the first target Bluetooth sub-signal.
[0063] In some embodiments of this application, when an electronic device receives the aforementioned second target Bluetooth sub-signal, it can detect the second phase of the aforementioned second target Bluetooth sub-signal.
[0064] In some embodiments of this application, the electronic device may first calculate the phase difference between the first phase and the second phase, and the frequency difference between the second frequency and the first frequency, and then determine the fourth distance based on the frequency difference and the phase difference.
[0065] In some embodiments of this application, the electronic device may use the following formula to determine the aforementioned fourth distance:
[0066] (1)
[0067] in, This represents the fourth distance mentioned above. This indicates the aforementioned phase difference value. This indicates the frequency difference mentioned above. It represents the speed of light.
[0068] In some embodiments of this application, the electronic device may use the following formula to calculate the aforementioned phase difference value:
[0069] (2)
[0070] in, This indicates the first phase mentioned above. This indicates the second phase mentioned above.
[0071] In some embodiments of this application, the electronic device may use the following formula to calculate the above-mentioned frequency difference:
[0072] (3)
[0073] in, This refers to the second frequency mentioned above. This refers to the first frequency mentioned above.
[0074] Step 102c: The electronic device determines the fifth distance based on the first UWB signal and the third UWB signal.
[0075] In some embodiments of this application, the electronic device acquires first time information and second time information carried in the third UWB signal. The first time information is used to indicate the second time when the second electronic device receives the first UWB signal. The second time information is used to indicate the third time when the second electronic device sends the third UWB signal. The third time, the second time, the first time of sending the first UWB signal, and the second time of receiving the third UWB signal are used to determine the fifth distance.
[0076] In some embodiments of this application, the electronic device may first calculate the first time difference between the second time and the first time, and the second time difference between the fourth time and the third time, then calculate the time and value of the first time difference and the second time difference, and then determine the fifth distance based on the time and value.
[0077] In some embodiments of this application, the electronic device may use the following formula to calculate the aforementioned fifth distance:
[0078] d =c*T / 2; (4)
[0079] Where, d The fifth distance mentioned above is represented by T, and the time and value mentioned above are represented by T.
[0080] In some embodiments of this application, the electronic device may use the following formula to calculate the aforementioned first time difference:
[0081] ∆t1=t2-t1;(5)
[0082] Where ∆t1 represents the first time difference mentioned above, t2 represents the second time point mentioned above, and t1 represents the first time point mentioned above.
[0083] In some embodiments of this application, the electronic device may use the following formula to calculate the aforementioned second time difference:
[0084] ∆t2=t4-t3;(5)
[0085] Where ∆t2 represents the first time difference mentioned above, t4 represents the fourth time point mentioned above, and t3 represents the third time point mentioned above.
[0086] Step 102d: The electronic device determines the second distance between the first electronic device and the second electronic device based on M fourth and fifth distances.
[0087] In some embodiments of this application, combined with Figure 2 ,like Figure 3 As shown, step 102d above can be achieved through the following steps 102d1 and 102d2:
[0088] Step 102d1: The electronic device determines the target distance from the M fourth distances that has a difference from the fifth distance that is greater than or equal to the third distance threshold.
[0089] In some embodiments of this application, the electronic device can calculate the difference between each of the M fourth distances and the aforementioned fifth distance, and then determine the target distance from the M fourth distances whose difference with the fifth distance is greater than or equal to the third distance threshold.
[0090] In some embodiments of this application, the target distance can be a distance with a large deviation from the fifth distance.
[0091] Step 102d2: The electronic device determines the average distance of the other distances (excluding the target distance) among the M fourth distances as the second distance between the first electronic device and the second electronic device.
[0092] In some embodiments of this application, since the target distance deviates significantly from the fifth distance, the electronic device removes the target distance from the M fourth distances and determines the average distance of the other calculated distances as the ranging result, which can improve the accuracy of the ranging result.
[0093] Thus, the electronic device determines the target distance from the M fourth distances where the difference from the fifth distance is greater than or equal to the third distance threshold; and determines the average distance of the other distances among the M fourth distances excluding the target distance as the second distance between the first and second electronic devices. This allows the electronic device to determine the average distance of the other distances among the M fourth distances excluding the target distance which has a large deviation from the fifth distance as the ranging result, thereby improving the accuracy of the ranging result.
[0094] In some embodiments of this application, the UWB module is enabled during the transmission of the first target Bluetooth sub-signal through the Bluetooth module, and the transmission time of the first UWB signal differs from the transmission time of the first target Bluetooth sub-signal by a first duration.
[0095] The step 102 above, "measuring the second distance between the first electronic device and the second electronic device based on the first Bluetooth signal and the first UWB signal," can be achieved through the following step 102e:
[0096] Step 102e: When the difference between the second duration and the first duration between the reception time of the first UWB signal and the reception time of the first target Bluetooth sub-signal is less than or equal to the duration threshold, the electronic device measures the second distance between the first electronic device and the second electronic device based on the first Bluetooth signal and the first UWB signal.
[0097] In some embodiments of this application, the UWB module is enabled during the transmission of the first target Bluetooth sub-signal via the Bluetooth module. This can be understood as the UWB module only being enabled while the electronic device is transmitting the first target Bluetooth sub-signal via the Bluetooth module. In other words, after the first target Bluetooth sub-signal is transmitted, the UWB module will no longer be enabled. Since the UWB module is only enabled during the transmission of one of the M first Bluetooth sub-signals via the Bluetooth module, the operating time of the UWB module can be greatly reduced. This allows the electronic device to improve ranging accuracy and reduce power consumption when measuring the distance between the first electronic device and the second electronic device based on the first Bluetooth signal and the first UWB signal.
[0098] In some embodiments of this application, the third UWB signal carries third time information indicating the fifth moment of receiving the first UWB signal, and the second target Bluetooth sub-signal carries fourth time information indicating the sixth moment of receiving the first target Bluetooth sub-signal.
[0099] In some embodiments of this application, after receiving the third UWB signal and the second target Bluetooth sub-signal, the electronic device can determine the second duration of the time difference between the reception time of the first UWB signal and the reception time of the first target Bluetooth sub-signal based on the third time information and the fourth time information.
[0100] In some embodiments of this application, the difference between the second duration and the first duration is less than or equal to a duration threshold, indicating that the first electronic device and the second electronic device are substantially synchronized. Therefore, when the first electronic device and the second electronic device are substantially synchronized, measuring the distance between them can avoid the problem of deviation in the distance measurement results caused by the asynchrony of their times, thereby improving the accuracy of the distance measurement results.
[0101] In some embodiments of this application, the value range of the above-mentioned time threshold can be [0, 0.5us].
[0102] In the ranging method provided in this application embodiment, when a Bluetooth connection is established between the first electronic device and the second electronic device, the UWB module is enabled. A second Bluetooth signal is transmitted through the Bluetooth module, and a first UWB signal is transmitted through the UWB module. Based on the second Bluetooth signal and the first UWB signal, a second distance between the first electronic device and the second electronic device is measured. Thus, the electronic device can enable the UWB module when a Bluetooth connection is established between the first and second electronic devices. Therefore, the electronic device can measure the second distance between the first and second electronic devices using the second Bluetooth signal transmitted by the Bluetooth module and the first UWB signal transmitted by the UWB module, which improves ranging accuracy and reduces the power consumption of the electronic device.
[0103] In some embodiments of this application, before enabling the UWB module described above, the ranging method provided in this application may further include the following steps 103 and 104:
[0104] Step 103: If the electronic device detects that the signal strength measured by the Bluetooth module is less than the first signal strength threshold and greater than or equal to the third signal strength threshold, and / or the location information indicates that the first electronic device is located in the edge area of the target location, then the Bluetooth module is enabled.
[0105] In some embodiments of this application, the third signal strength threshold is less than the first signal strength threshold.
[0106] In some embodiments of this application, enabling the Bluetooth module in the electronic device can be understood as enabling only the Bluetooth module and not the UWB module.
[0107] In some embodiments of this application, the signal strength measured by the Bluetooth module is less than a first signal strength threshold and greater than or equal to a third signal strength threshold, indicating that the signal strength measured by the Bluetooth module is relatively low, suggesting a large distance between the first electronic device and the second electronic device. This location information indicates that the first electronic device is located in the edge region of the target location, also indicating a large distance between the first electronic device and the second electronic device. However, in long-distance scenarios, the electronic device does not require high accuracy in ranging results. Therefore, the electronic device can simply enable the Bluetooth module and measure the distance between the first and second electronic devices using the first Bluetooth signal transmitted by the Bluetooth module, thereby effectively reducing the power consumption of the electronic device.
[0108] Step 104: The electronic device sends a first Bluetooth signal through the Bluetooth module and determines a first distance based on the first Bluetooth signal.
[0109] In some embodiments of this application, after an electronic device sends a first Bluetooth signal through a Bluetooth module, it can receive a fourth Bluetooth signal fed back by a second electronic device based on the first Bluetooth signal through the Bluetooth module, and then determine the first distance based on the first Bluetooth signal and the fourth Bluetooth signal.
[0110] It should be noted that the process of determining the first distance based on the first Bluetooth signal and the fourth Bluetooth signal can be found in the descriptions of step 102a and step 102b above. To avoid repetition, these descriptions will not be repeated here.
[0111] Thus, if the electronic device detects that the signal strength measured by the Bluetooth module is less than the first signal strength threshold and greater than or equal to the third signal strength threshold, it enables the Bluetooth module; the electronic device sends a first Bluetooth signal through the Bluetooth module and determines a first distance based on the first Bluetooth signal, so that the electronic device can enable only the Bluetooth module in long-distance scenarios and measure the distance between the first electronic device and the second electronic device through the first Bluetooth signal sent by the Bluetooth module, thereby effectively reducing the power consumption of the electronic device.
[0112] In some embodiments of this application, after step 102 described above, the ranging method provided in this application may further include the following steps 105 and 106:
[0113] Step 105: If the second information satisfies the second ranging mode switching condition, the electronic device enables the UWB module and disables the Bluetooth module.
[0114] In some embodiments of this application, the second information mentioned above includes at least one of the second distance mentioned above and the signal strength measured by the Bluetooth module mentioned above;
[0115] The conditions for switching to the second ranging mode mentioned above include at least one of the following:
[0116] The second distance mentioned above is less than the first distance threshold mentioned above;
[0117] The aforementioned location information indicates that the first electronic device is located in the central area of the target location;
[0118] The signal strength measured by the Bluetooth module is greater than the second signal strength threshold.
[0119] In some embodiments of this application, enabling the UWB module in the electronic device can be understood as enabling only the UWB module and not the Bluetooth module.
[0120] In some embodiments of this application, the second distance is less than the first distance threshold, and / or the signal strength measured by the Bluetooth module is greater than the second signal strength threshold, and / or the location information indicates that the first electronic device is located in the central area of the target location, indicating that the distance between the first electronic device and the second electronic device is small. However, in close-range scenarios, if the electronic device measures the distance between the first and second electronic devices based on the Bluetooth signal sent by the Bluetooth module, the accuracy of the ranging result is poor. Therefore, the electronic device can enable only the UWB module and measure the distance between the first and second electronic devices through the second UWB signal sent by the UWB module, thereby effectively improving the ranging accuracy.
[0121] Step 106: Send a second UWB signal through the UWB module, and determine a third distance between the first electronic device and the second electronic device based on the second UWB signal.
[0122] In some embodiments of this application, after the electronic device sends a second UWB signal through the UWB module, it can receive a fourth UWB signal fed back by the second electronic device based on the second UWB signal through the UWB module, and then determine the third distance based on the second UWB signal and the fourth UWB signal.
[0123] It should be noted that the process of determining the third distance based on the second and fourth UWB signals can be found in the description of step 102c above. To avoid repetition, this embodiment will not repeat the description here.
[0124] Thus, if the electronic device determines that the second distance is less than the first distance threshold, and / or the signal strength measured by the Bluetooth module is greater than the second signal strength threshold, it enables the UWB module and disables the Bluetooth module; the electronic device sends a second UWB signal through the UWB module, and determines a third distance between the first electronic device and the second electronic device based on the second UWB signal, so that the electronic device can, in close-range scenarios, only enable the UWB module and measure the distance between the first electronic device and the second electronic device through the second UWB signal sent by the UWB module, thereby effectively improving the ranging accuracy.
[0125] In some embodiments of this application, prior to step 102 described above, the embodiments of this application further include the following step 107:
[0126] Step 107: The electronic device synchronizes the time between the Bluetooth module and the UWB module.
[0127] In some embodiments of this application, step 107 can be implemented by the following steps 107a and 107b:
[0128] Step 107a: When the electronic device detects a Bluetooth connection event via the Bluetooth module, it generates an initial timestamp.
[0129] In some embodiments of this application, the aforementioned initial timestamp is used to indicate the initial time of ranging.
[0130] In some embodiments of this application, the electronic device detects a Bluetooth connection event through the Bluetooth module, which can be understood as establishing a Bluetooth connection between the first electronic device and the second electronic device.
[0131] In some embodiments of this application, the moment when the device detects a Bluetooth connection event via the Bluetooth module is the initial moment when the electronic device determines that the ranging conditions are met, i.e., the initial time of ranging.
[0132] Step 107b: The electronic device transmits the initial timestamp to the UWB module to synchronize the initial timestamps between the UWB module and the Bluetooth module.
[0133] In some embodiments of this application, the electronic device can transmit the aforementioned initial timestamp to the UWB module through the communication interface between the Bluetooth module and the UWB module to synchronize the initial timestamps between the UWB module and the Bluetooth module.
[0134] In some embodiments of this application, the communication interface can be a Serial Peripheral Interface (SPI), an Inter-Integrated Circuit (IIC) interface, or other communication interfaces. The specific interface can be determined according to actual needs, and will not be described in detail here.
[0135] In some embodiments of this application, the Bluetooth module and the UWB module can use the same clock. After receiving the initial timestamp, the Bluetooth module and the UWB module can use the initial distance measurement time indicated by the initial timestamp as the initial time for timing, and start timing with the same clock. This ensures that the Bluetooth module and the UWB module are synchronized in real time. Consequently, when the electronic device enables both the Bluetooth module and the UWB module, sends the second Bluetooth signal through the Bluetooth module and the first UWB signal through the UWB module, the signals are sent under synchronized time conditions. This ensures that when the electronic device measures the distance between the first electronic device and the second electronic device based on the second Bluetooth signal and the first UWB signal, the distance measurement results will not be deviated due to time asynchrony, thereby improving the accuracy of the results.
[0136] In this way, the electronic device generates an initial timestamp when it detects a Bluetooth connection event via the Bluetooth module; it then transmits this initial timestamp to the UWB module to synchronize the initial timestamps between the UWB and Bluetooth modules. This ensures that both the Bluetooth and UWB modules start timing from the initial time of the distance measurement indicated by the initial timestamp, guaranteeing real-time synchronization. Consequently, when the electronic device enables both the Bluetooth and UWB modules, sending the second Bluetooth signal via the Bluetooth module and the first UWB signal via the UWB module, these actions are performed in synchronized time. This prevents discrepancies in the distance measurement results caused by time asynchrony when the electronic device measures the distance between the first and second electronic devices based on the second Bluetooth signal and the first UWB signal, thus improving the accuracy of the results.
[0137] The ranging method provided in this application will be described below with reference to specific implementation methods, taking a mobile phone as an example.
[0138] This implementation method is based on the existing Bluetooth (2.4GHz) and UWB modules of mobile phones, and achieves the goal through three major technologies: cross-band time synchronization, signal frame collaborative design, and dynamic weight fusion.
[0139] For example, the hardware architecture required for this embodiment can be as follows: Figure 4As shown, the system includes a controller 401, a Bluetooth module 402, and a UWB module 403 connected to the controller 401. The controller 401 generates hybrid modulation information, controls the transmission and reception of the Bluetooth module 402 and UWB module 403, and parses the information received by the Bluetooth module 402 and UWB module 403. The Bluetooth module 402 and UWB module 403 use the same crystal oscillator and / or external clock. Synchronization information is transmitted between the Bluetooth and UWB modules via a communication interface 404, such as SPI, IIC, or other communication interfaces.
[0140] For example, the process of distance measurement using the hardware architecture shown in the figure is detailed below:
[0141] I. Time Synchronization
[0142] Bluetooth timestamp capture records a local event stamp T_ble at the start of a Bluetooth module connection event and synchronizes it to the UWB module via the transmission interface between the Bluetooth and UWB modules to synchronize the initial timestamps between the UWB and Bluetooth modules. The UWB and Bluetooth modules must use the same clock system.
[0143] II. Frame Hybrid Structure Design
[0144] The design of the signal frame structure for hybrid Bluetooth and UWB modulation needs to consider compatibility (compatibility with existing Bluetooth / UWB standards), coordination (time / data domain linkage), and energy efficiency (on-demand embedding of UWB pulses). The structures of Bluetooth and UWB signal frames can be as follows: Figure 5 As shown, the specific design is illustrated in the following example (which includes Bluetooth main frames and UWB subframes):
[0145] 1. Synchronization fields:
[0146] Bluetooth preamble: The BLE standard preamble (10 0xAA symbols, 2μs per symbol under 2M PHY) is reserved for carrier synchronization and symbol timing recovery of the receiver Bluetooth module.
[0147] Joint synchronization sequence: Located after the hybrid control frame, it reuses the UWB preamble format from 802.15.4z and inserts a UWB synchronization pulse sequence (10 pulses, each pulse width 2ns, frequency 500MHz), with pulse positions following a pseudo-random sequence. It simultaneously provides a synchronization reference for the UWB module and achieves joint wake-up of the "Bluetooth + UWB" receiver through correlation detection of the pulse sequence.
[0148] 2. Control fields (used for Bluetooth information synchronization, identity verification, and indicating whether to invoke UWB, UWB pulse parameters, UWB time slot offset, etc.):
[0149] Bluetooth access address (16μs): 4-byte standard BLE access address, using the BT CS standard ranging protocol in the current protocol, for device identification and frame synchronization.
[0150] Hybrid Control Field (16μs): Referencing the Bluetooth control field, this is also set as a 4-byte field, specifically configured for UWB subframes, and includes:
[0151] UWB Enable Bit (1 bit): Whether to enable UWB subframes (0 = Bluetooth only, 1 = Mixed mode). The enable bit is used to indicate whether and when the UWB module is invoked in mixed test mode.
[0152] UWB pulse parameters (5 bits): number of pulse groups (1-32 groups), pulse repetition frequency (PRF: 62.4 / 124.8MHz), used to instruct the receiving end to determine the pulse duration, number, pulse frequency, etc., and to adjust the sampling frequency and some reception settings based on this information.
[0153] UWB Slot Offset (10 bits): The offset time of the UWB pulse relative to the start of the Bluetooth frame (0-1023ns), such as... Figure 5 As shown, the UWB pulse start time is T1, and the mixed frame start time is T0. This is mainly to mark the offset of T1 relative to T0 (the start time of each field is specified during the upper layer encapsulation). This is mainly to perform a verification to see if the actual time of Bluetooth and UWB received by the receiver (T_Bluetooth, T_UWB) corresponds to the preset offset. This can be used to determine multipath propagation and Bluetooth / UWB time synchronization.
[0154] Parity bit (2 bits): Controls simple parity checking of the field.
[0155] 3. Data and ranging segment (length depends on the actual length of the transmitted information; here, a maximum of 200µs is set).
[0156] This phase involves parallel Bluetooth data transmission and UWB ranging, with the two completely overlapping in time (due to their independent frequency bands).
[0157] Bluetooth data segment: follows the Bluetooth CS data segment modulation scheme and includes the following information;
[0158] UWB data subframes (embedded during Bluetooth data transmission, after the joint synchronization sequence):
[0159] STS (Scrambled Timestamp Sequence, 8μs): A 64-bit pseudo-random pulse sequence (generated based on AES-128) used for timestamp marking and anti-relay attacks in UWB ranging;
[0160] Ranging pulse group (n×4μs): Each group contains 16 pulses (8GHz center frequency, 500MHz bandwidth), and pulse position modulation (PPM) carries ranging auxiliary information (such as transmitter timestamp, phase, etc.).
[0161] For example, if configured with 2 pulses, the total duration is 8μs, which is transmitted in parallel with the first 8μs of the Bluetooth data segment.
[0162] 4. Closing and Feedback Section:
[0163] Bluetooth tail code (8μs): GFSK tail code (0x00) for standard Bluetooth Low Energy, used for modulator smooth shutdown.
[0164] III. Dynamic Mode Switching
[0165] Three different working modes are set according to the accuracy range:
[0166] Mode 1: Bluetooth standalone ranging (ranging accuracy 1-3m);
[0167] Only activate Bluetooth CS ranging to calculate the distance using phase difference (accuracy 1-3 meters).
[0168] UWB module is off (power consumption <1μA), Bluetooth only broadcasts periodically (duty cycle 1%, power consumption <2mW).
[0169] Mode 2: Bluetooth + UWB collaborative ranging (±30cm error);
[0170] Using the above-mentioned hybrid ranging frames, Bluetooth continuously maintains BT CS ranging, and enables UWB subframes once every 1 second to perform joint ranging in order to correct BT CS ranging errors.
[0171] Improve BT CS ranging accuracy, while UWB has an extremely low duty cycle, maintaining a certain level of accuracy while greatly reducing power consumption;
[0172] In mode 2, the UWB module is kept enabled to enable rapid response. For example, in the receiving state, when the UWB enable bit in the hybrid control field is parsed as 1, the UWB module is quickly activated to receive information. (When UWB is not transmitting, receiving, or processing, the power consumption is very low as it is only in the enabled state.)
[0173] The collaborative ranging interaction process (which generally uses the BT CS interaction process, with hybrid ranging frames inserted only in the PBR phase calculation and ranging parts) is shown in the figure below:
[0174] In the PBR (Phase-Based Ranging) ranging phase, UWB subframes are inserted using mode-2 (using hybrid ranging frames). During this phase:
[0175] A. The initiator (Bluetooth part) sends a hybrid ranging frame at f1 frequency and inserts a UWB subframe (Note: synchronization timestamp before interaction), wherein the initial timestamp t1 of the hybrid frame is inserted into the initiator UWB;
[0176] B: The receiver receives the signal and records the phase. 1. The initial reception time t2; then, mixed frame information is sent to the initiator at f2, where Bluetooth carries information including phase information. 1. The initial reception time t1; the UWB carries the transmission timestamp t3;
[0177] C: The initator receives a reply from the responder, which records the received time t3 and the received phase information. 2. And demodulate the information carried by the responder (phase) 1. Initial reception time t2, timestamp t3).
[0178] ①Use 1. For the PBR calculation of BT CS distance information for model 2, please refer to the above formulas (1) to (3). To avoid repetition, it will not be repeated here.
[0179] ② Use the UWB time difference to calculate the UWB distance. For details, please refer to the above formulas (4) to (6). To avoid repetition, it will not be repeated here.
[0180] The time measurement using UWB is corrected to correct the BT CS ranging error, and the final distance information is output. Using this hybrid modulation method, only a small number of UWB subframes need to be inserted into the PBR ranging process (based on the mode 2 format) during the BT CS ranging process.
[0181] In this mode, the BT CS ranging results are output as the final calculated parameters through a moving average. Taking 10 ranging measurements per second as an example, the UWB measurement value is updated every 10 moving average measurements. During the moving average process, values with large errors compared to the UWB ranging results are removed (for example, if the UWB ranging is 100cm, and the BT CS ranging result is 150cm, then this result is removed).
[0182] Mode 3: High-precision ranging mode (±10cm error)
[0183] BT CS ranging is disabled, and the Fira standard protocol is used, with only UWB used for distance calculation.
[0184] Terminal usage scenarios
[0185] This embodiment does not limit the specific use scenario. The three ranging modes can be dynamically switched according to the actual use scenario, or only mode 2 can be used. Taking the interaction scenario of a smart door lock with UWB function as an example:
[0186] 1. Long-distance wake-up: When the user carries a mobile phone, the door lock detects the mobile phone's RSSI > -80dBm and RSSI ≤ -70dBm via Bluetooth, triggering mode 1 (Bluetooth standalone CS ranging); maintaining low-power ranging.
[0187] 2. Mid-range coordination: At a distance of 3 meters, if RSSI > -70dBm and RSSI ≤ -50dBm, or if BT CS ranging is less than 3 meters but greater than or equal to 0.5 meters, trigger mode 2. In this mode, the UWB module remains active, improving accuracy to some extent, but power consumption is increased to a certain extent.
[0188] 3. Close-range unlocking: When the cooperative ranging is less than 0.5m or RSSI > -50, measurement mode 1 performs encryption unlocking (utilizing the high precision and high security of UWB), prioritizing accuracy but with higher power consumption.
[0189] The specific implementation steps are as follows:
[0190] Judgment threshold 1: RSSI > 80 dBm and RSSI ≤ -70 dBm;
[0191] Judgment threshold 2: RSSI > -70 and RSSI ≤ -50dBm or 0.5m ≤d < 3m;
[0192] Judgment threshold 3: RSSI > -50 or d < 1m;
[0193] Combination Figure 6 As shown, in a scenario where a user unlocks a smart door lock with their mobile phone upon returning home, the ranging method provided in this embodiment may include the following steps 601 to 604:
[0194] 601. When a user approaches their home door from outdoors, the mobile terminal detects the Bluetooth beacon information sent by the door lock, initiates a connection request with the door lock, and completes the Bluetooth connection operation with the door lock.
[0195] 602. The terminal uses the BLE module to detect the RSSI of the door lock in real time. When the judgment threshold 1 is met, that is, RSSI>-80dBm, mode 1 ranging is initiated, that is, the terminal initiates a CS ranging request to the door lock module (using the BT CS ranging process defined by the current protocol to perform ranging) and maintains BT CS ranging interaction with the door lock.
[0196] 603. When a user continuously approaches the entrance door, and the terminal detects a continuous increase in the RSSI signal, or the terminal's CS measurement distance is less than 3m, the judgment threshold 2 is met. In the next BT CS ranging process, the terminal initiates a request to use mode 2 (as shown in the mode 2 diagram) in the Bluetooth ranging request part, replacing the PBR ranging packet Mode-2 frame format with a mixed frame ranging. The terminal keeps the UWB module enabled, and the door lock detects the mode 2 ranging request initiated by the terminal, pulls up the UWB module and keeps it enabled.
[0197] In this mode, the terminal enables UWB once every 1 second according to the set UWB wake-up cycle (taking the previously mentioned 1 second wake-up as an example) to complete one round of BT CS+UWB hybrid ranging.
[0198] 604. When the terminal detects RSSI>-50dBm or the distance is less than 1m, i.e., threshold 3, the terminal initiates to close BT CS ranging and wakes up UWB ranging request. The test mode is switched to mode 3, using UWB high-precision and high-reliability ranging. When the distance measured by UWB is less than 0.5m, the door lock is opened, and the entire unlocking process is completed.
[0199] The ranging method provided in this embodiment, compared to the traditional method of using UWB and Bluetooth simultaneously, or the traditional collaborative method (using Bluetooth ranging or UWB ranging based on distance or RSSI, etc.), has two advantages. First, it designs a hybrid modulation frame structure. During the BT CS ranging process, a small number of UWB subframes are inserted only in the PBR phase calculation stage. This satisfies the Bluetooth Low Energy requirement, and the insertion of a small number of UWB subframes does not significantly increase UWB power consumption, thus improving accuracy while greatly saving power. Second, it combines BT CS ranging, hybrid ranging, and UWB ranging modes. In particular, the hybrid ranging mode utilizes the previously designed hybrid modulation frame and uses UWB to correct BT CS ranging errors. Users can call different ranging methods under different scenario requirements, meeting user needs in different scenarios while reducing power consumption.
[0200] It should be noted that each of the above method embodiments, or various possible implementations of each method embodiment, can be executed individually or in combination of any two or more. The specific implementation can be determined according to actual usage requirements, and this application embodiment does not impose any restrictions on this.
[0201] The ranging method provided in this application can be executed by a ranging device. This application uses a ranging device executing the ranging method as an example to illustrate the ranging device provided in this application.
[0202] Figure 7 This is a schematic diagram of the structure of the ranging device 700 provided in the embodiments of this application. The ranging device 700 is applied to a first electronic device including a Bluetooth module and an ultra-wideband UWB module. The ranging device 700 includes an enable module 701 and a ranging module 702.
[0203] The enable module 701 is used to enable the UWB module when the first electronic device and the second electronic device establish a Bluetooth connection.
[0204] The ranging module 702 is used to send a second Bluetooth signal through the Bluetooth module and a first UWB signal through the UWB module, and to measure a second distance between the first electronic device and the second electronic device based on the second Bluetooth signal and the first UWB signal.
[0205] In some embodiments of this application, the second Bluetooth signal includes M first Bluetooth sub-signals, and the ranging module 702 is specifically used for:
[0206] The device receives a third Bluetooth signal fed back by the second electronic device based on the second Bluetooth signal and a third UWB signal fed back by the second electronic device based on the first UWB signal. The third Bluetooth signal includes M second Bluetooth sub-signals, and each second Bluetooth sub-signal is a Bluetooth signal fed back by the second electronic device based on one of the M first Bluetooth sub-signals.
[0207] Based on the first target Bluetooth sub-signal and the second target Bluetooth sub-signal, a fourth distance is determined. The first target Bluetooth sub-signal is any one of the M first Bluetooth sub-signals, and the second target Bluetooth sub-signal is the Bluetooth signal corresponding to the first target Bluetooth sub-signal among the M second Bluetooth sub-signals.
[0208] The fifth distance is determined based on the first UWB signal and the third UWB signal;
[0209] Based on M fourth distances and the fifth distance, a second distance is determined between the first electronic device and the second electronic device;
[0210] Where M is a positive integer.
[0211] In some embodiments of this application, the ranging module 702 is specifically used for:
[0212] From the M fourth distances, determine the target distance whose difference from the fifth distance is greater than or equal to the third distance threshold;
[0213] The average distance of the M fourth distances, excluding the target distance, is determined as the second distance between the first electronic device and the second electronic device.
[0214] In some embodiments of this application, the UWB module is enabled during the transmission of the first target Bluetooth sub-signal through the Bluetooth module, and the transmission time of the first UWB signal differs from the transmission time of the first target Bluetooth sub-signal by a first duration.
[0215] The ranging module 702 is specifically used for:
[0216] If the difference between the second duration and the first duration between the reception time of the first UWB signal and the reception time of the first target Bluetooth sub-signal is less than or equal to a duration threshold, a second distance between the first electronic device and the second electronic device is measured based on the first Bluetooth signal and the first UWB signal.
[0217] In some embodiments of this application, the enabling module is specifically used for:
[0218] If the first information satisfies the first ranging mode switching condition, then the UWB module is enabled; wherein the first information includes at least one of the following: a first distance, the location information of the first electronic device, and the signal strength measured by the Bluetooth module; the first distance is the distance between the first electronic device and the second electronic device determined based on the first Bluetooth signal sent by the Bluetooth module;
[0219] The first ranging mode switching condition includes at least one of the following:
[0220] The first distance is greater than or equal to a first distance threshold and less than or equal to a second distance threshold;
[0221] The signal strength measured by the Bluetooth module is greater than or equal to the first signal strength threshold and less than or equal to the second signal strength threshold;
[0222] The location information indicates that the first electronic device is located in the buffer zone of the target location;
[0223] Wherein, the second signal strength threshold is greater than the first signal strength threshold, and the second distance threshold is less than the first distance threshold.
[0224] In some embodiments of this application, the ranging module 702 is further configured to:
[0225] If the first information satisfies the first ranging mode switching condition, then before enabling the UWB module, if it is detected that the signal strength measured by the Bluetooth module is less than the first signal strength threshold and greater than or equal to the third signal strength threshold, and / or the location information indicates that the first electronic device is located in the edge area of the target location, then the Bluetooth module is enabled.
[0226] The first Bluetooth signal is sent through the Bluetooth module, and the first distance is determined based on the first Bluetooth signal;
[0227] Wherein, the third signal strength threshold is less than the first signal strength threshold, and the distance between any coordinate position in the edge region and the center position of the target location is greater than the distance between any coordinate position in the buffer region and the center position of the target location.
[0228] In some embodiments of this application, the enabling module 701 is further configured to:
[0229] Based on the second Bluetooth signal and the first UWB signal, after measuring the second distance between the first electronic device and the second electronic device, if the second information satisfies the second ranging mode switching condition, then the UWB module is enabled and the Bluetooth module is turned off.
[0230] The ranging module 702 is also used to send a second UWB signal through the UWB module, and determine a third distance between the first electronic device and the second electronic device based on the second UWB signal;
[0231] The second information includes at least one of the second distance, the location information, and the signal strength measured by the Bluetooth module.
[0232] The second ranging mode switching condition includes at least one of the following:
[0233] The second distance is less than or greater than the second distance threshold;
[0234] The location information indicates that the first electronic device is located in the central area of the target location;
[0235] The signal strength measured by the Bluetooth module is less than the first signal strength threshold;
[0236] Wherein, the distance between any coordinate position in the buffer area and the center position of the target location is greater than the distance between any coordinate position in the central area and the center position of the target location.
[0237] In some embodiments of this application, combined with Figure 7 ,like Figure 8As shown, the device 700 further includes:
[0238] The synchronization module 703 is used to synchronize the time of the Bluetooth module and the UWB module before sending the second Bluetooth signal through the Bluetooth module and before sending the first UWB signal through the UWB module.
[0239] In some embodiments of this application, the synchronization module 703 is specifically used for:
[0240] An initial timestamp is generated at the moment a Bluetooth connection event is detected by the Bluetooth module.
[0241] The initial timestamp is transmitted to the UWB module to synchronize the initial timestamps between the UWB module and the Bluetooth module.
[0242] The ranging device provided in this application enables the UWB module when a Bluetooth connection is established between the first electronic device and the second electronic device. It transmits a second Bluetooth signal via the Bluetooth module and a first UWB signal via the UWB module, and measures a second distance between the first and second electronic devices based on the second Bluetooth signal and the first UWB signal. Thus, the ranging device enables the UWB module when a Bluetooth connection is established between the first and second electronic devices. Therefore, the ranging device can measure the second distance between the first and second electronic devices using the second Bluetooth signal transmitted by the Bluetooth module and the first UWB signal transmitted by the UWB module, which improves ranging accuracy and reduces the power consumption of the ranging device.
[0243] The ranging device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device, augmented reality / virtual reality device, robot, wearable device, super mobile personal computer, netbook, or personal digital assistant, etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the specific device.
[0244] The ranging device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.
[0245] The ranging device provided in this application can realize the various processes implemented in the various embodiments of the above ranging method. To avoid repetition, it will not be described again here.
[0246] Optionally, such as Figure 9 As shown, this application embodiment also provides an electronic device 900, including a processor 901 and a memory 902. The memory 902 stores a program or instructions that can be executed by the processor 901. When the program or instructions are executed by the processor 901, they implement the various steps of the above-described ranging method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0247] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0248] Figure 10 A schematic diagram of the hardware structure of an electronic device implementing an embodiment of this application.
[0249] The electronic device 1000 includes, but is not limited to, components such as: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010. The radio frequency unit 1001 includes a Bluetooth module and a UWB module.
[0250] Those skilled in the art will understand that the electronic device 1000 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1010 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 10 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0251] The processor 1010 is used to enable the UWB module when a Bluetooth connection is established between the first electronic device and the second electronic device.
[0252] The second Bluetooth signal is sent through the Bluetooth module, and the first UWB signal is sent through the UWB module. Based on the second Bluetooth signal and the first UWB signal, a second distance between the first electronic device and the second electronic device is measured.
[0253] In some embodiments of this application, the second Bluetooth signal includes M first Bluetooth sub-signals, and the processor 1010 is specifically used for:
[0254] The device receives a third Bluetooth signal fed back by the second electronic device based on the second Bluetooth signal and a third UWB signal fed back by the second electronic device based on the first UWB signal. The third Bluetooth signal includes M second Bluetooth sub-signals, and each second Bluetooth sub-signal is a Bluetooth signal fed back by the second electronic device based on one of the M first Bluetooth sub-signals.
[0255] Based on the first target Bluetooth sub-signal and the second target Bluetooth sub-signal, a fourth distance is determined. The first target Bluetooth sub-signal is any one of the M first Bluetooth sub-signals, and the second target Bluetooth sub-signal is the Bluetooth signal corresponding to the first target Bluetooth sub-signal among the M second Bluetooth sub-signals.
[0256] The fifth distance is determined based on the first UWB signal and the third UWB signal;
[0257] Based on M fourth distances and the fifth distance, a second distance is determined between the first electronic device and the second electronic device;
[0258] Where M is a positive integer.
[0259] In some embodiments of this application, the processor 1010 is specifically used for:
[0260] From the M fourth distances, determine the target distance whose difference from the fifth distance is greater than or equal to the third distance threshold;
[0261] The average distance of the M fourth distances, excluding the target distance, is determined as the second distance between the first electronic device and the second electronic device.
[0262] In some embodiments of this application, the UWB module is enabled during the transmission of the first target Bluetooth sub-signal through the Bluetooth module, and the transmission time of the first UWB signal differs from the transmission time of the first target Bluetooth sub-signal by a first duration.
[0263] The processor 1010 is specifically used for:
[0264] If the difference between the second duration and the first duration between the reception time of the first UWB signal and the reception time of the first target Bluetooth sub-signal is less than or equal to a duration threshold, a second distance between the first electronic device and the second electronic device is measured based on the first Bluetooth signal and the first UWB signal.
[0265] In some embodiments of this application, the enabling module is specifically used for:
[0266] If the first information satisfies the first ranging mode switching condition, then the UWB module is enabled; wherein the first information includes at least one of the following: a first distance, the location information of the first electronic device, and the signal strength measured by the Bluetooth module; the first distance is the distance between the first electronic device and the second electronic device determined based on the first Bluetooth signal sent by the Bluetooth module;
[0267] The first ranging mode switching condition includes at least one of the following:
[0268] The first distance is greater than or equal to a first distance threshold and less than or equal to a second distance threshold;
[0269] The signal strength measured by the Bluetooth module is greater than or equal to the first signal strength threshold and less than or equal to the second signal strength threshold;
[0270] The location information indicates that the first electronic device is located in the buffer zone of the target location;
[0271] Wherein, the second signal strength threshold is greater than the first signal strength threshold, and the second distance threshold is less than the first distance threshold.
[0272] In some embodiments of this application, the processor 1010 is further configured to:
[0273] If the first information satisfies the first ranging mode switching condition, then before enabling the UWB module, if it is detected that the signal strength measured by the Bluetooth module is less than the first signal strength threshold and greater than or equal to the third signal strength threshold, and / or the location information indicates that the first electronic device is located in the edge area of the target location, then the Bluetooth module is enabled.
[0274] The first Bluetooth signal is sent through the Bluetooth module, and the first distance is determined based on the first Bluetooth signal;
[0275] Wherein, the third signal strength threshold is less than the first signal strength threshold, and the distance between any coordinate position in the edge region and the center position of the target location is greater than the distance between any coordinate position in the buffer region and the center position of the target location.
[0276] In some embodiments of this application, the processor 1010 is further configured to:
[0277] Based on the second Bluetooth signal and the first UWB signal, after measuring the second distance between the first electronic device and the second electronic device, if the second information satisfies the second ranging mode switching condition, then the UWB module is enabled;
[0278] The processor 1010 is also configured to send a second UWB signal through the UWB module, and determine a third distance between the first electronic device and the second electronic device based on the second UWB signal;
[0279] The second information includes at least one of the second distance, the location information, and the signal strength measured by the Bluetooth module.
[0280] The second ranging mode switching condition includes at least one of the following:
[0281] The second distance is less than the first distance threshold;
[0282] The location information indicates that the first electronic device is located in the central area of the target location;
[0283] The signal strength measured by the Bluetooth module is greater than the second signal strength threshold.
[0284] Wherein, the distance between any coordinate position in the buffer area and the center position of the target location is greater than the distance between any coordinate position in the central area and the center position of the target location.
[0285] In some embodiments of this application, the processor 1010 is further configured to:
[0286] Before sending the second Bluetooth signal through the Bluetooth module and the first UWB signal through the UWB module, the Bluetooth module and the UWB module are synchronized in time.
[0287] In some embodiments of this application, the processor 1010 is specifically used for:
[0288] An initial timestamp is generated at the moment a Bluetooth connection event is detected by the Bluetooth module.
[0289] The initial timestamp is transmitted to the UWB module to synchronize the initial timestamps between the UWB module and the Bluetooth module.
[0290] In the ranging method provided in this application embodiment, when a Bluetooth connection is established between the first electronic device and the second electronic device, the UWB module is enabled. A second Bluetooth signal is transmitted through the Bluetooth module, and a first UWB signal is transmitted through the UWB module. Based on the second Bluetooth signal and the first UWB signal, a second distance between the first electronic device and the second electronic device is measured. Thus, the electronic device can enable the UWB module when a Bluetooth connection is established between the first and second electronic devices. Therefore, the electronic device can measure the second distance between the first and second electronic devices using the second Bluetooth signal transmitted by the Bluetooth module and the first UWB signal transmitted by the UWB module, which improves ranging accuracy and reduces the power consumption of the electronic device.
[0291] It should be understood that, in this embodiment, the input unit 1004 may include a graphics processing unit (GPU) 10041 and a microphone 10042. The GPU 10041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1006 may include a display panel 10061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 1007 includes at least one of a touch panel 10071 and other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, joysticks, etc., which will not be described in detail here.
[0292] The memory 1009 can be used to store software programs and various data. The memory 1009 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 1009 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1009 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0293] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into the processor 1010.
[0294] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described ranging method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0295] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0296] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described ranging method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0297] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0298] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above-described ranging method embodiments and achieve the same technical effects. To avoid repetition, further details are omitted here.
[0299] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0300] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0301] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A distance measurement method, characterized in that, The method, applied to a first electronic device including a Bluetooth module and an ultra-wideband (UWB) module, comprises: When the first electronic device and the second electronic device establish a Bluetooth connection, the UWB module is enabled; The second Bluetooth signal is sent through the Bluetooth module, and the first UWB signal is sent through the UWB module. Based on the second Bluetooth signal and the first UWB signal, a second distance between the first electronic device and the second electronic device is measured.
2. The method according to claim 1, characterized in that, The second Bluetooth signal includes M first Bluetooth sub-signals. The step of measuring the second distance between the first electronic device and the second electronic device based on the second Bluetooth signal and the first UWB signal includes: The device receives a third Bluetooth signal fed back by the second electronic device based on the second Bluetooth signal and a third UWB signal fed back by the second electronic device based on the first UWB signal. The third Bluetooth signal includes M second Bluetooth sub-signals, and each second Bluetooth sub-signal is a Bluetooth signal fed back by the second electronic device based on one of the M first Bluetooth sub-signals. A fourth distance is determined based on the first target Bluetooth sub-signal and the second target Bluetooth sub-signal. The first target Bluetooth sub-signal is any one of the M first Bluetooth sub-signals, and the second target Bluetooth sub-signal is the Bluetooth sub-signal corresponding to the first target Bluetooth sub-signal among the M second Bluetooth sub-signals. The fifth distance is determined based on the first UWB signal and the third UWB signal; Based on M fourth distances and the fifth distance, a second distance is determined between the first electronic device and the second electronic device; Where M is a positive integer.
3. The method according to claim 2, characterized in that, Determining the second distance between the first electronic device and the second electronic device based on M fourth distances and the fifth distance includes: From the M fourth distances, determine the target distance whose difference from the fifth distance is greater than or equal to the third distance threshold; The average distance of the M fourth distances, excluding the target distance, is determined as the second distance between the first electronic device and the second electronic device.
4. The method according to claim 2 or 3, characterized in that, The UWB module is enabled during the transmission of the first target Bluetooth sub-signal through the Bluetooth module, and the transmission time of the first UWB signal differs from the transmission time of the first target Bluetooth sub-signal by a first duration. The measurement of the second distance between the first electronic device and the second electronic device based on the first Bluetooth signal and the first UWB signal includes: If the difference between the second duration and the first duration between the reception time of the first UWB signal and the reception time of the first target Bluetooth sub-signal is less than or equal to a duration threshold, a second distance between the first electronic device and the second electronic device is measured based on the first Bluetooth signal and the first UWB signal.
5. The method according to claim 1, characterized in that, Enabling the UWB module includes: If the first information satisfies the first ranging mode switching condition, then the UWB module is enabled; wherein the first information includes at least one of the following: a first distance, the location information of the first electronic device, and the signal strength measured by the Bluetooth module; the first distance is the distance between the first electronic device and the second electronic device determined based on the first Bluetooth signal sent by the Bluetooth module; The first ranging mode switching condition includes at least one of the following: The first distance is greater than or equal to a first distance threshold and less than or equal to a second distance threshold; The signal strength measured by the Bluetooth module is greater than or equal to the first signal strength threshold and less than or equal to the second signal strength threshold; The location information indicates that the first electronic device is located in the buffer zone of the target location; Wherein, the second signal strength threshold is greater than the first signal strength threshold, and the second distance threshold is less than the first distance threshold.
6. The method according to claim 5, characterized in that, Before enabling the UWB module if the first information satisfies the first ranging mode switching condition, the method further includes: If the signal strength measured by the Bluetooth module is detected to be less than the first signal strength threshold and greater than or equal to the third signal strength threshold, and / or the location information indicates that the first electronic device is located in the edge area of the target location, then the Bluetooth module is enabled; The first Bluetooth signal is sent through the Bluetooth module, and the first distance is determined based on the first Bluetooth signal; Wherein, the third signal strength threshold is less than the first signal strength threshold, and the distance between any coordinate position in the edge region and the center position of the target location is greater than the distance between any coordinate position in the buffer region and the center position of the target location.
7. The method according to claim 5 or 6, characterized in that, After measuring the second distance between the first electronic device and the second electronic device based on the second Bluetooth signal and the first UWB signal, the method further includes: If the second information satisfies the second ranging mode switching condition, then the UWB module is enabled and the Bluetooth module is turned off; The UWB module sends a second UWB signal, and based on the second UWB signal, a third distance is determined between the first electronic device and the second electronic device. The second information includes at least one of the second distance, the location information, and the signal strength measured by the Bluetooth module. The second ranging mode switching condition includes at least one of the following: The second distance is less than the first distance threshold; The signal strength measured by the Bluetooth module is greater than the second signal strength threshold. The location information indicates that the first electronic device is located in the central area of the target location; Wherein, the distance between any coordinate position in the buffer area and the center position of the target location is greater than the distance between any coordinate position in the central area and the center position of the target location.
8. The method according to claim 1, characterized in that, Before sending the second Bluetooth signal through the Bluetooth module and the first UWB signal through the UWB module, the method further includes: The Bluetooth module and the UWB module are synchronized in time.
9. The method according to claim 8, characterized in that, The time synchronization of the Bluetooth module and the UWB module includes: An initial timestamp is generated at the moment when a Bluetooth connection event is detected by the Bluetooth module. The initial timestamp is transmitted to the UWB module to synchronize the initial timestamps between the UWB module and the Bluetooth module.
10. A ranging device, characterized in that, A first electronic device comprising a Bluetooth module and an ultra-wideband (UWB) module, the device comprising: An enabling module is used to enable the UWB module when the first electronic device and the second electronic device have established a Bluetooth connection. The ranging module is used to send a second Bluetooth signal through the Bluetooth module and a first UWB signal through the UWB module, and to measure a second distance between the first electronic device and the second electronic device based on the second Bluetooth signal and the first UWB signal.
11. The apparatus according to claim 10, characterized in that, The second Bluetooth signal includes M first Bluetooth sub-signals, and the ranging module is specifically used for: The device receives a third Bluetooth signal fed back by the second electronic device based on the second Bluetooth signal and a third UWB signal fed back by the second electronic device based on the first UWB signal. The third Bluetooth signal includes M second Bluetooth sub-signals, and each second Bluetooth sub-signal is a Bluetooth signal fed back by the second electronic device based on one of the M first Bluetooth sub-signals. A fourth distance is determined based on the first target Bluetooth sub-signal and the second target Bluetooth sub-signal. The first target Bluetooth sub-signal is any one of the M first Bluetooth sub-signals, and the second target Bluetooth sub-signal is the Bluetooth sub-signal corresponding to the first target Bluetooth sub-signal among the M second Bluetooth sub-signals. The fifth distance is determined based on the first UWB signal and the third UWB signal; Based on M fourth distances and the fifth distance, a second distance is determined between the first electronic device and the second electronic device; Where M is a positive integer.
12. The apparatus according to claim 11, characterized in that, The ranging module is specifically used for: From the M fourth distances, determine the target distance whose difference from the fifth distance is greater than or equal to the third distance threshold; The average distance of the M fourth distances, excluding the target distance, is determined as the second distance between the first electronic device and the second electronic device.
13. The apparatus according to claim 11 or 12, characterized in that, The UWB module is enabled during the transmission of the first target Bluetooth sub-signal through the Bluetooth module, and the transmission time of the first UWB signal differs from the transmission time of the first target Bluetooth sub-signal by a first duration. The ranging module is specifically used for: If the difference between the second duration and the first duration between the reception time of the first UWB signal and the reception time of the first target Bluetooth sub-signal is less than or equal to a duration threshold, a second distance between the first electronic device and the second electronic device is measured based on the first Bluetooth signal and the first UWB signal.
14. The apparatus according to claim 10, characterized in that, The enabling module is specifically used for: If the first information satisfies the first ranging mode switching condition, then the UWB module is enabled; wherein the first information includes at least one of the following: a first distance, the location information of the first electronic device, and the signal strength measured by the Bluetooth module; the first distance is the distance between the first electronic device and the second electronic device determined based on the first Bluetooth signal sent by the Bluetooth module; The first ranging mode switching condition includes at least one of the following: The first distance is greater than or equal to a first distance threshold and less than or equal to a second distance threshold; The signal strength measured by the Bluetooth module is greater than or equal to the first signal strength threshold and less than or equal to the second signal strength threshold; The location information indicates that the first electronic device is located in the buffer zone of the target location; Wherein, the second signal strength threshold is greater than the first signal strength threshold, and the second distance threshold is less than the first distance threshold.
15. The apparatus according to claim 14, characterized in that, The ranging module is also used for: If the first information satisfies the first ranging mode switching condition, then before enabling the UWB module, if it is detected that the signal strength measured by the Bluetooth module is less than the first signal strength threshold and greater than or equal to the third signal strength threshold, and / or the location information indicates that the first electronic device is located in the edge area of the target location, then the Bluetooth module is enabled. The first Bluetooth signal is sent through the Bluetooth module, and the first distance is determined based on the first Bluetooth signal; Wherein, the third signal strength threshold is less than the first signal strength threshold, and the distance between any coordinate position in the edge region and the center position of the target location is greater than the distance between any coordinate position in the buffer region and the center position of the target location.
16. The apparatus according to claim 14 or 15, characterized in that, The enabling module is further configured to: Based on the second Bluetooth signal and the first UWB signal, after measuring the second distance between the first electronic device and the second electronic device, if the second information satisfies the second ranging mode switching condition, then the UWB module is enabled; The ranging module is also used to send a second UWB signal through the UWB module, and determine a third distance between the first electronic device and the second electronic device based on the second UWB signal; The second information includes at least one of the second distance, the location information, and the signal strength measured by the Bluetooth module. The second information satisfies at least one of the following conditions for switching the second ranging mode: The second distance is less than the first distance threshold; The location information indicates that the first electronic device is located in the central area of the target location; The signal strength measured by the Bluetooth module is greater than the second signal strength threshold. Wherein, the distance between any coordinate position in the buffer area and the center position of the target location is greater than the distance between any coordinate position in the central area and the center position of the target location.
17. The apparatus according to claim 10, characterized in that, The device further includes: A synchronization module is used to synchronize the time of the Bluetooth module and the UWB module before sending the second Bluetooth signal through the Bluetooth module and before sending the first UWB signal through the UWB module.
18. The apparatus according to claim 17, characterized in that, The synchronization module is specifically used for: An initial timestamp is generated at the moment when a Bluetooth connection event is detected by the Bluetooth module. The initial timestamp is transmitted to the UWB module to synchronize the initial timestamps between the UWB module and the Bluetooth module.
19. An electronic device, characterized in that, It includes a processor and a memory, the memory storing programs or instructions that can run on the processor, the programs or instructions being executed by the processor to implement the steps of the ranging method as described in any one of claims 1 to 9.
20. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the ranging method as described in any one of claims 1 to 9.