A ranging method and a first device
By combining Bluetooth and acoustic signals to calculate the distance between devices, the problem of RSSI being affected by environmental factors has been solved, achieving high-accuracy ranging and timely control operations, thus improving the user experience.
Patent Information
- Application Number
- CN202211040828.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-29
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2042-08-29
AI Technical Summary
Bluetooth signal strength indicator (RSSI) is susceptible to environmental factors, which can lead to inaccurate ranging and affect the user experience.
By combining Bluetooth signals and acoustic signals, and calculating the signal reception time and acoustic transmission rate, the distance between devices can be calculated, thus improving the accuracy of ranging.
It achieves high-accuracy ranging, ensuring the timely execution of subsequent control operations and improving the user experience.
Smart Images

Figure CN115407268B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a ranging method and a first device. Background Technology
[0002] With the development of Bluetooth technology, users can now use different Bluetooth devices in various scenarios. For example, users can listen to music from their mobile phones through in-car Bluetooth devices. To further improve the user experience, Bluetooth devices can now also calculate distance using the received signal strength indication (RSSI) and perform corresponding operations based on that distance. In the scenario described above, the in-car Bluetooth device can calculate the distance between itself and the mobile phone based on the RSSI, and can perform operations such as unlocking the door if the distance is less than a threshold, thus achieving a contactless car key function based on distance.
[0003] However, RSSI is susceptible to various factors in the real environment, which can lead to inaccurate ranging and may affect the timeliness of subsequent operations, resulting in a poor user experience. Summary of the Invention
[0004] This application provides a ranging method and a first device, which improves the accuracy of ranging and provides a better user experience.
[0005] In a first aspect, a ranging method is provided, applied to a first device, the method comprising: receiving a Bluetooth signal and an acoustic signal from a second device; and calculating the distance between the first device and the second device based on the Bluetooth signal and the acoustic signal, wherein the first device and the second device have established a communication connection.
[0006] In this application, the first device can receive Bluetooth signals and acoustic signals from the second device, and can calculate the distance between itself and the second device based on the Bluetooth signals and acoustic signals, thereby achieving high-accuracy ranging and providing a good user experience.
[0007] In conjunction with the first aspect, in some implementations of the first aspect, obtaining the distance between the first device and the second device based on the Bluetooth signal and the acoustic signal includes: calculating the distance between the first device and the second device based at least on the reception time of the Bluetooth signal and the acoustic signal and the transmission rate of the acoustic wave.
[0008] In conjunction with the first aspect, in some implementations of the first aspect, when the transmission times of the Bluetooth signal and the acoustic signal are the same, the method of obtaining the distance between the first device and the second device based at least on the reception times of the Bluetooth signal and the acoustic signal and the transmission rate of the acoustic signal includes: determining the difference in reception times based on the reception times of the Bluetooth signal and the acoustic signal; and obtaining the distance between the first device and the second device based on the transmission rate of the acoustic signal and the absolute value of the difference.
[0009] In conjunction with the first aspect, in some implementations of the first aspect, when the transmission times of the Bluetooth signal and the acoustic signal are separated by a preset time interval, the above-mentioned method of obtaining the distance between the first device and the second device based at least on the reception times of the Bluetooth signal and the acoustic signal and the transmission rate of the acoustic signal includes: determining the difference in reception times based on the reception times of the Bluetooth signal and the acoustic signal; and calculating the distance between the first device and the second device based on the transmission rate of the acoustic signal, the absolute value of the difference, and the preset time interval.
[0010] In conjunction with the first aspect, in some implementations of the first aspect, the distance L between the first device and the second device satisfies the following formula: L=V1*(Δt-t p ), where V1 is the sound wave transmission rate, Δt is the absolute value of the difference, and t p This is the preset time interval.
[0011] In conjunction with the first aspect, in some implementations of the first aspect, the aforementioned preset time interval is indicated by a target signal, or the aforementioned preset time interval is pre-stored in the first device, the target signal being the aforementioned Bluetooth signal or the aforementioned acoustic signal.
[0012] In conjunction with the first aspect, in some implementations of the first aspect, the target signal is a Bluetooth signal, and the method further includes: activating a timer, which instructs the first device to receive an acoustic signal after a preset time interval following the receipt of the Bluetooth signal.
[0013] In conjunction with the first aspect, in some implementations of the first aspect, the above method further includes: determining that the distance between the first device and the second device is less than or equal to a first threshold; and generating a control command based on a preset correspondence between distance and control operation.
[0014] In conjunction with the first aspect, in some implementations of the first aspect, the above method further includes: determining that the distance between the first device and the second device is less than or equal to the first threshold; generating a control command based on a preset correspondence between distance and control operation; and executing the operation corresponding to the control command.
[0015] In a second aspect, a first device is provided, comprising: a Bluetooth unit, an acoustic wave unit, and a processing unit; wherein the Bluetooth unit is configured to receive Bluetooth signals from a second device; the acoustic wave unit is configured to receive acoustic wave signals from the second device; and the processing unit is configured to determine the distance between the first device and the second device based on the Bluetooth signals and the acoustic wave signals; wherein the first device and the second device establish a communication connection.
[0016] In conjunction with the second aspect, in some implementations of the second aspect, the processing unit is used to: calculate the distance between the first device and the second device based at least on the reception times of the Bluetooth signal and the acoustic signal and the transmission rate of the acoustic signal.
[0017] In conjunction with the second aspect, in some implementations of the second aspect, when the transmission times of the Bluetooth signal and the acoustic signal are the same, the processing unit is configured to: determine the difference in reception times based on the reception times of the Bluetooth signal and the acoustic signal; and calculate the distance between the first device and the second device based on the transmission rate of the acoustic signal and the absolute value of the difference.
[0018] In conjunction with the second aspect, in some implementations of the second aspect, when the transmission times of the Bluetooth signal and the acoustic signal are separated by a preset time interval, the processing unit is used to: determine the difference in reception times based on the reception times of the Bluetooth signal and the acoustic signal; and obtain the distance between the first device and the second device based on the transmission rate of the acoustic signal, the absolute value of the difference, and the preset time interval.
[0019] In conjunction with the second aspect, in some implementations of the second aspect, the distance L between the first device and the second device satisfies the following formula: L=V1*(Δt-t p ), where V1 is the transmission rate of the acoustic signal, Δt is the absolute value of the difference, and t p This is the preset time interval.
[0020] In conjunction with the second aspect, in some implementations of the second aspect, the aforementioned preset time interval is indicated by a target signal, or the aforementioned preset time interval is pre-stored in the first device, the target signal being the aforementioned Bluetooth signal or the aforementioned acoustic signal.
[0021] In conjunction with the second aspect, in some implementations of the second aspect, the processing unit is used to: activate a timer, the timer being used to instruct the first device to receive the acoustic signal after a preset time interval following the receipt of the Bluetooth signal.
[0022] In conjunction with the second aspect, in some implementations of the second aspect, the above-mentioned processing unit is used to: determine that the distance between the first device and the second device is less than or equal to a first threshold; and generate control instructions according to the correspondence between preset distance and control operation.
[0023] In conjunction with the second aspect, in some implementations of the second aspect, the processing unit is used to: determine that the distance between the first device and the second device is less than or equal to the first threshold; generate a control command based on the preset correspondence between the distance and the control operation; and execute the operation corresponding to the control command.
[0024] Thirdly, another first device is provided, comprising a processor coupled to a memory for executing instructions in the memory to implement the method in any of the possible implementations of the first aspect described above. Optionally, the terminal device further includes a memory. Optionally, the terminal device further includes a communication interface, to which the processor is coupled.
[0025] Fourthly, a processor is provided, comprising: an input circuit, an output circuit, and a processing circuit. The processing circuit is used to receive signals through the input circuit and transmit signals through the output circuit, causing the processor to execute the method in any possible implementation of the first aspect described above.
[0026] In specific implementation, the processor can be a chip, the input circuit can be an input pin, the output circuit can be an output pin, and the processing circuit can be a transistor, gate circuit, flip-flop, and various logic circuits. The input signal received by the input circuit can be received and input by, for example, but not limited to, a receiver, and the signal output by the output circuit can be, for example, but not limited to, output to a transmitter and transmitted by the transmitter. Furthermore, the input circuit and the output circuit can be the same circuit, which is used as the input circuit and the output circuit at different times. This application does not limit the specific implementation of the processor and various circuits.
[0027] Fifthly, a processing apparatus is provided, including a processor and a memory. The processor is used to read instructions stored in the memory and to receive signals via a receiver and transmit signals via a transmitter to execute the method in any of the possible implementations of the first aspect described above.
[0028] Optionally, there may be one or more processors and one or more memories.
[0029] Alternatively, the memory can be integrated with the processor, or the memory can be set up separately from the processor.
[0030] In specific implementation, the memory can be a non-transitory memory, such as read-only memory (ROM), which can be integrated with the processor on the same chip or set on different chips. The embodiments of this application do not limit the type of memory or the way the memory and processor are set.
[0031] It should be understood that the relevant data interaction process, such as sending indication information, can be the process of outputting indication information from the processor, and receiving capability information can be the process of the processor receiving input capability information. Specifically, the processed output data can be output to the transmitter, and the input data received by the processor can come from the receiver. Here, the transmitter and receiver can be collectively referred to as a transceiver.
[0032] The processing device in the fifth aspect above can be a chip. The processor can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor that reads software code stored in memory. The memory can be integrated into the processor or located outside the processor and exist independently.
[0033] In a sixth aspect, a computer program product is provided, the computer program product comprising: a computer program (also referred to as code or instructions), which, when run, causes a computer to perform the method in any of the possible implementations of the first aspect described above.
[0034] In a seventh aspect, a computer-readable storage medium is provided that stores a computer program (also referred to as code or instructions) that, when executed on a computer, causes the computer to perform the methods in any of the possible implementations of the first aspect described above. Attached Figure Description
[0035] Figure 1 This is a schematic diagram illustrating the application scenario provided in the embodiments of this application;
[0036] Figure 2 This is a schematic diagram of the system architecture of the first / second device provided in the embodiments of this application;
[0037] Figure 3 This is a flowchart illustrating an example of the ranging method provided in this application.
[0038] Figure 4 This is a flowchart of a first specific example of the ranging method provided in the embodiments of this application;
[0039] Figure 5This is a flowchart of a second specific example of the ranging method provided in the embodiments of this application;
[0040] Figure 6 This is a flowchart of a third specific example of the ranging method provided in the embodiments of this application;
[0041] Figure 7 This is a flowchart of a fourth specific example of the ranging method provided in the embodiments of this application;
[0042] Figure 8 This is a flowchart of the fifth specific example of the ranging method provided in the embodiments of this application;
[0043] Figure 9 This is a flowchart illustrating another example of the ranging method provided in the embodiments of this application;
[0044] Figure 10 This is a flowchart of the sixth specific example of the ranging method provided in the embodiments of this application;
[0045] Figure 11 This is a flowchart of the seventh specific example of the ranging method provided in the embodiments of this application;
[0046] Figure 12 This is a flowchart of the eighth specific example of the ranging method provided in the embodiments of this application;
[0047] Figure 13 This is a flowchart of the ninth specific example of the ranging method provided in the embodiments of this application;
[0048] Figure 14 This is a flowchart of the tenth specific example of the ranging method provided in the embodiments of this application;
[0049] Figure 15 This is a structural block diagram of an example of the first device provided in the embodiments of this application;
[0050] Figure 16 This is a schematic diagram of another example of the first device provided in the embodiments of this application. Detailed Implementation
[0051] The technical solutions in this application will now be described with reference to the accompanying drawings.
[0052] To facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with essentially the same function and effect. For example, "first instruction" and "second instruction" are used to distinguish different user instructions and do not limit their order. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.
[0053] It should be noted that, in this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0054] Furthermore, "at least one" refers to one or more, while "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, and c can mean: a, or b, or c, or a and b, or a and c, or b and c, or a, b, and c, where a, b, and c can be single or multiple.
[0055] Figure 1 This application illustrates an application scenario 100 provided in an embodiment of this application, such as... Figure 1 As shown, the application scenario 100 may include a first device 101 and a second device 102. In this embodiment, the number of devices in application scenario 100 is not limited. For example, application scenario 100 may also include a third or fourth device. Those skilled in the art can set this according to actual usage. In this embodiment, application scenario 100 including a first device 101 and a second device 102 is used as an example for explanation. The first device 101 and the second device 102 communicate via short-range communication, for example, a Bluetooth connection is established between them. The first device 101 can measure and, if it determines that the distance between them meets a preset condition, generate and execute a control command. Alternatively, the first device 101 can send the control command to the second device 102, which can then perform the corresponding operation based on the control command.
[0056] It should be understood that the second device 102 can also measure and, if it determines that the distance between the two meets a preset condition, generate and execute a control command. Alternatively, the second device 102 can also send the control command to the first device 101, which can then perform the corresponding operation based on the control command.
[0057] For example, in a vehicle-mounted Bluetooth device usage scenario, the first device 101 is a mobile phone, and the second device 102 is a vehicle-mounted Bluetooth device, with a Bluetooth connection established between the mobile phone and the vehicle-mounted Bluetooth device. When the user moves while holding the mobile phone, the mobile phone can measure the distance between itself and the vehicle-mounted Bluetooth device. If the distance is less than a threshold, it can be assumed that the user is likely to need to get into the vehicle. To improve the user experience, the mobile phone can generate a control command and send it to the vehicle-mounted Bluetooth device. Correspondingly, the vehicle-mounted Bluetooth device receives the control command and performs a corresponding operation (such as opening the door) based on the control command to meet the user's needs. Alternatively, when the user moves while holding the mobile phone, the vehicle-mounted Bluetooth device can also measure the distance between itself and the mobile phone, and if the distance is less than a threshold, generate a control command and perform a corresponding operation (such as opening the door).
[0058] For example, in a Bluetooth speaker usage scenario, the first device 101 is a mobile phone, and the second device 102 is a Bluetooth speaker. The mobile phone and the Bluetooth speaker have established a Bluetooth connection, and the mobile phone is playing music through the Bluetooth speaker. When the user moves the mobile phone, the mobile phone can measure the distance between itself and the Bluetooth speaker. If the distance is less than a threshold, the mobile phone generates a control command and sends the control command to the Bluetooth speaker. Correspondingly, the Bluetooth speaker receives the control command and performs a corresponding operation based on the control command (such as lowering the volume of the current music). Alternatively, if the mobile phone determines that the distance is greater than the threshold, it can generate another control command and send the second control command to the Bluetooth speaker. Correspondingly, the Bluetooth speaker receives the second control command and performs a corresponding operation based on the second control command (such as raising the volume of the current music). Similarly, in a Bluetooth speaker usage scenario, the Bluetooth speaker can also perform distance measurement and generate and execute corresponding control commands based on the distance.
[0059] Currently, the above ranging is mainly achieved through the received signal strength indicator (RSSI) of Bluetooth signals, and the specific calculation formula is as follows:
[0060] Rssi=A-10nlgd
[0061] Where Rssi is the strength of the received Bluetooth signal, A is the Bluetooth signal strength when the first device and the second device are 1 meter apart, n is the environmental factor, and d is the distance between the first device and the second device.
[0062] However, in real-world environments, there are various factors that can cause RSSI fluctuations and poor consistency (such as environment, weather, equipment, etc.), resulting in low ranging accuracy. This can lead to operational errors in the aforementioned equipment, resulting in a poor user experience.
[0063] For example, in the above-mentioned vehicle Bluetooth device usage scenario, there may be a situation where the user has moved to the front of the car with their mobile phone, but due to the inaccuracy of RSSI ranging, the vehicle Bluetooth device has not received the instruction to open the door for a long time, resulting in the user not being able to get into the car in time and having a poor experience.
[0064] For example, in the use case of Bluetooth speakers, there may be a situation where the user has moved their mobile phone in front of the Bluetooth speaker, but due to the inaccuracy of RSSI ranging, the Bluetooth headphones do not receive the command to lower the volume for a long time, resulting in a poor user experience.
[0065] In view of this, embodiments of this application provide a ranging method and a first device, the first device being able to receive Bluetooth signals and acoustic signals from a second device. The first and second devices communicate via a short-range communication method, for example, establishing a Bluetooth connection. Based on the aforementioned Bluetooth and acoustic signals, the first device can determine the distance between the first and second devices, achieving high-accuracy ranging and enabling timely execution of subsequent control operations, resulting in a better user experience.
[0066] The first and second devices involved in the embodiments of this application are both devices that support near-field communication. The first and second devices can be mobile phones, tablets, laptops, PDAs, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, personal digital assistants (PDAs), etc., and this application embodiment is not limited to these.
[0067] For example, Figure 2 This is a schematic diagram of a system architecture for a first device / second device provided in an embodiment of this application.
[0068] like Figure 2 As shown, the first device / second device includes a processor 210 and a transceiver 220.
[0069] Optionally, the first / second device may further include a memory 230. The processor 210, transceiver 220 and memory 230 can communicate with each other through an internal connection path to transmit ranging data. The memory 230 is used to store computer programs, and the processor 210 is used to call and run the computer programs from the memory 230.
[0070] The processor 210 and memory 230 can be combined into a single processing device, but more commonly they are separate components. The processor 210 executes the program code stored in the memory 230 to achieve the aforementioned functions. In specific implementations, the memory 230 can be integrated into the processor 210, or it can be independent of the processor 210.
[0071] In addition, to further enhance the functionality of the first / second device, the first / second device may also include one or more of an input unit 260, an audio circuit 280, and a sensor 201.
[0072] Optionally, the first device / second device may further include a power supply 250 for providing power to various devices or circuits in the first device / second device.
[0073] Understandable, Figure 2 The operation and / or function of each module in the first / second device shown are respectively for implementing the corresponding processes in the following method embodiments. For details, please refer to the description in the following method embodiments; to avoid repetition, detailed descriptions are appropriately omitted here.
[0074] Understandable, Figure 2 The processor 210 in the first / second device shown may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.
[0075] The processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 210 has just used or that are used repeatedly. If the processor 210 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.
[0076] In some embodiments, the processor 210 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0077] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the first device / second device. In other embodiments of this application, the first device / second device may also adopt different interface connection methods or a combination of multiple interface connection methods as described in the above embodiments.
[0078] Understandable, Figure 2 The power supply 250 shown is used to supply power to the processor 210, memory 230, display unit 270, camera 260, input unit 260 and transceiver 220, etc.
[0079] Transceiver 220 can provide solutions for wireless communication applications on the first / second device, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. Transceiver 220 can be one or more devices integrating at least one communication processing module.
[0080] The memory 230 can be used to store computer executable program code, which includes instructions. The memory 230 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of the first / second device (such as ranging data), etc. Furthermore, the memory 230 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. The processor 210 executes various functional applications and data processing of the first / second device by running instructions stored in the memory 230 and / or instructions stored in memory disposed within the processor.
[0081] The first / second device can implement audio functions, such as music playback and recording, through the audio circuit 280 and application processor.
[0082] The audio circuit 280 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal. The audio circuit 280 can also be used for encoding and decoding audio signals. In some embodiments, the audio circuit 280 may be located in the processor 210, or some functional modules of the audio circuit 280 may be located in the processor 210.
[0083] To make the objectives and technical solutions of this application clearer and more intuitive, the ranging method and the first device provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0084] Figure 3 This is a schematic flowchart of a ranging method 300 provided in an embodiment of this application. This method 300 can be applied to the above-mentioned... Figure 1 The application scenario 100 shown can be a sender, and correspondingly, a second device can be a receiver. Alternatively, the second device can also be a sender, and the first device can be a receiver. Other scenarios are also possible, but this application does not limit the scope of the embodiments. Figure 3 As shown, the method 300 may include the following steps:
[0085] S301, the second device sends Bluetooth signals and acoustic signals to the first device. Correspondingly, the first device receives Bluetooth signals and acoustic signals from the second device.
[0086] It should be understood that the first and second devices communicate via short-range communication.
[0087] For example, a Bluetooth connection can be established between the first device and the second device.
[0088] In one possible scenario, the aforementioned Bluetooth signal and acoustic signal are transmitted by the second device at once.
[0089] For example, the second device sends Bluetooth signals and acoustic signals to the first device.
[0090] In another possible scenario, the aforementioned Bluetooth signal and acoustic signal were transmitted twice by the second device.
[0091] For example, the second device sends a Bluetooth signal to the first device for the first time, and then sends an acoustic signal to the first device for the second time.
[0092] S302, the first device obtains the distance between the first device and the second device based on the aforementioned Bluetooth signal and acoustic signal.
[0093] In one possible scenario, the Bluetooth signal and the acoustic signal are transmitted at the same time. The first device can determine the difference in reception time based on the reception time of the Bluetooth signal and the reception time of the acoustic signal, and can calculate the distance between the first device and the second device based on the transmission rate of the acoustic signal and the absolute value of the difference.
[0094] For example, the distance L between the first device and the second device satisfies the following formula: L=V1*(t1-t2), where V1 is the transmission rate of the acoustic signal, t1 is the reception time of the acoustic signal, and t2 is the reception time of the Bluetooth signal.
[0095] In another possible scenario, the transmission times of the Bluetooth signal and the acoustic signal are separated by a preset time interval. The first device can determine the difference in reception times based on the reception times of the Bluetooth signal and the acoustic signal, and can calculate the distance between the first device and the second device based on the transmission rate of the acoustic signal, the absolute value of the difference, and the preset time interval.
[0096] For example, the distance L between the first device and the second device satisfies the following formula: L=V1*(Δt-t p ), where V1 is the transmission rate of the acoustic signal, Δt is the absolute value of the difference, and t p This is the preset time interval.
[0097] It should be understood that the aforementioned preset time interval can be stored in the second device and can be indicated by a target signal. This target signal is either the Bluetooth signal or the acoustic signal, specifically the signal whose transmission time is further from the current time. In other words, the preset time interval can be indicated by the signal that is preferentially transmitted between the Bluetooth signal and the acoustic signal.
[0098] For example, the signal that is preferentially transmitted is a Bluetooth signal, which can indicate that the preset time interval is T. Upon receiving the Bluetooth signal, the first device can start a timer, and only after the timer satisfies the preset time interval T can it then receive the acoustic signal. In other words, the timer can be used to instruct the first device to receive the acoustic signal only after the preset time interval following the receipt of the Bluetooth signal.
[0099] Optionally, the aforementioned preset time interval can also be pre-stored in the first device; this application does not limit this.
[0100] Optionally, the first device may also generate a control command based on a preset correspondence between distance and control operation if it is determined that the distance between the first device and the second device is less than or equal to a first threshold.
[0101] In one possible scenario, the first device executes the operation corresponding to the control command.
[0102] In another possible scenario, the first device sends the control command to the second device. Correspondingly, the second device receives the control command and executes the operation corresponding to it.
[0103] In this embodiment, the first device and the second device establish a Bluetooth connection, and the first device can receive Bluetooth signals and acoustic signals from the second device. Based on the Bluetooth signals and acoustic signals, the first device can determine the distance between the first device and the second device, achieving high-accuracy ranging and enabling subsequent control operations to be executed promptly, resulting in a good user experience.
[0104] The following description uses a mobile phone as the first device, a vehicle Bluetooth device as the second device, and an ultrasonic signal as the above-mentioned sound wave signal as an example to illustrate the ranging method provided in this application.
[0105] Figure 4 A schematic flowchart of another ranging method 400 provided in an embodiment of this application is shown. Figure 4 As shown, the method 400 includes the following steps:
[0106] S401, the in-vehicle Bluetooth device can send both Bluetooth and ultrasonic signals to the mobile phone, with the Bluetooth signal transmission rate being significantly higher than that of the ultrasonic signal. Correspondingly, the mobile phone can receive both Bluetooth and ultrasonic signals from the in-vehicle Bluetooth device.
[0107] It's understandable that the phone and the car's Bluetooth device can establish a Bluetooth connection beforehand and send Bluetooth signals through that connection. Ultrasonic signals, on the other hand, are mechanical waves that are transmitted through a medium, such as air. The car's Bluetooth device directly sends ultrasonic signals, which are then transmitted to the phone via the air.
[0108] For example, when a user moves towards the vehicle with their mobile phone, the vehicle's Bluetooth device sends the aforementioned Bluetooth signal and ultrasonic signal to the phone. Correspondingly, the mobile phone, upon receiving the aforementioned Bluetooth signal and ultrasonic signal, can record the time of reception of the ultrasonic signal and Bluetooth signal.
[0109] In-vehicle Bluetooth devices can send Bluetooth and ultrasonic signals to mobile phones in ways including but not limited to the following two methods:
[0110] In the first method, the in-vehicle Bluetooth device simultaneously sends Bluetooth and ultrasonic signals to the mobile phone.
[0111] In other words, the timing of the in-vehicle Bluetooth device sending Bluetooth signals to the mobile phone is the same as the timing of the in-vehicle Bluetooth device sending ultrasonic signals to the mobile phone. After establishing a Bluetooth connection, the in-vehicle Bluetooth device can periodically send Bluetooth and ultrasonic signals according to a preset cycle; alternatively, after establishing a Bluetooth connection, the in-vehicle Bluetooth device can send a notification message to the user via the mobile phone, informing the user that a Bluetooth connection has been established, and then the user can trigger the transmission of Bluetooth and ultrasonic signals. Of course, the in-vehicle Bluetooth device can also send Bluetooth and ultrasonic signals through other methods, which are not limited here.
[0112] The second method involves the vehicle's Bluetooth device sending Bluetooth and ultrasonic signals at preset time intervals.
[0113] The preset time interval can be pre-stored in the vehicle's Bluetooth device. When the vehicle's Bluetooth device sends a Bluetooth signal via Bluetooth connection, a timer is started. The duration of this timer is the preset time interval. When the timer expires, the vehicle's Bluetooth device sends an ultrasonic signal to the mobile phone. The method by which the vehicle's Bluetooth device sends a Bluetooth signal is similar to that in the first method, and will not be described in detail here.
[0114] S402, the mobile phone can calculate the distance between itself and the vehicle's Bluetooth device based at least on the time of receiving the Bluetooth signal, the time of receiving the ultrasonic signal, and the transmission rate of the ultrasonic signal.
[0115] When the mobile phone receives both Bluetooth and ultrasonic signals, it can record the reception time of each signal. For example, the reception time of the ultrasonic signal is t1, and the reception time of the Bluetooth signal is t2. Then, based on the reception times of each signal and the transmission rate of the signal with the lower transmission rate, the distance between the vehicle's Bluetooth device and the mobile phone is calculated. In this embodiment, since the transmission rate of the ultrasonic signal is lower than that of the Bluetooth signal, the transmission rate of the ultrasonic signal is used for distance calculation.
[0116] In one possible scenario, the Bluetooth signal and the ultrasonic signal are sent simultaneously by the vehicle-mounted Bluetooth device, which is equivalent to the first method in step S401. The mobile phone can calculate the distance L between itself and the vehicle-mounted Bluetooth device based on the formula: L = V1 * (t1 - t2), where V1 is the transmission rate of the ultrasonic signal.
[0117] In another possible scenario, the aforementioned Bluetooth signal and ultrasonic signal are transmitted by the vehicle-mounted Bluetooth device at preset time intervals, equivalent to the second method in step S401. The mobile phone can then use the formula L=V1*(Δt-t) to... p The distance L between the ultrasonic signal and the vehicle's Bluetooth device is calculated, where V1 is the transmission rate of the ultrasonic signal, Δt is the absolute value of the difference between the Bluetooth signal reception time and the ultrasonic signal reception time, and t... p This is the preset time interval.
[0118] It is understandable that the above two distance calculation formulas are merely examples. In actual use, signal transmission may be affected by other factors, such as weather or propagation path. Therefore, some influencing factors can be added to the above calculation formulas. For example, on a cloudy day, the transmission rate of ultrasound is n times that on a sunny day, where n < 1. In this case, V1 in the above formula can be replaced with nV1. Of course, the adjustment of the above calculation formulas is only an example, and those skilled in the art can optimize them according to actual usage, which is not limited here.
[0119] S403, if it is determined that the distance is less than the first threshold, the mobile phone can generate a first control command according to the preset correspondence between distance and control operation.
[0120] Table 1 shows the correspondence between the preset distances and control operations.
[0121] Table 1
[0122] Preset distance Control operation 6m Lock the door 5m Increase volume 3m Lower the volume 1m Open the door
[0123] As shown in Table 1, when the preset distance is 10m, the corresponding control operation is to lock the door; when the preset distance is 5m, the corresponding control operation is to increase the volume; when the preset distance is 3m, the corresponding control operation is to decrease the volume; and when the preset distance is 1m, the corresponding control operation is to open the door.
[0124] For example, if the first threshold is 1m and the distance between the mobile phone and the vehicle Bluetooth device is 0.9m, according to Table 1, 0.9m < 1m, then the mobile phone can generate a door opening control command, that is, the first control command can be a door opening control command.
[0125] It should be understood that Table 1 above is merely an example. In addition, the preset distance and control operation can be represented in other ways, and this application does not limit them.
[0126] S404, the mobile phone sends the aforementioned first control command to the vehicle's Bluetooth device. Correspondingly, the vehicle's Bluetooth device receives the first control command.
[0127] S405, the vehicle Bluetooth device executes the operation corresponding to the first control command.
[0128] For example, if the first control command is a door opening control command, the vehicle Bluetooth device can perform the door opening operation so that the user can enter the vehicle in a timely manner without manually opening the door, resulting in a good user experience.
[0129] exist Figure 4 In the described embodiment, the first device is a mobile phone and the second device is an in-vehicle Bluetooth device. In other embodiments, the first device can also be an in-vehicle Bluetooth device, and the second device can also be a mobile phone. Please refer to... Figure 5 This illustrates a schematic flowchart of another ranging method 500 provided in an embodiment of this application. Figure 5 As shown, the method 500 includes the following steps:
[0130] In S501, the mobile phone can send both Bluetooth and ultrasonic signals to the vehicle's Bluetooth device, with the Bluetooth signal transmission rate being significantly higher than that of the ultrasonic signal. Correspondingly, the vehicle's Bluetooth device can receive both the Bluetooth and ultrasonic signals from the mobile phone.
[0131] For example, when a user moves their phone toward the vehicle, the phone sends the aforementioned Bluetooth signal and ultrasonic signal to the vehicle's Bluetooth device. Correspondingly, the vehicle's Bluetooth device can record the time of reception of the Bluetooth and ultrasonic signals upon receiving them.
[0132] The way the mobile phone sends Bluetooth and ultrasonic signals to the vehicle's Bluetooth device is similar to the way the vehicle's Bluetooth device sends Bluetooth and ultrasonic signals to the mobile phone in step S401, and will not be described again here.
[0133] S502, the in-vehicle Bluetooth device can calculate the distance between itself and the mobile phone based on at least the time of Bluetooth signal reception, the time of ultrasonic signal reception, and the transmission rate of ultrasonic signal.
[0134] In one possible scenario, the Bluetooth signal and the ultrasonic signal are sent simultaneously by the mobile phone. The in-vehicle Bluetooth device can calculate the distance L between itself and the mobile phone based on the formula: L = V1 * (t1 - t2), where V1 is the transmission rate of the ultrasonic signal, t1 is the time of receiving the ultrasonic signal, and t2 is the time of receiving the Bluetooth signal.
[0135] In another possible scenario, the aforementioned Bluetooth signal and ultrasonic signal are transmitted by the mobile phone at preset time intervals. The in-vehicle Bluetooth device can be based on the formula L=V1*(Δt-t) p The distance L between the ultrasonic wave and the mobile phone is calculated, where V1 is the transmission rate of the ultrasonic signal, Δt is the absolute value of the difference, and t is the distance between the ultrasonic wave and the mobile phone. p This is the preset time interval.
[0136] The method by which the in-vehicle Bluetooth device calculates the distance between the in-vehicle Bluetooth device and the mobile phone based on the reception time of each signal and the transmission rate of the signal with a lower transmission rate is similar to that in step S402, and will not be repeated here.
[0137] S503, when it is determined that the distance is less than the first threshold, the vehicle Bluetooth device can generate a second control command and execute the corresponding operation according to the preset correspondence between distance and control operation.
[0138] For example, as above, if the first threshold is 1m and the distance between the mobile phone and the vehicle Bluetooth device is 0.9m, according to Table 1, 0.9m < 1m, then the vehicle Bluetooth device can generate a second control command to open the door and execute the door opening operation, so that the user can enter the car in time without manually opening the door, resulting in a good user experience.
[0139] exist Figure 4 as well as Figure 5 In the embodiments described above, the first device and the second device are respectively a mobile phone and a vehicle Bluetooth device for illustration. Besides the usage scenarios shown above, the ranging method provided in this application can also be described in detail below using a mobile phone as the first device and a Bluetooth speaker as the second device. Please refer to... Figure 6 , Figure 6 A schematic flowchart of another ranging method 600 provided in an embodiment of this application is shown. Figure 6 As shown, the method 600 includes the following steps:
[0140] The S601 Bluetooth speaker can send both Bluetooth and ultrasonic signals to a mobile phone, with the Bluetooth signal transmission rate being significantly higher than that of the ultrasonic signal. Correspondingly, the mobile phone can receive both the Bluetooth and ultrasonic signals from the Bluetooth speaker.
[0141] It should be understood that the phone and the Bluetooth speaker had a pre-established Bluetooth connection.
[0142] For example, when a user moves their phone toward a Bluetooth speaker, the Bluetooth speaker can send the aforementioned Bluetooth signal and ultrasonic signal to the phone. Correspondingly, the phone can record the time of receiving the aforementioned Bluetooth signal and ultrasonic signal.
[0143] S602, the mobile phone can calculate the distance between itself and the vehicle's Bluetooth device based on at least the time of receiving the Bluetooth signal, the time of receiving the ultrasonic signal, and the transmission rate of the ultrasonic signal.
[0144] In one possible scenario, the Bluetooth signal and the ultrasonic signal are transmitted simultaneously by the Bluetooth speaker. The mobile phone can calculate the distance L between itself and the Bluetooth speaker based on the formula: L = V1 * (t1 - t2), where V1 is the transmission rate of the ultrasonic signal, t1 is the time of receiving the ultrasonic signal, and t2 is the time of receiving the Bluetooth signal.
[0145] In another possible scenario, the aforementioned Bluetooth signal and ultrasonic signal are transmitted by the Bluetooth speaker at preset time intervals, and the mobile phone can use the formula L=V1*(Δt-t) to determine the transmission time. p The distance L between the ultrasonic sensor and the Bluetooth speaker is calculated, where V1 is the transmission rate of the ultrasonic signal, Δt is the absolute value of the difference, and t is the distance between the two sensors. p This is the preset time interval.
[0146] Steps S601 to S602 are similar to steps S401 to S402, and will not be described again here.
[0147] S603, if it is determined that the distance is less than the first threshold, the mobile phone can generate a third control command based on the preset correspondence between distance and control operation.
[0148] For example, if the first threshold is 3m and the distance between the mobile phone and the Bluetooth speaker is 2m, according to Table 1, 2m < 3m, then the mobile phone can generate a third control command to reduce the volume, which is the control command to reduce the volume.
[0149] S604, the mobile phone sends the aforementioned third control command to the Bluetooth speaker. Correspondingly, the Bluetooth speaker receives the third control command.
[0150] S605, the Bluetooth speaker executes the operation corresponding to the third control command.
[0151] Steps S603 to S605 are similar to steps S403 to S405, and will not be described again here.
[0152] For example, if the third control command is a volume reduction command, the Bluetooth speaker can reduce the volume, allowing the user to have a good listening experience without manual operation, resulting in a better user experience.
[0153] Alternatively, the first device can also be a Bluetooth speaker, and the second device can also be a mobile phone; to avoid repetition, these will not be elaborated further here.
[0154] As an optional embodiment, the first device may also generate another control command if it determines that the distance between itself and the second device is greater than a second threshold. The second threshold is greater than the first threshold.
[0155] The following description, using a mobile phone as the first device and a vehicle-mounted Bluetooth device as the second device, details the ranging method provided in this application. Please refer to... Figure 7 , Figure 7 A schematic flowchart of another ranging method 700 provided in an embodiment of this application is shown. Figure 7 As shown, the method 700 includes the following steps:
[0156] S701: The in-vehicle Bluetooth device can send both Bluetooth and ultrasonic signals to the mobile phone, with the Bluetooth signal transmission rate being significantly higher than that of the ultrasonic signal. Correspondingly, the mobile phone can receive both Bluetooth and ultrasonic signals from the in-vehicle Bluetooth device.
[0157] For example, when the user is holding their phone away from the car, the vehicle's Bluetooth device sends the aforementioned Bluetooth signal and ultrasonic signal to the phone. Correspondingly, the phone can record the time of receiving the aforementioned Bluetooth signal and ultrasonic signal.
[0158] S702 allows the mobile phone to calculate the distance between itself and the vehicle's Bluetooth device based at least on the timing of the Bluetooth signal reception, the timing of the ultrasonic signal reception, and the transmission rate of the ultrasonic signal.
[0159] In one possible scenario, the Bluetooth signal and the ultrasonic signal are transmitted simultaneously by the vehicle's Bluetooth device. The mobile phone can calculate the distance L between itself and the vehicle's Bluetooth device based on the formula: L = V1 * (t1 - t2), where V1 is the transmission rate of the ultrasonic signal, t1 is the time of receiving the ultrasonic signal, and t2 is the time of receiving the Bluetooth signal.
[0160] In another possible scenario, the aforementioned Bluetooth signal and ultrasonic signal are transmitted by the vehicle's Bluetooth device at preset time intervals, and the mobile phone can use the formula L=V1*(Δt-t) to... p The distance L between it and the vehicle's Bluetooth device is calculated, where V1 is the transmission rate of the ultrasonic signal, Δt is the absolute value of the difference, and t is the distance between them. p This is the preset time interval.
[0161] Steps S701 to S702 are similar to steps S401 to S402, and will not be described again here.
[0162] S703, if it is determined that the distance is greater than the second threshold, the mobile phone can generate a fourth control command according to the preset correspondence between distance and control operation.
[0163] For example, if the second threshold is 6m and the distance between the mobile phone and the vehicle Bluetooth device is 7m, according to Table 1, 7m>6m, then the mobile phone can generate a door-locking control command, that is, the fourth control command can be a door-locking control command.
[0164] S704, the mobile phone sends the aforementioned fourth control command to the vehicle's Bluetooth device. Correspondingly, the vehicle's Bluetooth device receives the fourth control command.
[0165] S705, the vehicle Bluetooth device executes the operation corresponding to the fourth control command.
[0166] For example, if the fourth control command is a door locking command, the vehicle Bluetooth device can perform the door locking operation, reducing the possibility of theft of property inside the vehicle and providing a better user experience.
[0167] Optionally, the first device mentioned above can also be an in-vehicle Bluetooth device, and the second device can also be a mobile phone. This application does not limit this, and to avoid repetition, it will not be described in detail here.
[0168] In addition to the usage scenarios shown above, the ranging method provided in this application can also be described in detail below, taking a mobile phone as the first device and a Bluetooth speaker as the second device.
[0169] Figure 8 A schematic flowchart of another ranging method 800 provided in an embodiment of this application is shown. Figure 8As shown, the method 800 includes the following steps:
[0170] The S801 Bluetooth speaker can send both Bluetooth and ultrasonic signals to a mobile phone, with the Bluetooth signal transmission rate being significantly higher than that of the ultrasonic signal. Correspondingly, the mobile phone can receive both the Bluetooth and ultrasonic signals from the Bluetooth speaker.
[0171] It should be understood that the phone and the Bluetooth speaker had a pre-established Bluetooth connection.
[0172] For example, when the user holds the mobile phone away from the Bluetooth speaker, the Bluetooth speaker can send the aforementioned Bluetooth signal and ultrasonic signal to the mobile phone. Correspondingly, the mobile phone can record the time of receiving the aforementioned Bluetooth signal and ultrasonic signal upon receipt.
[0173] S802 allows the mobile phone to calculate the distance between itself and the vehicle's Bluetooth device based at least on the timing of the Bluetooth signal reception, the timing of the ultrasonic signal reception, and the transmission rate of the ultrasonic signal.
[0174] In one possible scenario, the Bluetooth signal and the ultrasonic signal are transmitted simultaneously by the Bluetooth speaker. The mobile phone can calculate the distance L between itself and the Bluetooth speaker based on the formula: L = V1 * (t1 - t2), where V1 is the transmission rate of the ultrasonic signal, t1 is the time of receiving the ultrasonic signal, and t2 is the time of receiving the Bluetooth signal.
[0175] In another possible scenario, the aforementioned Bluetooth signal and ultrasonic signal are transmitted by the Bluetooth speaker at preset time intervals, and the mobile phone can use the formula L=V1*(Δt-t) to determine the transmission time. p The distance L between the ultrasonic sensor and the Bluetooth speaker is calculated, where V1 is the transmission rate of the ultrasonic signal, Δt is the absolute value of the difference, and t is the distance between the two sensors. p This is the preset time interval.
[0176] Step S802 is similar to step S402, and will not be described again here.
[0177] S803, if it is determined that the distance is greater than the second threshold, the mobile phone can generate a fifth control command based on the preset correspondence between distance and control operation.
[0178] For example, if the second threshold is 5m and the distance between the mobile phone and the Bluetooth speaker is 6m, according to Table 1, 6m>5m, then the mobile phone can generate a control command to increase the volume, that is, the fifth control command can be a control command to increase the volume.
[0179] S804, the mobile phone sends the aforementioned fifth control command to the Bluetooth speaker. Correspondingly, the Bluetooth speaker receives the fifth control command.
[0180] S805, the Bluetooth speaker executes the operation corresponding to the fifth control command.
[0181] For example, if the fifth control command is a volume control command, the Bluetooth speaker can perform the volume increase operation, avoiding the situation where the user cannot hear the music due to the distance being too far, thus improving the user experience.
[0182] Optionally, the first device can also be a Bluetooth speaker, and the second device can also be a mobile phone. This application does not limit the scope of the application, and will not elaborate further here to avoid repetition.
[0183] As an optional embodiment, the first device may further receive a third reference signal from the second device before calculating the distance between itself and the second device based on the aforementioned Bluetooth signal and acoustic signal. Based on the signal strength of the third reference signal, the first device may calculate and determine that the initial distance between itself and the second device is less than or equal to a third threshold. In other words, this application can first perform coarse ranging based on the third reference signal, and then, if the distance is less than or equal to the third threshold, perform precise ranging using the aforementioned Bluetooth signal and acoustic signal.
[0184] It should be understood that the third threshold mentioned above is greater than the first threshold mentioned above.
[0185] Figure 9 This is a schematic flowchart of another ranging method 900 provided in an embodiment of this application. Method 900 can be applied to the above... Figure 1 The application scenario 100 shown can be applied to other scenarios as well, and this application does not limit the scope of application. For example... Figure 9 As shown, the method 900 may include the following steps:
[0186] S901, the second device sends a third reference signal to the first device. Correspondingly, the first device receives the third reference signal from the second device.
[0187] It should be understood that the first and second devices mentioned above have established a Bluetooth connection.
[0188] In one possible implementation, the aforementioned third reference signal is a Bluetooth signal. A Bluetooth connection is established between the second device and the first device, and the first device can receive Bluetooth signals from the second device in real time.
[0189] S902, the first device calculates the current distance between the first device and the second device based on the aforementioned third reference signal.
[0190] In one possible implementation, the third signal is a Bluetooth signal, and the first device can calculate the current distance between itself and the second device based on the signal strength of the received third reference signal.
[0191] For example, the first device can calculate the current distance d based on the formula Rssi = A - 10nlgd. Where Rssi is the strength of the received Bluetooth signal, A is the Bluetooth signal strength when the first device and the second device are 1 meter apart, and n is the environmental factor.
[0192] It should be understood that the above formula is merely exemplary and is not intended to limit the scope of this application.
[0193] S903, if the first device determines that the current distance is less than or equal to a third threshold, it sends a request message to the second device. Correspondingly, the second device receives the request message from the first device.
[0194] It should be understood that the request information may be distance information or information requesting the transmission of the aforementioned Bluetooth signal and acoustic signal; this application does not limit this.
[0195] For example, the first device and the second maintain a Bluetooth connection, and the Bluetooth signal of the first device can carry the request information.
[0196] S904, the second device sends the aforementioned Bluetooth signal and acoustic signal to the first device. Correspondingly, the first device receives the Bluetooth signal and acoustic signal from the second device.
[0197] In one possible scenario, the aforementioned request information is distance information. The second device can receive the distance information and, when determining that the distance indicated by the distance information is less than the aforementioned first threshold, send the aforementioned Bluetooth signal and sound wave signal to the first device.
[0198] In another possible scenario, the aforementioned request message is a request to send the aforementioned Bluetooth signal and acoustic signal. The second device can receive the request message and send the aforementioned Bluetooth signal and acoustic signal to the first device based on the message.
[0199] Similarly, the Bluetooth signal and the acoustic signal mentioned above can be sent multiple times by the second device, or they can be sent all at once by the second device. To avoid repetition, they will not be described again here. For specific details, please refer to the description in the above embodiments.
[0200] S905, the first device calculates the distance between the first device and the second device based on the aforementioned Bluetooth signal and acoustic signal.
[0201] In one possible implementation, the first device can calculate the distance between the first device and the second device based at least on the reception times of the Bluetooth signal and the acoustic signal, as well as the transmission rate of the acoustic signal.
[0202] In one possible scenario, the Bluetooth signal and the acoustic signal are transmitted at the same time. The first device can determine the difference in reception times based on the Bluetooth signal reception time and the acoustic signal reception time, and can calculate the distance between the first device and the second device based on the transmission rate of the acoustic signal and the absolute value of the difference.
[0203] In another possible scenario, the Bluetooth signal and the acoustic signal are transmitted at a preset time interval. The first device can determine the difference in reception times based on the reception times of the Bluetooth signal and the acoustic signal, and can calculate the distance between the first device and the second device based on the transmission rate of the acoustic signal, the absolute value of the difference, and the preset time interval.
[0204] It should be understood that the aforementioned preset time interval can be stored in the aforementioned second device and can be indicated by the signal that is preferentially transmitted among the aforementioned Bluetooth signal and the aforementioned acoustic wave signal, that is, by the signal that is transmitted from the aforementioned Bluetooth signal and the aforementioned acoustic wave signal with a time interval that is relatively large from the current time.
[0205] Optionally, the aforementioned preset time interval can also be pre-stored in the first device; this application does not limit this.
[0206] Optionally, the first device may also generate the aforementioned control command based on a preset distance-control operation correspondence when it is determined that the distance between the first device and the second device is less than or equal to a first threshold. The description of the preset distance and control operation can be found in Table 1 above, and will not be repeated here to avoid repetition.
[0207] In this embodiment, the first device and the second device establish a Bluetooth connection. The first device can receive a third reference signal from the second device and calculate the current distance between itself and the second device based on the third reference signal. When the current distance is less than a third threshold, the first device can also calculate the latest distance between itself and the second device based on the Bluetooth signal and the acoustic signal from the second device. In other words, this application can first perform coarse ranging based on the third reference signal, and then perform precise ranging using the Bluetooth signal and the acoustic signal when the distance is less than or equal to the third threshold. This achieves high-accuracy ranging while reducing power consumption and providing a better user experience.
[0208] The ranging method provided in this application will be described below using the example of a mobile phone as the first device, a vehicle Bluetooth device as the second device, an ultrasonic signal as the aforementioned sound wave signal, and a Bluetooth signal as the aforementioned third reference signal.
[0209] Similarly, the mobile phone and the car's Bluetooth device establish a Bluetooth connection.
[0210] Figure 10 A schematic flowchart of another ranging method 1000 provided in an embodiment of this application is shown. Figure 10 As shown, the method 1000 includes the following steps:
[0211] S1001, the in-vehicle Bluetooth device sends a Bluetooth signal to the mobile phone. Correspondingly, the mobile phone receives the Bluetooth signal from the in-vehicle Bluetooth device.
[0212] S1002, the mobile phone can calculate the current distance between itself and the vehicle's Bluetooth device based on the signal strength of the Bluetooth signal.
[0213] For example, the mobile phone can calculate the current distance d between itself and the vehicle's Bluetooth device based on the formula: Rssi = A - 10nlgd, where Rssi is the strength of the received Bluetooth signal, A is the Bluetooth signal strength when the mobile phone and the vehicle's Bluetooth device are 1 meter apart, and n is the environmental factor.
[0214] It should be understood that the above formula is merely exemplary and is not intended to limit the scope of this application.
[0215] S1003, if it is determined that the current distance is less than or equal to the third threshold, the mobile phone sends a request message to the vehicle's Bluetooth device. Correspondingly, the vehicle's Bluetooth device can receive the request message.
[0216] S1004, the in-vehicle Bluetooth device can send Bluetooth signals and ultrasonic signals to the mobile phone based on the above request information, wherein the transmission rate of the Bluetooth signal is much higher than that of the ultrasonic signal. Correspondingly, the mobile phone can receive the Bluetooth signals and ultrasonic signals from the in-vehicle Bluetooth device respectively.
[0217] S1005, the mobile phone can calculate the latest distance between itself and the vehicle's Bluetooth device based at least on the time of receiving the Bluetooth signal, the time of receiving the ultrasonic signal, and the transmission rate of the ultrasonic signal.
[0218] In one possible scenario, the Bluetooth signal and the ultrasonic signal are transmitted simultaneously by the vehicle's Bluetooth device. The mobile phone can calculate the latest distance L between itself and the vehicle's Bluetooth device based on the formula: L = V1 * (t1 - t2), where V1 is the transmission rate of the ultrasonic signal, t1 is the time of receiving the ultrasonic signal, and t2 is the time of receiving the Bluetooth signal.
[0219] In another possible scenario, the aforementioned Bluetooth signal and ultrasonic signal are transmitted by the vehicle's Bluetooth device at preset time intervals, and the mobile phone can use the formula L=V1*(Δt-t) to... p The latest distance L between it and the vehicle's Bluetooth device is calculated, where V1 is the transmission rate of the ultrasonic signal, Δt is the absolute value of the difference, and t is the distance between the two points. p This is the preset time interval.
[0220] Step S1005 is similar to step S402, and will not be described again here.
[0221] S1006, if it is determined that the latest distance is less than the first threshold, the mobile phone can generate a sixth control command according to the preset correspondence between distance and control operation.
[0222] For example, as above, if the first threshold is 1m and the latest distance between the mobile phone and the vehicle Bluetooth device is 0.9m, according to Table 1, 0.9m < 1m, then the mobile phone can generate a door opening control command, that is, the sixth control command can be a door opening control command.
[0223] S1007, the mobile phone sends the aforementioned sixth control command to the vehicle's Bluetooth device. Correspondingly, the vehicle's Bluetooth device receives the sixth control command.
[0224] S1008, the vehicle Bluetooth device executes the operation corresponding to the sixth control command.
[0225] For example, if the sixth control command is a door opening control command, the vehicle Bluetooth device can perform the door opening operation so that the user can enter the vehicle in a timely manner without manually opening the door, resulting in a good user experience.
[0226] Alternatively, the first device can also be an in-vehicle Bluetooth device, and the second device can also be a mobile phone.
[0227] Figure 11 A schematic flowchart of another ranging method 1100 provided in an embodiment of this application is shown. Figure 11 As shown, the method 1100 includes the following steps:
[0228] S1101, the mobile phone sends a Bluetooth signal to the vehicle's Bluetooth device. Correspondingly, the vehicle's Bluetooth device receives the Bluetooth signal from the mobile phone.
[0229] S1102, the in-vehicle Bluetooth device can calculate the current distance between itself and the mobile phone based on the signal strength of the Bluetooth signal.
[0230] For example, the in-vehicle Bluetooth device can calculate the current distance d between itself and the mobile phone based on the formula: Rssi = A - 10nlgd, where Rssi is the strength of the received Bluetooth signal, A is the Bluetooth signal strength when the mobile phone and the in-vehicle Bluetooth device are 1 meter apart, and n is the environmental factor.
[0231] It should be understood that the formula is merely exemplary and is not intended to limit the scope of this application.
[0232] S1003, if it is determined that the current distance is less than or equal to the third threshold, the vehicle Bluetooth device sends a request message to the mobile phone. Correspondingly, the mobile phone can receive the request message.
[0233] S1104, the mobile phone can send Bluetooth signals and ultrasonic signals to the vehicle's Bluetooth device based on the above request information, where the transmission rate of the Bluetooth signal is much higher than that of the ultrasonic signal. Correspondingly, the vehicle's Bluetooth device can receive the Bluetooth signals and ultrasonic signals from the mobile phone respectively.
[0234] S1105, the in-vehicle Bluetooth device can calculate the distance between itself and the mobile phone based at least on the time of Bluetooth signal reception, the time of ultrasonic signal reception, and the transmission rate of ultrasonic signal.
[0235] In one possible scenario, the Bluetooth signal and the ultrasonic signal are sent simultaneously by the mobile phone. The in-vehicle Bluetooth device can calculate the latest distance L between itself and the mobile phone based on the formula: L=V1*(t1-t2), where V1 is the transmission rate of the ultrasonic signal, t1 is the time of receiving the ultrasonic signal, and t2 is the time of receiving the Bluetooth signal.
[0236] In another possible scenario, the aforementioned Bluetooth and ultrasonic signals are transmitted by the mobile phone at preset time intervals. The in-vehicle Bluetooth device can be based on the formula L=V1*(Δt-t) p The latest distance L between the ultrasonic signal and the mobile phone is calculated, where V1 is the transmission rate of the ultrasonic signal, Δt is the absolute value of the difference, and t is the distance between the two signals. p This is the preset time interval.
[0237] S1106, if it is determined that the latest distance is less than the first threshold, the vehicle Bluetooth device can generate and execute the seventh control command according to the preset correspondence between distance and control operation.
[0238] For example, as above, if the first threshold is 1m and the latest distance between the mobile phone and the vehicle Bluetooth device is 0.9m, according to Table 1, 0.9m < 1m, then the vehicle Bluetooth device can generate a door opening control command (i.e., the seventh control command) and execute the door opening operation so that the user can enter the car in time without manually opening the door, resulting in a good user experience.
[0239] In addition to the usage scenarios shown above, the ranging method provided in this application can also be described in detail below, taking the first device as a mobile phone, the second device as a Bluetooth speaker, and the sound wave signal as an ultrasonic signal.
[0240] Figure 12 A schematic flowchart of another ranging method 1200 provided in an embodiment of this application is shown. Figure 12 As shown, the method 1200 includes the following steps:
[0241] S1201: The Bluetooth speaker sends a Bluetooth signal to the mobile phone. Correspondingly, the mobile phone receives the Bluetooth signal from the Bluetooth speaker.
[0242] It should be understood that the phone and the Bluetooth speaker had a pre-established Bluetooth connection.
[0243] S1202, the mobile phone can calculate the current distance between itself and the Bluetooth speaker based on the signal strength of the Bluetooth signal.
[0244] For example, the mobile phone can calculate the current distance d between itself and the Bluetooth speaker based on the formula: Rssi = A - 10nlgd, where Rssi is the strength of the received Bluetooth signal, A is the Bluetooth signal strength when the mobile phone and the Bluetooth speaker are 1 meter apart, and n is the environmental factor.
[0245] S1203, if it is determined that the current distance is less than or equal to the third threshold, the mobile phone sends a request message to the Bluetooth speaker. Correspondingly, the Bluetooth speaker can receive the request message.
[0246] S1203, the Bluetooth speaker can send Bluetooth and ultrasonic signals to the mobile phone based on the above request information, where the transmission rate of the Bluetooth signal is much higher than that of the ultrasonic signal. Correspondingly, the mobile phone can receive the Bluetooth signal and ultrasonic signal from the Bluetooth speaker respectively.
[0247] For example, when a user moves their phone toward a Bluetooth speaker, the Bluetooth speaker can send the aforementioned Bluetooth signal and ultrasonic signal to the phone. Correspondingly, the phone can record the time of receiving the aforementioned Bluetooth signal and ultrasonic signal.
[0248] S1204, the mobile phone can calculate the latest distance between itself and the Bluetooth speaker based at least on the time of receiving the Bluetooth signal, the time of receiving the ultrasonic signal, and the transmission rate of the ultrasonic signal.
[0249] In one possible scenario, the Bluetooth signal and the ultrasonic signal are transmitted simultaneously by the Bluetooth speaker. The mobile phone can calculate the latest distance L between itself and the Bluetooth speaker based on the formula: L = V1 * (t1 - t2), where V1 is the transmission rate of the ultrasonic signal, t1 is the time of receiving the ultrasonic signal, and t2 is the time of receiving the Bluetooth signal.
[0250] In another possible scenario, the aforementioned Bluetooth signal and ultrasonic signal are transmitted by the Bluetooth speaker at preset time intervals, and the mobile phone can use the formula L=V1*(Δt-t) to determine the transmission time. p The latest distance L between it and the Bluetooth speaker is calculated, where V1 is the transmission rate of the ultrasonic signal, Δt is the absolute value of the difference, and t is the distance between the two points. p This is the preset time interval.
[0251] S1205, if it is determined that the distance is less than the first threshold, the mobile phone can generate the eighth control command according to the preset correspondence between distance and control operation.
[0252] For example, if the first threshold is 3m and the distance between the mobile phone and the Bluetooth speaker is 2m, according to Table 1, 2m < 3m, then the mobile phone can generate a control command to reduce the volume, that is, the eighth control command can be a control command to reduce the volume.
[0253] S1206, the mobile phone sends the aforementioned eighth control command to the Bluetooth speaker. Correspondingly, the Bluetooth speaker receives the eighth control command.
[0254] S1207, the Bluetooth speaker executes the operation corresponding to the eighth control command.
[0255] For example, if the eighth control command is a volume reduction command, the Bluetooth speaker can reduce the volume, allowing the user to have a good listening experience without manual operation, resulting in a better user experience.
[0256] Optionally, the first device mentioned above can also be a Bluetooth speaker, and the second device can also be a mobile phone. This application does not limit this, and to avoid repetition, it will not be described in detail here.
[0257] Optionally, the first device may also calculate the latest distance between itself and the second device based on the Bluetooth signal and the acoustic signal, provided that the initial distance between itself and the second device is greater than or equal to the fourth threshold, based on the signal strength of the third reference signal.
[0258] The ranging method provided in this application will be described below using the example of a mobile phone as the first device, a vehicle Bluetooth device as the second device, an ultrasonic signal as the aforementioned sound wave signal, and a Bluetooth signal as the aforementioned third reference signal.
[0259] Figure 13 A schematic flowchart of another ranging method 1300 provided in an embodiment of this application is shown. Figure 13 As shown, the method 1300 includes the following steps:
[0260] S1301, the in-vehicle Bluetooth device sends a Bluetooth signal to the mobile phone. Correspondingly, the mobile phone receives the Bluetooth signal from the in-vehicle Bluetooth device.
[0261] It should be understood that the mobile phone and the vehicle's Bluetooth device establish a Bluetooth connection.
[0262] S1302, the mobile phone can calculate the current distance between itself and the vehicle's Bluetooth device based on the signal strength of the Bluetooth signal.
[0263] For example, the mobile phone can calculate the current distance d between itself and the vehicle's Bluetooth device based on the formula: Rssi = A - 10nlgd, where Rssi is the strength of the received Bluetooth signal, A is the Bluetooth signal strength when the mobile phone and the vehicle's Bluetooth device are 1 meter apart, and n is the environmental factor.
[0264] S1303, if it is determined that the current distance is greater than or equal to the fourth threshold, the mobile phone sends a request message to the vehicle's Bluetooth device. Correspondingly, the vehicle's Bluetooth device can receive the request message.
[0265] S1304, the in-vehicle Bluetooth device can send Bluetooth signals and ultrasonic signals to the mobile phone based on the above request information, wherein the transmission rate of the Bluetooth signal is much higher than that of the ultrasonic signal. Correspondingly, the mobile phone can receive the Bluetooth signals and ultrasonic signals from the in-vehicle Bluetooth device respectively.
[0266] S1305, the mobile phone can calculate the latest distance between itself and the vehicle's Bluetooth device based at least on the time of receiving the Bluetooth signal, the time of receiving the ultrasonic signal, and the transmission rate of the ultrasonic signal.
[0267] In one possible scenario, the Bluetooth signal and the ultrasonic signal are transmitted simultaneously by the vehicle's Bluetooth device. The mobile phone can calculate the latest distance L between itself and the vehicle's Bluetooth device based on the formula: L = V1 * (t1 - t2), where V1 is the transmission rate of the ultrasonic signal, t1 is the time of receiving the ultrasonic signal, and t2 is the time of receiving the Bluetooth signal.
[0268] In another possible scenario, the aforementioned Bluetooth signal and ultrasonic signal are transmitted by the vehicle's Bluetooth device at preset time intervals, and the mobile phone can use the formula L=V1*(Δt-t) to... p The latest distance L between it and the vehicle's Bluetooth device is calculated, where V1 is the transmission rate of the ultrasonic signal, Δt is the absolute value of the difference, and t is the distance between the two points.p This is the preset time interval.
[0269] S1306, if it is determined that the latest distance is greater than the second threshold, the mobile phone can generate a ninth control command according to the preset correspondence between distance and control operation.
[0270] For example, as above, if the second threshold is 6m and the latest distance between the mobile phone and the vehicle Bluetooth device is 7m, according to Table 1, 7m>6m, then the mobile phone can generate a door-locking control command, that is, the ninth control command can be a door-locking control command.
[0271] S1307, the mobile phone sends the aforementioned ninth control command to the vehicle's Bluetooth device. Correspondingly, the vehicle's Bluetooth device receives the ninth control command.
[0272] S1308, the vehicle Bluetooth device executes the operation corresponding to the ninth control command.
[0273] For example, if the ninth control command is a door locking control command, the vehicle Bluetooth device can perform the door locking operation, reducing the possibility of theft of property inside the vehicle and providing a better user experience.
[0274] It should be understood that the first device mentioned above can also be an in-vehicle Bluetooth device, and the second device can also be a mobile phone. To avoid repetition, it will not be elaborated here.
[0275] In addition to the usage scenarios shown above, the ranging method provided in this application can also be described in detail below, taking the first device as a mobile phone, the second device as a Bluetooth speaker, and the sound wave signal as an ultrasonic signal.
[0276] Figure 14 A schematic flowchart of another ranging method 1400 provided in an embodiment of this application is shown. Figure 14 As shown, the method 1400 includes the following steps:
[0277] S1401, the Bluetooth speaker sends a Bluetooth signal to the mobile phone. Correspondingly, the mobile phone receives the Bluetooth signal from the Bluetooth speaker.
[0278] It should be understood that the phone and the Bluetooth speaker had a pre-established Bluetooth connection.
[0279] S1402, the mobile phone can calculate the current distance between itself and the Bluetooth speaker based on the signal strength of the Bluetooth signal.
[0280] For example, the mobile phone can calculate the current distance d between itself and the Bluetooth speaker based on the formula: Rssi = A - 10nlgd, where Rssi is the strength of the received Bluetooth signal, A is the Bluetooth signal strength when the mobile phone and the Bluetooth speaker are 1 meter apart, and n is the environmental factor.
[0281] S1403, if it is determined that the current distance is greater than or equal to the fourth threshold, the mobile phone sends a request message to the Bluetooth speaker. Correspondingly, the Bluetooth speaker can receive the request message.
[0282] S1403, the Bluetooth speaker can send Bluetooth and ultrasonic signals to the mobile phone based on the above request information, where the transmission rate of the Bluetooth signal is much higher than that of the ultrasonic signal. Correspondingly, the mobile phone can receive the Bluetooth signal and ultrasonic signal from the Bluetooth speaker respectively.
[0283] For example, when a user moves their phone toward a Bluetooth speaker, the Bluetooth speaker can send the aforementioned Bluetooth signal and ultrasonic signal to the phone. Correspondingly, the phone can record the time of receiving the aforementioned Bluetooth signal and ultrasonic signal.
[0284] S1404, the mobile phone can calculate the latest distance between itself and the Bluetooth speaker based at least on the time of receiving the Bluetooth signal, the time of receiving the ultrasonic signal, and the transmission rate of the ultrasonic signal.
[0285] In one possible scenario, the Bluetooth signal and the ultrasonic signal are transmitted simultaneously by the Bluetooth speaker. The mobile phone can calculate the latest distance L between itself and the Bluetooth speaker based on the formula: L = V1 * (t1 - t2), where V1 is the transmission rate of the ultrasonic signal, t1 is the time of receiving the ultrasonic signal, and t2 is the time of receiving the Bluetooth signal.
[0286] In another possible scenario, the aforementioned Bluetooth signal and ultrasonic signal are transmitted by the Bluetooth speaker at preset time intervals, and the mobile phone can use the formula L=V1*(Δt-t) to determine the transmission time. p The latest distance L between it and the Bluetooth speaker is calculated, where V1 is the transmission rate of the ultrasonic signal, Δt is the absolute value of the difference, and t is the distance between the two points. p This is the preset time interval.
[0287] S1405, if it is determined that the distance is greater than the second threshold, the mobile phone can generate a tenth control command according to the preset correspondence between distance and control operation.
[0288] For example, if the second threshold is 5m and the distance between the mobile phone and the Bluetooth speaker is 6m, according to Table 1, 6m>5m, then the mobile phone can generate a control command to increase the volume, that is, the tenth control command can be a control command to increase the volume.
[0289] S1406, the mobile phone sends the aforementioned tenth control command to the Bluetooth speaker. Correspondingly, the Bluetooth speaker receives the tenth control command.
[0290] S1407, the Bluetooth speaker executes the operation corresponding to the tenth control command.
[0291] For example, if the tenth control command is a volume control command, the Bluetooth speaker can perform the volume control operation, avoiding the situation where the user cannot hear the music due to the distance being too far, thus improving the user experience.
[0292] It should be understood that this application only describes the ranging method provided in the context of in-vehicle Bluetooth devices and Bluetooth speakers. In addition, the ranging method of this application is applicable to many other scenarios, and this application does not limit it.
[0293] It should also be understood that, in addition to the ranging based on Bluetooth signals and acoustic signals shown above, this application can also implement the above ranging method based on the above acoustic signals and other signals with transmission rates much higher than the acoustic signals (such as signals corresponding to UWB or infrared signals), and this application does not limit this.
[0294] It should be understood that the various embodiments described above can also be coupled to each other, and this application does not limit this. Furthermore, the sequence number of each process does not imply the order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0295] The above text combines Figures 1 to 14 The distance measurement method of the embodiments of this application is described in detail below, and will be combined with Figures 15 to 16 The first device of the embodiments of this application is described in detail below.
[0296] Figure 15 An embodiment of this application illustrates a first device 1500. The device 1500 includes a Bluetooth unit 1501, an acoustic wave unit 1502, and a processing unit 1503.
[0297] The Bluetooth unit 1501 is used to receive Bluetooth signals from the second device; the acoustic wave unit 1502 is used to receive acoustic wave signals from the second device; and the processing unit 1503 is used to obtain the distance between the first device and the second device based on the Bluetooth signal and the acoustic wave signal, wherein the first device and the second device have established a communication connection.
[0298] Optionally, the processing unit 1503 is configured to: obtain the distance between the first device and the second device based at least on the reception times of the Bluetooth signal and the acoustic signal and the transmission rate of the acoustic signal.
[0299] Optionally, when the Bluetooth signal and the acoustic signal are transmitted at the same time, the processing unit 1503 is configured to: determine the difference in reception time based on the reception time of the Bluetooth signal and the reception time of the acoustic signal; and obtain the distance between the first device and the second device based on the transmission rate of the acoustic signal and the absolute value of the difference.
[0300] Optionally, when the transmission times of the Bluetooth signal and the acoustic signal are separated by a preset time interval, the processing unit 1503 is used to: determine the difference in reception times based on the reception times of the Bluetooth signal and the acoustic signal; and obtain the distance between the first device and the second device based on the transmission rate of the acoustic signal, the absolute value of the difference, and the preset time interval.
[0301] Optionally, the distance L between the first device and the second device satisfies the following formula: L=V1*(Δt-t p ), where V1 is the transmission rate of the acoustic signal, Δt is the absolute value of the difference, and t p This is the preset time interval.
[0302] Optionally, the preset time interval is indicated by a target signal, or the preset time interval is pre-stored in the first device, and the target signal is the Bluetooth signal or the acoustic signal.
[0303] Optionally, the processing unit 1503 is configured to: activate a timer, the timer being configured to instruct the first device to receive the acoustic signal after a preset time interval following the receipt of the Bluetooth signal.
[0304] Optionally, the processing unit 1503 is used to: determine that the distance between the first device and the second device is less than or equal to a first threshold; and generate a control command according to the correspondence between a preset distance and a control operation.
[0305] Optionally, the processing unit 1503 is configured to: determine that the distance between the first device and the second device is less than or equal to the first threshold; generate a control command based on the preset distance-control operation correspondence; and execute the operation corresponding to the control command.
[0306] It should be understood that the first device 1500 here is embodied in the form of a functional unit. The term "unit" here can refer to an application-specific integrated circuit (ASIC), electronic circuitry, a processor (e.g., a shared processor, a proprietary processor, or a group processor, etc.) and memory for executing one or more software or firmware programs, integrated logic circuitry, and / or other suitable components supporting the described functions. In an alternative example, those skilled in the art will understand that the first device 500 may be specifically the first device in the above embodiments, or the functions of the first device in the above embodiments may be integrated into the first device 1500. The first device 1500 may be used to execute the various processes and / or steps corresponding to the first device in the above method embodiments; to avoid repetition, these will not be described further here.
[0307] The first device 1500 described above has the function of implementing the corresponding steps performed by the first device in the above method; the above function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above function.
[0308] In the embodiments of this application, Figure 15 The first device 1500 in the process can also be a chip or a chip system, such as a system on a chip (SoC).
[0309] Figure 16 Another first device 1600 provided in an embodiment of this application is illustrated. The first device 1600 includes a processor 1601, a memory 1602, a communication interface 1603, and a bus 1604. The memory 1602 is used to store instructions, and the processor 1601 is used to execute the instructions stored in the memory 1602. The processor 1601, the memory 1602, and the communication interface 1603 are interconnected via the bus 1604.
[0310] The processor 1601 is configured to: receive Bluetooth signals and acoustic signals from the second device; and, based on the Bluetooth signals and acoustic signals, determine the distance between the first device and the second device, wherein the first device and the second device have established a communication connection.
[0311] It should be understood that the first device 1600 may be specifically the first device in the above embodiments, or the functions of the first device in the above embodiments may be integrated into the first device 1600. The first device 1600 may be used to execute the various steps and / or processes corresponding to the first device in the above method embodiments.
[0312] Optionally, the memory 1602 may include read-only memory and random access memory, and provide instructions and data to the processor 1601. A portion of the memory 1602 may also include non-volatile random access memory. For example, the memory 1602 may also store device type information. The processor 1601 can be used to execute instructions stored in the memory, and when the processor executes the instructions, the processor 1601 can perform the various steps and / or processes corresponding to the first device in the above method embodiments.
[0313] It should be understood that, in the embodiments of this application, the processor may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0314] In implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software. The steps of the method disclosed in the embodiments of this application can be directly manifested as execution by a hardware processor, or as a combination of hardware and software modules within the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor executes the instructions in the memory, combining them with its hardware to complete the steps of the above method. To avoid repetition, detailed descriptions are omitted here.
[0315] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0316] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0317] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0318] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0319] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0320] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0321] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A distance measurement method, characterized in that, Applied to a first device, the method includes: Receive a third reference signal from a second device, wherein the third reference signal is a Bluetooth signal; Based on the third reference signal, the current distance between the first device and the second device is calculated; If the current distance is determined to be less than or equal to the third threshold, a request message is sent to the second device; Receives Bluetooth signals and acoustic signals from the second device; the Bluetooth signals and the acoustic signals are sent by the second device based on the request information; The distance between the first device and the second device can be obtained at least based on the reception times of the Bluetooth signal and the acoustic signal, as well as the transmission rate of the acoustic signal. If the distance is determined to be less than or equal to a first threshold, a control command is generated according to the preset correspondence between distance and control operation, and the operation corresponding to the control command is executed by the first device; or, the operation corresponding to the control command is executed by the second device, and the control command is sent from the first device to the second device, and the control operation includes at least one of opening the door, locking the door, increasing the volume, and decreasing the volume; The first device and the second device establish a Bluetooth communication connection.
2. The method according to claim 1, characterized in that, When the Bluetooth signal and the acoustic signal are transmitted at the same time, determining the distance between the first device and the second device based at least on the reception times of the Bluetooth signal and the acoustic signal and the transmission rate of the acoustic signal includes: The difference in reception times is determined based on the reception times of the Bluetooth signal and the acoustic signal. The distance between the first device and the second device is obtained based on the transmission rate of the acoustic signal and the absolute value of the difference.
3. The method according to claim 1, characterized in that, When the transmission times of the Bluetooth signal and the acoustic signal are separated by a preset time interval, the step of determining the distance between the first device and the second device based at least on the reception times of the Bluetooth signal and the acoustic signal and the transmission rate of the acoustic signal includes: The difference in reception times is determined based on the reception times of the Bluetooth signal and the acoustic signal. The distance between the first device and the second device is obtained based on the transmission rate of the acoustic signal, the absolute value of the difference, and the preset time interval.
4. The method according to claim 3, characterized in that, The distance L between the first device and the second device satisfies the following formula: L=V1*(Δt-t p ) Where V1 is the transmission rate of the acoustic signal, Δt is the absolute value of the difference, and t p The preset time interval is [the set time interval].
5. The method according to claim 3 or 4, characterized in that, The preset time interval is indicated by a target signal, or the preset time interval is pre-stored in the first device, whereby the target signal is the Bluetooth signal or the acoustic signal.
6. A first device, characterized in that, The first device includes: Bluetooth unit: used to receive a third reference signal from a second device, wherein the third reference signal is a Bluetooth signal; The processing unit is configured to calculate the current distance between the first device and the second device based on the third reference signal; and send a request message to the second device if it is determined that the current distance is less than or equal to a third threshold. The Bluetooth unit is used to receive Bluetooth signals from the second device; the Bluetooth signals are sent by the second device based on the request information. An acoustic wave unit is used to receive acoustic wave signals from the second device; the acoustic wave signals are sent by the second device based on the request information; The processing unit is configured to determine the distance between the first device and the second device based at least on the reception times of the Bluetooth signal and the acoustic signal and the transmission rate of the acoustic signal; if the distance is determined to be less than or equal to a first threshold, it generates a control command based on a preset correspondence between distance and control operation, wherein the operation corresponding to the control command is executed by the first device; or, the operation corresponding to the control command is executed by the second device, wherein the control command is sent from the first device to the second device, and the control operation includes at least one of opening the door, locking the door, increasing the volume, and decreasing the volume. The first device and the second device establish a Bluetooth communication connection.
7. The first device according to claim 6, characterized in that, When the Bluetooth signal and the acoustic signal are transmitted at the same time, the processing unit is used to: The difference in reception times is determined based on the reception times of the Bluetooth signal and the acoustic signal. The distance between the first device and the second device is obtained based on the transmission rate of the acoustic signal and the absolute value of the difference.
8. The first device according to claim 6, characterized in that, When the transmission times of the Bluetooth signal and the acoustic signal are separated by a preset time interval, the processing unit is used to: The difference in reception times is determined based on the reception times of the Bluetooth signal and the acoustic signal. The distance between the first device and the second device is obtained based on the transmission rate of the acoustic signal, the absolute value of the difference, and the preset time interval.
9. The first device according to claim 8, characterized in that, The distance L between the first device and the second device satisfies the following formula: L=V1*(Δt-t p ) Where V1 is the transmission rate of the acoustic signal, Δt is the absolute value of the difference, and t p The preset time interval is [the set time interval].
10. The first device according to claim 8, characterized in that, The preset time interval is indicated by a target signal, or the preset time interval is pre-stored in the first device, whereby the target signal is the Bluetooth signal or the acoustic signal.
11. A computer-readable storage medium, characterized in that, Used to store a computer program, the computer program including instructions for implementing the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Distance measurement method and device, storage medium and electronic equipment
CN112291710A
Prompting method, electronic equipment, Bluetooth headset and computer storage medium
CN113691939A