WO2023225954A1 - 一种距离确定方法、装置、电子设备及可读存储介质 - Google Patents

一种距离确定方法、装置、电子设备及可读存储介质 Download PDF

Info

Publication number
WO2023225954A1
WO2023225954A1 PCT/CN2022/095291 CN2022095291W WO2023225954A1 WO 2023225954 A1 WO2023225954 A1 WO 2023225954A1 CN 2022095291 W CN2022095291 W CN 2022095291W WO 2023225954 A1 WO2023225954 A1 WO 2023225954A1
Authority
WO
WIPO (PCT)
Prior art keywords
detection signal
electronic device
target
time difference
target detection
Prior art date
Application number
PCT/CN2022/095291
Other languages
English (en)
French (fr)
Inventor
祝宁之
易鑫林
张墉
王凯
史润宇
Original Assignee
北京小米移动软件有限公司
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 北京小米移动软件有限公司 filed Critical 北京小米移动软件有限公司
Priority to PCT/CN2022/095291 priority Critical patent/WO2023225954A1/zh
Publication of WO2023225954A1 publication Critical patent/WO2023225954A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B1/00Details of transmission systems, not covered by a single one of groups H04B3/00 - H04B13/00; Details of transmission systems not characterised by the medium used for transmission
    • H04B1/69Spread spectrum techniques
    • H04B1/707Spread spectrum techniques using direct sequence modulation

