CN113655437A - Ranging method, ranging apparatus, and storage medium - Google Patents

Ranging method, ranging apparatus, and storage medium Download PDF

Info

Publication number
CN113655437A
CN113655437A CN202110912537.5A CN202110912537A CN113655437A CN 113655437 A CN113655437 A CN 113655437A CN 202110912537 A CN202110912537 A CN 202110912537A CN 113655437 A CN113655437 A CN 113655437A
Authority
CN
China
Prior art keywords
timestamp
corrected
difference
time stamp
electronic device
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.)
Withdrawn
Application number
CN202110912537.5A
Other languages
Chinese (zh)
Inventor
郭富祥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202110912537.5A priority Critical patent/CN113655437A/en
Publication of CN113655437A publication Critical patent/CN113655437A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO 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/00Position-fixing by co-ordinating two or more direction or position line determinations; Position-fixing by co-ordinating two or more distance determinations
    • G01S5/02Position-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

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 application discloses a distance measuring method, a distance measuring device and a storage medium. The distance measurement method comprises the following steps: the method comprises the steps of obtaining a first time stamp and a second time stamp, wherein the first time stamp is obtained according to the fact that a first radio frequency port of a distance measuring device receives a signal sent by an electronic device, and the second time stamp is obtained according to the fact that a second radio frequency port of the distance measuring device receives a signal sent by the electronic device; calculating a time difference between the first time stamp and the second time stamp; under the condition that the time difference is larger than a preset value, correcting the first timestamp according to the time difference; and calculating the distance between the distance measuring device and the electronic device based on the corrected first time stamp. In this application, compare the time difference of first time stamp and second time stamp with the default, under its condition that is greater than the default, confirm that sequencing device receives the influence of multipath effect to revise first time stamp based on the time difference, adopt the first time stamp of revising to carry out follow-up calculation, thereby reduce the influence of multipath effect, improve the range finding precision.

Description

