WO2022000354A1 - Method for ranging and terminal device - Google Patents

Method for ranging and terminal device Download PDF

Info

Publication number
WO2022000354A1
WO2022000354A1 PCT/CN2020/099601 CN2020099601W WO2022000354A1 WO 2022000354 A1 WO2022000354 A1 WO 2022000354A1 CN 2020099601 W CN2020099601 W CN 2020099601W WO 2022000354 A1 WO2022000354 A1 WO 2022000354A1
Authority
WO
WIPO (PCT)
Prior art keywords
timestamp
broadcast information
ble
receiving
reception
Prior art date
Application number
PCT/CN2020/099601
Other languages
French (fr)
Chinese (zh)
Inventor
罗朝明
茹昭
张军
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to CN202080100198.4A priority Critical patent/CN115443665A/en
Priority to PCT/CN2020/099601 priority patent/WO2022000354A1/en
Publication of WO2022000354A1 publication Critical patent/WO2022000354A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/02Services making use of location information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present application relates to the technical field of the Internet of Things, and more particularly, to a method and terminal device for ranging.
  • RSSI Received Signal Strength Indication
  • TOA Time of Arrival
  • AOA Angle of Arrival
  • AOD Angle of Departure
  • BLE Bluetooth Low Energy
  • the RSSI value measured based on BLE fluctuates greatly, and the estimated distance accuracy lower.
  • the receiver or transmitter needs to have an antenna array, usually more than three antenna devices are required to measure the position and distance, and the cost is high.
  • the embodiments of the present application provide a method and a terminal device for distance measurement, and the information required for calculating the terminal distance can be obtained by using the embodiments of the present application.
  • An embodiment of the present application provides a method for ranging, including:
  • the first device sends first low-power Bluetooth BLE broadcast information, where the first BLE broadcast information includes a first fixed-frequency extended CTE signal; the first device records a first transmission timestamp of the first CTE signal;
  • the first device receives second BLE broadcast information sent by the second device, where the second BLE broadcast information includes a second CTE signal; the first device records a second reception timestamp of the second CTE signal; The first sending timestamp and the second receiving timestamp are used to calculate the distance between the first device and the second device.
  • the embodiment of the present application also provides a terminal device, including:
  • a first sending module configured to send first low-power Bluetooth BLE broadcast information, where the first BLE broadcast information includes a first fixed frequency extended CTE signal;
  • a first recording module configured to record the first transmission time stamp of the first CTE signal
  • a first receiving module configured to receive second BLE broadcast information sent by a second device, where the second BLE broadcast information includes a second CTE signal;
  • a second recording module configured to record a second reception timestamp of the second CTE signal; wherein the first transmission timestamp and the second reception timestamp are used to calculate the relationship between the first device and the first device. The distance between the two devices.
  • An embodiment of the present application further provides a terminal device, including: a processor and a memory, where the memory is used to store a computer program, the processor invokes and runs the computer program stored in the memory, and executes the method of distance measurement.
  • An embodiment of the present application further provides a chip, including: a processor configured to call and run a computer program from a memory, so that a device on which the chip is installed executes the method for ranging as described above.
  • Embodiments of the present application further provide a computer-readable storage medium for storing a computer program, wherein the computer program causes a computer to execute the method for ranging as described above.
  • Embodiments of the present application also provide a computer program product, including computer program instructions, wherein the computer program instructions cause a computer to execute the above-described method for controlling transmit power.
  • Embodiments of the present application also provide a computer program, the computer program causing a computer to execute the method for ranging as described above.
  • the terminal device uses the low-power Bluetooth BLE broadcast information carrying the fixed frequency extended CTE signal, and records the transmission timestamp and reception timestamp information of the CTE signal.
  • the group time stamp information the time error of the multiple groups of time stamp information obtained based on the embodiment of the present application is small, and the calculated distance between devices has high precision.
  • Figure 1 is a schematic diagram of the logical principle effect of unilateral bidirectional ranging.
  • FIG. 2 and FIG. 3 are schematic diagrams of the logical principle effect of the four-message mode and the three-message mode of bilateral two-way ranging, respectively.
  • FIG. 4 is a flowchart of a method for ranging on a first device side according to an embodiment of the present application.
  • FIG. 5 is a flowchart of a method for ranging on a second device side according to an embodiment of the present application.
  • FIG. 6 is a flowchart of a method for ranging on an electronic device side according to an embodiment of the present application.
  • FIG. 7 is a schematic diagram of information interaction between two devices in Embodiment 1 of the present application.
  • FIG. 8 is a schematic diagram of various timestamp information obtained by interaction according to the embodiment of FIG. 7 .
  • FIG. 9 is a flowchart of a method for ranging on a third device side according to an embodiment of the present application.
  • FIG. 10 is a flowchart of a method for ranging on a fourth device side according to an embodiment of the present application.
  • FIG. 11 is a schematic diagram of information interaction between two devices in Embodiment 2 of the present application.
  • FIG. 12 is a schematic diagram of various timestamp information obtained by interaction according to the embodiment of FIG. 11 .
  • FIG. 13 and 14 are schematic structural block diagrams of the first device and the second device according to the embodiments of the present application.
  • FIG. 15 is a schematic structural block diagram of an electronic device according to an embodiment of the present application.
  • 16 and 17 are schematic structural block diagrams of the third device and the fourth device according to the embodiments of the present application.
  • FIG. 18 is a schematic block diagram of a communication device according to an embodiment of the present application.
  • FIG. 19 is a schematic block diagram of a chip according to an embodiment of the present application.
  • terminal equipment may also be referred to as user equipment (User Equipment, UE), access terminal, subscriber unit, subscriber station, mobile station, mobile station, remote station, remote station Terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user equipment, etc.
  • UE User Equipment
  • access terminal subscriber unit, subscriber station, mobile station, mobile station, remote station, remote station Terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user equipment, etc.
  • the terminal device may be a mobile phone (Mobile Phone), a tablet computer (Pad), a computer with a wireless transceiver function, a virtual reality (Virtual Reality, VR) terminal device, and an augmented reality (Augmented Reality, AR) terminal equipment, wireless terminal equipment in industrial control, wireless terminal equipment in unmanned driving, wireless terminal equipment in remote medical, wireless terminal equipment in smart grid, transportation safety ( Wireless terminal equipment in transportation safety), wireless terminal equipment in smart city or wireless terminal equipment in smart home, etc.
  • a mobile phone Mobile Phone
  • a tablet computer Pad
  • a computer with a wireless transceiver function a virtual reality (Virtual Reality, VR) terminal device
  • an augmented reality (Augmented Reality, AR) terminal equipment wireless terminal equipment in industrial control, wireless terminal equipment in unmanned driving, wireless terminal equipment in remote medical, wireless terminal equipment in smart grid, transportation safety ( Wireless terminal equipment in transportation safety), wireless terminal equipment in smart city or wireless terminal equipment in smart home, etc.
  • the terminal device may also be a wearable device.
  • Wearable devices can also be called wearable smart devices, which are the general term for the intelligent design of daily wear and the development of wearable devices using wearable technology, such as glasses, gloves, watches, clothing and shoes.
  • a wearable device is a portable device that is worn directly on the body or integrated into the user's clothing or accessories. Wearable device is not only a hardware device, but also realizes powerful functions through software support, data interaction, and cloud interaction.
  • wearable smart devices include full-featured, large-scale, complete or partial functions without relying on smart phones, such as smart watches or smart glasses, and only focus on a certain type of application function, which needs to cooperate with other devices such as smart phones.
  • the unilateral/bilateral bidirectional ranging method is briefly described first.
  • the transmitter physical layer records the time when a specific signal (such as RMARKER) is sent, and the receiver physical layer records the arrival time of the specific signal, calculates the time difference, and then estimates the distance between the two according to the physical characteristics of electromagnetic wave propagation.
  • the technical key point of this method is to reduce the timing error by timing the physical layer, improve the accuracy, and improve the detection success rate by using a specific signal. Based on this, there are several calculation methods as follows.
  • SS-TWR is a simple measurement of time for a single round-trip message
  • device A actively sends data to device B
  • device B responds to device A with data.
  • the ranging process is as follows: Device A actively sends (TX) data, and records the sending time stamp, and device B records the receiving time stamp after receiving (RX); after delaying T reply , device B sends data and records the sending time at the same time. Stamp, device A receives the data, and records the receiving timestamp at the same time.
  • T prop 1/2(T round d–T reply )
  • T prop 1/2 (T round – T reply (1 – Coffs))
  • Coffs is the clock offset between device A's receiver and remote device B's transmitter.
  • the distance between device A and device B can be obtained by multiplying the propagation time T prop of the signal by the speed of light c.
  • DS-TWR is an extended method of unilateral two-way ranging. It needs to record the time stamps of two round trips, and finally get the flight time. Although it increases the response time, it can reduce the ranging error.
  • the bilateral two-way ranging algorithm can be divided into two-way two-way ranging 4 message mode (DS-TWR with 4 messages), and bilateral two-way ranging 3 message mode (DS-TWR with 3 messages).
  • Bilateral two-way ranging is divided into two ranging.
  • Device A actively initiates the first ranging message, and device B responds.
  • device A receives the data, it returns the data, and finally four time differences can be obtained: T round1 , T reply1 , T round2 , T reply2 .
  • FIG. 2 shows a schematic diagram of the principle of the bilateral two-way ranging 4 message mode
  • FIG. 3 shows a schematic schematic diagram of the principle of the bilateral two-way ranging 3 message mode. Comparing Figure 2 and Figure 3, where T round1 , T reply1 , T round2 , and T reply2 are calculated in different ways, the propagation time T prop can be calculated as follows:
  • Ultra Wide Band (UWB) modules are not supported. Therefore, for unilateral two-way ranging or bilateral two-way ranging related functions are not supported.
  • the embodiments of the present application provide a method for assisting ranging, and the main purpose is to obtain timestamp information of signal waves transmitted and received between devices.
  • the terminal device of the embodiments of the present application uses Bluetooth Low Energy (Bluetooth Low Energy) , BLE) fixed frequency extension (Constant Tone Extension, CTE) signal, can realize unilateral two-way ranging or bilateral two-way ranging function of terminal equipment, low cost and good effect.
  • Bluetooth Low Energy Bluetooth Low Energy
  • BLE fixed frequency extension
  • CTE Constant Tone Extension
  • the CTE signal in the embodiment of the present application, it is a special Bluetooth signal with the characteristics of low-power Bluetooth BLE.
  • the CTE signal has the characteristics of a long transmission time, and the receiver can extract the in-phase quadrature signal (In-phase Quadrature signal).
  • Signal, IQ sample data without interfering with the modulation, and the CTE signal is transmitted at the end of the corresponding physical link data packet, so it will not affect the cyclic redundancy check of the data packet.
  • the clock time of the recording itself is increased.
  • the BLE physical layer implementation can be modified, for example, the physical layer recording
  • the time is the end time point of the guard interval (Guard period) or the end time point of the reference interval (Reference period)
  • the calculation is based on the specific Switch slot where the signal of the sampled switch slot (Switch slot) is located and the duration of the signal Error correction is performed to obtain relatively accurate signal reception times, and the results can be recorded in the random access memory (RAM) of the Bluetooth low energy chip (BLE SoC).
  • the IQ sample may not be recorded but only the clock time of the self may be recorded, which can reduce the amount of computation and storage space.
  • the embodiments of the present application use the CTE signal of BLE to assist in implementing the unilateral/bilateral bidirectional ranging process, and the specific implementation process is described below through multiple embodiments.
  • the target device for ranging that is, the device to be tested is referred to as the first device
  • the test device is referred to as the second device. Both the first device and the second device are capable of sending/receiving CTE signals of BLE.
  • Example 1 Using BLE broadcast packets carrying CTE signals
  • a BLE broadcast packet carrying a CTE signal may also be referred to as a "connectionless CTE" (Connectionless CTE).
  • connectionless CTE Connectionless CTE
  • the first device sends first BLE broadcast information, where the first BLE broadcast information includes a first CTE signal;
  • the first device records a first transmission timestamp of the first CTE signal
  • the first device receives second BLE broadcast information sent by the second device, where the second BLE broadcast information includes a second CTE signal;
  • the first device records a second receiving timestamp of the second CTE signal; wherein the first sending timestamp and the second receiving timestamp are used to calculate the relationship between the first device and the first The distance between the two devices.
  • the first device continuously broadcasts a low-power Bluetooth BLE broadcast packet, and the BLE broadcast packet carries a fixed-frequency extended CTE signal, and the first device can record the sending time stamp of the CTE signal as a A time parameter for subsequent distance calculation.
  • the BLE broadcast packet carries a fixed-frequency extended CTE signal
  • the first device can record the sending time stamp of the CTE signal as a A time parameter for subsequent distance calculation.
  • other devices receive the BLE broadcast packet sent by the first device, they can return a BLE broadcast packet that also carries the CTE signal.
  • the first device receives the returned BLE broadcast packet, it can be recorded.
  • the receiving timestamp of the CTE signal is used as another time parameter in the subsequent calculation of the distance.
  • the terminal device in the embodiment of the present application uses the fixed frequency of low-power Bluetooth BLE to extend the CTE signal, and can obtain multiple time stamp parameters for calculating the distance between devices, thereby realizing the ranging function of the terminal device.
  • the terminal device of the embodiment of the present application can, without installing a special function module (such as the aforementioned UWB module), based on the transmission time stamp and the reception time stamp of the CTE signal, according to the calculation of, for example, unilateral bidirectional ranging
  • the distance between devices can be calculated using the formula, and further, if the transmission and feedback process of the CTE signal is repeated many times, multiple sets of time stamp information can be obtained, and then the distance between devices can be calculated according to the principle of bilateral two-way ranging, which has low cost and reliable test results.
  • sexual advantage such as the aforementioned UWB module
  • an embodiment of the present application further provides a method for ranging, which is applied to a second device, including:
  • a second device receives first BLE broadcast information sent by a first device, where the first BLE broadcast information includes a first CTE signal;
  • the second device records a first reception timestamp of the first CTE signal
  • the second device sends second BLE broadcast information to the first device, where the second BLE broadcast information includes a second CTE signal;
  • the second device records a second sending timestamp of the second CTE signal; wherein the first receiving timestamp and the second sending timestamp are used to calculate the relationship between the first device and the first The distance between the two devices.
  • the second device may receive the BLE broadcast packet carrying the CTE signal sent by the first device, and record the time stamp of reception, and the second device will feed back the BLE broadcast containing the CTE signal to the first device. packet, and record the sending time stamp for subsequent calculation of the distance between the first device and the second device.
  • the timestamp information required for calculating the distance between devices can be obtained without installing a special function module, which has the characteristics of low test cost and high reliability of results.
  • the first device and the second device in the embodiment of the present application respectively have two working modes: a broadcast mode and a search mode, and the default switching duration of the two working modes is the first duration.
  • the first device sends the first BLE broadcast information in a broadcast mode, and the first device switches to a search mode after continuing in the broadcast mode for the first duration;
  • the first device After the first device switches from the broadcast mode to the search mode, it starts to search for the second BLE broadcast information sent by the second device, if the first device receives the second device within the first time period
  • the second BLE broadcast information sent by the second device is directly switched to the broadcast mode; if the first device does not receive the second BLE broadcast information sent by the second device within the first time Switch to broadcast mode for the first time.
  • the first duration may be, for example, 100ms, continuously sending broadcast information to the outside in the broadcast mode, and receiving broadcast information sent externally in the search mode;
  • the first device or the second device continues to send BLE broadcast information containing CTE signals in broadcast mode, for example, after 100ms, it switches to search mode and starts to search for information. If no external information is searched, the search mode reaches 100ms Switch back to the broadcast mode again when it starts to send broadcast packets, and so on; however, if it receives BLE broadcast information from the outside in search mode, it directly switches to broadcast mode and starts to send broadcast packets instead of waiting for 100ms. switch.
  • the default switching duration that is, the value of the first duration
  • the first duration if the first duration is too short, external information may not be searched; if the first duration is too long, the accumulated time error will increase.
  • the value of the first duration is set according to specific conditions and application accuracy requirements.
  • the above switching method is applicable to both the first device and the second device, that is, the two devices constantly switch between the broadcast mode and the search mode. Once the BLE broadcast packet containing the CTE signal is received in the search mode, it will immediately switch to the broadcast mode. And send a BLE broadcast packet containing the CTE signal, so that each of the two devices can obtain the sending timestamp and the receiving timestamp of the CTE signal for calculating the distance.
  • the third BLE broadcast information is sent to the second device, and the third BLE broadcast information includes the third CTE signal;
  • the first device records the third transmission timestamp of the third CTE signal
  • the first device After the first device switches from the broadcast mode to the search mode, it receives fourth BLE broadcast information sent by the second device, where the fourth BLE broadcast information includes a fourth CTE signal;
  • the first device records the fourth reception timestamp of the fourth CTE signal
  • the third sending timestamp and the fourth receiving timestamp are used to calculate the distance between the first device and the second device.
  • the following describes the processing performed by the second device after switching from the search mode to the broadcast mode.
  • the second device receives third BLE broadcast information sent by the first device in the search mode, where the third BLE broadcast information includes a third CTE signal;
  • the second device records the third reception timestamp of the third CTE signal
  • the second device After the second device is switched from the search mode to the broadcast mode, the second device sends fourth BLE broadcast information to the first device, where the fourth BLE broadcast information includes a fourth CTE signal;
  • the second device records the fourth transmission timestamp of the fourth CTE signal
  • the third receiving timestamp and the fourth sending timestamp are used to calculate the distance between the first device and the second device.
  • the first device and the second device can respectively obtain multiple transmission timestamps and multiple reception timestamps of the CTE signal, which can be used to calculate the distance.
  • the first device can be made to send the recorded time stamp information to the second device, and the second device with computing capability can substitute it into the corresponding calculation formula to obtain the distance between the devices;
  • the information is sent to the first device, and the distance is calculated by the first device with computing capabilities; alternatively, the first device and the second device can each send the recorded timestamp information to a third party for calculation, for example, to a server for calculation.
  • the purpose of the embodiments of the present application for ranging can be achieved.
  • the first device and the second device in this embodiment of the present application further record the sending channel number of the CTE signal in each sent BLE broadcast information.
  • each BLE broadcast information in this embodiment of the present application further includes an identification ID, where the identification ID is used to identify the corresponding BLE broadcast information.
  • the ID field of the BLE broadcast information can be set to a length of 1-16 bytes, which does not exceed the number of bytes available in the broadcast packet.
  • the value n of the ID field can be set to an auto-incrementing integer or a timestamp value. , not 0.
  • the identification ID is used to uniquely identify the BLE broadcast packet.
  • each BLE broadcast information in this embodiment of the present application is provided with a receiving identification ID field, a receiving timestamp field, and a receiving channel field; wherein,
  • the receiving identification ID field represents the identification ID of the received BLE broadcast information
  • the reception timestamp field represents the reception timestamp when the CTE signal in the BLE broadcast information is received
  • the receiving channel field indicates the receiving channel number of the CTE signal in the received BLE broadcast information.
  • the receiving identifier ID field value is the identifier value of the received broadcast packet of the opposite end
  • the receiving timestamp field value is the timestamp when the CTE signal of the broadcast packet is received
  • the receiving channel number is the location where the broadcast packet CTE signal was received.
  • the broadcast channel (such as 37, 38, 39 channels), the default value can be 0.
  • the first device when sending the third BLE broadcast information, adds the received identification ID, reception timestamp and reception channel number of the second BLE broadcast information to the third BLE broadcast information, respectively. in the Receive Identification ID field, the Receive Timestamp field, and the Receive Channel field.
  • the second device when sending the second BLE broadcast information, the second device adds the received identification ID, receiving timestamp and receiving channel number of the first BLE broadcast information to the second BLE broadcast information respectively.
  • the receiving identification ID field In the receiving identification ID field, the receiving timestamp field and the receiving channel field in the information.
  • the first device and the second device when sending the BLE broadcast information, the identification ID, the receiving timestamp and the receiving channel number of the last received BLE broadcast information are carried in the sent BLE broadcast information, and the sent BLE broadcast information is sent. to the peer device.
  • the first device and the second device can distinguish different BLE broadcast information according to the identification ID of the BLE broadcast information, thereby distinguishing different CTE signals, and can also determine the corresponding CTE signal according to the receiving channel number and the transmitting channel number, and according to the corresponding CTE signal
  • the sending time stamp and receiving time stamp of the signal calculate the distance between the devices to ensure that the data is correct.
  • the first device and the second device in the embodiment of the present application may not carry the identification ID, the receiving timestamp and the receiving channel number in the BLE broadcast packet to be sent, but complete the sending of multiple BLE broadcast packets.
  • the recorded multiple receiving time stamps, identification IDs and receiving channel numbers are separately sent to the opposite end device in the form of broadcast packets for calculating the distance.
  • the first device receives the timestamp and other information recorded by the second device
  • the first device obtains the first reception timestamp of the first CTE signal, the reception channel number, and the identification ID of the first BLE broadcast information,
  • the first reception time stamp is a time stamp when the second device receives the first CTE signal
  • the third reception time stamp is when the second device receives the third CTE signal
  • the first reception timestamp, reception channel number, and identification ID of the first BLE broadcast information of the first CTE signal are carried in the second BLE broadcast information, and the first reception time stamp of the third CTE signal is carried in the second BLE broadcast information.
  • the receiving timestamp, the receiving channel number, and the identification ID of the third BLE broadcast information are carried in the fourth BLE broadcast information;
  • the first reception timestamp, the reception channel number and the ID of the first BLE broadcast information of the first CTE signal, and the third reception timestamp and reception channel number of the third CTE signal and the identification ID of the third BLE broadcast information is sent by the second device to the first device after sending the fourth BLE broadcast information.
  • the first device obtains a second transmission timestamp of the second CTE signal and a fourth transmission timestamp of the fourth CTE signal.
  • the first device sends the recorded timestamp and other information to the second device
  • the first device sends the second reception timestamp of the second CTE signal, the reception channel number and the identification ID of the second BLE broadcast information to the second device,
  • the first device sends the fourth reception time stamp of the fourth CTE signal, the reception channel number and the identification ID of the fourth BLE broadcast information to the second device,
  • the second reception time stamp is a time stamp when the first device receives the second CTE signal
  • the fourth reception time stamp is when the first device receives the fourth CTE signal
  • the second reception timestamp, the reception channel number, and the ID of the second BLE broadcast information of the second CTE signal are carried in the third BLE broadcast information, and the third BLE broadcast information of the fourth CTE signal.
  • the receiving timestamp, the receiving channel number and the identification ID of the fourth BLE broadcast information are carried in the fifth BLE broadcast information;
  • the second reception time stamp, the reception channel number, and the ID of the second BLE broadcast information of the second CTE signal, and the fourth reception time stamp and reception channel number of the fourth CTE signal and the identification ID of the fourth BLE broadcast information is sent to the second device by the first device after sending the fifth BLE broadcast information to the second device.
  • the first device sends the first transmission timestamp of the first CTE signal and the third transmission timestamp of the third CTE signal to the second device.
  • the second device sends the recorded timestamp and other information to the first device
  • the second device sends the first receiving timestamp, the receiving channel number and the identification ID of the first BLE broadcast information of the first CTE signal to the first device,
  • the second device sends the third reception timestamp of the third CTE signal, the reception channel number, and the identification ID of the third BLE broadcast information to the first device,
  • the first reception time stamp is a time stamp when the second device receives the first CTE signal
  • the third reception time stamp is when the second device receives the third CTE signal
  • the first reception timestamp, reception channel number, and identification ID of the first BLE broadcast information of the first CTE signal are carried in the second BLE broadcast information, and the first reception time stamp of the third CTE signal is carried in the second BLE broadcast information.
  • the receiving timestamp, the receiving channel number, and the identification ID of the third BLE broadcast information are carried in the fourth BLE broadcast information;
  • the first reception timestamp, the reception channel number and the ID of the first BLE broadcast information of the first CTE signal, and the third reception timestamp and reception channel number of the third CTE signal and the identification ID of the third BLE broadcast information is sent by the second device to the first device after sending the fourth BLE broadcast information.
  • the second device sends the second transmission timestamp of the second CTE signal and the fourth transmission timestamp of the fourth CTE signal to the first device.
  • the second device receives the timestamp and other information recorded by the first device
  • the second device acquires the second reception timestamp, the reception channel number and the identification ID of the second BLE broadcast information of the second CTE signal,
  • the second device obtains the fourth reception timestamp of the fourth CTE signal, the reception channel number, and the identification ID of the fourth BLE broadcast information,
  • the second reception time stamp is a time stamp when the first device receives the second CTE signal
  • the fourth reception time stamp is when the first device receives the fourth CTE signal
  • the second reception timestamp, the reception channel number, and the ID of the second BLE broadcast information of the second CTE signal are carried in the third BLE broadcast information, and the third BLE broadcast information of the fourth CTE signal.
  • the receiving timestamp, the receiving channel number and the identification ID of the fourth BLE broadcast information are carried in the fifth BLE broadcast information;
  • the second reception time stamp, the reception channel number, and the ID of the second BLE broadcast information of the second CTE signal, and the fourth reception time stamp and reception channel number of the fourth CTE signal and the identification ID of the fourth BLE broadcast information is sent to the second device by the first device after sending the fifth BLE broadcast information to the second device.
  • the second device obtains a first transmission timestamp of the first CTE signal and a third transmission timestamp of the third CTE signal.
  • the first device or the second device calculates the distance between the first device and the second device after obtaining multiple timestamp information required for the calculation.
  • the difference between the sending timestamp and the receiving timestamp corresponding to the ID and having the same sending channel number and receiving channel number is calculated.
  • the following situations may occur: since BLE will send the same broadcast packet of the application layer on channels 37, 38 and 39, respectively, there may be 1,
  • the broadcast packet records of 2 or 3 physical layers are distinguished by the transmission channel number, that is, the transmission channel numbers of the broadcast packets of the same application layer may be different.
  • the distance When calculating the distance, it needs to be calculated based on the difference between the sending time stamp and the receiving time stamp with the same sending channel number and receiving channel number.
  • the fourth transmission time stamp, the first reception time stamp, the second reception time stamp, the third reception time stamp and the fourth reception time stamp there is no transmission time with the same transmission channel number and reception channel number Stamp and receiving timestamp, indicating that the timestamp record of the sender needs to be adjusted.
  • the value of the sending timestamp can be adjusted according to the difference between the sending channel number and the receiving channel number, as well as the time interval between adjacent broadcast channels. . This will be explained below with specific examples.
  • an embodiment of the present application further provides a method for ranging.
  • the method includes:
  • S301 Receive a first sending timestamp, a second sending timestamp, a third sending timestamp, a fourth sending timestamp, a first receiving timestamp, a second receiving timestamp, and a third sending timestamp sent by a first device and a second device.
  • S302 Calculate the distance between the first device and the second device based on the difference between the sending timestamp and the receiving timestamp corresponding to the ID and having the same sending channel number and receiving channel number.
  • the information can be sent to a third-party device in a unified manner, such as a server device with powerful computing capabilities, to calculate the first device and the second device.
  • a third-party device in a unified manner, such as a server device with powerful computing capabilities, to calculate the first device and the second device.
  • the respective processing procedures of the first device and the second device are described above.
  • the interaction process between the first device (hereinafter referred to as device A) and the second device (hereinafter referred to as device B) will be described in detail below through specific examples.
  • this embodiment takes device A as the device to be tested and device B as a mobile phone as an example.
  • Device A switches between broadcast mode and search mode every 100 milliseconds, that is, sends broadcast packets for 100 milliseconds, and then switches to search mode. , in which, if a broadcast packet is received in the search mode, it will switch back to the broadcast mode, and if no broadcast packet has been received in the search mode, it will switch back to the broadcast mode after the search continues for 100 milliseconds.
  • Device A records the sending time stamp TXAn, the corresponding identification field value n and the sending channel number CAn when it sends the CTE signal of each broadcast packet.
  • BLE will send the same broadcast packet of the application layer on channels 37, 38 and 39, respectively, for an application layer broadcast packet, there may be 1, 2 or 3 physical layer broadcast packets. Records are distinguished by sending channel numbers.
  • Device B starts searching, and device B switches between broadcast mode and search mode every 100 milliseconds. Similarly, if a broadcast packet is received in search mode, it switches to broadcast mode, sends a broadcast packet for 100 milliseconds, and then switches back to search mode .
  • device B When receiving the broadcast packet from device A, device B records the reception timestamp RXBn, the corresponding identification field value n and the receiving channel number CBn when the CTE signal of the broadcast packet is received, and then sends out a corresponding broadcast packet (identification field value is m), and fill in the receiving fields: RXBn, n and CBn in the broadcast packet, and record the transmission time stamp TXBm, the corresponding identification field value m and the transmission channel number CBm when the CTE signal of the broadcast packet is sent.
  • device A After device A switches to search, it receives the broadcast packet sent by device B (the value of the identification field is m), and device A records the reception timestamp RXAm, the value of the corresponding identification field m and the receiving channel when the CTE signal of the broadcast packet is received. No. CAm.
  • device A and device B may not transmit information such as receiving timestamps for each broadcast packet, but after the above steps, send a separate broadcast packet to record the multiple receiving timestamps, corresponding identification values and The received channel number is sent to the opposite end in a centralized manner.
  • multiple time stamp information as shown in FIG. 8 can be obtained.
  • Select TXAn and RXBn, TXBm and RXAm, TXAx and RXBx, and TXBy and RXAy with the same transmit channel number and receive channel number in the record, in order to obtain multiple time stamp records that satisfy the above conditions (the transmit channel number and receive channel number are the same) the foregoing process can be repeated multiple times, as shown in FIG. 7 , until the time stamp data that meets the conditions is obtained.
  • the time record of the transmit end can be adjusted according to the relevant Bluetooth core protocol and the channel number of the receive end to compensate for the channel number.
  • the amount of offset here, the sender knows and records the actual transmission interval IntA and IntB between its two broadcast channels.
  • TXAn TXAn+2 ⁇ IntA.
  • CBy of TXBy is channel number 39
  • CAy of RXAy is channel number 38
  • each time stamp data can be substituted into the calculation formula, such as the calculation formula of unilateral two-way ranging SS-TWR and bilateral two-way ranging DS-TWR, as follows:
  • Tround1 RXAm-TXAn
  • Treply1 TXBm-RXBn
  • Tround2 RXAy-TXAx
  • Treply2 TXBy-RXBx
  • Treply1 TXBm-RXBn
  • Example 2 Using BLE request-response packets carrying CTE signals
  • the BLE request-response packet carrying the CTE signal may also be referred to as a "connected CTE" (Connection CTE).
  • Connection CTE include:
  • a third device sends first BLE request information to a fourth device
  • the third device receives the first BLE response information sent by the fourth device, where the first BLE response information includes the first CTE signal;
  • the third device records a first reception timestamp of the first CTE signal; wherein the first reception timestamp is used to calculate the distance between the third device and the fourth device.
  • an embodiment of the present application further provides a method for ranging, which is applied to a fourth device.
  • the method includes:
  • the fourth device receives the first BLE request information sent by the third device
  • the fourth device sends first BLE response information to the third device, where the first BLE response information includes a first CTE signal;
  • the fourth device records a first sending timestamp of the first CTE signal; the first sending timestamp is used to calculate the distance between the third device and the fourth device.
  • this embodiment of the present application uses a BLE request response packet carrying a CTE signal, rather than the BLE broadcast packet of Embodiment 1, so that the third device and the fourth device can exchange request information and response information point-to-point. , and record the sending time stamp and the corresponding receiving time stamp of the CTE signal during the interaction process, which are used to calculate the distance between the two devices.
  • the third device receives the second BLE request information sent by the fourth device;
  • the third device sends second BLE response information to the fourth device, where the second BLE response information includes a second CTE signal; the third device records a second sending timestamp of the second CTE signal ; wherein, the second sending timestamp is used to calculate the distance between the third device and the fourth device.
  • the fourth device sends second BLE request information to the third device
  • the fourth device receives the second BLE response information sent by the third device, where the second BLE response information includes a second CTE signal; the fourth device records the second receiving time of the second CTE signal where the second received timestamp is used to calculate the distance between the third device and the fourth device.
  • multiple sets of sending timestamps and receiving timestamps can be obtained, which can be calculated using various formulas to improve calculation accuracy.
  • each BLE request information includes a timestamp field, which indicates the sending timestamp of the last received CTE signal.
  • each BLE response information includes a timestamp field, which indicates the reception timestamp of the last CTE signal sent.
  • the device that sends the response information records the sending time stamp of the CTE signal
  • the device that receives the response information records the time stamp of the CTE signal.
  • the received timestamp of the CTE signal is recorded to record the timestamp information required for the calculation.
  • the third device adds the first reception timestamp to the second BLE response information.
  • the fourth device adds the first sending timestamp to the second BLE request information. In this way, the timestamp information required for the calculation is sent to the peer device.
  • the calculation is performed based on the difference between the corresponding sending timestamp and the receiving timestamp.
  • the distance between the two devices can be calculated by substituting the sending timestamp and the receiving timestamp into the corresponding calculation formula.
  • the following describes the information exchange process between devices in the embodiment of the present application by using a specific example, wherein the third device is denoted as device A, and the fourth device is denoted as device B.
  • device A and device B alternately send BLE request information carrying CTE signals (denoted as LL_CTE_REQ in FIG. 11 ) and BLE response information carrying CTE signals (denoted as LL_CTE_RSP in FIG. 11 );
  • the device sending LL_CTE_RSP records the time stamp of sending CTE
  • the device receiving LL_CTE_RSP records the time stamp of receiving CTE.
  • Treply1 TXA2-RXA1,
  • Treply2 TXA4–RXA3,
  • Treply1 TXA2-RXA1,
  • Treply2 TXB3-RXB2
  • the various embodiments of the present application can be implemented by using the Bluetooth modules commonly found on most smart terminals such as mobile phones, and the implementation process does not require an antenna array or multiple auxiliary positioning devices, and can more accurately measure the Measuring the distance between the device and the mobile phone can improve the user experience and reduce the cost.
  • the time error is small and the ranging accuracy is high.
  • an embodiment of the present application further provides a terminal device 100, which may be referred to as a first device.
  • the terminal device 100 includes:
  • the first sending module 101 is configured to send first low-power Bluetooth BLE broadcast information, where the first BLE broadcast information includes a first fixed frequency extended CTE signal;
  • a first recording module 102 configured to record the first transmission time stamp of the first CTE signal
  • a first receiving module 103 configured to receive second BLE broadcast information sent by a second device, where the second BLE broadcast information includes a second CTE signal;
  • a second recording module 104 configured to record the second reception timestamp of the second CTE signal
  • the first sending timestamp and the second receiving timestamp are used to calculate the distance between the first device and the second device.
  • an embodiment of the present application further provides a terminal device 200, which may be referred to as a second device.
  • the terminal device 200 includes:
  • a first receiving module 201 configured to receive first BLE broadcast information sent by a first device, where the first BLE broadcast information includes a first CTE signal;
  • a first recording module 202 configured to record the first reception timestamp of the first CTE signal
  • a first sending module 203 configured to send second BLE broadcast information to the first device, where the second BLE broadcast information includes a second CTE signal;
  • a first recording module 204 configured to record the second transmission time stamp of the second CTE signal
  • the first receiving timestamp and the second sending timestamp are used to calculate the distance between the first device and the second device.
  • an embodiment of the present application further provides an electronic device 300, referring to FIG. 15, which includes:
  • a receiving module 301 configured to receive a first sending timestamp, a second sending timestamp, a third sending timestamp, a fourth sending timestamp, a first receiving timestamp, and a second receiving time sent by the first device and the second device stamp, the third receiving time stamp and the fourth receiving time stamp, and the identification ID, the sending channel number and the receiving channel number corresponding to each time stamp;
  • the calculation module 302 is configured to calculate the distance between the first device and the second device based on the difference between the sending timestamp and the receiving timestamp corresponding to the ID and having the same sending channel number and receiving channel number.
  • an embodiment of the present application further provides a terminal device 400, which may be referred to as a third device.
  • the terminal device 400 includes:
  • the first sending module 401 is configured to send the first BLE request information to the fourth device;
  • the first receiving module 402 is configured to receive the first BLE response information sent by the fourth device, where the first BLE response information includes the first CTE signal;
  • a first recording module 403, configured to record the first reception timestamp of the first CTE signal
  • the first received timestamp is used to calculate the distance between the third device and the fourth device.
  • an embodiment of the present application further provides a terminal device 500, which may be referred to as a fourth device.
  • the terminal device 500 includes:
  • the first receiving module 501 is configured to receive the first BLE request information sent by the third device;
  • a first sending module 502 configured to send first BLE response information to the third device, where the first BLE response information includes a first CTE signal;
  • a first recording module 503, configured to record the first transmission time stamp of the first CTE signal
  • the first sending timestamp is used to calculate the distance between the third device and the fourth device.
  • the terminal devices 100 , 200 , 400 and 500 and the electronic device 300 in the embodiments of the present application can implement the corresponding functions of the terminal device and the server in the foregoing method embodiments, and each module (submodule, unit or component, etc.) corresponds to
  • each module submodule, unit or component, etc.
  • the functions described by the terminal devices 100 , 200 , 400 , and 500 and the various modules (submodules, units, or components, etc.) in the electronic device 300 in the embodiments of the present application may be described by different modules (submodules, units, etc.). or components, etc.), or can be implemented by the same module (sub-module, unit or component, etc.), for example, the first sending module and the second sending module may be different modules, or the same module, both Corresponding functions of the terminal device in the embodiments of the present application can be implemented.
  • FIG. 18 is a schematic structural diagram of a communication device 600 according to an embodiment of the present application, wherein the communication device 600 includes a processor 610, and the processor 610 can call and run a computer program from a memory to implement the method in the embodiment of the present application.
  • the communication device 600 may also include a memory 620 .
  • the processor 610 may call and run a computer program from the memory 620 to implement the methods in the embodiments of the present application.
  • the memory 620 may be a separate device independent of the processor 610 , or may be integrated in the processor 610 .
  • the communication device 600 may further include a transceiver 630, and the processor 610 may control the transceiver 630 to communicate with other devices, specifically, may send information or data to other devices, or receive information or data sent by other devices .
  • the transceiver 630 may include a transmitter and a receiver.
  • the transceiver 630 may further include antennas, and the number of the antennas may be one or more.
  • the communication device 600 may be a terminal device of an embodiment of the present application, such as any one of the terminal devices shown in FIGS. 13-14 and 16-17 , and the communication device 600 may implement the following For the sake of brevity, the corresponding process implemented by the terminal device will not be repeated here.
  • FIG. 19 is a schematic structural diagram of a chip 700 according to an embodiment of the present application, wherein the chip 700 includes a processor 710, and the processor 710 can call and run a computer program from a memory to implement the method in the embodiment of the present application.
  • the chip 700 may further include a memory 720 .
  • the processor 710 may call and run a computer program from the memory 720 to implement the methods in the embodiments of the present application.
  • the memory 720 may be a separate device independent of the processor 710 , or may be integrated in the processor 710 .
  • the chip 700 may further include an input interface 730 .
  • the processor 710 may control the input interface 730 to communicate with other devices or chips, and specifically, may acquire information or data sent by other devices or chips.
  • the chip 700 may further include an output interface 740 .
  • the processor 710 can control the output interface 740 to communicate with other devices or chips, and specifically, can output information or data to other devices or chips.
  • the chip can be applied to the terminal device in the embodiments of the present application, such as any one of the terminal devices shown in FIGS. 13-14 and 16-17 , and the chip can implement the various methods in the embodiments of the present application by the terminal device.
  • the terminal device such as any one of the terminal devices shown in FIGS. 13-14 and 16-17
  • the chip can implement the various methods in the embodiments of the present application by the terminal device.
  • the corresponding process of implementation will not be repeated here.
  • the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, a system-on-chip, a system-on-chip, or a system-on-a-chip, or the like.
  • the processor mentioned above may be a general-purpose processor, a digital signal processor (DSP), a field programmable gate array (FPGA), an application specific integrated circuit (ASIC) or Other programmable logic devices, transistor logic devices, discrete hardware components, etc.
  • DSP digital signal processor
  • FPGA field programmable gate array
  • ASIC application specific integrated circuit
  • the general-purpose processor mentioned above may be a microprocessor or any conventional processor or the like.
  • the memory mentioned above may be either volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically programmable Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be random access memory (RAM).
  • the memory in the embodiment of the present application may also be a static random access memory (static RAM, SRAM), a dynamic random access memory (dynamic RAM, DRAM), Synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection Dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM) and so on. That is, the memory in the embodiments of the present application is intended to include but not limited to these and any other suitable types of memory.
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it can be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated.
  • the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored on or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted over a wire from a website site, computer, server or data center (eg coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (eg infrared, wireless, microwave, etc.) means to another website site, computer, server or data center.
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media integrated.
  • the available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk (SSD)), among others.
  • the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be dealt with in the embodiments of the present application. implementation constitutes any limitation.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