Definitions

  • the present disclosure relates to the field of electronic equipment, and in particular, to a distance determination method, device, electronic equipment and readable storage medium.
  • short-distance ranging can use various methods such as infrared ranging or electromagnetic wave ranging.
  • Infrared ranging cannot detect the distance of objects that are similar to black bodies.
  • Electromagnetic wave ranging is costly and susceptible to electromagnetic wave interference.
  • Acoustic ranging is widely used in short-distance ranging scenarios due to its low implementation difficulty and good flexibility.
  • the method of applying acoustic wave ranging in electronic devices is not perfect yet.
  • the present disclosure provides a distance determination method, device, electronic device and readable storage medium.
  • a distance determination method is provided, applied to a first electronic device, and the method includes:
  • At least one first detection signal is sent to the second electronic device in sequence until a confirmation message from the second electronic device for the first target detection signal in the at least one first detection signal is received.
  • the distance between the first electronic device and the second electronic device in the current ranging process is determined according to the second target detection signal and the first target time difference.
  • the method further includes:
  • corresponding numbers are sequentially configured for the at least one first detection signal.
  • sending at least one first detection signal to the second electronic device in sequence includes:
  • receiving the second target detection signal sent by the second electronic device for the first target detection signal in the current ranging process, and the first target time difference includes:
  • the target number is the number of the first target detection signal.
  • the distance between the first electronic device and the second electronic device in the current ranging process is determined based on the second target detection signal and the first target time difference, include:
  • the distance is determined based on the first target detection signal, the second target detection signal and the first target time difference.
  • determining the distance based on the first target detection signal, the second target detection signal and the first target time difference includes:
  • the distance is determined based on the first target time difference and the second time difference.
  • the method further includes:
  • the method further includes:
  • the first detection signal is sent when the channel is idle;
  • a distance determination method is provided, applied to a second electronic device, and the method includes:
  • the current ranging process in response to receiving the first target detection signal sent by the first electronic device, sending a confirmation message corresponding to the first target detection signal to the first electronic device, wherein the first The target detection signal is a detection signal among at least one first detection signal sent by the first electronic device during the current ranging process;
  • the first time difference is used to represent: the time when the second electronic device receives the first target detection signal and the time when the acoustic wave receiver inside the second electronic device receives the The time difference between the time when the second target detects the signal;
  • the at least one first detection signal is configured with corresponding numbers in sequence
  • the sending of at least one second detection signal to the first electronic device in sequence includes:
  • the target number of the first target detection signal generate at least one second detection signal carrying the target number in a set sequence
  • At least one second detection signal carrying the target number is sent to the first electronic device in sequence.
  • the at least one first detection signal is configured with corresponding numbers in sequence
  • Determining the first time difference includes:
  • At least one first time difference carrying the target number in a set sequence is generated.
  • the method further includes:
  • the sending is performed when the channel is idle;
  • a distance determination device configured in a first electronic device, and the device includes:
  • the first sending module in the current ranging process, sends at least one first detection signal to the second electronic device in sequence until the second electronic device receives the first target detection signal among the at least one first detection signal. Confirmation message to send at least one first detection signal in the next ranging process;
  • a receiving module configured to receive a second target detection signal sent by the second electronic device for the first target detection signal in the current ranging process, and a first target time difference, wherein the first target time difference is used to characterize : the time difference between the time when the second electronic device receives the first target detection signal and the time when the acoustic wave receiver inside the second electronic device receives the second target detection signal;
  • a first determination module configured to determine the distance between the first electronic device and the second electronic device in the current ranging process according to the second target detection signal and the first target time difference.
  • a distance determination device configured in a second electronic device, and the device includes:
  • the second sending module is configured to send a confirmation message corresponding to the first target detection signal to the first electronic device in response to receiving the first target detection signal sent by the first electronic device during the current ranging process.
  • the first target detection signal is a detection signal among at least one first detection signal sent by the first electronic device during the current ranging process;
  • the second sending module is further configured to send at least one second detection signal to the first electronic device in sequence until the first electronic device receives a second target detection signal in the at least one second detection signal. confirmation message;
  • the second determination module is used to determine a first time difference, wherein the first time difference is used to represent: the time when the second electronic device receives the first target detection signal, and the time when the second electronic device internally a time difference between the times when the acoustic wave receiver receives the second target detection signal;
  • the second sending module is further configured to send at least one first time difference to the first electronic device in sequence until a confirmation message from the first electronic device for the first target time difference in the at least one first time difference is received. , transmitting at least one second detection signal in the next ranging process.
  • an electronic device including:
  • Memory used to store instructions executable by the processor
  • the processor is configured to: execute the distance determination method as described in any one of the first aspect or the second aspect.
  • a non-transitory computer-readable storage medium which when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the first aspect or the third aspect.
  • the distance determination method according to any one of the two aspects.
  • the first electronic device can promptly and accurately learn the data transmission situation based on the feedback situation of the first detection signal sent during the current ranging process. It is not only conducive to starting the next ranging process in a timely and efficient manner when receiving the confirmation message; it is also conducive to accurately transmitting data and improving the success rate of ranging. Moreover, after receiving the confirmation message, the next ranging process is started, effectively reducing the time interval between two ranging measurements and increasing the refresh frequency of ranging.
  • Figure 1 is a schematic diagram of an application scenario according to an exemplary embodiment.
  • FIG. 2 is a flowchart of a distance determination method according to an exemplary embodiment.
  • FIG. 3 is a flowchart of a distance determination method according to an exemplary embodiment.
  • FIG. 4 is a sequence diagram of the first electronic device sending and receiving information according to an exemplary embodiment.
  • FIG. 5 is a sequence diagram of the second electronic device sending and receiving information according to an exemplary embodiment.
  • FIG. 6 is a sequence diagram of the first electronic device sending and receiving some information according to an exemplary embodiment.
  • FIG. 7 is a sequence diagram of the second electronic device sending and receiving some information according to an exemplary embodiment.
  • FIG. 8 is a block diagram of a distance determining device according to an exemplary embodiment.
  • Fig. 9 is a block diagram of a distance determining device according to an exemplary embodiment.
  • FIG. 10 is a block diagram of an electronic device according to an exemplary embodiment.
  • each ranging process is completely independent in time. For example, device A sends a detection signal and receives a detection signal from device B. After device A calculates the distance between devices based on the data sent by device B, device A will send the next detection signal.
  • each ranging is completely independent in time, and the time interval between the output of two adjacent distance values is too large, which greatly reduces the refresh frequency of ranging.
  • each ranging process adopts frequency division method.
  • device A can send multiple detection signals on different signal frequency bands, and combine the detection signals sent by device B on each signal frequency band to calculate the distance in each signal frequency band.
  • the above two methods do not consider the problem of missed signal detection or misinterpretation, that is, the methods in the related art cannot determine whether the data transmission is successful.
  • device B may not necessarily be able to successfully receive the detection signal sent by device A, or may not be able to successfully decode the detection signal sent by device A, which will cause ranging failure.
  • FIG. 1 is a schematic diagram of an application scenario of a distance determination method according to an exemplary embodiment.
  • the distance determination method of the embodiment of the present disclosure can be applied to detect the distance between the first electronic device 101 and the second electronic device 102 .
  • the first electronic device 101 may be a mobile phone, a smart speaker, a tablet, a smart wearable device, a laptop, a smart home Internet of Things (IOT) device, etc.
  • the second electronic device 102 may also be a mobile phone, a smart speaker, a tablet, a smart wearable device, a laptop, a smart home Internet of Things (IOT) device, etc.
  • the first electronic device 101 and the second electronic device 102 may be of the same or different types, and the first electronic device 101 may be a control device among the two electronic devices.
  • the first electronic device 101 has a first sound wave transmitter 1011 and a first sound wave receiver 1012
  • the second electronic device 102 has a second sound wave transmitter 1021 and a second sound wave receiver 1022.
  • the first electronic device 101 and the second electronic device 102 not only have the ability to send sound waves, but also have the ability to receive sound waves.
  • the first acoustic wave transmitter 1011 or the second acoustic wave transmitter 1021 includes: an acoustic wave signal generator, a digital-to-analog converter (DAC), and an acoustic wave signal transmitter.
  • the first acoustic wave receiver 1012 or the second acoustic wave receiver 1022 includes: an acoustic wave signal receiver, an analog-to-digital converter (ADC), and an acoustic wave signal detector.
  • ADC analog-to-digital converter
  • the speakers, earpieces or microphones inside the terminal equipment can be regarded as ultrasonic transmitting/receiving devices, and no additional hardware structure is required.
  • the distance determination method in the embodiment of the present disclosure can be applied to the following scenarios, for example:
  • the first electronic device 101 is, for example, a smart speaker
  • the second electronic device 102 is, for example, a sweeping robot.
  • the distance determination method in the embodiment of the present disclosure is used to locate the position of the second electronic device 102 .
  • the first electronic device 101 is, for example, a payment terminal
  • the second electronic device 102 is, for example, a cash register or other payment collection device.
  • the distance determination method in the embodiment of the present disclosure is used to determine the distance of the second electronic device 102 so that the control strategy can be customized, such as waking up the payment interface when the distance to the second electronic device 102 is less than a threshold.
  • both the first electronic device 101 and the second electronic device 102 may be mobile phones.
  • the distance determination method in the embodiment of the present disclosure is used to determine the distance between two mobile phones so that the password can be transmitted when the distance is less than the threshold. Compared with existing methods (such as code scanning), it is simpler and faster, and reduces power consumption.
  • the first electronic device 101 is, for example, a mobile phone
  • the second electronic device is, for example, a speaker.
  • the distance determination method in the embodiment of the present disclosure is used to determine the distance between the two, and perform personalized control based on the distance. For example, when the distance is greater than the threshold, the first electronic device 101 plays the audio and video, and when the distance is less than the threshold, the second electronic device 102 continues to play the audio and video in succession.
  • Figure 2 is a flow chart of a distance determination method according to an exemplary embodiment. As shown in Figure 2, the distance determination method is used in a first electronic device. The method in this embodiment may include the following steps.
  • Step S210 During the current ranging process, at least one first detection signal is sequentially sent to the second electronic device until a confirmation message from the second electronic device for the first target detection signal in the at least one first detection signal is received, and the next step is performed. Transmission of at least one first detection signal during a ranging process.
  • Step S220 Receive the second target detection signal sent by the second electronic device in response to the first target detection signal in the current ranging process, and the first target time difference.
  • Step S230 Determine the distance between the first electronic device and the second electronic device in the current ranging process based on the time difference between the second target detection signal and the first target.
  • the current ranging process may be applied to any ranging process of the first electronic device, and the next ranging process corresponds to the first ranging process after the current ranging process.
  • the acknowledgment message (ACK) is used to indicate that the second electronic device has successfully received and successfully decoded the first target detection signal.
  • the first electronic device can send a signal in the form of an acoustic wave (such as an ultrasonic wave), such as a first detection signal, through its own first acoustic wave emitter 1011, and the second electronic device can send a signal in the form of an acoustic wave through the corresponding second acoustic wave emitter 1021, Such as ACK; the acoustic wave receiver in the first electronic device or the second electronic device is used to receive signals in the form of acoustic waves, such as the first detection signal.
  • an acoustic wave such as an ultrasonic wave
  • a first detection signal such as a first detection signal
  • the first electronic device may sequentially send at least one first detection signal (signal A) according to a set time interval.
  • an ACK based on the first target detection signal such as A 1-2
  • the sending of the first detection signal of the current ranging process is stopped, and the first detection signal of the next ranging process is sent.
  • the first electronic device does not need to wait for the detection signal (signal B) or the first time difference (signal C) sent by the second electronic device, so the two ranging processes can be effectively shortened. interval to increase the ranging refresh frequency.
  • the first target time difference is used to represent: the time difference between the time when the second electronic device receives the first target detection signal and the time when the acoustic wave receiver inside the second electronic device receives the second target detection signal. .
  • the second electronic device after receiving the first detection signal, the second electronic device also sends a second detection signal in the form of an acoustic wave and a first time difference.
  • the second detection signal received by the first electronic device be the second target detection signal
  • the first time difference received be the first target time difference.
  • the first electronic device may also reply a confirmation message to the second electronic device.
  • the method in this example can also include the following steps:
  • Step S221 In response to receiving the second target detection signal and the first target time difference, send corresponding confirmation messages to the second electronic device respectively.
  • the first electronic device sends an ACK to the second electronic device after successfully receiving the second target detection signal (such as B 1- 2-2 ); after successfully receiving the first target time difference (such as C 1 -2-2-1 ), ACK will also be sent to the second electronic device.
  • the second target detection signal such as B 1- 2-2
  • the first target time difference such as C 1 -2-2-1
  • the first detection signal sent by the first electronic device can be received by the second electronic device or by the acoustic wave receiver of the first electronic device itself; similarly, the first detection signal sent by the second electronic device can The second detection signal can be received not only by the first electronic device, but also by the acoustic wave receiver of the second electronic device itself. Therefore, during the current ranging process, the first electronic device and the second electronic device can transmit and receive acoustic wave signals to each other. During the ranging process, the first electronic device and the second electronic device are used as the transmitting end or the receiving end respectively, and the transmitting and receiving devices are separated to avoid using echoes for ranging and improve the problem of sound waves being absorbed.
  • the first electronic device can measure the time of flight (TOF) of the acoustic signal in the air based on the parameter information (such as reception time) corresponding to the second target detection signal and the first target time difference, thereby determining two The distance between devices.
  • TOF time of flight
  • the first electronic device can promptly and accurately learn the data transmission situation based on the feedback situation of the first detection signal sent during the current ranging process. It is not only conducive to starting the next ranging process in a timely and efficient manner when receiving the confirmation message; it is also conducive to accurately transmitting data and improving the success rate of ranging. Moreover, after receiving the confirmation message, the next ranging process is started, effectively reducing the time interval between two ranging measurements and increasing the refresh frequency of ranging.
  • the method of this embodiment may also include the following steps:
  • Step S200 Before sending at least one first detection signal in the current ranging process, configure corresponding numbers in order for at least one first detection signal.
  • the first electronic device may encode at least one first detection signal according to a preset numbering rule during each ranging process.
  • each first detection signal is represented by the number form A an , where A represents the signal sent by the first electronic device, a represents the a-th ranging process, and n represents the n-th first detection of the a-th ranging process. Signal.
  • At least one first detection signal in the current ranging process can be: A 1-1 , A 1-2 ,..., A 1 -n .
  • the content of each first detection signal is the same, but the number is different. Therefore, the first detection signals other than the first first detection signal can also be regarded as copies of the first first detection signal.
  • At least one first detection signal in the next ranging process of the current ranging process may be: A 2-1 , A 2-2 ,..., A 2-n .
  • corresponding numbers are sequentially configured for the first detection signal.
  • a set number of first detection signals in the ranging process are preset and corresponding numbers are configured in sequence; it can be understood that in this method, , if an ACK from the second electronic device is received, it is not necessary to send all the set number of first detection signals.
  • the method of this embodiment may include step S200 and steps S210 to S230.
  • sending at least one first detection signal to the second electronic device in sequence in step S210 of this embodiment may include the following steps:
  • Step S2101 Send the first detection signal of the current number to the second electronic device.
  • Step S2102 In response to not receiving the acknowledgment message corresponding to the first detection signal with the current number, retransmit the first detection signal with the next number from the current number.
  • step S2101 as shown in FIG. 4 , the current number is, for example, A 1-1 .
  • the first electronic device sends the first detection signal of A 1-1 to the second electronic device.
  • step S2102 if the first electronic device does not receive the corresponding ACK while sending the first detection signal to the second electronic device, it will retransmit the first detection signal in the current ranging process, such as sending A 1-2 , so as to ensure that the second electronic device can successfully receive the first detection signal in the current ranging process, thereby facilitating the completion of the current ranging process.
  • the current ranging process such as sending A 1-2
  • the output interval of the two ranging results can be effectively reduced and the refresh frequency of the ranging results can be increased.
  • step S220 in this embodiment may include the following steps:
  • Step S2201 Receive a second target detection signal carrying a target number sent by the second electronic device.
  • Step S2202 Receive the first target time difference carrying the target number sent by the second electronic device.
  • the target number is the number of the first target detection signal.
  • the second electronic device may use a matching numbering rule to number the second detection signal.
  • each first detection signal is represented by the number form B anm , where B represents the signal sent by the second electronic device, a represents the a-th ranging process, and n represents the signal received by the second electronic device during the a-th ranging process.
  • the nth first detection signal received, m represents the mth second detection signal in the ath ranging process.
  • the first detection signal received by the second electronic device during the current ranging process may be: A 1 -2 .
  • the second electronic device can send at least one second detection signal, and the at least one second detection signal is in sequence: B 1-2-1 , B 1-2-2 ,..., B 1- 2-m .
  • the second detection signal received by the first electronic device is recorded as the second target detection signal.
  • the number of the second target detection signal is: B 1-2-2 .
  • step S2202 when the second electronic device numbers the first time difference, for example, it can adopt the numbering form of C anmk , where C represents the signal determined and sent by the second electronic device, a represents the a-th ranging process, and n represents The n-th first detection signal received by the second electronic device during the a-th ranging process, m represents the m-th second detection signal received by the first electronic device during the a-th ranging process, and k represents The k-th first time difference in the a-th ranging process.
  • C represents the signal determined and sent by the second electronic device
  • a represents the a-th ranging process
  • n represents The n-th first detection signal received by the second electronic device during the a-th ranging process
  • m represents the m-th second detection signal received by the first electronic device during the a-th ranging process
  • k represents The k-th first time difference in the a-th ranging process.
  • the second electronic device can determine and send at least one first time difference, and the at least one first time difference is in sequence: C 1- 2-2-1 , C 1-2-2-2 ,... ,C 1-2-2-m .
  • the first time difference received by the first electronic device is recorded as the first target time difference.
  • the number of the first target time difference is: C 1-2-2-1 .
  • both the second detection signal and the first time difference carry the numbering information of the received first detection signal.
  • step S230 in this embodiment may include the following steps:
  • Step S2301 Determine the first target detection signal corresponding to the target number based on the target number carried by the second target detection signal and the target number carried by the first target time difference.
  • Step S2302 Determine the distance based on the first target detection signal, the second target detection signal and the first target time difference.
  • step S2301 after receiving the second target detection signal or the first target time difference, the first electronic device can learn that the first detection signal received by the second electronic device is based on the target numbers carried by the two: First target detection signal.
  • the first electronic device combines the timing diagrams of Figures 6 to 7, Figure 6 and Figure 7 based on the first target detection signal, the second target detection signal and the relevant parameters (such as reception time) of the first target time difference. shows the timing diagram of the signal received by the device, and the distance can be determined based on the TOF principle.
  • step S2302 may include the following steps:
  • Step S2302-1 Determine the time when the first electronic device receives the first target detection signal. In this step, after the first electronic device learns that the first detection signal received by the second electronic device is the first target detection signal, it can determine the time when its own acoustic wave receiver receives the first target detection signal, which is recorded as t AA .
  • Step S2302-2 Determine the second time difference based on the time when the first electronic device receives the first target detection signal and the time when it receives the second target detection signal.
  • the time when the first electronic device receives the second target detection signal can be recorded as t AB
  • the second time difference t 1 t AB – t AA .
  • the first electronic device can determine the distance d between the first electronic device and the second electronic device. d satisfies:
  • D is the sum of the distance between the sound wave transmitter and the sound wave receiver in the first electronic device and the distance between the sound wave transmitter and the sound wave receiver in the second electronic device
  • u is the speed of sound in the air (approximately 340m/s).
  • the method of this embodiment may also include the following steps:
  • Step S201 Before sending the first detection signal and during the process of sending the first detection signal, monitor the channel status of the channel corresponding to the first detection signal.
  • Step S202 If the channel is occupied before sending the first detection signal, send the first detection signal when the channel is idle.
  • Step S203 If there is signal collision in the channel during sending the first detection signal, stop sending the first detection signal.
  • this embodiment is suitable for the first electronic device to adjust the timing of sending the signal by performing channel monitoring before sending the signal or during the process of sending the signal.
  • the first electronic device may monitor the channel based on a carrier sensing (CSMA) mechanism and transmit a signal when the channel is idle.
  • CSMA carrier sensing
  • step S202 if the channel is occupied before sending the first detection signal (for example, the second electronic device may occupy the channel to send the second detection signal), the first electronic device keeps waiting, and then sends the first detection signal when the channel is idle. , to avoid collision of transmitted signals, resulting in both signals not being successfully demodulated.
  • step S203 if there is a signal collision during the sending of the first detection signal, the device sending the signal needs to stop sending and adopt a backoff strategy. In this step, the first electronic device stops sending the first detection signal and still keeps monitoring the channel.
  • Figure 3 is a flow chart of a distance determination method according to an exemplary embodiment. As shown in Figure 3, the distance determination method is used in a second electronic device. The method in this embodiment may include the following steps.
  • Step S310 In the current ranging process, in response to receiving the first target detection signal sent by the first electronic device, send a confirmation message corresponding to the first target detection signal to the first electronic device.
  • Step S320 Send at least one second detection signal to the first electronic device in sequence until a confirmation message from the first electronic device for the second target detection signal in the at least one second detection signal is received.
  • Step S330 Determine the first time difference.
  • Step S340 Send at least one first time difference to the first electronic device in sequence. After receiving a confirmation message from the first electronic device for the first target time difference in the at least one first time difference, perform at least one second detection in the next ranging process. Transmission of signals.
  • the first target detection signal is a detection signal among at least one first detection signal sent by the first electronic device during the current ranging process.
  • the second electronic device After receiving the first target detection signal and successfully decoding it (decoding and passing the check code verification), the second electronic device sends an ACK to the first electronic device.
  • step S320 combined with the timing diagram of the second electronic device shown in Figure 5, after receiving the first target detection signal, the second electronic device will send at least one first step in the current ranging process according to a set time interval.
  • the second detection signal stops sending the second detection signal of the current ranging process until the ACK of the first electronic device is received.
  • the first time difference is used to represent the time difference between the time when the second electronic device receives the first target detection signal and the time when the acoustic wave receiver inside the second electronic device receives the second target detection signal.
  • the second electronic device may calculate and determine the first time difference (t 2 ).
  • step S340 the second electronic device still uses retransmission to send the first time difference, that is, it sends at least one first time difference at a set time interval until it receives an ACK from the first electronic device.
  • the second electronic device can start sending the second detection signal in the next ranging process, thereby effectively reducing the waiting time on the time axis and conducive to improving ranging refresh. frequency.
  • Step S320 in this embodiment may include the following steps:
  • Step S3201 Generate at least one second detection signal carrying the target number in a set sequence according to the target number of the first target detection signal.
  • Step S3202 Send at least one second detection signal carrying the target number to the first electronic device in sequence.
  • step S3201 the second electronic device adopts the set numbering rule and generates the number of the corresponding second detection signal according to the target number.
  • the target number of the first detection signal received by the second electronic device is: A 1-2
  • the second electronic device can detect at least one second detection signal
  • the following numbering format is adopted: B 1-2-m , where B represents the signal sent by the second electronic device, and m represents the m-th second detection signal.
  • the number of the second detection signal carries the target number "1-2".
  • step S3202 the second electronic device sequentially sends at least one second detection signal carrying "1-2" to the first electronic device at set time intervals, such as sequentially sending the following second detection signal B 1-2 -1 ,B 1-2-2 ,...,B 1-2- m.
  • Step S330 in this embodiment may include the following steps:
  • Step S3301 Determine the time when the second electronic device receives the second target detection signal.
  • Step S3302 Determine the difference between the time when the second electronic device receives the second target detection signal and the time when it receives the first target detection signal.
  • Step S3303 Generate at least one first time difference carrying the target number in a set sequence based on the difference value and the target number of the first target detection signal.
  • the second target detection signal is a second detection signal successfully received by the first electronic device, that is, a second detection signal corresponding to the ACK received by the second electronic device.
  • the second electronic device determines the time when its own acoustic wave receiver receives the second target detection signal, which is recorded as t BB .
  • step S3302 the time when the second electronic device receives the first target detection signal is marked as t BA .
  • step S3303 the second electronic device encodes the difference value and the number together to obtain the first time difference carrying the number.
  • the second electronic device can use the following numbering format for at least one first time difference: C 1-2-2-k , where B represents the signal determined and sent by the second electronic device, and k represents the k-th first time difference.
  • the number of the first time difference carries the target number "1-2", or it carries the number of the second target detection signal including the target number, that is, "1-2-2".
  • the method of this embodiment further includes:
  • Step S301 Before sending the second detection signal or the first time difference, or during the process of sending the second detection signal or the first time difference, monitor the channel status of the corresponding channel.
  • Step S302 If the channel is occupied before sending the second detection signal or the first time difference, the sending is performed when the channel is idle.
  • Step S303 If there is signal collision in the channel during sending the second detection signal or the first time difference, stop sending the second detection signal or the first time difference.
  • this embodiment is suitable for the second electronic device to adjust the timing of sending the signal by performing channel monitoring before sending the signal or during the process of sending the signal.
  • the second electronic device may monitor the channel based on a carrier sensing (CSMA) mechanism and transmit a signal when the channel is idle.
  • CSMA carrier sensing
  • step S302 if the channel is occupied before sending the second detection signal or the first time difference (for example, the first electronic device may occupy the channel to send the first detection signal), the second electronic device keeps waiting and transmits again when the channel is idle. , to avoid collision of transmitted signals, resulting in both signals not being successfully demodulated.
  • step S303 if there is a signal collision during the process of sending the second detection signal or the first time difference, the device sending the signal needs to stop sending and adopt a backoff strategy. In this step, the second electronic device stops sending the first detection signal and still keeps monitoring the channel.
  • FIG. 8 is a block diagram of a distance determination device according to an exemplary embodiment.
  • the device is configured in a first electronic device.
  • the device includes a first sending module 810, a receiving module 820 and a first determining module 830.
  • the first sending module 810 is configured to sequentially send at least one first detection signal to the second electronic device during the current ranging process until it receives the first target detection signal among the at least one first detection signal from the second electronic device. confirmation message to send at least one first detection signal in the next ranging process.
  • the receiving module 820 is configured to receive the second target detection signal sent by the second electronic device for the first target detection signal in the current ranging process, and the first target time difference, where the first target time difference is used to characterize: the second electronic device The time difference between the time when the device receives the first target detection signal and the time when the acoustic wave receiver inside the second electronic device receives the second target detection signal.
  • the first determination module 830 is configured to determine the distance between the first electronic device and the second electronic device in the current ranging process according to the second target detection signal and the first target time difference.
  • Figure 9 is a block diagram of a distance determination device according to an exemplary embodiment.
  • the device is configured in a second electronic device.
  • the device includes a second sending module 910 and a second determining module 920.
  • the second sending module 910 is configured to send a confirmation message corresponding to the first target detection signal to the first electronic device in response to receiving the first target detection signal sent by the first electronic device during the current ranging process, wherein,
  • the first target detection signal is a detection signal among at least one first detection signal sent by the first electronic device during the current ranging process.
  • the second sending module 910 is configured to send at least one second detection signal to the first electronic device in sequence until a confirmation message from the first electronic device for the second target detection signal in the at least one second detection signal is received.
  • the second determining module 920 is configured to determine a first time difference, where the first time difference is used to characterize: the time when the second electronic device receives the first target detection signal and the time when the acoustic wave receiver inside the second electronic device receives the second The time difference between the time the target detects the signal;
  • the second sending module 910 is configured to send at least one first time difference to the first electronic device in sequence, and perform the next ranging process until receiving a confirmation message from the first electronic device for the first target time difference in the at least one first time difference.
  • the transmission of at least one second detection signal is configured to send at least one first time difference to the first electronic device in sequence, and perform the next ranging process until receiving a confirmation message from the first electronic device for the first target time difference in the at least one first time difference.
  • FIG. 10 is a block diagram of an electronic device 1000 according to an exemplary embodiment.
  • the device 1000 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like.
  • the device 1000 may include one or more of the following components: a processing component 1002, a memory 1004, a power component 1006, a multimedia component 1008, an audio component 1010, an input/output (I/O) interface 1012, a sensor component 1014, and communications component 1016.
  • Processing component 1002 generally controls the overall operations of device 1000, such as operations associated with display, phone calls, data communications, camera operations, and recording operations.
  • the processing component 1002 may include one or more processors 1020 to execute instructions to complete all or part of the steps of the above method.
  • processing component 1002 may include one or more modules that facilitate interaction between processing component 1002 and other components.
  • processing component 1002 may include a multimedia module to facilitate interaction between multimedia component 1008 and processing component 1002.
  • Memory 1004 is configured to store various types of data to support operations at device 1000 . Examples of such data include instructions for any application or method operating on device 1000, contact data, phonebook data, messages, pictures, videos, etc.
  • Memory 1004 may be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EEPROM), Programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EEPROM erasable programmable read-only memory
  • EPROM Programmable read-only memory
  • PROM programmable read-only memory
  • ROM read-only memory
  • magnetic memory flash memory, magnetic or optical disk.
  • Power supply component 1006 provides power to various components of device 1000.
  • Power supply components 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to device 1000 .
  • Multimedia component 1008 includes a screen that provides an output interface between the device 1000 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide action.
  • multimedia component 1008 includes a front-facing camera and/or a rear-facing camera.
  • the front camera and/or the rear camera may receive external multimedia data.
  • Each front-facing camera and rear-facing camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
  • Audio component 1010 is configured to output and/or input audio signals.
  • audio component 1010 includes a microphone (MIC) configured to receive external audio signals when device 1000 is in operating modes, such as call mode, recording mode, and speech recognition mode. The received audio signals may be further stored in memory 1004 or sent via communications component 1016 .
  • audio component 1010 also includes a speaker for outputting audio signals.
  • the I/O interface 1012 provides an interface between the processing component 1002 and a peripheral interface module.
  • the peripheral interface module may be a keyboard, a click wheel, a button, etc. These buttons may include, but are not limited to: Home button, Volume buttons, Start button, and Lock button.
  • Sensor component 1014 includes one or more sensors for providing various aspects of status assessment for device 1000 .
  • the sensor component 1014 can detect the open/closed state of the device 1000, the relative positioning of components, such as the display and keypad of the device 1000, and the sensor component 1014 can also detect the position change of the device 1000 or a component of the device 1000. , the presence or absence of user contact with the device 1000 , device 1000 orientation or acceleration/deceleration and temperature changes of the device 1000 .
  • Sensor assembly 1014 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact.
  • Sensor assembly 1014 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor component 1014 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • Communication component 1016 is configured to facilitate wired or wireless communication between apparatus 1000 and other devices.
  • Device 1000 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof.
  • the communication component 1016 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communications component 1016 also includes a near field communications (NFC) module to facilitate short-range communications.
  • NFC near field communications
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • apparatus 1000 may be configured by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable Gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are implemented for executing the above method.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable Gate array
  • controller microcontroller, microprocessor or other electronic components are implemented for executing the above method.
  • a non-transitory computer-readable storage medium including instructions such as a memory 1004 including instructions, which can be executed by the processor 1020 of the device 1000 to complete the above method is also provided.
  • the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
  • the first electronic device can promptly and accurately learn the data transmission situation based on the feedback situation of the first detection signal sent during the current ranging process. It is not only conducive to starting the next ranging process in a timely and efficient manner when receiving the confirmation message; it is also conducive to accurately transmitting data and improving the success rate of ranging. Moreover, after receiving the confirmation message, the next ranging process is started, effectively reducing the time interval between two ranging measurements and increasing the refresh frequency of ranging.

