Method for determining location information and electronic device
By sending ultrasonic signals through the first electronic device and utilizing the time difference and the position information of the speaker and microphone inside the device, the position of the second electronic device is automatically determined, which solves the problem of the complexity of manually setting the device position by the user and improves the user experience.
Patent Information
- Application Number
- PCT/CN2023/140438
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-28
- Filing Date
- 2023-12-20
- Publication Date
- 2024-09-06
AI Technical Summary
When multiple electronic devices collaborate, users need to manually set the position and role of each device, which is complicated and results in a poor user experience.
The first electronic device sends ultrasonic signals and receives echo signals. By utilizing the time difference and the position information of the speaker and microphone inside the device, the position of the second electronic device is automatically determined, avoiding manual setting by the user.
It simplifies user operations, improves user experience, and reduces the complexity of device location settings.
Smart Images

Figure CN2023140438_06092024_PF_FP
Abstract
Description
Method and electronic device for determining location information
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on February 28, 2023, with application number 202310225172.8 and application name “Method and electronic device for determining location information”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of electronic technology, and more particularly to a method and electronic device for determining position information in the field of electronic technology. Background Art
[0003] In some scenarios, multiple electronic devices can collaborate to achieve some functions. In the process of collaboration among multiple electronic devices, users need to know the position of each electronic device and manually set the role of each electronic device according to the position of the electronic device. Some functions can be achieved according to the different roles of each electronic device. This places high demands on users and is complicated to operate. For example, a large screen can play different audio signals through multiple speakers to achieve a stereo effect. For example, the large screen can be a TV, a computer, or a projector. Users can set the channel of each speaker according to the position of each speaker in the display interface of the large screen. Multiple speakers play different audio signals from the large screen to achieve a stereo effect. However, this process requires users to set it manually and requires users to have certain knowledge of allocating channels. The operation is complicated and the user experience is poor.
[0004] Summary of the Invention
[0005] The embodiments of the present application provide a method for determining location information and an electronic device, which can improve user experience and reduce operational complexity.
[0006] In a first aspect, a method for determining position information is provided, including: a first electronic device sends a first ultrasonic signal through a first speaker; the first electronic device sends a second ultrasonic signal through a second speaker; the first electronic device receives a third ultrasonic signal sent by a second electronic device through a third speaker through a first microphone; the first electronic device obtains first time information and second time information, the first time information being used to indicate a time difference between a time when the second electronic device receives the first ultrasonic signal and a time when the second electronic device processes the third ultrasonic signal, and the second time information being used to indicate a time difference between a time when the second electronic device receives the second ultrasonic signal and a time when the second electronic device processes the third ultrasonic signal; wherein the time when the second electronic device processes the third ultrasonic signal includes: the time when the second electronic device sends the third ultrasonic signal through the third speaker or the time when the second electronic device receives the third ultrasonic signal through the second microphone; the first electronic device processes the third ultrasonic signal based on the first time information and the second time information The position information of the second electronic device is determined based on the information, third time information and fourth time information, as well as the positions of the first speaker, the second speaker and the first microphone in the first electronic device, the third time information is used to indicate the time difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first electronic device processes the first ultrasonic signal, and the fourth time information is used to indicate the time difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first electronic device processes the second ultrasonic signal; wherein, the time when the first electronic device processes the first ultrasonic signal includes: the time when the first electronic device sends the first ultrasonic signal through the first speaker or the time when the first electronic device receives the first ultrasonic signal through the first microphone; the time when the first electronic device processes the second ultrasonic signal includes: the time when the first electronic device sends the second ultrasonic signal through the second speaker or the time when the first electronic device receives the second ultrasonic signal through the first microphone.
[0007] In the above scheme, the first electronic device can send the first ultrasonic signal and the second ultrasonic signal respectively through the first speaker and the second speaker, and the second electronic device can also send the third ultrasonic signal through the third speaker. The first electronic device can use the first time information, the second time information, the third time information and the fourth time information, as well as the positions of the first speaker, the second speaker and the first microphone in the first electronic device to determine the position information of the second electronic device, thereby avoiding the user from needing to know the position information of the second electronic device, which can improve the user experience and reduce the complexity of operation. In a scenario where a large screen can play different audio signals through multiple speakers to achieve a stereo effect, the first electronic device can be the large screen and the second electronic device can be the speaker. The large screen can determine the position of the speaker based on the first time information, the second time information, the third time information and the fourth time information, as well as the positions of the first speaker, the second speaker and the first microphone in the large screen. The large screen can assign channels to the speakers based on the positions of the speakers, avoiding the need for the user to know the positions of each speaker and manually assign channels based on the positions of each speaker, thereby improving the user experience and reducing complexity.
[0008] Optionally, the time difference in the embodiment of the present application can be a positive value or a negative value.
[0009] Optionally, the first time information is used to indicate the time difference between the time when the second electronic device receives the first ultrasonic signal and the time when the second electronic device processes the third ultrasonic signal. If the second electronic device receives the first ultrasonic signal before the second electronic device processes the third ultrasonic signal, the time difference between the time when the second electronic device receives the first ultrasonic signal and the time when the second electronic device processes the third ultrasonic signal indicated by the first time information may be a negative value; if the second electronic device receives the first ultrasonic signal after the second electronic device processes the third ultrasonic signal, the time difference between the time when the second electronic device receives the first ultrasonic signal and the time when the second electronic device processes the third ultrasonic signal indicated by the first time information may be a positive value.
[0010] Optionally, the second time information is used to indicate the time difference between the time when the second electronic device receives the second ultrasonic signal and the time when the second electronic device processes the third ultrasonic signal. If the second electronic device receives the second ultrasonic signal before the second electronic device processes the third ultrasonic signal, the time difference between the time when the second electronic device receives the second ultrasonic signal and the time when the second electronic device processes the third ultrasonic signal indicated by the second time information may be a negative value; if the second electronic device receives the second ultrasonic signal after the second electronic device processes the third ultrasonic signal, the time difference between the time when the second electronic device receives the second ultrasonic signal and the time when the second electronic device processes the third ultrasonic signal indicated by the second time information may be a positive value.
[0011] Optionally, the third time information is used to indicate the time difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first electronic device processes the first ultrasonic signal. If the first electronic device receives the third ultrasonic signal before the first electronic device processes the first ultrasonic signal, the difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first electronic device processes the first ultrasonic signal indicated by the third time information is negative; if the first electronic device receives the third ultrasonic signal after the first electronic device processes the first ultrasonic signal, the difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first electronic device processes the first ultrasonic signal indicated by the third time information is positive.
[0012] Optionally, the fourth time information is used to indicate the time difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first electronic device processes the second ultrasonic signal. If the first electronic device receives the third ultrasonic signal before the first electronic device processes the second ultrasonic signal, the difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first electronic device processes the second ultrasonic signal indicated by the fourth time information is negative; if the first electronic device receives the third ultrasonic signal after the first electronic device processes the second ultrasonic signal, the difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first electronic device processes the second ultrasonic signal indicated by the fourth time information is positive.
[0013] Optionally, the positions of the first speaker, the second speaker, and the first microphone in the first electronic device may be known quantities, and the first electronic device may know the positions of the first speaker, the second speaker, and the first microphone in the first electronic device.
[0014] Optionally, the position of the first speaker in the first electronic device may be the coordinates of the first speaker; the position of the second speaker in the first electronic device may be the coordinates of the second speaker; and the position of the first microphone in the first electronic device may be the coordinates of the first microphone.
[0015] Optionally, the first speaker may be a left speaker of the first electronic device, and the second speaker may be a right speaker of the first electronic device.
[0016] Optionally, the distance between the first speaker and the second speaker is greater than a preset value.
[0017] Optionally, the size of the first electronic device is larger than a preset value. For example, the display screen of the first electronic device may be larger than the preset size.
[0018] Optionally, the first electronic device may be a smart TV.
[0019] Optionally, the first electronic device may be a smart screen.
[0020] Optionally, the second electronic device may be an audio playback device, such as a speaker.
[0021] Optionally, the first ultrasonic signal is different from the second ultrasonic signal, so that the second electronic device can distinguish that the first ultrasonic signal and the second ultrasonic signal are sent by two different speakers. Optionally, if the first ultrasonic signal is different from the second ultrasonic signal, the time when the first electronic device sends the first ultrasonic signal through the first speaker can be the same as the time when the first electronic device sends the second ultrasonic signal through the second speaker, that is, the first electronic device can send the first ultrasonic signal and the second ultrasonic signal at the same time. Optionally, the first ultrasonic signal and the second ultrasonic signal are different, including: the first electronic device sends the first ultrasonic signal and the second ultrasonic signal at different frequencies, or the first ultrasonic signal and the second ultrasonic signal are orthogonal signals.
[0022] Optionally, the first ultrasonic signal and the second ultrasonic signal may be the same, but the time when the first electronic device sends the first ultrasonic signal through the first speaker is different from the time when the first electronic device sends the second ultrasonic signal through the second speaker, so that the second electronic device can identify the first ultrasonic signal and the second ultrasonic signal.
[0023] In some possible implementations, the time it takes for the first electronic device to process the first ultrasonic signal is: the time it takes for the first electronic device to send the first ultrasonic signal through the first speaker; the time it takes for the first electronic device to process the second ultrasonic signal is: the time it takes for the first electronic device to send the second ultrasonic signal through the second speaker.
[0024] In some possible implementations, the first electronic device determines the location information of the second electronic device based on the first time information, the second time information, the third time information and the fourth time information, as well as the locations of the first speaker, the second speaker and the first microphone in the first electronic device, including: the first electronic device determines the sum of the first distance and the second distance based on the first time information and the third time information; the first distance is the distance between the first speaker and the second electronic device, and the second distance is the distance between the first microphone and the second electronic device; the first electronic device determines the sum of the third distance and the second distance based on the second time information and the fourth time information; the third distance is the distance between the second speaker and the second electronic device; the first electronic device determines the location information of the second electronic device based on the sum of the first distance and the second distance, the sum of the third distance and the second distance, and the locations of the first speaker, the second speaker and the first microphone in the first electronic device.
[0025] In the above solution, the first electronic device can determine the sum of the distance from the first speaker to the second electronic device and the distance from the first microphone to the second electronic device based on the first time information and the third time information, and determine the sum of the distance from the second speaker to the second electronic device and the distance from the first microphone to the second electronic device based on the second time information and the fourth time information. The first electronic device can determine the location information of the second electronic device based on the sum of these two distances and the positions of the first speaker, the second speaker, and the first microphone within the first electronic device, thereby eliminating the need for the user to know the location information of the second electronic device, improving the user experience, and reducing operational complexity.
[0026] It is understandable that the first electronic device cannot determine the first distance, the second distance and the third distance, but can determine the sum of the first distance and the second distance, and can also determine the sum of the second distance and the third distance. In other words, the first electronic device can determine the sum of the two distances based on the first time information, the third time information and the positions of the first speaker, the second speaker and the first microphone in the first electronic device, but cannot determine each distance. It can determine the sum of the two distances based on the second time information, the fourth time information and the positions of the first speaker, the second speaker and the first microphone in the first electronic device, but cannot determine each distance.
[0027] In some possible implementations, the time it takes for the first electronic device to process the first ultrasonic signal is: the time it takes for the first electronic device to receive the first ultrasonic signal through the first microphone; the time it takes for the first electronic device to process the second ultrasonic signal is: the time it takes for the first electronic device to receive the second ultrasonic signal through the first microphone.
[0028] In some possible implementations, the first electronic device determines the position information of the second electronic device based on the first time information, the second time information, the third time information and the fourth time information, as well as the positions of the first speaker, the second speaker and the first microphone in the first electronic device, including: the first electronic device determines the sum of the first distance and the second distance based on the first time information, the third time information and the distance between the first speaker and the first microphone; the first distance is the distance between the first speaker and the second electronic device, and the second distance is the distance between the first microphone and the second electronic device; the first electronic device determines the sum of the third distance and the second distance based on the second time information, the fourth time information and the distance between the second speaker and the first microphone; the third distance is the distance between the second speaker and the second electronic device; and determines the position information of the second electronic device based on the sum of the first distance and the second distance, the sum of the third distance and the second distance, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device.
[0029] In the above solution, the first electronic device can determine the sum of the distance from the first speaker to the second electronic device and the distance from the first microphone to the second electronic device based on the first time information, the third time information, and the distance from the first speaker to the first microphone, and determine the sum of the distance from the second speaker to the second electronic device and the distance from the first microphone to the second electronic device based on the second time information, the fourth time information, and the distance from the second speaker to the first microphone. The first electronic device can determine the location information of the second electronic device based on the sum of these two distances and the positions of the first speaker, the second speaker, and the first microphone within the first electronic device, thereby eliminating the need for the user to determine the location information of the second electronic device, improving the user experience, and reducing operational complexity.
[0030] Optionally, the distance between the first speaker and the first microphone may be an absolute value of the distance between the first speaker and the first microphone.
[0031] Optionally, the distance between the second speaker and the second microphone may be an absolute value of the distance between the second speaker and the second microphone.
[0032] It is understandable that the first electronic device cannot determine the first distance, the second distance and the third distance, but can determine the sum of the first distance and the second distance, and can also determine the sum of the second distance and the third distance. In other words, the first electronic device can determine the sum of the two distances based on the first time information, the third time information and the positions of the first speaker, the second speaker and the first microphone in the first electronic device, but cannot determine each distance. It can determine the sum of the two distances based on the second time information, the fourth time information and the positions of the first speaker, the second speaker and the first microphone in the first electronic device, but cannot determine each distance.
[0033] In some possible implementations, the first electronic device obtains the first time information and the second time information, including: the first electronic device receives the first time information and the second time information from the second electronic device.
[0034] In the above solution, the second electronic device may determine the first time information and the second time information, and send the first time information and the second time information to the first electronic device.
[0035] In some possible implementations, the first electronic device obtains the first time information and the second time information, including: the first electronic device receives a first recording file from the second electronic device, the first recording file includes the first ultrasonic signal, the second ultrasonic signal and the third ultrasonic signal; the first electronic device determines the first time information and the second time information based on the first recording file.
[0036] Optionally, the second electronic device may establish a Bluetooth channel with the first electronic device. The first electronic device may send a first instruction to the second electronic device via the established Bluetooth channel. The first instruction is used to instruct the second electronic device to begin recording. The second electronic device may begin recording according to the first instruction. After the second electronic device receives the first and second ultrasonic signals and transmits the third ultrasonic signal, recording ends. The second electronic device may then send the resulting first recording file to the first electronic device. Optionally, the second electronic device may be required to transmit the third ultrasonic signal after receiving the first and second ultrasonic signals, or the first electronic device may be required to transmit the first and second ultrasonic signals after receiving the third ultrasonic signal transmitted by the second electronic device. In other words, the time interval between the second electronic device transmitting the third ultrasonic signal and the first electronic device transmitting the first ultrasonic signal is fixed, or the time interval between the second electronic device transmitting the third ultrasonic signal and the first electronic device transmitting the second ultrasonic signal is fixed. In this way, the first electronic device can determine the time range for transmitting the first and second ultrasonic signals and the time range for receiving the third ultrasonic signal. The first electronic device may instruct the second electronic device to record within this time range. This ensures that the first recording file obtained by the second electronic device includes the first, second, and third ultrasonic signals.
[0037] In some possible implementations, the method further includes: receiving first identification information from the second electronic device, the first identification information corresponding to the third ultrasonic signal; if the device identified by the first identification information is the second electronic device, the first electronic device determines that the third ultrasonic signal is sent by the second electronic device.
[0038] In the above scheme, if the first identification information received by the first electronic device corresponds to the third ultrasonic signal, the first electronic device can determine that the third ultrasonic signal is sent by the second electronic device identified by the first identification information, thereby avoiding the situation where the first electronic device cannot determine which electronic device sent the third ultrasonic signal.
[0039] Optionally, receiving the first identification information from the second electronic device includes: receiving the first identification information and the third ultrasonic signal from the second electronic device via the first microphone. That is, the first electronic device can receive the first identification information and the third ultrasonic signal simultaneously.
[0040] In some possible implementations, before the first electronic device sends the first ultrasonic signal through the first speaker, the method also includes: the first electronic device determines whether the second electronic device and the first electronic device are in the same space; if the second electronic device and the first electronic device are in the same space, the first electronic device sends the first ultrasonic signal through the first speaker, and the first electronic device sends the second ultrasonic signal through the second speaker.
[0041] In the above scheme, if the first electronic device and the second electronic device are in the same space, the first electronic device can determine the location information of the second electronic device, and the first electronic device can send the first ultrasonic signal and the second ultrasonic signal to avoid the second electronic device being unable to receive the first ultrasonic signal and the second ultrasonic signal after the first electronic device sends the first ultrasonic signal and the second ultrasonic signal. For example, the first electronic device is a large screen and the second electronic device is a speaker. If the large screen and the speaker are in the same space, the large screen sends the first ultrasonic signal and the second ultrasonic signal, and the large screen can allocate channels to the speaker according to the determined position of the speaker; if the large screen and the speaker are not in the same space, the large screen may not send the first ultrasonic signal and the second ultrasonic signal.
[0042] In some possible implementations, the method further includes: the first electronic device receives a fourth ultrasonic signal sent by a fourth speaker of a third electronic device through the first microphone; the first electronic device obtains fifth time information and sixth time information, the fifth time information being used to indicate a time difference between a time when the third electronic device receives the first ultrasonic signal and a time when the third electronic device processes the fourth ultrasonic signal, and the sixth time information being used to indicate a time difference between a time when the third electronic device receives the second ultrasonic signal and a time when the third electronic device processes the fourth ultrasonic signal; wherein the time when the third electronic device processes the fourth ultrasonic signal includes: a time when the third electronic device sends the fourth ultrasonic signal through a third speaker or a time when the third microphone of the third electronic device receives the fourth ultrasonic signal; the first electronic device processes the fourth ultrasonic signal based on the fifth time information, the sixth time information, the seventh time information and the eighth time information, and the first speaker The position of the third electronic device is determined by locating the positions of the second speaker, the second speaker and the first microphone in the first electronic device, the position information of the third electronic device is determined, the seventh time information is used to indicate the time difference between the time when the first electronic device receives the fourth ultrasonic signal and the time when the first electronic device processes the first ultrasonic signal, the eighth time information is used to indicate the time difference between the time when the first electronic device receives the fourth ultrasonic signal and the time when the first electronic device transmits the second ultrasonic signal, the time when the first electronic device processes the first ultrasonic signal includes: the time when the first electronic device sends the first ultrasonic signal through the first speaker or the time when the first electronic device receives the first ultrasonic signal through the first microphone; the time when the first electronic device processes the second ultrasonic signal includes: the time when the first electronic device sends the second ultrasonic signal through the second speaker or the time when the first electronic device receives the second ultrasonic signal through the first microphone.
[0043] In the above scheme, the first electronic device can send the first ultrasonic signal and the second ultrasonic signal, the second electronic device and the third electronic device can both receive the first ultrasonic signal and the second ultrasonic signal, the second electronic device can send the fourth ultrasonic signal, and the third electronic device sends the fifth ultrasonic signal. In this way, the first electronic device can determine the position of the second electronic device based on the first time information, the second time information, the third time information and the fourth time information, as well as the positions of the first speaker, the second speaker and the first microphone in the first electronic device, and determine the position information of the third electronic device based on the fifth time information, the sixth time information, the seventh time information and the eighth time information, as well as the positions of the first speaker, the second speaker and the first microphone in the first electronic device. In this way, the first electronic device can simultaneously determine the position information of multiple electronic devices based on the sent first ultrasonic signal and the second ultrasonic signal, thereby improving the efficiency of determining the position information of the electronic devices, especially when there are many electronic devices, which can better improve the efficiency.
[0044] Optionally, the fifth time information is used to indicate the time difference between the time when the second electronic device receives the first ultrasonic signal and the time when the third electronic device processes the fourth ultrasonic signal. If the second electronic device receives the first ultrasonic signal before the third electronic device processes the fourth ultrasonic signal, the time difference between the time when the second electronic device receives the first ultrasonic signal and the time when the third electronic device processes the fourth ultrasonic signal indicated by the fifth time information may be a negative value; if the second electronic device receives the first ultrasonic signal after the third electronic device processes the fourth ultrasonic signal, the time difference between the time when the second electronic device receives the first ultrasonic signal and the time when the third electronic device processes the fourth ultrasonic signal indicated by the fifth time information may be a positive value.
[0045] Optionally, the sixth time information is used to indicate the time difference between the time when the third electronic device receives the second ultrasonic signal and the time when the third electronic device processes the fourth ultrasonic signal. If the third electronic device receives the second ultrasonic signal before the third electronic device processes the fourth ultrasonic signal, the time difference between the time when the third electronic device receives the second ultrasonic signal and the time when the third electronic device processes the fourth ultrasonic signal indicated by the sixth time information may be a negative value; if the third electronic device receives the second ultrasonic signal after the third electronic device processes the fourth ultrasonic signal, the time difference between the time when the third electronic device receives the second ultrasonic signal and the time when the third electronic device processes the fourth ultrasonic signal indicated by the sixth time information may be a positive value.
[0046] Optionally, the seventh time information is used to indicate the time difference between the time when the first electronic device receives the fourth ultrasonic signal and the time when the first electronic device processes the first ultrasonic signal. If the first electronic device receives the fourth ultrasonic signal before the first electronic device processes the first ultrasonic signal, the difference between the time when the first electronic device receives the fourth ultrasonic signal and the time when the first electronic device processes the first ultrasonic signal indicated by the seventh time information is a negative value; if the first electronic device receives the fourth ultrasonic signal after the first electronic device processes the first ultrasonic signal, the difference between the time when the first electronic device receives the fourth ultrasonic signal and the time when the first electronic device processes the first ultrasonic signal is a positive value.
[0047] Optionally, the eighth time information is used to indicate the time difference between the time when the first electronic device receives the fourth ultrasonic signal and the time when the first electronic device processes the second ultrasonic signal. If the first electronic device receives the fourth ultrasonic signal before the first electronic device processes the second ultrasonic signal, the eighth time information is used to indicate the time difference between the time when the first electronic device receives the fourth ultrasonic signal and the time when the first electronic device processes the second ultrasonic signal. A negative value is used; if the first electronic device receives the fourth ultrasonic signal after the first electronic device processes the second ultrasonic signal, the eighth time information is used to indicate the time difference between the time when the first electronic device receives the fourth ultrasonic signal and the time when the first electronic device processes the second ultrasonic signal. A positive value is used.
[0048] In some possible implementations, the time it takes for the first electronic device to process the first ultrasonic signal is: the time it takes for the first electronic device to send the first ultrasonic signal through the first speaker; the time it takes for the first electronic device to process the second ultrasonic signal is: the time it takes for the first electronic device to send the second ultrasonic signal through the second speaker.
[0049] In some possible implementations, the first electronic device determines the location information of the third electronic device based on the fifth time information, the sixth time information, the seventh time information and the eighth time information, as well as the locations of the first speaker, the second speaker and the first microphone in the first electronic device, including: the first electronic device determines the sum of the fourth distance and the fifth distance based on the fifth time information and the seventh time information; the fourth distance is the distance between the first speaker and the third electronic device, and the fifth distance is the distance between the first microphone and the third electronic device; the first electronic device determines the sum of the sixth distance and the fifth distance based on the sixth time information and the eighth time information; the sixth distance is the distance between the second speaker and the third electronic device; the first electronic device determines the location information of the third electronic device based on the sum of the fourth distance and the fifth distance, the sum of the sixth distance and the fifth distance, and the locations of the first speaker, the second speaker and the first microphone in the first electronic device.
[0050] In the above solution, the first electronic device can determine the sum of the distance from the first speaker to the third electronic device and the distance from the first microphone to the third electronic device based on the fifth time information, the seventh time information, and the distance from the first speaker to the first microphone, and determine the sum of the distance from the second speaker to the third electronic device and the distance from the first microphone to the third electronic device based on the sixth time information, the eighth time information, and the distance from the second speaker to the first microphone. The first electronic device can determine the location information of the third electronic device based on the sum of these two distances and the positions of the first speaker, the second speaker, and the first microphone within the first electronic device, thereby avoiding the need for the user to know the location information of the third electronic device, improving the user experience, and reducing operational complexity.
[0051] It is understandable that the first electronic device cannot determine the fourth distance, the fifth distance, and the sixth distance, but can determine the sum of the fourth distance and the fifth distance, and can also determine the sum of the fifth distance and the sixth distance. In other words, the first electronic device can determine the sum of the two distances based on the fifth time information, the seventh time information, and the positions of the first speaker, the second speaker, and the first microphone in the first electronic device, but cannot determine each distance. It can determine the sum of the two distances based on the sixth time information, the eighth time information, and the positions of the first speaker, the second speaker, and the first microphone in the first electronic device, but cannot determine each distance.
[0052] In some possible implementations, the time it takes for the first electronic device to process the first ultrasonic signal is: the time it takes for the first electronic device to receive the first ultrasonic signal through the first microphone; the time it takes for the first electronic device to process the second ultrasonic signal is: the time it takes for the first electronic device to receive the second ultrasonic signal through the first microphone.
[0053] In some possible implementations, the first electronic device determines the location information of the third electronic device based on the fifth time information, the sixth time information, the seventh time information, and the eighth time information, as well as the locations of the first speaker, the second speaker, and the first microphone in the first electronic device, including: the first electronic device determines the sum of a fourth distance and a fifth distance based on the fifth time information, the seventh time information, and the distance between the first speaker and the first microphone; the fourth distance is the distance between the first speaker and the third electronic device, and the fifth distance is the distance between the first microphone and the third electronic device; the first electronic device determines the sum of a sixth distance and the fifth distance based on the sixth time information, the eighth time information, and the distance between the second speaker and the first microphone; the sixth distance is the distance between the second speaker and the third electronic device; and determines the location information of the third electronic device based on the sum of the fourth distance and the fifth distance, the sum of the sixth distance and the fifth distance, and the locations of the first speaker, the second speaker, and the first microphone in the first electronic device.
[0054] In the above solution, the first electronic device can determine the sum of the distance from the first speaker to the third electronic device and the distance from the first microphone to the third electronic device based on the fifth time information, the seventh time information, and the distance from the first speaker to the first microphone, and determine the sum of the distance from the second speaker to the third electronic device and the distance from the first microphone to the third electronic device based on the sixth time information, the eighth time information, and the distance from the second speaker to the first microphone. The first electronic device can determine the location information of the third electronic device based on the sum of these two distances and the positions of the first speaker, the second speaker, and the first microphone within the first electronic device, thereby eliminating the need for the user to determine the location information of the third electronic device, improving the user experience, and reducing operational complexity.
[0055] It is understandable that the first electronic device cannot determine the fourth distance, the fifth distance and the sixth distance, but can determine the sum of the fourth distance and the fifth distance, and can also determine the sum of the fifth distance and the sixth distance. In other words, the first electronic device can determine the sum of the two distances based on the fifth time information, the seventh time information, the distance from the first speaker to the first microphone, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device, but cannot determine each distance. It can determine the sum of the two distances based on the sixth time information, the eighth time information, the distance from the second speaker to the first microphone, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device, but cannot determine each distance.
[0056] Optionally, the distance between the first speaker and the first microphone may be an absolute value of the distance between the first speaker and the first microphone.
[0057] Optionally, the distance between the second speaker and the first microphone may be an absolute value of the distance between the second speaker and the second microphone.
[0058] In some possible implementations, the first electronic device obtains the fifth time information and the sixth time information, including: the first electronic device receives the fifth time information and the sixth time information from a third electronic device.
[0059] In the above solution, the third electronic device may determine the fifth time information and the sixth time information, and send the fifth time information and the sixth time information to the first electronic device.
[0060] In some possible implementations, the first electronic device obtains the fifth time information and the sixth time information, including: the first electronic device receives a second recording file from the third electronic device, the second recording file includes the first ultrasonic signal, the second ultrasonic signal and the fourth ultrasonic signal; the first electronic device determines the fifth time information and the sixth time information based on the second recording file.
[0061] Optionally, the third electronic device may establish a Bluetooth channel with the first electronic device. The first electronic device may send a second instruction to the third electronic device via the established Bluetooth channel. The second instruction is used to instruct the third electronic device to begin recording. The third electronic device may begin recording according to the second instruction. After receiving the first and second ultrasonic signals and transmitting the fourth ultrasonic signal, the third electronic device ends recording. The third electronic device may then send the resulting first recording file to the first electronic device. Optionally, the third electronic device may be required to transmit the fourth ultrasonic signal after receiving the first and second ultrasonic signals, or the first electronic device may be required to transmit the first and second ultrasonic signals after receiving the fourth ultrasonic signal transmitted by the third electronic device. In other words, the time interval between the time the third electronic device transmits the fourth ultrasonic signal and the time the first electronic device transmits the first ultrasonic signal is fixed, or the time interval between the time the third electronic device transmits the fourth ultrasonic signal and the time the first electronic device transmits the second ultrasonic signal is fixed. In this way, the first electronic device can determine the time range for transmitting the first and second ultrasonic signals and the time range for receiving the fourth ultrasonic signal. The first electronic device may instruct the third electronic device to record within this time range. This ensures that the second recording file obtained by the third electronic device includes the first, second, and fourth ultrasonic signals.
[0062] In some possible implementations, the method further includes: receiving second identification information from the third electronic device, the second identification information corresponding to the fourth ultrasonic signal; if the device identified by the second identification information is the third electronic device, the first electronic device determines that the fourth ultrasonic signal is sent by the third electronic device.
[0063] In the above scheme, if the third electronic device identification information received by the first electronic device corresponds to the fourth ultrasonic signal, the first electronic device can determine that the fourth ultrasonic signal is sent by the third electronic device identified by the second identification information, thereby avoiding the situation where the first electronic device cannot determine which electronic device sent the fourth ultrasonic signal.
[0064] Optionally, receiving the second identification information from the third electronic device includes: receiving the second identification information and the fourth ultrasonic signal from the third electronic device via the first microphone. That is, the first electronic device can receive the second identification information and the fourth ultrasonic signal simultaneously.
[0065] In some possible implementations, before the first electronic device sends the first ultrasonic signal through the first speaker, the method also includes: the first electronic device determines whether the third electronic device and the first electronic device are in the same space; if the third electronic device and the first electronic device are in the same space, the first electronic device sends the first ultrasonic signal through the first speaker.
[0066] In the above scheme, if the first electronic device and the third electronic device are in the same space, the first electronic device can determine the location information of the third electronic device, and the first electronic device can send the first ultrasonic signal and the second ultrasonic signal to avoid the third electronic device being unable to receive the first ultrasonic signal and the second ultrasonic signal after the first electronic device sends the first ultrasonic signal and the second ultrasonic signal. For example, the first electronic device is a large screen and the third electronic device is a speaker. If the large screen and the speaker are in the same space, the large screen sends the first ultrasonic signal and the second ultrasonic signal, and the large screen can allocate channels to the speaker according to the determined position of the speaker; if the large screen and the speaker are not in the same space, the large screen may not send the first ultrasonic signal and the second ultrasonic signal.
[0067] In some possible implementations, the method further includes: the first electronic device allocating a channel to the third electronic device according to the location information of the third electronic device; or, the first electronic device displaying the location information of the third electronic device.
[0068] In some possible implementations, the method further includes: the first electronic device allocating a channel to the second electronic device according to the location information of the second electronic device; or, the first electronic device displaying the location information of the second electronic device.
[0069] In a second aspect, a method for determining position information is provided, wherein a second electronic device receives a first ultrasonic signal from a first electronic device; the second electronic device receives a second ultrasonic signal from the first electronic device; the second electronic device sends a third ultrasonic signal through a third speaker; the second electronic device sends first time information and second time information to the first electronic device, the first time information being used to indicate the time difference between the time when the second electronic device receives the first ultrasonic signal and the time when the second electronic device processes the third ultrasonic signal, and the second time information being used to indicate the time difference between the time when the second electronic device receives the second ultrasonic signal and the time when the second electronic device processes the third ultrasonic signal; wherein the time when the second electronic device processes the third ultrasonic signal includes: the time when the second electronic device sends the third ultrasonic signal through the third speaker or the time when the second electronic device receives the third ultrasonic signal through the second microphone, and the first time information and the second time information are used to determine the position information of the second electronic device.
[0070] In the above scheme, after the second electronic device receives the first ultrasonic signal and the second ultrasonic signal, it can send a third ultrasonic signal, and can determine the first time information and the second time information, and send the first time information and the second time information to the first electronic device, avoiding the need for the first electronic device to determine the first time information and the second time information.
[0071] Optionally, the second electronic device may send the third ultrasonic signal after receiving the first ultrasonic signal and the second ultrasonic signal, or may receive the first ultrasonic signal and the second ultrasonic signal after sending the third ultrasonic signal.
[0072] In some possible implementations, the second electronic device receiving the first ultrasonic signal from the first electronic device includes: the second electronic device receiving the first ultrasonic signal from the first electronic device through a fourth microphone; the second electronic device receiving the second ultrasonic signal from the first electronic device includes: the second electronic device receiving the second ultrasonic signal from the first electronic device through a fifth microphone;
[0073] The third speaker is a speaker in the second electronic device corresponding to the fourth microphone and the fifth microphone.
[0074] Optionally, the third speaker may be a speaker corresponding to the fourth microphone receiving the first ultrasonic signal and / or the fifth microphone receiving the second ultrasonic signal, including: the third speaker is a speaker closer to the fourth microphone and / or the fifth microphone, or including: if the fourth microphone receives the first ultrasonic signal earlier than the fifth microphone receives the second ultrasonic signal, then the third speaker may be a speaker closer to the fourth microphone, or if the fifth microphone receives the second ultrasonic signal earlier than the fourth microphone receives the first ultrasonic signal, then the third speaker may be a speaker closer to the fifth microphone. Optionally, the fourth microphone and the fifth microphone may be the same microphone or different microphones.
[0075] In a third aspect, embodiments of the present application provide a device for determining location information, which has the function of implementing any one of the above-mentioned first aspect or any one of the above-mentioned second aspect. The function can be implemented by hardware, or by hardware executing corresponding software implementation. The hardware or software includes one or more modules or units corresponding to the above-mentioned functions. For example, a transceiver module or unit, a processing module or unit, an acquisition module or unit, etc.
[0076] In a fourth aspect, an embodiment of the present application provides an electronic device comprising: a memory and a processor, the memory being used to store a computer program; the processor being used to enable the electronic device to execute any one of the methods in the first aspect or any one of the methods in the second aspect when calling the computer program.
[0077] In a fifth aspect, an embodiment of the present application provides a chip system, which includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement any method in the first aspect or any method in the second aspect.
[0078] The chip system may be a single chip or a chip module composed of multiple chips.
[0079] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any one of the first aspect or the method described in any one of the second aspect.
[0080] In a seventh aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes any one of the methods in the first aspect or any one of the methods in the second aspect.
[0081] It can be understood that the beneficial effects of the third to seventh aspects mentioned above can be found in the relevant descriptions in the first or second aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] FIG1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
[0083] FIG2 is a schematic diagram of a scene between a speaker and a large screen provided in an embodiment of the present application.
[0084] FIG3 is a schematic diagram of a scene between another speaker and a large screen provided in an embodiment of the present application.
[0085] FIG4 is a method for allocating channels with user participation in configuration provided in an embodiment of the present application.
[0086] FIG5 is a schematic diagram of a user setting interface provided in an embodiment of the present application.
[0087] FIG6 is a schematic diagram of a method for determining location information provided in an embodiment of the present application.
[0088] FIG7 is a schematic diagram of another method for determining location information provided in an embodiment of the present application.
[0089] FIG8 is a schematic diagram of another method for determining location information provided in an embodiment of the present application.
[0090] FIG9 is a schematic diagram of another method for determining location information provided in an embodiment of the present application.
[0091] FIG10 is a schematic diagram of another method for determining location information provided in an embodiment of the present application.
[0092] FIG11 is a schematic diagram of another method for determining location information provided in an embodiment of the present application.
[0093] FIG12 is a schematic diagram of another method for determining location information provided in an embodiment of the present application.
[0094] FIG13 is a schematic diagram of another method for determining location information provided in an embodiment of the present application. DETAILED DESCRIPTION
[0095] The following is a clear and detailed description of the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship between related objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0096] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.
[0097] 1 is a schematic diagram of the structure of an electronic device 100 according to an embodiment of the present application. The electronic device 100 may include a processor 110, a memory 120, a communication module 130, a display 140, and peripheral devices 150, wherein the peripheral devices 150 include speakers 151, 152, and a microphone 153.
[0098] The processor 110 may include one or more processing units, and the memory 120 is used to store program codes and data. In the embodiment of the present application, the processor 110 may execute computer-executable instructions stored in the memory 120 to control and manage the actions of the electronic device 100.
[0099] The communication module 130 can be used for communication between various internal modules of the electronic device 100, or communication between the electronic device 100 and other external electronic devices. For example, if the electronic device 100 communicates with other electronic devices via a wired connection, the communication module 130 may include an interface, such as a USB interface. The USB interface may be an interface that complies with USB standard specifications, specifically a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices.
[0100] Alternatively, the communication module 130 may include an audio device, a radio frequency circuit, a Bluetooth chip, a wireless fidelity (Wi-Fi) chip, a near-field communication (NFC) module, etc., and can realize the interaction between the electronic device 100 and other electronic devices in a variety of different ways.
[0101] The display screen 140 can display images or videos in a human-computer interaction interface.
[0102] Optionally, the peripheral device 150 may include a speaker 151, a speaker 152, and a microphone 153. The speaker 151 and the speaker 152, also known as "speakers", are used to convert audio electrical signals into sound signals. For example, the electronic device 100 can listen to music or listen to hands-free calls through the speaker 151 and the speaker 152. In some embodiments, the speaker 151 and the speaker 152 are used to send ultrasonic signals, for example, the speaker 151 can send a first ultrasonic signal, and the speaker 152 can send a second ultrasonic signal. Optionally, the distance between the speaker 151 and the speaker 152 is greater than a preset distance, for example, the preset distance is 10 cm or 8 cm. Optionally, the speaker 151 can be the first speaker in the embodiment of the present application, and the speaker 152 can be the second speaker in the embodiment of the present application. In some embodiments, the electronic device 100 may include multiple speakers.
[0103] The microphone 153, also known as a "microphone" or "microphone", is used to convert sound signals into electrical signals. For example, when making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 153 to input the sound signal into the microphone 153. The electronic device 100 can be provided with at least one microphone. In other embodiments, the electronic device 100 can be provided with two microphones, which can not only collect sound signals but also realize noise reduction. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones to realize sound signal collection, noise reduction, sound source identification, directional recording function, etc. Optionally, the distance between the two microphones of the electronic device 100 is greater than a preset distance, for example, the preset distance is 2 cm, 4 cm, 6 cm or 8 cm or 10 cm. In some embodiments, the microphone 153 of the electronic device 100 can receive an ultrasonic signal sent by another electronic device. For example, when the electronic device 100 is a first electronic device, the microphone 153 can receive a third ultrasonic signal sent by the second electronic device, or the microphone 153 can receive a fourth ultrasonic signal sent by the third electronic device.
[0104] For example, the electronic device 100 may be a television, a computer, or a projector.
[0105] Optionally, the peripheral device 150 may also include a mouse, a keyboard, or a receiver, etc., which is not limited in the embodiment of the present application.
[0106] It should be understood that, other than the various components or modules listed in FIG1 , the embodiments of the present application do not specifically limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or combine or separate certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0107] In some scenarios, multiple electronic devices can collaborate to perform certain functions. During this collaboration, users need to know the location of each electronic device and manually set the role of each electronic device based on their location. Different roles can be used to perform certain functions, which places high demands on users and is complex to operate.
[0108] For example, when multiple electronic devices in a user's home are networked, the main electronic device needs to know the location of each electronic device so that the network can be better established.
[0109] For another example, the electronic device 100 of FIG1 may be a large screen, which can play different audio signals through multiple speakers to achieve a stereo effect. For example, the large screen may be a television, a computer, or a projector. After the user has placed the multiple speakers, they can use the display interface of the large screen to set the corresponding channel for each speaker based on the position of the multiple speakers relative to the large screen. The multiple speakers play different audio signals from the large screen, thereby achieving a stereo effect. However, this process requires the user to roughly know the position of the multiple speakers and manually set them. This requires the user to have certain knowledge of channel allocation, which is complicated and provides a poor user experience. As shown in FIG2 , the user needs to use the display interface of the large screen to assign the left channel to the left speaker and the right channel to the right speaker. Specifically, the display interface of the large screen may display the identifier of the left speaker. The user assigns the left channel to the left speaker based on the identifier of the left speaker. The display interface of the large screen may display the identifier of the right speaker. The user assigns the right channel to the right speaker based on the identifier of the right speaker.
[0110] The following describes in detail how the user sets the audio channel.
[0111] As shown in Figure 3, there are four speakers around the large screen, namely Speaker 1, Speaker 2, Speaker 3 and Speaker 4. After the user manually places the four speakers. As shown in Figure 4, Speaker 1 is powered on and Speaker 1 broadcasts a Bluetooth signal. After the large screen searches for the Bluetooth signal broadcast by Speaker 1, the searched Speaker 1 is displayed on the display interface of the large screen. The user clicks the operation to establish a connection. In response to the user's operation, the large screen establishes a Bluetooth connection with Speaker 1. The user sets the left channel for Speaker 1 on the display interface of the large screen according to the position of Speaker 1. The large screen receives the user's instruction to set Speaker 1 to the left channel. For example, as shown in Figure 5, the user uses the remote control to select the left channel to complete the channel setting of Speaker 1. The large screen sends an audio signal to Speaker 1 through the established Bluetooth connection according to the left channel set by the user for Speaker 1. Speaker 2 is powered on and Speaker 2 broadcasts a Bluetooth signal. After the large screen detects the Bluetooth signal broadcast by speaker 2, the searched speaker 2 is displayed on the large screen's display interface. The user clicks the "establish connection" button. In response to the user's operation, the large screen establishes a Bluetooth connection with speaker 2. The user sets the left surround for speaker 2 on the large screen's display interface based on the location of speaker 2. The large screen receives the user's instruction to set speaker 2 to the left surround setting. For example, the user uses the remote control to select the left surround setting as shown in Figure 5 to complete the channel setting for speaker 2. The large screen transmits the audio signal to speaker 2 via the established Bluetooth connection based on the left surround setting set by the user. Speaker 3 is powered on and broadcasts a Bluetooth signal. After the large screen detects the Bluetooth signal broadcast by speaker 3, the searched speaker 3 is displayed on the large screen's display interface. The user clicks the "establish connection" button. In response to the user's operation, the large screen establishes a Bluetooth connection with speaker 3. The user sets the right channel for speaker 3 on the large screen's display interface based on the location of speaker 3. The large screen receives the user's instruction to set speaker 3 to the right channel. For example, a user uses the remote control to select the right channel shown in Figure 6 to set the channel for speaker 3. The large screen sends an audio signal to speaker 3 based on the right channel set by the user. Speaker 4 powers on and broadcasts a Bluetooth signal. After the large screen detects the Bluetooth signal broadcast by speaker 4, it displays the searched speaker 4 on its display interface. The user clicks to establish a connection. In response to the user's operation, the large screen establishes a Bluetooth connection with speaker 4. The user sets the right surround for speaker 4 based on the position of speaker 4 on the large screen's display interface. The large screen receives the user's instruction to set speaker 4 to right surround. For example, a user uses the remote control to select the right surround as shown in Figure 6 to set the channel for speaker 4. The large screen sends a speaker signal to speaker 4 based on the right surround set by the user via the established Bluetooth connection. This means that the user must turn on each speaker one by one and set the channel for each speaker based on its relative position to the large screen. This is complex and creates a poor user experience. This is especially true when there are multiple speakers, as the user needs to perform multiple operations, resulting in a poor user experience.Alternatively, in some embodiments, four speakers can be powered on at the same time, and the user can assign channels to the four speakers separately on the display interface of the large screen. However, in such a scenario, the identification of the four speakers needs to be displayed simultaneously on the display interface of the large screen, and the user needs to know the identification of the speakers in different positions, and then the user needs to set the channels of each speaker according to the position of each speaker. In other words, this places high demands on the user, and the user needs to know the identification of different speakers in different positions, so as to set different channels for speakers in different positions, and the user also needs to set it multiple times, which results in a poor user experience.
[0112] It should be noted that the electronic device 100 in Figure 1 may be the first electronic device in the embodiment of the present application, or the electronic device 100 in Figure 1 may be the second electronic device in the embodiment of the present application, or the electronic device 100 in Figure 1 may be the third electronic device in the embodiment of the present application.
[0113] In an embodiment of the present application, the first electronic device can send a first ultrasonic signal and a second ultrasonic signal through a first speaker and a second speaker respectively, and the second electronic device can also send a third ultrasonic signal. The first electronic device can use the first time information, the second time information, the third time information and the fourth time information, as well as the positions of the first speaker, the second speaker and the first microphone in the first electronic device to determine the position information of the second electronic device, the first time information is used to indicate the time difference between the time when the second electronic device receives the first ultrasonic signal and the time when the second electronic device processes the third ultrasonic signal, the second time information is used to indicate the time difference between the time when the second electronic device receives the second ultrasonic signal and the time when the second electronic device processes the third ultrasonic signal, the third time information is used to indicate the time difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first electronic device processes the first ultrasonic signal, and the fourth time information is used to indicate the time difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first electronic device processes the second ultrasonic signal. This avoids the user needing to know the position information of the second electronic device, can improve user experience, and reduce the complexity of operation. For example, in a scenario where a large screen can play different audio signals through multiple speakers to achieve a stereo effect, the first electronic device can be the large screen, and the second electronic device can be the speakers. The large screen can determine the positions of the speakers based on the first time information, the second time information, the third time information, and the fourth time information, as well as the positions of the first speaker, the second speaker, and the first microphone in the large screen. The large screen can assign channels to the speakers based on the positions of the speakers, avoiding the need for users to know the positions of each speaker and manually assign channels based on the positions of each speaker, thereby improving user experience and reducing complexity.
[0114] The following describes a method 600 for determining location information in an embodiment of the present application with reference to FIG6 . As shown in FIG6 , the method 600 includes:
[0115] S610: The first electronic device sends a first ultrasonic signal through a first speaker, and the second electronic device receives the first ultrasonic signal.
[0116] Optionally, the first electronic device may record the first moment when the first ultrasonic signal is sent through the first speaker.
[0117] Optionally, after the first electronic device sends the first ultrasonic signal through the first speaker, the first electronic device can receive the first ultrasonic signal sent by the first electronic device through the first speaker through the first microphone, and the first electronic device can record the second moment when the first ultrasonic signal is received through the first microphone.
[0118] Optionally, the first electronic device may be a large screen, and the second electronic device may be a speaker.
[0119] Optionally, the second electronic device may record a third time instant of receiving the first ultrasonic signal. Optionally, the second electronic device may receive the first ultrasonic signal via a fourth microphone, and the second electronic device may record the third time instant of receiving the first ultrasonic signal via the fourth microphone.
[0120] S620: The first electronic device sends a second ultrasonic signal through the second speaker, and the second electronic device receives the second ultrasonic signal.
[0121] Optionally, the first electronic device may record a fourth moment when the second ultrasonic signal is sent through the second speaker.
[0122] Optionally, after the first electronic device sends the second ultrasonic signal through the second speaker, the first electronic device can receive the second ultrasonic signal sent by the first electronic device through the second speaker through the first microphone, and the first electronic device can record the fifth moment when the second ultrasonic signal is received through the first microphone.
[0123] Optionally, the second electronic device may record a sixth moment of receiving the second ultrasonic signal. Optionally, the second electronic device may receive the second ultrasonic signal through a fifth microphone, and the second electronic device may record a sixth moment of receiving the second ultrasonic signal through the fifth microphone.
[0124] Optionally, before S610 and S620, the first electronic device may pre-configure the first ultrasonic signal and the second ultrasonic signal to be sent by the first electronic device to the second electronic device, so that the second electronic device can know that the first electronic device will send the first ultrasonic signal and the second ultrasonic signal. In other words, the first ultrasonic signal and the second ultrasonic signal used to determine the location information of the second electronic device may be pre-configured by the first electronic device to the second electronic device. For example, before S610 and S620, the first electronic device and the second electronic device may establish a Bluetooth channel, and the first electronic device may configure the first ultrasonic signal and the second ultrasonic signal to be sent by the first electronic device to the second electronic device through the established Bluetooth channel.
[0125] Optionally, S610 may be performed before or after S620, and the first ultrasonic signal and the second ultrasonic signal may be the same or different.
[0126] Optionally, S610 and S620 may be executed simultaneously, in which case the first ultrasonic signal and the second ultrasonic signal may be different, for example, the first electronic device sends the first ultrasonic signal and the second ultrasonic signal at different frequencies, or the first ultrasonic signal and the second ultrasonic signal are orthogonal signals.
[0127] S630: The second electronic device sends a third ultrasonic signal through the third speaker, and the first electronic device receives the third ultrasonic signal through the first microphone.
[0128] Optionally, the second electronic device may transmit a third ultrasonic signal via a third speaker, and the second microphone of the second electronic device may receive the third ultrasonic signal. Optionally, after the second electronic device transmits the third ultrasonic signal via the third speaker, the seventh moment at which the second electronic device transmits the third ultrasonic signal may be recorded. After the second microphone of the second electronic device receives the third ultrasonic signal, the eighth moment at which the second microphone of the second electronic device receives the third ultrasonic signal may be recorded.
[0129] Optionally, the third speaker may be a speaker corresponding to the fourth microphone receiving the first ultrasonic signal and / or the fifth microphone receiving the second ultrasonic signal. Optionally, the third speaker may be a speaker corresponding to the fourth microphone receiving the first ultrasonic signal and / or the fifth microphone receiving the second ultrasonic signal, including: the third speaker is a speaker closer to the fourth microphone and / or the fifth microphone, or including: if the fourth microphone receives the first ultrasonic signal earlier than the fifth microphone receives the second ultrasonic signal, the third speaker may be a speaker closer to the fourth microphone, or if the fifth microphone receives the second ultrasonic signal earlier than the fourth microphone receives the first ultrasonic signal, the third speaker may be a speaker closer to the fifth microphone. Optionally, the fourth microphone and the fifth microphone may be the same microphone or different microphones.
[0130] Optionally, after the second electronic device sends the third ultrasonic signal, the seventh moment when the second electronic device sends the third ultrasonic signal can be recorded. After the first electronic device receives the third ultrasonic signal, the ninth moment when the first electronic device receives the third ultrasonic signal can be recorded.
[0131] Optionally, before S630, the first electronic device may pre-configure the second electronic device to transmit a third ultrasonic signal to the second electronic device. That is, the third ultrasonic signal used to determine the location information of the second electronic device may be pre-configured by the first electronic device to the second electronic device. For example, before S630, the first electronic device and the second electronic device may establish a Bluetooth channel, and the first electronic device may configure the second electronic device to transmit the third ultrasonic signal to the first electronic device via the established Bluetooth channel.
[0132] Optionally, the second electronic device may send a third ultrasonic signal and the first identification information, and the first electronic device may receive the first identification information and the third ultrasonic signal through the first microphone. If the device identified by the first identification information is the second electronic device, the first electronic device may determine that the third ultrasonic signal was sent by the second electronic device. Optionally, the second electronic device may send a third ultrasonic signal and the first identification information, and the first electronic device may receive the first identification information and the third ultrasonic signal through the first microphone, including: the second electronic device may send the third ultrasonic signal and the first identification information through the third speaker at the seventh moment, and the first electronic device may receive the first identification information and the third ultrasonic signal through the first microphone at the ninth moment.
[0133] Optionally, S610 and S620 may be before or after S630, or S630 may be between S610 and S620, which is not limited in this embodiment of the present application.
[0134] S640: The first electronic device obtains first time information and second time information.
[0135] Among them, the first time information is used to indicate the time difference between the time when the second electronic device receives the first ultrasonic signal and the time when the second electronic device processes the third ultrasonic signal, and the second time information is used to indicate the time difference between the time when the second electronic device receives the second ultrasonic signal and the time when the second electronic device processes the third ultrasonic signal.
[0136] The time for the second electronic device to process the third ultrasonic signal is described below in two cases.
[0137] In case one, optionally, the time when the second electronic device processes the third ultrasonic signal may be the time when the second electronic device sends the third ultrasonic signal. Optionally, for example, if the time when the second electronic device receives the first ultrasonic signal is the third moment, and the time when the second electronic device sends the third ultrasonic signal is the seventh moment, then the first time information is used to indicate the time difference between the third moment and the seventh moment. For example, if the second electronic device receives the first ultrasonic signal before the second electronic device sends the third ultrasonic signal, then the time difference between the third moment and the seventh moment indicated by the first time information is a negative value; for another example, if the second electronic device receives the first ultrasonic signal after the second electronic device sends the third ultrasonic signal, then the time difference between the third moment and the seventh moment indicated by the first time information is a positive value. Optionally, the second time information is used to indicate the time when the second electronic device receives the second ultrasonic signal and the time when the second electronic device sends the third ultrasonic signal. For example, the time when the second electronic device receives the second ultrasonic signal is the sixth moment, and the time when the second electronic device sends the third ultrasonic signal is the seventh moment, then the second time information is used to indicate the time difference between the sixth moment and the seventh moment. For example, if the second electronic device receives the second ultrasonic signal before the second electronic device sends the third ultrasonic signal, then the time difference between the sixth moment and the seventh moment indicated by the first time information is a negative value. For another example, if the second electronic device receives the second ultrasonic signal after the second electronic device sends the third ultrasonic signal, then the time difference between the sixth moment and the seventh moment indicated by the second time information is a positive value.
[0138] In case 2, optionally, the time when the second electronic device processes the third ultrasonic signal may be the time when the second electronic device receives the third ultrasonic signal sent by the second electronic device through the third speaker via the second microphone, for example, it may be the eighth moment. Optionally, the first time information is used to indicate the time difference between the time when the second electronic device receives the first ultrasonic signal and the time when the second electronic device receives the third ultrasonic signal sent by the second electronic device through the third speaker via the second microphone. For example, if the time when the second electronic device receives the first ultrasonic signal is the third moment and the time when the second electronic device receives the third ultrasonic signal sent by the second electronic device through the third speaker via the second microphone is the eighth moment, then the first time information is used to indicate the time difference between the third moment and the eighth moment. For example, if the second electronic device receives the first ultrasonic signal before the second electronic device receives the third ultrasonic signal sent by the second electronic device through the third speaker via the second microphone, then the time difference between the third moment and the eighth moment indicated by the first time information is a negative value. For another example, if the second electronic device receives the first ultrasonic signal after the second electronic device receives the third ultrasonic signal sent by the second electronic device through the third speaker via the second microphone, then the time difference between the third moment and the eighth moment indicated by the first time information is a positive value. Optionally, the second time information is used to indicate the time when the second electronic device receives the second ultrasonic signal and the time when the second electronic device receives the third ultrasonic signal sent by the second electronic device through the third speaker through the second microphone. For example, the time when the second electronic device receives the second ultrasonic signal is the sixth moment, and the time when the second electronic device receives the third ultrasonic signal sent by the second electronic device through the third speaker through the second microphone is the eighth moment. The second time information is used to indicate the time difference between the sixth moment and the eighth moment. For example, if the second electronic device receives the second ultrasonic signal before the second electronic device receives the third ultrasonic signal sent by the second electronic device through the third speaker through the second microphone, the time difference between the sixth moment and the eighth moment indicated by the second time information is a negative value. For another example, if the second electronic device receives the second ultrasonic signal after the second electronic device receives the third ultrasonic signal sent by the second electronic device through the third speaker through the second microphone, the time difference between the sixth moment and the eighth moment indicated by the second time information is a positive value.
[0139] Optionally, S640 includes: the second electronic device determines the first time information and the second time information, and the second electronic device sends the first time information and the second time information to the first electronic device, and the first electronic device receives the first time information and the second time information from the second electronic device.
[0140] Optionally, S640 includes: the second electronic device may send a first recording file to the first electronic device, the first recording file including a first ultrasonic signal, a second ultrasonic signal, and a third ultrasonic signal, and the first electronic device may determine the first time information and the second time information based on the first recording file. Optionally, before S610, the second electronic device may establish a Bluetooth channel with the first electronic device, and the first electronic device may send a first instruction to the second electronic device through the established Bluetooth channel, the first instruction being used to instruct the second electronic device to start recording, the second electronic device may start recording according to the first instruction, the second electronic device may end recording after receiving the first ultrasonic signal and the second ultrasonic signal and sending the third ultrasonic signal, and the second electronic device may send the obtained recording file to the first electronic device. Optionally, it can be stipulated that the second electronic device sends the third ultrasonic signal after receiving the first ultrasonic signal and the second ultrasonic signal, or it can be stipulated that the first electronic device can send the first ultrasonic signal and the second ultrasonic signal after receiving the third ultrasonic signal sent by the second electronic device. That is, the time interval between the time when the second electronic device sends the third ultrasonic signal and the time when the first electronic device sends the first ultrasonic signal is fixed, or the time interval between the time when the second electronic device sends the third ultrasonic signal and the time when the first electronic device sends the second ultrasonic signal is fixed. In this way, the first electronic device can determine the time for sending the first ultrasonic signal and the second ultrasonic signal and the time range for receiving the third ultrasonic signal. The first electronic device can instruct the second electronic device to record within the time range, so as to ensure that the first recording file obtained by the second electronic device includes the first ultrasonic signal, the second ultrasonic signal and the third ultrasonic signal.
[0141] Optionally, the first electronic device may know before S630 that the second electronic device sends a third ultrasonic signal, and the first electronic device may determine the first time information and the second time information based on the first recording file, including: the first electronic device may determine the difference between the time when the second electronic device receives the first ultrasonic signal in the first recording file and the time when the second electronic device receives the third ultrasonic signal sent by the third speaker of the second electronic device through the second microphone based on the pre-known third ultrasonic signal and the sent first ultrasonic signal, and the first time information is used to indicate the difference between the time when the second electronic device receives the first ultrasonic signal and the time when the second electronic device receives the third ultrasonic signal sent by the third speaker of the second electronic device through the second microphone; the first electronic device may determine the difference between the time when the second electronic device receives the second ultrasonic signal in the first recording file and the time when the second electronic device receives the third ultrasonic signal sent by the third speaker of the second electronic device through the second microphone based on the pre-known third ultrasonic signal and the sent second ultrasonic signal, and the second time information is used to indicate the difference between the time when the second electronic device receives the second ultrasonic signal and the time when the second electronic device receives the third ultrasonic signal sent by the third speaker of the second electronic device through the second microphone.
[0142] S650: The first electronic device determines location information of the second electronic device according to the first time information, the second time information, the third time information, and the fourth time information, and locations of the first speaker, the second speaker, and the first microphone in the first electronic device.
[0143] Optionally, S650 may include: the first electronic device determining the location information of the second electronic device based on the first time information, the second time information, the third time information, the fourth time information, the positions of the first speaker, the second speaker, and the first microphone in the first electronic device, and the positions of the components of the second electronic device in the second electronic device. Optionally, the components of the second electronic device may include at least one of a second microphone, a fourth microphone, a fifth microphone, or a third speaker. That is, in determining the location of the second electronic device, the first electronic device may determine the location of the second electronic device based not only on the positions of the components of the first electronic device in the first electronic device, but also on the positions of the components of the second electronic device in the second electronic device.
[0144] Among them, the third time information is used to indicate the time difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first electronic device processes the first ultrasonic signal, and the fourth time information is used to indicate the time difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first electronic device processes the second ultrasonic signal.
[0145] The time for the first electronic device to process the first ultrasonic signal is described below in two cases.
[0146] In case 1, optionally, the time when the first electronic device processes the first ultrasonic signal may be the time when the first electronic device sends the first ultrasonic signal, for example, it may be the first moment. Optionally, the third time information is used to indicate the time difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first electronic device sends the first ultrasonic signal through the first speaker. For example, if the time when the first electronic device sends the first ultrasonic signal through the first speaker is the first moment, and the time when the first electronic device receives the third ultrasonic signal is the ninth moment, then the third time information is used to indicate the time difference between the ninth moment and the first moment. For example, if the first electronic device sends the first ultrasonic signal through the first speaker before the first electronic device receives the third ultrasonic signal, the time difference between the ninth moment and the first moment indicated by the third time information is a positive value; for another example, if the first electronic device sends the first ultrasonic signal through the first speaker after the first electronic device receives the third ultrasonic signal, then the time difference between the ninth moment and the first moment indicated by the third time information is a negative value.
[0147] In case 2, optionally, the time when the first electronic device processes the first ultrasonic signal may be the time when the first microphone of the first electronic device receives the first ultrasonic signal, for example, it may be the second moment. Optionally, the third time information is used to indicate the time difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first microphone of the first electronic device receives the first ultrasonic signal sent by the first speaker of the first electronic device. For example, if the time when the first microphone of the first electronic device receives the first ultrasonic signal sent by the first speaker of the first electronic device is the second moment, and the time when the first electronic device receives the third ultrasonic signal is the ninth moment, then the third time information is used to indicate the time difference between the ninth moment and the second moment. For example, if the first microphone of the first electronic device receives the first ultrasonic signal sent by the first speaker of the first electronic device before the first microphone of the first electronic device receives the third ultrasonic signal, then the time difference between the ninth moment and the second moment indicated by the third time information is a positive value. For another example, if the first microphone of the first electronic device receives the first ultrasonic signal sent by the first speaker of the first electronic device after the first microphone of the first electronic device receives the third ultrasonic signal, then the time difference between the ninth moment and the second moment indicated by the third time information is a negative value.
[0148] The time for the first electronic device to process the second ultrasonic signal is described below in two cases.
[0149] In case one, optionally, the time when the first electronic device processes the second ultrasonic signal may be the time when the first electronic device sends the second ultrasonic signal, for example, it may be the fourth moment. Optionally, the fourth time information is used to indicate the time difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first electronic device sends the second ultrasonic signal through the second speaker. For example, if the time when the first electronic device sends the second ultrasonic signal through the second speaker is the fourth moment, and the time when the first electronic device receives the third ultrasonic signal is the ninth moment, then the fourth time information is used to indicate the time difference between the ninth moment and the fourth moment. For example, if the first electronic device sends the second ultrasonic signal through the second speaker before the first electronic device receives the third ultrasonic signal, then the time difference between the ninth moment and the fourth moment indicated by the fourth time information is a positive value; for another example, if the first electronic device sends the second ultrasonic signal through the second speaker after the first electronic device receives the third ultrasonic signal, then the fourth time information is used to indicate that the time difference between the ninth moment and the fourth moment is a negative value.
[0150] In case 2, optionally, the time when the first electronic device processes the second ultrasonic signal may be the time when the first microphone of the first electronic device receives the second ultrasonic signal sent by the second speaker of the first electronic device, for example, it may be the fifth moment. Optionally, the fourth time information is used to indicate the time difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first microphone of the first electronic device receives the second ultrasonic signal sent by the second speaker of the first electronic device. For example, if the time when the first microphone of the first electronic device receives the second ultrasonic signal sent by the second speaker of the first electronic device is the fifth moment, and the time when the first electronic device receives the third ultrasonic signal is the ninth moment, then the fourth time information is used to indicate the time difference between the ninth moment and the fifth moment. For example, if the first microphone of the first electronic device receives the second ultrasonic signal sent by the second speaker of the first electronic device before the first microphone of the first electronic device receives the third ultrasonic signal, then the time difference between the ninth moment and the fifth moment indicated by the fourth time information is a positive value. For another example, if the first microphone of the first electronic device receives the second ultrasonic signal sent by the second speaker of the first electronic device after the first microphone of the first electronic device receives the third ultrasonic signal, then the time difference between the ninth moment and the fifth moment indicated by the fourth time information is a negative value.
[0151] Optionally, the location information of the second electronic device may indicate the coordinates of the second electronic device.
[0152] Optionally, the location information of the second electronic device may indicate an angle of the second electronic device.
[0153] Optionally, the location information of the second electronic device may indicate the distance between the second electronic device and the first electronic device.
[0154] Optionally, the location information of the second electronic device may indicate the angle of the second electronic device and the distance between the second electronic device and the first electronic device.
[0155] S650 is described below in four cases according to the time it takes for the first electronic device to process the first ultrasonic signal, the time it takes for the first electronic device to process the second ultrasonic signal, and the time it takes for the second electronic device to process the third ultrasonic signal.
[0156] a) The time it takes for the first electronic device to process the first ultrasonic signal is the description of case one, the time it takes for the first electronic device to process the second ultrasonic signal is the description of case one, and the time it takes for the second electronic device to process the third ultrasonic signal is the description of case one.
[0157] That is, in a), the time when the first electronic device processes the first ultrasonic signal may be the time when the first electronic device sends the first ultrasonic signal, the time when the first electronic device processes the second ultrasonic signal may be the time when the first electronic device sends the second ultrasonic signal, and the time when the second electronic device processes the third ultrasonic signal may be the time when the second electronic device sends the third ultrasonic signal. At this time, S650 includes: the first electronic device determines the position information of the second electronic device based on the first time information, the second time information, the third time information, the fourth time information, the propagation speed of the ultrasonic signal, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device.
[0158] Optionally, in a), S650 includes: the first electronic device determining, based on the first time information and the third time information, the sum of the first distance and the second distance; the first distance being the distance between the first speaker and the second electronic device, and the second distance being the distance between the first microphone and the second electronic device; the first electronic device determining, based on the second time information and the fourth time information, the sum of the third distance and the second distance; the third distance being the distance between the second speaker and the second electronic device; and the first electronic device determining, based on the sum of the first distance and the second distance, the sum of the third distance and the second distance, and the positions of the first speaker, the second speaker, and the first microphone in the first electronic device, the position information of the second electronic device. The first distance, the second distance, and the third distance may be unknown quantities, that is, the first electronic device may not determine the specific values of the first distance, the second distance, and the third distance, but may determine the sum of the first distance and the second distance, and the sum of the second distance and the third distance.
[0159] Optionally, the first electronic device determining the sum of the first distance and the second distance based on the first time information and the third time information includes: the first electronic device determining the sum of the first distance and the second distance based on the first time information, the third time information, and a propagation speed of the ultrasonic signal. The first electronic device determining the sum of the second distance and the third distance based on the second time information and the fourth time information includes: the first electronic device determining the sum of the second distance and the third distance based on the second time information, the fourth time information, and the propagation speed of the ultrasonic signal.
[0160] For example, the first electronic device transmits a first ultrasonic signal at time t1, and the second electronic device receives the first ultrasonic signal at time t3; the first electronic device transmits a second ultrasonic signal at time t4, and the second electronic device receives the second ultrasonic signal at time t6; the second electronic device transmits a third ultrasonic signal at time t7, and the first electronic device receives the third ultrasonic signal at time t9; the first time information indicates the time difference between t3 and t7. If the second electronic device receives the first ultrasonic signal before the second electronic device transmits the third ultrasonic signal, the t3-t7 value indicated by the first time information is a negative value; if the second electronic device receives the first ultrasonic signal after the second electronic device transmits the third ultrasonic signal, the t3-t7 value indicated by the first time information is a positive value. The second time information indicates the time difference between t6 and t7. If the second electronic device receives the second ultrasonic signal before the second electronic device transmits the third ultrasonic signal, the t6-t7 value indicated by the second time information is a negative value; if the second electronic device receives the second ultrasonic signal after the second electronic device transmits the third ultrasonic signal, the t6-t7 value indicated by the second time information is a positive value. The third time information is used to indicate the time difference between t9 and t1. If the first electronic device transmits the first ultrasonic signal through the first speaker before the first electronic device receives the third ultrasonic signal, the t9-t1 indicated by the third time information is a positive value. For another example, if the first electronic device transmits the first ultrasonic signal through the first speaker after the first electronic device receives the third ultrasonic signal, the t9-t1 indicated by the third time information is a negative value. The fourth time information is used to indicate the time difference between t9 and t4. If the first electronic device transmits the second ultrasonic signal through the second speaker before the first electronic device receives the third ultrasonic signal, the t9-t4 indicated by the fourth time information is a positive value. For another example, if the first electronic device transmits the second ultrasonic signal through the second speaker after the first electronic device receives the third ultrasonic signal, the t9-t4 indicated by the fourth time information is a negative value. The coordinates of the first speaker of the first electronic device are (d1, 0), the coordinates of the second speaker of the first electronic device are (d2, 0), and the coordinates of the first microphone of the first electronic device are (d3, 0). The first electronic device can determine the location information of the second electronic device based on t3-t7, t6-t7, t9-t1, t9-t4, (d1, 0), (d2, 0), and (d3, 0). The first electronic device can determine the location information of the second electronic device based on t3-t7, t6-t7, t9-t1, t9-t4, (d1, 0), (d2, 0), and (d3, 0), including: the first electronic device can determine the sum of the first distance and the second distance based on t3-t7, t9-t1, and ν, and determine the sum of the second distance and the third distance based on t6-t7, t9-t4, and ν. Where ν is the propagation speed of the ultrasonic signal.
[0161] b) The time it takes for the first electronic device to process the first ultrasonic signal is as described in case two, the time it takes for the first electronic device to process the second ultrasonic signal is as described in case two, and the time it takes for the second electronic device to process the third ultrasonic signal is as described in case one.
[0162] That is, in b), the time when the first electronic device processes the first ultrasonic signal may be the time when the first microphone of the first electronic device receives the first ultrasonic signal sent by the first speaker of the first electronic device, the time when the first electronic device processes the second ultrasonic signal may be the time when the first microphone of the first electronic device receives the second ultrasonic signal sent by the second speaker of the first electronic device, and the time when the second electronic device processes the third ultrasonic signal may be the time when the second electronic device sends the third ultrasonic signal. At this time, S650 includes: the first electronic device determines the position information of the second electronic device based on the first time information, the second time information, the third time information, the fourth time information, the distance from the first speaker to the first microphone, the distance from the second speaker to the first microphone, and the positions of the first speaker, the second speaker, and the first microphone in the first electronic device. Optionally, the first electronic device determines the position information of the second electronic device based on the first time information, the second time information, the third time information, the fourth time information, the distance from the first speaker to the first microphone, the distance from the second speaker to the first microphone, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device, including: the first electronic device determines the position information of the second electronic device based on the first time information, the second time information, the third time information, the fourth time information, the distance from the first speaker to the first microphone, the distance from the second speaker to the first microphone, the propagation speed of the ultrasonic signal, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device.
[0163] Optionally, S650 includes: the first electronic device determining, based on the first time information, the third time information, and the distance between the first speaker and the first microphone, the sum of the first distance and the second distance; the first distance being the distance between the first speaker and the second electronic device, and the second distance being the distance between the first microphone and the second electronic device; the first electronic device determining, based on the second time information, the fourth time information, and the distance between the second speaker and the first microphone, the sum of the third distance and the second distance; the third distance being the distance between the second speaker and the second electronic device; and determining, based on the sum of the first distance and the second distance, the sum of the third distance and the second distance, and the positions of the first speaker, the second speaker, and the first microphone in the first electronic device, the position information of the second electronic device. The first distance, the second distance, and the third distance may be unknown quantities, that is, the first electronic device may not determine the specific values of the first distance, the second distance, and the third distance, but may determine the sum of the first distance and the second distance, and the sum of the second distance and the third distance.
[0164] Optionally, the first electronic device determines the sum of the first distance and the second distance based on the first time information, the third time information, and the distance between the first speaker and the first microphone, including: the first electronic device determines the sum of the first distance and the second distance based on the first time information, the third time information, the propagation speed of the ultrasonic signal, and the distance between the first speaker and the first microphone. The first electronic device determines the sum of the second distance and the third distance based on the second time information, the fourth time information, and the distance between the second speaker and the first microphone, including: the first electronic device determines the sum of the second distance and the third distance based on the second time information, the fourth time information, the propagation speed of the ultrasonic signal, and the distance between the second speaker and the first microphone.
[0165] For example, the time when the first speaker of the first electronic device sends the first ultrasonic signal is t1, the time when the first microphone of the first electronic device receives the first ultrasonic signal sent by the first speaker of the first electronic device is t2, and the time when the second electronic device receives the first ultrasonic signal is t3; the time when the first electronic device sends the second ultrasonic signal is t4, the time when the first microphone of the first electronic device receives the second ultrasonic signal sent by the second speaker of the first electronic device is t5, the time when the second electronic device receives the second ultrasonic signal is t6, the time when the second electronic device sends the third ultrasonic signal is t7, and the time when the first electronic device receives the third ultrasonic signal is t9; the first time information is used to indicate the time difference between t3 and t7. If the second electronic device receives the first ultrasonic signal before the second electronic device sends the third ultrasonic signal, the t3-t7 indicated by the first time information is a negative value. If the second electronic device receives the first ultrasonic signal after the second electronic device sends the third ultrasonic signal, the t3-t7 indicated by the first time information is a positive value. The second time information is used to indicate the time difference between t6 and t7. If the second electronic device receives the second ultrasonic signal before the second electronic device transmits the third ultrasonic signal, the t6-t7 indicated by the second time information is a negative value. If the second electronic device receives the second ultrasonic signal after the second electronic device transmits the third ultrasonic signal, the t6-t7 indicated by the second time information is a positive value. The third time information is used to indicate the time difference between t9 and t2. If the first electronic device receives the first ultrasonic signal transmitted by the first speaker of the first electronic device through the first microphone before the first electronic device receives the third ultrasonic signal, the t9-t2 indicated by the third time information is a positive value. For example, if the first electronic device receives the first ultrasonic signal transmitted by the first speaker of the first electronic device through the first microphone after the first electronic device receives the third ultrasonic signal, the t9-t2 indicated by the third time information is a negative value. The fourth time information is used to indicate the time difference between t9 and t5. If the first electronic device receives the second ultrasonic signal transmitted by the second speaker of the first electronic device through the first microphone before the first electronic device receives the third ultrasonic signal, then t9-t5 indicated by the fourth time information is a positive value. For another example, if the first electronic device receives the second ultrasonic signal transmitted by the second speaker of the first electronic device through the first microphone after the first electronic device receives the third ultrasonic signal, then t9-t5 indicated by the fourth time information is a negative value. The coordinates of the first speaker of the first electronic device are (d1, 0), the coordinates of the second speaker of the first electronic device are (d2, 0), the coordinates of the first microphone of the first electronic device are (d3, 0), the distance from the first microphone of the first electronic device to the first speaker of the first electronic device is |d1-d3|, and the distance from the first microphone of the first electronic device to the second speaker of the first electronic device is |d2-d3|.The first electronic device may determine the location information of the second electronic device based on t3-t7, t6-t7, t9-t2, t9-t5, |d1-d3|, |d2-d3|, (d1, 0), (d2, 0), and (d3, 0). The first electronic device may determine the sum of the first distance and the second distance based on t3-t7, t9-t2, ν, and |d1-d3|, determine the sum of the second distance and the third distance based on t6-t7, t9-t5, and |d2-d3|, and determine the location information of the second electronic device based on the sum of the first distance and the second distance, the sum of the second distance and the third distance, (d1, 0), (d2, 0), and (d3, 0).
[0166] c) The time it takes for the first electronic device to process the first ultrasonic signal is as described in case one, the time it takes for the first electronic device to process the second ultrasonic signal is as described in case one, and the time it takes for the second electronic device to process the third ultrasonic signal is as described in case two.
[0167] That is, in c), the time when the first electronic device processes the first ultrasonic signal may be the time when the first electronic device transmits the first ultrasonic signal, the time when the first electronic device processes the second ultrasonic signal may be the time when the first electronic device transmits the second ultrasonic signal, and the time when the second electronic device processes the third ultrasonic signal may be the time when the second electronic device receives, via the second microphone, the third ultrasonic signal transmitted by the second electronic device via the third speaker. In this case, S650 includes: the first electronic device determining the location information of the second electronic device based on the first time information, the second time information, the third time information, the fourth time information, the distance from the third speaker to the second microphone, and the positions of the first speaker, the second speaker, and the first microphone in the first electronic device. Optionally, the first electronic device determining the location information of the second electronic device based on the first time information, the second time information, the third time information, the fourth time information, the distance from the third speaker to the second microphone, and the positions of the first speaker, the second speaker, and the first microphone in the first electronic device includes: the first electronic device determining the location information of the second electronic device based on the first time information, the second time information, the third time information, the fourth time information, the distance from the third speaker to the second microphone, the propagation speed of the ultrasonic signal, and the positions of the first speaker, the second speaker, and the first microphone in the first electronic device.
[0168] Optionally, in c), S650 includes: the first electronic device determining, based on the first time information, the third time information, and the distance from the second microphone to the third speaker, the sum of a seventh distance and an eighth distance; the seventh distance being the distance between the first speaker and the fourth microphone of the second electronic device, and the eighth distance being the distance between the third speaker of the second electronic device and the first microphone; the first electronic device determining, based on the second time information, the fourth time information, and the distance from the second microphone to the third speaker, the sum of an eighth distance and a ninth distance; the ninth distance being the distance between the second speaker and the fifth microphone of the second electronic device; and the first electronic device determining, based on the sum of the seventh distance and the eighth distance, the sum of the eighth distance and the ninth distance, the positions of the first speaker, the second speaker, and the first microphone in the first electronic device, and the positions of the fourth microphone, the fifth microphone, and the third speaker in the second electronic device, the position information of the second electronic device. The seventh distance, the eighth distance, and the ninth distance may be unknown quantities, that is, the first electronic device may not determine the specific values of the seventh distance, the eighth distance, and the ninth distance, but may determine the sum of the seventh distance and the eighth distance, and the sum of the eighth distance and the ninth distance.
[0169] Optionally, the first electronic device determines the sum of the seventh distance and the eighth distance based on the first time information, the third time information, and the distance from the second microphone to the third speaker, including: the first electronic device determines the sum of the seventh distance and the eighth distance based on the first time information, the third time information, the propagation speed of the ultrasonic signal, and the distance from the second microphone to the third speaker. The first electronic device determines the sum of the eighth distance and the ninth distance based on the second time information, the fourth time information, and the distance from the second microphone to the third speaker, including: the first electronic device determines the sum of the eighth distance and the ninth distance based on the second time information, the fourth time information, the propagation speed of the ultrasonic signal, and the distance from the second microphone to the third speaker.
[0170] For example, the time when the first electronic device sends the first ultrasonic signal is t1, and the time when the second electronic device receives the first ultrasonic signal is t3; the time when the first electronic device sends the second ultrasonic signal is t4, the time when the second electronic device receives the second ultrasonic signal is t6, the time when the second electronic device sends the third ultrasonic signal through the third speaker is t7, the time when the second electronic device receives the third ultrasonic signal sent by the second electronic device through the third speaker through the second microphone is t8, and the time when the first electronic device receives the third ultrasonic signal is t9; the first time information is used to indicate the time difference between t3 and t8. If the second electronic device receives the first ultrasonic signal before the second electronic device receives the third ultrasonic signal sent by the second electronic device through the third speaker through the second microphone, then the t3-t8 indicated by the first time information is a negative value. If the second electronic device receives the first ultrasonic signal after the second electronic device receives the third ultrasonic signal sent by the second electronic device through the third speaker through the second microphone, then the t3-t8 indicated by the first time information is a positive value. The second time information indicates the time difference between t6 and t8. If the second electronic device receives the second ultrasonic signal before it transmits the third ultrasonic signal, the value t6-t8 indicated by the second time information is negative. If the second electronic device receives the second ultrasonic signal after it transmits the third ultrasonic signal, the value t6-t8 indicated by the second time information is positive. The third time information indicates the time difference between t9 and t1. If the first electronic device transmits the first ultrasonic signal through the first speaker before it receives the third ultrasonic signal, the value t9-t1 indicated by the third time information is positive. For example, if the first electronic device transmits the first ultrasonic signal through the first speaker after it receives the third ultrasonic signal, the value t9-t1 indicated by the third time information is negative. The fourth time information indicates the time difference between t9 and t4. If the first electronic device transmits the second ultrasonic signal through the second speaker before it receives the third ultrasonic signal, the value t9-t4 indicated by the fourth time information t9-t4 is positive. For example, if the first electronic device transmits the second ultrasonic signal through the second speaker after it receives the third ultrasonic signal, the value t9-t4 indicated by the fourth time information t9-t4 is negative. The coordinates of the third speaker of the second electronic device are (x+l1, y+l2), the coordinates of the distance from the second microphone of the second electronic device are (x+l3, y+l4), the coordinates of the fourth microphone of the second electronic device are (x+l5, y+l6), the coordinates of the fifth microphone of the second electronic device are (x+l7, y+l8), and the distance from the second microphone of the second electronic device to the third speaker of the second electronic device is The coordinates of the center point of the second electronic device are (x, y), and (x, y) are unknown quantities. The coordinates of the first speaker of the first electronic device are (d1, 0), the coordinates of the second speaker of the first electronic device are (d2, 0), and the coordinates of the first microphone of the first electronic device are (d3, 0). The first electronic device can calculate the coordinates of the first microphone according to t3-t8, t6-t8, t9-t1, t9-t4, (d1, 0), (d2, 0), (d3, 0), Determine the location information of the second electronic device. The first electronic device can determine the location information of the second electronic device according to t3-t8, t6-t8, t9-t1, t9-t4, (d1,0), (d2,0), (d3,0), Determining the location information of the second electronic device includes: the first electronic device determines the location information of the second electronic device according to t3-t8, t9-t1 and Determine the sum of the seventh distance and the eighth distance, based on t6-t8, t9-t4 and Determine the sum of the eighth distance and the ninth distance, and determine the location information of the second electronic device based on (d1,0), (d2,0), (d3,0), (x+l1,y+l2), (x+l5,y+l6), (x+l7,y+l8), the sum of the seventh distance and the eighth distance, and the sum of the eighth distance and the ninth distance.
[0171] d) The time it takes for the first electronic device to process the first ultrasonic signal is as described in case two, the time it takes for the first electronic device to process the second ultrasonic signal is as described in case two, and the time it takes for the second electronic device to process the third ultrasonic signal is as described in case two.
[0172] That is, in d), the time when the first electronic device processes the first ultrasonic signal may be the time when the first microphone of the first electronic device receives the first ultrasonic signal sent by the first speaker of the first electronic device, the time when the first electronic device processes the second ultrasonic signal may be the time when the first microphone of the first electronic device receives the second ultrasonic signal sent by the second speaker of the first electronic device, and the time when the second electronic device processes the third ultrasonic signal may be the time when the second electronic device receives the third ultrasonic signal sent by the second electronic device through the third speaker via the second microphone. At this time, S650 includes: the first electronic device determines the position information of the second electronic device based on the first time information, the second time information, the third time information, the fourth time information, the distance from the first speaker to the first microphone, the distance from the second speaker to the first microphone, the distance from the second microphone to the third speaker, and the positions of the first speaker, the second speaker, and the first microphone in the first electronic device. Optionally, the first electronic device determines the location information of the second electronic device based on the first time information, the second time information, the third time information, the fourth time information, the distance from the first speaker to the first microphone, the distance from the second speaker to the first microphone, the distance from the second microphone to the third speaker, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device, and the positions of the third speaker, the fourth microphone and the fifth microphone in the second electronic device, including: the first electronic device determines the location information of the second electronic device based on the first time information, the second time information, the third time information, the fourth time information, the distance from the first speaker to the first microphone, the distance from the second speaker to the first microphone, the distance from the second microphone to the third speaker, the propagation speed of the ultrasonic signal, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device, and the positions of the third speaker, the fourth microphone and the fifth microphone in the second electronic device.
[0173] Optionally, in d), S650 includes: the first electronic device determining, based on the first time information, the third time information, the distance from the second microphone to the third speaker, and the distance from the first speaker to the first microphone, the sum of a seventh distance and an eighth distance; the seventh distance being the distance between the first speaker and the fourth microphone of the second electronic device, and the eighth distance being the distance between the third speaker of the second electronic device and the first microphone; the first electronic device determining, based on the second time information, the fourth time information, the distance from the second microphone to the third speaker, and the distance from the second speaker to the first microphone, the sum of an eighth distance and a ninth distance; the ninth distance being the distance between the second speaker and the fifth microphone of the second electronic device; and the first electronic device determining, based on the sum of the seventh distance and the eighth distance, the sum of the eighth distance and the ninth distance, the positions of the first speaker, the second speaker, and the first microphone in the first electronic device, and the positions of the fourth microphone, the fifth microphone, and the third speaker in the second electronic device, the position information of the second electronic device. The seventh distance, the eighth distance, and the ninth distance may be unknown quantities, that is, the first electronic device may not determine the specific values of the seventh distance, the eighth distance, and the ninth distance, but may determine the sum of the seventh distance and the eighth distance, and the sum of the eighth distance and the ninth distance.
[0174] Optionally, the first electronic device determines the sum of the seventh distance and the eighth distance based on the first time information, the third time information, the distance from the second microphone to the third speaker, and the distance from the first speaker to the first microphone, including: the first electronic device determines the sum of the seventh distance and the eighth distance based on the first time information, the third time information, the propagation speed of the ultrasonic signal, the distance from the second microphone to the third speaker, and the distance from the first speaker to the first microphone. The first electronic device determines the sum of the eighth distance and the ninth distance based on the second time information, the fourth time information, the distance from the second microphone to the third speaker, and the distance from the second speaker to the first microphone, including: the first electronic device determines the sum of the eighth distance and the ninth distance based on the second time information, the fourth time information, the propagation speed of the ultrasonic signal, the distance from the second microphone to the third speaker, and the distance from the second speaker to the first microphone.
[0175] For example, the time when the first speaker of the first electronic device sends the first ultrasonic signal is t1, the time when the first microphone of the first electronic device receives the first ultrasonic signal sent by the first speaker of the first electronic device is t2, and the time when the second electronic device receives the first ultrasonic signal is t3; the time when the first electronic device sends the second ultrasonic signal is t4, the time when the first microphone of the first electronic device receives the second ultrasonic signal sent by the second speaker of the first electronic device is t5, the time when the second electronic device receives the second ultrasonic signal is t6, the time when the second electronic device sends the third ultrasonic signal is t7, the time when the second electronic device receives the third ultrasonic signal sent by the second electronic device through the third speaker through the second microphone is t8, and the time when the first electronic device receives the third ultrasonic signal is t9; the first time information is used to indicate the time difference between t3 and t8. If the second electronic device receives the first ultrasonic signal before the second electronic device receives the third ultrasonic signal sent by the second electronic device through the third speaker through the second microphone, then t3-t8 indicated by the first time information is a negative value. If the second electronic device receives the first ultrasonic signal after the second electronic device receives the third ultrasonic signal sent by the second electronic device through the third speaker through the second microphone, then t3-t8 indicated by the first time information is a positive value. The second time information is used to indicate the time difference between t6 and t8. If the second electronic device receives the second ultrasonic signal before the second electronic device receives the third ultrasonic signal transmitted by the second electronic device through the third speaker via the second microphone, then the value t6-t8 indicated by the second time information is negative. If the second electronic device receives the second ultrasonic signal after the second electronic device receives the third ultrasonic signal transmitted by the second electronic device through the third speaker via the second microphone, then the value t6-t8 indicated by the second time information is positive. The third time information is used to indicate the time difference between t9 and t2. If the first electronic device receives the first ultrasonic signal transmitted by the first speaker of the first electronic device through the first microphone before the first electronic device receives the third ultrasonic signal, then the value t9-t2 indicated by the third time information is positive. For example, if the first electronic device receives the first ultrasonic signal transmitted by the first speaker of the first electronic device through the first microphone after the first electronic device receives the third ultrasonic signal, then the value t9-t2 indicated by the third time information is negative. The fourth time information is used to indicate the time difference between t9 and t5. If the first electronic device receives the second ultrasonic signal sent by the second speaker of the first electronic device through the first microphone before the first electronic device receives the third ultrasonic signal, t9-t5 indicated by the fourth time information is a positive value; for example, if the first electronic device receives the second ultrasonic signal sent by the second speaker of the first electronic device through the first microphone after the first electronic device receives the third ultrasonic signal, t9-t5 indicated by the fourth time information is a negative value.Among them, the coordinates of the first speaker of the first electronic device are (d1,0), the coordinates of the second speaker of the first electronic device are (d2,0), the coordinates of the first microphone of the first electronic device are (d3,0), the coordinates of the third speaker of the second electronic device are (x+l1,y+l2), and the coordinates of the distance of the second microphone of the second electronic device are.
[0176] (x+l3, y+l4), the coordinates of the fourth microphone of the second electronic device are (x+l5, y+l6), the coordinates of the fifth microphone of the second electronic device are (x+l7, y+l8), the distance from the first microphone of the first electronic device to the first speaker of the first electronic device is |d1-d3|, the distance from the first microphone of the first electronic device to the second speaker of the first electronic device is |d2-d3|, the distance from the second microphone of the second electronic device to the third speaker of the second electronic device is The first electronic device can select t3-t8, t6-t8, t9-t2, t9-t5, |d1-d3|, |d2-d3|, (d1,0), (d2,0), (d3,0), (x+l1,y+l2), (x+l5,y+l6), and (x+l7,y+l8) determine the location information of the second electronic device. The first electronic device can determine the location information of the second electronic device based on t3-t8, t6-t8, t9-t2, t9-t5, |d1-d3|, |d2-d3|, (d1,0), (d2,0), (d3,0), (x+l1,y+l2), (x+l5,y+l6) and (x+l7,y+l8) determine the location information of the second electronic device, including: the first electronic device determines the location information of the second electronic device according to t3-t8, t9-t2, The sum of the seventh distance and the eighth distance is determined by |d1-d3|, and the sum of t6-t8, t9-t5, The sum of the eighth distance and the ninth distance is determined by summing |d2-d3|, and the location information of the second electronic device is determined according to (d1,0), (d2,0), (d3,0), (x+l1,y+l2), (x+l5,y+l6), (x+l7,y+l8), the sum of the seventh distance and the eighth distance, and the sum of the eighth distance and the ninth distance.
[0177] Optionally, S650 includes: the first electronic device determines the position information of the second electronic device based on the absolute value of the time difference between the time when the second electronic device receives the first ultrasonic signal and the time when the second electronic device processes the third ultrasonic signal according to the first time information, the absolute value of the time difference between the time when the second electronic device receives the second ultrasonic signal and the time when the second electronic device processes the third ultrasonic signal according to the second time information, the absolute value of the time difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first electronic device processes the first ultrasonic signal according to the third time information, the absolute value of the time difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first electronic device processes the second ultrasonic signal according to the fourth time information, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device.
[0178] Optionally, any two of the second microphone, the fourth microphone and the fifth microphone of the second electronic device may be the same microphone or different microphones, which is not limited in this embodiment of the present application.
[0179] Optionally, in method 600, the first microphone of the first electronic device may receive the third ultrasonic signal sent by the third speaker of the second electronic device, and determine the location information of the second electronic device in S650. If the first electronic device includes multiple microphones, the first electronic device may determine the location information of the second electronic device once for each microphone, and determine the location information of the second electronic device based on the location information of the second electronic device obtained multiple times, for example, averaging the location information of the second electronic device obtained multiple times to obtain the location information of the second electronic device, or may determine the location information of the second electronic device based on the signal quality of the ultrasonic signal. For example, the microphone 1 of the first electronic device receives the third ultrasonic signal of the second electronic device. At this time, the third time information is used to indicate the time difference between the time when the microphone 1 receives the third ultrasonic signal and the time when the first electronic device processes the first ultrasonic signal. The fourth time information is used to indicate the time difference between the time when the microphone 1 receives the third ultrasonic signal and the time when the first electronic device processes the second ultrasonic signal. The first electronic device determines the location information of the second electronic device based on the first time information, the second time information, the third time information, the fourth time information, and the first speaker and the second speaker. The first electronic device can determine the location information of the second electronic device corresponding to microphone 2 based on the positions of the speaker and microphone 1 in the first electronic device. When microphone 2 of the first electronic device receives the third ultrasonic signal from the second electronic device, the third time information indicates the time difference between the time microphone 2 receives the third ultrasonic signal and the time the first electronic device processes the first ultrasonic signal. The fourth time information indicates the time difference between the time microphone 2 receives the third ultrasonic signal and the time the first electronic device processes the second ultrasonic signal. The first electronic device can determine the location information of the second electronic device corresponding to microphone 2 based on the first time information, the second time information, the third time information, the fourth time information, and the positions of the first speaker, the second speaker, and microphone 2 in the first electronic device. If the signal quality of the third ultrasonic signal received by microphone 1 is higher than the signal quality of the third ultrasonic signal received by microphone 2, the location information of the second electronic device corresponding to microphone 1 is determined as the location information of the second electronic device. That is, after the first electronic device transmits the first and second ultrasonic signals once, multiple microphones of the first electronic device can receive the third ultrasonic signal transmitted by the second electronic device. The first electronic device can calculate the location information of the second electronic device once for each microphone. That is, the different values of the ninth moment for different microphones in method 600 may result in different calculated location information of the second electronic device.
[0180] In some embodiments, the first electronic device can determine the location information of multiple electronic devices. In combination with method 600, if the first electronic device also determines the location information of a third electronic device, the first electronic device can continue to send a fifth ultrasonic signal to the third electronic device via the first speaker, send a sixth ultrasonic signal to the third electronic device via the second speaker, and the third electronic device can then send a seventh ultrasonic signal to the first electronic device. The first electronic device determines the location information of the third electronic device based on a method similar to method 600. For example, the first electronic device can assign a sound channel to each electronic device based on the location information of the multiple electronic devices.
[0181] In some embodiments, a first electronic device may determine location information of multiple electronic devices. The first electronic device may send a first ultrasonic signal and a second ultrasonic signal. Both the second electronic device and the third electronic device may receive the first ultrasonic signal and the second ultrasonic signal. The second electronic device then sends a fourth ultrasonic signal, and the third electronic device sends a fifth ultrasonic signal. The first electronic device may determine the location information of the second electronic device based on method 600. A method similar to method 600 may also determine the location information of the second electronic device. This embodiment is described below in conjunction with method 700 in FIG. As shown in FIG. 7 , method 700 includes:
[0182] S710: The first electronic device sends a first ultrasonic signal through a first speaker, the second electronic device receives the first ultrasonic signal, and the third electronic device receives the first ultrasonic signal.
[0183] Optionally, the first electronic device sending the first ultrasonic signal may refer to the description of S610.
[0184] Optionally, the third electronic device receives the first ultrasonic signal in a similar manner to the second electronic device receiving the first ultrasonic signal, and reference may be made to the description of S610 .
[0185] S720: The first electronic device sends a second ultrasonic signal through the second speaker, the second electronic device receives the second ultrasonic signal, and the third electronic device receives the second ultrasonic signal.
[0186] Optionally, the first electronic device sending the second ultrasonic signal may refer to the description of S620.
[0187] Optionally, the third electronic device receives the second ultrasonic signal similarly to the second electronic device receiving the first ultrasonic signal, and reference may be made to the description of S620 .
[0188] S730a, same as S630.
[0189] S730b: The third electronic device sends a fourth ultrasonic signal, and the first electronic device receives the fourth ultrasonic signal.
[0190] The manner in which the third electronic device sends the fourth ultrasonic signal is similar to the manner in which the second electronic device sends the third ultrasonic signal. Please refer to the description of S630 , which will not be described in detail to avoid redundancy.
[0191] S740a, same as S640.
[0192] S740b: The first electronic device obtains fifth time information and sixth time information.
[0193] Optionally, the fifth time information is used to indicate the time difference between the time when the third electronic device receives the first ultrasonic signal and the time when the third electronic device processes the fourth ultrasonic signal, and the sixth time information is used to indicate the time difference between the time when the third electronic device receives the second ultrasonic signal and the time when the third electronic device processes the fourth ultrasonic signal; wherein, the time when the third electronic device processes the fourth ultrasonic signal includes: the time when the third electronic device sends the fourth ultrasonic signal through the third speaker or the time when the third microphone of the third electronic device receives the fourth ultrasonic signal.
[0194] Among them, the fifth time information is similar to the first time information in S640, and the sixth time information is similar to the second time information in S640. The way in which the first electronic device obtains the fifth time information and the sixth time information is similar to the way in which the first electronic device obtains the first time information and the second time information in S640. Please refer to the description of S640. In order to avoid repetition, it is not described in detail.
[0195] S750a, same as S650.
[0196] S750b: The first electronic device determines location information of the third electronic device based on the fifth time information, the sixth time information, the seventh time information, the eighth time information, and the locations of the first speaker, the second speaker, and the first microphone in the first electronic device.
[0197] Among them, the seventh time information is similar to the third time information in S650, the eighth time information is similar to the fourth time information in S650, and the way in which the first electronic device determines the location information of the third electronic device based on the fifth time information, the sixth time information, the seventh time information, the eighth time information and the positions of the first speaker, the second speaker and the first microphone in the first electronic device is similar to S650. Please refer to the description of S650. In order to avoid repetition, it is not described in detail.
[0198] Optionally, the first electronic device can determine the location information of the second electronic device and the location information of the third electronic device, and allocate channels to the second electronic device and the third electronic device based on the location information of the second electronic device and the location information of the third electronic device. Similarly, the first electronic device can determine the location information of multiple electronic devices, such as the first electronic device can determine whether each electronic device is on the left or right side of the first electronic device based on the location information of each electronic device, and the relative distance between any two electronic devices and the first electronic device. For example, the first electronic device is a large screen, and the multiple electronic devices are four speakers. The large screen can allocate channels to the four speakers based on the distances of the four speakers from the large screen and the angles of the four speakers relative to the large screen. Specifically, the large screen determines whether the four speakers are on the left or right side of the large screen based on the angles of the four speakers relative to the large screen. Then, the large screen sets the speaker closer to the left as the left channel, the speaker farther away from the left as the left surround, the speaker closer to the right as the right channel, and the speaker farther away from the right as the right surround.
[0199] In order to better illustrate the above-mentioned method embodiment, a specific description is given below in conjunction with Figures 8 to 13. In the process described below, the first electronic device determines the location information of the second electronic device as an example. The first electronic device determines the location information of other electronic devices. For example, the first electronic device determines the location information of the third electronic device similarly to the location information of the second electronic device. In order to avoid redundancy, a detailed description is not given. Figures 8 to 10 are detailed descriptions of a) in S650, Figure 11 is a detailed description of b) in S650, Figure 12 is a detailed description of c) in S650, and Figure 13 is a detailed description of d) in S650. As shown in Figure 8, method 800 includes:
[0200] S810: The first electronic device sends a first ultrasonic signal through a first speaker at a first moment, and the second electronic device receives the first ultrasonic signal at a third moment.
[0201] S820: The first electronic device sends a second ultrasonic signal through the second speaker at a fourth moment, and the second electronic device receives the second ultrasonic signal at a sixth moment.
[0202] After S810 and S820, the second electronic device may perform S830.
[0203] There is no restriction on the order between S810 and S820. S810 can be performed before or after S820, or simultaneously. If S810 and S820 are performed simultaneously, the first ultrasonic signal is different from the second ultrasonic signal.
[0204] Optionally, before S810 and S820, method 800 may further include: the first electronic device determines whether the second electronic device and the first electronic device are in the same space; if the first electronic device determines that the second electronic device and the first electronic device are in the same space, S810 and S820 may be executed, otherwise S810 and S820 are not executed.
[0205] Optionally, before S810, the second electronic device may send a Bluetooth signal and an eighth ultrasonic signal to the first electronic device. The first electronic device determines whether the first electronic device and the second electronic device are in the same space based on the signal strength of the Bluetooth signal and the signal strength of the eighth ultrasonic signal. Since the obstruction of the wall will cause the attenuation of the ultrasonic signal to be much greater than the attenuation of the Bluetooth signal, if the signal strength of the Bluetooth signal is much better than the signal strength of the eighth ultrasonic signal, it indicates that the first electronic device and the second electronic device are not in the same space. Optionally, the first electronic device can use the difference between the signal strength of the Bluetooth signal and the signal strength of the eighth ultrasonic signal to determine whether the first electronic device and the second electronic device are in the same space.
[0206] For example, the signal strength of the Bluetooth signal is ρ B ,in, P B is a coefficient related to Bluetooth transmission power, and the first electronic device can know P B , W B is the Bluetooth attenuation coefficient caused by the wall, d is the distance from the first electronic device to the second electronic device. The signal strength of the eighth ultrasonic signal is ρ U ,in, P U is a coefficient related to ultrasonic transmission power, the first electronic device can know P U , W U is the ultrasonic attenuation coefficient caused by wall shielding. When the first electronic device and the second electronic device are in the same space, that is, there is no wall shielding between the first electronic device and the second electronic device, W B =1,W U = 1. When the first electronic device and the second electronic device are not in the same space, that is, when there is a wall between the first electronic device and the second electronic device, the attenuation of ultrasound is much greater than the attenuation of Bluetooth, W U The smaller the value, the greater the attenuation. Therefore, W U < <W B It can be seen that the first electronic device can use the ratio of the signal strength of the received Bluetooth signal to the signal strength of the eighth ultrasonic signal Determine whether the first electronic device and the second electronic device are in the same space. That is to say Regardless of the distance between the first electronic device and the second electronic device, since P U and P B is a fixed value. and When there is no wall between the first electronic device and the second electronic device, W B =1,W U =1, That is, if the ratio of the signal strength of the first electronic device's Bluetooth signal to the signal strength of the eighth ultrasonic signal is equal to It means that the first electronic device and the second electronic device are in the same space. It means that the first electronic device and the second electronic device are not in the same space. Optionally, the first electronic device can set a threshold σ, and the first electronic device can test to obtain σ. When , it means that there is a wall between the first electronic device and the second electronic device, and the first electronic device and the second electronic device are not in the same space. , it indicates that there is no wall blocking the first electronic device and the second electronic device, and the first electronic device and the second electronic device are in the same space.
[0207] It can be understood that it is an optional step for the first electronic device to determine whether the second electronic device is in the same space as the first electronic device. The first electronic device may not determine whether the first electronic device and the second electronic device are in the same space, and may assume that the first electronic device and the second electronic device are in the same space or may still execute the method of the embodiment of the present application regardless of whether the first electronic device and the second electronic device are in the same space. That is, even if the first electronic device and the second electronic device are not in the same space, the first electronic device can still determine the location information of the second electronic device. For example, the first electronic device can still allocate a channel to the second electronic device based on the determined location information of the second electronic device.
[0208] S830: The second electronic device sends a third ultrasonic signal at the seventh moment, and the first electronic device receives the third ultrasonic signal through the first microphone at the ninth moment.
[0209] Optionally, S810 and S820 may be before S830 or after S830, and this embodiment of the application does not limit this. If S810 and S820 are before S830, it means that the first electronic device first sends the first ultrasonic signal and the second ultrasonic signal, and the second electronic device can send the third ultrasonic signal after receiving the first ultrasonic signal and the second ultrasonic signal; if S810 and S820 are after S830, it means that the second electronic device first sends the third ultrasonic signal, and the first electronic device can send the first ultrasonic signal and the second ultrasonic signal after receiving the third ultrasonic signal sent by the second electronic device.
[0210] S840: The first electronic device obtains a difference between the third time and the seventh time.
[0211] At this time, the first time information in method 600 is used to indicate the difference between the third moment and the seventh moment.
[0212] Optionally, the second electronic device may send indication information indicating the difference between the third moment and the seventh moment to the first electronic device.
[0213] S850: The first electronic device obtains the difference between the sixth moment and the seventh moment.
[0214] At this time, the second time information in method 600 is used to indicate the difference between the sixth moment and the seventh moment.
[0215] Optionally, the second electronic device may send indication information indicating the difference between the sixth moment and the seventh moment to the first electronic device.
[0216] S860: The first electronic device determines a difference between the ninth moment and the first moment, and a difference between the ninth moment and the fourth moment.
[0217] The third time information in method 600 indicates the difference between the ninth moment and the first moment, and the fourth time information indicates the difference between the ninth moment and the fourth moment.
[0218] S870, the first electronic device determines the location information of the second electronic device based on the difference between the third moment and the seventh moment, the difference between the sixth moment and the seventh moment, the difference between the ninth moment and the first moment, the difference between the ninth moment and the fourth moment, and the positions of the first speaker, the second speaker, and the first microphone in the first electronic device.
[0219] Optionally, S870 includes: the first electronic device determines the location information of the second electronic device based on the difference between the third moment and the seventh moment, the difference between the sixth moment and the seventh moment, the difference between the ninth moment and the first moment, the difference between the ninth moment and the fourth moment, the propagation speed of the ultrasonic signal, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device.
[0220] Optionally, the first electronic device determines the location information of the second electronic device based on the difference between the third moment and the seventh moment, the difference between the sixth moment and the seventh moment, the difference between the ninth moment and the first moment, the difference between the ninth moment and the fourth moment, the propagation speed of the ultrasonic signal, and the positions of the first speaker, the second speaker, and the first microphone in the first electronic device, including: the first electronic device determines the location information of the second electronic device based on the absolute value of the difference between the third moment and the seventh moment, the absolute value of the difference between the sixth moment and the seventh moment, the absolute value of the difference between the ninth moment and the first moment, the absolute value of the difference between the ninth moment and the fourth moment, the propagation speed of the ultrasonic signal, and the positions of the first speaker, the second speaker, and the first microphone in the first electronic device.
[0221] The following describes a method in which a first electronic device determines location information of a second electronic device by way of example.
[0222] The first moment is t1, the third moment is t3, the fourth moment is t4, the sixth moment is t6, the seventh moment is t7, and the ninth moment is t9. As shown in Figure 9, the coordinates of the first speaker of the first electronic device are (d1,0), the coordinates of the second speaker are (d2,0), and the coordinates of the first microphone are (d3,0). The midpoint coordinates of the first speaker and the second speaker can be (0,0). The coordinates of the first speaker, the coordinates of the second speaker, and the coordinates of the first microphone can represent their positions in the first electronic device. The first speaker can be understood as the left speaker, the second speaker can be understood as the right speaker, and the coordinates (x,y) of the second electronic device are the values to be solved. The volume of the second electronic device is smaller than that of the first electronic device. For example, the volume of the second electronic device can be smaller than a preset value. For example, the second electronic device is a speaker and the first electronic device is a large screen. In this way, the second electronic device can be regarded as a point. That is, the distance from the first speaker to the fourth microphone of the second electronic device is equivalent to the distance from the first speaker to the second electronic device, and the distance from the second speaker to the fifth microphone of the second electronic device is equivalent to the distance from the second speaker to the second electronic device. As shown in FIG9 , the first distance from the first speaker to the second electronic device is D1, where The third distance from the second speaker to the second electronic device is D2, where The second distance between the second electronic device and the first microphone is D3, where: Then there are formulas (1) and (2): D1+D3=|t9-t1|-|t3-t7||ν (1) D2+D3=||t9-t4|-|t6-t7||ν (2)
[0223] If S810 and S820 can be performed before S830, that is, the first electronic device sends the first ultrasonic signal and the second ultrasonic signal before the second electronic device sends the third ultrasonic signal, then formula (1) can be replaced by formula (3) and formula (2) can be replaced by formula (4). D1+D3=((t9-t1)-(t7-t3))ν (3)
[0224] D2+D3=((t9-t4)-(t7-t6))ν (4)
[0225] If S810 and S820 can be performed after S830, that is, after the first electronic device sends the first ultrasonic signal and the second ultrasonic signal and the second electronic device sends the third ultrasonic signal, then formula (1) can be replaced by formula (5) and formula (2) can be replaced by formula (6). D1+D3=((t1-t9)-(t3-t7))ν (5) D s +D3=((t4-t9)-(t6-t7))ν (6)
[0226] Wherein, ν is the propagation velocity of the ultrasonic signal. The right sides of Formula (1) to Formula (6) are all known quantities. To simplify the description, the right side of Formula (1) or Formula (3) or Formula (5) can be recorded as A, that is, A = ||t9-t1|-|t3-t7||ν in Formula (1), A = ((t9-t1)-(t7-t3))ν in Formula (3), and A = ((t1-t9)-(t3-t7))ν in Formula (5). That is, A is the sum of the first distance and the second distance, and the right side of formula (2) or formula (4) or formula (6) can be recorded as B, that is, B = ||t9-t4|-|t6-t7||ν in formula (2), B = ((t9-t4)-(t7-t6))ν in formula (4), and B = ((t4-t9)-(t6-t7))ν in formula (6). That is, B is the sum of the second distance and the third distance.
[0227] Formula (7) is obtained by transforming formula (1) or formula (3) or formula (5), and formula (8) is obtained by transforming formula (2) or formula (4) or formula (6).
[0228] Solve formula (7) and formula (8) to obtain (x, y), where
[0229] x can be substituted into y to obtain the value of y, that is, if formula (1) is transformed into formula (7) and formula (2) is transformed into formula (8), then A = ||t9-t1|-|t3-t7||ν, and B = ||t9-t4|-|t6-t7||ν in x and y; if formula (3) is transformed into formula (7) and formula (4) is transformed into formula (8), then A = ((t9-t1)-(t7-t3))ν, and B = ((t9-t4)-(t7-t6))ν in x and y; if formula (5) is transformed into formula (7) and formula (6) is transformed into formula (8), then A = ((t1-t9)-(t3-t7))ν, and B = ((t4-t9)-(t6-t7))ν in x and y. After the first electronic device determines the coordinates of the second electronic device, it can also determine the distance between the first electronic device and the second electronic device and / or the angle of the second electronic device relative to the first electronic device based on the coordinates of the second electronic device. For example, the distance from the center point of the two speakers of the first electronic device to the second electronic device is The angle from the second electronic device to the midpoint of the two speakers of the first electronic device is That is to say, the position information of the second electronic device may indicate at least one of the coordinates of the second electronic device, the angle between the second electronic device and the midpoint of the two speakers of the first electronic device, or the distance between the second electronic device and the midpoint of the two speakers of the first electronic device. In addition, in the embodiment of the present application, the midpoint of the two speakers of the first electronic device is used as the coordinate origin, the physical size of the first electronic device is a known quantity, and the position of the first speaker, the position of the second speaker, and the position of the first microphone in the first electronic device are also known quantities. Therefore, any position of the first electronic device can be the coordinate origin. When a certain position of the first electronic device is the coordinate origin, the coordinates of the first speaker can be determined, the coordinates of the second speaker can also be determined, and the coordinates of the first microphone can also be determined.
[0230] The above is an example of deriving the two-dimensional coordinates of the second electronic device. In some cases, the three-dimensional coordinates of the second electronic device can also be derived based on the three-dimensional coordinates. The first moment is t1, the third moment is t3, the fourth moment is t4, the sixth moment is t6, the seventh moment is t7, and the eighth moment is t9. As shown in Figure 10, the coordinates of the first speaker of the first electronic device are (d1,0,h1), and the coordinates of the second speaker are (d2,0,h1), where the heights of the first and second speakers are the same, h1, the coordinates of the bottom midpoint of the first electronic device are (0,0,0), and the coordinates of the first microphone are (d3,0,h2), where the first speaker can be understood as the left speaker and the second speaker can be understood as the right speaker. The coordinates of the second electronic device (x,y,0) are the values to be solved, where the height of the speaker can be parallel to the bottom of the large screen. The volume of the second electronic device is smaller than that of the first electronic device. For example, the volume of the second electronic device can be smaller than a preset value. For example, the second electronic device is a speaker and the first electronic device is a large screen. In this way, the second electronic device can be regarded as a point. That is, the distance from the first speaker to the fourth microphone of the second electronic device is equivalent to the distance from the first speaker to the second electronic device, and the distance from the second speaker to the fifth microphone of the second electronic device is equivalent to the distance from the second speaker to the second electronic device. As shown in FIG10 , the first distance from the first speaker to the second electronic device is D1, where The third distance from the second speaker to the second electronic device is D2, where The second distance between the second electronic device and the first microphone is D3, where: Therefore, transforming formula (1) or formula (3) or formula (5) can obtain formula (9), and transforming formula (2) or formula (4) or formula (6) and formula (10).
[0231] Solve formula (9) and formula (10) to obtain (x, y, 0), where
[0232] Substituting x into y can get the value of y. After the first electronic device determines the coordinates of the second electronic device, it can also determine the distance between the first electronic device and the second electronic device and / or the angle of the second electronic device relative to the first electronic device based on the coordinates of the second electronic device. For example, the distance from the bottom midpoint of the first electronic device to the second electronic device is The angle from the second electronic device to the midpoint of the two speakers of the first electronic device is That is to say, the position information of the second electronic device may indicate at least one of the coordinates of the second electronic device, the angle between the second electronic device and the midpoint of the two speakers of the first electronic device, or the distance between the second electronic device and the midpoint of the two speakers of the first electronic device. In addition, in the embodiment of the present application, the midpoint of the bottom of the first electronic device is used as the coordinate origin, the physical size of the first electronic device is a known quantity, and the position of the first speaker, the position of the second speaker, and the position of the first microphone in the first electronic device are also known quantities. Therefore, any position of the first electronic device can be the coordinate origin. When a certain position of the first electronic device is used as the coordinate origin, the coordinates of the first speaker can be determined, the coordinates of the second speaker can also be determined, and the coordinates of the first microphone can also be determined.
[0233] S650 b) will be described in detail below with reference to FIG11 . As shown in FIG11 , method 1100 includes:
[0234] S1110, the first electronic device sends a first ultrasonic signal through a first speaker at a first moment, the first microphone of the first electronic device receives the first ultrasonic signal at a second moment, and the second electronic device receives the first ultrasonic signal at a third moment.
[0235] S1120: The first electronic device sends a second ultrasonic signal through the second speaker at a fourth moment, the first microphone of the first electronic device receives the second ultrasonic signal at a fifth moment, and the second electronic device receives the second ultrasonic signal at a sixth moment.
[0236] After S1110 and S1120, the second electronic device may perform S1130.
[0237] There is no restriction on the order between S1110 and S1120. S1110 can be performed before or after S1120, or simultaneously. If S1110 and S1120 are performed simultaneously, the first ultrasonic signal is different from the second ultrasonic signal.
[0238] Optionally, before S1110 and S1120, method 1100 may further include: the first electronic device determining whether the second electronic device is in the same space as the first electronic device; if the first electronic device determines that the second electronic device is in the same space as the first electronic device, S1110 and S1120 may be executed; otherwise, S1110 and S1120 are not executed. The manner in which the first electronic device determines whether the second electronic device is in the same space as the first electronic device is described in the description of method 900, and is not described in detail to avoid redundancy.
[0239] S1130: The second electronic device sends a third ultrasonic signal at the seventh moment, and the first electronic device receives the third ultrasonic signal through the first microphone at the ninth moment.
[0240] Optionally, S1110 and S1120 may be before S1130 or after S1110 and S1120, which is not limited in this embodiment of the present application. If S1110 and S1120 are before S1130, it means that the first electronic device first sends the first ultrasonic signal and the second ultrasonic signal, and the second electronic device can send the third ultrasonic signal after receiving the first ultrasonic signal and the second ultrasonic signal; if S1110 and S1120 are after S1130, it means that the second electronic device first sends the third ultrasonic signal, and the first electronic device can send the first ultrasonic signal and the second ultrasonic signal after receiving the third ultrasonic signal sent by the second electronic device.
[0241] S1140: The first electronic device obtains a difference between the third time and the seventh time.
[0242] At this time, the first time information in method 600 is used to indicate the difference between the third moment and the seventh moment.
[0243] Optionally, the second electronic device may send indication information indicating the difference between the third moment and the seventh moment to the first electronic device.
[0244] S1150: The first electronic device obtains a difference between the sixth time and the seventh time.
[0245] At this time, the second time information in method 600 is used to indicate the difference between the sixth moment and the seventh moment.
[0246] Optionally, the second electronic device may send indication information indicating the difference between the sixth moment and the seventh moment to the first electronic device.
[0247] S1160: The first electronic device determines a difference between the ninth moment and the second moment, and a difference between the ninth moment and the fifth moment.
[0248] The third time information in method 600 indicates the difference between the ninth moment and the second moment, and the fourth time information indicates the difference between the ninth moment and the fifth moment.
[0249] S1170, the first electronic device determines the location information of the second electronic device based on the difference between the third moment and the seventh moment, the difference between the sixth moment and the seventh moment, the difference between the ninth moment and the second moment, the difference between the ninth moment and the fifth moment, the distance from the first speaker to the first microphone, the distance from the second speaker to the first microphone, and the positions of the first speaker, the second speaker, and the first microphone in the first electronic device.
[0250] Optionally, S1170 includes: the first electronic device determines the position information of the second electronic device based on the difference between the third moment and the seventh moment, the difference between the sixth moment and the seventh moment, the difference between the ninth moment and the second moment, the difference between the ninth moment and the fifth moment, the propagation speed of the ultrasonic signal, the distance from the first speaker to the first microphone, the distance from the second speaker to the first microphone, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device.
[0251] Optionally, the first electronic device determines the location information of the second electronic device based on the difference between the third moment and the seventh moment, the difference between the sixth moment and the seventh moment, the difference between the ninth moment and the second moment, the difference between the ninth moment and the fifth moment, the propagation speed of the ultrasonic signal, the distance from the first speaker to the first microphone, the distance from the second speaker to the first microphone, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device, including: the first electronic device determines the location information of the second electronic device based on the absolute value of the difference between the third moment and the seventh moment, the absolute value of the difference between the sixth moment and the seventh moment, the absolute value of the difference between the ninth moment and the second moment, the absolute value of the difference between the ninth moment and the fifth moment, the propagation speed of the ultrasonic signal, the distance from the first speaker to the first microphone, the distance from the second speaker to the first microphone, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device.
[0252] The following describes a method in which a first electronic device determines location information of a second electronic device by way of example.
[0253] The second moment is t2, the third moment is t3, the fifth moment is t5, the sixth moment is t6, the seventh moment is t7, and the ninth moment is t9. As shown in Figure 9, the coordinates of the first speaker of the first electronic device are (d1,0), the coordinates of the second speaker are (d2,0), and the coordinates of the first microphone are (d3,0). The midpoint coordinates of the first speaker and the second speaker can be (0,0). The coordinates of the first speaker, the coordinates of the second speaker, and the coordinates of the first microphone can represent their positions in the first electronic device. The first speaker can be understood as the left speaker, the second speaker can be understood as the right speaker, and the coordinates (x,y) of the second electronic device are the values to be solved. The volume of the second electronic device is smaller than that of the first electronic device. For example, the volume of the second electronic device can be smaller than a preset value. For example, the second electronic device is a speaker and the first electronic device is a large screen. In this way, the second electronic device can be regarded as a point. That is, the distance from the first speaker to the fourth microphone of the second electronic device is equivalent to the distance from the first speaker to the second electronic device, and the distance from the second speaker to the fifth microphone of the second electronic device is equivalent to the distance from the second speaker to the second electronic device. As shown in FIG9 , the first distance from the first speaker to the second electronic device is D1, where The third distance from the second speaker to the second electronic device is D2, where The second distance between the second electronic device and the first microphone is D3, where: Then there are formulas (11) and (12). D1+D3=||t9-t2|-|t3-t7||ν+|d1-d3| (11) D2+D3=||t9-t5|-|t6-t7||ν+|d2-d3| (12)
[0254] If S1110 and S1120 can be performed before S1130, that is, the first electronic device sends the first ultrasonic signal and the second ultrasonic signal before the second electronic device sends the third ultrasonic signal, then formula (11) can be replaced by formula (13), and formula (12) can be replaced by formula (14). D1+D3=((t9-t2)-(t7-t3))ν+|d1-d3| (13) D2+D3=((t9-t5)-(t7-t6))ν+|d2-d3| (14)
[0255] If S1110 and S1120 can be performed after S1130, that is, the first electronic device sends the first ultrasonic signal and the second ultrasonic signal after the second electronic device sends the third ultrasonic signal, then formula (11) can be replaced by formula (15) and formula (12) can be replaced by formula (16).
[0256] D1+D3=((t2-t9)-(t3-t7))ν+|d1-d3| (15)
[0257] D2+D3=((t5-t9)-(t6-t7))ν+|d2-d3| (16)
[0258] Wherein, ν is the propagation speed of the ultrasonic signal. The right sides of formulas (11) to (16) are all known quantities. To simplify the description, the right side of formula (11) or formula (13) or formula (15) can be recorded as A, that is, A = ||t9-t2|-|t3-t7||ν + |d1-d3| in formula (11), A = ((t9-t2)-(t7-t3))ν + |d1-d3| in formula (13), and A = ((t2-t9)-(t3-t7))ν + |d1-d3| in formula (15). That is, A is the sum of the first distance and the second distance, and the right side of formula (12) or formula (14) or formula (16) can be recorded as B, that is, B = ||t9-t5|-|t6-t7||ν+|d2-d3| in formula (12), B = ((t9-t5)-(t7-t6))ν+|d2-d3| in formula (14), and B = ((t5-t9)-(t6-t7))ν+|d2-d3| in formula (16). That is, B is the sum of the second distance and the third distance.
[0259] Therefore, if formula (11) and formula (12) are solved, then A in the coordinates (x, y) of the second electronic device in method 800 is replaced by A=||t9-t2|-|t3-t7||ν+|d1-d3|, and B is replaced by B=||t9-t5|-|t6-t7||ν+|d2-d3|. If formula (13) and formula (14) are solved, then A in the coordinates (x, y) of the second electronic device in method 800 is replaced by A=((t9-t2)-(t7-t3))ν+|d1-d3|, and B is replaced by B=((t9-t5)-(t7-t6))ν+|d2-d3|. If equations (15) and (16) are solved, then A in the coordinates (x, y) of the second electronic device in method 800 is replaced by A = ((t2-t9)-(t3-t7))ν + |d1-d3|, and B is replaced by B = ((t5-t9)-(t6-t7))ν + |d2-d3|. In other words, A in method 1100 is different from A in method 800, and B in method 1100 is different from B in method 800. Therefore, the coordinates of the second electronic device calculated by method 800 are different from the coordinates of the second electronic device calculated by method 1100.
[0260] In the above embodiments, the second electronic device can be considered a point. That is, the coordinates of the second electronic device can be the coordinates of the fourth microphone of the second electronic device, or the coordinates of the fifth microphone of the second electronic device, or the coordinates of the second microphone of the second electronic device, or the coordinates of the third speaker of the second electronic device, etc. In other words, the coordinates of any microphone or speaker of the second electronic device are equivalent to the coordinates of the second electronic device. In some embodiments, the coordinates of the second electronic device can be the center point of the second electronic device. The physical dimensions of the second electronic device are known quantities, and the position of any microphone or speaker in the second electronic device can also be a known quantity.
[0261] An embodiment of determining the coordinates of the second electronic device as the center point of the second electronic device is described below.
[0262] The following describes step c) of step S650 in detail with reference to FIG. 12 . As shown in FIG. 12 , the method 1200 includes:
[0263] S1210: The first electronic device sends a first ultrasonic signal through a first speaker at a first moment, and a fourth microphone of the second electronic device receives the first ultrasonic signal at a third moment.
[0264] S1220: The first electronic device sends a second ultrasonic signal through the second speaker at a fourth moment, and the fifth microphone of the second electronic device receives the second ultrasonic signal at a sixth moment.
[0265] After S1210 and S1220, the second electronic device may perform S1230.
[0266] There is no restriction on the order between S1210 and S1220. S1210 can be performed before or after S1220, or simultaneously. If S1210 and S1220 are performed simultaneously, the first ultrasonic signal is different from the second ultrasonic signal.
[0267] Optionally, before S1210 and S1220, method 1200 may further include: the first electronic device determining whether the second electronic device is in the same space as the first electronic device; if the first electronic device determines that the second electronic device is in the same space as the first electronic device, S1210 and S1220 may be executed; otherwise, S1210 and S1220 are not executed. The method by which the first electronic device determines whether the second electronic device is in the same space as the first electronic device is described in detail in method 900 to avoid redundancy.
[0268] S1230: The second electronic device sends a third ultrasonic signal through the third speaker at the seventh moment, the second electronic device receives the third ultrasonic signal through the second microphone at the eighth moment, and the first electronic device receives the third ultrasonic signal through the first microphone at the ninth moment.
[0269] Optionally, S1210 and S1220 may be before S1230 or after S1230, and this embodiment of the present application does not limit this. If S1210 and S1220 are before S1230, it means that the first electronic device first sends the first ultrasonic signal and the second ultrasonic signal, and the second electronic device can send the third ultrasonic signal after receiving the first ultrasonic signal and the second ultrasonic signal; if S1210 and S1220 are after S1230, it means that the second electronic device first sends the third ultrasonic signal, and the first electronic device can send the first ultrasonic signal and the second ultrasonic signal after receiving the third ultrasonic signal sent by the second electronic device.
[0270] S1240: The first electronic device obtains a difference between the third moment and the eighth moment.
[0271] At this time, the first time information in method 600 is used to indicate the difference between the third moment and the eighth moment.
[0272] Optionally, the second electronic device may send indication information indicating the difference between the third moment and the eighth moment to the first electronic device.
[0273] S1250: The first electronic device obtains a difference between the sixth moment and the eighth moment.
[0274] At this time, the second time information in method 600 is used to indicate the difference between the sixth moment and the eighth moment.
[0275] Optionally, the second electronic device may send indication information indicating the difference between the sixth moment and the eighth moment to the first electronic device.
[0276] S1260: The first electronic device determines a difference between the ninth moment and the first moment, and a difference between the ninth moment and the fourth moment.
[0277] The third time information in method 600 indicates the difference between the ninth moment and the first moment, and the fourth time information indicates the difference between the ninth moment and the fourth moment.
[0278] S1270, the first electronic device determines the location information of the second electronic device based on the difference between the third moment and the eighth moment, the difference between the sixth moment and the eighth moment, the difference between the ninth moment and the first moment, the difference between the ninth moment and the fourth moment, the distance from the third speaker to the second microphone, and the positions of the first speaker, the second speaker, and the first microphone in the first electronic device.
[0279] Optionally, S1270 includes: the first electronic device determines the position information of the second electronic device based on the difference between the eighth moment and the third moment, the difference between the eighth moment and the sixth moment, the difference between the ninth moment and the first moment, the difference between the ninth moment and the fourth moment, the distance from the third speaker to the second microphone, the propagation speed of the ultrasonic signal, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device.
[0280] Optionally, the first electronic device determines the position information of the second electronic device based on the difference between the eighth moment and the third moment, the difference between the eighth moment and the sixth moment, the difference between the ninth moment and the first moment, the difference between the ninth moment and the fourth moment, the distance from the third speaker to the second microphone, the propagation speed of the ultrasonic signal, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device, including: the first electronic device determines the position information of the second electronic device based on the absolute value of the difference between the eighth moment and the third moment, the absolute value of the difference between the eighth moment and the sixth moment, the absolute value of the difference between the ninth moment and the first moment, the absolute value of the difference between the ninth moment and the fourth moment, the distance from the third speaker to the second microphone, the propagation speed of the ultrasonic signal, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device.
[0281] The following describes a method in which a first electronic device determines location information of a second electronic device by way of example.
[0282] Among them, the first moment is t1, the third moment is t3, the fourth moment is t4, the sixth moment is t6, the eighth moment is t8, and the ninth moment is t9. For example, the coordinates of the first speaker of the first electronic device are (d1,0), the coordinates of the second speaker are (d2,0), and the coordinates of the first microphone are (d3,0), wherein the coordinates of the midpoint of the first speaker and the second speaker can be (0,0), the coordinates of the first speaker, the coordinates of the second speaker, and the coordinates of the first microphone can represent the position in the first electronic device. Among them, the first speaker can be understood as the left speaker, the second speaker can be understood as the right speaker, and the coordinates (x, y) of the center point of the second electronic device are the values to be solved. The coordinates of the third speaker of the second electronic device are (x+l1, y+l2), the coordinates of the distance from the second microphone of the second electronic device are (x+l3, y+l4), and the distance from the third speaker of the second electronic device to the second microphone of the second electronic device is The coordinates of the fourth microphone are (x+15, y+16), and the coordinates of the fifth microphone are (x+17, y+18). The coordinates of the third speaker, the fourth microphone, and the fifth microphone represent their positions in the second electronic device. The seventh distance from the first speaker to the fourth microphone of the second electronic device is D1, where The distance from the second speaker to the fifth microphone of the second electronic device is D2, where The distance between the third speaker of the second electronic device and the first microphone is D3, where: Then there are formulas (17) and (18).
[0283] If S1210 and S1220 can be performed before S1230, that is, the first electronic device sends the first ultrasonic signal and the second ultrasonic signal before the second electronic device sends the third ultrasonic signal, then formula (17) can be replaced by formula (19), and formula (18) can be replaced by formula (20).
[0284] If S1210 and S1220 can be performed after S1230, that is, the first electronic device sends the first ultrasonic signal and the second ultrasonic signal after the second electronic device sends the third ultrasonic signal, then formula (17) can be replaced by formula (21), and formula (18) can be replaced by formula (22).
[0285] Where ν is the propagation velocity of the ultrasonic signal. The right sides of formulas (17) to (22) are all known quantities. To simplify the description, the right side of formula (17) or formula (19) or formula (21) can be recorded as A, that is, in formula (17): In formula (19) In formula (21) That is, A is the sum of the seventh distance and the eighth distance, and the right side of formula (18) or formula (20) or formula (22) can be recorded as B, that is, In formula (20) In formula (22) That is, B is the sum of the eighth distance and the ninth distance.
[0286] Therefore, by transforming formula (17) or formula (19) or formula (21), formula (23) can be obtained, and by transforming formula (18), formula (20) or formula (22), formula (24) can be obtained.
[0287] Formula (23) and Formula (24) are two equations with two unknowns x and y, so they can be solved to obtain (x, y). For example, x and y can be solved by traversal. After the first electronic device determines the coordinates of the center point of the second electronic device, it can also determine the distance between the center points of the first electronic device and the second electronic device and / or the angle of the second electronic device relative to the center point of the first electronic device based on the coordinates of the center point of the second electronic device. For example, the distance from the center point of the two speakers of the first electronic device to the second electronic device is The angle from the second electronic device to the midpoint of the two speakers of the first electronic device is That is to say, the location information of the second electronic device may indicate at least one of the coordinates of the center point of the second electronic device, the angle from the center point of the second electronic device to the midpoint of the two speakers of the first electronic device, or the distance from the center point of the second electronic device to the midpoint of the two speakers of the first electronic device.
[0288] The method for solving the center point of the second electronic device in the three-dimensional coordinate system is similar to that in the two-dimensional coordinate system, and is not described in detail to avoid redundancy.
[0289] The following describes step d) in S650 in detail with reference to FIG. 13 . As shown in FIG. 13 , the method 1300 includes:
[0290] S1310: The first electronic device sends a first ultrasonic signal through a first speaker at a first moment, the first electronic device receives the first ultrasonic signal through a first microphone at a second moment, and a fourth microphone of the second electronic device receives the first ultrasonic signal at a third moment.
[0291] S1320: The first electronic device sends a second ultrasonic signal through the second speaker at a fourth moment, the first electronic device receives the second ultrasonic signal through the first microphone at a fifth moment, and the fifth microphone of the second electronic device receives the second ultrasonic signal at a sixth moment.
[0292] After S1310 and S1320, the second electronic device may perform S1330.
[0293] There is no restriction on the order between S1310 and S1320. S1310 can be performed before or after S1320, or simultaneously. If S1310 and S1320 are performed simultaneously, the first ultrasonic signal is different from the second ultrasonic signal.
[0294] Optionally, before S1310 and S1320, method 1300 may further include: the first electronic device determining whether the second electronic device is in the same space as the first electronic device; if the first electronic device determines that the second electronic device is in the same space as the first electronic device, S1310 and S1320 may be executed; otherwise, S1310 and S1320 are not executed. The method by which the first electronic device determines whether the second electronic device is in the same space as the first electronic device is described in method 800, and is not described in detail to avoid redundancy.
[0295] S1330: The second electronic device sends a third ultrasonic signal through the third speaker at the seventh moment, the second electronic device receives the third ultrasonic signal through the second microphone at the eighth moment, and the first electronic device receives the third ultrasonic signal through the first microphone at the ninth moment.
[0296] S1340: The first electronic device obtains a difference between the third moment and the eighth moment.
[0297] At this time, the first time information in method 600 is used to indicate the difference between the third moment and the eighth moment.
[0298] Optionally, the second electronic device may send indication information indicating the difference between the third moment and the eighth moment to the first electronic device.
[0299] S1350: The first electronic device obtains a difference between the sixth moment and the eighth moment.
[0300] At this time, the second time information in method 700 is used to indicate the difference between the sixth moment and the eighth moment.
[0301] Optionally, the second electronic device may send indication information indicating the difference between the sixth moment and the eighth moment to the first electronic device.
[0302] S1360: The first electronic device determines a difference between the ninth moment and the second moment, and a difference between the ninth moment and the fifth moment.
[0303] The third time information in method 700 indicates the difference between the ninth moment and the second moment, and the fourth time information indicates the difference between the ninth moment and the fifth moment.
[0304] S1370, the first electronic device determines the location information of the second electronic device based on the difference between the third moment and the eighth moment, the difference between the sixth moment and the eighth moment, the difference between the ninth moment and the second moment, the difference between the ninth moment and the fifth moment, the distance from the first speaker to the first microphone, the distance from the second speaker to the second microphone, the distance from the third speaker to the second microphone, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device, and the positions of the fourth microphone, the fifth microphone and the third speaker in the second electronic device.
[0305] Optionally, S1370 includes: the difference between the third moment and the eighth moment, the difference between the sixth moment and the eighth moment, the difference between the ninth moment and the second moment, the difference between the ninth moment and the fifth moment, the distance from the first speaker to the first microphone, the distance from the second speaker to the second microphone, the distance from the third speaker to the second microphone, the propagation speed of the ultrasonic signal, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device, and the positions of the fourth microphone, the fifth microphone and the third speaker in the second electronic device.
[0306] Optionally, the difference between the third moment and the eighth moment, the difference between the sixth moment and the eighth moment, the difference between the ninth moment and the second moment, the difference between the ninth moment and the fifth moment, the distance from the first speaker to the first microphone, the distance from the second speaker to the second microphone, the distance from the third speaker to the second microphone, the propagation speed of the ultrasonic signal, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device, and the positions of the fourth microphone, the fifth microphone and the third speaker in the second electronic device, include: the absolute value of the difference between the third moment and the eighth moment, the absolute value of the difference between the sixth moment and the eighth moment, the absolute value of the difference between the ninth moment and the second moment, the absolute value of the difference between the ninth moment and the fifth moment, the distance from the first speaker to the first microphone, the distance from the second speaker to the second microphone, the distance from the third speaker to the second microphone, the propagation speed of the ultrasonic signal, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device, and the positions of the fourth microphone, the fifth microphone and the third speaker in the second electronic device.
[0307] The following describes a method in which a first electronic device determines location information of a second electronic device by way of example.
[0308] Among them, the second moment is t2, the third moment is t3, the fifth moment is t5, the sixth moment is t6, the eighth moment is t8, and the ninth moment is t9. The coordinates of the first speaker of the first electronic device are (d1,0), the coordinates of the second speaker are (d2,0), and the coordinates of the first microphone are (d3,0), wherein the midpoint coordinates of the first speaker and the second speaker can be (0,0), the coordinates of the first speaker, the coordinates of the second speaker, and the coordinates of the first microphone can represent the position in the first electronic device. Among them, the first speaker can be understood as the left speaker, the second speaker can be understood as the right speaker, and the coordinates (x,y) of the center point of the second electronic device are the values to be solved. The coordinates of the third speaker of the second electronic device are (x+l1,y+l2), the coordinates of the distance of the second microphone of the second electronic device are (x+l3,y+l4), and the distance from the third speaker of the second electronic device to the second microphone of the second electronic device is The coordinates of the fourth microphone are (x+15, y+16), and the coordinates of the fifth microphone are (x+17, y+18). The coordinates of the third speaker, the fourth microphone, and the fifth microphone represent their positions in the second electronic device. The seventh distance from the first speaker to the fourth microphone of the second electronic device is D1, where The ninth distance from the second speaker to the fifth microphone of the second electronic device is D2, where An eighth distance from the third speaker of the second electronic device to the first microphone is D3, wherein, Then there are formulas (25) and (26).
[0309] If S1310 and S1320 can be performed before S1330, that is, the first electronic device sends the first ultrasonic signal and the second ultrasonic signal before the second electronic device sends the third ultrasonic signal, then formula (25) can be replaced by formula (27), and formula (26) can be replaced by formula (28).
[0310] If S1310 and S1320 can be performed after S1330, that is, the first electronic device sends the first ultrasonic signal and the second ultrasonic signal after the second electronic device sends the third ultrasonic signal, then formula (25) can be replaced by formula (29), and formula (26) can be replaced by formula (30).
[0311] Where ν is the propagation velocity of the ultrasonic signal. The right sides of formulas (25) to (30) are all known quantities. To simplify the description, the right side of formula (25) or formula (27) or formula (29) can be recorded as A, that is, In formula (27) In formula (29) That is, A is the sum of the seventh distance and the eighth distance, and the right side of formula (26) or formula (28) or formula (30) can be recorded as B, that is, In formula (28) In formula (30) That is, B is the sum of the eighth distance and the ninth distance. A in method 1300 is different from A in method 1200, and B in method 1300 is different from B in method 1200. Therefore, the coordinates of the second electronic device calculated by method 1300 are different from the coordinates of the second electronic device calculated by method 1300.
[0312] In the embodiment of the present application, "ultrasonic signal" can be replaced by "ultrasonic signal", or "sequence", or "ultrasonic sequence" and other terms, and the embodiment of the present application does not impose any limitations on this.
[0313] Based on the same inventive concept, an embodiment of the present application further provides an electronic device, including: a memory and a processor, the memory being used to store a computer program; the processor being used to execute the method described in the above method embodiment when calling the computer program.
[0314] The electronic device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effects are similar, which will not be repeated here.
[0315] Based on the same inventive concept, an embodiment of the present application further provides a chip system, which includes a processor coupled to a memory, and executes a computer program stored in the memory to implement the method described in the above method embodiment.
[0316] The chip system may be a single chip or a chip module composed of multiple chips.
[0317] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the method described in the above method embodiment when the computer program is executed by a processor.
[0318] An embodiment of the present application further provides a computer program product. When the computer program product is run on an electronic device, the electronic device implements the method described in the above method embodiment when executing the computer program product.
[0319] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may at least include: any entity or device capable of carrying computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk.
[0320] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0321] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0322] In the embodiments provided in this application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0323] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0324] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0325] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0326] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0327] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0328] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for determining location information, characterized in that include: The first electronic device sends a first ultrasonic signal through a first speaker; The first electronic device sends a second ultrasonic signal through a second speaker; The first electronic device receives, through the first microphone, a third ultrasonic signal sent by the second electronic device through the third speaker; The first electronic device acquires first time information and second time information, the first time information is used to indicate a time difference between a time when the second electronic device receives the first ultrasonic signal and a time when the second electronic device processes the third ultrasonic signal, and the second time information is used to indicate a time difference between a time when the second electronic device receives the second ultrasonic signal and a time when the second electronic device processes the third ultrasonic signal; wherein the time when the second electronic device processes the third ultrasonic signal includes: a time when the second electronic device sends the third ultrasonic signal through a third speaker or a time when the second electronic device receives the third ultrasonic signal through a second microphone; The first electronic device determines the position information of the second electronic device based on the first time information, the second time information, the third time information and the fourth time information, as well as the positions of the first speaker, the second speaker and the first microphone in the first electronic device, wherein the third time information is used to indicate the time difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first electronic device processes the first ultrasonic signal, and the fourth time information is used to indicate the time difference between the time when the first electronic device receives the third ultrasonic signal and the time when the first electronic device processes the second ultrasonic signal; wherein the time when the first electronic device processes the first ultrasonic signal includes: the time when the first electronic device sends the first ultrasonic signal through the first speaker or the time when the first electronic device receives the first ultrasonic signal through the first microphone; and the time when the first electronic device processes the second ultrasonic signal includes: the time when the first electronic device sends the second ultrasonic signal through the second speaker or the time when the first electronic device receives the second ultrasonic signal through the first microphone.
2. The method according to claim 1, characterized in that: The first electronic device determines the position information of the second electronic device according to the first time information, the second time information, the third time information and the fourth time information, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device, including: The first electronic device determines, according to the first time information and the third time information, a sum of a first distance and a second distance; the first distance is a distance between the first speaker and the second electronic device, and the second distance is a distance between the first microphone and the second electronic device; The first electronic device determines, according to the second time information and the fourth time information, a sum of a third distance and the second distance; the third distance is a distance between the second speaker and the second electronic device; The first electronic device determines the location information of the second electronic device according to the sum of the first distance and the second distance, the sum of the third distance and the second distance, and the locations of the first speaker, the second speaker, and the first microphone in the first electronic device.
3. The method according to claim 1, characterized in that: The first electronic device determines the position information of the second electronic device according to the first time information, the second time information, the third time information and the fourth time information, and the positions of the first speaker, the second speaker and the first microphone in the first electronic device, including: The first electronic device determines, according to the first time information, the third time information, and the distance between the first speaker and the first microphone, a sum of a first distance and a second distance; the first distance is the distance between the first speaker and the second electronic device, and the second distance is the distance between the first microphone and the second electronic device; The first electronic device determines, according to the second time information, the fourth time information, and the distance between the second speaker and the first microphone, a sum of a third distance and the second distance; the third distance being the distance between the second speaker and the second electronic device; The location information of the second electronic device is determined according to the sum of the first distance and the second distance, the sum of the third distance and the second distance, and the locations of the first speaker, the second speaker, and the first microphone in the first electronic device.
4. The method according to any one of claims 1 to 3, characterized in that The first electronic device acquires the first time information and the second time information, including: The first electronic device receives the first time information and the second time information from the second electronic device.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: receiving first identification information from the second electronic device, where the first identification information corresponds to the third ultrasonic signal; If the device identified by the first identification information is the second electronic device, the first electronic device determines that the third ultrasonic signal is sent by the second electronic device.
6. The method according to any one of claims 1 to 5, characterized in that The first ultrasonic signal is different from the second ultrasonic signal; or, the first ultrasonic signal is the same as the second ultrasonic signal, and the time when the first electronic device sends the first ultrasonic signal through the first speaker is different from the time when the first electronic device sends the second ultrasonic signal through the second speaker.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: The first electronic device receives, through the first microphone, a fourth ultrasonic signal sent by a fourth speaker of the third electronic device; The first electronic device acquires fifth time information and sixth time information, the fifth time information being used to indicate a time difference between a time when the third electronic device receives the first ultrasonic signal and a time when the third electronic device processes the fourth ultrasonic signal, and the sixth time information being used to indicate a time difference between a time when the third electronic device receives the second ultrasonic signal and a time when the third electronic device processes the fourth ultrasonic signal; wherein the time when the third electronic device processes the fourth ultrasonic signal includes: a time when the third electronic device sends the fourth ultrasonic signal through a third speaker or a time when a third microphone of the third electronic device receives the fourth ultrasonic signal; The first electronic device determines the position information of the third electronic device based on the fifth time information, the sixth time information, the seventh time information and the eighth time information, as well as the positions of the first speaker, the second speaker and the first microphone in the first electronic device, the seventh time information is used to indicate the time difference between the time when the first electronic device receives the fourth ultrasonic signal and the time when the first electronic device processes the first ultrasonic signal, the eighth time information is used to indicate the time difference between the time when the first electronic device receives the fourth ultrasonic signal and the time when the first electronic device transmits the second ultrasonic signal, the time when the first electronic device processes the first ultrasonic signal includes: the time when the first electronic device sends the first ultrasonic signal through the first speaker or the time when the first electronic device receives the first ultrasonic signal through the first microphone; the time when the first electronic device processes the second ultrasonic signal includes: the time when the first electronic device sends the second ultrasonic signal through the second speaker or the time when the first electronic device receives the second ultrasonic signal through the first microphone.
8. The method according to claim 7, characterized in that The first electronic device determines the location information of the third electronic device according to the fifth time information, the sixth time information, the seventh time information, and the eighth time information, and the locations of the first speaker, the second speaker, and the first microphone in the first electronic device, including: The first electronic device determines, according to the fifth time information and the seventh time information, a sum of a fourth distance and a fifth distance; the fourth distance is a distance between the first speaker and the third electronic device, and the fifth distance is a distance between the first microphone and the third electronic device; The first electronic device determines, according to the sixth time information and the eighth time information, a sum of a sixth distance and the fifth distance; the sixth distance is a distance between the second speaker and the third electronic device; The first electronic device determines the location information of the third electronic device according to the sum of the fourth distance and the fifth distance, the sum of the sixth distance and the fifth distance, and the locations of the first speaker, the second speaker, and the first microphone in the first electronic device.
9. The method according to claim 7, characterized in that: The first electronic device determines the location information of the third electronic device according to the fifth time information, the sixth time information, the seventh time information, and the eighth time information, and the locations of the first speaker, the second speaker, and the first microphone in the first electronic device, including: The first electronic device determines, according to the fifth time information, the seventh time information, and the distance between the first speaker and the first microphone, a sum of a fourth distance and a fifth distance; the fourth distance is the distance between the first speaker and the third electronic device, and the fifth distance is the distance between the first microphone and the third electronic device; The first electronic device determines the sum of a sixth distance and the fifth distance according to the sixth time information, the eighth time information, and the distance between the second speaker and the first microphone; the sixth distance is the distance between the second speaker and the third electronic device; According to the sum of the fourth distance and the fifth distance, the sum of the sixth distance and the fifth distance, and the first speaker The position information of the third electronic device is determined based on the positions of the second speaker, the second speaker and the first microphone in the first electronic device.
10. The method according to any one of claims 7 to 9, characterized in that The method further comprises: receiving second identification information from the third electronic device, where the second identification information corresponds to the fourth ultrasonic signal; If the device identified by the second identification information is the third electronic device, the first electronic device determines that the fourth ultrasonic signal is sent by the third electronic device.
11. The method according to any one of claims 7 to 10, characterized in that The method further comprises: The first electronic device allocates a channel to the third electronic device according to the location information of the third electronic device; or The first electronic device displays the location information of the third electronic device.
12. The method according to any one of claims 2 or 4 to 6 or 8 or 10 or 11, characterized in that: The time when the first electronic device processes the first ultrasonic signal is: the time when the first electronic device sends the first ultrasonic signal through the first speaker; The time when the first electronic device processes the second ultrasonic signal is: the time when the first electronic device sends the second ultrasonic signal through the second speaker.
13. The method according to any one of claims 3 or 4 to 6 or 9 or 10 or 11, characterized in that The time when the first electronic device processes the first ultrasonic signal is: the time when the first electronic device receives the first ultrasonic signal through the first microphone; The time when the first electronic device processes the second ultrasonic signal is: the time when the first electronic device receives the second ultrasonic signal through the first microphone.
14. The method according to any one of claims 1 to 13, characterized in that The method further comprises: the first electronic device assigning a channel to the second electronic device according to the location information of the second electronic device; or The first electronic device displays the location information of the second electronic device.
15. The method according to any one of claims 1 to 14, characterized in that The first electronic device is a smart TV.
16. A method for determining location information, characterized in that include: The second electronic device receives the first ultrasonic signal from the first electronic device; The second electronic device receives a second ultrasonic signal from the first electronic device; The second electronic device sends a third ultrasonic signal through a third speaker; The second electronic device sends first time information and second time information to the first electronic device, the first time information is used to indicate the time difference between the time when the second electronic device receives the first ultrasonic signal and the time when the second electronic device processes the third ultrasonic signal, and the second time information is used to indicate the time difference between the time when the second electronic device receives the second ultrasonic signal and the time when the second electronic device processes the third ultrasonic signal; wherein the time when the second electronic device processes the third ultrasonic signal includes: the time when the second electronic device sends the third ultrasonic signal through the third speaker or the time when the second electronic device receives the third ultrasonic signal through the second microphone, and the first time information and the second time information are used to determine the location information of the second electronic device.
17. The method according to claim 16, characterized in that The second electronic device receives a first ultrasonic signal from the first electronic device, including: The second electronic device receives the first ultrasonic signal from the first electronic device through the fourth microphone; The second electronic device receives a second ultrasonic signal from the first electronic device, including: The second electronic device receives a second ultrasonic signal from the first electronic device through a fifth microphone; The third speaker is a speaker in the second electronic device corresponding to the fourth microphone and the fifth microphone.
18. An electronic device, characterized in that: include: A memory and a processor, wherein the memory is used to store a computer program; and the processor is used to cause the electronic device to execute the method as claimed in any one of claims 1 to 17 when calling the computer program.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 17 is implemented.
20. A chip, characterized in that: The method comprises a processor connected to a memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the method according to any one of claims 1 to 17.
21. A computer program product, characterized in that When the computer program product is executed on an electronic device, the electronic device is caused to execute the method according to any one of claims 1 to 17.
Citation Information
Patent Citations
Electronic device, peripheral devices and control method therefor
CN107873136A
Parameter configuration method and system
CN108882139A
Positioning method of wearable device, host device and computer readable storage medium
CN113055870A
Device interaction method, position determination method, electronic device and chip system
CN114895244A
Distance measurement method, distance measurement device and storage medium
CN115704889A
