Method and electronic device for determining location information
By sending and receiving ultrasonic signals, combined with time difference and internal device location information, the speaker position is automatically determined and channels are assigned, solving the problem of complex manual device position and role settings for users and improving the user experience.
Patent Information
- Application Number
- CN202310225172.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2024-08-30
AI Technical Summary
When multiple electronic devices work together, users need to manually set the position and role of each device to achieve specific functions. This is complicated and results in a poor user experience, especially when networking a large screen with speakers, where users need to manually assign audio channels.
The first electronic device sends ultrasonic signals and receives echo signals. By using 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, and then the sound channels are automatically allocated.
This reduces the need for users to know the device's location, simplifies the operation process, and improves the user experience.
Smart Images

Figure CN118566841A
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and more specifically to a method and an electronic device for determining location information in the field of electronic technology. Background Art
[0002] 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 location of each electronic device and manually set the role of each electronic device according to the location of the electronic device. Some functions can be achieved according to the different roles of each electronic device, which 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. Summary of the invention
[0003] The embodiments of the present application provide a method for determining location information and an electronic device, which can improve user experience and reduce operation complexity.
[0004] In a first aspect, a method for determining position information is provided, comprising: 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 acquires 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 according to the first time information and the second time information The position information of the second electronic device is determined based on the 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, 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.
[0005] In the above scheme, the first electronic device can send the first ultrasonic signal and the second ultrasonic signal through the first speaker and the second speaker respectively, and the second electronic device can also send the third ultrasonic signal through the third speaker. The first electronic device can determine the position information of the second electronic device by using 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, so as to avoid the user needing to know the position information of the second electronic device, which can improve the user experience and reduce the complexity of the operation. In the scenario where the large screen can play different audio signals through multiple speakers to achieve a stereo effect, the first electronic device can be a large screen, and the second electronic device can be a speaker. The large screen can determine the position of the speaker according to 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 allocate channels to the speakers according to the positions of the speakers, avoiding the need for the user to know the positions of each speaker and manually allocate channels according to the positions of each speaker, thereby improving the user experience and reducing the complexity.
[0006] Optionally, the time difference in the embodiment of the present application may be a positive value or a negative value.
[0007] 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.
[0008] 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.
[0009] 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 a negative value; 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 a positive value.
[0010] 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 a negative value; 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 a positive value.
[0011] 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.
[0012] 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.
[0013] 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.
[0014] Optionally, the distance between the first speaker and the second speaker is greater than a preset value.
[0015] 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.
[0016] Optionally, the first electronic device may be a smart TV.
[0017] Optionally, the first electronic device may be a smart screen.
[0018] Optionally, the second electronic device may be an audio playback device, such as a speaker.
[0019] 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 is different from the second ultrasonic signal, 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.
[0020] 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 recognize the first ultrasonic signal and the second ultrasonic signal.
[0021] In some possible implementations, the time for the first electronic device to process the first ultrasonic signal is: the time for the first electronic device to send the first ultrasonic signal through the first speaker; the time for the first electronic device to process the second ultrasonic signal is: the time for the first electronic device to send the second ultrasonic signal through the second speaker.
[0022] 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 a first distance and a 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 a third distance and a 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.
[0023] In the above scheme, 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 according to 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 according to the second time information and the fourth time information. The first electronic device can determine the location information of the second electronic device according to the sum of the two distances and the locations of the first speaker, the second speaker and the first microphone in the first electronic device, thereby avoiding the need for the user to know the location information of the second electronic device, improving the user experience and reducing the complexity of the operation.
[0024] 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.
[0025] In some possible implementations, 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.
[0026] 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 a first distance and a 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 a 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; the location information of the second electronic device is determined 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.
[0027] In the above scheme, 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 the two distances and the locations of the first speaker, the second speaker, and the first microphone in the first electronic device, thereby avoiding the need for the user to determine the location information of the second electronic device, thereby improving the user experience and reducing the complexity of the operation.
[0028] 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.
[0029] 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.
[0030] 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.
[0031] In some possible implementations, 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.
[0032] 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.
[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 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.
[0034] Optionally, the second electronic device may establish a Bluetooth channel with the first electronic device, and the first electronic device sends a first instruction to the second electronic device through the established Bluetooth channel, the first instruction is 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 ends 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 first recording file to the first electronic device. Optionally, it may be specified that the second electronic device sends the third ultrasonic signal after receiving the first ultrasonic signal and the second ultrasonic signal, or it may be specified that the first electronic device may 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, so that the first electronic device can determine the time to send the first ultrasonic signal and the second ultrasonic signal and the time range for receiving the third ultrasonic signal, and the first electronic device may instruct the second electronic device to record within the time range, so that the first recording file obtained by the second electronic device recording includes the first ultrasonic signal, the second ultrasonic signal and the third ultrasonic signal.
[0035] In some possible implementations, the method also 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.
[0036] 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. In this way, the situation where the first electronic device cannot determine which electronic device sent the third ultrasonic signal is avoided.
[0037] 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 through the first microphone. That is, the first electronic device can receive the first identification information and the third ultrasonic signal at the same time.
[0038] 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.
[0039] 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 situation where the second electronic device cannot 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.
[0040] 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 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: 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; the first electronic device acquires fifth time information and sixth time information according to the fifth time information, the sixth time information, the seventh time information and the eighth time information, and the first speaker 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.
[0041] 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, and 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, and 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 determining the efficiency of the position information of the electronic devices, especially when there are many electronic devices, which can better improve the efficiency.
[0042] 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.
[0043] 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.
[0044] 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 indicated by the seventh time information is a positive value.
[0045] 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, and 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, and ...
[0046] In some possible implementations, the time for the first electronic device to process the first ultrasonic signal is: the time for the first electronic device to send the first ultrasonic signal through the first speaker; the time for the first electronic device to process the second ultrasonic signal is: the time for the first electronic device to send the second ultrasonic signal through the second speaker.
[0047] 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, 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 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.
[0048] In the above scheme, 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 according to 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 according to 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 according to the sum of the two distances and the locations of the first speaker, the second speaker and the first microphone in 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 the complexity of the operation.
[0049] 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.
[0050] In some possible implementations, 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.
[0051] In some possible implementations, 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 the sum of the fourth distance and the fifth distance according to 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 the 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; the location information of the third electronic device is determined 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.
[0052] In the above scheme, 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 according to 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 according to 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 according to the sum of the two distances and the locations of the first speaker, the second speaker and the first microphone in the first electronic device, thereby avoiding the need for the user to determine the location information of the third electronic device, improving the user experience and reducing the complexity of the operation.
[0053] 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.
[0054] 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.
[0055] 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.
[0056] 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.
[0057] 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.
[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 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.
[0059] Optionally, the third electronic device may establish a Bluetooth channel with the first electronic device, and the first electronic device sends a second instruction to the third electronic device through the established Bluetooth channel, the second instruction is used to instruct the third electronic device to start recording, the third electronic device may start recording according to the second instruction, the third electronic device ends recording after receiving the first ultrasonic signal and the second ultrasonic signal and sending the fourth ultrasonic signal, and the third electronic device may send the obtained first recording file to the first electronic device. Optionally, it may be specified that the third electronic device sends the fourth ultrasonic signal after receiving the first ultrasonic signal and the second ultrasonic signal, or it may be specified that the first electronic device may send the first ultrasonic signal and the second ultrasonic signal after receiving the fourth ultrasonic signal sent by the third electronic device, that is, the time interval between the time when the third electronic device sends the fourth 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 third electronic device sends the fourth ultrasonic signal and the time when the first electronic device sends the second ultrasonic signal is fixed, so that the first electronic device can determine the time to send the first ultrasonic signal and the second ultrasonic signal and the time range to receive the fourth ultrasonic signal, and the first electronic device may instruct the third electronic device to record within the time range, so that the second recording file obtained by the third electronic device recording includes the first ultrasonic signal, the second ultrasonic signal and the fourth ultrasonic signal.
[0060] In some possible implementations, the method also 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, then the first electronic device determines that the fourth ultrasonic signal is sent by the third electronic device.
[0061] 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.
[0062] 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 through the first microphone. That is, the first electronic device can receive the second identification information and the fourth ultrasonic signal at the same time.
[0063] 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.
[0064] 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 situation where the third electronic device cannot 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.
[0065] 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.
[0066] 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.
[0067] 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 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, and the first time information and the second time information are used to determine the position information of the second electronic device.
[0068] 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.
[0069] 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.
[0070] In some possible implementations, the second electronic device receives the first ultrasonic signal from the first electronic device, including: the second electronic device receives the first ultrasonic signal from the first electronic device through a fourth microphone; the second electronic device receives the second ultrasonic signal from the first electronic device, including: the second electronic device receives the second ultrasonic signal from the first electronic device through a fifth microphone;
[0071] The third speaker is a speaker in the second electronic device corresponding to the fourth microphone and the fifth microphone.
[0072] 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.
[0073] In a third aspect, an embodiment of the present application provides a device for determining location information, which has the function of implementing any one of the first aspect or any one of the second aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions. For example, a transceiver module or unit, a processing module or unit, an acquisition module or unit, etc.
[0074] 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.
[0075] 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.
[0076] The chip system may be a single chip or a chip module composed of multiple chips.
[0077] 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.
[0078] In a seventh aspect, an embodiment of the present application provides a computer program product. When the computer program product runs 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.
[0079] 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
[0080] Figure 1 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0081] Figure 2 It is a schematic diagram of the scene between the speaker and the large screen provided in an embodiment of the present application.
[0082] Figure 3 This is a schematic diagram of a scene between another speaker and a large screen provided in an embodiment of the present application.
[0083] Figure 4 This is a method for allocating channels with user participation and configuration provided in an embodiment of the present application.
[0084] Figure 5 It is a schematic diagram of the user setting interface provided in an embodiment of the present application.
[0085] Figure 6 It is a schematic diagram of a method for determining location information provided in an embodiment of the present application.
[0086] Figure 7 It is a schematic diagram of another method for determining location information provided in an embodiment of the present application.
[0087] Figure 8 This is another schematic diagram of a method for determining location information provided in an embodiment of the present application.
[0088] Fig. 9 This is another schematic diagram of a method for determining location information provided in an embodiment of the present application.
[0089] Fig.10 This is another schematic diagram of a method for determining location information provided in an embodiment of the present application.
[0090] Fig.11 This is another schematic diagram of a method for determining location information provided in an embodiment of the present application.
[0091] Fig.12 This is another schematic diagram of a method for determining location information provided in an embodiment of the present application.
[0092] Fig.13 This is another schematic diagram of a method for determining location information provided in an embodiment of the present application. DETAILED DESCRIPTION
[0093] The technical solutions in the embodiments of the present application will be described clearly and in detail below 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 of associated 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.
[0094] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0095] Figure 1 1 is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may include a processor 110, a memory 120, a communication module 130, a display screen 140 and a peripheral device 150, wherein the peripheral device 150 includes a speaker 151, a speaker 152 and a microphone 153.
[0096] 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.
[0097] 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. Exemplarily, 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.
[0098] 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 technology (NFC) module, etc., and can achieve interaction between the electronic device 100 and other electronic devices in a variety of different ways.
[0099] The display screen 140 can display images or videos in the human-computer interaction interface.
[0100] 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 called "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 speakers 151 and 152. In some embodiments, the speakers 151 and the speakers 152 are used to send ultrasonic signals, for example, the speaker 151 can send a first ultrasonic signal, and the speaker 2 can send a first 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 may be the first speaker in the embodiment of the present application, and the speaker 152 may be the second speaker in the embodiment of the present application. In some embodiments, the electronic device 100 may include multiple speakers.
[0101] Microphone 153, also known as "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 make a sound by approaching the microphone 153 with his mouth 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 function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones to realize the collection of sound signals, noise reduction, identification of sound sources, and realization of directional recording functions. Optionally, the distance between the two microphones of the electronic device 100 is greater than a preset distance, for example, the preset distance is 2cm, 4cm, 6cm or 8cm or 10cm. 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 a second electronic device, or the microphone 153 can receive a fourth ultrasonic signal sent by a third electronic device.
[0102] For example, the electronic device 100 may be a television, a computer, or a projector.
[0103] 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.
[0104] It should be understood that, in addition to Figure 1 In addition to the various components or modules listed in the figure, the embodiment of the present application does not specifically limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure can be implemented in hardware, software, or a combination of software and hardware.
[0105] In some scenarios, multiple electronic devices can collaborate to achieve some functions. In the process of collaboration, users need to know the location of each electronic device and manually set the role of each electronic device according to the location of the electronic device. Some functions can be achieved according to the different roles of each electronic device, which places high demands on users and is complicated to operate.
[0106] 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.
[0107] For example, Figure 1 The electronic device 100 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 TV, a computer, or a projector. After placing multiple speakers, the user can set the channel corresponding to each speaker according to the position of the multiple speakers relative to the large screen in the display interface of the large screen. The multiple speakers play different audio signals from the large screen, thereby achieving a stereo effect. However, in this process, the user needs to roughly know the position of the multiple speakers and set them manually. The user needs to have certain knowledge of allocating channels, the operation is complicated, and the user experience is poor. Figure 2 As shown, the user needs to assign the left channel to the left speaker and the right channel to the right speaker on the display interface of the large screen. Specifically, the display interface of the large screen can display the identification of the left speaker, and the user assigns the left channel to the left speaker according to the identification of the left speaker. The display interface of the large screen can display the identification of the right speaker, and the user assigns the right channel to the right speaker according to the identification of the right speaker.
[0108] The following describes in detail how the user sets the channel.
[0109] like Figure 3 As shown in the figure, 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. Figure 4As shown, speaker 1 is powered on and 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 on the operation of establishing 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 as the left channel, for example Figure 5 As shown, 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 searches for the Bluetooth signal broadcast by speaker 2, the searched speaker 2 is displayed on the display interface of the large screen. The user clicks on the operation to establish a connection. 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 display interface of the large screen according to the position of speaker 2. The large screen receives the user's instruction to set speaker 2 to the left surround. For example, the user uses the remote control to select as Figure 5 The left surround shown completes the channel setting of speaker 2. The large screen sends an audio signal to speaker 2 through the established Bluetooth according to the left surround set by the user for speaker 2. Speaker 3 is powered on and broadcasts the Bluetooth signal. After the large screen searches for the Bluetooth signal broadcast by speaker 3, the searched speaker 3 is displayed on the display interface of the large screen. The user clicks the operation of establishing a connection. 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 display interface of the large screen according to the position of speaker 3. The large screen receives the user's instruction to set speaker 3 to the right channel. For example, the user selects the remote control Figure 6 The right channel shown completes the channel setting of speaker 3. The large screen sends an audio signal to speaker 3 according to the right channel set by the user for speaker 3. Speaker 4 is powered on and broadcasts a Bluetooth signal. After the large screen searches for the Bluetooth signal broadcast by speaker 4, the searched speaker 4 is displayed on the display interface of the large screen. The user clicks the operation of establishing 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 on the display interface of the large screen according to the position of speaker 4. The large screen receives the user's instruction to set speaker 4 as right surround. For example, the user selects the remote control Figure 6The right surround shown completes the setting of the channel of the speaker 4. The large screen sends a speaker signal to the speaker 4 through the established Bluetooth connection according to the right surround set by the user for the speaker 4. In other words, the user has to turn on each speaker in turn, and set the channel for each speaker according to the relative position relationship between each speaker and the large screen. The operation is complicated and the user experience is poor. Especially in the case of more speakers, the user needs to operate multiple times, and the user experience is poor. Alternatively, in some embodiments, the four speakers can be powered on at the same time, and the user can allocate channels to the four speakers respectively on the display interface of the large screen, but in such a scenario, the identification of the four speakers needs to be displayed simultaneously in 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, that is, this has high requirements for the user, and the user needs to know the identification of different speakers in different positions, so as to set different channels for the speakers in different positions, and the user also needs to set it multiple times, and the user experience is poor.
[0110] It should be noted that Figure 1 The electronic device 100 may be the first electronic device in the embodiment of the present application, or Figure 1 The electronic device 100 may be the second electronic device in the embodiment of the present application, or Figure 1 The electronic device 100 may be the third electronic device in the embodiment of the present application.
[0111] In an embodiment of the present application, the first electronic device may send the first ultrasonic signal and the second ultrasonic signal through the first speaker and the second speaker respectively, and the second electronic device may also send the third ultrasonic signal. The first electronic device may determine the position information of the second electronic device by using 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 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, so as to avoid the user needing to know the position information of the second electronic device, thereby improving the user experience and reducing the complexity of the 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 a large screen, and the second electronic device can be a 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 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.
[0112] Combine the following Figure 6 Describe the method 600 for determining location information in an embodiment of the present application, such as Figure 6 As shown, the method 600 includes:
[0113] S610: The first electronic device sends a first ultrasonic signal through a first speaker, and the second electronic device receives the first ultrasonic signal.
[0114] Optionally, the first electronic device may record a first moment when the first ultrasonic signal is sent through the first speaker.
[0115] 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 a second moment when the first ultrasonic signal is received through the first microphone.
[0116] Optionally, the first electronic device may be a large screen, and the second electronic device may be a speaker.
[0117] Optionally, the second electronic device may record a third time when the first ultrasonic signal is received. Optionally, the second electronic device may receive the first ultrasonic signal through a fourth microphone, and the second electronic device may record a third time when the first ultrasonic signal is received through the fourth microphone.
[0118] S620: The first electronic device sends a second ultrasonic signal through the second speaker, and the second electronic device receives the second ultrasonic signal.
[0119] Optionally, the first electronic device may record a fourth moment when the second ultrasonic signal is sent through the second speaker.
[0120] 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 a fifth moment when the second ultrasonic signal is received through the first microphone.
[0121] Optionally, the second electronic device may record the 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 the sixth moment of receiving the second ultrasonic signal through the fifth microphone.
[0122] Optionally, before S610 and S620, the first electronic device may pre-configure the first ultrasonic signal and the second ultrasonic signal 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 sent by the first electronic device to the second electronic device through the established Bluetooth channel.
[0123] Optionally, S610 may be before or after S620, and the first ultrasonic signal and the second ultrasonic signal may be the same or different.
[0124] 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.
[0125] 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.
[0126] Optionally, the second electronic device may send a third ultrasonic signal through a third speaker, and the second microphone of the second electronic device may receive the third ultrasonic signal. Optionally, after the second electronic device sends the third ultrasonic signal through the third speaker, the seventh moment when the second electronic device sends the third ultrasonic signal may be recorded, and after the second microphone of the second electronic device receives the third ultrasonic signal, the eighth moment when the second microphone of the second electronic device receives the third ultrasonic signal may be recorded.
[0127] 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.
[0128] 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.
[0129] Optionally, before S630, the first electronic device may pre-configure the second electronic device to send 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 first electronic device to send a third ultrasonic signal to the second electronic device through the established Bluetooth channel.
[0130] 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 is 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.
[0131] Optionally, S610 and S620 may be before or after S630, or S630 may be between S610 and S620, which is not limited in the embodiment of the present application.
[0132] S640: The first electronic device obtains first time information and second time information.
[0133] 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.
[0134] The time for the second electronic device to process the third ultrasonic signal is described below in two cases.
[0135] Case 1: 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, 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.
[0136] 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 through 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 through the second microphone. For example, 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 through 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, 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 time difference between the third moment and the eighth moment indicated by the first time information is a negative value; for another example, 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 third moment and the eighth moment indicated by the first time information are positive values. 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, 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. Then the time difference between the sixth moment and the eighth moment indicated by the second time information is a negative value. For another example, 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. Then the time difference between the sixth moment and the eighth moment indicated by the second time information is a positive value.
[0137] 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.
[0138] Optionally, S640 includes: the second electronic device can send a first recording file to the first electronic device, the first recording file includes a first ultrasonic signal, a second ultrasonic signal and a third ultrasonic signal, and the first electronic device can determine the first time information and the second time information according to the first recording file. Optionally, before S610, the second electronic device can establish a Bluetooth channel with the first electronic device, and the first electronic device sends a first instruction to the second electronic device through the established Bluetooth channel, the first instruction is used to instruct the second electronic device to start recording, the second electronic device can start recording according to the first instruction, the second electronic device ends recording after receiving the first ultrasonic signal and the second ultrasonic signal and sending the third ultrasonic signal, and the second electronic device can 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, so that the first electronic device can determine the time to send the first ultrasonic signal and the second ultrasonic signal and the time range for receiving the third ultrasonic signal, and 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.
[0139] Optionally, before S630, the first electronic device may learn 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.
[0140] 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.
[0141] Optionally, S650 may include: the first electronic device determines the location information of the second electronic device according to the first time information, the second time information, the third time information, the fourth time information, the locations of the first speaker, the second speaker and the first microphone in the first electronic device, and the location of the device of the second electronic device in the second electronic device. Optionally, the device of the second electronic device may include at least one of the second microphone, the fourth microphone, the fifth microphone or the third speaker, that is, in the process of determining the location of the second electronic device, the first electronic device may determine the location of the second electronic device not only according to the location of the device of the first electronic device in the first electronic device, but also according to the location of the device of the second electronic device in the second electronic device.
[0142] 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.
[0143] The time for the first electronic device to process the first ultrasonic signal is described below in two cases.
[0144] 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, 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, the first electronic device sends the first ultrasonic signal through the first speaker before the first electronic device receives the third ultrasonic signal, and the time difference between the ninth moment and the first moment indicated by the third time information is a positive value; for another example, 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.
[0145] 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, 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, 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, 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.
[0146] The time for the first electronic device to process the second ultrasonic signal is described below in two cases.
[0147] In case 1, 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, 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, the first electronic device sends the second ultrasonic signal through the second speaker before the first electronic device receives the third ultrasonic signal. The time difference between the ninth moment and the fourth moment indicated by the fourth time information is a positive value; for another example, the first electronic device sends the second ultrasonic signal through the second speaker after the first electronic device receives the third ultrasonic signal. The fourth time information is used to indicate that the time difference between the ninth moment and the fourth moment is a negative value.
[0148] 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, 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, 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, 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.
[0149] Optionally, the location information of the second electronic device may indicate the coordinates of the second electronic device.
[0150] Optionally, the location information of the second electronic device may indicate an angle of the second electronic device.
[0151] Optionally, the location information of the second electronic device may indicate the distance between the second electronic device and the first electronic device.
[0152] Optionally, the location information of the second electronic device may indicate an angle of the second electronic device and a distance between the second electronic device and the first electronic device.
[0153] S650 is described below in four cases according to the time when the first electronic device processes the first ultrasonic signal, the time when the first electronic device processes the second ultrasonic signal, and the time when the second electronic device processes the third ultrasonic signal.
[0154] a), the time taken by the first electronic device to process the first ultrasonic signal is the description of case one, the time taken by the first electronic device to process the second ultrasonic signal is the description of case one, and the time taken by the second electronic device to process the third ultrasonic signal is the description of case one.
[0155] That is to say, 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.
[0156] Optionally, in a), S650 includes: the first electronic device determines the sum of the first distance and the second distance according to 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 according to 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 position 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 positions of the first speaker, the second speaker and the first microphone in the first electronic device. Among them, the first distance, the second distance and the third distance can be unknown quantities, that is, the first electronic device can determine the specific values of the first distance, the second distance and the third distance, but the first electronic device can determine the sum of the first distance and the second distance, and the sum of the second distance and the third distance.
[0157] Optionally, the first electronic device determines the sum of the first distance and the second distance according to the first time information and the third time information, including: the first electronic device determines the sum of the first distance and the second distance according to the first time information, the third time information and the propagation speed of the ultrasonic signal. The first electronic device determines the sum of the second distance and the third distance according to the second time information and the fourth time information, including: the first electronic device determines the sum of the second distance and the third distance according to the second time information, the fourth time information and the propagation speed of the ultrasonic signal.
[0158] 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 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, then 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, then 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 sends the third ultrasonic signal, then 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 sends the third ultrasonic signal, then 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 t1. 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 t9-t1 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, 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 sends 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 sends 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 according to 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 according to 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 according to t3-t7, t9-t1, and ν, and determine the sum of the second distance and the third distance according to t6-t7, t9-t4, and ν. Wherein, ν is the propagation speed of the ultrasonic signal.
[0159] b) The time taken by the first electronic device to process the first ultrasonic signal is the description of case two, the time taken by the first electronic device to process the second ultrasonic signal is the description of case two, and the time taken by the second electronic device to process the third ultrasonic signal is the description of case one.
[0160] 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 according to 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 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, 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 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.
[0161] Optionally, S650 includes: the first electronic device determines the sum of the first distance and the second distance according to 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 according to 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; according to 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 is determined. Among them, the first distance, the second distance and the third distance can be unknown quantities, that is, the first electronic device can determine the specific values of the first distance, the second distance and the third distance, but the first electronic device can determine the sum of the first distance and the second distance, and the sum of the second distance and the third distance.
[0162] Optionally, the first electronic device determines the sum of the first distance and the second distance according to 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 according to 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 according to 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 according to 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.
[0163] 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, then t3-t7 indicated by the first time information is a negative value, and if the second electronic device receives the first ultrasonic signal after the second electronic device sends the third ultrasonic signal, then 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 sends the third ultrasonic signal, 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 sends the third ultrasonic signal, 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 sent by the first speaker of the first electronic device through the first microphone before the first electronic device receives the third ultrasonic signal, t9-t2 indicated by the third time information is a positive value. For another example, if the first electronic device receives the first ultrasonic signal sent by the first speaker of the first electronic device through the first microphone after the first electronic device receives the third ultrasonic signal, 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 sent 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 sent 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 according to 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 according to t3-t7, t9-t2, ν, and |d1-d3|, the first electronic device may determine the sum of the second distance and the third distance according to t6-t7, t9-t5, and |d2-d3|, the first electronic device may determine the location information of the second electronic device according to 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).
[0164] c) The time taken by the first electronic device to process the first ultrasonic signal is the description of case one, the time taken by the first electronic device to process the second ultrasonic signal is the description of case one, and the time taken by the second electronic device to process the third ultrasonic signal is the description of case two.
[0165] 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 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 receives the third ultrasonic signal sent by the second electronic device through the third speaker through the second microphone. At this time, S650 includes: 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, 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 determines the position information of the second electronic device according to 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, including: 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, 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.
[0166] Optionally, in c), S650 includes: the first electronic device determines the sum of the seventh distance and the eighth distance according to the first time information, the third time information and the distance from the second microphone to the third speaker; the seventh distance is the distance between the first speaker and the fourth microphone of the second electronic device, and the eighth distance is the distance between the third speaker of the second electronic device and the first microphone; the first electronic device determines the sum of the eighth distance and the ninth distance according to the second time information, the fourth time information and the distance from the second microphone to the third speaker; the ninth distance is the distance between the second speaker and the fifth microphone of the second electronic device; the first electronic device determines the position information of the second electronic device according to 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. Among them, the seventh distance, the eighth distance and the ninth distance can be unknown quantities, that is, the first electronic device can determine the specific values of the seventh distance, the eighth distance and the ninth distance, but the first electronic device can determine the sum of the seventh distance and the eighth distance, and the sum of the eighth distance and the ninth distance.
[0167] Optionally, the first electronic device determines the sum of the seventh distance and the eighth distance according to 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 according to 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 according to 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 according to 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.
[0168] 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, and 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 t3-t8 indicated by the first time information is a negative value, and 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 sends the third ultrasonic signal, the t6-t8 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 sends the third ultrasonic signal, the t6-t8 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 sends 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 sends 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 sends 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 t9-t4 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, the t9-t4 indicated by the fourth time information is a negative value. 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), 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) is an unknown quantity. 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,
[0169] The sum of the nine distances, determines the location information of the second electronic device 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.
[0170] d) The time when the first electronic device processes the first ultrasonic signal is the description of case two, the time when the first electronic device processes the second ultrasonic signal is the description of case two, and the time when the second electronic device processes the third ultrasonic signal is the description of case two.
[0171] 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 through the second microphone. At this time, S650 includes: 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, 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.
[0172] Optionally, in d), S650 includes: the first electronic device determines the sum of the seventh distance and the eighth distance according to 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 seventh distance is the distance between the first speaker and the fourth microphone of the second electronic device, and the eighth distance is the distance between the third speaker of the second electronic device and the first microphone; the first electronic device determines the sum of the eighth distance and the ninth distance according to 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 ninth distance is the distance between the second speaker and the fifth microphone of the second electronic device; the first electronic device determines the position information of the second electronic device according to 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. Among them, the seventh distance, the eighth distance and the ninth distance can be unknown quantities, that is, the first electronic device can not determine the specific values of the seventh distance, the eighth distance and the ninth distance, but the first electronic device can determine the sum of the seventh distance and the eighth distance, and the sum of the eighth distance and the ninth distance.
[0173] Optionally, the first electronic device determines the sum of the seventh distance and the eighth distance according to 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 according to 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 according to 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 according to 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.
[0174] 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 sent by the second electronic device through the third speaker through the second microphone, then t6-t8 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 receives the third ultrasonic signal sent by the second electronic device through the third speaker through the second microphone, then t6-t8 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 sent by the first speaker of the first electronic device through the first microphone before the first electronic device receives the third ultrasonic signal, then t9-t2 indicated by the third time information is a positive value. For another example, if the first electronic device receives the first ultrasonic signal sent by the first speaker of the first electronic device through the first microphone after the first electronic device receives the third ultrasonic signal, then 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 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), the coordinates of the distance of 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), 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|, and the distance from the second microphone of the second electronic device to the third speaker of the second electronic device is |d2-d3|. (x+l7, y+l8) determines 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-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, (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 determine the location information of the second electronic device.
[0175] 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.
[0176] 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.
[0177] 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 the location information of the second electronic device may be determined based on the signal quality of the ultrasonic signal. For example, microphone 1 of the first electronic device receives the third ultrasonic signal of the second electronic device, at which time the third time information is used to indicate the time difference between the time when microphone 1 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 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 position information of the second electronic device corresponding to the microphone 2 according to the position of the speaker and the microphone 1 in the first electronic device; the microphone 2 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 2 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 microphone 2 receives the third ultrasonic signal and the time when the first electronic device processes the second ultrasonic signal. The first electronic device can determine the position information of the second electronic device corresponding to the microphone 2 according to 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 the microphone 2 in the first electronic device. If the signal quality of the third ultrasonic signal received by the microphone 1 is higher than the signal quality of the third ultrasonic signal received by the microphone 2, the position information of the second electronic device corresponding to the microphone 1 is determined as the position information of the second electronic device. That is, after the first electronic device sends the first ultrasonic signal and the second ultrasonic signal once, the multiple microphones of the first electronic device can receive the third ultrasonic signal sent by the second electronic device, and the first electronic device can calculate the position information of the second electronic device once for each microphone, that is, the values of the ninth moment of different microphones in the method 600 are different, which may result in different calculated position information of the second electronic device.
[0178] In some embodiments, the first electronic device may 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 may continue to send a fifth ultrasonic signal to the third electronic device through the first speaker, send a sixth ultrasonic signal to the third electronic device through the second speaker, and the third electronic device may then send a seventh ultrasonic signal to the first electronic device, and the first electronic device may determine the location information of the third electronic device based on a method similar to method 600. For example, the first electronic device may allocate channels to each electronic device according to the location information of the multiple electronic devices.
[0179] In some embodiments, the first electronic device can determine the location information of multiple electronic devices, the first electronic device can send a first ultrasonic signal and a second ultrasonic signal, the second electronic device and the third electronic device can both receive the first ultrasonic signal and the second ultrasonic signal, then the second electronic device sends a fourth ultrasonic signal, and the third electronic device sends a fifth ultrasonic signal. The first electronic device can determine the location information of the second electronic device based on method 600, and a method similar to method 600 can also determine the location information of the second electronic device. Figure 7 The method 700 in FIG. 700 describes this embodiment, as shown in FIG. Figure 7 As shown, the method 700 includes:
[0180] 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.
[0181] Optionally, the first electronic device sending the first ultrasonic signal may refer to the description of S610.
[0182] Optionally, the third electronic device receiving the first ultrasonic signal is similar to the second electronic device receiving the first ultrasonic signal, and reference may be made to the description of S610.
[0183] 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.
[0184] Optionally, the first electronic device sending the second ultrasonic signal may refer to the description of S620.
[0185] Optionally, the third electronic device receiving the second ultrasonic signal is similar to the second electronic device receiving the first ultrasonic signal, and reference may be made to the description of S620.
[0186] S730a, same as S630.
[0187] S730b: The third electronic device sends a fourth ultrasonic signal, and the first electronic device receives the fourth ultrasonic signal.
[0188] The way in which the third electronic device sends the fourth ultrasonic signal is similar to the way in which the second electronic device sends the third ultrasonic signal, and reference may be made to the description of S630 , which will not be described in detail to avoid redundancy.
[0189] S740a, same as S640.
[0190] S740b: The first electronic device obtains fifth time information and sixth time information.
[0191] 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.
[0192] 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.
[0193] S750a, same as S650.
[0194] S750b: The first electronic device determines location information of the third electronic device according to the fifth time information, the sixth time information, the seventh time information, the eighth time information, and locations of the first speaker, the second speaker, and the first microphone in the first electronic device.
[0195] 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.
[0196] 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 according to 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 according to 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 according to the distances of the four speakers to 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 according to the angles of the four speakers relative to the large screen, and then the large screen sets the speakers closer to the left as the left channel, the speakers farther away from the left as the left surround, the speakers closer to the right as the right channel, and the speakers farther away from the right as the right surround.
[0197] In order to better illustrate the above method embodiment, Figure 8-Figure 13 A specific description is given, wherein the process described below is described by taking the first electronic device determining the location information of the second electronic device as an example, and the first electronic device determining the location information of other electronic devices, such as the first electronic device determining the location information of the third electronic device is similar to determining the location information of the second electronic device, in order to avoid redundancy, no detailed description is given. Figures 8 to 10 is a detailed description of a) in S650, Fig.11 is a detailed description of b) in S650, Fig.12 is a detailed description of c) in S650, Fig.13 is a detailed description of d) in S650. Figure 8 As shown, method 800 includes:
[0198] 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.
[0199] 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.
[0200] After S810 and S820, the second electronic device may perform S830.
[0201] 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.
[0202] 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.
[0203] 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 attenuation of the ultrasonic signal due to the obstruction of the wall is 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 means that the first electronic device and the second electronic device are not in the same space. Optionally, the first electronic device may 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.
[0204] 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 obtain P B , W B is the Bluetooth attenuation coefficient caused by the wall, and 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, because 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 Bluetooth signal of the first electronic device to the signal strength of the eighth ultrasonic signal is equal to This 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 value σ, 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. Optionally,
[0205] 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.
[0206] 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.
[0207] Optionally, S810 and S820 may be before S830 or S810 and S820 may be after S830, and the embodiments of the present application do 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.
[0208] S840: The first electronic device obtains a difference between the third time and the seventh time.
[0209] At this time, the first time information in method 600 is used to indicate the difference between the third moment and the seventh moment.
[0210] 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.
[0211] S850: The first electronic device obtains a difference between the sixth time and the seventh time.
[0212] At this time, the second time information in method 600 is used to indicate the difference between the sixth moment and the seventh moment.
[0213] 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.
[0214] 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.
[0215] 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.
[0216] 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.
[0217] 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.
[0218] 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.
[0219] The following describes a method in which a first electronic device determines location information of a second electronic device by way of example.
[0220] 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. Fig. 9 As shown, 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 may be (0,0), and the coordinates of the first speaker, the coordinates of the second speaker, and the coordinates of the first microphone may represent the positions in the first electronic device. Among them, the first speaker may be understood as the left speaker, the second speaker may be understood as the right speaker, and the coordinates (x,y) of the second electronic device are values to be solved. The volume of the second electronic device is smaller than the volume of the first electronic device. For example, the volume of the second electronic device may 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 may 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. Fig. 9 As shown, the first distance from the first speaker to the second electronic device is Then there are formula (1) and formula (2)
[0221] D1+D3=||t9-t1|-|t3-t7||ν (1)
[0222] 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).
[0224] D1+D3=((t9-t1)-(t7-t3))ν (3)
[0225] D2+D3=((t9-t4)-(t7-t6))ν (4)
[0226] If S810 and S820 can be performed after S830, 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 (1) can be replaced by formula (5) and formula (2) can be replaced by formula (6).
[0227] D1+D3=((t1-t9)-(t3-t7))ν (5)
[0228] D2+D3=((t4-t9)-(t6-t7))ν (6)
[0229] Wherein, ν is the propagation speed 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 to say, A is the sum of the first distance and the second distance. The right side of formula (2) or formula (4) or formula (6) can be expressed 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 to say, B is the sum of the second distance and the third distance.
[0230] 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).
[0231]
[0232] Solving formula (7) and formula (8) yields (x, y), where: By substituting x into y, the value of y can be obtained. That is to say, if formula (1) is transformed into formula (7) and formula (2) is transformed into formula (8), then A = ||t9-t1|-|t3-t7||ν, 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))ν, 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))ν, 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 according to 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 between the second electronic device and 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 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 be determined, and the coordinates of the first microphone can also be determined.
[0233] The above is based on the two-dimensional coordinates as an example to derive 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 time is t1, the third time is t3, the fourth time is t4, the sixth time is t6, the seventh time is t7, and the eighth time is t9. Fig.10As shown, 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), wherein the heights of the first speaker and the second speaker are the same, which is 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), wherein 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 values to be solved, wherein 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 the volume 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, such as Fig.10 As shown, the first
[0234] Formula (9) can be obtained for formula (2) or formula (4) or formula (6) and formula (10).
[0235]
[0236] Solving formula (9) and formula (10) yields (x, y, 0), where:
[0237] Substituting x into y, the value of y can be obtained. 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 according to 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 between the second electronic device and 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 bottom midpoint of the first electronic device is used as the coordinate origin, the physical size of the first electronic device is a known quantity, the position of the first speaker in the first electronic device, the position of the second speaker and the position of the first microphone are also known quantities, so 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.
[0238] Combine the following Fig.11 S650 b) is described in detail. Fig.11 As shown, the method 1100 includes:
[0239] 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.
[0240] 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.
[0241] After S1110 and S1120, the second electronic device may perform S1130.
[0242] 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.
[0243] Optionally, before S1110 and S1120, method 1100 may further include: the first electronic device determines 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 method 900, which is not described in detail to avoid redundancy.
[0244] 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.
[0245] Optionally, S1110 and S1120 may be before S1130 or S1110 and S1120 may be after S1130, which is not limited in the embodiments 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.
[0246] S1140: The first electronic device obtains a difference between the third time and the seventh time.
[0247] At this time, the first time information in method 600 is used to indicate the difference between the third moment and the seventh moment.
[0248] 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.
[0249] S1150: The first electronic device obtains a difference between the sixth time and the seventh time.
[0250] At this time, the second time information in method 600 is used to indicate the difference between the sixth moment and the seventh moment.
[0251] 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.
[0252] 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.
[0253] 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.
[0254] 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.
[0255] Optionally, S1170 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 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.
[0256] 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.
[0257] The following describes a method in which a first electronic device determines location information of a second electronic device by way of example.
[0258] The second time is t2, the third time is t3, the fifth time is t5, the sixth time is t6, the seventh time is t7, and the ninth time is t9. Fig. 9 As shown, 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 may be (0,0), and the coordinates of the first speaker, the coordinates of the second speaker, and the coordinates of the first microphone may represent the positions in the first electronic device. Among them, the first speaker may be understood as the left speaker, the second speaker may be understood as the right speaker, and the coordinates (x,y) of the second electronic device are values to be solved. The volume of the second electronic device is smaller than the volume of the first electronic device. For example, the volume of the second electronic device may 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 may 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. Fig. 9As shown, the first distance from the first speaker to the second electronic device is D1. Then there are formula (11) and formula (12).
[0259] D1+D3=||t9-t2|-|t3-t7||ν+|d1-d3| (11)
[0260] D2+D3=||t9-t5|-|t6-t7||ν+|d2-d3| (12)
[0261] If S1110 and S1120 can be 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).
[0262] D1+D3=((t9-t2)-(t7-t3))ν+|d1-d3| (13)
[0263] D2+D3=((t9-t5)-(t7-t6))ν+|d2-d3| (14)
[0264] 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).
[0265] D1+D3=((t2-t9)-(t3-t7))ν+|d1-d3| (15)
[0266] D2+D3=((t5-t9)-(t6-t7))ν+|d2-d3| (16)
[0267] Wherein, ν is the propagation speed of the ultrasonic signal. The right sides of formula (11) to formula (16) are all known quantities. In order 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 to say, A is the sum of the first distance and the second distance. The right side of formula (12) or formula (14) or formula (16) can be expressed 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 to say, B is the sum of the second distance and the third distance.
[0268] Therefore, if the equations (11) and (12) are solved, the coordinates (x, y) of the second electronic device in the method 800 are replaced by A=||t9-t2|-|t3-t7||ν+|d1-d3|, and B is replaced by B=||t9-t5|-|t6-t7||ν+|d2-d3|. If the equations (13) and (14) are solved, the coordinates (x, y) of the second electronic device in the method 800 are replaced by A=((t9-t2)-(t7-t3))ν+|d1-d3|, and B is replaced by B=((t9-t5)-(t7-t6))ν+|d2-d3|. If formula (15) and formula (16) are solved, then A in the coordinate (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|. That is, 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.
[0269] In the above embodiment, the second electronic device can be regarded as 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., that is, the coordinates of any microphone or speaker of the second electronic device are equal 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 size of the second electronic device is a known quantity, and the position of any microphone or any speaker in the second electronic device can also be a known quantity.
[0270] An embodiment of determining the coordinates of the second electronic device as the center point of the second electronic device is described below.
[0271] Combine the following Fig.12 S650 c) is described in detail, wherein, Fig.12 As shown, the method 1200 includes:
[0272] 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.
[0273] 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.
[0274] After S1210 and S1220, the second electronic device may perform S1230.
[0275] 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.
[0276] Optionally, before S1210 and S1220, method 1200 may further include: the first electronic device determines 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 for the first electronic device to determine whether the second electronic device is in the same space as the first electronic device refers to the description of method 900, which is not described in detail to avoid redundancy.
[0277] 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.
[0278] Optionally, S1210 and S1220 may be before S1230 or S1210 and S1220 may be 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.
[0279] S1240: The first electronic device obtains a difference between the third moment and the eighth moment.
[0280] At this time, the first time information in method 600 is used to indicate the difference between the third moment and the eighth moment.
[0281] 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.
[0282] S1250: The first electronic device obtains a difference between the sixth moment and the eighth moment.
[0283] At this time, the second time information in method 600 is used to indicate the difference between the sixth moment and the eighth moment.
[0284] 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.
[0285] 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.
[0286] 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.
[0287] 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.
[0288] 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.
[0289] Optionally, the first electronic device determines the location 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 location 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.
[0290] The following describes a method in which a first electronic device determines location information of a second electronic device by way of example.
[0291] 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 midpoint coordinates of the first speaker and the second speaker may be (0,0), and the coordinates of the first speaker, the coordinates of the second speaker, and the coordinates of the first microphone may represent the position in the first electronic device. Among them, the first speaker may be understood as the left speaker, the second speaker may 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
[0292]
[0293] If S1210 and S1220 can be 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).
[0294]
[0295]
[0296] 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).
[0297]
[0298]
[0299] Wherein, ν is the propagation speed of the ultrasonic signal. The right sides of formula (17) to formula (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): The right side of (18) or (20) or (22) can be denoted as B, that is,
[0300] 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.
[0301]
[0302]
[0303] Formula (23) and Formula (24) are two equations with two unknowns x and y, so (x, y) can be solved. 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 between the second electronic device and 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.
[0304] 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 will not be described in detail to avoid redundancy.
[0305] Combine the following Fig.13 S650 d) is described in detail, wherein, Fig.13 As shown, the method 1300 includes:
[0306] 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.
[0307] 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.
[0308] After S1310 and S1320, the second electronic device may perform S1330.
[0309] 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.
[0310] Optionally, before S1310 and S1320, method 1300 may further include: the first electronic device determines 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 for the first electronic device to determine whether the second electronic device is in the same space as the first electronic device refers to the description of method 800, which is not described in detail to avoid redundancy.
[0311] 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.
[0312] S1340: The first electronic device obtains a difference between the third moment and the eighth moment.
[0313] At this time, the first time information in method 600 is used to indicate the difference between the third moment and the eighth moment.
[0314] 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.
[0315] S1350: The first electronic device obtains a difference between the sixth moment and the eighth moment.
[0316] At this time, the second time information in method 700 is used to indicate the difference between the sixth moment and the eighth moment.
[0317] 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.
[0318] 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.
[0319] 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.
[0320] 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.
[0321] 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.
[0322] 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.
[0323] The following describes a method in which a first electronic device determines location information of a second electronic device by way of example.
[0324] 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), and 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
[0325] If S1310 and S1320 can be 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).
[0326]
[0327] 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).
[0328]
[0329] Wherein, ν is the propagation velocity of the ultrasonic signal. The right sides of formula (25) to formula (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, And, the right side of formula (26) or formula (28) or formula (30) can be recorded as B, that is, A in method 1300 is different from A in method 1200 , and B in method 1300 is different from B in method 1200 , so 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 .
[0330] 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 limitation on this.
[0331] 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.
[0332] The electronic device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0333] 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 the processor executes a computer program stored in the memory to implement the method described in the above method embodiment.
[0334] The chip system may be a single chip or a chip module composed of multiple chips.
[0335] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method described in the above method embodiment is implemented.
[0336] The embodiment of the present application also 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.
[0337] 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, which can be completed 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 the processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code 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 that can carry the computer program code to the camera / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk.
[0338] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0339] Those of ordinary skill 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 to be beyond the scope of this application.
[0340] In the embodiments provided in the present 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 only a logical function division, and there may be other division methods in actual implementation, 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.
[0341] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0342] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0343] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" 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 "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0344] 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.
[0345] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0346] 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 it. 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 replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate 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; The location information of the third electronic device is determined 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.
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
Cited By
Method for determining location information and electronic device
EP4660659A1