Abstract

本公开是关于一种距离确定方法、装置、电子设备及可读存储介质,方法包括:在当前测距过程中,依次向第二电子设备发送至少一个第一检测信号,至接收到第二电子设备对至少一个第一检测信号中第一目标检测信号的确认消息,进行下一个测距过程中至少一个第一检测信号的发送;接收第二电子设备针对当前测距过程中第一目标检测信号发送的第二目标检测信号,以及第一目标时间差;根据第二目标检测信号和第一目标时间差,确定当前测距过程中第一电子设备和第二电子设备之间的距离。本公开的方法中,能够高效的开启下一次测距过程,提高测距频率,还有利于准确传输数据,提高测距的成功率。

Description

一种距离确定方法、装置、电子设备及可读存储介质 技术领域
本公开涉及电子设备领域,尤其涉及一种距离确定方法、装置、电子设备及可读存储介质。
背景技术
随技术发展,短距离测距可采用红外测距或电磁波测距等多种方式。红外测距无法检测近似黑体的物体的距离,电磁波测距成本较高、且易受到电磁波干扰。声波测距因其实现难度低、灵活性好等优势广泛应用于短距离测距场景。相关技术中,在电子设备中应用声波测距的方式还不够完善。
发明内容
为克服相关技术中存在的问题,本公开提供一种距离确定方法、装置、电子设备及可读存储介质。
根据本公开实施例的第一方面,提供一种距离确定方法,应用于第一电子设备,方法包括:
在当前测距过程中,依次向第二电子设备发送至少一个第一检测信号,至接收到所述第二电子设备对所述至少一个第一检测信号中第一目标检测信号的确认消息,进行下一个测距过程中至少一个第一检测信号的发送;
接收第二电子设备针对所述当前测距过程中所述第一目标检测信号发送的第二目标检测信号,以及第一目标时间差,其中,所述第一目标时间差用于表征:所述第二电子设备接收到所述第一目标检测信号的时间,与所述第二电子设备内部的声波接收器接收到所述第二目标检测信号之间的时间差;
根据所述第二目标检测信号和所述第一目标时间差,确定所述当前测距过程中所述第一电子设备和所述第二电子设备之间的距离。
在一些实施方式中,所述方法还包括:
在发送所述当前测距过程中的所述至少一个第一检测信号之前,为所述至少一个第一检测信号按序配置对应的编号。
在一些实施方式中,所述依次向第二电子设备发送至少一个第一检测信号,包括:
向所述第二电子设备发送当前编号的第一检测信号;
响应于未收到所述当前编号的第一检测信号对应的确认消息,重传所述当前编号的下一个编号的第一检测信号。
在一些实施方式中,所述接收第二电子设备针对所述当前测距过程中所述第一目标检测信号发送的第二目标检测信号,以及第一目标时间差,包括:
接收所述第二电子设备发送的携带目标编号的第二目标检测信号;
接收所述第二电子设备发送的携带所述目标编号的第一目标时间差;
其中,所述目标编号为所述第一目标检测信号的编号。
在一些实施方式中,所述根据所述第二目标检测信号和所述第一目标时间差,确定所述当前测距过程中所述第一电子设备和所述第二电子设备之间的距离,包括:
根据所述第二目标检测信号携带的目标编号以及所述第一目标时间差携带的目标编号,确定所述目标编号对应的所述第一目标检测信号;
根据所述第一目标检测信号、所述第二目标检测信号以及所述第一目标时间差,确定所述距离。
在一些实施方式中,所述根据所述第一目标检测信号、所述第二目标检测信号以及所述第一目标时间差,确定所述距离,包括:
确定所述第一电子设备接收所述第一目标检测信号的时间;
根据所述第一电子设备接收所述第一目标检测信号的时间,以及接收到所述第二目标检测信号的时间,确定第二时间差;
根据所述第一目标时间差与所述第二时间差,确定所述距离。
在一些实施方式中,所述方法还包括:
响应于接收到所述第二目标检测信号和所述第一目标时间差,分别向所述第二电子设备发送对应的确认消息。
在一些实施方式中,所述方法还包括:
在发送所述第一检测信号之前以及发送所述第一检测信号的过程中,监听所述第一检测信号对应信道的信道状态;
若在发送所述第一检测信号之前所述信道被占用,待所述信道空闲时发送所述第一检测信号;
若在发送所述第一检测信号的过程中所述信道中存在信号碰撞,停止发送所述第一检测 信号。
根据本公开实施例的第二方面,提供一种距离确定方法,应用于第二电子设备,方法包括:
在当前测距过程中,响应于接收到第一电子设备发送的第一目标检测信号,向所述第一电子设备发送针对所述第一目标检测信号对应的确认消息,其中,所述第一目标检测信号为第一电子设备在当前测距过程中发送的至少一个第一检测信号中的检测信号;
依次向所述第一电子设备发送至少一个第二检测信号,至接收到所述第一电子设备对所述至少一个第二检测信号中第二目标检测信号的确认消息;
确定第一时间差,其中,所述第一时间差用于表征:所述第二电子设备接收到所述第一目标检测信号的时间,与所述第二电子设备内部的声波接收器接收到所述第二目标检测信号的时间之间的时间差;
依次向所述第一电子设备发送至少一个第一时间差,至接收到所述第一电子设备对所述至少一个第一时间差中第一目标时间差的确认消息,进行下一个测距过程中至少一个第二检测信号的发送。
在一些实施方式中,所述至少一个第一检测信号按序配置有对应的编号;
所述依次向所述第一电子设备发送至少一个第二检测信号,包括:
根据所述第一目标检测信号的目标编号,生成具有设定顺序的至少一个携带所述目标编号的第二检测信号;
依次向所述第一电子设备发送至少一个携带所述目标编号的第二检测信号。
在一些实施方式中,所述至少一个第一检测信号按序配置有对应的编号;
所述确定第一时间差,包括:
确定所述第二电子设备接收所述第二目标检测信号的时间;
确定所述第二电子设备接收所述第二目标检测信号的时间与接收所述第一目标检测信号的时间之间的差值;
根据所述差值和所述第一目标检测信号的目标编号,生成具有设定顺序的至少一个携带所述目标编号的所述第一时间差。
在一些实施方式中,所述方法还包括:
在发送所述第二检测信号或所述第一时间差之前,或者,在发送所述第二检测信号或所述第一时间差的过程中,监听对应信道的信道状态;
若在发送所述第二检测信号或所述第一时间差之前所述信道被占用,待所述信道空闲时 执行发送;
若在发送所述第二检测信号或所述第一时间差的过程中所述信道中存在信号碰撞,停止发送所述第二检测信号或所述第一时间差。
根据本公开实施例的第三方面,提供一种距离确定装置,被配置于第一电子设备,装置包括:
第一发送模块,在当前测距过程中,依次向第二电子设备发送至少一个第一检测信号,至接收到所述第二电子设备对所述至少一个第一检测信号中第一目标检测信号的确认消息,进行下一个测距过程中至少一个第一检测信号的发送;
接收模块,用于接收第二电子设备针对所述当前测距过程中所述第一目标检测信号发送的第二目标检测信号,以及第一目标时间差,其中,所述第一目标时间差用于表征:所述第二电子设备接收到所述第一目标检测信号的时间,与所述第二电子设备内部的声波接收器接收到所述第二目标检测信号的时间之间的时间差;
第一确定模块,用于根据所述第二目标检测信号和所述第一目标时间差,确定所述当前测距过程中所述第一电子设备和所述第二电子设备之间的距离。
根据本公开实施例的第四方面,提供一种距离确定装置,被配置于第二电子设备,装置包括:
第二发送模块,用于在当前测距过程中,响应于接收到第一电子设备发送的第一目标检测信号,向所述第一电子设备发送针对所述第一目标检测信号对应的确认消息,其中,所述第一目标检测信号为第一电子设备在当前测距过程中发送的至少一个第一检测信号中的检测信号;
所述第二发送模块还用于,依次向所述第一电子设备发送至少一个第二检测信号,至接收到所述第一电子设备对所述至少一个第二检测信号中第二目标检测信号的确认消息;
第二确定模块,用于确定第一时间差,其中,所述第一时间差用于表征:所述第二电子设备接收到所述第一目标检测信号的时间,与所述第二电子设备内部的声波接收器接收到所述第二目标检测信号的时间之间的时间差;
所述第二发送模块还用于,依次向所述第一电子设备发送至少一个第一时间差,至接收到所述第一电子设备对所述至少一个第一时间差中第一目标时间差的确认消息,进行下一个测距过程中至少一个第二检测信号的发送。
根据本公开实施例的第五方面,提供一种电子设备,包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,所述处理器被配置为:执行如第一方面或者第二方面任一项所述的距离确定方法。
根据本公开实施例的第六方面,提供一种非临时性计算机可读存储介质,当所述存储介质中的指令由电子设备的处理器执行时,使得电子设备能够执行如第一方面或者第二方面任一项所述的距离确定方法。
本公开的实施例提供的技术方案可以包括以下有益效果:
本公开的方法中,第一电子设备能够根据当前测距过程中发送第一检测信号的反馈情况,及时而准确的获知数据传输的情况。既有利于在收到确认消息时,及时高效的开启下一次测距过程;还有利于准确传输数据,提高测距的成功率。并且,在收到确认消息后即开启下一次测距过程,有效减小两次测距之间的时间间隔,提高测距的刷新频率。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本发明的实施例,并与说明书一起用于解释本发明的原理。
图1是根据一示例性实施例示出的应用场景的示意图。
图2是根据一示例性实施例示出的距离确定方法的流程图。
图3是根据一示例性实施例示出的距离确定方法的流程图。
图4是根据一示例性实施例示出的第一电子设备端收发信息的时序图。
图5是根据一示例性实施例示出的第二电子设备端收发信息的时序图。
图6是根据一示例性实施例示出的第一电子设备端收发部分信息的时序图。
图7是根据一示例性实施例示出的第二电子设备端收发部分信息的时序图。
图8是根据一示例性实施例示出的距离确定装置的框图。
图9是根据一示例性实施例示出的距离确定装置的框图。
图10是根据一示例性实施例示出的一种电子设备的框图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时, 除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本发明相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本发明的一些方面相一致的装置和方法的例子。
相关技术中,为保证各测距过程之间的独立性,通常包括如下两种方式:
第一、各测距过程在时间上完全独立。比如,设备A发送检测信号并接收设备B的检测信号,在设备A根据设备B发送的数据计算出本次设备间距离之后,设备A才会进行下一次检测信号的发送。
此方式中,各次测距在时间上完全独立,相邻两次距离值的输出时间间隔太大,极大地降低了测距的刷新频率。
第二、各测距过程采取分频方式。比如,设备A可在不同的信号频段上分别发送多个检测信号,结合设备B在各信号频段上发送的检测信号,计算各信号频段下的距离。
此方式中,虽可以解决测距刷新频率低的问题,但会造成频谱浪费。
并且,上述两种方式中并未考虑信号被漏检或者解错的问题,即相关技术中的方式无法确定数据传输是否成功。比如,设备B并不一定能够成功接收到设备A发送的检测信号,或者不一定能够成功解码设备A发送的检测信号,而这将导致测距失败。
图1是根据一示例性实施例示出的一种距离确定方法的应用场景示意图。如图1所示,本公开实施例的距离确定方法可应用于检测第一电子设备101与第二电子设备102之间的距离。第一电子设备101可以是手机、智能音响、平板电脑、智能穿戴设备、笔记本电脑、智能家居物联网(IOT)设备等。第二电子设备102也可以是手机、智能音响、平板电脑、智能穿戴设备、笔记本电脑、智能家居物联网(IOT)设备等。第一电子设备101与第二电子设备102的种类可相同或不同,第一电子设备101可以是两电子设备中的控制设备。
其中,第一电子设备101具有第一声波发射器1011和第一声波接收器1012,第二电子设备102具有第二声波发射器1021和第二声波接收器1022。第一电子设备101和第二电子设备102不仅具有发送声波能力,还具有接收声波能力。第一声波发射器1011或第二声波发射器1021包括:声波信号生成器、数模转换器(DAC)和声波信号发射器。第一声波接收器1012或第二声波接收器1022包括:声波信号接收器、模数转换器(ADC)和声波信号检测器。
可以理解的,对于手机等终端设备而言,终端设备内部的喇叭、听筒或麦克风等可视为超声波发射/接收装置,无需增加额外的硬件结构。
本公开实施例中的距离确定方法,比如可应用于如下场景:
在室内定位场景中,第一电子设备101比如是智能音响,第二电子设备102比如是扫地机器人。本公开实施例中的距离确定方法用于定位第二电子设备102的位置。
在移动支付场景中,第一电子设备101比如是支付终端,第二电子设备102比如是收银机等收款设备。本公开实施例中的距离确定方法用于确定第二电子设备102的距离,以便于可定制控制策略,如在与第二电子设备102的距离小于阈值时,唤醒支付界面。
在分享密码的场景中,第一电子设备101和第二电子设备102均可以是手机。本公开实施例中的距离确定方法用于确定两个手机间的距离,以便于可在距离小于阈值时传输密码,相较于现有方式(如扫码)更简便快捷,降低功耗。
在音箱接力场景中,第一电子设备101比如是手机,第二电子设备比如是音箱。本公开实施例中的距离确定方法用于确定二者距离,并结合距离执行个性化控制。比如,在距离大于阈值时以第一电子设备101播放音视频,在距离小于阈值时以第二电子设备102继续接力播放前述音视频。
图2是根据一示例性实施例示出的一种距离确定方法的流程图,如图2所示,距离确定方法用于第一电子设备中,本实施例的方法可以包括以下步骤。
步骤S210,在当前测距过程中,依次向第二电子设备发送至少一个第一检测信号,至接收到第二电子设备对至少一个第一检测信号中第一目标检测信号的确认消息,进行下一个测距过程中至少一个第一检测信号的发送。
步骤S220,接收第二电子设备针对当前测距过程中第一目标检测信号发送的第二目标检测信号,以及第一目标时间差。
步骤S230,根据第二目标检测信号和第一目标时间差,确定当前测距过程中第一电子设备和第二电子设备之间的距离。
其中,在步骤S210中,当前测距过程可以适用于第一电子设备的任一次测距,下一个测距过程对应于当前测距过程之后的第一个测距过程。确认消息(ACK)用于表征第二电子设备已成功接收到并成功解码第一目标检测信号。第一电子设备可通过自身的第一声波发射器1011发送声波形式(如超声波)的信号,如第一检测信号,第二电子设备通过对应的第二声波发射器1021发送声波形式的信号,如ACK;第一电子设备或第二电子设备内的声波接收器用于接收声波形式的信号,如第一检测信号。
本步骤中,结合图4至图7所示的第一电子设备的时序图,第一电子设备可按照设定的时间间隔依次发送至少一个第一检测信号(信号A)。当接收到第二电子设备的基于第一目标 检测信号(如为A 1-2)的ACK,则停止发送当前测距过程的第一检测信号,而进行发送下一个测距过程的第一检测信号。在发送下一个测距过程的第一检测信号时,第一电子设备无需等待第二电子设备发送的检测信号(信号B)或第一时间差(信号C),因此可有效缩短两次测距过程的间隔,提升测距刷新频率。
在步骤S220中,第一目标时间差用于表征:第二电子设备接收到第一目标检测信号的时间,与第二电子设备内部的声波接收器接收到第二目标检测信号的时间之间的时间差。第一目标时间差(t 2=t BB–t BA)是由第二电子设备确定的,详细实施方式可参考下述实施例的描述,此处不再赘述。
本步骤中,第二电子设备在接收到第一检测信号之后,还会发送声波形式的第二检测信号和第一时间差。记第一电子设备接收到的第二检测信号为第二目标检测信号,接收到的第一时间差为第一目标时间差。
在一个示例中,结合图4至图7所示,本步骤第一电子设备在成功收到第二电子设备的发送的消息后,也可向第二电子设备回复确认消息。本示例中方法还可以包括如下步骤:
步骤S221、响应于接收到第二目标检测信号和所述第一目标时间差,分别向第二电子设备发送对应的确认消息。此步骤中,第一电子设备在成功接收到第二目标检测信号(如为B 1- 2-2)后,向第二电子设备发送ACK;在成功接收到第一目标时间差(如为C 1-2-2-1)后,也会向第二电子设备发送ACK。以此保证通信的双方都能够及时的获知数据传输的情况,以免因数据遗漏或解码失败而影响当次测距过程的测距结果。并且,在确定数据传输成功后能够及时进行运算,以提升测距效率。
在步骤S230中,第一电子设备发送的第一检测信号既可以被第二电子设备收到,还可以被第一电子设备自身的声波接收器收到;同理,第二电子设备发送的第二检测信号既可以被第一电子设备收到,还可以被第二电子设备自身的声波接收器收到。因此,在当前测距过程中,第一电子设备与第二电子设备之间能够互相发射和接收声波信号。在测距过程中,将第一电子设备和第二电子设备分别作为发射端或接收端,将发射和接收设备分离的方式,以免利用回波进行测距,改善声波被吸收的问题。
本步骤中,第一电子设备根据第二目标检测信号对应的参数信息(如接收时间)和第一目标时间差,可以测量声波信号在空气中的飞行时间(TOF),从而结合TOF原理确定两个设备间的距离。
本公开的方法中,第一电子设备能够根据当前测距过程中发送第一检测信号的反馈情况,及时而准确的获知数据传输的情况。既有利于在收到确认消息时,及时高效的开启下一次测 距过程;还有利于准确传输数据,提高测距的成功率。并且,在收到确认消息后即开启下一次测距过程,有效减小两次测距之间的时间间隔,提高测距的刷新频率。
在一个示例性的实施例中,本实施例的方法还可以包括如下步骤:
步骤S200,在发送当前测距过程中的至少一个第一检测信号之前,为至少一个第一检测信号按序配置对应的编号。
在步骤S200中,第一电子设备在每次测距过程中,可按照预设的编号规则对至少一个第一检测信号进行编码。比如,以A a-n的编号形式表征各第一检测信号,其中A代表第一电子设备发出的信号,a代表第a次测距过程,n代表第a次测距过程的第n个第一检测信号。
结合图4所示,以当前测距过程是第一次测距为例,当前测距过程中至少一个第一检测信号可依次为:A 1-1,A 1-2,……,A 1-n。每个第一检测信号的内容相同,但编号不同,因此也可以将:除第一个第一检测信号之外的第一检测信号视为第一个第一检测信号的副本。当前测距过程的下一次测距中至少一个第一检测信号可依次为:A 2-1,A 2-2,……,A 2-n
在本步骤的一种实施方式下,在每次测距过程中,每发送一个第一检测信号之前,依次为该第一检测信号按序配置对应的编号。在本步骤的另一种实施方式下,在每次测距过程之前,预先为该测距过程中设定数量个第一检测信号按序配置好对应的编号;可以理解的,此种方式中,若收到第二电子设备的ACK,设定数量个第一检测信号无需全部发完。
在一个示例性的实施例中,本实施例的方法可以包括步骤S200以及步骤S210至S230。
在第一个示例中,本实施例步骤S210中依次向第二电子设备发送至少一个第一检测信号,可以包括如下步骤:
步骤S2101、向第二电子设备发送当前编号的第一检测信号。
步骤S2102、响应于未收到当前编号的第一检测信号对应的确认消息,重传当前编号的下一个编号的第一检测信号。
其中,在步骤S2101中,结合图4所示,当前编号比如是A 1-1。第一电子设备向第二电子设备发送A 1-1的第一检测信号。
在步骤S2102中,第一电子设备在向第二电子设备发送第一检测信号过程中,若未收到对应的ACK,将会进行当前测距过程中第一检测信号的重传,如发送A 1-2,以便于能够保证第二电子设备能够成功接收到当前测距过程中的第一检测信号,从而有利于完成当前测距过程。结合图4可知,两个相邻测距过程中在时间轴上存在交集,因此可以有效减少两次测距结果的输出间隔,提高测距结果的刷新频率。
在第二个示例中,本实施例步骤S220可以包括如下步骤:
步骤S2201、接收第二电子设备发送的携带目标编号的第二目标检测信号。
步骤S2202、接收第二电子设备发送的携带目标编号的第一目标时间差。
其中,目标编号为第一目标检测信号的编号。
在步骤S2201中,第二电子设备可采用匹配的编号规则对第二检测信号进行编号。比如,以B a-n-m的编号形式表征各第一检测信号,其中B代表第二电子设备发出的信号,a代表第a次测距过程,n代表第a次测距过程中第二电子设备所接收到的第n个第一检测信号,m代表第a次测距过程中的第m个第二检测信号。
结合图5所示,以当前测距过程是第一次测距为例,当前测距过程中第二电子设备接收到的第一检测信号即第一目标检测信号的目标编号可以是:A 1-2。则在当前测距过程中,第二电子设备可发送至少一个第二检测信号,至少一个第二检测信号依次为:B 1-2-1,B 1-2-2,……,B 1-2-m。记第一电子设备接收到的第二检测信号为第二目标检测信号,例如第二目标检测信号的编号为:B 1-2-2
在步骤S2202中,第二电子设备在为第一时间差编号时,比如可采用C a-n-m-k的编号形式,其中C代表第二电子设备确定并发出的信号,a代表第a次测距过程,n代表第a次测距过程中第二电子设备所接收到的第n个第一检测信号,m代表第a次测距过程中第一电子设备所接收到的第m个第二检测信号,k代表第a次测距过程中第k个第一时间差。
结合图4至图5所示以及前述示例,若第二电子设备接收到的第一检测信号编号为:A 1- 2,第一电子设备接收到的第二检测信号(第二目标检测信号)的编号为:B 1-2-2。则在当前测距过程中,第二电子设备可确定并发送至少一个第一时间差,至少一个第一时间差依次为:C 1- 2-2-1,C 1-2-2-2,……,C 1-2-2-m。记第一电子设备接收到的第一时间差为第一目标时间差,例如第一目标时间差的编号为:C 1-2-2-1
本实施例中,第二电子设备在编号过程中,第二检测信号和第一时间差都会携带所接收到的第一检测信号的编号信息。比如图4或图5示例中的“1-2”。
在第三个示例中,本实施例中步骤S230可以包括如下步骤:
步骤S2301、根据第二目标检测信号携带的目标编号以及第一目标时间差携带的目标编号,确定目标编号对应的第一目标检测信号。
步骤S2302、根据第一目标检测信号、第二目标检测信号以及第一目标时间差,确定距离。
其中,在步骤S2301中,第一电子设备在接收到第二目标检测信号或者第一目标时间差后,可根据二者所携带的目标编号获知第二电子设备所收到的第一检测信号为:第一目标检 测信号。
在步骤S2302中,第一电子设备根据第一目标检测信号、第二目标检测信号以及第一目标时间差的相关参数(如接收时间),结合图6至图7的时序图,图6和图7中示意了设备接收到的信号的时序图,根据TOF原理可确定距离。
在一种可能的实施方式中,步骤S2302可以包括如下步骤:
步骤S2302-1、确定第一电子设备接收第一目标检测信号的时间。此步骤中,第一电子设备在获知第二电子设备所接收到的第一检测信号为第一目标检测信号之后,可确定自身声波接收器接收第一目标检测信号的时间,记为t AA
步骤S2302-2、根据第一电子设备接收第一目标检测信号的时间,以及接收到第二目标检测信号的时间,确定第二时间差。此步骤中,第一电子设备接收到第二目标检测信号的时间可记为t AB,第二时间差t 1=t AB–t AA
步骤S2302-3、根据第一目标时间差(t 2=t BB–t BA)与第二时间差,确定距离。此步骤中,结合第二电子设备确定并发送的第一目标时间差(t 2),第一电子设备能够确定与第二电子设备间的距离d。d满足:
Figure PCTCN2022095291-appb-000001
其中,D为第一电子设备中声波发射器与声波接收器的距离、与第二电子设备中声波发射器与声波接收器的距离之和,u为空气中声速(近似为340m/s)。
示例地,不同温度条件下声速可由如下公式计算:u=331.6+0.6T(m/s),其中,T为摄氏度,331.6m/s是声波在空气中温度为0摄氏度时的传播速度。
在一个示例性的实施例中,本实施例的方法还可以包括如下步骤:
步骤S201、在发送第一检测信号之前以及发送第一检测信号的过程中,监听第一检测信号对应信道的信道状态。
步骤S202、若在发送第一检测信号之前信道被占用,待信道空闲时发送第一检测信号。
步骤S203、若在发送第一检测信号的过程中信道中存在信号碰撞,停止发送第一检测信号。
其中,本实施例适用于第一电子设备在发送信号之前或者发送信号的过程中,通过进行信道监听,来调整发送信号的时机。
在步骤S201中,第一电子设备可基于载波侦听(CSMA)机制进行监听信道没在信道空闲 时进行信号的发送。可以理解的,在监听时可能存在多个设备因信道空闲而同时发送的问题,因此在发送第一检测信号的过程中,也仍要进行监听信道状态,是否存在信号碰撞。
在步骤S202中,若在发送第一检测信号之前信道被占用(如第二电子设备可能占用信道发送第二检测信号),第一电子设备保持等待,待信道空闲时再进行发送第一检测信号,以免发送信号碰撞而导致两个信号都不能被成功解调。
在步骤S203中,若在发送第一检测信号的过程中存在信号碰撞,发送信号的设备均需要停止发送,采用退避策略。本步骤中第一电子设备停止发送第一检测信号,仍保持对信道的监听。
图3是是根据一示例性实施例示出的一种距离确定方法的流程图,如图3所示,距离确定方法用于第二电子设备中,本实施例的方法可以包括以下步骤。
步骤S310,在当前测距过程中,响应于接收到第一电子设备发送的第一目标检测信号,向第一电子设备发送针对第一目标检测信号对应的确认消息。
步骤S320,依次向第一电子设备发送至少一个第二检测信号,至接收到第一电子设备对至少一个第二检测信号中第二目标检测信号的确认消息。
步骤S330,确定第一时间差。
步骤S340,依次向第一电子设备发送至少一个第一时间差,至接收到第一电子设备对至少一个第一时间差中第一目标时间差的确认消息,进行下一个测距过程中至少一个第二检测信号的发送。
其中,在步骤S310中,第一目标检测信号为第一电子设备在当前测距过程中发送的至少一个第一检测信号中的检测信号。第二电子设备在接收到第一目标检测信号,并成功解码(解码并通过了校验码验证)后,向第一电子设备发送ACK。
在步骤S320中,结合图5所示的第二电子设备的时序图,第二电子设备在收到第一目标检测信号之后,会按照设定的时间间隔发送当前测距过程中的至少一个第二检测信号,直至收到第一电子设备的ACK停止发送当前测距过程的第二检测信号。
在步骤S330中,第一时间差用于表征:第二电子设备接收到第一目标检测信号的时间,与第二电子设备内部的声波接收器接收到第二目标检测信号的时间之间的时间差。本步骤中,第二电子设备在收到第一电子设备的ACK后,可计算确定第一时间差(t 2)。
在步骤S340中,第二电子设备发送第一时间差的方式依然采取重传的方式,即按设定的 时间间隔发送至少一个第一时间差,直至收到第一电子设备的ACK再停止。第二电子设备在收到第一电子设备针对第一时间差的ACK后,可启动下一次测距过程中第二检测信号的发送,从而在时间轴可以有效减少等待时间,有利于提升测距刷新频率。
在一个示例性的实施例中,至少一个第一检测信号按序配置有对应的编号。本实施例中步骤S320可以包括如下步骤:
步骤S3201、根据第一目标检测信号的目标编号,生成具有设定顺序的至少一个携带目标编号的第二检测信号。
步骤S3202、依次向第一电子设备发送至少一个携带目标编号的第二检测信号。
其中,在步骤S3201中,第二电子设备采用设定的编号规则,根据目标编号,生成对应的第二检测信号的编号。结合图4至图5所示以及前述实施例的描述,若第二电子设备接收到的第一检测信号的目标编号为:A 1-2,则第二电子设备可对至少一个第二检测信号采用如下编号形式:B 1-2-m,其中,B代表第二电子设备发送的信号,m代表第m个第二检测信号。第二检测信号的编号携带了目标编号“1-2”。
在步骤S3202中,第二电子设备按设定的时间间隔依次向第一电子设备发送携带“1-2”的至少一个第二检测信号,比如依次发送如下编号的第二检测信号B 1-2-1,B 1-2-2,……,B 1-2-m。
在一个示例性的实施例中,至少一个第一检测信号按序配置有对应的编号。本实施例中步骤S330可以包括如下步骤:
步骤S3301、确定第二电子设备接收第二目标检测信号的时间。
步骤S3302、确定第二电子设备接收第二目标检测信号的时间与接收第一目标检测信号的时间之间的差值。
步骤S3303、根据差值和第一目标检测信号的目标编号,生成具有设定顺序的至少一个携带目标编号的第一时间差。
其中,在步骤S3301中,第二目标检测信号是第一电子设备成功接收的第二检测信号,即第二电子设备收到的ACK对应的第二检测信号。本步骤中,第二电子设备确定自身的声波接收器接收第二目标检测信号时的时间,记为t BB
在步骤S3302中,第二电子设备接收第一目标检测信号的时间记为t BA。第二电子设备计算差值t 2=t BB–t BA
在步骤S3303中,第二电子设备将差值与编号一起编码,获得携带编号的第一时间差。
结合图4至图5所示以及前述实施例的描述,若第二电子设备接收到的第一检测信号的 目标编号为:A 1-2,第一电子设备接收到的第二检测信号(第二目标检测信号)的编号为:B 1- 2-2。则第二电子设备可对至少一个第一时间差采用如下编号形式:C 1-2-2-k,其中,B代表第二电子设备确定并发送的信号,k代表第k个第一时间差。第一时间差的编号携带了目标编号“1-2”,或者说携带了包含目标编号的第二目标检测信号的编号,即“1-2-2”。
在一个示例性的实施例中,本实施例的方法还包括:
步骤S301、在发送第二检测信号或第一时间差之前,或者,在发送第二检测信号或第一时间差的过程中,监听对应信道的信道状态。
步骤S302、若在发送第二检测信号或第一时间差之前信道被占用,待信道空闲时执行发送。
步骤S303、若在发送第二检测信号或第一时间差的过程中信道中存在信号碰撞,停止发送第二检测信号或第一时间差。
其中,本实施例适用于第二电子设备在发送信号之前或者发送信号的过程中,通过进行信道监听,来调整发送信号的时机。
在步骤S301中,第二电子设备可基于载波侦听(CSMA)机制进行监听信道没在信道空闲时进行信号的发送。可以理解的,在监听时可能存在多个设备因信道空闲而同时发送的问题,因此在发送第二检测信号或第一时间差的过程中,也仍要进行监听信道状态,是否存在信号碰撞。
在步骤S302中,若在发送第二检测信号或第一时间差之前信道被占用(如第一电子设备可能占用信道发送第一检测信号),第二电子设备保持等待,待信道空闲时再进行发送,以免发送信号碰撞而导致两个信号都不能被成功解调。
在步骤S303中,若在发送第二检测信号或第一时间差的过程中存在信号碰撞,发送信号的设备均需要停止发送,采用退避策略。本步骤中第二电子设备停止发送第一检测信号,仍保持对信道的监听。
图8是根据一示例性实施例示出的一种距离确定装置的框图。参照图8,该装置被配置于第一电子设备中。该装置包括第一发送模块810,接收模块820和第一确定模块830。
该第一发送模块810被配置为在当前测距过程中,依次向第二电子设备发送至少一个第一检测信号,至接收到第二电子设备对至少一个第一检测信号中第一目标检测信号的确认消息,进行下一个测距过程中至少一个第一检测信号的发送。
该接收模块820被配置为接收第二电子设备针对当前测距过程中第一目标检测信号发送 的第二目标检测信号,以及第一目标时间差,其中,第一目标时间差用于表征:第二电子设备接收到第一目标检测信号的时间,与第二电子设备内部的声波接收器接收到第二目标检测信号的时间之间的时间差。
该第一确定模块830被配置为根据第二目标检测信号和第一目标时间差,确定当前测距过程中第一电子设备和第二电子设备之间的距离。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
图9是根据一示例性实施例示出的一种距离确定装置的框图。参照图9,该装置被配置于第二电子设备中。该装置包括第二发送模块910和第二确定模块920。
第二发送模块910被配置为在当前测距过程中,响应于接收到第一电子设备发送的第一目标检测信号,向第一电子设备发送针对第一目标检测信号对应的确认消息,其中,第一目标检测信号为第一电子设备在当前测距过程中发送的至少一个第一检测信号中的检测信号。
第二发送模块910被配置为,依次向第一电子设备发送至少一个第二检测信号,至接收到第一电子设备对至少一个第二检测信号中第二目标检测信号的确认消息。
第二确定模块920被配置为确定第一时间差,其中,第一时间差用于表征:第二电子设备接收到第一目标检测信号的时间,与第二电子设备内部的声波接收器接收到第二目标检测信号的时间之间的时间差;
第二发送模块910被配置为,依次向第一电子设备发送至少一个第一时间差,至接收到第一电子设备对至少一个第一时间差中第一目标时间差的确认消息,进行下一个测距过程中至少一个第二检测信号的发送。
图10是根据一示例性实施例示出的一种电子设备1000的框图。例如,装置1000可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。
参照图10,装置1000可以包括以下一个或多个组件:处理组件1002,存储器1004,电力组件1006,多媒体组件1008,音频组件1010,输入/输出(I/O)的接口1012,传感器组件1014,以及通信组件1016。
处理组件1002通常控制装置1000的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件1002可以包括一个或多个处理器1020来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件1002可以包括一个或多个模块,便于处理组件1002和其他组件之间的交互。例如,处理组件1002可以包括多媒体模块,以 方便多媒体组件1008和处理组件1002之间的交互。
存储器1004被配置为存储各种类型的数据以支持在设备1000的操作。这些数据的示例包括用于在装置1000上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器1004可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电源组件1006为装置1000的各种组件提供电力。电源组件1006可以包括电源管理系统,一个或多个电源,及其他与为装置1000生成、管理和分配电力相关联的组件。
多媒体组件1008包括在所述装置1000和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件1008包括一个前置摄像头和/或后置摄像头。当设备1000处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件1010被配置为输出和/或输入音频信号。例如,音频组件1010包括一个麦克风(MIC),当装置1000处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器1004或经由通信组件1016发送。在一些实施例中,音频组件1010还包括一个扬声器,用于输出音频信号。
I/O接口1012为处理组件1002和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。
传感器组件1014包括一个或多个传感器,用于为装置1000提供各个方面的状态评估。例如,传感器组件1014可以检测到设备1000的打开/关闭状态,组件的相对定位,例如所述组件为装置1000的显示器和小键盘,传感器组件1014还可以检测装置1000或装置1000一个组件的位置改变,用户与装置1000接触的存在或不存在,装置1000方位或加速/减速和装置1000的温度变化。传感器组件1014可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件1014还可以包括光传感器,如CMOS或CCD图像传 感器,用于在成像应用中使用。在一些实施例中,该传感器组件1014还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件1016被配置为便于装置1000和其他设备之间有线或无线方式的通信。装置1000可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件1016经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件1016还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,装置1000可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器1004,上述指令可由装置1000的处理器1020执行以完成上述方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本发明的其它实施方案。本申请旨在涵盖本发明的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本发明的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本发明的真正范围和精神由下面的权利要求指出。
应当理解的是,本发明并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本发明的范围仅由所附的权利要求来限制。
工业实用性
本公开的方法中,第一电子设备能够根据当前测距过程中发送第一检测信号的反馈情况,及时而准确的获知数据传输的情况。既有利于在收到确认消息时,及时高效的开启下一次测距过程;还有利于准确传输数据,提高测距的成功率。并且,在收到确认消息后即开启下一次测距过程,有效减小两次测距之间的时间间隔,提高测距的刷新频率。