Ranging method, ranging apparatus, and storage medium
Technical Field
The present application relates to the field of information technology, and in particular, to a distance measuring method, a distance measuring device, and a storage medium.
Background
In the existing device equipped with the UWB communication module, when ranging is performed by using the UWB technology, in an actual wireless transmission environment, electromagnetic waves are reflected by objects such as walls, glass, metal and the like to generate multipath signals, so that direct signals and the reflected multipath signals are overlapped in a time domain to cause signal distortion, the device cannot accurately identify the direct signals in the overlapped signals during reception, and a certain error is generated in the judgment of the reception time of the received direct signals. Therefore, when the device is interfered by multipath effect, the actually measured measuring distance has large error, and the positioning precision is not high.
Disclosure of Invention
The embodiment of the application provides a distance measuring method, a distance measuring device and a storage medium.
The distance measurement method in the embodiment of the application comprises the following steps:
the method comprises the steps of obtaining a first time stamp and a second time stamp, wherein the first time stamp is obtained according to the fact that a first radio frequency port of a distance measuring device receives a signal sent by an electronic device, and the second time stamp is obtained according to the fact that a second radio frequency port of the distance measuring device receives the signal sent by the electronic device;
calculating a time difference between the first timestamp and the second timestamp;
under the condition that the time difference is larger than a preset value, correcting the first timestamp according to the time difference;
calculating the distance between the distance measuring device and the electronic device based on the corrected first time stamp.
According to the ranging method, the time difference obtained by calculating the first time stamp and the second time stamp based on the first radio frequency port and the second radio frequency port for receiving the signals sent by the electronic device is compared with the preset value, under the condition that the time difference is larger than the preset value, the influence of the multipath effect on the sequencing device is confirmed, the first time stamp is corrected based on the time difference, the judgment error of the time for receiving the signals is reduced, the distance between the ranging device and the electronic device can be calculated by adopting the corrected first time stamp, the influence of the multipath effect is reduced, and the purpose of improving the ranging precision is achieved.
The embodiment of the present application provides a distance measuring device, the distance measuring device includes:
a first radio frequency port;
a second radio frequency port arranged at an interval with the first radio frequency port;
the first antenna is connected with the first radio frequency port and used for sending signals to an electronic device or receiving signals sent by the electronic device;
the second antenna is connected with the second radio frequency port and used for receiving the signal sent by the electronic device; and
the processor is used for acquiring a first time stamp and a second time stamp, the first time stamp is obtained according to a signal sent by an electronic device and received by a first radio frequency port of a distance measuring device, the second time stamp is obtained according to a signal sent by the electronic device and received by a second radio frequency port of the distance measuring device, calculating a time difference between the first time stamp and the second time stamp, correcting the first time stamp according to the time difference under the condition that the time difference is greater than a preset value, and calculating the distance between the distance measuring device and the electronic device based on the corrected first time stamp.
Embodiments of the present application provide a non-transitory computer-readable storage medium of computer-executable instructions, which, when executed by one or more processors, cause the processors to perform the ranging method described in any of the above embodiments.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The above and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flow chart of a ranging method in an embodiment of the present application;
FIG. 2 is a schematic plan view of a distance measuring device according to an embodiment of the present application;
fig. 3 is a schematic connection diagram of a UWB communication module, a first antenna, and a second antenna in a ranging apparatus according to an embodiment of the present application;
FIG. 4 is a block diagram of a ranging system in an embodiment of the present application;
fig. 5 is a schematic flow chart of a ranging method according to an embodiment of the present application;
fig. 6 is a schematic flow chart of a ranging method according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a scenario in which a ranging device and an electronic device transmit UWB signals based on two-way ranging interaction logic according to an embodiment of the present application;
fig. 8 is a schematic flow chart of a ranging method according to an embodiment of the present application;
fig. 9 is a flowchart illustrating a ranging method according to an embodiment of the present application.
Description of the main element symbols:
the ranging device 100, the UWB communication module 11, the first radio frequency port 110, the second radio frequency port 111, the processor 12, the first antenna 13, the second antenna 14, the electronic device 200, the UWB tag 21, and the ranging system 1000.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative and are only for the purpose of explaining the present application and are not to be construed as limiting the present application.
The following disclosure provides many different embodiments or examples for implementing different features of the application. In order to simplify the disclosure of the present application, specific example components and arrangements are described below. Of course, they are merely examples and are not intended to limit the present application. Moreover, the present application may repeat reference numerals and/or letters in the various examples, such repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed. In addition, examples of various specific processes and materials are provided herein, but one of ordinary skill in the art may recognize applications of other processes and/or use of other materials.
Referring to fig. 1, fig. 2 and fig. 3, an embodiment of the present application provides a distance measuring method, including:
step S10: acquiring a first timestamp and a second timestamp, where the first timestamp is obtained according to a signal sent by the electronic device 200 (shown in fig. 4) received by the first rf port 110 of the ranging device 100, and the second timestamp is obtained according to a signal sent by the electronic device 200 received by the second rf port 111 of the ranging device 100;
step S20: calculating a time difference between the first time stamp and the second time stamp;
step S30: under the condition that the time difference is larger than a preset value, correcting the first timestamp according to the time difference;
step S40: the distance between the ranging device 100 and the electronic device 200 is calculated based on the corrected first time stamp.
Referring to fig. 2 and fig. 3, a distance measuring device 100 according to an embodiment of the present disclosure is provided, where the distance measuring device 100 includes a first rf port 110, a second rf port 111, a first antenna 13, a second antenna 14, and a processor 12. The first rf port 110 and the second rf port 111 are arranged at an interval, the first antenna 13 is connected to the first rf port 110, the second antenna 14 is connected to the second rf port 111, the first antenna 13 is configured to send a signal to the electronic device 200 or receive a signal sent by the electronic device 200, the second antenna 14 is configured to receive a signal sent by the electronic device 200, and the processor 12 is configured to implement the ranging method.
The distance measurement method according to the embodiment of the present application can be realized by the distance measurement device 100 according to the embodiment of the present application. For example, the steps S10, S20, S30 and S40 may be implemented by the processor 12 of the ranging apparatus 100. Or, the processor 12 is configured to obtain a first timestamp and a second timestamp, where the first timestamp is obtained according to a signal sent by the electronic device 200 and received by the first rf port 110 of the ranging apparatus 100, the second timestamp is obtained according to a signal sent by the electronic device 200 and received by the second rf port 111 of the ranging apparatus 100, calculate a time difference between the first timestamp and the second timestamp, correct the first timestamp according to the time difference if the time difference is greater than a preset value, and calculate a distance between the ranging apparatus 100 and the electronic device 200 based on the corrected first timestamp.
Referring to fig. 4, the present application further provides a distance measuring system 1000, where the distance measuring system 1000 includes an electronic device 200 and a distance measuring device 100. Wherein, the electronic device 200 is configured to send a signal to the ranging device 100 or receive a signal sent by the ranging device 100, the ranging device 100 is configured to obtain a first timestamp and a second timestamp, the first timestamp is obtained according to the first rf port 110 of the ranging device 100 receiving the signal sent by the electronic device 200, the second timestamp is obtained according to the second rf port 111 of the ranging device 100 receiving the signal sent by the electronic device 200, and is configured to calculate a time difference between the first timestamp and the second timestamp, and is configured to correct the first timestamp according to the time difference if the time difference is greater than a preset value, and is configured to calculate a distance between the ranging device 100 and the electronic device 200 based on the corrected first timestamp.
According to the ranging method, the time difference obtained by calculating the first time stamp and the second time stamp based on the first radio frequency port 110 and the second radio frequency port 111 for receiving the signals sent by the electronic device 200 is compared with the preset value, the influence of the multipath effect on the sequencing device is confirmed under the condition that the time difference is greater than the preset value, and the first time stamp is corrected based on the time difference, so that the distance between the ranging device 100 and the electronic device 200 can be calculated by adopting the corrected first time stamp, the influence of the multipath effect is reduced, and the purpose of ranging precision is improved.
Specifically, the distance measuring device 100 in the present application may be a smart device such as a smart phone, a tablet computer, or a notebook computer, which is installed with an Ultra Wide Band (UWB) communication module 11, and the distance measuring device 100 may perform UWB communication with the electronic device 200 to perform distance measuring and positioning on the electronic device 200 based on UWB technology, so it can be understood that the electronic device 200 may be any product device provided with a UWB tag 21, such as a watch, a bracelet, an earphone, and glasses.
UWB is a radio technology with the highest positioning accuracy up to now, and has a higher time resolution and a certain resistance to multipath effect compared to a conventional narrowband system, thereby being suitable for high-accuracy positioning or ranging. In the development of modern smart phones, UWB technology is also being applied gradually to locate articles provided with UWB tags, thereby facilitating finding articles and playing a role in preventing loss and the like.
Currently, ranging of UWB technology is mainly applied to TOF (Time of Flight) based algorithms. The travel time of the wireless signal from the transmitting device to the receiving device is calculated by recording the transceiving time stamp of the ranging message, and then the travel time is multiplied by the speed of light to obtain the distance between the devices. The method can be divided into one-way ranging and two-way ranging according to different transmission modes of ranging messages, wherein the ranging messages in the one-way ranging are only transmitted in one way, the two devices need to keep accurate clock synchronization for obtaining the flight time between the devices, the system has high complexity and cost for realizing, the two-way ranging has no requirement on the clock synchronization of the two devices, and the system has low complexity and cost for realizing.
It should be further noted that when the UWB technology is applied in the ranging process, although the UWB technology has a certain anti-multipath capability, in an indoor/outdoor environment with many obstacles, transmitted electromagnetic waves are reflected by objects such as walls, glass, metal, and the like, and generate multipath signals, so that the direct signals and the reflected multipath signals overlap in a time domain, which causes distortion of the signals, and the device cannot accurately identify the direct signals in the superimposed signals during reception, which causes a certain error in the determination of the reception time of the received direct signals. That is to say, between the distance measuring device equipped with the UWB communication module and the electronic device provided with the UWB tag, when ranging based on UWB, the interference due to the multipath effect is still easily received, so that the error of the actually measured measurement distance is large, and the positioning accuracy is not high.
Based on this, the present application provides a ranging method, which is applied in a ranging system 1000 formed by a ranging device 100 and an electronic device 200 together, so as to reduce the influence of multipath effect in the ranging process. In particular, UWB of the present application refers to UWB technology in the 802.15.4 protocol.
In particular, the distance measuring device 100 applying the distance measuring method in the present application needs to be installed with two antennas, that is, the first antenna 13 and the second antenna 14, and the first antenna 13 and the second antenna 14 are installed inside the distance measuring device 100 for implementing the signal transceiving function of the distance measuring device 100. The first antenna 13 may be connected to the first rf port 110, and the first rf port 110 may be a TRX port, so that the first antenna 13 may transmit signals to the electronic apparatus 200 through the first rf port 110, and the first antenna 13 may also be used to receive signals transmitted through the electronic apparatus 200; the second antenna 14 may be connected to the second rf port 111, and the second rf port 111 may be an RX port, so that the second antenna 14 may receive signals transmitted by the electronic device 200 via the second rf port 111. In addition, the above communication between the distance measuring device 100 and the electronic device 200 is based on the UWB technology.
In one embodiment of the present application, a TWR (Two-Way Ranging) method is used, Two-Way communication is supported between the Ranging apparatus 100 mounted with the UWB communication module 11 and the electronic apparatus 200 provided with the UWB tag 21, the single time of flight of the UWB signal is calculated by recording the UWB signal transceiving time stamp of each side apparatus, and then the single time of flight is multiplied by the speed of light to obtain the actual distance information between the Ranging apparatus 100 and the electronic apparatus 200. It can be understood that, due to interference of multipath effect, the timestamp information of the ranging apparatus 100 used in calculating the single time of flight may have a certain error, and when the error is too large, the accuracy of the calculated single time of flight is not high, and the result obtained when calculating the distance between apparatuses based on the single time of flight is not accurate.
Then, according to the present distance measuring method, the time stamp recorded when the distance measuring apparatus 100 having two antennas is receiving the signal can be corrected. In step S10, the processor 12 of the ranging apparatus 100 may acquire the first time stamp and the second time stamp. The first timestamp is recorded when the first antenna 13 of the ranging apparatus 100 receives the signal sent by the electronic apparatus 200 through the first rf port 110, and the second timestamp is recorded when the second antenna 14 of the ranging apparatus 100 receives the signal sent by the electronic apparatus 200 through the second rf port 111.
It should be noted that the signal sent by the electronic device 200 may be a signal actively sent by the electronic device 200 in the ranging process, that is, the electronic device 200 is used as an active side for sending the signal; the electronic device 200 may also receive a signal transmitted by the first antenna 13 of the distance measuring device 100 and then return the signal to the distance measuring device 100, that is, the distance measuring device 100 may be the master of the signal transmission. In either case, the distance measuring device 100 and the electronic device 200 record the time stamp when receiving and transmitting the signal, and in the present application, the distance measuring device 100 is the default of the active transmission source of the signal.
In step S20, the processor 12 of the ranging apparatus 100 may calculate a time difference between the first time stamp and the second time stamp. Here, the time difference calculated in step S20 is the time difference between the first antenna 13 and the second antenna 14 in the distance measuring device 100 receiving the signal transmitted by the electronic device 200. The time Difference is denoted as TDoA (time Difference of arrival), and the time Difference is the first time stamp minus the second time stamp based on the setting of step S20, and then under this setting, when TDoA is less than zero, it means that the first antenna 13 receives a signal earlier than the second antenna 14 in the ranging apparatus 100; when TDoA is greater than zero, it means that the first antenna 13 receives a signal later than the second antenna 14 in the ranging apparatus 100.
In step S30, the processor 12 may determine whether the time difference is greater than a preset value, and correct the first timestamp according to the time difference if the time difference is greater than the preset value. The preset value can be determined according to the distance measurement precision required actually. For example, it is known that a measurement error of 10cm is caused when the time difference is 0.3ns, and in the case where the preset value is set to 0.3ns, the time difference is corrected when it exceeds 0.3ns, that is, the first timestamp is corrected when the measurement error exceeds 10 cm.
The preset value needs to be a positive number, and when the time difference is smaller than the preset value, the time error of the signals received by the first antenna 13 and the second antenna 14 is considered to be smaller, so that the first timestamp can not be corrected; in case the time difference is larger than the predetermined value, then the first antenna 13 receives the signal significantly later than the second antenna 14, and the error cannot be ignored, and the first timestamp should be corrected in time based on the time difference.
It should be noted that, since the first rf port 110 of the first antenna 13 for rf electrical connection is a TRX port, the ranging apparatus 100 can send a signal to the electronic apparatus 200 through the first antenna 13, and when calculating the single time of flight TOF, the time stamps of the ranging apparatus 100 that are needed are all time stamps generated by recording with respect to the first antenna 13. At this time, although the second antenna 14 can record the second time stamp by the UWB communication module 11 of the distance measuring device 100, the second time stamp only serves to assist in correcting the first time stamp, and does not directly participate in the calculation of the time of flight.
Thus, because the first antenna 13 receives the signal through the first rf port 110, so that the measured first timestamp directly participates in the calculation of the flight time, then under the condition that the time difference is greater than the preset value, the first antenna 13 obviously receives the signal later than the second antenna 14, and it can be considered that the first antenna 13 is interfered by the multipath effect, so that the time at which the first antenna 13 actually receives the signal is judged to be wrong, and the recorded first timestamp is obviously later than the second timestamp, so that the first timestamp needs to be corrected to improve the measurement accuracy.
In step S40, the processor 12 may calculate a distance between the ranging device 100 and the electronic device 200 based on the corrected first timestamp. It is understood that, in the step S30, the scenario that the first timestamp needs to be corrected is described, and then the corrected first timestamp should be smaller in value than the first timestamp, and in the case that the distance between the ranging apparatus 100 and the electronic apparatus 200 is calculated by the corrected first timestamp, the measured distance result can be made more accurate.
The distance between the distance measuring device 100 and the electronic device 200 can be obtained by first calculating the single time of flight based on the corrected first timestamp and then multiplying the single time of flight by the speed of light.
Referring to fig. 5, in some embodiments, the correcting the first timestamp according to the time difference (step S30) includes:
step S31: the time difference is subtracted from the first timestamp to obtain a corrected first timestamp.
In some embodiments, processor 12 in ranging device 100 is configured to subtract the time difference from the first time stamp to obtain a corrected first time stamp.
In this way, the first timestamp is obtained by subtracting the time difference from the first timestamp, so that when the first antenna 13 receives the signal sent by the electronic device 200, the signal delay caused by the multipath effect or the judgment error of the received signal time caused by the multipath effect can be corrected, and thus, in the subsequent calculation process, the accuracy of the measured distance is improved.
Specifically, in step S31, in the case that the time difference is greater than the preset value, it represents that the first antenna 13 receives signals significantly later than the second antenna 14, and it can be considered that the first antenna 13 is interfered by the multipath effect, so that the first timestamp needs to be corrected to improve the measurement accuracy in step S30.
It is understood that, at this time, the actual time when the first antenna 13 receives the signal is earlier than the recorded first time stamp, then, due to the second antenna 14, the second time stamp recorded by the UWB communication module 11 may play a role of auxiliary correction for the first time stamp, that is, the first time stamp may be subtracted by the time difference to obtain a corrected first time stamp.
The method is simple and easy to implement, and the distance between the ranging device 100 and the electronic device 200 can be measured subsequently after the corrected first timestamp is easily obtained, so as to improve the ranging accuracy.
Referring to fig. 6, in some embodiments, calculating the distance between the ranging device 100 and the electronic device 200 based on the corrected first timestamp (step S40) includes:
step S41: acquiring a third timestamp, wherein the third timestamp is obtained according to a record when the ranging device 100 sends a signal to the electronic device 200;
step S42: acquiring a fourth timestamp, wherein the fourth timestamp is obtained according to a signal sent by the distance measuring device 100 received by the electronic device 200;
step S43: acquiring a fifth timestamp, wherein the fifth timestamp is obtained according to a record when the electronic device 200 sends a signal to the ranging device 100;
step S44: subtracting the third time stamp from the corrected first time stamp to obtain a corrected first difference value, and subtracting the fourth time stamp from the fifth time stamp to obtain a second difference value;
step S45: and subtracting the second difference value from the corrected first difference value to obtain a corrected third difference value, and processing the corrected third difference value to obtain the distance.
In some embodiments, processor 12 is configured to obtain a third timestamp from a record of when ranging device 100 sent a signal to electronic device 200, and to obtain a fourth timestamp from a record of when electronic device 200 received a signal sent by ranging device 100, and to obtain a fifth timestamp from a record of when electronic device 200 sent a signal to ranging device 100, and to subtract the third timestamp from the modified first timestamp to obtain a modified first difference, subtract the fourth timestamp from the fifth timestamp to obtain a second difference, and to subtract the second difference from the modified first difference to obtain a modified third difference, and to process the modified third difference to obtain a distance.
Thus, the time of flight, i.e., the third difference, can be obtained through the above calculation, and since the first timestamp directly used for calculating the time of flight has been corrected, the calculated third difference is also the corrected third difference, so that the accuracy of ranging can be improved by using the corrected third difference in subsequent calculations.
Specifically, since in one embodiment, the TWR ranging method is adopted, and the ranging apparatus 100 is used as an active sending device to actively send a signal to the electronic apparatus 200, as shown in fig. 7, the basic interaction logic of the TWR ranging method is as follows: at a first time, ranging device 100 sends a first signal to electronic device 200; at a second time, the electronic device 200 receives the first signal; at the third time, the electronic device 200 transmits the second signal to the ranging device 100; at a fourth time, ranging device 100 receives the second signal. The ranging device 100 and the electronic device 200 record corresponding time stamps when receiving and transmitting signals. The first time, the second time, the third time, and the fourth time are indicated as circles marked with reference numerals in the drawing.
Then, based on this interaction logic, in step S41, the processor 12 may obtain a third timestamp at the first time, i.e., the third timestamp is recorded when the ranging device 100 sends the first signal to the electronic device 200; in step S42, the processor 12 may obtain a fourth timestamp at the second time, where the fourth timestamp is recorded at the time when the electronic device 200 receives the first signal sent by the distance measuring device 100; in step S43, the processor 12 may obtain a fifth timestamp at the third time, where the fifth timestamp is recorded when the electronic device 200 transmits the second signal to the distance measuring device 100.
In this way, in steps S41, S42, and S43, the processor 12 has obtained the third time stamp, the fourth time stamp, and the fifth time stamp, and, in steps S10-S30, the processor 12 has obtained a corrected first time stamp corrected based on the first time stamp recorded at the time when the distance measuring device 100 received the second signal transmitted by the electronic device 200 at the fourth time.
Then, steps S44 and S45 can be performed, based on the existing time-of-flight algorithm:
TOF ═ i (first timestamp' -third timestamp) - (fifth timestamp-fourth timestamp);
the total time of flight TOF of the first signal and the second signal is calculated. Wherein the content of the first and second substances,
first timestamp ═ first timestamp — time difference;
the time difference is the first time stamp to the second time stamp.
Thus, after the flight time TOF is calculated, that is, the third difference corrected in step S45 is obtained, since it is known that the first signal and the second signal both fly at the speed of light, the positions of the ranging apparatus 100 and the electronic apparatus 200 are also kept unchanged during the ranging process at the moment when the signals are transmitted back and forth, and then the single flight time between the ranging apparatus and the electronic apparatus is obtained by dividing the third difference by two. After the single flight time is obtained, the distance between the distance measuring device 100 and the electronic device 200 can be calculated by multiplying the single flight time by the speed of light.
Referring to fig. 8, in some embodiments, the ranging method may further include:
step S46: under the condition that the time difference is larger than the preset value, correcting the fourth timestamp according to the time difference;
step S47: and calculating the distance between the ranging device 100 and the electronic device 200 based on the corrected first time stamp and the corrected fourth time stamp.
In some embodiments, the processor 12 is configured to correct the fourth timestamp according to the time difference if the time difference is greater than the preset value, and to calculate the distance between the ranging apparatus 100 and the electronic apparatus 200 based on the corrected first timestamp and the corrected fourth timestamp.
In this manner, by correcting the fourth time stamp and then calculating the distance between the distance measuring device 100 and the electronic device 200 based on the corrected fourth time stamp and the corrected first time stamp, the accuracy of the calculated distance can be improved in a certain procedure.
In particular, in the above-described embodiment, since the obstruction between the ranging apparatus 100 and the electronic apparatus 200 can be reciprocal, the transceiving channels are similar, the multi-path lengths are similar, and the ranging time based on the UWB technology is short. Then, when the distance measuring device 100 receives the second signal, if the calculated time difference is greater than the preset value, it represents that the first antenna 13 of the distance measuring device 100 is subjected to multipath interference, and a certain judgment error exists in the obtained first time stamp, which results in that the first time stamp is obviously later than the second time stamp, it is deduced forward that there is also a judgment error when the electronic device 200 receives the first signal, which is substantially the same as the judgment error occurring when the distance measuring device 100 receives the second signal in terms of time length, and then the fourth time stamp may be corrected according to the time difference obtained in step S20.
In particular, when the correction is performed, the data packet carrying the fourth timestamp and transmitted by the electronic device 200 may be received via the processor 12, so that the processor 12 may obtain the fourth timestamp to perform the correction. In this way, in step S47, a more accurate TOF may be calculated based on the corrected first time stamp and the corrected fourth time stamp, so that the distance between the distance measuring device 100 and the electronic device 200 is calculated more accurately.
Referring to fig. 9, in some embodiments, calculating a distance between the ranging device 100 and the electronic device 200 based on the corrected first timestamp and the corrected fourth timestamp (step S47) includes:
step S470: subtracting the corrected fourth timestamp from the fifth timestamp to obtain a corrected second difference;
step S471: and subtracting the corrected second difference value from the corrected first difference value to obtain a corrected fourth difference value, and processing the corrected fourth difference value to obtain the distance.
In some embodiments, the processor 12 is configured to subtract the corrected fourth timestamp from the fifth timestamp to obtain a corrected second difference, and to subtract the corrected second difference from the corrected first difference to obtain a corrected fourth difference, and to process the corrected fourth difference to obtain the distance.
Therefore, more accurate flight time, namely the fourth difference value, can be obtained through the calculation, and the fourth difference value obtained through calculation is also the corrected fourth difference value because the first time stamp and the fourth time stamp which are directly used for calculating the more accurate flight time are corrected, so that the accuracy of ranging can be further improved by adopting the corrected fourth difference value in subsequent calculation.
In particular, still based on the above interaction logic of the TWR, in step S470, the processor 12 may subtract the fifth timestamp obtained at the third time instant from the fourth timestamp corrected in step S46, thereby correcting the second difference as well. Then in step S471 the total time of flight between the distance measuring device and the electronic device of the further modified first signal and the second signal is recalculated:
TOF ═ i (first timestamp '-third timestamp) - (fifth timestamp-fourth timestamp');
wherein the fourth timestamp is a fourth timestamp-time difference;
thus, if the calculated time-of-flight that is further corrected corresponds to the fourth difference corrected in step S471, the single time-of-flight that is further corrected is obtained by dividing the fourth difference by two. After the further corrected single flight time is obtained, the distance between the distance measuring device 100 and the electronic device 200 can be calculated by multiplying the single flight time by the speed of light.
In some embodiments, the first antenna 13 may be spaced from the second antenna 14 by a distance less than the operating frequency wavelength of the ranging device 100. In this way, the distance between the first antenna 13 and the second antenna 14 is set to be smaller than the operating frequency wavelength of the ranging device 100, so that the second antenna 14 can better correct the timestamp recorded when the first antenna 13 receives the signal.
Specifically, the operating frequency wavelength of the distance measuring device 100, that is, the operating frequency wavelength of the UWB communication module 11 installed in the distance measuring device 100, is generally selected to be between 6.5GHz and 8GHz, and the distance is approximately between 3.7cm and 4.6cm according to the conversion relationship between the wavelength and the distance, that is, the distance between the first antenna 13 and the second antenna 14 may be between 3.7cm and 4.6 cm.
It will be appreciated that too close or too far apart of the first antenna 13 and the second antenna 14 will defeat the purpose of the timestamp obtained when the second antenna 14 assists in correcting the received signal of the first antenna 13. Furthermore, the internal structure of the distance measuring device 100 needs to be compact to accommodate more components, and it is preferable that the first antenna 13 and the second antenna 14 are as close as possible to each other, for example, less than half of the wavelength of the operating frequency of the distance measuring device 100, which is 1.8cm to 2.3cm, while ensuring the calibration function of the second antenna 14. Of course, the embodiment of the present application does not limit the specific separation distance, and the two distance ranges are only referred to in the preferred embodiment, so as to meet the practical requirements in application.
In some embodiments, the ranging method may also be applied to the ranging device and the electronic device to perform the distance calculation based on the SS-TWR algorithm, and may be applied to implement the distance calculation based on the DS-TWR algorithm. Because the algorithm is required to be established on the basis of obtaining the flight time when measuring the distance, the method can correct the timestamp parameters required by calculating the flight time, thereby reducing the influence of certain multipaths and improving the ranging precision.
The present embodiments provide a non-transitory computer-readable storage medium storing a computer program, which, when executed by one or more processors 12, causes the processors 12 to execute the ranging method of any one of the above embodiments.
For example, the computer program, when executed by the one or more processors 12, causes the processors 12 to perform the steps of:
step S10: acquiring a first timestamp and a second timestamp, wherein the first timestamp is obtained according to a signal sent by the electronic device 200 and received by a first radio frequency port 110 of the ranging device 100, and the second timestamp is obtained according to a signal sent by the electronic device 200 and received by a second radio frequency port 111 of the ranging device 100;
step S20: calculating a time difference between the first time stamp and the second time stamp;
step S30: under the condition that the time difference is larger than a preset value, correcting the first timestamp according to the time difference;
step S40: the distance between the ranging device 100 and the electronic device 200 is calculated based on the corrected first time stamp.
Specifically, the processor 12 may be a Central Processing Unit (CPU). The Processor 12 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or any combination thereof.
The computer program may be stored in a memory, which is a non-transitory computer readable storage medium, operable to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the methods in the above-described method embodiments. The processor 12 executes various functional applications of the processor 12 and the ranging by running non-transitory software programs, instructions, and modules stored in the memory, that is, implementing the methods in the above-described method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, and the implemented program can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD) or a Solid State Drive (SSD), etc.; the storage medium may also comprise a combination of memories of the kind described above.
In the description herein, references to the description of the terms "one embodiment," "certain embodiments," "an illustrative embodiment," "an example," "a specific example," or "some examples" or the like mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present application have been shown and described, it will be understood by those of ordinary skill in the art that: numerous changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the application, the scope of which is defined by the claims and their equivalents.

