Method and device for measuring distance, and storage medium
AssigneeBeijing Xiaomi Mobile Software Co., Ltd.
InventorsKai Wang, Runyu Shi
Life of this patent
Estimating the term…
Abstract
The present disclosure is related to a method and device for measuring a distance and a storage medium. The method for measuring the distance includes determining a distance between a first device and a second device based on a first time difference and a second time difference, where the first time difference is between a time of receiving a first detection signal by the first device and a time of receiving a second detection signal by the first device, and the second time difference is between a time of receiving the first detection signal by the second device and time of receiving the second detection signal by the second device.
Claims20
A method for measuring a distance, applied to a first device, comprising:
- sending a first detection signal;
- determining a time difference, between a time of receiving the first detection signal by the first device and a time of receiving a second detection signal by the first device, as a first time difference, wherein the second detection signal is sent by a second device in response to the second device receiving the first detection signal;
- obtaining a second time difference from the second device, the second time difference being a time difference between a time of receiving the first detection signal by the second device and a time of receiving the second detection signal by the second device;
- and
- determining the distance between the first device and the second device based on the first time difference and the second time difference;
- wherein the first detection signal is modulated and sent by the first device using a first carrier frequency;
- the second detection signal is modulated and sent by the second device using a second carrier frequency;
- the second time difference is characterized by a data encoding signal, and the data encoding signal is modulated and sent by the second device using a third carrier frequency;
- and the first carrier frequency, the second carrier frequency, and the third carrier frequency are different from each other;
- and
- wherein the method further comprises:
- receiving each of the modulated first detection signal, the modulated second detection signal, and the modulated data encoding signal via a band-pass filter.
A first device for measuring a distance, comprising:
- a processor, and
- a memory storing one or more executable instructions for the processor, wherein
- the processor is configured to:
- send a first detection signal;
- determine a time difference, between a time of receiving the first detection signal by the first device and a time of receiving a second detection signal by the first device, as a first time difference, wherein the second detection signal is sent by a second device in response to the second device receiving the first detection signal;
- obtain a second time difference from the second device, the second time difference being a time difference between a time of receiving the first detection signal by the second device and a time of receiving the second detection signal by the second device;
- and
- determine the distance between the first device and the second device based on the first time difference and the second time difference;
- wherein the first detection signal is modulated and sent by the first device using a first carrier frequency;
- the second detection signal is modulated and sent by the second device using a second carrier frequency;
- the second time difference is characterized by a data encoding signal, and the data encoding signal is modulated and sent by the second device using a third carrier frequency;
- and the first carrier frequency, the second carrier frequency, and the third carrier frequency are different from each other;
- and
- wherein the processor is further configured to receive each of the modulated first detection signal, the modulated second detection signal, and the modulated data encoding signal via a band-pass filter.
A non-transitory computer readable storage medium, wherein one or more instructions in the storage medium, when executed by a processor of a first device, enable the first device to perform following acts:
- sending a first detection signal;
- determining a time difference, between a time of receiving the first detection signal by the first device and a time of receiving a second detection signal by the first device, as a first time difference, wherein the second detection signal is sent by a second device in response to the second device receiving the first detection signal;
- obtaining a second time difference from the second device, the second time difference being a time difference between a time of receiving the first detection signal by the second device and a time of receiving the second detection signal by the second device;
- and
- determining the distance between the first device and the second device based on the first time difference and the second time difference;
- wherein the first detection signal is modulated and sent by the first device using a first carrier frequency;
- the second detection signal is modulated and sent by the second device using a second carrier frequency;
- the second time difference is characterized by a data encoding signal, and the data encoding signal is modulated and sent by the second device using a third carrier frequency;
- and the first carrier frequency, the second carrier frequency, and the third carrier frequency are different from each other;
- and
- wherein the first device is enabled to further perform following acts:
- receiving each of the modulated first detection signal, the modulated second detection signal, and the modulated data encoding signal via a band-pass filter;
- wherein the first device is a mobile terminal.
Dependencies are inferred from the claim text.