Claims (16)

  1. 一种距离确定方法,其特征在于,应用于第一电子设备,方法包括:
    在当前测距过程中,依次向第二电子设备发送至少一个第一检测信号,至接收到所述第二电子设备对所述至少一个第一检测信号中第一目标检测信号的确认消息,进行下一个测距过程中至少一个第一检测信号的发送;
    接收第二电子设备针对所述当前测距过程中所述第一目标检测信号发送的第二目标检测信号,以及第一目标时间差,其中,所述第一目标时间差用于表征:所述第二电子设备接收到所述第一目标检测信号的时间,与所述第二电子设备内部的声波接收器接收到所述第二目标检测信号的时间之间的时间差;
    根据所述第二目标检测信号和所述第一目标时间差,确定所述当前测距过程中所述第一电子设备和所述第二电子设备之间的距离。
  2. 根据权利要求1所述的距离确定方法,其特征在于,所述方法还包括:
    在发送所述当前测距过程中的所述至少一个第一检测信号之前,为所述至少一个第一检测信号按序配置对应的编号。
  3. 根据权利要求2所述的距离确定方法,其特征在于,所述依次向第二电子设备发送至少一个第一检测信号,包括:
    向所述第二电子设备发送当前编号的第一检测信号;
    响应于未收到所述当前编号的第一检测信号对应的确认消息,重传所述当前编号的下一个编号的第一检测信号。
  4. 根据权利要求2所述的距离确定方法,其特征在于,所述接收第二电子设备针对所述当前测距过程中所述第一目标检测信号发送的第二目标检测信号,以及第一目标时间差,包括:
    接收所述第二电子设备发送的携带目标编号的第二目标检测信号;
    接收所述第二电子设备发送的携带所述目标编号的第一目标时间差;
    其中,所述目标编号为所述第一目标检测信号的编号。
  5. 根据权利要求4所述的距离确定方法,其特征在于,所述根据所述第二目标检测信号和所述第一目标时间差,确定所述当前测距过程中所述第一电子设备和所述第二电子设备之间的距离,包括:
    根据所述第二目标检测信号携带的目标编号以及所述第一目标时间差携带的目标编号, 确定所述目标编号对应的所述第一目标检测信号;
    根据所述第一目标检测信号、所述第二目标检测信号以及所述第一目标时间差,确定所述距离。
  6. 根据权利要求5所述的距离确定方法,其特征在于,所述根据所述第一目标检测信号、所述第二目标检测信号以及所述第一目标时间差,确定所述距离,包括:
    确定所述第一电子设备接收所述第一目标检测信号的时间;
    根据所述第一电子设备接收所述第一目标检测信号的时间,以及接收到所述第二目标检测信号的时间,确定第二时间差;
    根据所述第一目标时间差与所述第二时间差,确定所述距离。
  7. 根据权利要求1至6任一项所述的距离确定方法,其特征在于,所述方法还包括:
    响应于接收到所述第二目标检测信号和所述第一目标时间差,分别向所述第二电子设备发送对应的确认消息。
  8. 根据权利要求1至6任一项所述的距离确定方法,其特征在于,所述方法还包括:
    在发送所述第一检测信号之前以及发送所述第一检测信号的过程中,监听所述第一检测信号对应信道的信道状态;
    若在发送所述第一检测信号之前所述信道被占用,待所述信道空闲时发送所述第一检测信号;
    若在发送所述第一检测信号的过程中所述信道中存在信号碰撞,停止发送所述第一检测信号。
  9. 一种距离确定方法,其特征在于,应用于第二电子设备,方法包括:
    在当前测距过程中,响应于接收到第一电子设备发送的第一目标检测信号,向所述第一电子设备发送针对所述第一目标检测信号对应的确认消息,其中,所述第一目标检测信号为第一电子设备在当前测距过程中发送的至少一个第一检测信号中的检测信号;
    依次向所述第一电子设备发送至少一个第二检测信号,至接收到所述第一电子设备对所述至少一个第二检测信号中第二目标检测信号的确认消息;
    确定第一时间差,其中,所述第一时间差用于表征:所述第二电子设备接收到所述第一目标检测信号的时间,与所述第二电子设备内部的声波接收器接收到所述第二目标检测信号的时间之间的时间差;
    依次向所述第一电子设备发送至少一个第一时间差,至接收到所述第一电子设备对所述至少一个第一时间差中第一目标时间差的确认消息,进行下一个测距过程中至少一个第二检 测信号的发送。
  10. 根据权利要求9所述的距离确定方法,其特征在于,所述至少一个第一检测信号按序配置有对应的编号;
    所述依次向所述第一电子设备发送至少一个第二检测信号,包括:
    根据所述第一目标检测信号的目标编号,生成具有设定顺序的至少一个携带所述目标编号的第二检测信号;
    依次向所述第一电子设备发送至少一个携带所述目标编号的第二检测信号。
  11. 根据权利要求9所述的距离确定方法,其特征在于,所述至少一个第一检测信号按序配置有对应的编号;
    所述确定第一时间差,包括:
    确定所述第二电子设备接收所述第二目标检测信号的时间;
    确定所述第二电子设备接收所述第二目标检测信号的时间与接收所述第一目标检测信号的时间之间的差值;
    根据所述差值和所述第一目标检测信号的目标编号,生成具有设定顺序的至少一个携带所述目标编号的所述第一时间差。
  12. 根据权利要求9至11任一项所述的距离确定方法,其特征在于,所述方法还包括:
    在发送所述第二检测信号或所述第一时间差之前,或者,在发送所述第二检测信号或所述第一时间差的过程中,监听对应信道的信道状态;
    若在发送所述第二检测信号或所述第一时间差之前所述信道被占用,待所述信道空闲时执行发送;
    若在发送所述第二检测信号或所述第一时间差的过程中所述信道中存在信号碰撞,停止发送所述第二检测信号或所述第一时间差。
  13. 一种距离确定装置,其特征在于,被配置于第一电子设备,装置包括:
    第一发送模块,在当前测距过程中,依次向第二电子设备发送至少一个第一检测信号,至接收到所述第二电子设备对所述至少一个第一检测信号中第一目标检测信号的确认消息,进行下一个测距过程中至少一个第一检测信号的发送;
    接收模块,用于接收第二电子设备针对所述当前测距过程中所述第一目标检测信号发送的第二目标检测信号,以及第一目标时间差,其中,所述第一目标时间差用于表征:所述第二电子设备接收到所述第一目标检测信号的时间,与所述第二电子设备内部的声波接收器接 收到所述第二目标检测信号的时间之间的时间差;
    第一确定模块,用于根据所述第二目标检测信号和所述第一目标时间差,确定所述当前测距过程中所述第一电子设备和所述第二电子设备之间的距离。
  14. 一种距离确定装置,其特征在于,被配置于第二电子设备,装置包括:
    第二发送模块,用于在当前测距过程中,响应于接收到第一电子设备发送的第一目标检测信号,向所述第一电子设备发送针对所述第一目标检测信号对应的确认消息,其中,所述第一目标检测信号为第一电子设备在当前测距过程中发送的至少一个第一检测信号中的检测信号;
    所述第二发送模块还用于,依次向所述第一电子设备发送至少一个第二检测信号,至接收到所述第一电子设备对所述至少一个第二检测信号中第二目标检测信号的确认消息;
    第二确定模块,用于确定第一时间差,其中,所述第一时间差用于表征:所述第二电子设备接收到所述第一目标检测信号的时间,与所述第二电子设备内部的声波接收器接收到所述第二目标检测信号的时间之间的时间差;
    所述第二发送模块还用于,依次向所述第一电子设备发送至少一个第一时间差,至接收到所述第一电子设备对所述至少一个第一时间差中第一目标时间差的确认消息,进行下一个测距过程中至少一个第二检测信号的发送。
  15. 一种电子设备,其特征在于,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器被配置为:执行如权利要求1至8任一项或者权利要求9至12任一项所述的距离确定方法。
  16. 一种非临时性计算机可读存储介质,其特征在于,当所述存储介质中的指令由电子设备的处理器执行时,使得电子设备能够执行如权利要求1至8任一项或者权利要求9至12任一项所述的距离确定方法。