Claims (10)

1. A method for ranging, the method comprising:
the method comprises the steps of obtaining a first time stamp and a second time stamp, wherein the first time stamp is obtained according to the fact that a first radio frequency port of a distance measuring device receives a signal sent by an electronic device, and the second time stamp is obtained according to the fact that a second radio frequency port of the distance measuring device receives the signal sent by the electronic device;
calculating a time difference between the first timestamp and the second timestamp;
under the condition that the time difference is larger than a preset value, correcting the first timestamp according to the time difference;
calculating the distance between the distance measuring device and the electronic device based on the corrected first time stamp.
2. The ranging method of claim 1, wherein the correcting the first timestamp according to the time difference comprises:
subtracting the time difference from the first timestamp to obtain a corrected first timestamp.
3. The method of claim 1, wherein calculating the distance between the ranging device and the electronic device based on the corrected first timestamp comprises:
acquiring a third timestamp, wherein the third timestamp is obtained according to recording when the distance measuring device sends a signal to the electronic device;
acquiring a fourth timestamp, wherein the fourth timestamp is obtained according to the signal sent by the distance measuring device and received by the electronic device;
acquiring a fifth timestamp, wherein the fifth timestamp is obtained according to the record when the electronic device sends a signal to the distance measuring device;
subtracting the third timestamp from the corrected first timestamp to obtain a corrected first difference value, and subtracting the fourth timestamp from the fifth timestamp to obtain a second difference value;
and subtracting the second difference from the corrected first difference to obtain a corrected third difference, and processing the corrected third difference to obtain the distance.
4. The ranging method according to claim 3, wherein the ranging method comprises:
under the condition that the time difference is larger than a preset value, correcting the fourth timestamp according to the time difference;
calculating the distance between the distance measuring device and the electronic device based on the corrected first time stamp and the corrected fourth time stamp.
5. The ranging method of claim 4, wherein calculating the distance between the ranging device and the electronic device based on the corrected first timestamp and the corrected fourth timestamp comprises:
subtracting the corrected fourth timestamp from the fifth timestamp to obtain a corrected second difference;
and subtracting the corrected second difference from the corrected first difference to obtain a corrected fourth difference, and processing the corrected fourth difference to obtain the distance.
6. A ranging apparatus, comprising:
a first radio frequency port;
a second radio frequency port arranged at an interval with the first radio frequency port;
the first antenna is connected with the first radio frequency port and used for sending signals to an electronic device or receiving signals sent by the electronic device;
the second antenna is connected with the second radio frequency port and used for receiving the signal sent by the electronic device; and
the processor is used for acquiring a first time stamp and a second time stamp, the first time stamp is obtained according to a signal sent by an electronic device and received by a first radio frequency port of a distance measuring device, the second time stamp is obtained according to a signal sent by the electronic device and received by a second radio frequency port of the distance measuring device, calculating a time difference between the first time stamp and the second time stamp, correcting the first time stamp according to the time difference under the condition that the time difference is greater than a preset value, and calculating the distance between the distance measuring device and the electronic device based on the corrected first time stamp.
7. The range-finding device of claim 6, wherein the processor is configured to obtain a third timestamp, and wherein the third timestamp is recorded from the time the range-finding device sends a signal to the electronic device, and wherein the processor is configured to obtain a fourth timestamp, the fourth timestamp is obtained according to the signal sent by the distance measuring device and received by the electronic device, and is used for obtaining a fifth timestamp, the fifth timestamp is obtained according to a record when the electronic device sends a signal to the ranging device, and is used for subtracting the third timestamp from the corrected first timestamp to obtain a corrected first difference value, subtracting the fourth timestamp from the fifth timestamp to obtain a second difference value, and the distance processing unit is used for subtracting the second difference from the corrected first difference to obtain a corrected third difference, and processing the corrected third difference to obtain the distance.
8. The ranging device as claimed in claim 7, wherein the processor is configured to correct the fourth timestamp according to the time difference if the time difference is greater than a preset value, and to calculate a distance between the ranging device and the electronic device based on the corrected first timestamp and the corrected fourth timestamp.
9. The range finder device of claim 8, wherein the processor is configured to subtract the corrected fourth timestamp from the fifth timestamp to obtain a corrected second difference, and to subtract the corrected second difference from the corrected first difference to obtain a corrected fourth difference, and to process the corrected fourth difference to obtain the distance.
10. A non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by one or more processors, implements the ranging method of any one of claims 1-5.
CN202110912537.5A 2021-08-10 2021-08-10 Ranging method, ranging apparatus, and storage medium Withdrawn CN113655437A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110912537.5A CN113655437A (en) 2021-08-10 2021-08-10 Ranging method, ranging apparatus, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110912537.5A CN113655437A (en) 2021-08-10 2021-08-10 Ranging method, ranging apparatus, and storage medium

