Ranging method and device, and electronic equipment
By establishing a connection between the master device and the target terminal, and having the slave device only listen for response data packets, the problem of spectrum resource occupation and energy consumption when multiple Bluetooth devices are used for ranging is solved, thus achieving fast and accurate ranging.
Patent Information
- Application Number
- CN202511046478.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-10-28
AI Technical Summary
When multiple Bluetooth devices are used for ranging, existing technologies suffer from excessive Bluetooth spectrum resource consumption and energy consumption.
The master device establishes a Bluetooth connection with the target terminal. The master and slave devices only listen to the response data packets of the target terminal. The master device sends an indication message to complete the ranging, avoiding the slave device from establishing a connection with the target terminal.
It reduces the use of Bluetooth spectrum resources, lowers energy consumption during ranging, and improves ranging accuracy and anti-interference capability.
Smart Images

Figure CN120847719A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of electronic equipment technology, specifically relating to a ranging method and device, and electronic equipment. Background Technology
[0002] In related technologies, achieving indoor positioning, smart object finding, and digital car key functions through smart electronic devices such as mobile phones and smartwatches requires these devices to be capable of distance measurement. Common distance measurement methods include Ultra-Wide Band (UWB) distance measurement and Bluetooth distance measurement. Among these, UWB distance measurement has a small ecosystem and high cost; therefore, Bluetooth distance measurement based on Channel Sounding (CS) has been widely used.
[0003] The channel detection specification only defines the point-to-point ranging specification between two Bluetooth devices. However, in scenarios where multiple Bluetooth devices are ranging from one Bluetooth device, each Bluetooth device needs to establish a connection and perform CS ranging separately. This greatly increases the communication overhead of Bluetooth devices, occupies more Bluetooth spectrum resources, and causes excessive energy consumption. Summary of the Invention
[0004] The purpose of this application is to provide a ranging method, device, and electronic device that can solve the problem of excessive Bluetooth spectrum resources being occupied and causing excessive energy consumption when multiple Bluetooth devices are performing ranging.
[0005] In a first aspect, embodiments of this application provide a ranging method, executed by a first electronic device, the method comprising:
[0006] Send a first message to the target terminal; wherein, the first message is used to obtain ranging information;
[0007] Send a second message to a second electronic device; wherein the second message is used to instruct the second electronic device to listen to the response data packet sent by the target terminal, and to determine the distance information between the second electronic device and the target terminal based on the response data packet, and the second message includes ranging information;
[0008] Send a ranging data packet to the target terminal; wherein, the ranging data packet is used to instruct the target terminal to send a response data packet;
[0009] Receive the response data packet and determine the distance information between the first electronic device and the target terminal based on the response data packet.
[0010] Secondly, embodiments of this application provide a ranging method, executed by a second electronic device, the ranging method comprising:
[0011] Receive a second message sent by the first electronic device; wherein the second message includes ranging information;
[0012] In response to the second message, listen for the response data packets sent by the target terminal;
[0013] The distance information between the second electronic device and the target terminal is determined based on the response data packet.
[0014] Thirdly, embodiments of this application provide a ranging device applied to a first electronic device, the ranging device comprising:
[0015] The sending module is used to send a first message to the target terminal; wherein the first message is used to acquire ranging information; and,
[0016] Sending a second message to a second electronic device; wherein the second message instructs the second electronic device to listen for response data packets sent by the target terminal, and to determine distance information between the second electronic device and the target terminal based on the response data packets; the second message includes ranging information; and,
[0017] Send a ranging data packet to the target terminal; wherein, the ranging data packet is used to instruct the target terminal to send a response data packet;
[0018] The first receiving module is used to receive response data packets and determine the distance information between the first electronic device and the target terminal based on the response data packets.
[0019] Fourthly, embodiments of this application provide a ranging device applied to a second electronic device, the ranging device comprising:
[0020] The second receiving module is used to receive a second message sent by the first electronic device; wherein the second message includes ranging information.
[0021] The listening module is used to listen for response data packets sent by the target terminal in response to the second message;
[0022] The determination module is used to determine the distance information between the second electronic device and the target terminal based on the response data packet.
[0023] Fifthly, embodiments of this application provide an electronic device including a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the methods as described in the first aspect and / or the second aspect.
[0024] In a sixth aspect, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the methods as described in the first and / or second aspects.
[0025] In a seventh aspect, embodiments of this application provide a chip including a processor and a communication interface coupled to the processor, the processor being used to run programs or instructions to implement the steps of the methods as described in the first and / or second aspects.
[0026] Eighthly, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the methods of the first aspect and / or the second aspect.
[0027] In this embodiment, in a scenario where multiple electronic devices perform Bluetooth ranging on a target terminal, the first electronic device among the multiple electronic devices establishes a Bluetooth connection with the target terminal and exchanges ranging data packets. The second electronic device among the multiple electronic devices does not need to exchange ranging data packets with the target terminal. Instead, it only needs to listen for response data packets between the target terminal and the first electronic device under the instruction of a second message sent by the first electronic device to complete the ranging. Therefore, it does not need to establish a Bluetooth connection with the target terminal, thus reducing the occupation of Bluetooth spectrum resources and lowering energy consumption during ranging. Attached Figure Description
[0028] Figure 1 Flowcharts of ranging methods according to some embodiments of this application are shown;
[0029] Figure 2 The following are schematic diagrams illustrating ranging of some embodiments of this application;
[0030] Figure 3 This application illustrates the interaction of multiple devices in a ranging method according to some embodiments;
[0031] Figure 4 A schematic diagram of the ranging cycle of some embodiments of this application is shown;
[0032] Figure 5 Flowcharts of ranging methods according to some embodiments of this application are shown;
[0033] Figure 6 Structural block diagrams of ranging devices according to some embodiments of this application are shown;
[0034] Figure 7 Structural block diagrams of ranging devices according to some embodiments of this application are shown;
[0035] Figure 8 A structural block diagram of an electronic device according to an embodiment of this application is shown;
[0036] Figure 9 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application. Detailed Implementation
[0037] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0038] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0039] The ranging method, apparatus, and electronic equipment provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.
[0040] In some embodiments of this application, a ranging method is provided, which is performed by a first electronic device.
[0041] Figure 1 Flowcharts of ranging methods according to some embodiments of this application are shown, such as Figure 1 As shown, the method includes:
[0042] Step 102: Send a first message to the target terminal; wherein the first message is used to obtain ranging information.
[0043] In this embodiment of the application, the application scenario is exemplarily described as a Bluetooth ranging scenario. A first electronic device and one or more second electronic devices need to complete ranging with a target terminal. For example, the first electronic device and the second electronic devices obtain distance information with the target terminal through Bluetooth-based CS ranging.
[0044] For example, Figure 2 The following are schematic diagrams illustrating ranging of some embodiments of this application, such as... Figure 2 As shown, a first electronic device is defined as the master device, and one or more second electronic devices are defined as slave devices. The number of second electronic devices may be multiple. Taking four second electronic devices as an example, these four second electronic devices are denoted as second electronic device 1, second electronic device 2, second electronic device 3, and second electronic device 4.
[0045] The first electronic device interacts with the target terminal, instructing the target terminal to enter ranging mode by sending a first message. At this time, the first electronic device and the target terminal negotiate to enter the CS ranging state, and interact to obtain ranging information. For example, the ranging information includes the Bluetooth communication connection key between the first electronic device and the target terminal, the device identifiers of the first electronic device and the target terminal, CS capability information, CS security authentication, CS default settings and configurations, etc.
[0046] Step 104: Send a second message to the second electronic device; wherein the second message is used to instruct the second electronic device to listen to the response data packet sent by the target terminal, and to determine the distance information between the second electronic device and the target terminal based on the response data packet, and the second message includes ranging information.
[0047] In this embodiment, the master device, i.e., the first electronic device, sends the ranging information required for CS ranging obtained through interaction with the target terminal to each slave device, i.e., to each second electronic device, via a second message. Upon receiving the second message, the second electronic device begins listening for response data packets sent by the target terminal.
[0048] Step 106: Send a ranging data packet to the target terminal; wherein the ranging data packet is used to instruct the target terminal to send a response data packet;
[0049] Step 108: Receive the response data packet and determine the distance information between the first electronic device and the target terminal based on the response data packet.
[0050] In this embodiment, for CS ranging, the core principle is to calculate the number of wave cycles required for signal propagation by comparing the phase difference between the transmitted and received signals, thereby deriving the distance. The ranging process involves the initiator sending a signal → the reflector returning a signal → repeated measurements at multiple frequencies, and the final ranging result is determined by combining the phase differences.
[0051] For example, after the first electronic device completes CS ranging negotiation with the target terminal and sends the ranging information to the second electronic device, the first electronic device sends a ranging data packet to the target terminal in each ranging cycle. The ranging data packet may carry the initial phase or may only be used to trigger the target terminal's signal return operation.
[0052] Upon receiving the ranging data packet from the first electronic device, the target terminal immediately transmits a response data packet. The first electronic device receives this response data packet through an information exchange channel with the target terminal, and determines the distance between the first electronic device and the target terminal based on the phase of the received response data packet.
[0053] For other secondary electronic devices, since the secondary electronic devices do not need to send any messages to the target terminal, that is, the secondary electronic devices do not need to achieve data interaction with the target terminal, the secondary electronic devices only need to listen to the response data packets sent by the target terminal. Based on the phase information and initial phase of the listened response data packets, the secondary electronic devices can determine the information between themselves and the target terminal and achieve ranging.
[0054] In this embodiment of the application, in a scenario where multiple electronic devices perform Bluetooth ranging on a target terminal, a first electronic device among the multiple electronic devices establishes a Bluetooth connection with the target terminal and exchanges ranging data packets. A second electronic device among the multiple electronic devices does not need to exchange ranging data packets with the target terminal; instead, it only needs to listen for response data packets between the target terminal and the first electronic device under the instruction of a second message sent by the first electronic device to complete the ranging. Therefore, it does not need to establish a Bluetooth connection with the target terminal, thus reducing the occupation of Bluetooth spectrum resources and lowering energy consumption during ranging.
[0055] In some embodiments of this application, the method further includes: before sending the first message to the target terminal:
[0056] Control the first electronic device to establish a first communication connection with the target terminal, and control the first electronic device to establish a second communication connection with the second electronic device;
[0057] In this process, the first electronic device sends a first message and a ranging data packet to the target terminal through a first communication connection, and the first electronic device sends a second message to each of the second electronic devices through a second communication connection.
[0058] In this embodiment, a first electronic device establishes a first communication connection with a target terminal. Exemplarily, the first communication connection is a Bluetooth communication connection. Simultaneously, the first electronic device establishes a second communication connection with one or more second electronic devices. Exemplarily, the second communication connection can be a Bluetooth communication connection, or a Wi-Fi communication connection, a Zifeng communication connection, an ultra-wideband communication connection, or a wired network-based communication connection.
[0059] The first electronic device sends the aforementioned second message to the second electronic device via a second communication connection, such as a Wi-Fi communication connection.
[0060] The first electronic device interacts with the target terminal via Bluetooth communication, sending the aforementioned first message and ranging data packets to the target terminal, and receiving the target terminal's response data packets through the same channel used to send the ranging data packets in the Bluetooth communication connection. Assuming the first electronic device sends ranging data packets to the target terminal through the first Bluetooth channel and receives response data packets through the same channel, the second electronic device can listen to the second Bluetooth channel using its own Bluetooth communication function, thereby listening to the response data packets.
[0061] In scenarios where multiple electronic devices are used to measure the distance to a target terminal, this application requires only the master device (first electronic device) to establish a Bluetooth communication connection with the target terminal. The other slave devices (second electronic devices) only need to listen to the return data packets from the target terminal to complete the positioning, effectively reducing the occupancy rate of Bluetooth spectrum resources.
[0062] In some embodiments of this application, sending ranging data packets to a target terminal includes: sending ranging data packets to the target terminal sequentially based on each of M communication channels within N periods, where N and M are positive integers, and N is greater than or equal to M;
[0063] Receiving response data packets includes: receiving response data packets sequentially based on each of the M communication channels within N cycles.
[0064] Taking N = 3 and M = 2 as an example: In the first cycle, ranging data packets are sent to the target terminal through communication channel A; in the second cycle, ranging data packets are sent to the target terminal through communication channel B; and in the third cycle, ranging data packets are sent to the target terminal through communication channel A.
[0065] In the embodiments of this application, one cycle corresponds to one channel, but different cycles may correspond to the same communication channel.
[0066] In this embodiment of the application, for CS ranging, by having the first electronic device and the target terminal quickly switch between multiple Bluetooth channels to measure phase information at different frequencies, the influence of multipath effect can be eliminated, and the anti-interference capability and accuracy of ranging can be improved.
[0067] For example, the first electronic device and the target terminal exchange data packets N times in N cycles on M communication channels of different frequencies, thereby completing the ranging.
[0068] For example, Figure 3 The following diagram illustrates the interaction of multiple devices in the ranging method of some embodiments of this application, such as... Figure 3 As shown, the first electronic device establishes a Bluetooth communication connection with the target terminal and a second communication connection with the second electronic device.
[0069] After the connection is established, the first electronic device and the target terminal exchange information, exchange the information required for CS ranging, and negotiate to enter the CS ranging state.
[0070] After the negotiation is completed, the first electronic device sends the information required for CS ranging to each of the second electronic devices, and each of the second electronic devices confirms to the first electronic device that the information has been successfully received.
[0071] In the first round of ranging data packet exchange, the first electronic device sends a ranging data packet to the target terminal. Upon receiving the ranging data packet, the target terminal sends a response data packet on the same communication channel. At this time, the first electronic device receives the response data packet via Bluetooth communication, and each second electronic device listens for the response data packet from the target terminal.
[0072] The above process is repeated N times. In the Nth round of ranging data packet exchange, the first electronic device sends a ranging data packet to the target terminal. After receiving the ranging data packet, the target terminal sends a response data packet on the same communication channel. At this time, the first electronic device receives the response data packet via Bluetooth communication connection, and each second electronic device listens for the response data packet from the target terminal.
[0073] Subsequently, the first electronic device and the second electronic device calculate the distance information between themselves and the target terminal based on the received response data packets.
[0074] For example, regarding the exchange of N rounds of ranging data packets between the target terminal, the first electronic device, and the second electronic device, according to the CS specification in the Bluetooth standard protocol, there are three CS ranging modes: Mode-1, Mode-2, and Mode-3. For ease of description, Mode-2 will be used for CS ranging in the following explanation.
[0075] Figure 4 A schematic diagram of the ranging cycle of some embodiments of this application is shown, such as Figure 4 As shown, according to the Bluetooth protocol, the exchange of Mode-2 data packets needs to be performed on different channels based on the frequency hopping algorithm. After each round of data packet exchange, the process switches to a new channel and continues. During each round of data packet exchange, the first electronic device sends Mode-2 type data packets to the target terminal, and the target terminal responds by sending a corresponding data packet to the master device. Simultaneously, each second electronic device can also receive response data packets from the target terminal through listening.
[0076] This application improves ranging accuracy by exchanging ranging data packets on M communication channels of different frequencies.
[0077] In some embodiments of this application, each ranging data packet includes phase data, and the target terminal determines a first initial phase based on the phase data and sends a response data packet based on the first initial phase; or, the target terminal sends a response data packet based on a second initial phase; wherein the second initial phase corresponding to N cycles is the same.
[0078] In this embodiment, for example, the ranging data packet sent by the first electronic device to the target terminal includes a first initial phase, and the target terminal sends a corresponding response data packet based on the first initial phase. For example, when the first electronic device and the target perform the first round of data packet exchange, it is assumed that the frequency of the working channel is f1. The first electronic device sends a Mode-2 data packet to the target terminal, and the target terminal calculates the phase corresponding to the received data packet and responds by sending a data packet with the same phase. At this time, the first electronic device detects the data packet from the target terminal and calculates the phase as Phi_1_0. Assuming there are four second electronic devices, each second electronic device receives the response data packet by listening and calculates the phases as Phi_1_1, Phi_1_2, Phi_1_3, and Phi_1_4, respectively.
[0079] After completing one round of Mode-2 ranging data packet exchange, the frequency is hopped to a channel with frequency f2. At this time, the first electronic device detects the data packet from the target terminal and calculates the phase as Phi_2_0. Each second electronic device receives the data packet by listening and calculates the phases as Phi_2_1, Phi_2_2, Phi_2_3, Phi_2_4, and so on. The initial phase of the response data packets in the first and Nth rounds is determined based on the data packets sent by the first electronic device.
[0080] According to the protocol specifications, the distance can be calculated using the phase measured on different frequency channels. It's important to note that, using the above method, the distance calculated by the first electronic device is twice the distance between the first electronic device and the target terminal. The distance calculated by each second electronic device is the sum of the distance between that second electronic device and the target terminal and the distance between the target terminal and the first electronic device.
[0081] For example, the initial phase of the response data packet sent by the target terminal is not specified by the ranging data packet sent by the first electronic device, but is always the same second initial phase. For example, the second initial phase is 0°. For example, when the first electronic device and the target terminal perform the first round of data packet exchange, it is assumed that the frequency of the working channel is f1 at this time. The first electronic device sends a Mode-2 data packet to the target terminal, and the target terminal always sends a response data packet with the same initial phase. At this time, the first electronic device detects the data packet from the target terminal and calculates the phase as Phi_1_0. Each second electronic device receives the data packet by listening and calculates the phases as Phi_1_1, Phi_1_2, Phi_1_3, and Phi_1_4, respectively.
[0082] After completing one round of Mode-2 ranging data packet exchange, the frequency is hopped to a channel with frequency f2. At this time, the first electronic device detects the data packet from the target terminal and calculates the phase as Phi_2_0. Each second electronic device receives the data packet by listening and calculates the phases as Phi_2_1, Phi_2_2, Phi_2_3, and Phi_2_4, respectively, and so on. The initial phase of the response data packets in the first round and the Nth round is the same.
[0083] According to the protocol specifications, the distance can be calculated using the phase measurements taken on different frequency channels. It's important to note that the distance calculated by the first electronic device using the above method is the distance between the target terminal and the first electronic device. Each second electronic device calculates the distance between itself and the target terminal.
[0084] This application enables rapid and accurate distance measurement.
[0085] A second aspect of this application provides a ranging method performed by a second electronic device. Figure 5 Flowcharts of ranging methods according to some embodiments of this application are shown, such as Figure 5 As shown, the distance measurement methods include:
[0086] Step 502: Receive a second message sent by the first electronic device; wherein the second message includes ranging information;
[0087] Step 504: In response to the second message, listen for the response data packet sent by the target terminal;
[0088] Step 506: Determine the distance information between the second electronic device and the target terminal based on the response data packet.
[0089] In this embodiment, a first electronic device and one or more second electronic devices need to perform ranging with a target terminal. The first electronic device is the master device, and the multiple second electronic devices are slave devices. The first electronic device interacts with the target terminal by sending a first message to instruct the target terminal to enter ranging mode. The first electronic device interacts with the target terminal to obtain ranging information. For example, the ranging information includes the Bluetooth communication connection key between the first electronic device and the target terminal, the device identifiers of the first electronic device and the target terminal, CS capability information, CS security authentication, CS default settings and configuration, etc.
[0090] The first electronic device, having obtained the ranging information required for CS ranging through interaction with the target terminal, sends a second message to each slave device. Upon receiving the second message, the second electronic device begins listening for response data packets sent by the target terminal.
[0091] Since the second electronic device does not need to send any messages to the target terminal, that is, the second electronic device does not need to interact with the target terminal, the second electronic device only needs to listen to the response data packets sent by the target terminal. Based on the phase information and initial phase of the listened response data packets, the second electronic device can determine the information between itself and the target terminal and realize the ranging.
[0092] In the scenario where multiple electronic devices measure the distance to a target terminal, the second electronic device, acting as a slave device, does not need to establish a complete transmit / receive communication connection with the target terminal. It completes the distance measurement by listening to the distance measurement data packets, thus reducing the occupation of Bluetooth spectrum resources and lowering the energy consumption during distance measurement.
[0093] In some embodiments of this application, before receiving the second message sent by the first electronic device, the method further includes: controlling the second electronic device to establish a second communication connection with the first electronic device; wherein the second electronic device receives the second message sent by the first electronic device through the second communication connection.
[0094] In this embodiment, a second communication connection is established between the second electronic device and the first electronic device. Exemplarily, the second communication connection can be a Bluetooth communication connection, a Wi-Fi communication connection, a Zifeng communication connection, an ultra-wideband communication connection, or a wired network-based communication connection. The second electronic device receives the aforementioned second message sent by the first electronic device through the second communication connection, such as a Wi-Fi communication connection.
[0095] In scenarios where multiple electronic devices are used to measure the distance to a target terminal, the second electronic device, acting as a slave device, only needs to listen to the return data packets from the target terminal to complete the positioning, effectively reducing the occupancy rate of Bluetooth spectrum resources.
[0096] In some embodiments of this application, listening to the response data packets sent by the target terminal includes:
[0097] Within N cycles, response data packets are listened to sequentially through each of the M communication channels, where N and M are positive integers, and N is greater than or equal to M; wherein, within N cycles, the first electronic device sends ranging data to the target terminal sequentially through each of the M communication channels; and within N cycles, the target terminal sends response data packets sequentially through each of the M communication channels.
[0098] In this embodiment, by rapidly switching between multiple Bluetooth channels between the first electronic device and the target terminal, phase information at different frequencies can be measured, eliminating the influence of multipath effects and improving the anti-interference capability and accuracy of ranging. The second electronic device listens for response data packets sent by the target terminal on M communication channels of different frequencies within N cycles. The distance information between the electronic device and the target terminal is calculated based on the received response data packets.
[0099] This application improves ranging accuracy by exchanging ranging data packets on M communication channels of different frequencies.
[0100] The ranging method provided in this application can be executed by a ranging device. This application uses a ranging device executing the ranging method as an example to illustrate the ranging device provided in this application.
[0101] A third aspect of this application provides a ranging device applied to a first electronic device. Figure 6 Structural block diagrams of ranging devices according to some embodiments of this application are shown, such as... Figure 6 As shown, the ranging device 600 includes:
[0102] The sending module 602 is configured to send a first message to a target terminal, wherein the first message is used to acquire ranging information; and to send a second message to a second electronic device, wherein the second message is used to instruct the second electronic device to listen for a response data packet sent by the target terminal, the second message including ranging information; and to send a ranging data packet to the target terminal; wherein, when the target terminal receives the ranging data packet, the target terminal sends a response data packet, and the second electronic device determines the distance information between the second electronic device and the target terminal based on the response data packet.
[0103] The first receiving module 604 is used to receive response data packets and determine the distance information between the first electronic device and the target terminal based on the response data packets.
[0104] In the scenario where multiple electronic devices measure the distance to a target terminal, only the first electronic device needs to establish a ranging connection with the target terminal. The other second electronic devices do not need to establish a complete transmit / receive communication connection with the target terminal. They complete the ranging by listening to the ranging data packets. Therefore, the occupation of Bluetooth spectrum resources can be reduced and the energy consumption during ranging can be reduced.
[0105] In some embodiments of this application, the ranging device further includes:
[0106] The first control module is used to control the first electronic device to establish a first communication connection with the target terminal and to control the first electronic device to establish a second communication connection with the second electronic device; wherein, the first electronic device sends a first message and a ranging data packet to the target terminal through the first communication connection, and the first electronic device sends a second message to each of the second electronic devices through the second communication connection.
[0107] In scenarios where multiple electronic devices are used to measure the distance to a target terminal, this application requires only the master device (first electronic device) to establish a Bluetooth communication connection with the target terminal. The other slave devices (second electronic devices) only need to listen to the return data packets from the target terminal to complete the positioning, effectively reducing the occupancy rate of Bluetooth spectrum resources.
[0108] In some embodiments of this application, the sending module is further configured to send ranging data packets to the target terminal sequentially based on each of the M communication channels within N periods, where N and M are positive integers, and N is greater than or equal to M; the first receiving module is further configured to receive response data packets sequentially based on each of the M communication channels within N periods.
[0109] This application improves ranging accuracy by exchanging ranging data packets on M communication channels of different frequencies.
[0110] In some embodiments of this application, each ranging data packet includes phase data, and the target terminal determines a first initial phase based on the phase data and sends a response data packet based on the first initial phase; or, the target terminal sends a response data packet based on a second initial phase; wherein the second initial phase corresponding to N cycles is the same.
[0111] This application enables rapid and accurate distance measurement.
[0112] A fourth aspect of this application provides a ranging device for use in a second electronic device. Figure 7 Structural block diagrams of ranging devices according to some embodiments of this application are shown, such as... Figure 7 As shown, the ranging device 700 includes:
[0113] The second receiving module 702 is used to receive a second message sent by the first electronic device; wherein the second message includes ranging information;
[0114] The listening module 704 is used to listen to the response data packets sent by the target terminal in response to the second message;
[0115] The determination module 706 is used to determine the distance information between the second electronic device and the target terminal based on the response data packet.
[0116] In the scenario where multiple electronic devices measure the distance to a target terminal, the second electronic device, acting as a slave device, does not need to establish a complete transmit / receive communication connection with the target terminal. It completes the distance measurement by listening to the distance measurement data packets, thus reducing the occupation of Bluetooth spectrum resources and lowering the energy consumption during distance measurement.
[0117] In some embodiments of this application, the ranging device further includes:
[0118] The second control module is used to control the second electronic device to establish a second communication connection with the first electronic device; wherein, the second electronic device receives a second message sent by the first electronic device through the second communication connection.
[0119] In scenarios where multiple electronic devices are used to measure the distance to a target terminal, the second electronic device, acting as a slave device, only needs to listen to the return data packets from the target terminal to complete the positioning, effectively reducing the occupancy rate of Bluetooth spectrum resources.
[0120] In some embodiments of this application, the listening module is further configured to listen for response data packets sequentially on each of the M communication channels within N periods, where N and M are positive integers, and N is greater than or equal to M; wherein, the first electronic device sends ranging data to the target terminal sequentially on each of the M communication channels within N periods; and the target terminal sends response data packets sequentially on each of the M communication channels within N periods.
[0121] This application improves ranging accuracy by exchanging ranging data packets on M communication channels of different frequencies.
[0122] The ranging device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the scope of the device.
[0123] The ranging device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.
[0124] The ranging device provided in this application embodiment can realize all the processes implemented in the above method embodiments, and will not be described again here to avoid repetition.
[0125] Optionally, embodiments of this application also provide an electronic device. Figure 8 A structural block diagram of an electronic device according to an embodiment of this application is shown, such as... Figure 8 As shown, the electronic device 800 includes a processor 802, a memory 804, and a program or instructions stored in the memory 804 and executable on the processor 802. When the program or instructions are executed by the processor 802, they implement the various processes of the above method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.
[0126] It should be noted that the electronic devices in the embodiments of this application include the aforementioned mobile electronic devices and non-mobile electronic devices.
[0127] Figure 9 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.
[0128] The electronic device 900 includes, but is not limited to, components such as: radio frequency unit 901, network module 902, audio output unit 903, input unit 904, sensor 905, display unit 906, user input unit 907, interface unit 908, memory 909, and processor 910.
[0129] Those skilled in the art will understand that the electronic device 900 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 910 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 9 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0130] The processor 910 is configured to send a first message to a target terminal, wherein the first message is used to acquire ranging information; and to send a second message to a second electronic device, wherein the second message is used to instruct the second electronic device to listen for a response data packet sent by the target terminal, the second message including ranging information; and to send a ranging data packet to the target terminal; wherein, when the target terminal receives the ranging data packet, the target terminal sends a response data packet, and the second electronic device determines the distance information between the second electronic device and the target terminal based on the response data packet; and to receive the response data packet and determine the distance information between the first electronic device and the target terminal based on the response data packet.
[0131] In the scenario where multiple electronic devices measure the distance to a target terminal, only the first electronic device needs to establish a ranging connection with the target terminal. The other second electronic devices do not need to establish a complete transmit / receive communication connection with the target terminal. They complete the ranging by listening to the ranging data packets. Therefore, the occupation of Bluetooth spectrum resources can be reduced and the energy consumption during ranging can be reduced.
[0132] Optionally, the processor 910 is further configured to control the first electronic device to establish a first communication connection with the target terminal, and to control the first electronic device to establish a second communication connection with the second electronic device; wherein the first electronic device sends a first message and a ranging data packet to the target terminal through the first communication connection, and the first electronic device sends a second message to each of the second electronic devices through the second communication connection.
[0133] In scenarios where multiple electronic devices are used to measure the distance to a target terminal, this application requires only the master device (first electronic device) to establish a Bluetooth communication connection with the target terminal. The other slave devices (second electronic devices) only need to listen to the return data packets from the target terminal to complete the positioning, effectively reducing the occupancy rate of Bluetooth spectrum resources.
[0134] Optionally, the processor 910 is further configured to send ranging data packets to the target terminal sequentially based on each of the N communication channels within N cycles, where N and M are positive integers, and N is greater than or equal to M; the first receiving module is further configured to receive response data packets sequentially based on each of the M communication channels within N cycles.
[0135] This application improves ranging accuracy by exchanging ranging data packets on M communication channels of different frequencies.
[0136] Optionally, each ranging data packet includes phase data, and the target terminal determines a first initial phase based on the phase data and sends a response data packet based on the first initial phase; or, the target terminal sends a response data packet based on a second initial phase; wherein the second initial phase is the same for N cycles.
[0137] This application enables rapid and accurate distance measurement.
[0138] Optionally, the processor 910 is further configured to receive a second message sent by the first electronic device; wherein the second message includes ranging information; in response to the second message, listen for a response data packet sent by the target terminal; and determine the distance information between the second electronic device and the target terminal based on the response data packet.
[0139] In the scenario where multiple electronic devices measure the distance to a target terminal, the second electronic device, acting as a slave device, does not need to establish a complete transmit / receive communication connection with the target terminal. It completes the distance measurement by listening to the distance measurement data packets, thus reducing the occupation of Bluetooth spectrum resources and lowering the energy consumption during distance measurement.
[0140] Optionally, the processor 910 is further configured to control the second electronic device to establish a second communication connection with the first electronic device; wherein the second electronic device receives a second message sent by the first electronic device through the second communication connection.
[0141] In scenarios where multiple electronic devices are used to measure the distance to a target terminal, the second electronic device, acting as a slave device, only needs to listen to the return data packets from the target terminal to complete the positioning, effectively reducing the occupancy rate of Bluetooth spectrum resources.
[0142] Optionally, the processor 910 is further configured to listen for response data packets sequentially on each of the M communication channels within N cycles, where N and M are positive integers, and N is greater than or equal to M; wherein, the first electronic device sends ranging data to the target terminal sequentially on each of the M communication channels within N cycles; and the target terminal sends response data packets sequentially on each of the M communication channels within N cycles.
[0143] This application improves ranging accuracy by exchanging ranging data packets on M communication channels of different frequencies.
[0144] It should be understood that, in this embodiment, the input unit 904 may include a graphics processing unit (GPU) 9041 and a microphone 9042. The GPU 9041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 906 may include a display panel 9061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 907 includes at least one of a touch panel 9071 and other input devices 9072. The touch panel 9071 is also called a touch screen. The touch panel 9071 may include a touch detection device and a touch controller. Other input devices 9072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0145] The memory 909 can be used to store software programs and various data. The memory 909 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 909 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 909 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.
[0146] Processor 910 may include one or more processing units; optionally, processor 910 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 910.
[0147] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0148] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0149] This application also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0150] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0151] This application provides a computer program product that is stored in a storage medium and executed by at least one processor to implement the various processes of the above method embodiments and achieve the same technical effects. To avoid repetition, further details are omitted here.
[0152] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0153] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0154] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A ranging method, executed by a first electronic device, characterized in that, The method includes: Send a first message to the target terminal; wherein the first message is used to obtain ranging information; Send a second message to a second electronic device; wherein the second message is used to instruct the second electronic device to listen to the response data packet sent by the target terminal, and to determine the distance information between the second electronic device and the target terminal based on the response data packet, the second message including the ranging information; A ranging data packet is sent to the target terminal; wherein the ranging data packet is used to instruct the target terminal to send the response data packet; The system receives the response data packet and determines the distance information between the first electronic device and the target terminal based on the response data packet.
2. The ranging method according to claim 1, characterized in that, Before sending the first message to the target terminal, the method further includes: The system controls the first electronic device to establish a first communication connection with the target terminal, and controls the first electronic device to establish a second communication connection with the second electronic device. The first electronic device sends the first message and the ranging data packet to the target terminal through the first communication connection, and the first electronic device sends the second message to each of the second electronic devices through the second communication connection.
3. The ranging method according to claim 1, characterized in that, Sending ranging data packets to the target terminal includes: Within N cycles, the ranging data packet is sent to the target terminal sequentially based on each of the M communication channels, where N and M are positive integers, and N is greater than or equal to M. Receiving the response data packet includes: Within the N cycles, the response data packet is received sequentially based on each of the M communication channels.
4. The ranging method according to claim 3, characterized in that, Each ranging data packet includes phase data. The target terminal determines a first initial phase based on the phase data and sends the response data packet based on the first initial phase; or... The target terminal sends the response data packet based on a second initial phase; wherein the second initial phase corresponding to the N cycles is the same.
5. A ranging method, performed by a second electronic device, characterized in that, The method includes: Receive a second message sent by a first electronic device; wherein the second message includes ranging information; In response to the second message, listen for the response data packets sent by the target terminal; The distance information between the second electronic device and the target terminal is determined based on the response data packet.
6. The ranging method according to claim 5, characterized in that, Before receiving the second message sent by the first electronic device, the method further includes: The second electronic device is controlled to establish a second communication connection with the first electronic device; wherein the second electronic device receives the second message sent by the first electronic device through the second communication connection.
7. The ranging method according to claim 5, characterized in that, The response data packets sent by the target terminal being monitored include: Within N periods, the response data packet is listened to sequentially based on each of the M communication channels, where N and M are positive integers, and N is greater than or equal to M; In this process, the first electronic device sequentially sends ranging data to the target terminal based on each of the M communication channels within the N cycles; and the target terminal sequentially sends the response data packet based on each of the M communication channels within the N cycles.
8. A ranging device, applied to a first electronic device, characterized in that, The ranging device includes: The sending module is configured to send a first message to the target terminal; wherein the first message is used to acquire ranging information; and, Sending a second message to a second electronic device; wherein the second message is used to instruct the second electronic device to listen for response data packets sent by the target terminal, and to determine distance information between the second electronic device and the target terminal based on the response data packets, the second message including the ranging information; and, A ranging data packet is sent to the target terminal; wherein the ranging data packet is used to instruct the target terminal to send the response data packet; The first receiving module is used to receive the response data packet and determine the distance information between the first electronic device and the target terminal based on the response data packet.
9. The ranging device according to claim 8, characterized in that, The ranging device further includes: The first control module is used to control the first electronic device to establish a first communication connection with the target terminal, and to control the first electronic device to establish a second communication connection with the second electronic device; The first electronic device sends the first message and the ranging data packet to the target terminal through the first communication connection, and the first electronic device sends the second message to each of the second electronic devices through the second communication connection.
10. The ranging device according to claim 8, characterized in that, The sending module is further configured to send the ranging data packet to the target terminal sequentially based on each of the M communication channels within N cycles, where N and M are positive integers, and N is greater than or equal to M; The first receiving module is further configured to receive the response data packet sequentially based on each of the M communication channels within the N cycles.
11. The ranging device according to claim 10, characterized in that, Each ranging data packet includes phase data. The target terminal determines a first initial phase based on the phase data and sends the response data packet based on the first initial phase; or... The target terminal sends the response data packet based on a second initial phase; wherein the second initial phase corresponding to the N cycles is the same.
12. A ranging device, applied to a second electronic device, characterized in that, The ranging device includes: The second receiving module is used to receive a second message sent by the first electronic device; wherein the second message includes ranging information; The listening module is used to listen to the response data packets sent by the target terminal in response to the second message; The determination module is used to determine the distance information between the second electronic device and the target terminal based on the response data packet.
13. The ranging device according to claim 12, characterized in that, The ranging device further includes: The second control module is used to control the second electronic device to establish a second communication connection with the first electronic device; wherein the second electronic device receives the second message sent by the first electronic device through the second communication connection.
14. The ranging device according to claim 12, characterized in that, The listening module is also used to listen to the response data packet sequentially based on each of the M communication channels within N periods, where N and M are positive integers, and N is greater than or equal to M; In this process, the first electronic device sequentially sends ranging data to the target terminal based on each of the M communication channels within the N cycles; and the target terminal sequentially sends the response data packet based on each of the M communication channels within the N cycles.
15. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the method as described in any one of claims 1 to 7.