A method for ranging and a terminal device. The method comprises: a first device sends first Bluetooth low energy (BLE) broadcast information, the first BLE broadcast information comprising a first constant tone extension (CTE) signal (S101); the first device records a first transmitting timestamp of the first CTE signal (S102); the first device receives second BLE broadcast information sent by a second device, the second BLE broadcast information comprising a second CTE signal; the first device records a second receiving timestamp of the second CTE signal, the first transmitting timestamp and the second receiving timestamp being used for calculating the distance between the first device and the second device (S103). By using the method, timestamp information used for ranging can be obtained at lower cost.

Description

用于测距的方法和终端设备Method and terminal device for ranging 技术领域technical field
本申请涉及物联网技术领域,更具体地,涉及一种用于测距的方法和终端设备。The present application relates to the technical field of the Internet of Things, and more particularly, to a method and terminal device for ranging.
背景技术Background technique
常用的测距技术有基于接收信号强度指示值(Received Signal Strength Indication,RSSI)、基于到达时间(Time of Arrival,TOA)、基于到达角(Angle of Arrival,AOA)/发送角(Angle of Departure,AOD)等方法。蓝牙低功耗(Bluetooth Low Energy,BLE)技术具有低功耗特点,并且可以提供接收信号强度指示值。基于BLE的RSSI测距法是在蓝牙接收器端通过信号采样获取接收的信号强度,并根据电磁波传播特性和信号强度估算发射器与接收器之间的距离。Commonly used ranging techniques include Received Signal Strength Indication (RSSI), Time of Arrival (TOA), Angle of Arrival (AOA)/Angle of Departure, AOD) and other methods. Bluetooth Low Energy (BLE) technology has low power consumption and can provide an indication of received signal strength. The BLE-based RSSI ranging method obtains the received signal strength through signal sampling at the Bluetooth receiver end, and estimates the distance between the transmitter and the receiver according to the electromagnetic wave propagation characteristics and signal strength.
但是,由于环境中的反射(reflection)、衍射(diffraction)和散射(scattering)等现象可能导致多路效应(multipath effect),使得基于BLE测量到的RSSI值波动较大,所估算的距离准确度较低。此外,在基于BLE的AoA/AoD估算距离中,需要接收器或发射器具有天线阵列,通常需要三个以上天线设备才能测算位置和距离,成本较高。However, due to the phenomenon of reflection, diffraction and scattering in the environment, which may lead to multipath effect, the RSSI value measured based on BLE fluctuates greatly, and the estimated distance accuracy lower. In addition, in the BLE-based AoA/AoD estimation distance, the receiver or transmitter needs to have an antenna array, usually more than three antenna devices are required to measure the position and distance, and the cost is high.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本申请实施例提供一种用于测距的方法和终端设备,利用本申请实施例可获得用于计算终端距离所需的信息。In view of this, the embodiments of the present application provide a method and a terminal device for distance measurement, and the information required for calculating the terminal distance can be obtained by using the embodiments of the present application.
本申请实施例提供一种用于测距的方法,包括:An embodiment of the present application provides a method for ranging, including:
第一设备发送第一低功耗蓝牙BLE广播信息,所述第一BLE广播信息中包括第一固定频率扩展CTE信号;所述第一设备记录所述第一CTE信号的第一发送时间戳;The first device sends first low-power Bluetooth BLE broadcast information, where the first BLE broadcast information includes a first fixed-frequency extended CTE signal; the first device records a first transmission timestamp of the first CTE signal;
所述第一设备接收第二设备发送的第二BLE广播信息,所述第二BLE广播信息中包括第二CTE信号;所述第一设备记录所述第二CTE信号的第二接收时间戳;其中,所述第一发送时间戳和所述第二接收时间戳用于计算所述第一设备与所述第二设备之间的距离。The first device receives second BLE broadcast information sent by the second device, where the second BLE broadcast information includes a second CTE signal; the first device records a second reception timestamp of the second CTE signal; The first sending timestamp and the second receiving timestamp are used to calculate the distance between the first device and the second device.
本申请实施例还提供一种终端设备,包括:The embodiment of the present application also provides a terminal device, including:
第一发送模块,用于发送第一低功耗蓝牙BLE广播信息,所述第一BLE广播信息中包括第一固定频率扩展CTE信号;a first sending module, configured to send first low-power Bluetooth BLE broadcast information, where the first BLE broadcast information includes a first fixed frequency extended CTE signal;
第一记录模块,用于记录所述第一CTE信号的第一发送时间戳;a first recording module, configured to record the first transmission time stamp of the first CTE signal;
第一接收模块,用于接收第二设备发送的第二BLE广播信息,所述第二BLE广播信息中包括第二CTE信号;a first receiving module, configured to receive second BLE broadcast information sent by a second device, where the second BLE broadcast information includes a second CTE signal;
第二记录模块,用于记录所述第二CTE信号的第二接收时间戳;其中,所述第一发送时间戳和所述第二接收时间戳用于计算所述第一设备与所述第二设备之间的距离。a second recording module, configured to record a second reception timestamp of the second CTE signal; wherein the first transmission timestamp and the second reception timestamp are used to calculate the relationship between the first device and the first device. The distance between the two devices.
本申请实施例还提供一种终端设备,包括:处理器和存储器,所述存储器用于存储计算机程序,所述处理器调用并运行所述存储器中存储的计算机程序,执行如上所述的用于测距的方法。An embodiment of the present application further provides a terminal device, including: a processor and a memory, where the memory is used to store a computer program, the processor invokes and runs the computer program stored in the memory, and executes the method of distance measurement.
本申请实施例还提供一种芯片,包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有所述芯片的设备执行如上所述的用于测距的方法。An embodiment of the present application further provides a chip, including: a processor configured to call and run a computer program from a memory, so that a device on which the chip is installed executes the method for ranging as described above.
本申请实施例还提供一种计算机可读存储介质,用于存储计算机程序,其中,所述计算机程序使得计算机执行如上所述的用于测距的方法。Embodiments of the present application further provide a computer-readable storage medium for storing a computer program, wherein the computer program causes a computer to execute the method for ranging as described above.
本申请实施例还提供一种计算机程序产品,包括计算机程序指令,其中,所述计算机程序指令使得计算机执行如上所述的控制发射功率的方法。Embodiments of the present application also provide a computer program product, including computer program instructions, wherein the computer program instructions cause a computer to execute the above-described method for controlling transmit power.
本申请实施例还提供一种计算机程序,所述计算机程序使得计算机执行如上所述的用于测距的方法。Embodiments of the present application also provide a computer program, the computer program causing a computer to execute the method for ranging as described above.
利用本申请的实施例,终端设备使用携带固定频率扩展CTE信号的低功耗蓝牙BLE广播信息,通过记录CTE信号的发送时间戳和接收时间戳信息,可以以较低的成本获取符合条件的多组时间戳信息,基于本申请实施例获得的多组时间戳信息时间误差小,计算得到的设备间距离精度较高。Using the embodiments of the present application, the terminal device uses the low-power Bluetooth BLE broadcast information carrying the fixed frequency extended CTE signal, and records the transmission timestamp and reception timestamp information of the CTE signal. For the group time stamp information, the time error of the multiple groups of time stamp information obtained based on the embodiment of the present application is small, and the calculated distance between devices has high precision.
附图说明Description of drawings
图1是单边双向测距的逻辑原理效果示意图。Figure 1 is a schematic diagram of the logical principle effect of unilateral bidirectional ranging.
图2和图3分别是双边双向测距的四消息方式和三消息方式的逻辑原理效果示意图。FIG. 2 and FIG. 3 are schematic diagrams of the logical principle effect of the four-message mode and the three-message mode of bilateral two-way ranging, respectively.
图4是本申请实施例的第一设备侧的用于测距的方法的流程框图。FIG. 4 is a flowchart of a method for ranging on a first device side according to an embodiment of the present application.
图5是本申请实施例的第二设备侧的用于测距的方法的流程框图。FIG. 5 is a flowchart of a method for ranging on a second device side according to an embodiment of the present application.
图6是本申请实施例的电子设备侧的用于测距的方法的流程框图。FIG. 6 is a flowchart of a method for ranging on an electronic device side according to an embodiment of the present application.
图7是本申请实施例1中的两设备间信息交互的示意图。FIG. 7 is a schematic diagram of information interaction between two devices in Embodiment 1 of the present application.
图8是按照图7实施例交互得到的多种时间戳信息的示意图。FIG. 8 is a schematic diagram of various timestamp information obtained by interaction according to the embodiment of FIG. 7 .
图9是本申请实施例的第三设备侧的用于测距的方法的流程框图。FIG. 9 is a flowchart of a method for ranging on a third device side according to an embodiment of the present application.
图10是本申请实施例的第四设备侧的用于测距的方法的流程框图。FIG. 10 is a flowchart of a method for ranging on a fourth device side according to an embodiment of the present application.
图11是本申请实施例2中的两设备间信息交互的示意图。FIG. 11 is a schematic diagram of information interaction between two devices in Embodiment 2 of the present application.
图12是按照图11实施例交互得到的多种时间戳信息的示意图。FIG. 12 is a schematic diagram of various timestamp information obtained by interaction according to the embodiment of FIG. 11 .
图13和14是本申请实施例的第一设备和第二设备的示意性结构框图。13 and 14 are schematic structural block diagrams of the first device and the second device according to the embodiments of the present application.
图15本申请实施例的电子设备的示意性结构框图。FIG. 15 is a schematic structural block diagram of an electronic device according to an embodiment of the present application.
图16和17是本申请实施例的第三设备和第四设备的示意性结构框图。16 and 17 are schematic structural block diagrams of the third device and the fourth device according to the embodiments of the present application.
图18是本申请实施例的通信设备示意性框图。FIG. 18 is a schematic block diagram of a communication device according to an embodiment of the present application.
图19是本申请实施例的芯片的示意性框图。FIG. 19 is a schematic block diagram of a chip according to an embodiment of the present application.
具体实施方式detailed description
下面结合本申请实施例的附图,对本申请实施例的技术方案进行描述,其中包括本申请实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本申请的范围和精神。为了清楚和简明,以下的描述中省略了对公知功能和公知结构的描述。The technical solutions of the embodiments of the present application are described below with reference to the drawings of the embodiments of the present application, including various details of the embodiments of the present application to facilitate understanding, and they should be regarded as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. For clarity and conciseness, descriptions of well-known functions and well-known structures are omitted in the following description.
本申请实施例基于终端设备描述了各个实施例,其中,终端设备也可以称为用户设备(User Equipment,UE)、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置等。The embodiments of this application describe various embodiments based on terminal equipment, where the terminal equipment may also be referred to as user equipment (User Equipment, UE), access terminal, subscriber unit, subscriber station, mobile station, mobile station, remote station, remote station Terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user equipment, etc.
在本申请实施例中,终端设备可以是手机(Mobile Phone)、平板电脑(Pad)、带无线收发功能的电脑、虚拟现实(Virtual Reality,VR)终端设备、增强现实(Augmented Reality,AR)终端设备、工业控制(industrial control)中的无线终端设备、无人驾驶中的无线终端设备、远程医疗(remote medical)中的无线终端设备、智能电网(smart grid)中的无线终端设备、运输安全(transportation safety)中的无线终端设备、智慧城市(smart city)中的无线终端设备或智慧家庭(smart home)中的无线终端设备等。In this embodiment of the present application, the terminal device may be a mobile phone (Mobile Phone), a tablet computer (Pad), a computer with a wireless transceiver function, a virtual reality (Virtual Reality, VR) terminal device, and an augmented reality (Augmented Reality, AR) terminal equipment, wireless terminal equipment in industrial control, wireless terminal equipment in unmanned driving, wireless terminal equipment in remote medical, wireless terminal equipment in smart grid, transportation safety ( Wireless terminal equipment in transportation safety), wireless terminal equipment in smart city or wireless terminal equipment in smart home, etc.
作为示例而非限定,在本申请实施例中,该终端设备还可以是可穿戴设备。可穿戴设备也可以称为穿戴式智能设备,是应用穿戴式技术对日常穿戴进行智能化设计、开发出可以穿戴的设备的总称,如眼镜、手套、手表、服饰及鞋等。可穿戴设备即直接穿在身上,或是整合到用户的衣服或配件的一种便携式设备。可穿戴设备不仅仅是一种硬件设备,更是通过软件支持以及数据交互、云端交互来实现强大的功能。广义穿戴式智能设备包括功能全、尺寸大、可不依赖智能手机实现完整或者部分的功能,例如:智能手表或智能眼镜等,以及只专注于某一类应用功能,需要和其它设备如智能手机配合使用,如各类进行体征监测的智能手环、智能首饰等。As an example and not a limitation, in this embodiment of the present application, the terminal device may also be a wearable device. Wearable devices can also be called wearable smart devices, which are the general term for the intelligent design of daily wear and the development of wearable devices using wearable technology, such as glasses, gloves, watches, clothing and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothing or accessories. Wearable device is not only a hardware device, but also realizes powerful functions through software support, data interaction, and cloud interaction. In a broad sense, wearable smart devices include full-featured, large-scale, complete or partial functions without relying on smart phones, such as smart watches or smart glasses, and only focus on a certain type of application function, which needs to cooperate with other devices such as smart phones. Use, such as all kinds of smart bracelets, smart jewelry, etc. for physical sign monitoring.
为了清楚地阐述本申请实施例的思想,首先对单边/双边双向测距法进行简要描述。在相关规定中,发射器物理层记录特定信号(例如RMARKER)发出的时间,接收器物理层记录特定信号的到达时间,计算出时间差,然后根据电磁波传播的物理特性估算两者间的距离。该方法的技术关键点在于,通过在物理层计时来减少计时的误差,提高精度,通过使用特定信号来提高检测的成功率。基于此,有以下几种计算方式。In order to clearly illustrate the idea of the embodiments of the present application, the unilateral/bilateral bidirectional ranging method is briefly described first. In the relevant regulations, the transmitter physical layer records the time when a specific signal (such as RMARKER) is sent, and the receiver physical layer records the arrival time of the specific signal, calculates the time difference, and then estimates the distance between the two according to the physical characteristics of electromagnetic wave propagation. The technical key point of this method is to reduce the timing error by timing the physical layer, improve the accuracy, and improve the detection success rate by using a specific signal. Based on this, there are several calculation methods as follows.
1.单边双向测距(Single-sided Two-way Ranging,SS-TWR)1. Single-sided Two-way Ranging (SS-TWR)
参考图1,SS-TWR是对单个往返消息的时间上的简单测量,设备A主动发送数据到设备B,设备B返回数据响应设备A。大体上测距流程是:设备A主动发送(TX)数据,同时记录发送时间戳,设备B接收(RX)到之后记录接收时间戳;延时T reply之后,设备B发送数据,同时记录发送时间戳,设备A接收数据,同时记录接收时间戳。 Referring to Figure 1, SS-TWR is a simple measurement of time for a single round-trip message, device A actively sends data to device B, and device B responds to device A with data. Generally speaking, the ranging process is as follows: Device A actively sends (TX) data, and records the sending time stamp, and device B records the receiving time stamp after receiving (RX); after delaying T reply , device B sends data and records the sending time at the same time. Stamp, device A receives the data, and records the receiving timestamp at the same time.
根据四个时间戳数据可得到两个时间差数据,设备A的时间差T round和设备B的时间差T reply,最终得到无线信号飞行时间或者说传播时间T propAccording to the four time stamp data, two time difference data can be obtained, the time difference T round of device A and the time difference T reply of device B, and finally the flight time or propagation time T prop of the wireless signal is obtained:
T prop=1/2(T round–T reply) T prop = 1/2(T round d–T reply )
T prop=1/2(T round–T reply(1–Coffs)) T prop = 1/2 (T round – T reply (1 – Coffs))
其中Coffs是设备A的接收器和远程设备B的发射器之间的时钟偏移量。以信号的传播时间T prop与光速c相乘可得到设备A与设备B的距离。 where Coffs is the clock offset between device A's receiver and remote device B's transmitter. The distance between device A and device B can be obtained by multiplying the propagation time T prop of the signal by the speed of light c.
2.双边双向测距(Double-sided Two-way Ranging,DS-TWR)2. Double-sided Two-way Ranging (DS-TWR)
DS-TWR是单边双向测距的一种扩展方法,需要记录两个往返的时间戳,最后得到飞行时间,虽然增加了响应的时间,但能够降低测距误差。DS-TWR is an extended method of unilateral two-way ranging. It needs to record the time stamps of two round trips, and finally get the flight time. Although it increases the response time, it can reduce the ranging error.
根据发送消息个数不同,双边双向测距算法可分为双边双向测距4消息方式(DS-TWR with 4 messages),以及双边双向测距3消息方式(DS-TWR with 3messages)。According to the number of messages sent, the bilateral two-way ranging algorithm can be divided into two-way two-way ranging 4 message mode (DS-TWR with 4 messages), and bilateral two-way ranging 3 message mode (DS-TWR with 3 messages).
双边双向测距分为两次测距,设备A主动发起第一次测距消息,设备B响应,当设备A收到数据之后,再返回数据,最终可以得到四个时间差:T round1、T reply1、T round2、T reply2。图2示出了双边双向测距4消息方式的原理示意图,图3示出了双边双向测距3消息方式的原理示意图。比较图2和图3,其中计算T round1、T reply1、T round2、T reply2的方式不同,传播时间T prop可按如下公式计算: Bilateral two-way ranging is divided into two ranging. Device A actively initiates the first ranging message, and device B responds. When device A receives the data, it returns the data, and finally four time differences can be obtained: T round1 , T reply1 , T round2 , T reply2 . FIG. 2 shows a schematic diagram of the principle of the bilateral two-way ranging 4 message mode, and FIG. 3 shows a schematic schematic diagram of the principle of the bilateral two-way ranging 3 message mode. Comparing Figure 2 and Figure 3, where T round1 , T reply1 , T round2 , and T reply2 are calculated in different ways, the propagation time T prop can be calculated as follows:
Figure PCTCN2020099601-appb-000001
Figure PCTCN2020099601-appb-000001
目前,用户终端设备例如手机或者其他终端均不带有支持上述功能的模组,例如超宽带模组(Ultra Wide Band,UWB),因此,对于单边双向测距或者双边双向测距的相关功能均不支持。At present, user terminal equipment such as mobile phones or other terminals do not have modules that support the above functions, such as Ultra Wide Band (UWB) modules. Therefore, for unilateral two-way ranging or bilateral two-way ranging related functions are not supported.
为此,本申请实施例提供用于辅助测距的方法,主要目的是获取信号波在设备之间发射以及接收的时间戳信息,本申请实施例的终端设备使用低功耗蓝牙(Bluetooth Low Enery,BLE)的固定频率扩展(Constant Tone Extension,CTE)信号,能够实现终端设备的单边双向测距或者双边双向测距功能,成本低且效果好。To this end, the embodiments of the present application provide a method for assisting ranging, and the main purpose is to obtain timestamp information of signal waves transmitted and received between devices. The terminal device of the embodiments of the present application uses Bluetooth Low Energy (Bluetooth Low Energy) , BLE) fixed frequency extension (Constant Tone Extension, CTE) signal, can realize unilateral two-way ranging or bilateral two-way ranging function of terminal equipment, low cost and good effect.
关于本申请实施例中的CTE信号,其是一种特殊的蓝牙信号,具有低功耗蓝牙BLE特性,CTE信号具有传输时间较长的特点,接收器可提取同相正交信号(In-phase Quadrature Signal,IQ)样本数据而不会对调制产生干扰,并且,CTE信号在相应物理链路数据包的最后发射,因此不会对数据包的循环冗余校验产生影响。Regarding the CTE signal in the embodiment of the present application, it is a special Bluetooth signal with the characteristics of low-power Bluetooth BLE. The CTE signal has the characteristics of a long transmission time, and the receiver can extract the in-phase quadrature signal (In-phase Quadrature signal). Signal, IQ) sample data without interfering with the modulation, and the CTE signal is transmitted at the end of the corresponding physical link data packet, so it will not affect the cyclic redundancy check of the data packet.
在本申请的实施例中,在发送CTE信号时或者接收CTE信号进行信号采样时,例如在记录IQ样本的同时,增加记录自身时钟时间,为此可修改BLE物理层实现,例如,物理层记录的时间为保护间隔(Guard period)的结束 时间点或者参考间隔(Reference period)的结束时间点,计算时根据采样到的切换时隙(Switch slot)的信号具体所在的Switch slot以及信号的持续时间进行误差校正,以获得相对准确的信号接收时间,可将结果记录在低功耗蓝牙芯片(BLE SoC)的随机存取存储器(RAM)中。其中,可选的,在发送CTE信号时或者接收CTE信号进行信号采样时,也可不再记录IQ样本而只是记录自身时钟时间,可以减少运算量和存储空间。In the embodiments of the present application, when a CTE signal is sent or a CTE signal is received for signal sampling, for example, when recording an IQ sample, the clock time of the recording itself is increased. For this purpose, the BLE physical layer implementation can be modified, for example, the physical layer recording The time is the end time point of the guard interval (Guard period) or the end time point of the reference interval (Reference period), the calculation is based on the specific Switch slot where the signal of the sampled switch slot (Switch slot) is located and the duration of the signal Error correction is performed to obtain relatively accurate signal reception times, and the results can be recorded in the random access memory (RAM) of the Bluetooth low energy chip (BLE SoC). Optionally, when a CTE signal is sent or when a CTE signal is received for signal sampling, the IQ sample may not be recorded but only the clock time of the self may be recorded, which can reduce the amount of computation and storage space.
本申请的实施例使用BLE的CTE信号来辅助实现单边/双边双向测距过程,以下通过多个实施例分别描述具体的实现过程。以下实施例中将测距的目标设备也就是待测设备称为第一设备,将测试设备称为第二设备。第一设备和第二设备均具备发送/接收BLE的CTE信号的能力。The embodiments of the present application use the CTE signal of BLE to assist in implementing the unilateral/bilateral bidirectional ranging process, and the specific implementation process is described below through multiple embodiments. In the following embodiments, the target device for ranging, that is, the device to be tested is referred to as the first device, and the test device is referred to as the second device. Both the first device and the second device are capable of sending/receiving CTE signals of BLE.
实施例1:使用携带CTE信号的BLE广播包Example 1: Using BLE broadcast packets carrying CTE signals
携带CTE信号的BLE广播包也可称为“无连接的CTE”(Connectionless CTE),参考图4,本申请实施例提供一种用于测距的方法,应用于第一设备,该方法包括:A BLE broadcast packet carrying a CTE signal may also be referred to as a "connectionless CTE" (Connectionless CTE). Referring to FIG. 4 , an embodiment of the present application provides a method for ranging, which is applied to a first device, and the method includes:
S101,第一设备发送第一BLE广播信息,所述第一BLE广播信息中包括第一CTE信号;S101, the first device sends first BLE broadcast information, where the first BLE broadcast information includes a first CTE signal;
S102,所述第一设备记录所述第一CTE信号的第一发送时间戳;S102, the first device records a first transmission timestamp of the first CTE signal;
S103,所述第一设备接收第二设备发送的第二BLE广播信息,所述第二BLE广播信息中包括第二CTE信号;S103, the first device receives second BLE broadcast information sent by the second device, where the second BLE broadcast information includes a second CTE signal;
S104,所述第一设备记录所述第二CTE信号的第二接收时间戳;其中,所述第一发送时间戳和所述第二接收时间戳用于计算所述第一设备与所述第二设备之间的距离。S104, the first device records a second receiving timestamp of the second CTE signal; wherein the first sending timestamp and the second receiving timestamp are used to calculate the relationship between the first device and the first The distance between the two devices.
在本申请的实施例中,第一设备持续向外广播低功耗蓝牙BLE广播包,该BLE广播包中携带有固定频率扩展CTE信号,第一设备可记录该CTE信号的发送时间戳,作为后续计算距离时的一个时刻参数,当其他设备接收到第一设备发送的BLE广播包后,可返回一个同样携带CTE信号的BLE广播包,当第一设备接收到返回的BLE广播包时可记录其中CTE信号的接收时间戳,作为后续计算距离时的又一个时刻参数。In the embodiment of the present application, the first device continuously broadcasts a low-power Bluetooth BLE broadcast packet, and the BLE broadcast packet carries a fixed-frequency extended CTE signal, and the first device can record the sending time stamp of the CTE signal as a A time parameter for subsequent distance calculation. When other devices receive the BLE broadcast packet sent by the first device, they can return a BLE broadcast packet that also carries the CTE signal. When the first device receives the returned BLE broadcast packet, it can be recorded. The receiving timestamp of the CTE signal is used as another time parameter in the subsequent calculation of the distance.
因此,本申请实施例的终端设备使用低功耗蓝牙BLE的固定频率扩展CTE信号,可获得多个时间戳参数用于计算设备间的距离,从而实现终端设备的测距功能。Therefore, the terminal device in the embodiment of the present application uses the fixed frequency of low-power Bluetooth BLE to extend the CTE signal, and can obtain multiple time stamp parameters for calculating the distance between devices, thereby realizing the ranging function of the terminal device.
可见,本申请实施例的终端设备能够在无需安装特殊功能模组(例如前述的UWB模组)的条件下,基于CTE信号的发射时间戳和接收时间戳,根据例如单边双向测距的计算式计算设备间的距离,进一步,如果重复多次CTE信号的发射和反馈过程,可获得多组时间戳信息,进而可根据双边双向测距原理计算设备间的距离,具有成本低且测试结果可靠性高的优势。It can be seen that the terminal device of the embodiment of the present application can, without installing a special function module (such as the aforementioned UWB module), based on the transmission time stamp and the reception time stamp of the CTE signal, according to the calculation of, for example, unilateral bidirectional ranging The distance between devices can be calculated using the formula, and further, if the transmission and feedback process of the CTE signal is repeated many times, multiple sets of time stamp information can be obtained, and then the distance between devices can be calculated according to the principle of bilateral two-way ranging, which has low cost and reliable test results. Sexual advantage.
与上述实施例相对应地,参考图5,本申请实施例还提供一种用于测距的方法,应用于第二设备,包括:Corresponding to the foregoing embodiment, referring to FIG. 5 , an embodiment of the present application further provides a method for ranging, which is applied to a second device, including:
S201,第二设备接收第一设备发送的第一BLE广播信息,所述第一BLE广播信息中包括第一CTE信号;S201, a second device receives first BLE broadcast information sent by a first device, where the first BLE broadcast information includes a first CTE signal;
S202,所述第二设备记录所述第一CTE信号的第一接收时间戳;S202, the second device records a first reception timestamp of the first CTE signal;
S203,所述第二设备向所述第一设备发送第二BLE广播信息,所述第二BLE广播信息中包括第二CTE信号;S203, the second device sends second BLE broadcast information to the first device, where the second BLE broadcast information includes a second CTE signal;
S204,所述第二设备记录所述第二CTE信号的第二发送时间戳;其中,所述第一接收时间戳和所述第二发送时间戳用于计算所述第一设备与所述第二设备之间的距离。S204, the second device records a second sending timestamp of the second CTE signal; wherein the first receiving timestamp and the second sending timestamp are used to calculate the relationship between the first device and the first The distance between the two devices.
在本申请的实施例中,第二设备可接收第一设备发出的携带CTE信号的BLE广播包,并记录接收时的时间戳,并且第二设备会向第一设备反馈包含CTE信号的BLE广播包,并记录发送时间戳,用于后续计算第一设备与第二设备之间的距离。In the embodiment of the present application, the second device may receive the BLE broadcast packet carrying the CTE signal sent by the first device, and record the time stamp of reception, and the second device will feed back the BLE broadcast containing the CTE signal to the first device. packet, and record the sending time stamp for subsequent calculation of the distance between the first device and the second device.
本申请的实施例中,对于第二设备,同样地,也无需安装特殊功能模组即可获得计算设备间距离所需要的时间戳信息,具有测试成本低且结果可靠性高的特点。In the embodiment of the present application, for the second device, similarly, the timestamp information required for calculating the distance between devices can be obtained without installing a special function module, which has the characteristics of low test cost and high reliability of results.
以下对本申请实施例的多种实现方式进行详细描述。Various implementation manners of the embodiments of the present application are described in detail below.
本申请实施例中的第一设备和第二设备分别具备两种工作模式:广播模式和搜索模式,两种工作模式的默认切换时长为第一时长,The first device and the second device in the embodiment of the present application respectively have two working modes: a broadcast mode and a search mode, and the default switching duration of the two working modes is the first duration.
具体地,所述第一设备在广播模式下发送所述第一BLE广播信息,所述第一设备在广播模式下持续所述第一时长后切换为搜索模式;Specifically, the first device sends the first BLE broadcast information in a broadcast mode, and the first device switches to a search mode after continuing in the broadcast mode for the first duration;
所述第一设备从广播模式切换为搜索模式之后,开始搜索所述第二设备发送的第二BLE广播信息,如果在所述第一时长之内所述第一设备接收到所述第二设备发送的第二BLE广播信息,则直接切换为广播模式;如果在所述第一时长之内所述第一设备未接收到所述第二设备发送的第二BLE广播信息,则在到达所述第一时长时切换为广播模式。After the first device switches from the broadcast mode to the search mode, it starts to search for the second BLE broadcast information sent by the second device, if the first device receives the second device within the first time period The second BLE broadcast information sent by the second device is directly switched to the broadcast mode; if the first device does not receive the second BLE broadcast information sent by the second device within the first time Switch to broadcast mode for the first time.
举例来讲,第一时长可为例如100ms,在广播模式下持续向外发送广播信息,在搜索模式下接收外部发送的广播信息;For example, the first duration may be, for example, 100ms, continuously sending broadcast information to the outside in the broadcast mode, and receiving broadcast information sent externally in the search mode;
关于切换方式,第一设备或第二设备在广播模式下持续发送包含CTE信号的BLE广播信息,持续例如100ms之后切换为搜索模式,开始搜索信息,如果未搜索到外部信息,则搜索模式到达100ms时再次切换回广播模式,开始发送广播包,如此循环;但是,如果在搜索模式下接收到外部发来的BLE广播信息,则直接切换为广播模式,开始发送广播包,而不再等待100ms时切换。Regarding the switching method, the first device or the second device continues to send BLE broadcast information containing CTE signals in broadcast mode, for example, after 100ms, it switches to search mode and starts to search for information. If no external information is searched, the search mode reaches 100ms Switch back to the broadcast mode again when it starts to send broadcast packets, and so on; however, if it receives BLE broadcast information from the outside in search mode, it directly switches to broadcast mode and starts to send broadcast packets instead of waiting for 100ms. switch.
其中,关于默认切换时长即所述的第一时长的取值,如果第一时长过短,可能搜索不到外部信息,如果第一时长过长,时间累积误差会有所增大,实际中可根据具体情况和应用精度需求设定第一时长的取值。Among them, regarding the default switching duration, that is, the value of the first duration, if the first duration is too short, external information may not be searched; if the first duration is too long, the accumulated time error will increase. The value of the first duration is set according to specific conditions and application accuracy requirements.
以上切换方式对第一设备和第二设备均适用,也就是两设备不断在广播模式和搜索模式间切换,其中一旦在搜索模式下接收到包含CTE信号的BLE广播包,将立即切换为广播模式并发送包含CTE信号的BLE广播包,使得两设备各自能够获得CTE信号的发送时间戳和接收时间戳,用于计算距离。The above switching method is applicable to both the first device and the second device, that is, the two devices constantly switch between the broadcast mode and the search mode. Once the BLE broadcast packet containing the CTE signal is received in the search mode, it will immediately switch to the broadcast mode. And send a BLE broadcast packet containing the CTE signal, so that each of the two devices can obtain the sending timestamp and the receiving timestamp of the CTE signal for calculating the distance.
具体地,以下描述第一设备从搜索模式切换为广播模式之后进行的处理。Specifically, processing performed after the first device switches from the search mode to the broadcast mode is described below.
第一设备从搜索模式切换为广播模式之后,向第二设备发送第三BLE广播信息,所述第三BLE广播信息中包 括第三CTE信号;After the first device is switched from the search mode to the broadcast mode, the third BLE broadcast information is sent to the second device, and the third BLE broadcast information includes the third CTE signal;
第一设备记录所述第三CTE信号的第三发送时间戳;The first device records the third transmission timestamp of the third CTE signal;
第一设备从广播模式切换为搜索模式之后,接收第二设备发送的第四BLE广播信息,所述第四BLE广播信息中包括第四CTE信号;After the first device switches from the broadcast mode to the search mode, it receives fourth BLE broadcast information sent by the second device, where the fourth BLE broadcast information includes a fourth CTE signal;
第一设备记录所述第四CTE信号的第四接收时间戳;The first device records the fourth reception timestamp of the fourth CTE signal;
其中,所述第三发送时间戳和所述第四接收时间戳用于计算第一设备与第二设备之间的距离。Wherein, the third sending timestamp and the fourth receiving timestamp are used to calculate the distance between the first device and the second device.
相对应地,以下描述第二设备从搜索模式切换为广播模式之后进行的处理。Correspondingly, the following describes the processing performed by the second device after switching from the search mode to the broadcast mode.
第二设备在搜索模式下接收所述第一设备发送的第三BLE广播信息,所述第三BLE广播信息中包括第三CTE信号;The second device receives third BLE broadcast information sent by the first device in the search mode, where the third BLE broadcast information includes a third CTE signal;
第二设备记录所述第三CTE信号的第三接收时间戳;The second device records the third reception timestamp of the third CTE signal;
第二设备从搜索模式切换为广播模式之后,向所述第一设备发送第四BLE广播信息,所述第四BLE广播信息中包括第四CTE信号;After the second device is switched from the search mode to the broadcast mode, the second device sends fourth BLE broadcast information to the first device, where the fourth BLE broadcast information includes a fourth CTE signal;
第二设备记录所述第四CTE信号的第四发送时间戳;The second device records the fourth transmission timestamp of the fourth CTE signal;
其中,所述第三接收时间戳和所述第四发送时间戳用于计算所述第一设备与所述第二设备之间的距离。Wherein, the third receiving timestamp and the fourth sending timestamp are used to calculate the distance between the first device and the second device.
可以看到,通过工作模式的切换,第一设备和第二设备可分别获得CTE信号的多个发送时间戳和多个接收时间戳信息,可用于计算距离。例如,可令第一设备将记录的时间戳信息发送给第二设备,由具备运算能力的第二设备代入相应的计算式中得到设备间的距离;或者,由第二设备将记录的时间戳信息发送给第一设备,由具备运算能力的第一设备计算距离;再或者,还可令第一设备和第二设备各自将记录的时间戳信息发送给第三方进行计算,例如发送给服务器计算距离,均能够实现本申请实施例用于测距的目的。It can be seen that, by switching the working mode, the first device and the second device can respectively obtain multiple transmission timestamps and multiple reception timestamps of the CTE signal, which can be used to calculate the distance. For example, the first device can be made to send the recorded time stamp information to the second device, and the second device with computing capability can substitute it into the corresponding calculation formula to obtain the distance between the devices; The information is sent to the first device, and the distance is calculated by the first device with computing capabilities; alternatively, the first device and the second device can each send the recorded timestamp information to a third party for calculation, for example, to a server for calculation. The purpose of the embodiments of the present application for ranging can be achieved.
可选地,本申请实施例的第一设备和第二设备还记录发送的各个BLE广播信息中的CTE信号的发送信道号。Optionally, the first device and the second device in this embodiment of the present application further record the sending channel number of the CTE signal in each sent BLE broadcast information.
可选地,本申请实施例的各个BLE广播信息中还包括标识ID,所述标识ID用于标识对应的BLE广播信息。Optionally, each BLE broadcast information in this embodiment of the present application further includes an identification ID, where the identification ID is used to identify the corresponding BLE broadcast information.
例如,BLE广播信息的标识ID字段可设置为长度在1-16字节内,不超过广播包可用字节数即可,标识ID字段的值n可以设置为自增整数,或者是时间戳数值,非0。标识ID用来唯一标识BLE广播包。For example, the ID field of the BLE broadcast information can be set to a length of 1-16 bytes, which does not exceed the number of bytes available in the broadcast packet. The value n of the ID field can be set to an auto-incrementing integer or a timestamp value. , not 0. The identification ID is used to uniquely identify the BLE broadcast packet.
可选地,本申请实施例各个BLE广播信息中设置有接收标识ID字段、接收时间戳字段和接收信道字段;其中,Optionally, each BLE broadcast information in this embodiment of the present application is provided with a receiving identification ID field, a receiving timestamp field, and a receiving channel field; wherein,
所述接收标识ID字段表示接收到的BLE广播信息的标识ID;The receiving identification ID field represents the identification ID of the received BLE broadcast information;
所述接收时间戳字段表示接收到BLE广播信息中的CTE信号时的接收时间戳;The reception timestamp field represents the reception timestamp when the CTE signal in the BLE broadcast information is received;
所述接收信道字段表示接收到的BLE广播信息中的CTE信号的接收信道号。The receiving channel field indicates the receiving channel number of the CTE signal in the received BLE broadcast information.
例如,接收标识ID字段值为接收到的对端广播包的标识值,接收时间戳字段值为收到该广播包CTE信号时的时间戳,接收信道号为收到该广播包CTE信号时所在的广播信道(如37、38、39信道),默认值可均为0。For example, the receiving identifier ID field value is the identifier value of the received broadcast packet of the opposite end, the receiving timestamp field value is the timestamp when the CTE signal of the broadcast packet is received, and the receiving channel number is the location where the broadcast packet CTE signal was received. The broadcast channel (such as 37, 38, 39 channels), the default value can be 0.
可选地,第一设备在发送所述第三BLE广播信息时,将接收到的所述第二BLE广播信息的标识ID、接收时间戳和接收信道号分别添加至所述第三BLE广播信息中的接收标识ID字段、接收时间戳字段和接收信道字段中。Optionally, when sending the third BLE broadcast information, the first device adds the received identification ID, reception timestamp and reception channel number of the second BLE broadcast information to the third BLE broadcast information, respectively. in the Receive Identification ID field, the Receive Timestamp field, and the Receive Channel field.
对应地,所述第二设备在发送所述第二BLE广播信息时,将接收到的所述第一BLE广播信息的标识ID、接收时间戳和接收信道号分别添加在所述第二BLE广播信息中的接收标识ID字段、接收时间戳字段和接收信道字段中。Correspondingly, when sending the second BLE broadcast information, the second device adds the received identification ID, receiving timestamp and receiving channel number of the first BLE broadcast information to the second BLE broadcast information respectively. In the receiving identification ID field, the receiving timestamp field and the receiving channel field in the information.
通过上述方式,对于第一设备和第二设备,在发送BLE广播信息时,将上一次接收到的BLE广播信息的标识ID、接收时间戳和接收信道号携带在发送的BLE广播信息中,发送给对端设备。如此,第一设备和第二设备根据BLE广播信息的标识ID区分不同BLE广播信息,进而区分不同的CTE信号,还可根据接收信道号和发送信道号确定对应的CTE信号,并根据对应的CTE信号的发送时间戳和接收时间戳计算设备间的距离,确保数据无误。In the above manner, for the first device and the second device, when sending the BLE broadcast information, the identification ID, the receiving timestamp and the receiving channel number of the last received BLE broadcast information are carried in the sent BLE broadcast information, and the sent BLE broadcast information is sent. to the peer device. In this way, the first device and the second device can distinguish different BLE broadcast information according to the identification ID of the BLE broadcast information, thereby distinguishing different CTE signals, and can also determine the corresponding CTE signal according to the receiving channel number and the transmitting channel number, and according to the corresponding CTE signal The sending time stamp and receiving time stamp of the signal calculate the distance between the devices to ensure that the data is correct.
不同于上述方式,本申请实施例的第一设备和第二设备也可以不在要发送的BLE广播包中携带标识ID、接收时间戳和接收信道号,而是在完成多个BLE广播包的发送和接收过程之后,单独将记录的多个接收时间戳、标识ID和接收信道号以广播包形式集中发送给对端设备,用于计算距离。Different from the above methods, the first device and the second device in the embodiment of the present application may not carry the identification ID, the receiving timestamp and the receiving channel number in the BLE broadcast packet to be sent, but complete the sending of multiple BLE broadcast packets. After the receiving process and the receiving process, the recorded multiple receiving time stamps, identification IDs and receiving channel numbers are separately sent to the opposite end device in the form of broadcast packets for calculating the distance.
基于以上两种方式,以下分别描述第一设备和第二设备的处理过程。Based on the above two manners, the processing procedures of the first device and the second device are respectively described below.
①第一设备接收第二设备记录的时间戳等信息①The first device receives the timestamp and other information recorded by the second device
可选地,所述第一设备获取所述第一CTE信号的第一接收时间戳、接收信道号和所述第一BLE广播信息的标识ID,Optionally, the first device obtains the first reception timestamp of the first CTE signal, the reception channel number, and the identification ID of the first BLE broadcast information,
所述第一设备获取所述第三CTE信号的第三接收时间戳、接收信道号和所述第三BLE广播信息的标识ID;obtaining, by the first device, a third reception timestamp, a reception channel number, and an identification ID of the third BLE broadcast information of the third CTE signal;
其中,所述第一接收时间戳是所述第二设备接收到所述第一CTE信号时的时间戳,所述第三接收时间戳是所述第二设备接收到所述第三CTE信号时的时间戳,所述第一接收时间戳和所述第三接收时间戳用于计算所述第一设备与所述第二设备之间的距离。The first reception time stamp is a time stamp when the second device receives the first CTE signal, and the third reception time stamp is when the second device receives the third CTE signal The first receiving timestamp and the third receiving timestamp are used to calculate the distance between the first device and the second device.
可选地,所述第一CTE信号的第一接收时间戳、接收信道号和所述第一BLE广播信息的标识ID携带在所述第二BLE广播信息中,所述第三CTE信号的第三接收时间戳、接收信道号和所述第三BLE广播信息的标识ID携带在所述第四BLE广播信息中;Optionally, the first reception timestamp, reception channel number, and identification ID of the first BLE broadcast information of the first CTE signal are carried in the second BLE broadcast information, and the first reception time stamp of the third CTE signal is carried in the second BLE broadcast information. 3. The receiving timestamp, the receiving channel number, and the identification ID of the third BLE broadcast information are carried in the fourth BLE broadcast information;
可选地,所述第一CTE信号的第一接收时间戳、接收信道号和所述第一BLE广播信息的标识ID,以及,所述第三CTE信号的第三接收时间戳、接收信道号和所述第三BLE广播信息的标识ID由所述第二设备在发送所述第四BLE广播信息之后发送给所述第一设备。Optionally, the first reception timestamp, the reception channel number and the ID of the first BLE broadcast information of the first CTE signal, and the third reception timestamp and reception channel number of the third CTE signal and the identification ID of the third BLE broadcast information is sent by the second device to the first device after sending the fourth BLE broadcast information.
可选地,所述第一设备获取所述第二CTE信号的第二发送时间戳以及所述第四CTE信号的第四发送时间戳。Optionally, the first device obtains a second transmission timestamp of the second CTE signal and a fourth transmission timestamp of the fourth CTE signal.
②第一设备将记录的时间戳等信息发送给第二设备②The first device sends the recorded timestamp and other information to the second device
可选地,所述第一设备将所述第二CTE信号的第二接收时间戳、接收信道号和所述第二BLE广播信息的标识ID发送给所述第二设备,Optionally, the first device sends the second reception timestamp of the second CTE signal, the reception channel number and the identification ID of the second BLE broadcast information to the second device,
所述第一设备将所述第四CTE信号的第四接收时间戳、接收信道号和所述第四BLE广播信息的标识ID发送给 所述第二设备,The first device sends the fourth reception time stamp of the fourth CTE signal, the reception channel number and the identification ID of the fourth BLE broadcast information to the second device,
其中,所述第二接收时间戳是所述第一设备接收到所述第二CTE信号时的时间戳,所述第四接收时间戳是所述第一设备接收到所述第四CTE信号时的时间戳,所述第二接收时间戳和所述第四接收时间戳用于计算所述第一设备与所述第二设备之间的距离。Wherein, the second reception time stamp is a time stamp when the first device receives the second CTE signal, and the fourth reception time stamp is when the first device receives the fourth CTE signal The second receiving timestamp and the fourth receiving timestamp are used to calculate the distance between the first device and the second device.
可选地,所述第二CTE信号的第二接收时间戳、接收信道号和所述第二BLE广播信息的标识ID携带在所述第三BLE广播信息中,所述第四CTE信号的第四接收时间戳、接收信道号和所述第四BLE广播信息的标识ID携带在第五BLE广播信息中;Optionally, the second reception timestamp, the reception channel number, and the ID of the second BLE broadcast information of the second CTE signal are carried in the third BLE broadcast information, and the third BLE broadcast information of the fourth CTE signal. 4. The receiving timestamp, the receiving channel number and the identification ID of the fourth BLE broadcast information are carried in the fifth BLE broadcast information;
可选地,所述第二CTE信号的第二接收时间戳、接收信道号和所述第二BLE广播信息的标识ID,以及,所述第四CTE信号的第四接收时间戳、接收信道号和所述第四BLE广播信息的标识ID由所述第一设备在向所述第二设备发送第五BLE广播信息之后,发送给所述第二设备。Optionally, the second reception time stamp, the reception channel number, and the ID of the second BLE broadcast information of the second CTE signal, and the fourth reception time stamp and reception channel number of the fourth CTE signal and the identification ID of the fourth BLE broadcast information is sent to the second device by the first device after sending the fifth BLE broadcast information to the second device.
可选地,所述第一设备将所述第一CTE信号的第一发送时间戳以及所述第三CTE信号的第三发送时间戳发送给所述第二设备。Optionally, the first device sends the first transmission timestamp of the first CTE signal and the third transmission timestamp of the third CTE signal to the second device.
③第二设备将记录的时间戳等信息发送给第一设备③ The second device sends the recorded timestamp and other information to the first device
可选地,所述第二设备将所述第一CTE信号的第一接收时间戳、接收信道号和所述第一BLE广播信息的标识ID发送给所述第一设备,Optionally, the second device sends the first receiving timestamp, the receiving channel number and the identification ID of the first BLE broadcast information of the first CTE signal to the first device,
所述第二设备将所述第三CTE信号的第三接收时间戳、接收信道号和所述第三BLE广播信息的标识ID发送给所述第一设备,The second device sends the third reception timestamp of the third CTE signal, the reception channel number, and the identification ID of the third BLE broadcast information to the first device,
其中,所述第一接收时间戳是所述第二设备接收到所述第一CTE信号时的时间戳,所述第三接收时间戳是所述第二设备接收到所述第三CTE信号时的时间戳,所述第一接收时间戳和所述第三接收时间戳用于计算所述第一设备与所述第二设备之间的距离。The first reception time stamp is a time stamp when the second device receives the first CTE signal, and the third reception time stamp is when the second device receives the third CTE signal The first receiving timestamp and the third receiving timestamp are used to calculate the distance between the first device and the second device.
可选地,所述第一CTE信号的第一接收时间戳、接收信道号和所述第一BLE广播信息的标识ID携带在所述第二BLE广播信息中,所述第三CTE信号的第三接收时间戳、接收信道号和所述第三BLE广播信息的标识ID携带在所述第四BLE广播信息中;Optionally, the first reception timestamp, reception channel number, and identification ID of the first BLE broadcast information of the first CTE signal are carried in the second BLE broadcast information, and the first reception time stamp of the third CTE signal is carried in the second BLE broadcast information. 3. The receiving timestamp, the receiving channel number, and the identification ID of the third BLE broadcast information are carried in the fourth BLE broadcast information;
可选地,所述第一CTE信号的第一接收时间戳、接收信道号和所述第一BLE广播信息的标识ID,以及,所述第三CTE信号的第三接收时间戳、接收信道号和所述第三BLE广播信息的标识ID由所述第二设备在发送所述第四BLE广播信息之后,发送给所述第一设备。Optionally, the first reception timestamp, the reception channel number and the ID of the first BLE broadcast information of the first CTE signal, and the third reception timestamp and reception channel number of the third CTE signal and the identification ID of the third BLE broadcast information is sent by the second device to the first device after sending the fourth BLE broadcast information.
可选地,所述第二设备将所述第二CTE信号的第二发送时间戳以及所述第四CTE信号的第四发送时间戳发送给所述第一设备。Optionally, the second device sends the second transmission timestamp of the second CTE signal and the fourth transmission timestamp of the fourth CTE signal to the first device.
④第二设备接收第一设备记录的时间戳等信息④The second device receives the timestamp and other information recorded by the first device
所述第二设备获取所述第二CTE信号的第二接收时间戳、接收信道号和所述第二BLE广播信息的标识ID,The second device acquires the second reception timestamp, the reception channel number and the identification ID of the second BLE broadcast information of the second CTE signal,
所述第二设备获取所述第四CTE信号的第四接收时间戳、接收信道号和所述第四BLE广播信息的标识ID,The second device obtains the fourth reception timestamp of the fourth CTE signal, the reception channel number, and the identification ID of the fourth BLE broadcast information,
其中,所述第二接收时间戳是所述第一设备接收到所述第二CTE信号时的时间戳,所述第四接收时间戳是所述第一设备接收到所述第四CTE信号时的时间戳,所述第二接收时间戳和所述第四接收时间戳用于计算所述第一设备与所述第二设备之间的距离。Wherein, the second reception time stamp is a time stamp when the first device receives the second CTE signal, and the fourth reception time stamp is when the first device receives the fourth CTE signal The second receiving timestamp and the fourth receiving timestamp are used to calculate the distance between the first device and the second device.
可选地,所述第二CTE信号的第二接收时间戳、接收信道号和所述第二BLE广播信息的标识ID携带在所述第三BLE广播信息中,所述第四CTE信号的第四接收时间戳、接收信道号和所述第四BLE广播信息的标识ID携带在第五BLE广播信息中;Optionally, the second reception timestamp, the reception channel number, and the ID of the second BLE broadcast information of the second CTE signal are carried in the third BLE broadcast information, and the third BLE broadcast information of the fourth CTE signal. 4. The receiving timestamp, the receiving channel number and the identification ID of the fourth BLE broadcast information are carried in the fifth BLE broadcast information;
可选地,所述第二CTE信号的第二接收时间戳、接收信道号和所述第二BLE广播信息的标识ID,以及,所述第四CTE信号的第四接收时间戳、接收信道号和所述第四BLE广播信息的标识ID由所述第一设备在向所述第二设备发送第五BLE广播信息之后,发送给所述第二设备。Optionally, the second reception time stamp, the reception channel number, and the ID of the second BLE broadcast information of the second CTE signal, and the fourth reception time stamp and reception channel number of the fourth CTE signal and the identification ID of the fourth BLE broadcast information is sent to the second device by the first device after sending the fifth BLE broadcast information to the second device.
可选地,所述第二设备获取所述第一CTE信号的第一发送时间戳以及所述第三CTE信号的第三发送时间戳。Optionally, the second device obtains a first transmission timestamp of the first CTE signal and a third transmission timestamp of the third CTE signal.
经过上述多种处理方式中的至少一种处理,第一设备或者第二设备在获得计算所需的多个时间戳信息之后,计算第一设备与第二设备之间的距离,计算时,基于标识ID相对应且发送信道号和接收信道号相同的发送时间戳与接收时间戳的差值进行计算。After at least one of the above-mentioned processing methods, the first device or the second device calculates the distance between the first device and the second device after obtaining multiple timestamp information required for the calculation. The difference between the sending timestamp and the receiving timestamp corresponding to the ID and having the same sending channel number and receiving channel number is calculated.
在本申请一些实施例中,可能出现以下情况:由于BLE会将应用层的同一个广播包在37、38和39信道各自都发送一遍,所以对于一个应用层的广播包可能会出现1个、2个或者3个物理层的广播包记录,以发送信道号区分,也就是可能出现同一个应用层的广播包的发送信道号并不相同。In some embodiments of the present application, the following situations may occur: since BLE will send the same broadcast packet of the application layer on channels 37, 38 and 39, respectively, there may be 1, The broadcast packet records of 2 or 3 physical layers are distinguished by the transmission channel number, that is, the transmission channel numbers of the broadcast packets of the same application layer may be different.
计算距离时,需基于发送信道号和接收信道号相同的发送时间戳与接收时间戳的差值进行计算,如果遇到记录的全部时间戳(第一发送时间戳、第二发送时间戳、第三发送时间戳、第四发送时间戳、第一接收时间戳、第二接收时间戳、第三接收时间戳和第四接收时间戳)中,不存在发送信道号和接收信道号相同的发送时间戳与接收时间戳,说明需要对发送端的时间戳记录进行调整,具体地,可根据发送信道号与接收信道号的差值,以及相邻广播信道之间的时间间隔,调整发送时间戳的值。下文将通过具体的例子对此进行解释说明。When calculating the distance, it needs to be calculated based on the difference between the sending time stamp and the receiving time stamp with the same sending channel number and receiving channel number. Among the three transmission time stamps, the fourth transmission time stamp, the first reception time stamp, the second reception time stamp, the third reception time stamp and the fourth reception time stamp), there is no transmission time with the same transmission channel number and reception channel number Stamp and receiving timestamp, indicating that the timestamp record of the sender needs to be adjusted. Specifically, the value of the sending timestamp can be adjusted according to the difference between the sending channel number and the receiving channel number, as well as the time interval between adjacent broadcast channels. . This will be explained below with specific examples.
与上述第一设备、第二设备处理相对应地,本申请实施例还提供一种用于测距的方法,参考图6,该方法包括:Corresponding to the processing of the above-mentioned first device and second device, an embodiment of the present application further provides a method for ranging. Referring to FIG. 6 , the method includes:
S301,接收第一设备和第二设备发送的第一发送时间戳、第二发送时间戳、第三发送时间戳、第四发送时间戳、第一接收时间戳、第二接收时间戳、第三接收时间戳和第四接收时间戳,以及与各个时间戳对应的标识ID、发送信道号和接收信道号;S301: Receive a first sending timestamp, a second sending timestamp, a third sending timestamp, a fourth sending timestamp, a first receiving timestamp, a second receiving timestamp, and a third sending timestamp sent by a first device and a second device. The receiving time stamp and the fourth receiving time stamp, and the identification ID, the sending channel number and the receiving channel number corresponding to each time stamp;
S302,基于标识ID相对应且发送信道号和接收信道号相同的发送时间戳与接收时间戳的差值,计算所述第一设备与所述第二设备之间的距离。S302: Calculate the distance between the first device and the second device based on the difference between the sending timestamp and the receiving timestamp corresponding to the ID and having the same sending channel number and receiving channel number.
根据本申请实施例,在第一设备和第二设备获得计算所需要的时间戳等信息后,可将这些信息统一方式给第三 方设备,比如具备强大计算能力的服务器设备来计算第一设备和第二设备的距离,对于计算能力较弱的终端设备例如手机,此方案可节省终端设备的资源和电能消耗。According to the embodiment of the present application, after the first device and the second device obtain the time stamps and other information required for calculation, the information can be sent to a third-party device in a unified manner, such as a server device with powerful computing capabilities, to calculate the first device and the second device. The distance of the second device, for a terminal device with weak computing capability, such as a mobile phone, this solution can save the resources and power consumption of the terminal device.
以上描述了第一设备和第二设备各自的处理过程。以下通过具体的例子对第一设备(以下记为设备A)和第二设备(以下记为设备B)的交互过程进行详细描述。The respective processing procedures of the first device and the second device are described above. The interaction process between the first device (hereinafter referred to as device A) and the second device (hereinafter referred to as device B) will be described in detail below through specific examples.
参考图7,本实施例以设备A为待测设备,设备B为手机为例,设备A每100毫秒进行一次广播模式与搜索模式的切换,即持续100毫秒发送广播包,然后切换到搜索模式,其中,若在搜索模式下收到广播包,则切换回广播模式,若在搜索模式下一直未接收到广播包,则在搜索持续100毫秒后切换回广播模式。Referring to FIG. 7 , this embodiment takes device A as the device to be tested and device B as a mobile phone as an example. Device A switches between broadcast mode and search mode every 100 milliseconds, that is, sends broadcast packets for 100 milliseconds, and then switches to search mode. , in which, if a broadcast packet is received in the search mode, it will switch back to the broadcast mode, and if no broadcast packet has been received in the search mode, it will switch back to the broadcast mode after the search continues for 100 milliseconds.
设备A记录自身发出每个广播包的CTE信号时的发送时间戳TXAn、对应的标识字段值n和发送信道号CAn。这里,由于BLE会将应用层的同一个广播包在37、38和39信道各自都发送一遍,所以对于一个应用层的广播包,可能会出现1个、2个或3个物理层的广播包记录,通过发送信道号区分。Device A records the sending time stamp TXAn, the corresponding identification field value n and the sending channel number CAn when it sends the CTE signal of each broadcast packet. Here, since BLE will send the same broadcast packet of the application layer on channels 37, 38 and 39, respectively, for an application layer broadcast packet, there may be 1, 2 or 3 physical layer broadcast packets. Records are distinguished by sending channel numbers.
设备B启动搜索,设备B每100毫秒做一次广播模式和搜索模式的切换,类似地,若在搜索模式收到广播包,则切换到广播模式,发送100毫秒的广播包,然后切换回搜索模式。当收到设备A的广播包时,设备B记录收到广播包CTE信号时的接收时间戳RXBn、对应的标识字段值n及接收信道号CBn,然后,对应的发出一个广播包(标识字段值为m),并在该广播包中填入接收字段:RXBn、n及CBn,并且,记录发出该广播包的CTE信号时的发送时间戳TXBm、对应的标识字段值m和发送信道号CBm。Device B starts searching, and device B switches between broadcast mode and search mode every 100 milliseconds. Similarly, if a broadcast packet is received in search mode, it switches to broadcast mode, sends a broadcast packet for 100 milliseconds, and then switches back to search mode . When receiving the broadcast packet from device A, device B records the reception timestamp RXBn, the corresponding identification field value n and the receiving channel number CBn when the CTE signal of the broadcast packet is received, and then sends out a corresponding broadcast packet (identification field value is m), and fill in the receiving fields: RXBn, n and CBn in the broadcast packet, and record the transmission time stamp TXBm, the corresponding identification field value m and the transmission channel number CBm when the CTE signal of the broadcast packet is sent.
设备A切换到搜索后,接收到设备B发出的广播包(标识字段值为m),设备A记录收到该广播包的CTE信号时的接收时间戳RXAm、对应的标识字段值m和接收信道号CAm。After device A switches to search, it receives the broadcast packet sent by device B (the value of the identification field is m), and device A records the reception timestamp RXAm, the value of the corresponding identification field m and the receiving channel when the CTE signal of the broadcast packet is received. No. CAm.
可选的,设备A和设备B也可以不在每个广播包都传输接收时间戳等信息,而是在上述步骤之后,发送单独的广播包将前述记录的多个接收时间戳、对应标识值和接收信道号集中发送给对端。Optionally, device A and device B may not transmit information such as receiving timestamps for each broadcast packet, but after the above steps, send a separate broadcast packet to record the multiple receiving timestamps, corresponding identification values and The received channel number is sent to the opposite end in a centralized manner.
通过上述设备A和设备B的交互过程,可以得到如图8所示的多个时间戳信息。选取记录中发送信道号和接收信道号相同的TXAn和RXBn、TXBm和RXAm、TXAx和RXBx,以及TXBy和RXAy,为获得满足上述条件(发送信道号和接收信道号相同)的多个时间戳记录,可以对前述流程进行多次循环,如图7所示,直至获得符合条件的时间戳数据。Through the above interaction process between device A and device B, multiple time stamp information as shown in FIG. 8 can be obtained. Select TXAn and RXBn, TXBm and RXAm, TXAx and RXBx, and TXBy and RXAy with the same transmit channel number and receive channel number in the record, in order to obtain multiple time stamp records that satisfy the above conditions (the transmit channel number and receive channel number are the same) , the foregoing process can be repeated multiple times, as shown in FIG. 7 , until the time stamp data that meets the conditions is obtained.
在本申请实施例中,如果没有成功获得发送信道号和接收信道号相同的TXAn和RXBn记录,可根据相关的蓝牙核心协议,按照接收端的信道号,对发送端的时间记录进行调整,以补偿信道偏移的量,这里,发送端知晓并各自记录自身两个广播信道间的发送实际间隔IntA和IntB。In the embodiment of the present application, if the TXAn and RXBn records with the same transmit channel number and receive channel number are not successfully obtained, the time record of the transmit end can be adjusted according to the relevant Bluetooth core protocol and the channel number of the receive end to compensate for the channel number. The amount of offset, here, the sender knows and records the actual transmission interval IntA and IntB between its two broadcast channels.
调整时,例如若TXAn的CAn为信道号37,RXBn的CBn为信道号39,则调整为TXAn=TXAn+2×IntA。又例如,若TXBy的CBy为信道号39,RXAy的CAy为信道号38,则调整为TXBy=TXBy–1×IntB。During adjustment, for example, if CAn of TXAn is channel number 37 and CBn of RXBn is channel number 39, the adjustment is TXAn=TXAn+2×IntA. For another example, if CBy of TXBy is channel number 39, and CAy of RXAy is channel number 38, the adjustment is TXBy=TXBy−1×IntB.
获得符合条件的时间戳数据后,可将各个时间戳数据代入计算式,例如单边双向测距SS-TWR、双边双向测距DS-TWR的计算式中计算,如下:After obtaining the time stamp data that meets the conditions, each time stamp data can be substituted into the calculation formula, such as the calculation formula of unilateral two-way ranging SS-TWR and bilateral two-way ranging DS-TWR, as follows:
1)按照SS-TWR计算有:1) Calculated according to SS-TWR:
Tround=RXAm-TXAn,Tround=RXAm-TXAn,
Treply=TXBm-RXBnTreply=TXBm-RXBn
2)按照DS-TWR(4messages)计算有:2) Calculated according to DS-TWR (4messages):
Tround1=RXAm-TXAn,Tround1=RXAm-TXAn,
Treply1=TXBm-RXBn,Treply1=TXBm-RXBn,
Tround2=RXAy-TXAx,Tround2=RXAy-TXAx,
Treply2=TXBy-RXBxTreply2=TXBy-RXBx
3)按照DS-TWR(3messages)计算有:3) Calculated according to DS-TWR (3messages):
Tround1=RXAm-TXAnGround1=RXAm-TXAn
Treply1=TXBm-RXBnTreply1=TXBm-RXBn
Tround2=RXBx-TXBmTround2=RXBx-TXBm
Treply2=RXAm-TXAxTreply2=RXAm-TXAx
最后,分别代入前文给出的三个对应公式,即可计算出设备A与设备B间的距离。Finally, by substituting the three corresponding formulas given above, the distance between device A and device B can be calculated.
实施例2:使用携带CTE信号的BLE请求回应包Example 2: Using BLE request-response packets carrying CTE signals
携带CTE信号的BLE请求回应包也可称为“有连接的CTE”(Connection CTE),参考图9,本申请实施例还提供一种用于测距的方法,应用于第三设备,该方法包括:The BLE request-response packet carrying the CTE signal may also be referred to as a "connected CTE" (Connection CTE). include:
S401,第三设备向第四设备发送第一BLE请求信息;S401, a third device sends first BLE request information to a fourth device;
S402,所述第三设备接收第四设备发送的第一BLE回应信息,所述第一BLE回应信息中包括第一CTE信号;S402, the third device receives the first BLE response information sent by the fourth device, where the first BLE response information includes the first CTE signal;
S403,所述第三设备记录所述第一CTE信号的第一接收时间戳;其中,所述第一接收时间戳用于计算所述第三设备与所述第四设备之间的距离。S403, the third device records a first reception timestamp of the first CTE signal; wherein the first reception timestamp is used to calculate the distance between the third device and the fourth device.
相对应地,本申请实施例还提供一种用于测距的方法,应用于第四设备,参考图10,该方法包括:Correspondingly, an embodiment of the present application further provides a method for ranging, which is applied to a fourth device. Referring to FIG. 10 , the method includes:
S501,第四设备接收第三设备发送的第一BLE请求信息;S501, the fourth device receives the first BLE request information sent by the third device;
S502,所述第四设备向所述第三设备发送第一BLE回应信息,所述第一BLE回应信息中包括第一CTE信号;S502, the fourth device sends first BLE response information to the third device, where the first BLE response information includes a first CTE signal;
S503,所述第四设备记录所述第一CTE信号的第一发送时间戳;所述第一发送时间戳用于计算所述第三设备与所述第四设备之间的距离。S503, the fourth device records a first sending timestamp of the first CTE signal; the first sending timestamp is used to calculate the distance between the third device and the fourth device.
与前述的实施例1不同,本申请实施例采用携带CTE信号的BLE请求回应包,而非实施例1的BLE广播包,因此第三设备和第四设备之间可点对点交互请求信息和回应信息,并在交互过程中记录CTE信号的发送时间戳和对应的接收时间戳,用于计算两设备间的距离。Different from the foregoing Embodiment 1, this embodiment of the present application uses a BLE request response packet carrying a CTE signal, rather than the BLE broadcast packet of Embodiment 1, so that the third device and the fourth device can exchange request information and response information point-to-point. , and record the sending time stamp and the corresponding receiving time stamp of the CTE signal during the interaction process, which are used to calculate the distance between the two devices.
可选地,所述第三设备接收第四设备发送的第二BLE请求信息;Optionally, the third device receives the second BLE request information sent by the fourth device;
所述第三设备向所述第四设备发送第二BLE回应信息,所述第二BLE回应信息中包括第二CTE信号;所述第三设备记录所述第二CTE信号的第二发送时间戳;其中,所述第二发送时间戳用于计算所述第三设备与所述第四设备之间的距离。The third device sends second BLE response information to the fourth device, where the second BLE response information includes a second CTE signal; the third device records a second sending timestamp of the second CTE signal ; wherein, the second sending timestamp is used to calculate the distance between the third device and the fourth device.
对应地,所述第四设备向所述第三设备发送第二BLE请求信息;Correspondingly, the fourth device sends second BLE request information to the third device;
所述第四设备接收所述第三设备发送的第二BLE回应信息,所述第二BLE回应信息中包括第二CTE信号;所述第四设备记录所述第二CTE信号的第二接收时间戳;其中,所述第二接收时间戳用于计算所述第三设备与所述第四设备之间的距离。The fourth device receives the second BLE response information sent by the third device, where the second BLE response information includes a second CTE signal; the fourth device records the second receiving time of the second CTE signal where the second received timestamp is used to calculate the distance between the third device and the fourth device.
通过如上所述多轮信息交互,可获得多组发送时间戳和接收时间戳信息,可利用多种公式计算,提高计算精度。Through multiple rounds of information exchange as described above, multiple sets of sending timestamps and receiving timestamps can be obtained, which can be calculated using various formulas to improve calculation accuracy.
可选地,各个BLE请求信息中包括时间戳字段,表示接收到的上一个CTE信号的发送时间戳。Optionally, each BLE request information includes a timestamp field, which indicates the sending timestamp of the last received CTE signal.
可选地,各个BLE回应信息中包括时间戳字段,表示发送的上一个CTE信号的接收时间戳。Optionally, each BLE response information includes a timestamp field, which indicates the reception timestamp of the last CTE signal sent.
也就是说,本申请的实施例中,在第三设备和第四设备交替发送请求信息和回应信息时,由发送回应信息的设备记录CTE信号的发送时间戳,以及,由接收回应信息的设备记录CTE信号的接收时间戳,以此记录计算所需的时间戳信息。That is to say, in the embodiment of the present application, when the third device and the fourth device alternately send request information and response information, the device that sends the response information records the sending time stamp of the CTE signal, and the device that receives the response information records the time stamp of the CTE signal. The received timestamp of the CTE signal is recorded to record the timestamp information required for the calculation.
可选地,在所述第三设备向所述第四设备发送第二BLE回应信息之前,所述第三设备将所述第一接收时间戳添加至所述第二BLE回应信息中。对应地,在所述第四设备向所述第三设备发送第二BLE请求信息之前,所述第四设备将所述第一发送时间戳添加至所述第二BLE请求信息中。以此将计算所需的时间戳信息发送给对端设备。Optionally, before the third device sends the second BLE response information to the fourth device, the third device adds the first reception timestamp to the second BLE response information. Correspondingly, before the fourth device sends the second BLE request information to the third device, the fourth device adds the first sending timestamp to the second BLE request information. In this way, the timestamp information required for the calculation is sent to the peer device.
可选地,在计算所述第三设备与所述第四设备之间的距离时,基于对应的发送时间戳与接收时间戳的差值进行计算。可将发送时间戳与接收时间戳代入相应的计算公式中计算得到两设备间的距离。Optionally, when calculating the distance between the third device and the fourth device, the calculation is performed based on the difference between the corresponding sending timestamp and the receiving timestamp. The distance between the two devices can be calculated by substituting the sending timestamp and the receiving timestamp into the corresponding calculation formula.
以下通过具体的例子描述本申请实施例的设备间信息交互过程,其中将第三设备记为设备A,将第四设备记为设备B。The following describes the information exchange process between devices in the embodiment of the present application by using a specific example, wherein the third device is denoted as device A, and the fourth device is denoted as device B.
参考图11,设备A和设备B交替发送携带CTE信号的BLE请求信息(图11中记为LL_CTE_REQ)和携带CTE信号的BLE回应信息(图11中记为LL_CTE_RSP);Referring to FIG. 11 , device A and device B alternately send BLE request information carrying CTE signals (denoted as LL_CTE_REQ in FIG. 11 ) and BLE response information carrying CTE signals (denoted as LL_CTE_RSP in FIG. 11 );
在多次交互过程中,发送LL_CTE_RSP的设备记录发送CTE的时间戳,接收LL_CTE_RSP的设备记录接收CTE的时间戳。During multiple interactions, the device sending LL_CTE_RSP records the time stamp of sending CTE, and the device receiving LL_CTE_RSP records the time stamp of receiving CTE.
可选的,可以修改LL_CTE_REQ数据包,在LL_CTE_REQ中增加所记录的上一个CTE的接收时间戳;可选地,还可以修改LL_CTE_RSP数据包,在LL_CTE_RSP增加所记录的上一个CTE的发送时间戳,通过这种方式,可减少最后用于搜集交互过程中的多个时间戳数据的应用层数据包,可在一定程度上压缩处理时间,提高处理效率。Optionally, you can modify the LL_CTE_REQ data packet, and add the recorded receiving timestamp of the last CTE in LL_CTE_REQ; optionally, you can also modify the LL_CTE_RSP data packet, and add the recorded sending timestamp of the last CTE in LL_CTE_RSP, In this way, the application layer data packets that are finally used to collect multiple timestamp data in the interaction process can be reduced, the processing time can be compressed to a certain extent, and the processing efficiency can be improved.
通过上述设备A和设备B的交互过程,可以得到如图12所示的多个时间戳信息。Through the above interaction process between device A and device B, multiple time stamp information as shown in FIG. 12 can be obtained.
1)按照SS-TWR计算有:1) Calculated according to SS-TWR:
Tround=RXB2-TXB1,Tround=RXB2-TXB1,
Treply=TXA2-RXA1,Treply=TXA2-RXA1,
2)按照DS-TWR(4messages)计算有:2) Calculated according to DS-TWR (4messages):
Tround1=RXB2-TXB1,Ground1=RXB2-TXB1,
Treply1=TXA2-RXA1,Treply1=TXA2-RXA1,
Tround2=RXB4–TXB3,Tround2=RXB4–TXB3,
Treply2=TXA4–RXA3,Treply2=TXA4–RXA3,
3)按照DS-TWR(3messages)计算有:3) Calculated according to DS-TWR (3messages):
Tround1=RXB2-TXB1,Ground1=RXB2-TXB1,
Treply1=TXA2-RXA1,Treply1=TXA2-RXA1,
Tround2=RXA3-TXA2Ground2=RXA3-TXA2
Treply2=TXB3-RXB2Treply2=TXB3-RXB2
最后,分别代入前文给出的三个对应公式,即可计算出设备A与设备B间的距离。Finally, by substituting the three corresponding formulas given above, the distance between device A and device B can be calculated.
基于以上内容,本申请的多种实施例可以使用大多数智能终端如手机上普遍已有的蓝牙模组实现,实施过程不需要天线阵列或多个辅助定位设备,就能较准确地测量出待测设备与手机间的距离,能提升用户体验,降低成本,实际应用中时间误差小,测距准确度较高。Based on the above content, the various embodiments of the present application can be implemented by using the Bluetooth modules commonly found on most smart terminals such as mobile phones, and the implementation process does not require an antenna array or multiple auxiliary positioning devices, and can more accurately measure the Measuring the distance between the device and the mobile phone can improve the user experience and reduce the cost. In practical applications, the time error is small and the ranging accuracy is high.
以上通过多个实施例从不同角度描述了本申请实施例的具体设置和实现方式。与上述至少一个实施例的处理方法相对应地,本申请实施例还提供一种终端设备100,可称为第一设备,参考图13,其包括:The specific settings and implementations of the embodiments of the present application have been described above through multiple embodiments from different perspectives. Corresponding to the processing method of at least one of the above embodiments, an embodiment of the present application further provides a terminal device 100, which may be referred to as a first device. Referring to FIG. 13, the terminal device 100 includes:
第一发送模块101,用于发送第一低功耗蓝牙BLE广播信息,所述第一BLE广播信息中包括第一固定频率扩展CTE信号;The first sending module 101 is configured to send first low-power Bluetooth BLE broadcast information, where the first BLE broadcast information includes a first fixed frequency extended CTE signal;
第一记录模块102,用于记录所述第一CTE信号的第一发送时间戳;a first recording module 102, configured to record the first transmission time stamp of the first CTE signal;
第一接收模块103,用于接收第二设备发送的第二BLE广播信息,所述第二BLE广播信息中包括第二CTE信号;a first receiving module 103, configured to receive second BLE broadcast information sent by a second device, where the second BLE broadcast information includes a second CTE signal;
第二记录模块104,用于记录所述第二CTE信号的第二接收时间戳;A second recording module 104, configured to record the second reception timestamp of the second CTE signal;
其中,所述第一发送时间戳和所述第二接收时间戳用于计算所述第一设备与所述第二设备之间的距离。The first sending timestamp and the second receiving timestamp are used to calculate the distance between the first device and the second device.
与上述至少一个实施例的处理方法相对应地,本申请实施例还提供一种终端设备200,可称为第二设备,参考图14,其包括:Corresponding to the processing method of the above at least one embodiment, an embodiment of the present application further provides a terminal device 200, which may be referred to as a second device. Referring to FIG. 14, the terminal device 200 includes:
第一接收模块201,用于接收第一设备发送的第一BLE广播信息,所述第一BLE广播信息中包括第一CTE信号;A first receiving module 201, configured to receive first BLE broadcast information sent by a first device, where the first BLE broadcast information includes a first CTE signal;
第一记录模块202,用于记录所述第一CTE信号的第一接收时间戳;a first recording module 202, configured to record the first reception timestamp of the first CTE signal;
第一发送模块203,用于向所述第一设备发送第二BLE广播信息,所述第二BLE广播信息中包括第二CTE信号;a first sending module 203, configured to send second BLE broadcast information to the first device, where the second BLE broadcast information includes a second CTE signal;
第一记录模块204,用于记录所述第二CTE信号的第二发送时间戳;a first recording module 204, configured to record the second transmission time stamp of the second CTE signal;
其中,所述第一接收时间戳和所述第二发送时间戳用于计算所述第一设备与所述第二设备之间的距离。The first receiving timestamp and the second sending timestamp are used to calculate the distance between the first device and the second device.
与上述至少一个实施例的处理方法相对应地,本申请实施例还提供一种电子设备300,参考图15,其包括:Corresponding to the processing method of at least one of the above embodiments, an embodiment of the present application further provides an electronic device 300, referring to FIG. 15, which includes:
接收模块301,用于接收第一设备和第二设备发送的第一发送时间戳、第二发送时间戳、第三发送时间戳、第四发送时间戳、第一接收时间戳、第二接收时间戳、第三接收时间戳和第四接收时间戳,以及与各个时间戳对应的标识ID、发送信道号和接收信道号;A receiving module 301, configured to receive a first sending timestamp, a second sending timestamp, a third sending timestamp, a fourth sending timestamp, a first receiving timestamp, and a second receiving time sent by the first device and the second device stamp, the third receiving time stamp and the fourth receiving time stamp, and the identification ID, the sending channel number and the receiving channel number corresponding to each time stamp;
计算模块302,用于基于标识ID相对应且发送信道号和接收信道号相同的发送时间戳与接收时间戳的差值,计算所述第一设备与所述第二设备之间的距离。The calculation module 302 is configured to calculate the distance between the first device and the second device based on the difference between the sending timestamp and the receiving timestamp corresponding to the ID and having the same sending channel number and receiving channel number.
与上述至少一个实施例的处理方法相对应地,本申请实施例还提供一种终端设备400,可称为第三设备,参考图16,其包括:Corresponding to the processing method of the above at least one embodiment, an embodiment of the present application further provides a terminal device 400, which may be referred to as a third device. Referring to FIG. 16, the terminal device 400 includes:
第一发送模块401,用于向第四设备发送第一BLE请求信息;The first sending module 401 is configured to send the first BLE request information to the fourth device;
第一接收模块402,用于接收第四设备发送的第一BLE回应信息,所述第一BLE回应信息中包括第一CTE信号;The first receiving module 402 is configured to receive the first BLE response information sent by the fourth device, where the first BLE response information includes the first CTE signal;
第一记录模块403,用于记录所述第一CTE信号的第一接收时间戳;a first recording module 403, configured to record the first reception timestamp of the first CTE signal;
其中,所述第一接收时间戳用于计算所述第三设备与所述第四设备之间的距离。Wherein, the first received timestamp is used to calculate the distance between the third device and the fourth device.
与上述至少一个实施例的处理方法相对应地,本申请实施例还提供一种终端设备500,可称为第四设备,参考图17,其包括:Corresponding to the processing method of the above at least one embodiment, an embodiment of the present application further provides a terminal device 500, which may be referred to as a fourth device. Referring to FIG. 17, the terminal device 500 includes:
第一接收模块501,用于接收第三设备发送的第一BLE请求信息;The first receiving module 501 is configured to receive the first BLE request information sent by the third device;
第一发送模块502,用于向所述第三设备发送第一BLE回应信息,所述第一BLE回应信息中包括第一CTE信号;a first sending module 502, configured to send first BLE response information to the third device, where the first BLE response information includes a first CTE signal;
第一记录模块503,用于记录所述第一CTE信号的第一发送时间戳;a first recording module 503, configured to record the first transmission time stamp of the first CTE signal;
其中,所述第一发送时间戳用于计算所述第三设备与所述第四设备之间的距离。Wherein, the first sending timestamp is used to calculate the distance between the third device and the fourth device.
本申请实施例的终端设备100、200、400和500以及电子设备300能够实现前述的方法实施例中的终端设备和服务器的对应功能,其中的各个模块(子模块、单元或组件等)对应的流程、功能、实现方式以及有益效果,可参见上述方法实施例中的对应描述,此处不进行赘述。The terminal devices 100 , 200 , 400 and 500 and the electronic device 300 in the embodiments of the present application can implement the corresponding functions of the terminal device and the server in the foregoing method embodiments, and each module (submodule, unit or component, etc.) corresponds to For the processes, functions, implementations, and beneficial effects, reference may be made to the corresponding descriptions in the foregoing method embodiments, which will not be repeated here.
需要说明,关于本申请实施例的终端设备100、200、400和500以及电子设备300中的各个模块(子模块、单元或组件等)所描述的功能,可以由不同的模块(子模块、单元或组件等)实现,也可以由同一个模块(子模块、单元或组件等)实现,举例来说,第一发送模块与第二发送模块可以是不同的模块,也可以是同一个模块,均能够实现本申请实施例的终端设备的相应功能。It should be noted that the functions described by the terminal devices 100 , 200 , 400 , and 500 and the various modules (submodules, units, or components, etc.) in the electronic device 300 in the embodiments of the present application may be described by different modules (submodules, units, etc.). or components, etc.), or can be implemented by the same module (sub-module, unit or component, etc.), for example, the first sending module and the second sending module may be different modules, or the same module, both Corresponding functions of the terminal device in the embodiments of the present application can be implemented.
图18是根据本申请实施例的通信设备600示意性结构图,其中通信设备600包括处理器610,处理器610可以从存储器中调用并运行计算机程序,以实现本申请实施例中的方法。18 is a schematic structural diagram of a communication device 600 according to an embodiment of the present application, wherein the communication device 600 includes a processor 610, and the processor 610 can call and run a computer program from a memory to implement the method in the embodiment of the present application.
可选地,通信设备600还可以包括存储器620。其中,处理器610可以从存储器620中调用并运行计算机程序,以实现本申请实施例中的方法。Optionally, the communication device 600 may also include a memory 620 . The processor 610 may call and run a computer program from the memory 620 to implement the methods in the embodiments of the present application.
其中,存储器620可以是独立于处理器610的一个单独的器件,也可以集成在处理器610中。The memory 620 may be a separate device independent of the processor 610 , or may be integrated in the processor 610 .
可选地,通信设备600还可以包括收发器630,处理器610可以控制该收发器630与其他设备进行通信,具体地,可以向其他设备发送信息或数据,或接收其他设备发送的信息或数据。Optionally, the communication device 600 may further include a transceiver 630, and the processor 610 may control the transceiver 630 to communicate with other devices, specifically, may send information or data to other devices, or receive information or data sent by other devices .
其中,收发器630可以包括发射机和接收机。收发器630还可以进一步包括天线,天线的数量可以为一个或多个。Among them, the transceiver 630 may include a transmitter and a receiver. The transceiver 630 may further include antennas, and the number of the antennas may be one or more.
可选地,该通信设备600可为本申请实施例的终端设备,如图13-14、16-17中任一种终端设备,并且该通信设备600可以实现本申请实施例的各个方法中由终端设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the communication device 600 may be a terminal device of an embodiment of the present application, such as any one of the terminal devices shown in FIGS. 13-14 and 16-17 , and the communication device 600 may implement the following For the sake of brevity, the corresponding process implemented by the terminal device will not be repeated here.
图19是根据本申请实施例的芯片700的示意性结构图,其中芯片700包括处理器710,处理器710可以从存储器中调用并运行计算机程序,以实现本申请实施例中的方法。19 is a schematic structural diagram of a chip 700 according to an embodiment of the present application, wherein the chip 700 includes a processor 710, and the processor 710 can call and run a computer program from a memory to implement the method in the embodiment of the present application.
可选地,芯片700还可以包括存储器720。其中,处理器710可以从存储器720中调用并运行计算机程序,以实现本申请实施例中的方法。Optionally, the chip 700 may further include a memory 720 . The processor 710 may call and run a computer program from the memory 720 to implement the methods in the embodiments of the present application.
其中,存储器720可以是独立于处理器710的一个单独的器件,也可以集成在处理器710中。The memory 720 may be a separate device independent of the processor 710 , or may be integrated in the processor 710 .
可选地,该芯片700还可以包括输入接口730。其中,处理器710可以控制该输入接口730与其他设备或芯片进行通信,具体地,可以获取其他设备或芯片发送的信息或数据。Optionally, the chip 700 may further include an input interface 730 . The processor 710 may control the input interface 730 to communicate with other devices or chips, and specifically, may acquire information or data sent by other devices or chips.
可选地,该芯片700还可以包括输出接口740。其中,处理器710可以控制该输出接口740与其他设备或芯片进行通信,具体地,可以向其他设备或芯片输出信息或数据。Optionally, the chip 700 may further include an output interface 740 . The processor 710 can control the output interface 740 to communicate with other devices or chips, and specifically, can output information or data to other devices or chips.
可选地,该芯片可应用于本申请实施例中的终端设备,如图13-14、16-17中任一种终端设备,并且该芯片可以实现本申请实施例的各个方法中由终端设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the chip can be applied to the terminal device in the embodiments of the present application, such as any one of the terminal devices shown in FIGS. 13-14 and 16-17 , and the chip can implement the various methods in the embodiments of the present application by the terminal device. For the sake of brevity, the corresponding process of implementation will not be repeated here.
应理解,本申请实施例提到的芯片还可以称为系统级芯片,系统芯片,芯片系统或片上系统芯片等。It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, a system-on-chip, a system-on-chip, or a system-on-a-chip, or the like.
上述提及的处理器可以是通用处理器、数字信号处理器(digital signal processor,DSP)、现成可编程门阵列(field programmable gate array,FPGA)、专用集成电路(application specific integrated circuit,ASIC)或者其他可编程逻辑器件、晶体管逻辑器件、分立硬件组件等。其中,上述提到的通用处理器可以是微处理器或者也可以是任何常规的处理器等。The processor mentioned above may be a general-purpose processor, a digital signal processor (DSP), a field programmable gate array (FPGA), an application specific integrated circuit (ASIC) or Other programmable logic devices, transistor logic devices, discrete hardware components, etc. The general-purpose processor mentioned above may be a microprocessor or any conventional processor or the like.
上述提及的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非 易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM)。The memory mentioned above may be either volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically programmable Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory. Volatile memory may be random access memory (RAM).
应理解,上述存储器为示例性但不是限制性说明,例如,本申请实施例中的存储器还可以是静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synch link DRAM,SLDRAM)以及直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)等等。也就是说,本申请实施例中的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It should be understood that the above memory is an example but not a limitative description, for example, the memory in the embodiment of the present application may also be a static random access memory (static RAM, SRAM), a dynamic random access memory (dynamic RAM, DRAM), Synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection Dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM) and so on. That is, the memory in the embodiments of the present application is intended to include but not limited to these and any other suitable types of memory.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。该计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,该计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(Digital Subscriber Line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。该计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device. The computer instructions may be stored on or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted over a wire from a website site, computer, server or data center (eg coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (eg infrared, wireless, microwave, etc.) means to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media integrated. The available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk (SSD)), among others.
应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that, in various embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be dealt with in the embodiments of the present application. implementation constitutes any limitation.
所属技术领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described systems, devices and units can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
应理解,本文中术语“和/或”用来描述关联对象的关联关系,例如表示前后关联对象可存在三种关系,举例说明,A和/或B,可以表示:单独存在A、同时存在A和B、单独存在B这三种情况。本文中字符“/”一般表示前后关联对象是“或”的关系。It should be understood that the term "and/or" herein is used to describe the association relationship of associated objects, for example, it means that there can be three relationships between the associated objects before and after, for example, A and/or B can mean: A alone exists, A exists at the same time and B, and B alone exists in these three cases. The character "/" in this document generally indicates that the related objects are "or".
以上所述仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以该权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art who is familiar with the technical scope disclosed in the present application can easily think of changes or substitutions. Covered within the scope of protection of this application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (92)

  1. 一种用于测距的方法,应用于第一设备,包括:A method for ranging, applied to a first device, comprising:
    第一设备发送第一低功耗蓝牙BLE广播信息,所述第一BLE广播信息中包括第一固定频率扩展CTE信号;所述第一设备记录所述第一CTE信号的第一发送时间戳;The first device sends first low-power Bluetooth BLE broadcast information, where the first BLE broadcast information includes a first fixed-frequency extended CTE signal; the first device records a first transmission timestamp of the first CTE signal;
    所述第一设备接收第二设备发送的第二BLE广播信息,所述第二BLE广播信息中包括第二CTE信号;所述第一设备记录所述第二CTE信号的第二接收时间戳;The first device receives second BLE broadcast information sent by the second device, where the second BLE broadcast information includes a second CTE signal; the first device records a second reception timestamp of the second CTE signal;
    其中,所述第一发送时间戳和所述第二接收时间戳用于计算所述第一设备与所述第二设备之间的距离。The first sending timestamp and the second receiving timestamp are used to calculate the distance between the first device and the second device.
  2. 根据权利要求1所述的方法,其中,所述第一设备的工作模式包括广播模式和搜索模式,两种工作模式的默认切换时长为第一时长;The method according to claim 1, wherein the working mode of the first device includes a broadcast mode and a search mode, and the default switching duration of the two working modes is the first duration;
    其中,所述第一设备在广播模式下发送所述第一BLE广播信息,所述第一设备在广播模式下持续所述第一时长后切换为搜索模式;Wherein, the first device sends the first BLE broadcast information in the broadcast mode, and the first device switches to the search mode after continuing in the broadcast mode for the first duration;
    所述第一设备从广播模式切换为搜索模式之后,开始搜索所述第二设备发送的第二BLE广播信息,如果在所述第一时长之内所述第一设备接收到所述第二设备发送的第二BLE广播信息,则直接切换为广播模式;如果在所述第一时长之内所述第一设备未接收到所述第二设备发送的第二BLE广播信息,则在到达所述第一时长时切换为广播模式。After the first device switches from the broadcast mode to the search mode, it starts to search for the second BLE broadcast information sent by the second device, if the first device receives the second device within the first time period The second BLE broadcast information sent by the second device is directly switched to the broadcast mode; if the first device does not receive the second BLE broadcast information sent by the second device within the first time Switch to broadcast mode for the first time.
  3. 根据权利要求2所述的方法,还包括:The method of claim 2, further comprising:
    所述第一设备从搜索模式切换为广播模式之后,向所述第二设备发送第三BLE广播信息,所述第三BLE广播信息中包括第三CTE信号;所述第一设备记录所述第三CTE信号的第三发送时间戳;After the first device switches from the search mode to the broadcast mode, it sends third BLE broadcast information to the second device, where the third BLE broadcast information includes a third CTE signal; the first device records the third BLE broadcast information. The third transmission timestamp of the three CTE signals;
    所述第一设备从广播模式切换为搜索模式之后,接收第二设备发送的第四BLE广播信息,所述第四BLE广播信息中包括第四CTE信号;所述第一设备记录所述第四CTE信号的第四接收时间戳;After the first device switches from the broadcast mode to the search mode, it receives fourth BLE broadcast information sent by the second device, where the fourth BLE broadcast information includes a fourth CTE signal; the first device records the fourth BLE broadcast information. the fourth received timestamp of the CTE signal;
    其中,所述第三发送时间戳和所述第四接收时间戳用于计算所述第一设备与所述第二设备之间的距离。Wherein, the third sending timestamp and the fourth receiving timestamp are used to calculate the distance between the first device and the second device.
  4. 根据权利要求1至3中任一项所述的方法,还包括:The method of any one of claims 1 to 3, further comprising:
    所述第一设备还记录发送的各个BLE广播信息中的CTE信号的发送信道号。The first device further records the sending channel number of the CTE signal in each sent BLE broadcast information.
  5. 根据权利要求1至4中任一项所述的方法,其中,The method according to any one of claims 1 to 4, wherein,
    各个BLE广播信息中还包括标识ID,所述标识ID用于标识对应的BLE广播信息。Each BLE broadcast information further includes an identification ID, where the identification ID is used to identify the corresponding BLE broadcast information.
  6. 根据权利要求1至5中任一项所述的方法,其中,The method according to any one of claims 1 to 5, wherein,
    各个BLE广播信息中设置有接收标识ID字段、接收时间戳字段和接收信道字段;其中,Each BLE broadcast information is provided with a receiving identification ID field, a receiving timestamp field and a receiving channel field; wherein,
    所述接收标识ID字段表示接收到的BLE广播信息的标识ID;The receiving identification ID field represents the identification ID of the received BLE broadcast information;
    所述接收时间戳字段表示接收到BLE广播信息中的CTE信号时的接收时间戳;The reception timestamp field represents the reception timestamp when the CTE signal in the BLE broadcast information is received;
    所述接收信道字段表示接收到的BLE广播信息中的CTE信号的接收信道号。The receiving channel field indicates the receiving channel number of the CTE signal in the received BLE broadcast information.
  7. 根据权利要求6所述的方法,还包括:The method of claim 6, further comprising:
    所述第一设备在发送所述第三BLE广播信息时,将所述第二BLE广播信息的标识ID、接收时间戳和接收信道号分别添加至所述第三BLE广播信息中的接收标识ID字段、接收时间戳字段和接收信道字段中。When sending the third BLE broadcast information, the first device adds the identification ID, the receiving timestamp and the receiving channel number of the second BLE broadcast information to the receiving identification ID in the third BLE broadcast information, respectively field, receive timestamp field, and receive channel field.
  8. 根据权利要求1至6中任一项所述的方法,还包括:The method of any one of claims 1 to 6, further comprising:
    所述第一设备获取所述第一CTE信号的第一接收时间戳、接收信道号和所述第一BLE广播信息的标识ID,The first device obtains the first reception timestamp of the first CTE signal, the reception channel number, and the identification ID of the first BLE broadcast information,
    所述第一设备获取所述第三CTE信号的第三接收时间戳、接收信道号和所述第三BLE广播信息的标识ID;obtaining, by the first device, a third reception timestamp, a reception channel number, and an identification ID of the third BLE broadcast information of the third CTE signal;
    其中,所述第一接收时间戳是所述第二设备接收到所述第一CTE信号时的时间戳,所述第三接收时间戳是所述第二设备接收到所述第三CTE信号时的时间戳,所述第一接收时间戳和所述第三接收时间戳用于计算所述第一设备与所述第二设备之间的距离。The first reception time stamp is a time stamp when the second device receives the first CTE signal, and the third reception time stamp is when the second device receives the third CTE signal The first receiving timestamp and the third receiving timestamp are used to calculate the distance between the first device and the second device.
  9. 根据权利要求8所述的方法,其中,The method of claim 8, wherein,
    所述第一CTE信号的第一接收时间戳、接收信道号和所述第一BLE广播信息的标识ID携带在所述第二BLE广播信息中,所述第三CTE信号的第三接收时间戳、接收信道号和所述第三BLE广播信息的标识ID携带在所述第四BLE广播信息中;The first reception timestamp, reception channel number, and identification ID of the first BLE broadcast information of the first CTE signal are carried in the second BLE broadcast information, and the third reception timestamp of the third CTE signal , the receiving channel number and the identification ID of the third BLE broadcast information are carried in the fourth BLE broadcast information;
    或者,or,
    所述第一CTE信号的第一接收时间戳、接收信道号和所述第一BLE广播信息的标识ID,以及,所述第三CTE信号的第三接收时间戳、接收信道号和所述第三BLE广播信息的标识ID由所述第二设备在发送所述第四BLE广播信息之后,发送给所述第一设备。The first reception timestamp, the reception channel number, and the identification ID of the first BLE broadcast information of the first CTE signal, and the third reception timestamp, reception channel number, and the third CTE signal of the third CTE signal. The identification ID of the third BLE broadcast information is sent by the second device to the first device after sending the fourth BLE broadcast information.
  10. 根据权利要求1至9中任一项所述的方法,还包括:The method of any one of claims 1 to 9, further comprising:
    所述第一设备将所述第二CTE信号的第二接收时间戳、接收信道号和所述第二BLE广播信息的标识ID发送给所述第二设备,The first device sends the second receiving time stamp of the second CTE signal, the receiving channel number and the identification ID of the second BLE broadcast information to the second device,
    所述第一设备将所述第四CTE信号的第四接收时间戳、接收信道号和所述第四BLE广播信息的标识ID发送给所述第二设备,The first device sends the fourth reception timestamp of the fourth CTE signal, the reception channel number, and the identification ID of the fourth BLE broadcast information to the second device,
    其中,所述第二接收时间戳是所述第一设备接收到所述第二CTE信号时的时间戳,所述第四接收时间戳是所述第一设备接收到所述第四CTE信号时的时间戳,所述第二接收时间戳和所述第四接收时间戳用于计算所述第一设备与所述第二设备之间的距离。Wherein, the second reception time stamp is a time stamp when the first device receives the second CTE signal, and the fourth reception time stamp is when the first device receives the fourth CTE signal The second receiving timestamp and the fourth receiving timestamp are used to calculate the distance between the first device and the second device.
  11. 根据权利要求10所述的方法,其中,The method of claim 10, wherein,
    所述第二CTE信号的第二接收时间戳、接收信道号和所述第二BLE广播信息的标识ID携带在所述第三BLE广播信息中,所述第四CTE信号的第四接收时间戳、接收信道号和所述第四BLE广播信息的标识ID携带在第五 BLE广播信息中;The second reception timestamp of the second CTE signal, the reception channel number, and the identification ID of the second BLE broadcast information are carried in the third BLE broadcast information, and the fourth reception timestamp of the fourth CTE signal , the receiving channel number and the identification ID of the fourth BLE broadcast information are carried in the fifth BLE broadcast information;
    或者,or,
    所述第二CTE信号的第二接收时间戳、接收信道号和所述第二BLE广播信息的标识ID,以及,所述第四CTE信号的第四接收时间戳、接收信道号和所述第四BLE广播信息的标识ID由所述第一设备在向所述第二设备发送第五BLE广播信息之后,发送给所述第二设备。The second reception timestamp, the reception channel number, and the identification ID of the second BLE broadcast information of the second CTE signal, and the fourth reception timestamp, reception channel number, and the fourth CTE signal of the fourth CTE signal. The identification ID of the four BLE broadcast information is sent to the second device by the first device after sending the fifth BLE broadcast information to the second device.
  12. 根据权利要求1至11中任一项所述的方法,其中,The method of any one of claims 1 to 11, wherein,
    所述第一设备获取所述第二CTE信号的第二发送时间戳以及所述第四CTE信号的第四发送时间戳。The first device acquires a second transmission timestamp of the second CTE signal and a fourth transmission timestamp of the fourth CTE signal.
  13. 根据权利要求1至12中任一项所述的方法,其中,The method of any one of claims 1 to 12, wherein,
    所述第一设备将所述第一CTE信号的第一发送时间戳以及所述第三CTE信号的第三发送时间戳发送给所述第二设备。The first device sends the first transmission timestamp of the first CTE signal and the third transmission timestamp of the third CTE signal to the second device.
  14. 根据权利要求1至13中任一项所述的方法,其中,The method of any one of claims 1 to 13, wherein,
    在计算所述第一设备与所述第二设备之间的距离时,基于标识ID相对应且发送信道号和接收信道号相同的发送时间戳与接收时间戳的差值进行计算。When calculating the distance between the first device and the second device, the calculation is performed based on the difference between the sending timestamp and the receiving timestamp corresponding to the ID and having the same sending channel number and receiving channel number.
  15. 根据权利要求1至14中任一项所述的方法,其中,The method of any one of claims 1 to 14, wherein,
    在所述第一发送时间戳、第二发送时间戳、所述第三发送时间戳、第四发送时间戳、所述第一接收时间戳、所述第二接收时间戳、所述第三接收时间戳和所述第四接收时间戳中,如果不存在发送信道号和接收信道号相同的发送时间戳与接收时间戳,则根据发送信道号与接收信道号的差值,以及相邻广播信道之间的时间间隔,调整发送时间戳的值。At the first transmission time stamp, the second transmission time stamp, the third transmission time stamp, the fourth transmission time stamp, the first reception time stamp, the second reception time stamp, the third reception time stamp In the timestamp and the fourth receiving timestamp, if there is no sending timestamp and receiving timestamp with the same sending channel number and receiving channel number, according to the difference between the sending channel number and the receiving channel number, and the adjacent broadcast channel The time interval between, adjust the value of the send timestamp.
  16. 一种用于测距的方法,应用于第二设备,包括:A method for ranging, applied to a second device, comprising:
    第二设备接收第一设备发送的第一BLE广播信息,所述第一BLE广播信息中包括第一CTE信号;所述第二设备记录所述第一CTE信号的第一接收时间戳;The second device receives the first BLE broadcast information sent by the first device, where the first BLE broadcast information includes the first CTE signal; the second device records the first reception timestamp of the first CTE signal;
    所述第二设备向所述第一设备发送第二BLE广播信息,所述第二BLE广播信息中包括第二CTE信号;所述第二设备记录所述第二CTE信号的第二发送时间戳;The second device sends second BLE broadcast information to the first device, where the second BLE broadcast information includes a second CTE signal; the second device records a second sending timestamp of the second CTE signal ;
    其中,所述第一接收时间戳和所述第二发送时间戳用于计算所述第一设备与所述第二设备之间的距离。The first receiving timestamp and the second sending timestamp are used to calculate the distance between the first device and the second device.
  17. 根据权利要求16所述的方法,其中,所述第二设备的工作模式包括广播模式和搜索模式,两种工作模式的默认切换时长为第一时长;The method according to claim 16, wherein the working mode of the second device includes a broadcast mode and a search mode, and the default switching duration of the two working modes is the first duration;
    其中,所述第一设备在广播模式下发送所述第一BLE广播信息,所述第一设备在广播模式下持续所述第一时长后切换为搜索模式;Wherein, the first device sends the first BLE broadcast information in the broadcast mode, and the first device switches to the search mode after continuing in the broadcast mode for the first duration;
    所述第一设备从广播模式切换为搜索模式之后,开始搜索所述第二设备发送的第二BLE广播信息,如果在所述第一时长之内所述第一设备接收到所述第二设备发送的第二BLE广播信息,则直接切换为广播模式;如果在所述第一时长之内所述第一设备未接收到所述第二设备发送的第二BLE广播信息,则在到达所述第一时长时切换为广播模式。After the first device switches from the broadcast mode to the search mode, it starts to search for the second BLE broadcast information sent by the second device, if the first device receives the second device within the first time period The second BLE broadcast information sent by the second device is directly switched to the broadcast mode; if the first device does not receive the second BLE broadcast information sent by the second device within the first time Switch to broadcast mode for the first time.
  18. 根据权利要求17所述的方法,还包括:The method of claim 17, further comprising:
    所述第二设备在搜索模式下接收所述第一设备发送的第三BLE广播信息,所述第三BLE广播信息中包括第三CTE信号;所述第二设备记录所述第三CTE信号的第三接收时间戳;The second device receives third BLE broadcast information sent by the first device in the search mode, where the third BLE broadcast information includes a third CTE signal; the second device records the third CTE signal. the third receive timestamp;
    所述第二设备从搜索模式切换为广播模式之后,向所述第一设备发送第四BLE广播信息,所述第四BLE广播信息中包括第四CTE信号;所述第二设备记录所述第四CTE信号的第四发送时间戳;After the second device switches from the search mode to the broadcast mode, it sends fourth BLE broadcast information to the first device, where the fourth BLE broadcast information includes a fourth CTE signal; the second device records the first BLE broadcast information. The fourth transmission timestamp of the four-CTE signal;
    其中,所述第三接收时间戳和所述第四发送时间戳用于计算所述第一设备与所述第二设备之间的距离。Wherein, the third receiving timestamp and the fourth sending timestamp are used to calculate the distance between the first device and the second device.
  19. 根据权利要求16至18中任一项所述的方法,还包括:The method of any one of claims 16 to 18, further comprising:
    所述第二设备还记录发送的各个BLE广播信息中的CTE信号的发送信道号。The second device further records the sending channel number of the CTE signal in each sent BLE broadcast information.
  20. 根据权利要求16至19中任一项所述的方法,其中,The method of any one of claims 16 to 19, wherein,
    各个BLE广播信息中还包括标识ID,所述标识ID用于标识对应的BLE广播信息。Each BLE broadcast information further includes an identification ID, where the identification ID is used to identify the corresponding BLE broadcast information.
  21. 根据权利要求16至20中任一项所述的方法,其中,The method of any one of claims 16 to 20, wherein,
    各个BLE广播信息中设置有接收标识ID字段、接收时间戳字段和接收信道字段;其中,Each BLE broadcast information is provided with a receiving identification ID field, a receiving timestamp field and a receiving channel field; wherein,
    所述接收标识ID字段表示接收到的BLE广播信息的标识ID;The receiving identification ID field represents the identification ID of the received BLE broadcast information;
    所述接收时间戳字段表示接收到BLE广播信息中的CTE信号时的接收时间戳;The reception timestamp field represents the reception timestamp when the CTE signal in the BLE broadcast information is received;
    所述接收信道字段表示接收到的BLE广播信息中的CTE信号的接收信道号。The receiving channel field indicates the receiving channel number of the CTE signal in the received BLE broadcast information.
  22. 根据权利要求21所述的方法,还包括:The method of claim 21, further comprising:
    所述第二设备在发送所述第二BLE广播信息时,将所述第一BLE广播信息的标识ID、接收时间戳和接收信道号分别添加在所述第二BLE广播信息中的接收标识ID字段、接收时间戳字段和接收信道字段中。When sending the second BLE broadcast information, the second device adds the identification ID, the receiving timestamp and the receiving channel number of the first BLE broadcast information to the receiving identification ID in the second BLE broadcast information, respectively field, receive timestamp field, and receive channel field.
  23. 根据权利要求16至22中任一项所述的方法,还包括:The method of any one of claims 16 to 22, further comprising:
    所述第二设备将所述第一CTE信号的第一接收时间戳、接收信道号和所述第一BLE广播信息的标识ID发送给所述第一设备,The second device sends the first receiving timestamp, the receiving channel number and the identification ID of the first BLE broadcast information of the first CTE signal to the first device,
    所述第二设备将所述第三CTE信号的第三接收时间戳、接收信道号和所述第三BLE广播信息的标识ID发送给所述第一设备,The second device sends the third reception timestamp of the third CTE signal, the reception channel number, and the identification ID of the third BLE broadcast information to the first device,
    其中,所述第一接收时间戳是所述第二设备接收到所述第一CTE信号时的时间戳,所述第三接收时间戳是所述第二设备接收到所述第三CTE信号时的时间戳,所述第一接收时间戳和所述第三接收时间戳用于计算所述第一设备与所述第二设备之间的距离。The first reception time stamp is a time stamp when the second device receives the first CTE signal, and the third reception time stamp is when the second device receives the third CTE signal The first receiving timestamp and the third receiving timestamp are used to calculate the distance between the first device and the second device.
  24. 根据权利要求23所述的方法,其中,The method of claim 23, wherein,
    所述第一CTE信号的第一接收时间戳、接收信道号和所述第一BLE广播信息的标识ID携带在所述第二BLE广播信息中,所述第三CTE信号的第三接收时间戳、接收信道号和所述第三BLE广播信息的标识ID携带在所述第四BLE广播信息中;The first reception timestamp, reception channel number, and identification ID of the first BLE broadcast information of the first CTE signal are carried in the second BLE broadcast information, and the third reception timestamp of the third CTE signal , the receiving channel number and the identification ID of the third BLE broadcast information are carried in the fourth BLE broadcast information;
    或者,or,
    所述第一CTE信号的第一接收时间戳、接收信道号和所述第一BLE广播信息的标识ID,以及,所述第三CTE信号的第三接收时间戳、接收信道号和所述第三BLE广播信息的标识ID由所述第二设备在发送所述第四BLE广播信息之后,发送给所述第一设备。The first reception time stamp, reception channel number, and the ID of the first BLE broadcast information of the first CTE signal, and the third reception time stamp, reception channel number, and the third CTE signal of the third CTE signal. The identification ID of the third BLE broadcast information is sent by the second device to the first device after sending the fourth BLE broadcast information.
  25. 根据权利要求16至24中任一项所述的方法,还包括:The method of any one of claims 16 to 24, further comprising:
    所述第二设备获取所述第二CTE信号的第二接收时间戳、接收信道号和所述第二BLE广播信息的标识ID,The second device acquires the second reception timestamp, the reception channel number and the identification ID of the second BLE broadcast information of the second CTE signal,
    所述第二设备获取所述第四CTE信号的第四接收时间戳、接收信道号和所述第四BLE广播信息的标识ID,The second device obtains the fourth reception timestamp of the fourth CTE signal, the reception channel number, and the identification ID of the fourth BLE broadcast information,
    其中,所述第二接收时间戳是所述第一设备接收到所述第二CTE信号时的时间戳,所述第四接收时间戳是所述第一设备接收到所述第四CTE信号时的时间戳,所述第二接收时间戳和所述第四接收时间戳用于计算所述第一设备与所述第二设备之间的距离。Wherein, the second reception time stamp is a time stamp when the first device receives the second CTE signal, and the fourth reception time stamp is when the first device receives the fourth CTE signal The second receiving timestamp and the fourth receiving timestamp are used to calculate the distance between the first device and the second device.
  26. 根据权利要求25所述的方法,其中,The method of claim 25, wherein,
    所述第二CTE信号的第二接收时间戳、接收信道号和所述第二BLE广播信息的标识ID携带在所述第三BLE广播信息中,所述第四CTE信号的第四接收时间戳、接收信道号和所述第四BLE广播信息的标识ID携带在第五BLE广播信息中;The second reception timestamp of the second CTE signal, the reception channel number, and the identification ID of the second BLE broadcast information are carried in the third BLE broadcast information, and the fourth reception timestamp of the fourth CTE signal , the receiving channel number and the identification ID of the fourth BLE broadcast information are carried in the fifth BLE broadcast information;
    或者,or,
    所述第二CTE信号的第二接收时间戳、接收信道号和所述第二BLE广播信息的标识ID,以及,所述第四CTE信号的第四接收时间戳、接收信道号和所述第四BLE广播信息的标识ID由所述第一设备在向所述第二设备发送第五BLE广播信息之后,发送给所述第二设备。The second reception timestamp, the reception channel number, and the identification ID of the second BLE broadcast information of the second CTE signal, and the fourth reception timestamp, reception channel number, and the fourth CTE signal of the fourth CTE signal. The identification ID of the four BLE broadcast information is sent to the second device by the first device after sending the fifth BLE broadcast information to the second device.
  27. 根据权利要求16至26所述的方法,其中,A method according to claims 16 to 26, wherein,
    所述第二设备获取所述第一CTE信号的第一发送时间戳以及所述第三CTE信号的第三发送时间戳。The second device acquires a first transmission timestamp of the first CTE signal and a third transmission timestamp of the third CTE signal.
  28. 根据权利要求16至27所述的方法,其中,A method according to claims 16 to 27, wherein,
    所述第二设备将所述第二CTE信号的第二发送时间戳以及所述第四CTE信号的第四发送时间戳发送给所述第一设备。The second device sends the second transmission timestamp of the second CTE signal and the fourth transmission timestamp of the fourth CTE signal to the first device.
  29. 根据权利要求16至28所述的方法,其中,A method according to claims 16 to 28, wherein,
    在计算所述第一设备与所述第二设备之间的距离时,基于标识ID相对应且发送信道号和接收信道号相同的发送时间戳与接收时间戳的差值进行计算。When calculating the distance between the first device and the second device, the calculation is performed based on the difference between the sending timestamp and the receiving timestamp corresponding to the ID and having the same sending channel number and receiving channel number.
  30. 根据权利要求16至29所述的方法,其中,A method according to claims 16 to 29, wherein,
    在所述第一发送时间戳、第二发送时间戳、所述第三发送时间戳、第四发送时间戳、所述第一接收时间戳、所述第二接收时间戳、所述第三接收时间戳和所述第四接收时间戳中,如果不存在发送信道号和接收信道号相同的发送时间戳与接收时间戳,则根据发送信道号与接收信道号的差值,以及相邻广播信道之间的时间间隔,调整发送时间戳的值。At the first transmission time stamp, the second transmission time stamp, the third transmission time stamp, the fourth transmission time stamp, the first reception time stamp, the second reception time stamp, the third reception time stamp In the timestamp and the fourth receiving timestamp, if there is no sending timestamp and receiving timestamp with the same sending channel number and receiving channel number, according to the difference between the sending channel number and the receiving channel number, and the adjacent broadcast channel The time interval between, adjust the value of the send timestamp.
  31. 一种用于测距的方法,所述方法基于如权利要求1至30中任一项所述的方法,所述用于测距的方法包括:A method for ranging, the method based on the method of any one of claims 1 to 30, the method for ranging comprising:
    接收第一设备和第二设备发送的第一发送时间戳、第二发送时间戳、第三发送时间戳、第四发送时间戳、第一接收时间戳、第二接收时间戳、第三接收时间戳和第四接收时间戳,以及与各个时间戳对应的标识ID、发送信道号和接收信道号;Receive the first sending timestamp, the second sending timestamp, the third sending timestamp, the fourth sending timestamp, the first receiving timestamp, the second receiving timestamp, and the third receiving time sent by the first device and the second device stamp and the fourth receiving time stamp, and the identification ID, sending channel number and receiving channel number corresponding to each time stamp;
    基于标识ID相对应且发送信道号和接收信道号相同的发送时间戳与接收时间戳的差值,计算所述第一设备与所述第二设备之间的距离。The distance between the first device and the second device is calculated based on the difference between the sending timestamp and the receiving timestamp corresponding to the ID and having the same sending channel number and receiving channel number.
  32. 一种用于测距的方法,应用于第三设备,包括:A method for ranging, applied to a third device, comprising:
    第三设备向第四设备发送第一低功耗蓝牙BLE请求信息;The third device sends the first Bluetooth low energy BLE request information to the fourth device;
    所述第三设备接收第四设备发送的第一BLE回应信息,所述第一BLE回应信息中包括第一CTE信号;所述第三设备记录所述第一CTE信号的第一接收时间戳;The third device receives the first BLE response information sent by the fourth device, where the first BLE response information includes the first CTE signal; the third device records the first reception timestamp of the first CTE signal;
    其中,所述第一接收时间戳用于计算所述第三设备与所述第四设备之间的距离。Wherein, the first received timestamp is used to calculate the distance between the third device and the fourth device.
  33. 根据权利要求32所述的方法,还包括:The method of claim 32, further comprising:
    所述第三设备接收第四设备发送的第二BLE请求信息;The third device receives the second BLE request information sent by the fourth device;
    所述第三设备向所述第四设备发送第二BLE回应信息,所述第二BLE回应信息中包括第二CTE信号;所述第三设备记录所述第二CTE信号的第二发送时间戳;The third device sends second BLE response information to the fourth device, where the second BLE response information includes a second CTE signal; the third device records a second sending timestamp of the second CTE signal ;
    其中,所述第二发送时间戳用于计算所述第三设备与所述第四设备之间的距离。Wherein, the second sending timestamp is used to calculate the distance between the third device and the fourth device.
  34. 根据权利要求32或33所述的方法,其中,A method according to claim 32 or 33, wherein,
    各个BLE请求信息中包括时间戳字段,表示接收到的上一个CTE信号的发送时间戳。Each BLE request message includes a timestamp field, which indicates the sending timestamp of the last received CTE signal.
  35. 根据权利要求32至34中任一项所述的方法,其中,The method of any one of claims 32 to 34, wherein,
    各个BLE回应信息中包括时间戳字段,表示发送的上一个CTE信号的接收时间戳。Each BLE response message includes a timestamp field, which indicates the reception timestamp of the last CTE signal sent.
  36. 根据权利要求32至34中任一项所述的方法,还包括:The method of any one of claims 32 to 34, further comprising:
    在所述第三设备向所述第四设备发送第二BLE回应信息之前,所述第三设备将所述第一接收时间戳添加至所述第二BLE回应信息中。Before the third device sends the second BLE response information to the fourth device, the third device adds the first reception timestamp to the second BLE response information.
  37. 根据权利要求32至36中任一项所述的方法,其中,The method of any one of claims 32 to 36, wherein,
    在计算所述第三设备与所述第四设备之间的距离时,基于对应的发送时间戳与接收时间戳的差值进行计算。When calculating the distance between the third device and the fourth device, the calculation is performed based on the difference between the corresponding sending timestamp and the receiving timestamp.
  38. 一种用于测距的方法,应用于第四设备,包括:A method for ranging, applied to a fourth device, comprising:
    第四设备接收第三设备发送的第一BLE请求信息;The fourth device receives the first BLE request information sent by the third device;
    所述第四设备向所述第三设备发送第一BLE回应信息,所述第一BLE回应信息中包括第一CTE信号;所述第四设备记录所述第一CTE信号的第一发送时间戳;The fourth device sends first BLE response information to the third device, where the first BLE response information includes the first CTE signal; the fourth device records the first sending timestamp of the first CTE signal ;
    其中,所述第一发送时间戳用于计算所述第三设备与所述第四设备之间的距离。Wherein, the first sending timestamp is used to calculate the distance between the third device and the fourth device.
  39. 根据权利要求32所述的方法,还包括:The method of claim 32, further comprising:
    所述第四设备向所述第三设备发送第二BLE请求信息;sending, by the fourth device, second BLE request information to the third device;
    所述第四设备接收所述第三设备发送的第二BLE回应信息,所述第二BLE回应信息中包括第二CTE信号;所述第四设备记录所述第二CTE信号的第二接收时间戳;The fourth device receives the second BLE response information sent by the third device, where the second BLE response information includes a second CTE signal; the fourth device records the second reception time of the second CTE signal stamp;
    其中,所述第二接收时间戳用于计算所述第三设备与所述第四设备之间的距离。Wherein, the second received timestamp is used to calculate the distance between the third device and the fourth device.
  40. 根据权利要求32或33所述的方法,其中,A method according to claim 32 or 33, wherein,
    各个BLE请求信息中包括时间戳字段,表示接收到的上一个CTE信号的发送时间戳。Each BLE request message includes a timestamp field, which indicates the sending timestamp of the last received CTE signal.
  41. 根据权利要求32至34中任一项所述的方法,其中,The method of any one of claims 32 to 34, wherein,
    各个BLE回应信息中包括时间戳字段,表示发送的上一个CTE信号的接收时间戳。Each BLE response message includes a timestamp field, which indicates the reception timestamp of the last CTE signal sent.
  42. 根据权利要求32至34中任一项所述的方法,还包括:The method of any one of claims 32 to 34, further comprising:
    在所述第四设备向所述第三设备发送第二BLE请求信息之前,所述第四设备将所述第一发送时间戳添加至所述第二BLE请求信息中。Before the fourth device sends the second BLE request information to the third device, the fourth device adds the first transmission timestamp to the second BLE request information.
  43. 根据权利要求16至28所述的方法,其中,A method according to claims 16 to 28, wherein,
    在计算所述第三设备与所述第四设备之间的距离时,基于对应的发送时间戳与接收时间戳的差值进行计算。When calculating the distance between the third device and the fourth device, the calculation is performed based on the difference between the corresponding sending timestamp and the receiving timestamp.
  44. 一种终端设备,所述终端设备为第一设备,其包括:A terminal device, the terminal device is a first device, comprising:
    第一发送模块,用于发送第一低功耗蓝牙BLE广播信息,所述第一BLE广播信息中包括第一固定频率扩展CTE信号;a first sending module, configured to send first low-power Bluetooth BLE broadcast information, where the first BLE broadcast information includes a first fixed frequency extended CTE signal;
    第一记录模块,用于记录所述第一CTE信号的第一发送时间戳;a first recording module, configured to record the first transmission time stamp of the first CTE signal;
    第一接收模块,用于接收第二设备发送的第二BLE广播信息,所述第二BLE广播信息中包括第二CTE信号;a first receiving module, configured to receive second BLE broadcast information sent by a second device, where the second BLE broadcast information includes a second CTE signal;
    第二记录模块,用于记录所述第二CTE信号的第二接收时间戳;a second recording module, configured to record the second reception timestamp of the second CTE signal;
    其中,所述第一发送时间戳和所述第二接收时间戳用于计算所述第一设备与所述第二设备之间的距离。The first sending timestamp and the second receiving timestamp are used to calculate the distance between the first device and the second device.
  45. 根据权利要求44所述的终端设备,其中,所述第一设备的工作模式包括广播模式和搜索模式,两种工作模式的默认切换时长为第一时长;The terminal device according to claim 44, wherein the working mode of the first device includes a broadcast mode and a search mode, and the default switching duration of the two working modes is the first duration;
    所述第一设备还包括:The first device also includes:
    切换模块,用于使所述第一设备在广播模式下发送所述第一BLE广播信息,所述第一设备在广播模式下持续所述第一时长后切换为搜索模式;a switching module, configured to enable the first device to send the first BLE broadcast information in the broadcast mode, and the first device to switch to the search mode after the broadcast mode continues for the first duration;
    所述第一设备从广播模式切换为搜索模式之后,开始搜索所述第二设备发送的第二BLE广播信息,如果在所述第一时长之内所述第一设备接收到所述第二设备发送的第二BLE广播信息,则直接切换为广播模式;如果在所述第一时长之内所述第一设备未接收到所述第二设备发送的第二BLE广播信息,则在到达所述第一时长时切换为广播模式。After the first device switches from the broadcast mode to the search mode, it starts to search for the second BLE broadcast information sent by the second device, if the first device receives the second device within the first time period The second BLE broadcast information sent by the second device is directly switched to the broadcast mode; if the first device does not receive the second BLE broadcast information sent by the second device within the first time Switch to broadcast mode for the first time.
  46. 根据权利要求45所述的终端设备,还包括:The terminal device of claim 45, further comprising:
    第二发送模块,用于从搜索模式切换为广播模式之后,向所述第二设备发送第三BLE广播信息,所述第三BLE广播信息中包括第三CTE信号;a second sending module, configured to send third BLE broadcast information to the second device after switching from the search mode to the broadcast mode, where the third BLE broadcast information includes a third CTE signal;
    第三记录模块,用于记录所述第三CTE信号的第三发送时间戳;a third recording module, configured to record the third transmission timestamp of the third CTE signal;
    第二接收模块,用于从广播模式切换为搜索模式之后,接收第二设备发送的第四BLE广播信息,所述第四BLE广播信息中包括第四CTE信号;The second receiving module is configured to receive fourth BLE broadcast information sent by the second device after switching from the broadcast mode to the search mode, where the fourth BLE broadcast information includes a fourth CTE signal;
    第四记录模块,记录所述第四CTE信号的第四接收时间戳;a fourth recording module, recording the fourth received timestamp of the fourth CTE signal;
    其中,所述第三发送时间戳和所述第四接收时间戳用于计算所述第一设备与所述第二设备之间的距离。Wherein, the third sending timestamp and the fourth receiving timestamp are used to calculate the distance between the first device and the second device.
  47. 根据权利要求44至46中任一项所述的终端设备,还包括:The terminal device according to any one of claims 44 to 46, further comprising:
    第五记录模块,用于记录发送的各个BLE广播信息中的CTE信号的发送信道号。The fifth recording module is used to record the sending channel number of the CTE signal in each sent BLE broadcast information.
  48. 根据权利要求44至47中任一项所述的终端设备,其中,The terminal device according to any one of claims 44 to 47, wherein,
    各个BLE广播信息中还包括标识ID,所述标识ID用于标识对应的BLE广播信息。Each BLE broadcast information further includes an identification ID, where the identification ID is used to identify the corresponding BLE broadcast information.
  49. 根据权利要求44至48中任一项所述的终端设备,其中,The terminal device according to any one of claims 44 to 48, wherein,
    各个BLE广播信息中设置有接收标识ID字段、接收时间戳字段和接收信道字段;其中,Each BLE broadcast information is provided with a receiving identification ID field, a receiving timestamp field and a receiving channel field; wherein,
    所述接收标识ID字段表示接收到的BLE广播信息的标识ID;The receiving identification ID field represents the identification ID of the received BLE broadcast information;
    所述接收时间戳字段表示接收到BLE广播信息中的CTE信号时的接收时间戳;The reception timestamp field represents the reception timestamp when the CTE signal in the BLE broadcast information is received;
    所述接收信道字段表示接收到的BLE广播信息中的CTE信号的接收信道号。The receiving channel field indicates the receiving channel number of the CTE signal in the received BLE broadcast information.
  50. 根据权利要求49所述的终端设备,还包括:The terminal device of claim 49, further comprising:
    添加模块,用于在所述第一设备发送所述第三BLE广播信息时,将所述第二BLE广播信息的标识ID、接收时间戳和接收信道号分别添加至所述第三BLE广播信息中的接收标识ID字段、接收时间戳字段和接收信道字段中。The adding module is configured to add the identification ID, receiving timestamp and receiving channel number of the second BLE broadcast information to the third BLE broadcast information respectively when the first device sends the third BLE broadcast information in the Receive Identification ID field, the Receive Timestamp field, and the Receive Channel field.
  51. 根据权利要求44至49中任一项所述的终端设备,还包括:The terminal device according to any one of claims 44 to 49, further comprising:
    第一获取模块,用于获取所述第一CTE信号的第一接收时间戳、接收信道号和所述第一BLE广播信息的标识ID,a first acquisition module, configured to acquire the first reception timestamp of the first CTE signal, the reception channel number and the identification ID of the first BLE broadcast information,
    第二获取模块,用于获取所述第三CTE信号的第三接收时间戳、接收信道号和所述第三BLE广播信息的标识 ID;a second acquisition module, configured to acquire the third reception timestamp, the reception channel number and the identification ID of the third BLE broadcast information of the third CTE signal;
    其中,所述第一接收时间戳是所述第二设备接收到所述第一CTE信号时的时间戳,所述第三接收时间戳是所述第二设备接收到所述第三CTE信号时的时间戳,所述第一接收时间戳和所述第三接收时间戳用于计算所述第一设备与所述第二设备之间的距离。The first reception time stamp is a time stamp when the second device receives the first CTE signal, and the third reception time stamp is when the second device receives the third CTE signal The first receiving timestamp and the third receiving timestamp are used to calculate the distance between the first device and the second device.
  52. 根据权利要求51所述的终端设备,其中,The terminal device of claim 51, wherein,
    所述第一CTE信号的第一接收时间戳、接收信道号和所述第一BLE广播信息的标识ID携带在所述第二BLE广播信息中,所述第三CTE信号的第三接收时间戳、接收信道号和所述第三BLE广播信息的标识ID携带在所述第四BLE广播信息中;The first reception timestamp, reception channel number, and identification ID of the first BLE broadcast information of the first CTE signal are carried in the second BLE broadcast information, and the third reception timestamp of the third CTE signal , the receiving channel number and the identification ID of the third BLE broadcast information are carried in the fourth BLE broadcast information;
    或者,or,
    所述第一CTE信号的第一接收时间戳、接收信道号和所述第一BLE广播信息的标识ID,以及,所述第三CTE信号的第三接收时间戳、接收信道号和所述第三BLE广播信息的标识ID由所述第二设备在发送所述第四BLE广播信息之后,发送给所述第一设备。The first reception timestamp, the reception channel number, and the identification ID of the first BLE broadcast information of the first CTE signal, and the third reception timestamp, reception channel number, and the third CTE signal of the third CTE signal. The identification ID of the third BLE broadcast information is sent by the second device to the first device after sending the fourth BLE broadcast information.
  53. 根据权利要求44至52中任一项所述的终端设备,还包括:The terminal device according to any one of claims 44 to 52, further comprising:
    第三发送模块,用于将所述第二CTE信号的第二接收时间戳、接收信道号和所述第二BLE广播信息的标识ID发送给所述第二设备,a third sending module, configured to send the second receiving timestamp of the second CTE signal, the receiving channel number and the identification ID of the second BLE broadcast information to the second device,
    第四发送模块,用于将所述第四CTE信号的第四接收时间戳、接收信道号和所述第四BLE广播信息的标识ID发送给所述第二设备,a fourth sending module, configured to send the fourth receiving timestamp of the fourth CTE signal, the receiving channel number and the identification ID of the fourth BLE broadcast information to the second device,
    其中,所述第二接收时间戳是所述第一设备接收到所述第二CTE信号时的时间戳,所述第四接收时间戳是所述第一设备接收到所述第四CTE信号时的时间戳,所述第二接收时间戳和所述第四接收时间戳用于计算所述第一设备与所述第二设备之间的距离。Wherein, the second reception time stamp is a time stamp when the first device receives the second CTE signal, and the fourth reception time stamp is when the first device receives the fourth CTE signal The second receiving timestamp and the fourth receiving timestamp are used to calculate the distance between the first device and the second device.
  54. 根据权利要求53所述的终端设备,其中,The terminal device of claim 53, wherein,
    所述第二CTE信号的第二接收时间戳、接收信道号和所述第二BLE广播信息的标识ID携带在所述第三BLE广播信息中,所述第四CTE信号的第四接收时间戳、接收信道号和所述第四BLE广播信息的标识ID携带在第五BLE广播信息中;The second reception timestamp of the second CTE signal, the reception channel number, and the identification ID of the second BLE broadcast information are carried in the third BLE broadcast information, and the fourth reception timestamp of the fourth CTE signal , the receiving channel number and the identification ID of the fourth BLE broadcast information are carried in the fifth BLE broadcast information;
    或者,or,
    所述第二CTE信号的第二接收时间戳、接收信道号和所述第二BLE广播信息的标识ID,以及,所述第四CTE信号的第四接收时间戳、接收信道号和所述第四BLE广播信息的标识ID由所述第一设备在向所述第二设备发送第五BLE广播信息之后,发送给所述第二设备。The second reception timestamp, the reception channel number, and the identification ID of the second BLE broadcast information of the second CTE signal, and the fourth reception timestamp, reception channel number, and the fourth CTE signal of the fourth CTE signal. The identification ID of the four BLE broadcast information is sent to the second device by the first device after sending the fifth BLE broadcast information to the second device.
  55. 根据权利要求44至54中任一项所述的终端设备,其中,The terminal device according to any one of claims 44 to 54, wherein,
    第三获取模块,用于获取所述第二CTE信号的第二发送时间戳以及所述第四CTE信号的第四发送时间戳。A third acquiring module, configured to acquire the second transmission timestamp of the second CTE signal and the fourth transmission timestamp of the fourth CTE signal.
  56. 根据权利要求44至55中任一项所述的终端设备,其中,The terminal device according to any one of claims 44 to 55, wherein,
    第三发送模块,用于将所述第一CTE信号的第一发送时间戳以及所述第三CTE信号的第三发送时间戳发送给所述第二设备。A third sending module, configured to send the first sending timestamp of the first CTE signal and the third sending timestamp of the third CTE signal to the second device.
  57. 根据权利要求44至56中任一项所述的终端设备,其中,The terminal device according to any one of claims 44 to 56, wherein,
    计算模块,用于在计算所述第一设备与所述第二设备之间的距离时,基于标识ID相对应且发送信道号和接收信道号相同的发送时间戳与接收时间戳的差值进行计算。The calculation module is used for calculating the distance between the first device and the second device based on the difference between the sending timestamp and the receiving timestamp corresponding to the ID and the sending channel number and the receiving channel number are the same. calculate.
  58. 根据权利要求44至57中任一项所述的终端设备,其中,The terminal device according to any one of claims 44 to 57, wherein,
    调整模块,用于在所述第一发送时间戳、第二发送时间戳、所述第三发送时间戳、第四发送时间戳、所述第一接收时间戳、所述第二接收时间戳、所述第三接收时间戳和所述第四接收时间戳中不存在发送信道号和接收信道号相同的发送时间戳与接收时间戳的情况下,根据发送信道号与接收信道号的差值,以及相邻广播信道之间的时间间隔,调整发送时间戳的值。an adjustment module, configured to set the first sending time stamp, the second sending time stamp, the third sending time stamp, the fourth sending time stamp, the first receiving time stamp, the second receiving time stamp, In the third receiving time stamp and the fourth receiving time stamp, when there is no sending time stamp and receiving time stamp with the same sending channel number and receiving channel number, according to the difference between the sending channel number and the receiving channel number, As well as the time interval between adjacent broadcast channels, adjust the value of the send timestamp.
  59. 一种终端设备,所述终端设备为第二设备,其包括:A terminal device, the terminal device is a second device, comprising:
    第一接收模块,用于接收第一设备发送的第一BLE广播信息,所述第一BLE广播信息中包括第一CTE信号;a first receiving module, configured to receive first BLE broadcast information sent by a first device, where the first BLE broadcast information includes a first CTE signal;
    第一记录模块,用于记录所述第一CTE信号的第一接收时间戳;a first recording module, configured to record the first reception timestamp of the first CTE signal;
    第一发送模块,用于向所述第一设备发送第二BLE广播信息,所述第二BLE广播信息中包括第二CTE信号;a first sending module, configured to send second BLE broadcast information to the first device, where the second BLE broadcast information includes a second CTE signal;
    第二记录模块,用于记录所述第二CTE信号的第二发送时间戳;a second recording module, configured to record the second transmission time stamp of the second CTE signal;
    其中,所述第一接收时间戳和所述第二发送时间戳用于计算所述第一设备与所述第二设备之间的距离。The first receiving timestamp and the second sending timestamp are used to calculate the distance between the first device and the second device.
  60. 根据权利要求59所述的终端设备,其中,所述第二设备的工作模式包括广播模式和搜索模式,两种工作模式的默认切换时长为第一时长;The terminal device according to claim 59, wherein the working modes of the second device include a broadcast mode and a search mode, and the default switching duration of the two working modes is the first duration;
    所述终端设备还包括:The terminal equipment also includes:
    切换模块,用于使所述第一设备在广播模式下发送所述第一BLE广播信息,所述第一设备在广播模式下持续所述第一时长后切换为搜索模式;a switching module, configured to enable the first device to send the first BLE broadcast information in the broadcast mode, and the first device to switch to the search mode after the broadcast mode continues for the first duration;
    所述第一设备从广播模式切换为搜索模式之后,开始搜索所述第二设备发送的第二BLE广播信息,如果在所述第一时长之内所述第一设备接收到所述第二设备发送的第二BLE广播信息,则直接切换为广播模式;如果在所述第一时长之内所述第一设备未接收到所述第二设备发送的第二BLE广播信息,则在到达所述第一时长时切换为广播模式。After the first device switches from the broadcast mode to the search mode, it starts to search for the second BLE broadcast information sent by the second device, if the first device receives the second device within the first time period The second BLE broadcast information sent by the second device is directly switched to the broadcast mode; if the first device does not receive the second BLE broadcast information sent by the second device within the first time Switch to broadcast mode for the first time.
  61. 根据权利要求60所述的终端设备,还包括:The terminal device according to claim 60, further comprising:
    第二接收模块,用于在搜索模式下接收所述第一设备发送的第三BLE广播信息,所述第三BLE广播信息中包括第三CTE信号;a second receiving module, configured to receive third BLE broadcast information sent by the first device in a search mode, where the third BLE broadcast information includes a third CTE signal;
    第三记录模块,用于记录所述第三CTE信号的第三接收时间戳;a third recording module, configured to record the third received timestamp of the third CTE signal;
    第二发送模块,用于从搜索模式切换为广播模式之后,向所述第一设备发送第四BLE广播信息,所述第四BLE广播信息中包括第四CTE信号;a second sending module, configured to send fourth BLE broadcast information to the first device after switching from the search mode to the broadcast mode, where the fourth BLE broadcast information includes a fourth CTE signal;
    第四记录模块,用于记录所述第四CTE信号的第四发送时间戳;a fourth recording module, configured to record the fourth transmission time stamp of the fourth CTE signal;
    其中,所述第三接收时间戳和所述第四发送时间戳用于计算所述第一设备与所述第二设备之间的距离。Wherein, the third receiving timestamp and the fourth sending timestamp are used to calculate the distance between the first device and the second device.
  62. 根据权利要求59至61中任一项所述的终端设备,还包括:The terminal device according to any one of claims 59 to 61, further comprising:
    第五记录模块,用于记录发送的各个BLE广播信息中的CTE信号的发送信道号。The fifth recording module is used to record the sending channel number of the CTE signal in each sent BLE broadcast information.
  63. 根据权利要求59至62中任一项所述的终端设备,其中,The terminal device according to any one of claims 59 to 62, wherein,
    各个BLE广播信息中还包括标识ID,所述标识ID用于标识对应的BLE广播信息。Each BLE broadcast information further includes an identification ID, where the identification ID is used to identify the corresponding BLE broadcast information.
  64. 根据权利要求59至63中任一项所述的终端设备,其中,The terminal device according to any one of claims 59 to 63, wherein,
    各个BLE广播信息中设置有接收标识ID字段、接收时间戳字段和接收信道字段;其中,Each BLE broadcast information is provided with a receiving identification ID field, a receiving timestamp field and a receiving channel field; wherein,
    所述接收标识ID字段表示接收到的BLE广播信息的标识ID;The receiving identification ID field represents the identification ID of the received BLE broadcast information;
    所述接收时间戳字段表示接收到BLE广播信息中的CTE信号时的接收时间戳;The reception timestamp field represents the reception timestamp when the CTE signal in the BLE broadcast information is received;
    所述接收信道字段表示接收到的BLE广播信息中的CTE信号的接收信道号。The receiving channel field indicates the receiving channel number of the CTE signal in the received BLE broadcast information.
  65. 根据权利要求64所述的终端设备,还包括:The terminal device of claim 64, further comprising:
    添加模块,用于在发送所述第二BLE广播信息时,将所述第一BLE广播信息的标识ID、接收时间戳和接收信道号分别添加在所述第二BLE广播信息中的接收标识ID字段、接收时间戳字段和接收信道字段中。The adding module is configured to add the identification ID, the receiving timestamp and the receiving channel number of the first BLE broadcasting information to the receiving identification ID in the second BLE broadcasting information respectively when sending the second BLE broadcasting information field, receive timestamp field, and receive channel field.
  66. 根据权利要求59至65中任一项所述的终端设备,还包括:The terminal device according to any one of claims 59 to 65, further comprising:
    第三发送模块,用于将所述第一CTE信号的第一接收时间戳、接收信道号和所述第一BLE广播信息的标识ID发送给所述第一设备,a third sending module, configured to send the first receiving timestamp of the first CTE signal, the receiving channel number and the identification ID of the first BLE broadcast information to the first device,
    第四发送模块,用于将所述第三CTE信号的第三接收时间戳、接收信道号和所述第三BLE广播信息的标识ID发送给所述第一设备,a fourth sending module, configured to send the third receiving timestamp of the third CTE signal, the receiving channel number and the identification ID of the third BLE broadcast information to the first device,
    其中,所述第一接收时间戳是所述第二设备接收到所述第一CTE信号时的时间戳,所述第三接收时间戳是所述第二设备接收到所述第三CTE信号时的时间戳,所述第一接收时间戳和所述第三接收时间戳用于计算所述第一设备与所述第二设备之间的距离。The first reception time stamp is a time stamp when the second device receives the first CTE signal, and the third reception time stamp is when the second device receives the third CTE signal The first receiving timestamp and the third receiving timestamp are used to calculate the distance between the first device and the second device.
  67. 根据权利要求66所述的终端设备,其中,The terminal device of claim 66, wherein,
    所述第一CTE信号的第一接收时间戳、接收信道号和所述第一BLE广播信息的标识ID携带在所述第二BLE广播信息中,所述第三CTE信号的第三接收时间戳、接收信道号和所述第三BLE广播信息的标识ID携带在所述第四BLE广播信息中;The first reception timestamp, reception channel number, and identification ID of the first BLE broadcast information of the first CTE signal are carried in the second BLE broadcast information, and the third reception timestamp of the third CTE signal , the receiving channel number and the identification ID of the third BLE broadcast information are carried in the fourth BLE broadcast information;
    或者,or,
    所述第一CTE信号的第一接收时间戳、接收信道号和所述第一BLE广播信息的标识ID,以及,所述第三CTE信号的第三接收时间戳、接收信道号和所述第三BLE广播信息的标识ID由所述第二设备在发送所述第四BLE广播信息之后,发送给所述第一设备。The first reception timestamp, the reception channel number, and the identification ID of the first BLE broadcast information of the first CTE signal, and the third reception timestamp, reception channel number, and the third CTE signal of the third CTE signal. The identification ID of the third BLE broadcast information is sent by the second device to the first device after sending the fourth BLE broadcast information.
  68. 根据权利要求59至67中任一项所述的终端设备,还包括:The terminal device according to any one of claims 59 to 67, further comprising:
    第一获取模块,用于获取所述第二CTE信号的第二接收时间戳、接收信道号和所述第二BLE广播信息的标识ID,a first acquisition module, configured to acquire the second reception timestamp, the reception channel number and the identification ID of the second BLE broadcast information of the second CTE signal,
    第二获取模块,用于获取所述第四CTE信号的第四接收时间戳、接收信道号和所述第四BLE广播信息的标识ID,a second obtaining module, configured to obtain the fourth receiving timestamp, the receiving channel number and the identification ID of the fourth BLE broadcast information of the fourth CTE signal,
    其中,所述第二接收时间戳是所述第一设备接收到所述第二CTE信号时的时间戳,所述第四接收时间戳是所述第一设备接收到所述第四CTE信号时的时间戳,所述第二接收时间戳和所述第四接收时间戳用于计算所述第一设备与所述第二设备之间的距离。Wherein, the second reception time stamp is a time stamp when the first device receives the second CTE signal, and the fourth reception time stamp is when the first device receives the fourth CTE signal The second receiving timestamp and the fourth receiving timestamp are used to calculate the distance between the first device and the second device.
  69. 根据权利要求68所述的终端设备,其中,The terminal device of claim 68, wherein,
    所述第二CTE信号的第二接收时间戳、接收信道号和所述第二BLE广播信息的标识ID携带在所述第三BLE广播信息中,所述第四CTE信号的第四接收时间戳、接收信道号和所述第四BLE广播信息的标识ID携带在第五BLE广播信息中;The second reception timestamp of the second CTE signal, the reception channel number, and the identification ID of the second BLE broadcast information are carried in the third BLE broadcast information, and the fourth reception timestamp of the fourth CTE signal , the receiving channel number and the identification ID of the fourth BLE broadcast information are carried in the fifth BLE broadcast information;
    或者,or,
    所述第二CTE信号的第二接收时间戳、接收信道号和所述第二BLE广播信息的标识ID,以及,所述第四CTE信号的第四接收时间戳、接收信道号和所述第四BLE广播信息的标识ID由所述第一设备在向所述第二设备发送第五BLE广播信息之后,发送给所述第二设备。The second reception timestamp, the reception channel number, and the identification ID of the second BLE broadcast information of the second CTE signal, and the fourth reception timestamp, reception channel number, and the fourth CTE signal of the fourth CTE signal. The identification ID of the four BLE broadcast information is sent to the second device by the first device after sending the fifth BLE broadcast information to the second device.
  70. 根据权利要求59至69所述的终端设备,其中,The terminal device according to claims 59 to 69, wherein,
    第三获取模块,用于获取所述第一CTE信号的第一发送时间戳以及所述第三CTE信号的第三发送时间戳。A third acquiring module, configured to acquire a first transmission timestamp of the first CTE signal and a third transmission timestamp of the third CTE signal.
  71. 根据权利要求59至70所述的终端设备,其中,The terminal device according to claims 59 to 70, wherein,
    第五发送模块,用于将所述第二CTE信号的第二发送时间戳以及所述第四CTE信号的第四发送时间戳发送给所述第一设备。A fifth sending module, configured to send the second sending timestamp of the second CTE signal and the fourth sending timestamp of the fourth CTE signal to the first device.
  72. 根据权利要求59至71所述的终端设备,其中,The terminal device according to claims 59 to 71, wherein,
    计算模块,用于在计算所述第一设备与所述第二设备之间的距离时,基于标识ID相对应且发送信道号和接收信道号相同的发送时间戳与接收时间戳的差值进行计算。The calculation module is used for calculating the distance between the first device and the second device based on the difference between the sending timestamp and the receiving timestamp corresponding to the ID and the sending channel number and the receiving channel number are the same. calculate.
  73. 根据权利要求59至72所述的终端设备,其中,A terminal device according to claims 59 to 72, wherein,
    调整模块,用于在所述第一发送时间戳、第二发送时间戳、所述第三发送时间戳、第四发送时间戳、所述第一 接收时间戳、所述第二接收时间戳、所述第三接收时间戳和所述第四接收时间戳中不存在发送信道号和接收信道号相同的发送时间戳与接收时间戳的情况下,根据发送信道号与接收信道号的差值,以及相邻广播信道之间的时间间隔,调整发送时间戳的值。an adjustment module, configured to set the first sending time stamp, the second sending time stamp, the third sending time stamp, the fourth sending time stamp, the first receiving time stamp, the second receiving time stamp, In the third receiving timestamp and the fourth receiving timestamp, when there is no sending timestamp and receiving timestamp with the same sending channel number and receiving channel number, according to the difference between the sending channel number and the receiving channel number, As well as the time interval between adjacent broadcast channels, adjust the value of the send timestamp.
  74. 一种电子设备,其基于如权利要求1至30中任一项所述的方法,所述电子设备包括:An electronic device based on the method according to any one of claims 1 to 30, the electronic device comprising:
    接收模块,用于接收第一设备和第二设备发送的第一发送时间戳、第二发送时间戳、第三发送时间戳、第四发送时间戳、第一接收时间戳、第二接收时间戳、第三接收时间戳和第四接收时间戳,以及与各个时间戳对应的标识ID、发送信道号和接收信道号;A receiving module, configured to receive the first sending timestamp, the second sending timestamp, the third sending timestamp, the fourth sending timestamp, the first receiving timestamp, and the second receiving timestamp sent by the first device and the second device , the third receiving time stamp and the fourth receiving time stamp, and the identification ID, the sending channel number and the receiving channel number corresponding to each time stamp;
    计算模块,用于基于标识ID相对应且发送信道号和接收信道号相同的发送时间戳与接收时间戳的差值,计算所述第一设备与所述第二设备之间的距离。A calculation module, configured to calculate the distance between the first device and the second device based on the difference between the sending timestamp and the receiving timestamp corresponding to the ID and having the same sending channel number and receiving channel number.
  75. 一种终端设备,所述终端设备为第三设备,其包括:A terminal device, the terminal device is a third device, comprising:
    第一发送模块,用于向第四设备发送第一低功耗蓝牙BLE请求信息;a first sending module, configured to send the first low-power bluetooth BLE request information to the fourth device;
    第一接收模块,用于接收第四设备发送的第一BLE回应信息,所述第一BLE回应信息中包括第一CTE信号;a first receiving module, configured to receive the first BLE response information sent by the fourth device, where the first BLE response information includes the first CTE signal;
    第一记录模块,用于记录所述第一CTE信号的第一接收时间戳;a first recording module, configured to record the first reception timestamp of the first CTE signal;
    其中,所述第一接收时间戳用于计算所述第三设备与所述第四设备之间的距离。Wherein, the first received timestamp is used to calculate the distance between the third device and the fourth device.
  76. 根据权利要求75所述的终端设备,还包括:The terminal device of claim 75, further comprising:
    第二接收模块,用于接收第四设备发送的第二BLE请求信息;a second receiving module, configured to receive the second BLE request information sent by the fourth device;
    第二发送模块,用于向所述第四设备发送第二BLE回应信息,所述第二BLE回应信息中包括第二CTE信号;a second sending module, configured to send second BLE response information to the fourth device, where the second BLE response information includes a second CTE signal;
    第二记录模块,用于记录所述第二CTE信号的第二发送时间戳;a second recording module, configured to record the second transmission time stamp of the second CTE signal;
    其中,所述第二发送时间戳用于计算所述第三设备与所述第四设备之间的距离。Wherein, the second sending timestamp is used to calculate the distance between the third device and the fourth device.
  77. 根据权利要求75或76所述的终端设备,其中,The terminal device according to claim 75 or 76, wherein,
    各个BLE请求信息中包括时间戳字段,表示接收到的上一个CTE信号的发送时间戳。Each BLE request message includes a timestamp field, which indicates the sending timestamp of the last received CTE signal.
  78. 根据权利要求75至77中任一项所述的终端设备,其中,The terminal device according to any one of claims 75 to 77, wherein,
    各个BLE回应信息中包括时间戳字段,表示发送的上一个CTE信号的接收时间戳。Each BLE response message includes a timestamp field, which indicates the reception timestamp of the last CTE signal sent.
  79. 根据权利要求75至78中任一项所述的终端设备,还包括:The terminal device according to any one of claims 75 to 78, further comprising:
    添加模块,用于在所述第三设备向所述第四设备发送第二BLE回应信息之前,将所述第一接收时间戳添加至所述第二BLE回应信息中。An adding module is configured to add the first reception timestamp to the second BLE response information before the third device sends the second BLE response information to the fourth device.
  80. 根据权利要求75至79中任一项所述的终端设备,其中,The terminal device according to any one of claims 75 to 79, wherein,
    计算模块,用于在计算所述第三设备与所述第四设备之间的距离时,基于对应的发送时间戳与接收时间戳的差值进行计算。The calculation module is configured to perform calculation based on the difference between the corresponding sending timestamp and the receiving timestamp when calculating the distance between the third device and the fourth device.
  81. 一种终端设备,所述终端设备为第四设备,其包括:A terminal device, the terminal device is a fourth device, comprising:
    第一接收模块,用于接收第三设备发送的第一BLE请求信息;a first receiving module, configured to receive the first BLE request information sent by the third device;
    第一发送模块,用于向所述第三设备发送第一BLE回应信息,所述第一BLE回应信息中包括第一CTE信号;a first sending module, configured to send first BLE response information to the third device, where the first BLE response information includes a first CTE signal;
    第一记录模块,用于记录所述第一CTE信号的第一发送时间戳;a first recording module, configured to record the first transmission time stamp of the first CTE signal;
    其中,所述第一发送时间戳用于计算所述第三设备与所述第四设备之间的距离。Wherein, the first sending timestamp is used to calculate the distance between the third device and the fourth device.
  82. 根据权利要求81所述的终端设备,还包括:The terminal device of claim 81, further comprising:
    第二发送模块,用于向所述第三设备发送第二BLE请求信息;a second sending module, configured to send second BLE request information to the third device;
    第二接收模块,用于接收所述第三设备发送的第二BLE回应信息,所述第二BLE回应信息中包括第二CTE信号;a second receiving module, configured to receive second BLE response information sent by the third device, where the second BLE response information includes a second CTE signal;
    第二记录模块,用于记录所述第二CTE信号的第二接收时间戳;a second recording module, configured to record the second reception timestamp of the second CTE signal;
    其中,所述第二接收时间戳用于计算所述第三设备与所述第四设备之间的距离。Wherein, the second received timestamp is used to calculate the distance between the third device and the fourth device.
  83. 根据权利要求81或82所述的终端设备,其中,The terminal device according to claim 81 or 82, wherein,
    各个BLE请求信息中包括时间戳字段,表示接收到的上一个CTE信号的发送时间戳。Each BLE request message includes a timestamp field, which indicates the sending timestamp of the last received CTE signal.
  84. 根据权利要求81至83中任一项所述的终端设备,其中,The terminal device according to any one of claims 81 to 83, wherein,
    各个BLE回应信息中包括时间戳字段,表示发送的上一个CTE信号的接收时间戳。Each BLE response message includes a timestamp field, which indicates the reception timestamp of the last CTE signal sent.
  85. 根据权利要求81至84中任一项所述的终端设备,还包括:The terminal device according to any one of claims 81 to 84, further comprising:
    添加模块,用于在所述第四设备向所述第三设备发送第二BLE请求信息之前,将所述第一发送时间戳添加至所述第二BLE请求信息中。An adding module is configured to add the first sending timestamp to the second BLE request information before the fourth device sends the second BLE request information to the third device.
  86. 根据权利要求81至85所述的终端设备,其中,The terminal device according to claims 81 to 85, wherein,
    计算模块,用于在计算所述第三设备与所述第四设备之间的距离时,基于对应的发送时间戳与接收时间戳的差值进行计算。The calculation module is configured to perform calculation based on the difference between the corresponding sending timestamp and the receiving timestamp when calculating the distance between the third device and the fourth device.
  87. 一种终端设备,包括:处理器和存储器,所述存储器用于存储计算机程序,所述处理器调用并运行所述存储器中存储的计算机程序,执行如权利要求1至30以及32至43中任一项所述的用于测距的方法的步骤。A terminal device, comprising: a processor and a memory, the memory is used to store a computer program, the processor calls and runs the computer program stored in the memory, and executes any one of claims 1 to 30 and 32 to 43. A step of the method for ranging.
  88. 一种电子设备,包括:处理器和存储器,所述存储器用于存储计算机程序,所述处理器调用并运行所述存储器中存储的计算机程序,执行如权利要求31所述的用于测距的方法的步骤。An electronic device, comprising: a processor and a memory, the memory is used to store a computer program, the processor calls and runs the computer program stored in the memory, and executes the method for ranging according to claim 31. steps of the method.
  89. 一种芯片,包括:A chip that includes:
    处理器,用于从存储器中调用并运行计算机程序,使得安装有所述芯片的设备执行如权利要求1至30以及32至43中任一项所述的用于测距的方法的步骤。A processor for invoking and running a computer program from the memory to cause the device on which the chip is installed to perform the steps of the method for ranging as claimed in any one of claims 1 to 30 and 32 to 43.
  90. 一种计算机可读存储介质,用于存储计算机程序,其中,A computer-readable storage medium for storing a computer program, wherein,
    所述计算机程序使得计算机执行如权利要求1至30以及32至43中任一项所述的用于测距的方法的步骤。The computer program causes a computer to perform the steps of the method for ranging as claimed in any one of claims 1 to 30 and 32 to 43.
  91. 一种计算机程序产品,包括计算机程序指令,其中,A computer program product comprising computer program instructions, wherein,
    所述计算机程序指令使得计算机执行如权利要求1至30以及32至43中任一项所述的用于测距的方法的步骤。The computer program instructions cause a computer to perform the steps of the method for ranging as claimed in any one of claims 1 to 30 and 32 to 43.
  92. 一种计算机程序,所述计算机程序使得计算机执行如权利要求1至30以及32至43中任一项所述的用于测距的方法的步骤。A computer program that causes a computer to perform the steps of the method for ranging as claimed in any one of claims 1 to 30 and 32 to 43.
PCT/CN2020/099601 2020-06-30 2020-06-30 Method for ranging and terminal device WO2022000354A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080100198.4A CN115443665A (en) 2020-06-30 2020-06-30 Method and terminal device for ranging
PCT/CN2020/099601 WO2022000354A1 (en) 2020-06-30 2020-06-30 Method for ranging and terminal device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/099601 WO2022000354A1 (en) 2020-06-30 2020-06-30 Method for ranging and terminal device

Publications (1)

Publication Number Publication Date
WO2022000354A1 true WO2022000354A1 (en) 2022-01-06

Family

ID=79317748

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/099601 WO2022000354A1 (en) 2020-06-30 2020-06-30 Method for ranging and terminal device

Country Status (2)

Country Link
CN (1) CN115443665A (en)
WO (1) WO2022000354A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114222247A (en) * 2022-01-28 2022-03-22 Oppo广东移动通信有限公司 UWB ranging method, device, terminal equipment and storage medium
CN114646952A (en) * 2022-03-15 2022-06-21 Oppo广东移动通信有限公司 Distance acquisition method, device, system, storage medium and electronic equipment
WO2023225962A1 (en) * 2022-05-26 2023-11-30 华为技术有限公司 Distance measurement method and related apparatus

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103596276A (en) * 2013-11-22 2014-02-19 浪潮电子信息产业股份有限公司 Wireless network channel distribution strategy based on channel interval
US20140335885A1 (en) * 2013-05-10 2014-11-13 Itai Steiner Initiator-conditioned fine timing measurement service request
CN104620127A (en) * 2012-09-11 2015-05-13 高通股份有限公司 Method for precise location determination
CN107209261A (en) * 2015-02-17 2017-09-26 高通股份有限公司 The method and system of ranging protocol
CN107409290A (en) * 2015-03-16 2017-11-28 高通股份有限公司 For the adaptive triggering of the RTT rangings of positional accuracy enhanced
CN109196840A (en) * 2016-06-12 2019-01-11 苹果公司 Modification safe condition is detected by safe range
CN109257725A (en) * 2017-07-14 2019-01-22 硅实验室公司 For adaptive scanning and/or the system and method for broadcast
CN109975758A (en) * 2019-02-20 2019-07-05 苏州普息导航技术有限公司 Wi-Fi blue tooth integrated base station location system
CN111165000A (en) * 2017-10-06 2020-05-15 赛普拉斯半导体公司 Distance estimation and authentication for bluetooth systems and devices

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104620127A (en) * 2012-09-11 2015-05-13 高通股份有限公司 Method for precise location determination
US20140335885A1 (en) * 2013-05-10 2014-11-13 Itai Steiner Initiator-conditioned fine timing measurement service request
CN103596276A (en) * 2013-11-22 2014-02-19 浪潮电子信息产业股份有限公司 Wireless network channel distribution strategy based on channel interval
CN107209261A (en) * 2015-02-17 2017-09-26 高通股份有限公司 The method and system of ranging protocol
CN107409290A (en) * 2015-03-16 2017-11-28 高通股份有限公司 For the adaptive triggering of the RTT rangings of positional accuracy enhanced
CN109196840A (en) * 2016-06-12 2019-01-11 苹果公司 Modification safe condition is detected by safe range
CN109257725A (en) * 2017-07-14 2019-01-22 硅实验室公司 For adaptive scanning and/or the system and method for broadcast
CN111165000A (en) * 2017-10-06 2020-05-15 赛普拉斯半导体公司 Distance estimation and authentication for bluetooth systems and devices
CN109975758A (en) * 2019-02-20 2019-07-05 苏州普息导航技术有限公司 Wi-Fi blue tooth integrated base station location system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114222247A (en) * 2022-01-28 2022-03-22 Oppo广东移动通信有限公司 UWB ranging method, device, terminal equipment and storage medium
CN114222247B (en) * 2022-01-28 2023-08-29 Oppo广东移动通信有限公司 UWB ranging method, device, terminal equipment and storage medium
CN114646952A (en) * 2022-03-15 2022-06-21 Oppo广东移动通信有限公司 Distance acquisition method, device, system, storage medium and electronic equipment
WO2023225962A1 (en) * 2022-05-26 2023-11-30 华为技术有限公司 Distance measurement method and related apparatus

Also Published As

Publication number Publication date
CN115443665A (en) 2022-12-06

Similar Documents

Publication Publication Date Title
WO2022000354A1 (en) Method for ranging and terminal device
US9320010B2 (en) Apparatus, system and method of estimating a location of a mobile device
US20210345285A1 (en) Method and Device for User Equipment Positioning
US9628952B2 (en) Methods for determining relative locations of multiple nodes in a wireless network
EP4266710A1 (en) Location data harvesting and pruning for wireless accessory devices
CN114007183B (en) Positioning mode triggering method and communication device
WO2021204293A1 (en) Positioning signal processing method and apparatus
CN103675800A (en) Method for measuring distance and electronic device for achievement of distance measurement
US11889302B2 (en) Maintenance of wireless devices
CN113655437A (en) Ranging method, ranging apparatus, and storage medium
US8289963B2 (en) Process and system for calculating distances between wireless nodes
CN114706036A (en) Method, device and equipment for detecting ranging value between equipment
US10948593B2 (en) System for determining distance between fixed and mobile endpoints and related methods
WO2019191996A1 (en) Data transmission method and device
US20240015687A1 (en) Cooperative positioning method and apparatus
WO2022160298A1 (en) Time synchronization method, apparatus and system
WO2018048473A1 (en) Apparatus, system and method of ranging measurement
WO2021046820A1 (en) Measurement reporting method and apparatus
WO2023130876A1 (en) Positioning method and apparatus
WO2020107396A1 (en) Bluetooth positioning method and bluetooth device
CN111315041A (en) Full-duplex LoRa gateway supporting LoRaWAN protocol
WO2024027664A1 (en) Carrier phase positioning method and apparatus, and device and medium
WO2023174131A1 (en) Communication method and communication apparatus
WO2023221931A1 (en) Method and apparatus for positioning
Barreira et al. Collaborative localization of mobile users with Bluetooth: caching and synchronisation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20942588

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20942588

Country of ref document: EP

Kind code of ref document: A1