Publications (1)

Publication Number Publication Date
CN113655437A true CN113655437A (en) 2021-11-16

Family

ID=78491052

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110912537.5A Withdrawn CN113655437A (en) 2021-08-10 2021-08-10 Ranging method, ranging apparatus, and storage medium

Country Status (1)

Country Link
CN (1) CN113655437A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114222247A (en) * 2022-01-28 2022-03-22 Oppo广东移动通信有限公司 UWB ranging method, device, terminal equipment and storage medium
TWI820600B (en) * 2021-12-02 2023-11-01 大陸商立訊電子科技(昆山)有限公司 Wireless headset, mobile phone and method for measuring distances by soundwaves
TWI825879B (en) * 2022-07-29 2023-12-11 宏碁股份有限公司 Detection device and detection method with calibration function

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130336131A1 (en) * 2012-06-14 2013-12-19 Qualcomm Atheros, Inc. Rtt based ranging system and method
CN104620127A (en) * 2012-09-11 2015-05-13 高通股份有限公司 Method for precise location determination
WO2016181197A1 (en) * 2015-05-14 2016-11-17 Telefonaktiebolaget Lm Ericsson (Publ) High-accuracy round trip time (rtt) ranging
US10278155B1 (en) * 2018-01-19 2019-04-30 Cisco Technology, Inc. Monitor radio assisted fine timing measurement for location applications
WO2020165227A1 (en) * 2019-02-14 2020-08-20 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Apparatus, method and computer program for localizing a tag
CN111650575A (en) * 2020-05-30 2020-09-11 Oppo广东移动通信有限公司 Obstacle detection method, obstacle detection device, electronic device, and storage medium
EP3822662A1 (en) * 2019-11-15 2021-05-19 Daniel Neuhold High precision uwb distance determination
CN112946569A (en) * 2021-02-01 2021-06-11 Oppo广东移动通信有限公司 Measuring distance correction method, measuring distance correction device, measuring distance correction medium, and electronic device
CN113093101A (en) * 2021-03-10 2021-07-09 Oppo广东移动通信有限公司 Distance measuring method and device, equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130336131A1 (en) * 2012-06-14 2013-12-19 Qualcomm Atheros, Inc. Rtt based ranging system and method
CN104620127A (en) * 2012-09-11 2015-05-13 高通股份有限公司 Method for precise location determination
WO2016181197A1 (en) * 2015-05-14 2016-11-17 Telefonaktiebolaget Lm Ericsson (Publ) High-accuracy round trip time (rtt) ranging
US10278155B1 (en) * 2018-01-19 2019-04-30 Cisco Technology, Inc. Monitor radio assisted fine timing measurement for location applications
WO2020165227A1 (en) * 2019-02-14 2020-08-20 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Apparatus, method and computer program for localizing a tag
EP3822662A1 (en) * 2019-11-15 2021-05-19 Daniel Neuhold High precision uwb distance determination
CN111650575A (en) * 2020-05-30 2020-09-11 Oppo广东移动通信有限公司 Obstacle detection method, obstacle detection device, electronic device, and storage medium
CN112946569A (en) * 2021-02-01 2021-06-11 Oppo广东移动通信有限公司 Measuring distance correction method, measuring distance correction device, measuring distance correction medium, and electronic device
CN113093101A (en) * 2021-03-10 2021-07-09 Oppo广东移动通信有限公司 Distance measuring method and device, equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI820600B (en) * 2021-12-02 2023-11-01 大陸商立訊電子科技(昆山)有限公司 Wireless headset, mobile phone and method for measuring distances by soundwaves
CN114222247A (en) * 2022-01-28 2022-03-22 Oppo广东移动通信有限公司 UWB ranging method, device, terminal equipment and storage medium
CN114222247B (en) * 2022-01-28 2023-08-29 Oppo广东移动通信有限公司 UWB ranging method, device, terminal equipment and storage medium
TWI825879B (en) * 2022-07-29 2023-12-11 宏碁股份有限公司 Detection device and detection method with calibration function

Similar Documents

Publication Publication Date Title
CN113655437A (en) Ranging method, ranging apparatus, and storage medium
CN110857973B (en) Arrival angle estimation method and device
US9157991B2 (en) Mechanism for proximity detection based on Wi-Fi signals
US9055523B2 (en) Apparatus, system and method of calibrating a radio delay of a wireless device
US10928479B2 (en) Apparatus and method for determining a distance to an object
KR101836837B1 (en) METHOD FOR Time difference compensation in positioning system and positioning system therefor
EP2745135B1 (en) Method and apparatus for modeling timing relationships between clocks
CN113009461B (en) Improved single-side two-way distance measuring method, equipment, system and medium based on UWB
US20140256352A1 (en) Method for measuring position of user terminal
EP2901576B1 (en) Apparatus, system and method of communicating filter information
US10264396B2 (en) Method of distance measurement between wireless communication devices in wireless communication system
CN112929820A (en) Positioning direction detection method, positioning terminal and computer readable storage medium
CN115812329A (en) Calibrating beam orientation errors to improve positioning
US11579238B2 (en) Localization and communication systems and methods
US20150195725A1 (en) Apparatus and Methods for Radio Frequency Ranging
CN113138378A (en) UWB ranging method, device, intelligent terminal and computer readable storage medium
WO2023151555A1 (en) Positioning methods and apparatuses, user equipment and storage medium
WO2024131689A1 (en) Sensing method, sensing apparatus, and communication device
WO2024131752A1 (en) Sensing method, sensing apparatus, communication device and storage medium
WO2024131688A1 (en) Sensing method, sensing apparatus, and communication device
WO2024032538A1 (en) Calibration method and apparatus, information transmission method and apparatus, and communication device
WO2023138673A1 (en) Timing calibration method and apparatus, and communication device
WO2024131690A1 (en) Sensing method and apparatus, and device
US20230417865A1 (en) Communication device and method of operation
US20230254007A1 (en) Communication device and operating method

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20211116

WW01 Invention patent application withdrawn after publication