PCT/CN2022/095291 2022-05-26 2022-05-26 一种距离确定方法、装置、电子设备及可读存储介质 WO2023225954A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/095291 WO2023225954A1 (zh) 2022-05-26 2022-05-26 一种距离确定方法、装置、电子设备及可读存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/095291 WO2023225954A1 (zh) 2022-05-26 2022-05-26 一种距离确定方法、装置、电子设备及可读存储介质

Publications (1)

Publication Number Publication Date
WO2023225954A1 true WO2023225954A1 (zh) 2023-11-30

Family

ID=88918139

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/095291 WO2023225954A1 (zh) 2022-05-26 2022-05-26 一种距离确定方法、装置、电子设备及可读存储介质

Country Status (1)

Country Link
WO (1) WO2023225954A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016042606A1 (ja) * 2014-09-17 2016-03-24 株式会社日立製作所 距離検知システム
CN107076829A (zh) * 2014-10-27 2017-08-18 高通股份有限公司 用于确定无线地连接的电子装置之间的距离或角度的方法
CN112540377A (zh) * 2019-09-04 2021-03-23 北京小米移动软件有限公司 距离检测组件、方法、电子设备及存储介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016042606A1 (ja) * 2014-09-17 2016-03-24 株式会社日立製作所 距離検知システム
CN107076829A (zh) * 2014-10-27 2017-08-18 高通股份有限公司 用于确定无线地连接的电子装置之间的距离或角度的方法
CN112540377A (zh) * 2019-09-04 2021-03-23 北京小米移动软件有限公司 距离检测组件、方法、电子设备及存储介质

Similar Documents

Publication Publication Date Title
EP3576430B1 (en) Audio signal processing method and device, and storage medium
WO2019183854A1 (zh) 寻呼同步指示方法及装置、寻呼同步方法及装置和基站
US11516832B2 (en) Method and device for transmitting data in unlicensed cell, base station and user equipment
US11641625B2 (en) Information transmission method for ultrasonic transmitter, information transmission device for ultrasonic transmitter, and storage medium
US11337173B2 (en) Method and device for selecting from a plurality of beams
US11727928B2 (en) Responding method and device, electronic device and storage medium
US20230413234A1 (en) Method and device for resource selection, and storage medium
US10009283B2 (en) Method and device for processing information
US11832180B2 (en) Information transmission method and electronic device
WO2019061085A1 (zh) 信道检测、信息发送方法、装置及通信设备
US20210307104A1 (en) Method and apparatus for controlling intelligent voice control device and storage medium
WO2019041348A1 (zh) 波束上报和调整方法及装置、用户设备、基站
US11871449B2 (en) Backoff method and apparatus in transmission process, device, system, and storage medium
US11304067B2 (en) Methods and devices for reporting and determining optimal beam, user equipment, and base station
WO2019127250A1 (zh) 数据传输方法、装置、系统及计算机可读存储介质
WO2023225954A1 (zh) 一种距离确定方法、装置、电子设备及可读存储介质
US11317341B2 (en) System information request adjustment method and apparatus, and user equipment
US11863480B2 (en) Method and device for transmitting reference signal
WO2021179126A1 (zh) 控制信令检测方法、控制信令检测装置及存储介质
US11956755B2 (en) Method and apparatus for transmitting paging signaling
EP3876651A1 (en) Contention random access method and device
WO2019183939A1 (zh) 数据传输方法及装置
WO2019140696A1 (zh) 信息传输方法、装置、系统和存储介质
WO2022104745A1 (zh) 通信方法、通信装置及存储介质
WO2023201484A1 (zh) 一种基于辅助资源集进行通信的方法、装置及存储介质

Legal Events

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

Ref document number: 22943154

Country of ref document: EP

Kind code of ref document: A1