CN113093101A - Distance measuring method and device, equipment and storage medium - Google Patents
Distance measuring method and device, equipment and storage medium Download PDFInfo
- Publication number
- CN113093101A CN113093101A CN202110261172.4A CN202110261172A CN113093101A CN 113093101 A CN113093101 A CN 113093101A CN 202110261172 A CN202110261172 A CN 202110261172A CN 113093101 A CN113093101 A CN 113093101A
- Authority
- CN
- China
- Prior art keywords
- response
- ranging
- frame
- sending
- time
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 93
- 230000004044 response Effects 0.000 claims abstract description 191
- 230000006399 behavior Effects 0.000 claims description 29
- 238000004590 computer program Methods 0.000 claims description 10
- 230000008054 signal transmission Effects 0.000 claims description 10
- 238000005259 measurement Methods 0.000 description 30
- 238000004891 communication Methods 0.000 description 20
- 230000005540 biological transmission Effects 0.000 description 15
- 238000010586 diagram Methods 0.000 description 12
- 230000003993 interaction Effects 0.000 description 11
- 238000000691 measurement method Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 6
- 238000001914 filtration Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000001228 spectrum Methods 0.000 description 3
- 230000001360 synchronised effect Effects 0.000 description 3
- 230000001413 cellular effect Effects 0.000 description 2
- 239000013078 crystal Substances 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000010365 information processing Effects 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 239000000654 additive Substances 0.000 description 1
- 230000000996 additive effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 239000003795 chemical substances by application Substances 0.000 description 1
- 125000004122 cyclic group Chemical group 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 230000036039 immunity Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 239000002184 metal Substances 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000000644 propagated effect Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 230000003595 spectral effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01S—RADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
- G01S5/00—Position-fixing by co-ordinating two or more direction or position line determinations; Position-fixing by co-ordinating two or more distance determinations
- G01S5/02—Position-fixing by co-ordinating two or more direction or position line determinations; Position-fixing by co-ordinating two or more distance determinations using radio waves
- G01S5/0273—Position-fixing by co-ordinating two or more direction or position line determinations; Position-fixing by co-ordinating two or more distance determinations using radio waves using multipath or indirect path propagation signals in position determination
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Radar Systems Or Details Thereof (AREA)
Abstract
The embodiment of the invention discloses a distance measuring method, a distance measuring device, distance measuring equipment and a storage medium, wherein the method comprises the following steps: the method comprises the steps that a first device sends a first ranging frame to a second device, and a sending timestamp for sending the first ranging frame is recorded; the first device receives a first response which is sent by the second device and used for responding to the first ranging frame, and records a receiving time stamp of the first response; wherein the sending of the first response is a hardware behavior of the second device; the first equipment determines a target distance according to the sending time stamp and the receiving time stamp; the target distance is a distance between the first device and the second device.
Description
Technical Field
The present invention relates to positioning technologies, and in particular, to a distance measuring method, apparatus, device, and storage medium.
Background
An Ultra-wideband (UWB) technology based on the IEEE 802.15.4a/f/z standard is a wireless communication technology for data transmission using nanosecond-level narrow pulses. UWB technology can achieve accurate position measurements at the centimeter level, provide secure data communications at rates up to 27 megabits per second (Mbps), and have very low power consumption and latency, while the extremely high bandwidth and extremely low power spectral density allow it to share the spectrum with other narrowband and broadband wireless communication systems and have some immunity to interference. The UWB utilizes nanosecond-level non-sine wave narrow pulses to transmit data, so that the occupied frequency spectrum range is wide, UWB time domain signals are narrow, the time resolution is enhanced, the time difference of receiving multipath reflection delay signals and direct signals is generally larger than the pulse width, therefore, the delay signals and the direct signals are separable in the time domain, and the system can quickly extract the direct signals to realize accurate positioning.
In the related art, the UWB ranging based scheme includes: the method comprises the following steps of Single-sided Two-way Ranging (SS-TWR) and Double-sided Two-way Ranging (DS-TWR), wherein the SS-TWR can save power consumption, but the Ranging error is large, and the DS-TWR Ranging error is small, but cannot be applied to a scene with high power consumption requirements.
Disclosure of Invention
Embodiments of the present invention provide a distance measurement method, apparatus, device, and storage medium, which can save power consumption and reduce distance measurement errors.
The technical scheme of the embodiment of the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a ranging method, where a first device sends a first ranging frame to a second device, and records a sending timestamp for sending the first ranging frame;
the first device receives a first response which is sent by the second device and used for responding to the first ranging frame, and records a receiving time stamp of the first response; wherein the sending of the first response is a hardware behavior of the second device;
the first equipment determines a target distance according to the sending time stamp and the receiving time stamp; the target distance is a distance between the first device and the second device.
In a second aspect, an embodiment of the present invention provides a ranging method, where the method includes:
the second equipment receives a first ranging frame sent by the first equipment;
the second device transmitting a first response to the first device in response to the first ranging frame; the sending of the first response is the hardware behavior of the second device; wherein the sending timestamp of the first ranging frame and the receiving timestamp of the first response sent by the first device are used for the first device to determine a target distance, and the target distance is a distance between the first device and the second device.
In a third aspect, an embodiment of the present invention provides a distance measuring apparatus, which is applied to a first device, where the apparatus includes:
the first ranging module is used for sending a first ranging frame to second equipment and recording a sending time stamp for sending the first ranging frame;
a second ranging module, configured to receive a first response sent by the second device and used for responding to the first ranging frame, and record a receiving timestamp for receiving the first response; wherein the sending of the first response is a hardware behavior of the second device;
a determining module, configured to determine a target distance according to the sending timestamp and the receiving timestamp; the target distance is a distance between the first device and the second device.
In a fourth aspect, an embodiment of the present invention provides a ranging apparatus, which is applied to a second device, where the apparatus includes:
a receiving module, configured to receive a first ranging frame sent by the first device;
a sending module, configured to send a first response to the first device, where the first response is used to respond to the first ranging frame; the sending of the first response is the hardware behavior of the second device; wherein the sending timestamp of the first ranging frame and the receiving timestamp of the first response sent by the first device are used for the first device to determine a target distance, and the target distance is a distance between the first device and the second device.
In a fifth aspect, an embodiment of the present invention provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps in the ranging method.
In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the above distance measuring method.
The distance measurement method provided by the embodiment of the invention comprises the following steps: the method comprises the steps that a first device sends a first ranging frame to a second device, and a sending timestamp for sending the first ranging frame is recorded; the first device receives a first response which is sent by the second device and used for responding to the first ranging frame, and records a receiving time stamp of the first response; wherein the sending of the first response is a hardware behavior of the second device; the first equipment determines a target distance according to the sending time stamp and the receiving time stamp; the target distance is a distance between the first device and the second device. Therefore, after the first distance measurement frame is sent to the second equipment by the first equipment, the second equipment replies the first response of the first equipment based on the hardware behavior without software intervention, so that the reply time delay required by the second equipment for replying the first distance measurement frame is reduced, the distance measurement error is reduced as much as possible, the distance measurement precision is improved, meanwhile, the distance measurement is realized by the interaction of two messages between the first equipment and the equipment, and therefore, the power consumption is saved more, and especially in an application scene needing a large amount of distance measurement, the scene with high power consumption requirement of a similar scene is met.
Drawings
Fig. 1 is a schematic diagram of an alternative architecture of a ranging system according to an embodiment of the present invention;
fig. 2 is an alternative flow chart of a ranging method according to an embodiment of the present invention;
fig. 3 is an alternative flow chart of a ranging method according to an embodiment of the present invention;
fig. 4 is an alternative flow chart of the ranging method according to the embodiment of the present invention;
fig. 5 is an alternative flow chart of the ranging method according to the embodiment of the present invention;
FIG. 6 is a frame structure diagram of a first ranging frame according to an embodiment of the present invention;
fig. 7 is a frame structure diagram of a MAC data frame of a first ranging frame according to an embodiment of the present invention;
fig. 8 is an alternative flow chart of the ranging method according to the embodiment of the present invention;
fig. 9 is an alternative flow chart of the ranging method according to the embodiment of the present invention;
FIG. 10 is a schematic diagram of an alternative scenario of signal transmission provided by an embodiment of the present invention;
FIG. 11 is a schematic diagram of UWB signal transmission waveforms provided by an embodiment of the present invention;
fig. 12 is an alternative flow chart of the ranging method according to the embodiment of the present invention;
fig. 13 is an alternative flow chart of the ranging method according to the embodiment of the present invention;
fig. 14 is an alternative flow chart of the ranging method according to the embodiment of the present invention;
fig. 15 is a schematic frame structure diagram of a MAC header of a first ranging frame according to an embodiment of the present invention;
fig. 16 is an alternative flow chart of the ranging method according to the embodiment of the present invention;
FIG. 17 is a schematic diagram of an alternative structure of a distance measuring device according to an embodiment of the present invention;
FIG. 18 is a schematic view of an alternative structure of a distance measuring device according to an embodiment of the present invention;
fig. 19 is an alternative structural schematic diagram of an electronic device provided in an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail with reference to the accompanying drawings, the described embodiments should not be construed as limiting the present invention, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
Embodiments of the present invention may provide a ranging method, and apparatus, device, and storage medium. In practical applications, the distance measuring method may be implemented by a distance measuring apparatus, and each functional entity in the distance measuring apparatus may be cooperatively implemented by hardware resources of a computer device (e.g., an earphone and a terminal device), such as computing resources such as a processor, and communication resources (e.g., for supporting communications in various manners such as optical cable and cellular).
Of course, the embodiments of the present invention are not limited to being provided as methods and hardware, and may be provided as a storage medium (storing instructions for executing the ranging method provided by the embodiments of the present invention).
The distance measurement method provided by the embodiment of the invention can be applied to the distance measurement system shown in fig. 1, and as shown in fig. 1, the distance measurement system comprises: a first device 10 and a second device 20, wherein the first device 10 is a UWB-capable electronic device. The second device is a UWB-capable electronic device. The first device and the second device may communicate using the UWB-based network 30.
The first device 10 sends a first ranging frame to the second device 20, and records a sending timestamp for sending the first ranging frame; the second device 20 receives the first ranging frame sent by the first device 10 and sends a first response to the first device 10 for responding to the first ranging frame; wherein. The sending of the first response is the hardware behavior of the second device 20; the first device 10 receives a first response sent by the second device 20 for responding to the first ranging frame, and records a receiving time stamp of the first response; the first device 10 determines the distance between the first device 10 and the second device 20 from the transmission time stamp and the reception time stamp.
In practical application, the ranging system may include a plurality of second devices, where the first device sends a first ranging frame to each of the second devices, receives a first response returned by each of the second devices, and determines a distance between the first device and each of the second devices according to a sending timestamp for sending the first ranging frame and a receiving timestamp for receiving the first response.
The first device and the second device in the embodiment of the present invention are opposite, the electronic device that sends the first ranging frame is the first device, and the device that receives the first ranging frame is the second device. For the same electronic device, the first ranging frame may be sent to other electronic devices as a first device, or may be received by a second device as a second device.
The first device and the second device in the ranging system may communicate based on various communication systems, such as: a Global System for Mobile communications (GSM) System, a Code Division Multiple Access (CDMA) System, a Wideband Code Division Multiple Access (WCDMA) System, a General Packet Radio Service (GPRS), a Long Term Evolution (Long Term Evolution, LTE) System, an LTE Frequency Division Duplex (FDD) System, an LTE Time Division Duplex (TDD), a Universal Mobile Telecommunications System (UMTS), a Worldwide Interoperability for Microwave Access (WiMAX) communication System, or a 5G System.
The first apparatus 10 and the second apparatus 20 may be terminal apparatuses, which may refer to access terminals, User Equipments (UEs), subscriber units, subscriber stations, mobile stations, remote terminals, mobile devices, User terminals, wireless communication devices, User agents, or User devices. An access terminal may be a cellular telephone, a cordless telephone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), a handheld device having Wireless communication capabilities, a computing device or other processing device connected to a Wireless modem, a vehicle mounted device, a wearable device, a terminal device in a 5G network, or a terminal device in a future evolved PLMN, etc. The terminal equipment can also be a sensor, a laser scanning system, intelligent household appliances and other Internet of things equipment.
In an example, the first device is an Internet of Things (IOT) device, wherein the second device is a handset, wherein the first device may be provided with a UWB tag, and the UWB tag in the first device transmits the first ranging frame to the second device.
Embodiments of a ranging method, a ranging device, a ranging apparatus, and a storage medium according to embodiments of the present invention are described below with reference to a schematic diagram of a ranging system shown in fig. 1.
The embodiment provides a distance measurement method, which is applied to a first device, and fig. 2 is a schematic flow chart illustrating an implementation of the distance measurement method according to the embodiment of the present invention, as shown in fig. 2, the method may include the following steps:
s201, a first device sends a first ranging frame to a second device, and records a sending time stamp of the first ranging frame.
Here, the first device transmits a first ranging frame in a transmit (Tx) state. After the first device sends the first ranging frame in the first state, the first device switches from the sending state to the receiving (Rx) state and waits for receiving a first response responding to the first ranging frame. Wherein the first device may transmit the first ranging frame to the second device using UWB through a first UWB chip in the first device. Wherein when the first UWB chip is in a transmit (Tx) state, the first device is in a transmit (Tx) state; when the first UWB chip is in a receive (Rx) state, the first device is in a receive (Rx) state.
In an embodiment of the invention, the power consumption of the electronic device in the transmission (Tx) state is less than the power consumption in the reception (Rx) state.
In this embodiment of the present invention, the first device may perform transmission of the first ranging frame at least at the following occasions:
receiving a ranging operation of a user in a first condition;
and in case two, the current time reaches the specified time.
In this case, the first device triggers transmission of a first ranging frame upon receiving a ranging operation of a user.
In case two, the first device is provided with a designated time, and when the current time is obtained from the designated time, the first ranging frame is triggered to be sent. The designated time may be a fixed time or a time triggered based on the ranging period.
In the embodiment of the present invention, the timing when the first device transmits the first ranging frame is not limited.
The first device records a transmission Time stamp (Tx Time stamp) for transmitting the first ranging frame, which is recorded as Time1, at the same Time of transmitting the first ranging frame.
In the embodiment of the present invention, as shown in fig. 3, the interaction between the first device and the second device includes:
s301, the first equipment sends a first ranging frame to the second equipment;
s302, the second device sends a first response to the first device.
In the case where the second device receives the first ranging frame of the first device, a first response is sent to the first device in response to the received first ranging frame based on the hardware behavior.
S202, the first device receives a first response which is sent by the second device and used for responding to the first ranging frame, and records a receiving time stamp of the first response.
Wherein the sending of the first response is a hardware behavior of the second device.
The first device receives a first response via the first UWB chip.
The first device, while receiving the first response, records a reception timestamp (Rx Time stamp) of the reception of the first response, which is denoted as Time 2.
In an example, the first response is an Acknowledgement (ACK) frame that does not include a frame payload (payload), i.e., a Medium Access Control (MAC) payload, in the payload.
S203, the first device determines the target distance according to the sending time stamp and the receiving time stamp.
The target distance is a distance between the first device and the second device.
Under the condition that the first equipment receives the first response, according to a sending time stamp of sending the first ranging frame and a receiving time stamp of receiving the first response, determining a time difference between the first equipment sending the first ranging frame and the first response, namely a response interval Tround, obtaining a time difference between the second equipment receiving the first ranging frame and the first response, namely a reply interval Treply, namely a reply delay, determining the flight time Tof of a signal through the Tround and Treply, and obtaining the distance between the first equipment and the second equipment according to the Tof and the light speed.
As shown in fig. 4, the first device sends the first ranging frame 401 at Time1 and receives the first response 402 at Time2, the Time interval between Time1 and Time2 is the response interval Tround, the Time of flight TOF of the signal is the transmission Time Tprop of the first ranging frame and the first response, and the Time interval between the second device receiving the first ranging frame 401 and sending the first response 402 is the reply interval Treply, then TOF can be calculated by equation (1):
Tof=(Tround-Treply) Formula (1);
Troundis calculated as shown in equation (2):
Troundtime2-Time1 equation (2);
in this embodiment, Treply is related to the time when the second device sends the first response and the time when the first ranging frame is received. In one example, Treply may be a preset duration. In one example, Treply is calculated based on the length of the first ranging frame and the length of the first response. In an example, Treply is calculated according to a length of the first ranging frame, a length of the first response, and a switching duration of the second device switching from a first state to a second state, where the second device receives the first ranging frame in the first state and the second device transmits the first response in the second state.
In this embodiment of the application, the reply of the first response is a hardware behavior of the second device, and the first device can determine, according to the sent first ranging frame and the received first response, a reply delay for the second device to reply the first response. In practical application, the hardware behavior of the second device does not need software intervention, and the reply delay of the second device for replying the first response based on the hardware behavior is smaller than the reply delay of the second device for replying the message based on the software intervention.
The distance measurement method provided by the embodiment of the invention comprises the following steps: the method comprises the steps that a first device sends a first ranging frame to a second device, and a sending timestamp for sending the first ranging frame is recorded; the first device receives a first response which is sent by the second device and used for responding to the first ranging frame, and records a receiving time stamp of the first response; wherein the sending of the first response is a hardware behavior of the second device; the first equipment determines a target distance according to the sending time stamp and the receiving time stamp; the target distance is a distance between the first device and the second device. Therefore, after the first distance measurement frame is sent to the second equipment by the first equipment, the second equipment replies the first response of the first equipment based on the hardware behavior without software intervention, so that the reply time delay required by the second equipment for replying the first distance measurement frame is reduced, the distance measurement error is reduced as much as possible, the distance measurement precision is improved, meanwhile, the distance measurement is realized by the interaction of two messages between the first equipment and the equipment, and therefore, the power consumption is saved more, and especially in an application scene needing a large amount of distance measurement, the scene with high power consumption requirement of a similar scene is met.
An embodiment of the present invention provides a distance measuring method, where the method is applied to a second device, fig. 5 is a schematic flow chart illustrating an implementation of the distance measuring method according to the embodiment of the present invention, and as shown in fig. 5, the method may include the following steps:
s501, the second device receives a first ranging frame sent by the first device.
The second device may receive a first ranging frame transmitted by the first device through a second UWB chip in the second device in the first state. And after receiving the first ranging frame, the second equipment is switched from the first state to the second state and sends a first response.
In one example, the first state is a receive (Rx) state and the second state is a transmit (Tx) state.
In this embodiment, the second device may receive, by using a UWB chip in the second device, the first ranging frame transmitted by the second device. Wherein, when the second UWB chip is in a transmit (Tx) state, the second device is in a transmit (Tx) state; when the second UWB chip is in a receive (Rx) state, the second device is in a receive (Rx) state.
The second device may receive the first ranging frame transmitted by the first device in the following mode:
a first mode and a parameter receiving mode;
mode two, a filtering mode;
mode three, auto-reply mode.
In the parameter receiving mode, the second device controls the second UWB chip to enter the first state all the time through software.
In one example, in the parameter receiving mode, if there is no software intervention, the second UWB chip enters the idle state after receiving the first ranging frame and without the need to reply to the first response or after completing the reply to the first response.
In the filtering mode, the second UWB chip may determine, at the bottom layer, uninteresting frames in the received frames according to a set filtering rule, and the uninteresting frames are dropped at the physical layer and are not reported to the MAC layer for processing.
In the auto-reply mode, the second UWB chip will automatically reply to the acknowledgement frame after receiving the frame of interest.
In an embodiment of the invention, the frames of interest to the second device comprise first ranging frames.
S502, the second device sends a first response for responding to the first ranging frame to the first device.
The sending of the first response is the hardware behavior of the second device; wherein the hardware behavior of the second device does not require software intervention. In this embodiment, the second device may receive the first ranging frame through the second UWB chip in the auto-reply mode, and directly transmit the first response through the second UWB chip in a case where the second UWB chip receives the first ranging frame, so as to perform an auto-reply of the first response through the second UWB chip. In the embodiment of the application, the reply delay for sending the first response under the condition of the hardware behavior without software intervention is smaller than the reply delay for sending the first response under the condition of the software intervention. Wherein the reply delay is a time from when the second device receives the first ranging frame to when the second device sends the first response.
The sending timestamp of the first ranging frame and the receiving timestamp of the first response sent by the first device are used by the first device to determine a target distance, wherein the target distance is the distance between the first device and the second device.
The second device may parse the received frame through the second UWB chip in the first state, switch from the first state to the second state after determining that the received frame is the first ranging frame, and reply to the first device with a first response in the second state in response to the first ranging frame.
In an example, the first response is an Acknowledgement (ACK) frame. The MAC payload is not included in the payload of the acknowledgement frame.
And the first device receives a first response sent by the second device, and determines the distance between the first device and the second device, namely the target distance, by sending the sending time stamp of the first ranging frame, receiving the receiving time stamp of the first response and the reply time length of the second UWB chip replying the first response.
In the related art, the second UWB chip receives a frame sent by another device in the first state, and enters the third state after receiving the frame sent by the another device, and after receiving a state switching instruction of software of the second device instructing the second UWB chip to switch to the second state, the second UWB chip enters the second state, and sends information in the second state.
In the embodiment of the application, the second UWB chip receives the first ranging frame sent by the first device in the first state, directly switches to the second state after receiving the first ranging frame, and sends the first response to the first device in the second state, thereby avoiding the intervention of software of the second device,
the distance measurement method provided by the embodiment of the invention comprises the following steps: the second equipment receives a first ranging frame sent by the first equipment; the second device transmitting a first response to the first device in response to the first ranging frame; the sending of the first response is the hardware behavior of the second device; wherein the sending timestamp of the first ranging frame and the receiving timestamp of the first response sent by the first device are used for the first device to determine a target distance, and the target distance is a distance between the first device and the second device. Therefore, after the first distance measurement frame is sent to the second equipment by the first equipment, the second equipment replies the first response of the first equipment based on the hardware behavior without software intervention, so that the reply time delay required by the second equipment for replying the first distance measurement frame is reduced, the distance measurement error is reduced as much as possible, the distance measurement precision is improved, meanwhile, the distance measurement is realized by the interaction of two messages between the first equipment and the equipment, and therefore, the power consumption is saved more, and especially in an application scene needing a large amount of distance measurement, the scene with high power consumption requirement of a similar scene is met.
In some embodiments, the first ranging frame includes at least the following subfields: a response request subfield; the response request subfield to indicate whether the second device sends the first response to the first device; before S201, the first device further performs the following steps: the first device sets a value of the response request subfield to a target value to instruct the second device to send the first response to the first device.
Before S502, if the second device determines that the value of the response request subfield is a target value, it determines to send the first response to the first device; the value of the response request subfield is the target value, instructing the second device to send the first response to the first device.
The response request subfield in the first ranging frame is used to indicate whether a second device receiving the first ranging frame replies with a first response to the first device. And when the value of the response request subfield is the target value, indicating the second device receiving the first ranging frame to reply the first response to the first device. And when the value of the response request subfield is a value outside the target value, indicating that the second device receiving the first ranging frame does not reply the first response to the first device.
In one example, the target value is 1. At this point, the first device enables the response request subfield in the first ranging frame, and then instructs the second device to reply with the first response.
In the embodiment of the present application, the response request subfield may be included in a MAC frame header of the first ranging frame, where the MAC frame header is located in a payload of the first ranging frame.
In this embodiment of the present invention, the subfields in the MAC frame header of the first ranging frame may at least include: a frame type subfield and a response request subfield. The frame type subfield characterizes the type of the frame, and when the value of the frame type subfield is a specified value, the frame is a first ranging frame. The response request subfield is used for indicating whether the receiving end responds to the sending end, and when the value of the response request subfield is a target value, the receiving end is indicated to respond to the sending end, and at the moment, the second equipment receiving the first ranging frame needs to reply a first response to the first equipment.
In the embodiment of the present application, a frame format of the first ranging frame may be as shown in fig. 6, and at least includes the following fields: a Preamble (Preamble), a Start Frame Delimiter (SFD), a physical layer Header (PHR), and a Payload (Payload). The preamble is used to wake up the second device, so that the second device is synchronized with the first ranging frame. The SFD is used to identify the beginning of the data message. The PHR includes physical parameters related to data transmission, such as: the length of the load. The payload includes message information of a physical layer and an MAC data frame.
As shown in fig. 7, the field MAC data frame includes a MAC header, a MAC payload, and a MAC trailer. The MAC header includes a frame type subfield indicating the type of frame that determines the length and content of the MAC payload of the frame, and the trailer is a Cyclic Redundancy Check (CRC) Check sequence of the header and the MAC payload.
In this embodiment of the application, the frame format of the first response is the same as that of the first ranging frame, and the load of the first response does not include the MAC load.
In some embodiments, prior to S203,
the first equipment acquires a reference time length; the reference duration is related to a length of the first ranging frame and a length of the first response; correspondingly, the implementation of S203 includes:
s2031, the first device determines the target distance according to the sending time stamp, the receiving time stamp and the reference time length.
Here, the obtained reference duration Tref is related to a time when the second device transmits the first response and a time when the first ranging frame is received. Here, the reference duration Tref is a reply duration Treply that is a duration from when the second UWB chip receives the first ranging frame to when the first response is sent.
In some embodiments, the implementation of S2031 comprises: determining a response interval according to the sending timestamp and the receiving timestamp; determining signal transmission time according to the receiving time interval and the reference duration; and determining the target distance according to the signal transmission time.
Here, the time of flight Tof, i.e., the signal transmission time, is calculated using equation (3):
Tof=(Tround-Tref) Formula (3);
wherein the response interval TroundIs calculated as shown in equation (2):
Troundtime2-Time1 equation (2).
In the embodiment of the present application, the reference duration may be calculated and obtained by the first device, and may also be received and obtained from the second device.
In some embodiments, the first device determines a first processing sub-duration according to a length of the first ranging frame; the first equipment determines a second processing sub-time length according to the length of the first response; and the first equipment determines the reference time length according to the first processing sub-time length and the second processing sub-time length.
The frame format of the first ranging frame includes fields: preamble, SFD, PHR and payload1, where the payload in the first ranging frame is denoted as payload1, and the frame format of the first response includes fields: preamble, SFD, PHR, and payload2, where the load in the first response is denoted as payload 2. The first device determines a first processing sub-duration according to the tag field in the first ranging frame and a second processing sub-duration according to the tag field in the second ranging frame. Here, a timestamp at which the second device receives the first ranging frame and a timestamp at which the first response is transmitted are determined with the tag field as a recording point.
In one example, the flag field is an SFD field. At this time, the first processing sub-duration T1 is TPHR+Tpayload1Second processing sub-timeLong T1 ═ TPreamble+TSFDAt this time, Tref=T1+T2=TPHR+Tpayload1+TPreamble+TSFD。
In one example, the length of the Preamble is 64 symbols, then TPreamble64 mus; SFD is 8 symbols, then TSFD8 mus; PHR is 19bits, then TPHR2.8 μ s; payload1 is 5 bytes, then Tpayload15.88. mu.s, in this case, Tref=2.8+5.88+64+8=81.5μs。
In the embodiment of the present application, the length of the Preamble, the SFD, and the PHR in the first ranging frame and the first response is the same, and the reference time length is actually the time of the length of one first ranging frame.
In an embodiment, the first device determines a switching duration for the second device to switch from the first state to the second state; the second device receiving the first ranging frame in the first state; the second equipment sends and receives the first response in the second state; correspondingly, the determining, by the first device, the reference time length according to the first processing sub-time length and the second processing sub-time length includes: and the first equipment determines the reference time length according to the first processing sub-time length, the second processing sub-time length and the switching time length.
Here, the reference time length includes, in addition to a time that is one first ranging frame long, a switching time length required for the second device to switch from the first state to the second state, where the switching time length is a time length required for the second UWB to switch from the first state to the second state. Here, the switching time length Tcha may be a set time length, and in one example, the first processing sub-time length T1 is T ═ TPHR+Tpay1The second processing sub-duration T1 ═ TPreamble+TSFDAt this time, Tref=T1+Tcha+T2=TPHR+Tpayload1+Tcha+TPreamble+TSFD。
In one example, the length of the Preamble is 64 symbols, then TPreamble64 mus; SFD is 8 symbols, then TSFD8 mus; tcha is 6.5 mus; PHRIs 19bits, then TPHR2.8 μ s; payload1 is 5 bytes, then Tpayload15.88. mu.s, in this case, Tref=2.8+5.88+6.5+64+8=88μs。
In the examples of the present application, Tcha is 6.5. mu.s.
In the embodiment of the application, the reply of the first response is performed based on the second UWB chip of the second device, and the time for the second device to reply the first response is determined according to the first ranging frame and the duration of the first response, so that the time for the second device to reply the first response can be reduced, the time for the second device to reply the first response can be accurately determined, and the ranging accuracy can be improved.
In the embodiment of the present application, when the reference duration is received by the first device from the second device, the manner in which the second device determines the reference duration is the same as the manner in which the first device determines the reference duration, which is not described herein again.
In some embodiments, based on the interaction shown in fig. 3, as shown in fig. 8, after S302, the method further includes S303, where the first device sends a second ranging frame carrying the target distance to the second device.
At this time, the second device receives a second ranging frame carrying the target distance sent by the first device.
Here, after the first device determines the target distance, the target distance is padded in the second ranging frame, and the second ranging frame is transmitted to the second device. The second ranging frame may be a new round of ranging initiated by the first device, so that after receiving the second ranging frame, the second device obtains a ranging result of the previous round of ranging, that is, the target distance, by analyzing the second ranging frame.
The target distance may be padded in the MAC payload of the first ranging frame.
In this embodiment of the application, through interaction of S301 and S302 in fig. 8, the first device can determine a distance between the first device and the second device, and send the ranging result of S301 and S302 to the second device through S303 in fig. 8, so that the second device can directly determine the distance between the first device and the second device.
In some embodiments, prior to S303, the first device further performs the steps of: the first device determining a time interval between a current time and a time at which the first response is received; and if the time interval is larger than a set time threshold, the first equipment determines to send a second ranging frame carrying the target distance to the second equipment.
And when the time length of the current time to the first response is greater than the time threshold value, sending a second ranging frame to the second equipment to initiate a new round of ranging.
In one example, the time threshold is 5 milliseconds (ms). The size of the time threshold can be determined according to actual requirements.
The embodiment of the invention provides a distance measuring method, which is applied to a distance measuring system, wherein the distance measuring system comprises the following steps: fig. 9 is a schematic flow chart illustrating an implementation of a ranging method according to an embodiment of the present invention, and as shown in fig. 9, the method may include the following steps:
s901, the first device sends a first ranging frame to the second device, and records a sending time stamp of the first ranging frame.
S902, the second device receives a first ranging frame sent by the first device, and sends a first response for responding to the first ranging frame to the first device.
The sending of the first response is a hardware behavior of the second device.
S903, the first device receives a first response sent by the second device and used for responding to the first ranging frame, and records a receiving timestamp for receiving the first response.
And S904, the first device determines the target distance according to the sending time stamp and the receiving time stamp.
The target distance is a distance between the first device and the second device.
In the ranging method shown in fig. 9, the first device may refer to the description in the ranging method shown in fig. 2, and the second device may refer to the description in the ranging method shown in fig. 5, which is not repeated herein.
The distance measurement method provided by the embodiment of the invention comprises the following steps: the first device sends a first ranging frame to the second device, and records a sending time stamp of the first ranging frame. And the second equipment receives the first ranging frame sent by the first equipment and sends a first response for responding to the first ranging frame to the first equipment. The sending of the first response is a hardware behavior of the second device. And the first device receives a first response which is sent by the second device and used for responding to the first ranging frame, and records a receiving time stamp for receiving the first response. And the first equipment determines the target distance according to the sending time stamp and the receiving time stamp. The target distance is a distance between the first device and the second device. Therefore, after the first distance measurement frame is sent to the second equipment by the first equipment, the second equipment replies the first response of the first equipment based on the hardware behavior without software intervention, so that the reply time delay required by the second equipment for replying the first distance measurement frame is reduced, the distance measurement error is reduced as much as possible, the distance measurement precision is improved, meanwhile, the distance measurement is realized by the interaction of two messages between the first equipment and the equipment, and therefore, the power consumption is saved more, and especially in an application scene needing a large amount of distance measurement, the scene with high power consumption requirement of a similar scene is met.
The information processing method provided by the embodiment of the present invention is further described below by taking as an example that the first device is a UWB iot device having a UWB chip, and the second device is a UWB mobile phone having a UWB chip.
Here, UWB ranging is first described.
The key of the positioning system is the error between the measured distance and the measured distance, the smaller the error is, the higher the positioning accuracy is, and the time of the electromagnetic wave transmitted in the air is approximately the light speed, so the distance error is the time error of the measured electromagnetic wave flying in the air, and if the measurement accuracy is to reach 0.1 meter (m), the calculation according to the following formula (4) shows that the error of the measured electromagnetic wave flying time must be within 0.3 nanosecond (ns);
Δt=ΔD/C=0.1m/(3×108m/s) ═ 0.3ns formula (4);
to achieve such accuracy, it is critical to distinguish the direct signal from the reflected signal in a short time for capturing the signal, so as to obtain a precise flight time, and in an actual wireless transmission environment, the electromagnetic wave is reflected by an object (similar to the reflection of visible light) in the surrounding environment, such as a wall, glass, metal, etc., to generate a multipath signal. As shown in fig. 10, the receiving node 102 often receives not only the direct signal 1001 of the transmitting node 101 but also the reflected signal 1002 propagated by the reflected path, and the direct signal 1001 of the direct path and the reflected signal 1002 of the reflected path are in an additive relationship.
Assuming that the path length of direct signal is 5m, the total distance of propagation of the reflected signal is 7m, the time of the direct signal is 16ns, the time of the reflected signal is 23ns, that is, the direct signal and the reflected signal are to be distinguished within 7ns, the traditional narrow-band signal is sinusoidal carrier communication, the bandwidth is narrow, the time required for completing signal transmission is tens of milliseconds, and the direct signal cannot complete transmission within 7ns, so that the direct signal and the reflected signal overlap in the time domain, the signal is delayed, and the amplitude and the phase are changed, thereby generating energy attenuation, reducing the signal-to-noise ratio, causing the first arriving signal not the direct signal, causing ranging error, and reducing the positioning accuracy.
The UWB technology is a wireless carrier communication technology, that is, a sinusoidal carrier is not used, but nanosecond-level non-sinusoidal narrow pulses are used to transmit data, as shown in fig. 11, the occupied frequency spectrum range is wide, the UWB time domain signal is narrow, so that the time resolution is enhanced, and the time difference between the received reflected signal 1002 and the direct signal 1001 in the reflected path is generally greater than the pulse width, so that the signals are separable in the time domain. The time difference of 7ns is enough to complete the transmission of the UWB direct signal (the transmission time is about 2ns), so that the system can quickly extract the direct signal to realize accurate positioning.
In the related art, when the UWB mobile phone and the UWB IOT device perform distance measurement, a Time of Flight (TOF) method is used, that is, the Time of Flight of a signal in the air is measured, and the distance is obtained by multiplying the Time of Flight by the speed of light.
Currently, schemes using TOF ranging include: SS-TWR, which is a simple measure of the time of a single round trip message, sends data on its own initiative to device B, which responds to device a with data back. DS-TWR is an extended ranging method for SS-TWR, which records timestamps of two round trips and finally obtains the time of flight, although increasing the response time, but reducing the ranging error. Compared with the DS-TWR, the SS-TWR can complete the ranging only by two frames of air interaction, so that the power consumption is saved, and particularly in an application scene needing a large amount of ranging, the SS-TWR is preferentially adopted for ranging in consideration of the low power consumption requirement of the IOT equipment.
An implementation of SS-TWR is shown in fig. 12, and includes:
s1201, the device a transmits a ranging frame (Range) to the device B.
The device a may be a UWB tag as a Client (Client), and the device B may be a UWB mobile phone as a Host (Host).
Device a transmits a ranging frame in the Tx state and device B receives a ranging frame in the Rx state.
S1202, device B sends a Reply frame (Reply) back to device a.
Device B sends back multiframes in Tx state and device a receives back multiframes in Rx state.
When the device A sends the ranging frame, recording a sending time stamp, and after the device B receives the ranging frame, recording a receiving time stamp; after the time delay Treply, the device B sends back the multiframe and simultaneously records the sending time stamp, and the device A receives the multiframe and simultaneously records the receiving time stamp.
The ranging principle of SS-TWR is shown in fig. 13, where device a actively transmits a ranging frame to device B and records a transmission timestamp T1. Recording a receiving time stamp T2 after the device B receives the ranging frame sent by the device A; after a delay Treply, device B sends back a multiframe while recording the send timestamp T3, and device A receives back a multiframe while recording the receive timestamp T4.
The time T1 to the time T2 are the propagation time Tprop of the signal, and if the clocks of the two signals can be synchronized, the distance that can be directly converted by the propagation time Tprop can be used as the distance between the device a and the device B. However, since the device a and the device B have independent clocks and are not synchronized, the time difference between the time T1 and the time T2 cannot be used as the propagation time Tprop of the signal for ranging.
Here, the signal time difference by the device a: response interval Tround and device B signal time difference: the reply interval Treply finally obtains the flight time Tprop of the wireless signal, as shown in (5):
the two time differences, Tround and Treply, are calculated based on a local clock, and the local clock errors can be cancelled out, but a slight clock offset exists between different devices, and assuming that the clock offsets of the devices a and B are eA and eB, respectively, the obtained flight time increases with the increase of Treply, and the ranging error is shown in formula (6):
the smaller Treply, the more accurate the range finding. In addition, Treply not only receives the transmission by device B, but also includes the time it takes to load and transmit data (UWB can also transmit data in addition to supporting position location, standard can load 128 bytes, extended mode can load 1024 bytes of data). The error relationship for a typical SS-TWR is shown in Table 1.
TABLE 1 error relationship for typical SS-TWR
Based on table 1, it can be determined that as Treply and clock offset increase, time-of-flight errors increase, thereby making ranging inaccurate. When the error of the crystal oscillator is 10PPM, a 1ms recovery delay (reply delay) will bring a ranging error of 5ns, i.e. 1.5 m.
The reply delay mainly comes from system delay brought by a system for controlling a UWB chip to switch from an RX state to a TX state, for IOT equipment, the IOT equipment is a single-chip microcomputer single-task system, and the system delay can be controlled within 100us, but because an operating system of the electronic equipment is a multi-task non-real-time processing operating system, the operating system is switched from the RX state to the TX state, if the switching is performed in a system software mode, the following two problems exist:
1. the existence time of the mobile phone software switching is not controllable;
2. the switching time is typically above 3 ms.
In order to solve the above problem, an embodiment of the present invention provides a method for automatically performing an ACK reply function through a UWB chip, and the method manually calculates accurate time of reply delay, completes SS-TWR interaction, and significantly improves ranging accuracy of SS-TWR. In the embodiment of the present invention, the interaction between the UWBITO device and the UWB mobile phone, as shown in fig. 14, includes:
s1401, the UWBIOT device sends a ranging frame to the UWB handset.
Because the power consumption of the UWB receiving end (RX) is much larger than that of the UWB transmitting end (TX), and the IOT device has a higher requirement for power consumption, the UWBITO device first transmits a ranging Frame (Range Frame) and records a transmission Time stamp (TX Time stamp) of the Range Frame: time 1.
Enabling a flag bit of the ACK Request in a Mac Header in a Range Frame, where a structure of a Mac Frame Header is shown in fig. 15, and includes: a frame type subfield of bits 0 to 2, a security subfield of bit 3, a frame suspend subfield of bit 4, a response request subfield of bit 5, i.e., an ACK request subfield, a personal area network identifier subfield of bit 6, a reserved subfield of bits 7 to 9, a destination address mode subfield of bits 10 to 11, a frame version subfield of bits 12 to 13, and a source address mode subfield of bits 14 to 15.
The Frame Type subfield may be represented as a Frame Type, and may characterize the Frame Type of the Frame, where the Frame Type of the Frame may include: a ranging Frame (Range Frame), a Reply Frame (Reply Frame), and a Final Frame (Final Frame). The Security subfield may be denoted as Security Enabled, indicating whether the frame is encrypted or not; the Frame Pending subfield can be represented as Frame Pending and represents whether the sender has a Frame to be sent continuously; the ACK Request subfield can be expressed as an ACK Request subfield, when the ACK Request subfield is enabled, the ACK Request subfield expresses that a sending end informs a receiving end to send ACK immediately after receiving the frame, when the ACK Request subfield is not enabled, the receiving end can not actively send ACK, wherein hardware behaviors are performed when the ACK is sent, and software intervention is not needed; the personal area network identifier subfield may be denoted as PAN ID Compress to indicate whether the frame contains both the destination and source addresses; the reserved subfield can be denoted as Reversed, and represents the custom content; the destination Address Mode subfield may be denoted as dest.address Mode, the Frame Version subfield may be denoted as Frame Version, and the Source Address Mode subfield may be denoted as Source Address Mode; the destination address mode subfield and the source address mode subfield are used to indicate whether the destination address and the source address use a long address mode (64bits) or a short address mode (16 bits).
And S1402, the UWB mobile phone replies ACK to the UWBITO equipment.
The UWB module of the mobile phone starts a permanent receiving (filter) mode, a filtering (filter) mode and an automatic response (Auto ACK) mode, the UWB mobile phone automatically replies ACK after receiving the correct Range Frame and automatically enters an RX state, and the whole process does not need the intervention of system software any more.
And after the UWBITO equipment receives the ACK, the UWBITO equipment calculates the ranging error.
The UWBITO device records the receive timestamp (Rx Time Stamp) of the ACK received: time2, calculating Tof according to equation (1):
Tof=(Tround-Treply) Formula (1);
Troundis calculated as shown in equation (2):
Troundtime2-Time1 equation (2);
Treplyis calculated as(7) Shown in the figure:
Treply=Tpreamble+Tsfd+Tphy+Tpayloadformula (7);
here, tpream is related to the length of a Preamble (Preamble) of UWB, and is set to an IEEE standard length of 64 in order to obtain a shorter delay time, tpream is 64us,
tsfd is related to the length Of the Start Of Frame Delimiter (SFD) field Of the UWB; SFD was set to 8 symbols, Tsfd was about 8 us.
Tprr is related to the length of the physical layer Header (PHR) field, PHR is fixed to 19bits and is transmitted at 6.8M rate, and tprr time is 2.8 us.
Tpayload is related to the length of the physical layer payload, and the MAC layer payload (MAC payload) of the first ranging frame is 5 bytes, so that Tpayload can be calculated to be 5.88 us.
Thus, Treply ═ 81.5us can be obtained.
So far, the Tof can be calculated by the above formula (1), and the distance between the UWB mobile phone and the UWBITO device can be obtained by multiplying the Tof by the speed of light.
According to the SS-TWR error estimation of Table 1, when the crystal oscillator error is 10PPM, the SS-TWR ranging error calculated according to the above method shown in FIG. 8 will be less than 1ns, i.e., 30CM, which is much less than the error accuracy of the conventional SS-TWR 150 CM.
In the information processing method shown in fig. 14, the UWBITO device can calculate the distance to the UWB mobile phone, and in order to allow the UWB mobile phone to obtain the ranging result of the SS-TWR, the result of the SS-TWR may be filled in a Range frame, where the interaction between the UWBITO device and the UWB mobile phone is shown in fig. 16:
s1401, the UWBITO equipment sends a ranging frame to the UWB mobile phone.
And S1402, the UWB mobile phone replies ACK to the UWBITO equipment.
And S1403, the UWBITO equipment sends a new round of ranging frame to the UWB mobile phone.
After the one round of SS-TWR shown in S1401 and S1402 is finished, the IOT tag delays for a time longer than 5ms, S1403 is executed to initiate the second round of SS-TWR ranging, and after the mobile phone receives the Range Frame, the ranging result of the previous round of SS-TWR can be obtained by analyzing the result information of the SS-TWR in the Range Frame.
Fig. 17 is a schematic diagram of an implementation flow of a distance measuring apparatus according to an embodiment of the present invention, which is applied to a first device, and as shown in fig. 17, an apparatus 1700 includes:
a first ranging module 1701 for sending a first ranging frame to a second device and recording a sending timestamp for sending the first ranging frame;
a second ranging module 1702, configured to receive a first response sent by the second device for responding to the first ranging frame, and record a receiving timestamp for receiving the first response; wherein the sending of the first response is a hardware behavior of the second device;
a determining module 1703, configured to determine a target distance according to the sending timestamp and the receiving timestamp; the target distance is a distance between the first device and the second device.
In some embodiments, apparatus 1700 further comprises: a setup module to: setting a value of a response request subfield of a first ranging frame to a target value to instruct the second device to send the first response to the first device; the response request subfield is to indicate whether the second device sends the first response to the first device.
In some embodiments, apparatus 1700 further comprises: the acquisition module is used for acquiring reference duration; the reference duration is related to a time when the second device transmits the first response and a time when the first ranging frame is received;
correspondingly, the determining module 1703 is configured to determine the target distance according to the sending timestamp, the receiving timestamp, and the reference time length.
In some embodiments, the determining module 1703 is further configured to:
determining a response interval according to the sending timestamp and the receiving timestamp;
determining signal transmission time according to the receiving time interval and the reference duration;
and determining the target distance according to the signal transmission time.
In some embodiments, apparatus 1700 further comprises: a duration determination module to:
determining a first processing sub-time length according to the length of the first ranging frame;
determining a second processing sub-time length according to the length of the first response;
and determining the reference time length according to the first processing sub-time length and the second processing sub-time length.
In some embodiments, the duration determination module is further configured to:
determining a switching duration of the second equipment from a first state to a second state; the second device receiving the first ranging frame in the first state; the second equipment sends and receives the first response in the second state;
correspondingly, the duration determining module is further configured to determine the reference duration according to the first processing sub-duration, the second processing sub-duration and the switching duration.
In some embodiments, apparatus 1700 further comprises: and the secondary sending module is used for sending a second ranging frame carrying the target distance to the second equipment.
In some embodiments, apparatus 1700 further comprises: a determining and sending module, configured to determine a time interval between a current time and a time when the first response is received before sending a second ranging frame to the second device; and if the time interval is larger than a set time threshold, determining to send a second ranging frame carrying the target distance to the second equipment.
Fig. 18 is a schematic diagram of an implementation flow of a distance measuring apparatus according to an embodiment of the present invention, which is applied to a second device, and as shown in fig. 18, the apparatus 1800 includes:
a receiving module 1801, configured to receive a first ranging frame sent by the first device;
a sending module 1802 configured to send, to the first device, a first response for responding to the first ranging frame; the sending of the first response is the hardware behavior of the second device; wherein the sending timestamp of the first ranging frame and the receiving timestamp of the first response sent by the first device are used for the first device to determine a target distance, and the target distance is a distance between the first device and the second device.
In some embodiments, apparatus 1800 further comprises: a response determining module, configured to determine that a value of a response request subfield of the first ranging frame is a target value, and then determine to send the first response to the first device; the value of the response request subfield is the target value, instructing the second device to send the first response to the first device; wherein the first ranging frame includes at least the following response request subfields; the response request subfield is to indicate whether the second device sends the first response to the first device.
In some embodiments, the receiving module 1801 is further configured to receive a second ranging frame that carries the target distance and is sent by the first device.
It should be noted that the distance measuring apparatus provided in the embodiment of the present invention includes modules, which can be implemented by a processor in an electronic device; of course, the implementation can also be realized through a specific logic circuit; in the implementation process, the Processor may be a Central Processing Unit (CPU), a microprocessor Unit (MPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or the like.
The above description of the apparatus embodiments, similar to the above description of the method embodiments, has similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the apparatus according to the invention, reference is made to the description of the embodiments of the method according to the invention for understanding.
It should be noted that, in the embodiment of the present invention, if the distance measuring method is implemented in the form of a software functional module and sold or used as a standalone product, the distance measuring method may also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, or an optical disk. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
Correspondingly, an embodiment of the present invention provides an electronic device, which includes a memory and a processor, where the memory stores a computer program executable on the processor, and the processor executes the computer program to implement the steps in the ranging method provided in the foregoing embodiment. The electronic device may be a first device or a second device.
Correspondingly, an embodiment of the present invention provides a storage medium, that is, a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps in the ranging method provided in the above-mentioned embodiment.
Here, it should be noted that: the above description of the storage medium and device embodiments is similar to the description of the method embodiments above, with similar advantageous effects as the method embodiments. For technical details not disclosed in the embodiments of the storage medium and the apparatus according to the invention, reference is made to the description of the embodiments of the method according to the invention.
It should be noted that fig. 19 is a schematic diagram of a hardware entity of an electronic device according to an embodiment of the present invention, as shown in fig. 19, the electronic device 1900 includes: a processor 1901, at least one communication bus 1902, at least one external communication interface 1904, and memory 1905. The communication bus 1902 is configured, among other things, to enable connective communication among these components. In an example, electronic device 1900 further includes: the user interface 1903, wherein the user interface 1903 may comprise a display screen and the external communication interface 1904 may comprise a standard wired interface and a wireless interface.
The Memory 1905 is configured to store instructions and applications executable by the processor 1901, and may also buffer data (e.g., image data, audio data, voice communication data, and video communication data) to be processed or already processed by the processor 1901 and modules in the electronic device, and may be implemented by a FLASH Memory (FLASH) or a Random Access Memory (RAM).
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrases "in one embodiment" or "in some embodiments" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in various embodiments of the present invention, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention. The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units; can be located in one place or distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as a removable Memory device, a Read Only Memory (ROM), a magnetic disk, or an optical disk.
Alternatively, the integrated unit of the present invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, a ROM, a magnetic or optical disk, or other various media that can store program code.
The above description is only an embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the present invention, and all such changes or substitutions are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.
Claims (15)
1. A method of ranging, the method comprising:
the method comprises the steps that a first device sends a first ranging frame to a second device, and a sending timestamp for sending the first ranging frame is recorded;
the first device receives a first response which is sent by the second device and used for responding to the first ranging frame, and records a receiving time stamp of the first response; wherein the sending of the first response is a hardware behavior of the second device;
the first equipment determines a target distance according to the sending time stamp and the receiving time stamp; the target distance is a distance between the first device and the second device.
2. The method of claim 1, wherein the first ranging frame comprises at least the following subfields: a response request subfield; the response request subfield to indicate whether the second device sends the first response to the first device; the method further comprises the following steps:
the first device sets a value of the response request subfield to a target value to instruct the second device to send the first response to the first device.
3. The method of claim 2, further comprising:
the first equipment acquires a reference time length; the reference duration is related to a time when the second device transmits the first response and a time when the first ranging frame is received;
correspondingly, the determining, by the first device, the target distance according to the sending timestamp and the receiving timestamp includes:
and the first equipment determines the target distance according to the sending time stamp, the receiving time stamp and the reference time length.
4. The method of claim 3, wherein determining the target distance based on the transmit timestamp, the receive timestamp, and the reference duration comprises:
determining a response interval according to the sending timestamp and the receiving timestamp;
determining signal transmission time according to the receiving time interval and the reference duration;
and determining the target distance according to the signal transmission time.
5. The method of claim 3, further comprising:
the first equipment determines a first processing sub-time length according to the length of the first ranging frame;
the first equipment determines a second processing sub-time length according to the length of the first response;
and the first equipment determines the reference time length according to the first processing sub-time length and the second processing sub-time length.
6. The method of claim 5, further comprising:
the first equipment determines the switching duration of the second equipment from a first state to a second state; the second device receiving the first ranging frame in the first state; the second equipment sends and receives the first response in the second state;
correspondingly, the determining, by the first device, the reference time length according to the first processing sub-time length and the second processing sub-time length includes:
and the first equipment determines the reference time length according to the first processing sub-time length, the second processing sub-time length and the switching time length.
7. The method of claim 1, further comprising:
and the first equipment sends a second ranging frame carrying the target distance to the second equipment.
8. The method of claim 7, wherein before the first device sends a second ranging frame to the second device, the method further comprises:
the first device determining a time interval between a current time and a time at which the first response is received;
and if the time interval is larger than a set time threshold, the first equipment determines to send a second ranging frame carrying the target distance to the second equipment.
9. A method of ranging, the method comprising:
the second equipment receives a first ranging frame sent by the first equipment;
the second device transmitting a first response to the first device in response to the first ranging frame; the sending of the first response is the hardware behavior of the second device; wherein the sending timestamp of the first ranging frame and the receiving timestamp of the first response sent by the first device are used for the first device to determine a target distance, and the target distance is a distance between the first device and the second device.
10. The method of claim 9, wherein the first ranging frame comprises at least the following subfields: a response request subfield; the response request subfield to indicate whether the second device sends the first response to the first device; the method further comprises the following steps:
the second device determines that the value of the response request subfield is a target value, and then determines to send the first response to the first device; the value of the response request subfield is the target value, instructing the second device to send the first response to the first device.
11. The method of claim 9, further comprising:
and the second equipment receives a second ranging frame which carries the target distance and is sent by the first equipment.
12. A ranging apparatus, applied to a first device, the apparatus comprising:
the first ranging module is used for sending a first ranging frame to second equipment and recording a sending time stamp for sending the first ranging frame;
a second ranging module, configured to receive a first response sent by the second device and used for responding to the first ranging frame, and record a receiving timestamp for receiving the first response; wherein the sending of the first response is a hardware behavior of the second device;
a determining module, configured to determine a target distance according to the sending timestamp and the receiving timestamp; the target distance is a distance between the first device and the second device.
13. A ranging apparatus, applied to a second device, the apparatus comprising:
a receiving module, configured to receive a first ranging frame sent by the first device;
a sending module, configured to send a first response to the first device, where the first response is used to respond to the first ranging frame; the sending of the first response is the hardware behavior of the second device; wherein the sending timestamp of the first ranging frame and the receiving timestamp of the first response sent by the first device are used for the first device to determine a target distance, and the target distance is a distance between the first device and the second device.
14. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the ranging method according to any one of claims 1 to 8 or implements the steps of the ranging method according to any one of claims 9 to 11 when executing the computer program.
15. A storage medium storing an executable program, wherein the executable program, when executed by a processor, implements the ranging method of any one of claims 1 to 8 or implements the ranging method of any one of claims 9 to 11.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110261172.4A CN113093101A (en) | 2021-03-10 | 2021-03-10 | Distance measuring method and device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110261172.4A CN113093101A (en) | 2021-03-10 | 2021-03-10 | Distance measuring method and device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113093101A true CN113093101A (en) | 2021-07-09 |
Family
ID=76666825
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110261172.4A Pending CN113093101A (en) | 2021-03-10 | 2021-03-10 | Distance measuring method and device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113093101A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113655437A (en) * | 2021-08-10 | 2021-11-16 | Oppo广东移动通信有限公司 | Ranging method, ranging apparatus, and storage medium |
CN113848543A (en) * | 2021-11-29 | 2021-12-28 | 华南理工大学 | Distance measurement positioning method and system for network node, electronic equipment and storage medium |
WO2023061011A1 (en) * | 2021-10-15 | 2023-04-20 | 华为技术有限公司 | Ranging method and apparatus |
CN117008050A (en) * | 2022-04-28 | 2023-11-07 | 比亚迪股份有限公司 | Vehicle ranging method and device, vehicle-mounted terminal, vehicle and storage medium |
CN117008049A (en) * | 2022-04-28 | 2023-11-07 | 比亚迪股份有限公司 | Vehicle ranging method and device, vehicle-mounted terminal, vehicle and storage medium |
WO2024001372A1 (en) * | 2022-06-27 | 2024-01-04 | 华为技术有限公司 | Initiation device, response device and information transmission method |
WO2024021853A1 (en) * | 2022-07-28 | 2024-02-01 | 华为技术有限公司 | Communication method and communication apparatus |
WO2024149026A1 (en) * | 2023-01-13 | 2024-07-18 | 华为技术有限公司 | Communication method and communication apparatus |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080231498A1 (en) * | 2004-11-15 | 2008-09-25 | Lars Menzer | Symmetrical Multi-Path Method For Determining the Distance Between Two Transmitter-Receivers |
US20120309416A1 (en) * | 2010-11-18 | 2012-12-06 | The Boeing Company | Geothentication based on network ranging |
US20140092746A1 (en) * | 2012-09-28 | 2014-04-03 | Futurewei Technologies, Inc. | System and Method for Response Frame Type indication |
CN107076826A (en) * | 2016-11-15 | 2017-08-18 | 深圳市大疆创新科技有限公司 | Ultra-broadband ranging method and apparatus, barrier-avoiding method and avoidance equipment |
CN107079399A (en) * | 2014-09-15 | 2017-08-18 | 高通股份有限公司 | For the enhancing technologies of IEEE 802.11 efficiently positioned |
CN107251621A (en) * | 2015-02-13 | 2017-10-13 | 高通股份有限公司 | Efficient ranging |
CN108964867A (en) * | 2018-09-28 | 2018-12-07 | 四川中电昆辰科技有限公司 | A kind of distance measuring method and range-measurement system |
-
2021
- 2021-03-10 CN CN202110261172.4A patent/CN113093101A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080231498A1 (en) * | 2004-11-15 | 2008-09-25 | Lars Menzer | Symmetrical Multi-Path Method For Determining the Distance Between Two Transmitter-Receivers |
US20120309416A1 (en) * | 2010-11-18 | 2012-12-06 | The Boeing Company | Geothentication based on network ranging |
US20140092746A1 (en) * | 2012-09-28 | 2014-04-03 | Futurewei Technologies, Inc. | System and Method for Response Frame Type indication |
CN107079399A (en) * | 2014-09-15 | 2017-08-18 | 高通股份有限公司 | For the enhancing technologies of IEEE 802.11 efficiently positioned |
CN107251621A (en) * | 2015-02-13 | 2017-10-13 | 高通股份有限公司 | Efficient ranging |
CN107076826A (en) * | 2016-11-15 | 2017-08-18 | 深圳市大疆创新科技有限公司 | Ultra-broadband ranging method and apparatus, barrier-avoiding method and avoidance equipment |
CN108964867A (en) * | 2018-09-28 | 2018-12-07 | 四川中电昆辰科技有限公司 | A kind of distance measuring method and range-measurement system |
Non-Patent Citations (1)
Title |
---|
孙骏毅: "2.4GHz_CMOS射频无线收发芯片的设计", 哈尔滨工业大学, 1 June 2011 (2011-06-01), pages 34 - 36 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113655437A (en) * | 2021-08-10 | 2021-11-16 | Oppo广东移动通信有限公司 | Ranging method, ranging apparatus, and storage medium |
WO2023061011A1 (en) * | 2021-10-15 | 2023-04-20 | 华为技术有限公司 | Ranging method and apparatus |
CN113848543A (en) * | 2021-11-29 | 2021-12-28 | 华南理工大学 | Distance measurement positioning method and system for network node, electronic equipment and storage medium |
CN117008050A (en) * | 2022-04-28 | 2023-11-07 | 比亚迪股份有限公司 | Vehicle ranging method and device, vehicle-mounted terminal, vehicle and storage medium |
CN117008049A (en) * | 2022-04-28 | 2023-11-07 | 比亚迪股份有限公司 | Vehicle ranging method and device, vehicle-mounted terminal, vehicle and storage medium |
WO2024001372A1 (en) * | 2022-06-27 | 2024-01-04 | 华为技术有限公司 | Initiation device, response device and information transmission method |
WO2024021853A1 (en) * | 2022-07-28 | 2024-02-01 | 华为技术有限公司 | Communication method and communication apparatus |
WO2024149026A1 (en) * | 2023-01-13 | 2024-07-18 | 华为技术有限公司 | Communication method and communication apparatus |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113093101A (en) | Distance measuring method and device, equipment and storage medium | |
KR102225144B1 (en) | Asymmetric double-sided two-way ranging in an ultrawideband communication system | |
TWI603106B (en) | Determination of device location in crowded indoor environments | |
CN109151796A (en) | NAN equipment finding method, relevant device and computer readable storage medium | |
US7299063B2 (en) | Wireless communication system, wireless communication device and wireless communication method, and computer program | |
EP4376469A1 (en) | Sensing signal measurement method and apparatus, network device, and terminal | |
US20120246265A1 (en) | Time synchronization in wireless networks | |
Despaux et al. | Accurate and platform-agnostic time-of-flight estimation in ultra-wide band | |
WO2023197224A1 (en) | Mobility management method and apparatus, and device and storage medium | |
US20230247580A1 (en) | Position determination method, apparatus, communication device, and storage medium | |
WO2023197986A1 (en) | Uwb signal transmission method and related apparatus | |
JP2021504676A (en) | How to determine the distance between two nodes | |
WO2022160298A1 (en) | Time synchronization method, apparatus and system | |
Ahmed et al. | Wsn06-3: Improving two-way ranging precision with phase-offset measurements | |
EP4397055A1 (en) | Positioning | |
JP2004085545A (en) | Radio communication system, device and method for radio communication, and computer program | |
CN111447026A (en) | Method and apparatus for processing data | |
WO2024156274A1 (en) | Communication method and apparatus | |
TWI843387B (en) | A communication method and a communications apparatus | |
WO2024217325A1 (en) | Ppdu transmission method and apparatus based on frequency band stitching | |
WO2024140462A1 (en) | Communication method and communication apparatus | |
WO2023185633A1 (en) | Communication method, apparatus, and system | |
WO2023202546A1 (en) | Sensing measurement result feedback method and apparatus based on ultra wideband | |
WO2023072130A1 (en) | Sensing measurement method and related apparatus | |
FI131060B1 (en) | Node positioning |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |