Method for determining location, electronic device, and chip system
By interacting with sound wave signals from speakers and microphones, the relative position of electronic devices is automatically identified, solving the problems of cumbersome operation and increased costs in existing technologies. This enables position determination without user intervention and improves the collaborative use experience of devices.
Patent Information
- Application Number
- PCT/CN2024/078814
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-31
- Filing Date
- 2024-02-27
- Publication Date
- 2024-10-03
AI Technical Summary
Existing technologies typically require users to manually input information or add additional measuring units when determining the relative position information between multiple electronic devices, leading to cumbersome operation or increased costs.
By using the speakers and microphones of two electronic devices to send and receive sound wave signals, the relative position information between the devices is automatically determined, including the four directions of front, back, left, and right. Ultrasonic signals are used in combination with the relevant peak amplitude and time difference received by the microphone to achieve automatic identification without user intervention.
Without increasing costs, it can automatically identify the relative positions of electronic devices, simplify user operations, enhance the degree of collaboration between devices, and expand usage scenarios.
Smart Images

Figure CN2024078814_03102024_PF_FP_ABST
Abstract
Description
Position determination method, electronic device, and chip system
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 31, 2023, with application number 202310364427.9 and application name “A Position Determination Method, Electronic Device and Chip System”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of terminal technology, and in particular to a location determination method, electronic device, and chip system. Background Art
[0003] As the types and number of electronic devices continue to increase, the demand for interaction between multiple electronic devices is increasing. When establishing interaction between multiple electronic devices, it is usually necessary to determine the relative position information between each electronic device and then implement the interaction between the multiple electronic devices based on the relative position information.
[0004] At present, the relative position information between multiple electronic devices is determined mainly based on the user's visual judgment or based on the addition of corresponding measurement units on the electronic devices for measurement and judgment. Among them, when judging the left-right or up-down relative orientation of two electronic devices based on the user's visual judgment, it is usually necessary for the user to manually input the judgment result into each electronic device, which makes the user operation cumbersome and the user experience poor. When adding a dedicated measurement unit to the electronic device for measurement and judgment, it is necessary to increase the peripherals of the electronic device, thereby increasing the production cost of the electronic device. Therefore, how to realize the automatic determination of relative position information between multiple electronic devices without the need for user participation and without increasing additional costs has become a problem that needs to be solved urgently.
[0005] Summary of the Invention
[0006] The present application provides a position determination method, electronic device and chip system, which can automatically determine the front, back, left and right relative position information between multiple electronic devices without user participation and without adding additional costs.
[0007] To achieve the above objectives, the present invention adopts the following technical solutions:
[0008] In a first aspect, a position determination method is provided, which is applied to a first electronic device, the method comprising: sending a first sound wave signal to a second electronic device through two speakers respectively, the first sound wave signal being used to determine first relative position information between the first electronic device and the second electronic device; receiving the first relative position information sent by the second electronic device, the first relative position information including any one of the second electronic device being located on the left side of the first electronic device, the second electronic device being located on the right side of the first electronic device, and the second electronic device being located on the front or back side of the first electronic device; when the first relative position information is that the second electronic device is located on the front or back side of the first electronic device, receiving a second sound wave signal sent by the speaker of the second electronic device through a microphone, and determining a reception result of the second sound wave signal; and determining second relative position information between the first electronic device and the second electronic device based on the reception result, the second relative position information including any one of the second electronic device being located on the front side of the first electronic device and the second electronic device being located on the back side of the first electronic device.
[0009] In the solution provided by the first aspect above, after the first electronic device sends a sound wave signal to the second electronic device through two speakers, the second electronic device can determine the relative position information of the second electronic device on the left, right, or front and back sides of the first electronic device based on the received sound wave signal, and notify the first electronic device. When the relative position information is the front and back side orientation information with an uncertain specific orientation, the second electronic device can reply the sound wave signal to the first electronic device through one speaker, and the first electronic device can accurately determine whether the second electronic device is located in front of the first electronic device or behind the first electronic device based on the received sound wave signal. In this way, the front, back, left, and right four directions between the first and second electronic devices can be automatically identified without the user actively setting it. Therefore, in some scenarios, the interactive operation between the first and second electronic devices can be realized based on the four directions of front, back, left, and right, thereby enhancing the degree of collaboration between the first and second electronic devices and expanding the usage scenarios of the first and second electronic devices.
[0010] In a possible implementation, the sound wave signal may be an ultrasonic wave signal.
[0011] In a possible implementation, the first sound wave signals respectively sent by the two speakers may be sound wave signals with the same characteristics sent successively, or may be sound wave signals with different characteristics, such as ultrasonic signals in different frequency bands or ultrasonic signals in different orthogonal sequences.
[0012] In one possible implementation, the reception result is the correlation peak amplitude of the second sound wave signal received by the microphone of the first electronic device. The correlation peak amplitude can reflect the signal strength of the sound wave signal. Thus, when the first electronic device determines that the second electronic device is located in front of or behind the first electronic device, it can further determine whether the second electronic device is located in front of or behind the first electronic device by sensing the strength of the sound wave signal from the second electronic device.
[0013] In one possible implementation, when the microphone of the first electronic device is located at the front edge of the first electronic device (such as in front of a keyboard), when the correlation peak amplitude of the second sound wave signal received by the microphone of the first electronic device is greater than the first amplitude threshold, it indicates that the microphone located at the front edge of the first electronic device senses that the signal strength of the sound wave signal from the second electronic device is relatively strong, and it can be considered that the second electronic device is located in front of the first electronic device. When the correlation peak amplitude of the second sound wave signal received by the microphone of the first electronic device is less than the first amplitude threshold, it indicates that the microphone located at the front edge of the first electronic device senses that the signal strength of the sound wave signal from the second electronic device is relatively weak, and the second electronic device is most likely not in front of the first electronic device, but is located at the back of the first electronic device.
[0014] In one possible implementation, when the microphone of the first electronic device is located at the upper edge of the first electronic device (such as above and behind the screen), when the correlation peak amplitude of the second sound wave signal received by the microphone of the first electronic device is less than the first amplitude threshold, it means that the microphone located at the upper edge of the first electronic device senses that the signal strength of the sound wave signal from the second electronic device is relatively weak, and it can be considered that the second electronic device is most likely not above and behind the screen of the first electronic device, but is located in front of the first electronic device. When the correlation peak amplitude of the second sound wave signal received by the microphone of the first electronic device is greater than the first amplitude threshold, it means that the microphone located at the upper edge of the first electronic device senses that the signal strength of the sound wave signal from the second electronic device is relatively strong, and it can be considered that the second electronic device is close to the upper side of the first electronic device, and the second electronic device is most likely located at the back side of the first electronic device (i.e. above and behind the screen).
[0015] In one possible implementation, the above-mentioned position determination method also includes: when the first relative position information indicates that the second electronic device is located on the left side of the first electronic device, or the first relative position information indicates that the second electronic device is located on the right side of the first electronic device, multi-screen interaction is performed between the first electronic device and the second electronic device according to the first relative position information; when the first relative position information indicates that the second electronic device is located in the front and back sides of the first electronic device, multi-screen interaction is performed between the first electronic device and the second electronic device according to the second relative position information.
[0016] In this way, when the sound wave signal sent unidirectionally from the two speakers of the first electronic device to the second electronic device accurately determines that the second electronic device is located to the left or to the right of the first electronic device, the interaction between the devices can be directly performed using this location information without having to replay the sound wave signal through a single speaker of the second electronic device. If the sound wave signal sent unidirectionally from the two speakers of the first electronic device to the second electronic device can only roughly determine that the second electronic device is located at the front or back side of the first electronic device, after replaying the sound wave signal through a single speaker of the second electronic device to further determine whether the second electronic device is specifically located at the front or back side of the first electronic device, the interaction between the devices can be performed using this front or back location information.
[0017] In one possible implementation, the second electronic device includes a third electronic device located on the left side of the first electronic device and a fourth electronic device located behind the first electronic device. The above-mentioned position determination method also includes: detecting a first operation on the first target content displayed by the first electronic device.
[0018] The above-mentioned multi-screen interaction between the first electronic device and the second electronic device based on the first relative position information includes: if the first operation is an operation of expanding the first target content to the left, the first electronic device sends the first target content to the display interface of the third electronic device located on the left side of the first electronic device for display.
[0019] The above-mentioned multi-screen interaction between the first electronic device and the second electronic device based on the second relative position information includes: if the first operation is an operation of expanding the first target content upward, the first electronic device sends the first target content to the display interface of the fourth electronic device located behind the first electronic device for display.
[0020] Thus, when the user needs to expand the display content of the first electronic device to the left, the display content can be sent to the third electronic device located to the left for expanded display based on the third electronic device being located to the left of the first electronic device. When the user needs to expand the display content of the first electronic device upward, the display content can be sent to the fourth electronic device located to the rear (above and behind the screen) for expanded display based on the fourth electronic device being located behind the first electronic device (above and behind the screen).
[0021] In one possible implementation, after the position of the first electronic device and / or the second electronic device changes, the first relative position information or the second relative position information between the first electronic device and the second electronic device is re-determined. Thus, if the first electronic device and / or the second electronic device moves, the above process can be automatically repeated to update the relative position information between the devices.
[0022] In a second aspect, a position determination method is provided, which is applied to a second electronic device, the method comprising: receiving first sound wave signals respectively sent by the first electronic device through two speakers, and determining a reception result of the first sound wave signal; determining first relative position information between the first electronic device and the second electronic device based on the reception result, the first relative position information including any one of the second electronic device being located on the left side of the first electronic device, the second electronic device being located on the right side of the first electronic device, and the second electronic device being located in the front or back side of the first electronic device; sending the first relative position information to the first electronic device; and sending a second sound wave signal through the speaker when the first relative position information is that the second electronic device is located in the front or back side of the first electronic device.
[0023] The solution provided in the second aspect above is that the second electronic device can determine the relative position information of the second electronic device to the left, right, or front and back of the first electronic device based on the signal reception result by receiving the sound wave signal sent from different speakers of the first electronic device, and notify the first electronic device. And when the relative position information is the front and back direction information of an uncertain specific direction, a sound wave signal is replied to the first electronic device through a speaker to ensure that the first electronic device can accurately determine whether the second electronic device is located in front of the first electronic device or behind the first electronic device based on the received reply sound wave signal. In this way, the front, back, left, and right directions between the first and second electronic devices can be automatically identified without the user actively setting it.
[0024] In a possible implementation, the above-mentioned reception result may be the time or time difference when the microphone of the second electronic device receives the first sound wave signals from the two speakers of the first electronic device.
[0025] In one scenario, taking the two speakers of the first electronic device as a left speaker and a right speaker as an example, if the time it takes for the first sound wave signal sent by the left channel speaker of the first electronic device to reach the microphone of the second electronic device is less than the time it takes for the first sound wave signal sent by the right channel speaker of the first electronic device to reach the microphone of the second electronic device, then it can be considered that the second electronic device is closer to the left channel speaker of the first electronic device, and it can be determined that the second electronic device is located on the left side of the first electronic device.
[0026] If the time it takes for the first sound wave signal sent by the left channel speaker of the first electronic device to reach the microphone of the second electronic device is greater than the time it takes for the first sound wave signal sent by the right channel speaker of the first electronic device to reach the microphone of the second electronic device, it can be considered that the second electronic device is closer to the right channel speaker of the first electronic device, and it can be determined that the second electronic device is located to the right of the first electronic device.
[0027] If the absolute value of the difference between the time when the first sound wave signal sent by the left channel speaker of the first electronic device reaches the microphone of the second electronic device and the time when the first sound wave signal sent by the right channel speaker of the first electronic device reaches the microphone of the second electronic device is less than the first time threshold, it can be considered that the first sound wave signals sent by the left channel speaker and the right channel speaker of the first electronic device reach the microphone of the second electronic device almost at the same time, and it can be determined that the second electronic device is located in the front and back side areas of the first electronic device.
[0028] In a possible implementation, the above-mentioned reception result may also be the signal strength of the first sound wave signal from the two speakers of the first electronic device received by the microphone of the second electronic device.
[0029] In a third aspect, a position determination method is provided, which is applied to a first electronic device, the method comprising: sending a first sound wave signal to a second electronic device through two speakers respectively; receiving a first reception result sent by the second electronic device, the first reception result being the reception result of the microphone of the second electronic device receiving the first sound wave signal; determining first relative position information between the first electronic device and the second electronic device based on the first reception result, the first relative position information including any one of the second electronic device being located on the left side of the first electronic device, the second electronic device being located on the right side of the first electronic device, and the second electronic device being located on the front or back side of the first electronic device; when the first relative position information is that the second electronic device is located on the front or back side of the first electronic device, receiving a second sound wave signal sent by the speaker of the second electronic device through the microphone, and determining a second reception result of receiving the second sound wave signal; determining second relative position information between the first electronic device and the second electronic device based on the second reception result, the second relative position information including any one of the second electronic device being located on the front side of the first electronic device and the second electronic device being located on the back side of the first electronic device.
[0030] According to the solution provided by the third aspect above, after the first electronic device sends a sound wave signal to the second electronic device through two speakers, the second electronic device can notify the first electronic device of the first reception result of the sound wave signal. The first electronic device determines the relative position information of the second electronic device on the left side, or right side, or front and back sides of the first electronic device based on the first reception result. When the relative position information is front and back side orientation information with an uncertain specific orientation, the second electronic device can reply the sound wave signal to the first electronic device through a speaker, and the first electronic device can further accurately determine whether the second electronic device is located in front of the first electronic device or behind the first electronic device based on the second reception result of the received sound wave signal. In this way, the four directions of front, back, left and right between the first electronic device and the second electronic device can be automatically identified without the user actively setting it.
[0031] In one possible implementation, the acoustic wave signal may be an ultrasonic signal. In one possible implementation, the first acoustic wave signals sent by the two speakers may be acoustic wave signals having the same characteristics, or may be acoustic wave signals having different characteristics, such as ultrasonic signals of different frequency bands or ultrasonic signals of different orthogonal sequences.
[0032] In one possible implementation, the second reception result is the peak amplitude of the second sound wave signal received by the microphone of the first electronic device and replied by the second electronic device. The peak amplitude can reflect the signal strength of the sound wave signal. Thus, when the first electronic device determines that the second electronic device is located in front of or behind the first electronic device, it can further determine whether the second electronic device is located in front of or behind the first electronic device by sensing the strength of the sound wave signal from the second electronic device.
[0033] In one possible implementation, when the microphone of the first electronic device is located at the front edge of the first electronic device (such as in front of a keyboard), when the correlation peak amplitude of the second sound wave signal received by the microphone of the first electronic device is greater than the first amplitude threshold, it indicates that the microphone located at the front edge of the first electronic device senses that the signal strength of the sound wave signal from the second electronic device is relatively strong, and it can be considered that the second electronic device is located in front of the first electronic device. When the correlation peak amplitude of the second sound wave signal received by the microphone of the first electronic device is less than the first amplitude threshold, it indicates that the microphone located at the front edge of the first electronic device senses that the signal strength of the sound wave signal from the second electronic device is relatively weak, and the second electronic device is most likely not in front of the first electronic device, but is located at the back of the first electronic device.
[0034] In one possible implementation, when the microphone of the first electronic device is located at the upper edge of the first electronic device (such as above and behind the screen), when the correlation peak amplitude of the second sound wave signal received by the microphone of the first electronic device is less than the first amplitude threshold, it means that the microphone located at the upper edge of the first electronic device senses that the signal strength of the sound wave signal from the second electronic device is relatively weak, and it can be considered that the second electronic device is most likely not above and behind the screen of the first electronic device, but is located in front of the first electronic device. When the correlation peak amplitude of the second sound wave signal received by the microphone of the first electronic device is greater than the first amplitude threshold, it means that the microphone located at the upper edge of the first electronic device senses that the signal strength of the sound wave signal from the second electronic device is relatively strong, and it can be considered that the second electronic device is close to the upper side of the first electronic device, and the second electronic device is most likely located at the back side of the first electronic device (i.e. above and behind the screen).
[0035] In one possible implementation, the first reception result may be the time or time difference between when the microphone of the second electronic device receives the first sound wave signal from the two speakers of the first electronic device. In this way, the second electronic device may calculate the arrival time or arrival time difference of the first sound wave signal and notify the first electronic device for further processing by the first electronic device.
[0036] In one possible implementation, the first reception result may be the microphone of the second electronic device receiving audio information of the first sound wave signal from two speakers of the first electronic device. In this manner, after receiving the first sound wave signal, the second electronic device directly transmits the audio information of the first sound wave signal recorded by the microphone to the first electronic device, and the first electronic device further calculates the arrival time or arrival time difference of the first sound wave signal.
[0037] In one possible implementation, the first reception result may also be the signal strength of the first sound wave signal received by the microphone of the second electronic device from the two speakers of the first electronic device. In this way, the first electronic device can also determine the relative position information of the second electronic device to the left, right, or front or back of the first electronic device based on the arrival strength of the first sound wave signal.
[0038] In one possible implementation, the above-mentioned position determination method also includes: when the first relative position information indicates that the second electronic device is located on the left side of the first electronic device, or the first relative position information indicates that the second electronic device is located on the right side of the first electronic device, multi-screen interaction is performed between the first electronic device and the second electronic device according to the first relative position information; when the first relative position information indicates that the second electronic device is located in the front and back sides of the first electronic device, multi-screen interaction is performed between the first electronic device and the second electronic device according to the second relative position information.
[0039] In a fourth aspect, a position determination method is provided, which is applied to a second electronic device, the method comprising: receiving, through a microphone, first sound wave signals respectively sent by the first electronic device through two speakers, and determining a first reception result of receiving the first sound wave signal; sending the first reception result to the first electronic device, the first reception result being used by the first electronic device to determine first relative position information between the first electronic device and the second electronic device; and sending a second sound wave signal through the speaker when the first relative position information is that the second electronic device is located at the front and rear sides of the first electronic device.
[0040] According to the solution provided in the fourth aspect, after the second electronic device receives the sound wave signal sent by the two speakers of the first electronic device through the microphone, it can notify the first electronic device of the first reception result of the sound wave signal. The first electronic device determines the relative position information of the second electronic device on the left side, or right side, or front and back sides of the first electronic device based on the first reception result. When the relative position information is the front and back side orientation information of an uncertain specific orientation, the second electronic device can reply the sound wave signal to the first electronic device through a speaker, and the first electronic device can further accurately determine whether the second electronic device is located in front of the first electronic device or on the back of the first electronic device based on the received reply sound wave signal. In this way, the four directions of front, back, left and right between the first electronic device and the second electronic device can be automatically identified without the user actively setting it.
[0041] In one possible implementation, the above-mentioned first reception result can be the time or time difference when the microphone of the second electronic device receives the first sound wave signal from the two speakers of the first electronic device, or it can be the audio information of the first sound wave signal from the two speakers of the first electronic device received by the microphone of the second electronic device, or it can be the signal strength of the first sound wave signal from the two speakers of the first electronic device received by the microphone of the second electronic device.
[0042] In a fifth aspect, a position determination method is provided, which is applied to a first electronic device, the method comprising: sending a first sound wave signal to a second electronic device through a speaker, and receiving the first wave signal through a microphone; then receiving a second sound wave signal sent by the speaker of the second electronic device through the microphone; determining a first reception result of the microphone receiving the first sound wave signal and the second sound wave signal; receiving a second reception result sent by the second electronic device, the second reception result being the reception result of the microphone in the second electronic device receiving the first sound wave signal and the second sound wave signal; and determining the relative position information between the first electronic device and the second electronic device based on the first reception result and the second reception result.
[0043] In the solution provided in the fifth aspect, when a first electronic device transmits a sound wave signal to a second electronic device via a speaker, both the first and second electronic devices receive the sound wave signal via their respective microphones. After receiving the sound wave signal, the second electronic device then responds with a sound wave signal to the first electronic device via its own speaker. At this point, both the first and second electronic devices also receive the response sound wave signal via their respective microphones. The first electronic device can determine a first reception result of its own microphone receiving the first and second sound wave signals. The second electronic device can also notify the first electronic device of a second reception result of its own microphone receiving the first and second sound wave signals. Thus, the first electronic device can determine the relative position information between the first and second electronic devices based on the reception results of the first and second sound wave signals by the respective microphones on the first and second electronic devices, such as the relative position information of whether the second electronic device is located to the left, right, front, or back of the first electronic device. In this way, by bidirectionally transmitting sound wave signals between the first and second electronic devices, the relative position information between the first and second electronic devices can be automatically identified without the user actively setting it.
[0044] In one possible implementation, the first reception result is the time or time difference between the first and second sound wave signals received by the microphone of the first electronic device. The second reception result is the time or time difference between the first and second sound wave signals received by the microphone of the second electronic device, or audio information of the first and second sound wave signals received by the microphone of the second electronic device.
[0045] In one possible implementation, the first electronic device can determine the sum of the round-trip distances between the microphone and the speaker in the first electronic device and the second electronic device based on the first reception result and the second reception result, where the round-trip distance includes the distance between the speaker of the first electronic device and the microphone of the second electronic device, and the distance between the microphone of the first electronic device and the speaker of the second electronic device; and determine the relative position information between the first electronic device and the second electronic device based on the sum of the round-trip distances. In this way, the sum of the round-trip distances between the microphone and the speaker in the first electronic device and the second electronic device measured by sending a sound wave signal in both directions can automatically determine the relative position information between the first electronic device and the second electronic device. For example, the relative position information of the second electronic device to the left, right, front, or back of the first electronic device, or the specific three-dimensional spatial coordinates of the second electronic device around the first electronic device.
[0046] In one possible implementation, the first electronic device can use the sum of the round-trip distances between the microphone and the speaker in the first electronic device and the second electronic device measured by sending sound wave signals in both directions to construct a mathematical model to solve the relative position information between the first electronic device and the second electronic device.
[0047] In one possible implementation, the first electronic device may determine multiple candidate positions of the second electronic device relative to the first electronic device; based on each candidate position, determine the candidate distances between the microphone and the speaker in the first electronic device and the second electronic device, respectively, the candidate distances including the distance between the speaker of the first electronic device and the microphone of the second electronic device, and the distance between the microphone of the first electronic device and the speaker of the second electronic device; based on the candidate position corresponding to the target candidate distance, determine the relative position information between the first electronic device and the second electronic device, the target candidate distance being the candidate distance for each candidate position, the candidate distance for which the matching result with the sum of the round-trip distances satisfies a preset condition. In this way, the first electronic device can select some candidate positions of the second electronic device for judgment by a spatial traversal search method, so as to find the most likely position of the second electronic device from the candidate positions of the second electronic device as the determined position of the second electronic device. This eliminates the need to solve the accurate three-dimensional spatial position of the second electronic device through a mathematical model.
[0048] In one possible implementation, the matching result of the target candidate distance and the sum of the round-trip distances satisfies a preset condition, which may be that the error value between the target candidate distance and the sum of the round-trip distances is minimized. In this way, the candidate position with the smallest error value may be used as the determined position of the second electronic device.
[0049] In one possible implementation, at least three combinations are formed between the microphones and speakers in the first electronic device and the second electronic device, each combination includes a speaker and a microphone of the first electronic device, and a speaker and a microphone of the second electronic device, and each combination is not exactly the same or completely different.
[0050] In one scenario, the first electronic device may have one speaker and three microphones, and the second electronic device may have one speaker and one microphone. Alternatively, the first electronic device may have one speaker and one microphone, and the second electronic device may have one speaker and three microphones. In this way, three combinations of microphones and speakers in the first and second electronic devices can be formed, and each combination is not exactly the same.
[0051] In one scenario, the first electronic device may have three speakers and one microphone, and the second electronic device may have one speaker and one microphone. Alternatively, the first electronic device may have one speaker and one microphone, and the second electronic device may have three speakers and one microphone. In this way, three combinations of microphones and speakers in the first and second electronic devices can be formed, and each combination is different.
[0052] In one scenario, the first electronic device may have two speakers and two microphones, and the second electronic device may also have two speakers and two microphones. Thus, 16 combinations of microphones and speakers in the first and second electronic devices can be formed, and each combination is not exactly the same.
[0053] In one possible implementation, the first electronic device may determine the sum of the round-trip distances between the microphone and the speaker in each combination based on the first reception result and the second reception result, where the round-trip distance includes the distance between the speaker of the first electronic device and the microphone of the second electronic device, and the distance between the microphone of the first electronic device and the speaker of the second electronic device. The first electronic device may then determine the relative position information between the first and second electronic devices based on the sum of the round-trip distances for each combination. In this way, the first electronic device can accurately determine the relative position information between the first and second electronic devices using the sum of the round-trip distances between the microphones and speakers in multiple combinations.
[0054] In one possible implementation, the first electronic device can also perform multi-screen interaction with the second electronic device based on the relative position information. This allows interactive operations between the first and second electronic devices based on the four positions of front, back, left, and right in some scenarios, thereby enhancing the collaboration between the first and second electronic devices and expanding their usage scenarios.
[0055] In one possible implementation, when the second electronic device includes a fifth electronic device located to the right of the first electronic device and a sixth electronic device located in front of the first electronic device, performing multi-screen interaction between the first electronic device and the second electronic device based on relative position information includes:
[0056] Detect a first operation on the first target content displayed on the first electronic device; if the first operation is an operation of expanding the first target content to the right, the first electronic device sends the first target content to the display interface of the fifth electronic device located on the right side of the first electronic device for display; if the first operation is an operation of expanding the first target content downward, the first electronic device sends the first target content to the display interface of the sixth electronic device located in front of the first electronic device for display.
[0057] Thus, when the user needs to expand the display content of the first electronic device to the right, the display content can be sent to the fifth electronic device located to the right for expanded display based on the fifth electronic device being located to the right of the first electronic device. When the user needs to expand the display content of the first electronic device downward, the display content can be sent to the sixth electronic device located in the front (in front of the keyboard) for expanded display based on the sixth electronic device being located in the front (in front of the keyboard) of the first electronic device.
[0058] In one possible implementation, the location determination method further includes re-determining the relative location information between the first electronic device and / or the second electronic device after the location of the first electronic device and / or the second electronic device changes. In this way, if the first electronic device and / or the second electronic device moves, the above process can be automatically repeated to update the relative location information between the devices.
[0059] In a sixth aspect, a position determination method is provided, which is applied to a second electronic device, and the method includes: receiving, through a microphone, a first sound wave signal sent by the first electronic device through a speaker respectively; sending a second sound wave signal through the speaker, and receiving the second sound wave signal through the microphone; determining a second reception result of the microphone receiving the first sound wave signal and the second sound wave signal; sending the second reception result to the first electronic device, and the second reception result is used by the first electronic device to determine the relative position information between the first electronic device and the second electronic device.
[0060] According to the solution provided in the sixth aspect, after the second electronic device receives the sound wave signal from the first electronic device through the microphone, it can reply the sound wave signal to the first electronic device through its own speaker, and at the same time, it will also receive the reply sound wave signal through its own microphone. The second electronic device can then determine the second reception result of its own microphone receiving the first sound wave signal and the second sound wave signal, and notify the first electronic device. Thus, the first electronic device can determine the relative position information between the first electronic device and the second electronic device based on the reception results of the first sound wave signal and the second sound wave signal received by each microphone on the first electronic device and the second electronic device, such as the relative position information of the second electronic device being located on the left, right, front, or back side of the first electronic device. In this way, by sending sound wave signals in both directions between the first electronic device and the second electronic device, the relative position information between the first electronic device and the second electronic device can be automatically identified without the user actively setting it.
[0061] In one possible implementation, the second reception result is the time or time difference when the microphone in the second electronic device receives the first sound wave signal and the second sound wave signal, or the audio information when the microphone in the second electronic device receives the first sound wave signal and the second sound wave signal.
[0062] In one possible implementation, at least three combinations are formed between the microphones and speakers in the first electronic device and the second electronic device, each combination includes a speaker and a microphone of the first electronic device, and a speaker and a microphone of the second electronic device, and each combination is not exactly the same or completely different.
[0063] In the seventh aspect, a position determination method is provided, which is applied to a first electronic device, the method comprising: sending a first sound wave signal to a second electronic device through a first speaker and a second speaker, and receiving the first sound wave signal through a first microphone and a second microphone; receiving a second sound wave signal sent by a third speaker and a fourth speaker of the second electronic device through the first microphone and the second microphone; determining a first reception result of the first microphone and the second microphone receiving the first sound wave signal and the second sound wave signal; receiving a second reception result sent by the second electronic device, the second reception result being the reception result of the third microphone and the fourth microphone in the second electronic device receiving the first sound wave signal and the second sound wave signal; and determining the relative position information between the first electronic device and the second electronic device based on the first reception result and the second reception result.
[0064] In the solution provided in the seventh aspect, the first electronic device and the second electronic device each have two speakers and two microphones, and the two microphones of the first electronic device and the two microphones of the second electronic device send sound wave signals in a two-way round trip, and at the same time, receive the two-way round trip sound wave signals through their respective two microphones. Thus, the first electronic device can determine the relative position information between the first electronic device and the second electronic device based on the reception results of the two-way round trip sound wave signals received by each microphone on the first electronic device and the second electronic device, such as the relative position information of the second electronic device being located on the left, right, front, or back side of the first electronic device. In this way, by sending sound wave signals in both directions between the first electronic device and the second electronic device, the relative position information between the first electronic device and the second electronic device can be automatically identified without the user actively setting it.
[0065] In one possible implementation, the first reception result includes the time or time difference when the first microphone receives the first sound wave signal and the second sound wave signal, and the time or time difference when the second microphone receives the first sound wave signal and the second sound wave signal; the second reception result includes the time or time difference or audio information when the third microphone receives the first sound wave signal and the second sound wave signal, and the time or time difference or audio information when the fourth microphone receives the first sound wave signal and the second sound wave signal.
[0066] In an eighth aspect, a position determination method is provided, which is applied to a second electronic device, the method comprising: receiving a first sound wave signal sent by a first speaker and a second speaker of the first electronic device through a third microphone and a fourth microphone; sending a second sound wave signal to the first electronic device through the third speaker and the fourth speaker, and receiving the second sound wave signal through the third microphone and the fourth microphone; determining a second reception result of the first sound wave signal and the second sound wave signal received by the third microphone and the fourth microphone; and sending the second reception result to the first electronic device, and the second reception result is used by the first electronic device to determine the relative position information between the first electronic device and the second electronic device.
[0067] According to the solution provided in the eighth aspect, after the second electronic device receives the sound wave signals from the two speakers of the first electronic device through the two microphones, it can reply the sound wave signals through its own two speakers and receive the reply sound wave signals through its own two microphones. The second electronic device can then notify the first electronic device of the second reception result of the two microphones receiving the two-way sound wave signals, so that the first electronic device can determine the relative position information between the first electronic device and the second electronic device based on the reception results of the two-way sound wave signals received by each microphone on the first electronic device and the second electronic device, such as the relative position information of the second electronic device being located on the left, right, front, or back side of the first electronic device. In this way, by sending the sound wave signals in both directions between the first electronic device and the second electronic device, the relative position information between the first electronic device and the second electronic device can be automatically identified without the user actively setting it.
[0068] In a ninth aspect, an electronic device is provided, which may be the aforementioned first electronic device or the aforementioned second electronic device. The electronic device includes: a memory, a display, a communication module, and one or more processors; the memory, display, and processor are coupled. The memory is configured to store computer program code, which includes computer instructions; when the electronic device is running, the processor is configured to execute the one or more computer instructions stored in the memory, causing the electronic device to perform the method performed in any of the aforementioned possible implementations.
[0069] In a tenth aspect, an interface display device is provided, which is included in an electronic device and has the function of implementing the electronic device behavior described in any of the possible implementation methods described above. This function can be implemented through hardware or through hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions.
[0070] In an eleventh aspect, a multi-screen collaborative system is provided, comprising the first electronic device and the second electronic device. The first electronic device executes the interface display method executed by the first electronic device in any of the possible implementations described above, and the second electronic device executes the interface display method executed by the second electronic device in any of the possible implementations described above.
[0071] In a twelfth aspect, a chip system is provided, which is applied to an electronic device. The chip system includes one or more interface circuits and one or more processors. The interface circuits and processors are interconnected via a circuit. The interface circuit is configured to receive a signal from a memory of the electronic device and send the signal to the processor. The signal includes computer instructions stored in the memory. When the processor executes the computer instructions, the electronic device executes the interface display method of any of the possible implementations described above.
[0072] In a thirteenth aspect, a computer-readable storage medium is provided, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the interface display method in any one of the possible implementations described above.
[0073] In a fourteenth aspect, a computer program product is provided. When the computer program product is run on an electronic device, the electronic device executes the interface display method in any one of the possible implementations described above.
[0074] It can be understood that the beneficial effects that can be achieved by the electronic device of the ninth aspect, the device of the tenth aspect, the multi-screen collaborative system of the eleventh aspect, the chip system of the twelfth aspect, the computer storage medium of the thirteenth aspect, and the computer program product of the fourteenth aspect provided above can be referred to the beneficial effects in the aforementioned possible implementations and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] FIG1 is a schematic diagram of a scenario of a ranging algorithm provided in an embodiment of the present application;
[0076] FIG2 is a schematic diagram of another scenario of a ranging algorithm provided in an embodiment of the present application;
[0077] FIG3 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0078] FIG4 is a schematic diagram of area division of an electronic device provided in an embodiment of the present application;
[0079] FIG5 is a flow chart of a location determination method provided in an embodiment of the present application;
[0080] FIG6 is a schematic structural diagram of a first electronic device and a second electronic device provided in an embodiment of the present application;
[0081] FIG7 is a first schematic diagram of sending an acoustic wave signal according to an embodiment of the present application;
[0082] FIG8 is a second schematic diagram of sending an acoustic signal provided in an embodiment of the present application;
[0083] FIG9 is a third schematic diagram of sending an acoustic wave signal provided in an embodiment of the present application;
[0084] FIG10 is a schematic diagram of a spatial coordinate system provided in an embodiment of the present application;
[0085] FIG11 is a schematic diagram of area division of another electronic device provided in an embodiment of the present application;
[0086] FIG12 is a second schematic diagram of a spatial coordinate system provided in an embodiment of the present application;
[0087] FIG13 is a flow chart of another location determination method provided in an embodiment of the present application;
[0088] FIG14 is a fourth schematic diagram of sending an acoustic wave signal according to an embodiment of the present application;
[0089] FIG15 is a flow chart of another method for determining a position according to an embodiment of the present application;
[0090] FIG16 is a schematic diagram of area division of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0091] In the description of this application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; "and / or" in this application is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural.
[0092] In the description of this application, unless otherwise specified, "a plurality of" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example,
[0093] At least one item among a, b, or c can represent: a, b, c, a and b, a and c, b and c, a, b and c, where a, b, c can be single or multiple.
[0094] In addition, to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first" and "second" do not limit the quantity or execution order, and the words "first" and "second" do not necessarily mean different.
[0095] In the embodiments of this application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a concrete manner to facilitate understanding.
[0096] The features, structures, or characteristics of this application may be combined in any suitable manner in one or more embodiments. In the various embodiments of this application, the order of the sequence numbers of the processes does not necessarily indicate the order of execution. The order of execution of the processes should be determined by their functions and inherent logic, and should not constitute any limitation on the implementation of the embodiments of this application.
[0097] Some optional features in the embodiments of the present application can be implemented independently in certain scenarios without relying on other features to solve corresponding technical problems and achieve corresponding effects. They can also be combined with other features in certain scenarios as needed.
[0098] In this application, unless otherwise specified, the same or similar parts between the various embodiments can be referenced to each other. In the various embodiments of this application, unless otherwise specified and there is no logical conflict, the terms and / or descriptions between different embodiments are consistent and can be referenced to each other. The technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships. The implementation methods of this application do not constitute a limitation on the scope of protection of this application.
[0099] In addition, the business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0100] Currently, relative position information between multiple electronic devices is determined mainly based on user visual judgment or by adding corresponding measurement units to the electronic devices for measurement and judgment, which increases the complexity of user operations or the production cost of the electronic devices.
[0101] In order to solve the above problems, an embodiment of the present application provides a position determination method, which measures the distance between the audio transmitting units and audio receiving units on the two electronic devices by respectively utilizing the existing audio transmitting units and audio receiving units of the two electronic devices to transmit and receive sound wave signals, and combines the distances between multiple pairs of audio transmitting units and audio receiving units to determine the relative position information between the two electronic devices. The relative position information between the two electronic devices can refer to the relative position relationship between the two electronic devices in terms of left and right, up and down (or front and back), or it can refer to the precise relative position coordinates between the two electronic devices.
[0102] Among them, the audio sending unit is a unit that can send sound wave signals outward, such as a loudspeaker. The audio receiving unit is a unit that can receive sound wave signals, such as a microphone. In an embodiment of the present application, the sound wave signal can be an infrasound signal with a frequency of 0 to 20KHz, or it can be an ultrasonic signal with a frequency of more than 20KHz, and the embodiment of the present application is not limited to this. For example, the frequency of the above-mentioned sound wave signal can be a single-frequency signal such as 1KHz, 2KHz, 3KHz, 5KHz, 10KHz, 15KHz, 20KHz, 30KHz, or it can be a linear frequency modulation signal (frequency-modulated continuous wave, FMCW) of 18kHz to 20kHz. As a way, since the frequency of sound that humans can hear is 20Hz to 2KHz, in order to ensure that the determination process of the position information is not perceived by the user, the above-mentioned sound wave signal can be an ultrasonic signal.
[0103] The following will take the audio sending unit as a speaker and the audio receiving unit as a microphone as an example to introduce the position determination method provided in the embodiment of the present application.
[0104] Generally, in order to obtain the distance between two devices, the transmission time of the sound wave signal between the devices is usually measured, and then the distance between the two devices is obtained by converting it according to the propagation speed of the sound wave signal.
[0105] Figure 1 is a schematic diagram of a scenario for a ranging algorithm provided in this application. The scenario includes electronic device 11 and electronic device 12. Electronic device 11 has at least one speaker, and electronic device 12 has at least one microphone. The speaker of electronic device 11 can transmit sound wave signals, and the microphone of electronic device 12 can receive these sound wave signals.
[0106] For example, if the electronic device 11 sends a sound wave signal through a speaker at time T1, and the electronic device 12 receives the sound wave signal through a microphone at time T2, then according to the time T1 when the electronic device 11 sends the sound wave signal and the time T2 when the electronic device 12 receives the sound wave signal, it can be obtained that: D1 = C(T2-T1), Formula (1)
[0107] Wherein, D1 is the distance between the speaker of the electronic device 11 and the microphone of the electronic device 12, and C is the propagation speed of the sound wave signal, which is the speed of sound.
[0108] However, as can be seen from formula (1), C is a constant, while T2 and T1 are variables. Therefore, the accuracy of (T2-T1) will have a significant impact on the accuracy of the ranging result. Since electronic device 11 and electronic device 12 are different electronic devices, if the time synchronization accuracy of the two electronic devices is poor and cannot be synchronized to the microsecond level, the accuracy of the signal propagation time (T2-T1) between the two electronic devices will be poor, resulting in a large error in the ranging result.
[0109] In order to solve the above problem, in the embodiment of the present application, a two-way ranging technology is used to measure the distance between the microphone and the speaker on two electronic devices, which can achieve ranging without relying on clock synchronization between the devices.
[0110] FIG2 is a schematic diagram of a scenario for a two-way ranging algorithm provided in this application. The scenario includes an electronic device 21 and an electronic device 22. Each of electronic device 21 and electronic device 22 has at least one microphone and at least one speaker. A speaker of electronic device 21 can transmit a sound wave signal, and each microphone of electronic device 21 and electronic device 22 can receive the sound wave signal. Similarly, a speaker of electronic device 22 can also transmit a sound wave signal, and each microphone of electronic device 21 and electronic device 22 can also receive the sound wave signal.
[0111] Referring to FIG2 , the two-way ranging algorithm may be as follows: first, a speaker of electronic device 21 transmits a sound wave signal, which propagates through the internal space of the device or through the air and is received by each microphone of electronic device 21 and electronic device 22. Then, a speaker of electronic device 22 transmits a sound wave signal, which propagates through the air and is received by each microphone of electronic device 21 and electronic device 22. By measuring the time it takes for each speaker of electronic device 21 and electronic device 22 to transmit the sound wave signal, and the time it takes for each microphone to receive the sound wave signal, the speaker-to-microphone distance between electronic device 22 and electronic device 21 can be determined.
[0112] The above two-way ranging algorithm is described in detail below using a specific example.
[0113] Electronic device 21 has a speaker S1 and a microphone M1, and electronic device 22 has a speaker S2 and at least one microphone M2. First, electronic device 21 sends a sound wave signal through speaker S1 at time T3. Microphone M1 of electronic device 21 receives the sound wave signal at time T4, and microphone M2 of electronic device 22 receives the sound wave signal at time T5. Then, electronic device 22 sends a sound wave signal through speaker S2 at time T6. Microphone M2 of electronic device 22 receives the sound wave signal at time T7, and microphone M1 of electronic device 21 receives the sound wave signal at time T8. At this point, the distances between multiple pairs of speakers and microphones can be obtained based on the sending and receiving times of the above sound wave signals.
[0114] For example, based on the time T3 when the speaker S1 of the electronic device 21 sends the sound wave signal and the time T4 when the microphone M1 of the electronic device 21 receives the sound wave signal, it can be obtained that: d1 = C(T4-T3), Formula (2)
[0115] Wherein, d1 is the distance between the speaker S1 and the microphone M1 on the same electronic device 21 .
[0116] According to the time T3 when the speaker S1 of the electronic device 21 sends the sound wave signal and the time T5 when the microphone M2 of the electronic device 22 receives the sound wave signal, it can be obtained that: D2=C(T5-T3), Formula (3)
[0117] Wherein, D2 is the distance between the speaker S1 on the electronic device 21 and the microphone M2 on the electronic device 22 .
[0118] According to the time T6 when the speaker S2 of the electronic device 22 sends the sound wave signal and the time T7 when the microphone M2 of the electronic device 22 receives the sound wave signal, it can be obtained that: d2=C(T7-T6), Formula (4)
[0119] Wherein, d2 is the distance between the speaker S2 and the microphone M2 on the same electronic device 22 .
[0120] According to the time T6 when the speaker S2 of the electronic device 22 sends the sound wave signal and the time T8 when the microphone M1 of the electronic device 21 receives the sound wave signal, it can be obtained that: D3=C(T8-T6), Formula (5)
[0121] Wherein, D3 is the distance between the speaker S2 on the electronic device 22 and the microphone M1 on the electronic device 21 .
[0122] However, for the distances D2 and D3 between the speakers and microphones on the two devices, the accuracy of (T5-T3) and (T8-T6) can significantly impact the accuracy of the distance measurement results. Since electronic device 21 and electronic device 22 are different electronic devices, if the time synchronization accuracy of the two electronic devices is poor and cannot be synchronized to the microsecond level, the accuracy of the signal propagation time (T5-T3) and (T8-T6) between the two devices will be poor, resulting in large errors in the distance measurement results.
[0123] However, it has been found that by combining the above formulas (2) to (5), we can obtain: D2+D3-(d1+d2)=C(T5-T3)+C(T8-T6)-[C(T4-T3)+C(T7-T6)]=C(T5+T8-T4-T7)=C[(T8-T4)-(T7-T5)], Formula (6)
[0124] That is, we can get: D2+D3=C[(T8-T4)-(T7-T5)]+d1+d2, Formula (7)
[0125] D2+D3 is the sum of the distance from the speaker S1 to the microphone M2 and the distance from the speaker S2 to the microphone M1 , that is, the sum of the round-trip distances of the speakers and microphones between the electronic device 21 and the electronic device 22 .
[0126] Combined with formula (7), it can be seen that the sum of the round-trip distances of a group of speakers and microphones between two devices can be obtained by converting the time difference between the two sound wave signals received by the microphones in the group, namely (T8-T4) and (T7-T5), and the distances between the speakers and microphones in the group, namely d1 and d2, by the speed of sound wave signal propagation.
[0127] Furthermore, from formula (7), we can see that (T8-T4) is the time difference between the two sound wave signals received by microphone M1 on electronic device 21. (T8-T4) is the clock difference on the same electronic device 21, so (T8-T4) is not affected by clock asynchrony. Similarly, (T7-T5) is the time difference between the two sound wave signals received by microphone M2 on electronic device 22. (T7-T5) is the clock difference on the same electronic device 22, so (T7-T5) is not affected by clock asynchrony. Therefore, the result of D2+D3 is also not affected by clock asynchrony.
[0128] In this way, through a round of two-way transmission and reception of sound wave signals between the speakers and microphones of the above two devices, the sum of the round-trip distances of the speakers and microphones between electronic device 21 and electronic device 22 can be determined without relying on clock synchronization between the devices.
[0129] Because the relative position information between two electronic devices involves a three-dimensional spatial distribution, the sum of the round-trip distances of a set of speakers and microphones between the two electronic devices is generally not enough to accurately determine the relative position information between the two electronic devices. In an embodiment of the present application, the sum of the round-trip distances of at least three sets of speakers and microphones with different spatial arrangements between the two electronic devices can be used to accurately determine the relative position information between the two electronic devices in three-dimensional space.
[0130] In an embodiment of the present application, the total number of microphones and speakers possessed by the two electronic devices is at least six, and each of the two electronic devices has at least one microphone and at least one speaker, and these microphones and speakers cannot be arranged on the same straight line. Part of these microphones and speakers may be located on a straight line. This ensures that the sum of the round-trip distances of at least three groups of speakers and microphones with different spatial arrangements can be measured, thereby improving the accuracy of the relative position information between the two electronic devices in three-dimensional space.
[0131] In the embodiment of the present application, the above two electronic devices can be mobile phones (such as foldable screen mobile phones), netbooks, tablet computers, car-mounted devices, wearable devices (such as smart watches, smart bracelets, etc.), personal computers (PCs) (including desktop computers or laptops), PDAs, personal digital assistants (PDAs), portable multimedia players (PMPs), projection devices, smart screen devices, augmented reality (AR) / virtual reality (VR) devices, mixed reality (MR) devices, televisions or somatosensory game consoles in human-computer interaction scenarios, and other devices with speakers and microphones. This application does not limit the specific types and structures of the two electronic devices. The two electronic devices can be devices of the same type or different types. For example, one electronic device is a mobile phone and the other electronic device is a laptop.
[0132] As an example, please refer to FIG3 , which shows a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0133] As shown in Figure 3, the electronic device 300 may include a processor 310, an external memory interface 320, an internal memory 321, a universal serial bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1, an antenna 2, a mobile communication module 350, a wireless communication module 360, an audio module 370, a speaker 370A, a receiver 370B, a microphone 370C, an earphone interface 370D, a sensor module 380, a button 390, a motor 391, an indicator 392, a camera 393, a display screen 394, and a subscriber identification module (SIM) card interface 395, etc. Among them, the sensor module 380 may include a pressure sensor 380A, a gyroscope sensor 380B, an air pressure sensor 380C, a magnetic sensor 380D, an acceleration sensor 380E, a distance sensor 380F, a proximity light sensor 380G, a fingerprint sensor 380H, a temperature sensor 380J, a touch sensor 380K, an ambient light sensor 380L, a bone conduction sensor 380M, etc.
[0134] It should be understood that the structure illustrated in this embodiment does not constitute a specific limitation on electronic device 300. In other embodiments, electronic device 300 may include more or fewer components than illustrated, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0135] The processor 310 may include one or more processing units. For example, the processor 310 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0136] The mobile communication module 350 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 300. The mobile communication module 350 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 350 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 350 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 350 can be set in the processor 310. In some embodiments, at least some of the functional modules of the mobile communication module 350 can be set in the same device as at least some of the modules of the processor 310.
[0137] The wireless communication module 360 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 300. The wireless communication module 360 can be one or more devices that integrate at least one communication processing module. The wireless communication module 360 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 310. The wireless communication module 360 can also receive the signal to be sent from the processor 310, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0138] Display screen 394 is used to display images, videos, etc. Display screen 394 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED).
[0139] The internal memory 321 can be used to store computer executable program codes, which include instructions. The processor 310 executes various functional applications and data processing of the electronic device 300 by running the instructions stored in the internal memory 321. For example, in an embodiment of the present application, the processor 310 can control the speaker 370A to send a sound wave signal by executing the instructions stored in the internal memory 321. The internal memory 321 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as an extended screen function, a screen projection function, etc.), etc. The data storage area may store data created during the use of the electronic device 300 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 321 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0140] The electronic device 300 can implement audio functions such as music playback and recording through the audio module 370, the speaker 370A, the receiver 370B, the microphone 370C, the headphone jack 370D, and the application processor.
[0141] The audio module 370 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 370 can also be used to encode and decode audio signals. In some embodiments, the audio module 370 can be provided in the processor 310, or some functional modules of the audio module 370 can be provided in the processor 310.
[0142] Speaker 370A, also known as a "horn," is used to convert audio electrical signals into sound signals. Electronic device 300 can transmit sound wave signals or play music through speaker 370A. Electronic device 300 can be equipped with at least one speaker 370A. In some embodiments, electronic device 300 can be equipped with two speakers 370A, each of which transmits sound wave signals. In other embodiments, electronic device 300 can be equipped with three, four, or more speakers 370A.
[0143] In some embodiments, when it is necessary to determine the relative position information between the electronic device 300 and other electronic devices, the electronic device 300 can control the speaker 370A to send a sound wave signal.
[0144] Microphone 370C, also known as a "microphone" or "microphone," is used to convert sound signals into electrical signals. Electronic device 300 can receive sound wave signals or record sound waves through microphone 370C. Electronic device 300 can be equipped with at least one microphone 370C. In some embodiments, electronic device 300 can be equipped with two microphones 370C, each for receiving sound wave signals. In other embodiments, electronic device 300 can be equipped with three, four, or more microphones 370C.
[0145] In some embodiments, the electronic device 300 may receive sound wave signals from the speaker 370A of the same electronic device 300 through the microphone 370C, and may also receive sound wave signals from speakers of other electronic devices through the microphone 370C.
[0146] In some embodiments, when it is necessary to determine the relative position information between the electronic device 300 and other electronic devices, the electronic device 300 may control the microphone 370C to receive a sound wave signal.
[0147] Indicator 392 can be an indicator light, which can be used to indicate the pairing status, extended screen status, and screen projection status between devices. It can also be used to indicate messages, notifications (pairing success notification, screen projection success notification), etc.
[0148] The position determination method provided in the embodiments of the present application can be applied to various scenarios that require identifying the relative positions between devices, such as extended screen scenarios, screen projection scenarios or other multi-screen interactive scenarios, directional sound playback application scenarios, etc.
[0149] The following will take the extended screen scenario as an example to introduce the location determination method provided in the embodiment of the present application.
[0150] Currently, when using a PC (including desktop computers or laptops), it is often necessary to extend the image displayed on the PC screen to the screen of another device to provide a better user experience. For example, the screen of a tablet computer can be used as an extended screen of the PC, and the image displayed on the PC screen can be extended to the tablet computer for display.
[0151] In order to make the image display of the extended screen more natural, it is necessary to make the image layout on the extended screen and the PC screen conform to the physical relative position relationship between the two. At this time, it is necessary to obtain the orientation of the tablet computer relative to the PC. At present, the relative position between the extended screen and the PC screen is usually manually configured by the user. For example, among the four orientation options of front, back, left, right, or up, down, left, and right, the user manually selects a certain orientation option to configure the relative position of multiple screen images; or on the multiple screen images arranged by default, the user manually drags the screen image to a certain orientation to configure the relative position of multiple screen images. This takes up a lot of configuration time for the user, resulting in a poor user experience. The position determination method provided in the embodiment of the present application can automatically identify the orientation of the tablet computer relative to the PC, reducing the tediousness of user configuration in the extended screen scenario.
[0152] The following uses a laptop and a tablet computer as examples to illustrate the extended screen scenario. In this extended screen scenario, the content displayed on the display interface of the laptop can be extended to the display interface of the tablet computer for display.
[0153] First, the laptop and tablet establish a pairing connection.
[0154] In some embodiments, before establishing a pairing connection between the laptop and tablet, the process may further include launching an extended display application. For example, a user may perform a first preset operation on the laptop, and the laptop, in response to the first preset operation, launches the extended display application. The first preset operation may be a touch operation, or an operation input by the user via a mouse or keyboard.
[0155] For example, a user may perform a second preset operation in an extended display application on a laptop. In response to the second preset operation, the laptop sends a first request message to the tablet. The first request message is used to request that the laptop and the tablet establish a pairing connection. The tablet displays the first request message and receives a third preset operation input by the user. The tablet responds to the third preset operation and establishes a pairing connection with the laptop.
[0156] Alternatively, the extended display application in the laptop computer may not be enabled. After detecting the second preset operation, the laptop computer may determine that extended display is required, and thus send the first request information to the tablet computer.
[0157] Alternatively, before the extended display application in the laptop is started, the laptop and the tablet have already established a pairing connection. Then, after the laptop runs the extended display application, it is not necessary to send the first request information to the tablet.
[0158] Exemplarily, the laptop computer and the tablet computer may be paired and connected via a wired connection, for example, via a high definition multimedia interface (HDMI).
[0159] For example, a pairing connection can be established between the laptop and the tablet computer via a wireless method. For example, the laptop and the tablet computer can establish a pairing connection by sharing a wireless access point (AP). Alternatively, the laptop and the tablet computer can establish a pairing connection via a wireless method such as Wi-Fi Direct or Bluetooth. The embodiments of the present application do not limit the specific connection method for establishing a pairing connection between the laptop and the tablet computer.
[0160] In one scenario, the process of establishing a pairing connection between a laptop and a tablet by sharing an AP may include: the laptop and the tablet establishing a Wi-Fi connection with the same AP; the laptop obtains address information of each electronic device that has established a connection with the AP; the laptop obtains operation information input by the user, and the operation information can be used to indicate that the user has selected a certain electronic device (such as a tablet) to establish a pairing connection with the laptop; the laptop responds to the operation information and initiates a pairing connection establishment request (i.e., first request information) to the tablet based on the address information of the tablet, and the pairing connection establishment request includes the address information of the laptop; the tablet responds to the pairing connection establishment request and establishes a pairing connection with the laptop based on the address information of the laptop.
[0161] In one scenario, the process of establishing a pairing connection between a laptop and a tablet computer via Wi-Fi Direct may include: the laptop computer establishing a Wi-Fi link layer connection with the tablet computer through channel search; after the Wi-Fi link layer connection is established, the laptop computer establishing a Transmission Control Protocol (TCP) data connection with the tablet computer; the laptop computer initiating a pairing connection establishment request (i.e., first request information) to the tablet computer via the TCP data connection, the pairing connection establishment request including the address information of the laptop computer; the tablet computer responding to the pairing connection establishment request and establishing a pairing connection with the laptop computer based on the address information of the laptop computer.
[0162] In one scenario, the process of establishing a pairing connection between a laptop and a tablet computer via Bluetooth may include: the laptop computer broadcasts outward via Bluetooth; the tablet computer generates a Bluetooth device list based on the received broadcast packet; the tablet computer calculates the signal strength of each Bluetooth device in the Bluetooth device list and sends a Bluetooth pairing connection request to the Bluetooth device with the largest signal strength; the laptop computer automatically pops up a pairing connection request dialog box and receives operation information input by the user, which operation information may be the user's consent to the pairing connection between the laptop computer and the tablet computer; the laptop computer responds to the operation information and establishes a Bluetooth pairing connection with the tablet computer.
[0163] Afterwards, the relative position information between the tablet computer and the laptop computer is determined using the position determination method of the embodiment of the present application. This automatically configures the relative position between the tablet computer screen and the laptop computer screen without requiring manual operation by the user, reducing the complexity of user configuration in extended screen scenarios. The relative position information can refer to any of the four directions (front, back, left, right, top, bottom, left, and right) of the tablet computer relative to the laptop computer, or it can refer to the specific three-dimensional coordinates of the tablet computer relative to the laptop computer.
[0164] For example, when a laptop computer needs to extend its display to a tablet computer, the laptop computer transmits a first sound wave signal and a second sound wave signal through its two built-in speakers. The laptop computer and the tablet computer receive the first and second sound wave signals through their two built-in microphones, respectively. After the tablet computer's two microphones receive the first and second sound wave signals, the tablet computer transmits a third and fourth sound wave signals through its two built-in speakers, respectively. The tablet computer and the laptop computer receive the third and fourth sound wave signals through their two built-in microphones, respectively.
[0165] During a round-trip transmission of sound wave signals between the tablet computer and the laptop computer, each microphone receives all sound wave signals and records the arrival times of all sound wave signals. The tablet computer can send the recorded arrival times of all sound wave signals received by each microphone on the tablet computer to the laptop computer. The laptop computer can determine the relative position information between the tablet computer and the laptop computer based on the recorded arrival times of all sound wave signals received by each microphone on the laptop computer and the received arrival times of all sound wave signals received by each microphone on the tablet computer. How to determine the relative position information between the tablet computer and the laptop computer will be described in detail in the following embodiments and will not be repeated here.
[0166] In the extended screen application scenario, the relative position information between the tablet computer and the laptop computer may include: the tablet computer is located in the left area of the laptop computer, the tablet computer is located in the right area of the laptop computer, the tablet computer is located in the front area of the laptop computer, and the tablet computer is located in the back area of the laptop computer, as shown in FIG4 .
[0167] It is understood that in extended screen applications, to avoid screen obstruction, when the tablet is located in the front area of the laptop, the tablet is generally located on the lower side in front of the laptop screen; when the tablet is located in the back area of the laptop, the tablet is generally located on the upper side behind the laptop screen. Therefore, in some scenarios, the tablet being located in the front area of the laptop can be understood as the tablet being located on the lower side of the laptop. The tablet being located in the back area of the laptop can also be understood as the tablet being located on the upper side of the laptop.
[0168] In addition, the tablet computer and the laptop computer can also send the arrival times of all sound wave signals received by each microphone recorded by each to other electronic devices, so that the other electronic devices can determine the relative position information between the tablet computer and the laptop computer.
[0169] It is understandable that after the laptop and tablet establish a pairing connection, the relative position information between the tablet and the laptop needs to be determined. And after the position of the tablet and / or the laptop changes, the relative position information between the tablet and the laptop also needs to be determined. For example, the tablet's accelerometer sensor, gyroscope sensor, or magnetometer sensor detects a change in the tablet's position, and the tablet sends a relative position information redetermination request to the laptop. This relative position information redetermination request is used to request the laptop to resend the first sound wave signal and the second sound wave signal through its two built-in speakers, and the tablet then resends the third sound wave signal and the fourth sound wave signal through its two built-in speakers. The laptop then determines the new relative position information between the tablet and the laptop by recording the arrival times of all new sound wave signals received by each microphone.
[0170] After the laptop computer determines the relative position between the tablet computer and the laptop computer in the aforementioned manner, it can automatically configure the extended screen layout based on this relative position information, i.e., automatically configure the orientation of the tablet computer's screen relative to the laptop computer's screen. In this way, the laptop computer can transmit the content displayed on the laptop computer's display interface to the tablet computer's display interface for display based on this screen layout. In this way, the user only needs to operate the laptop computer to transmit the content displayed on the laptop computer's display interface to the tablet computer's display interface for display.
[0171] The following describes how to extend a window from the laptop to the tablet computer for display, taking the tablet computer located in the front area of the laptop computer (such as in front of the keyboard, which can also be understood as below the screen) as an example.
[0172] The user drags the window downward in the laptop display interface, and the laptop responds to the user's operation by moving the first target content displayed in the window downward. As the user drags the window, the window moves downward in the laptop display interface. If the window moves to the first preset position of the laptop display interface and remains there for the first preset time, it means that the first part of the content of the window has been moved out of the laptop display interface. The tablet computer displays the first part of the content of the window, and the laptop computer displays the second part of the content of the window. The first part of the content of the window and the second part of the content of the window constitute the first target content displayed by the entire window. At this time, the laptop and the tablet computer display the window together. If the window moves to the second preset position of the laptop display interface and remains there for the second preset time, it means that the window has been completely moved out of the laptop display interface. At this time, the tablet computer displays all the contents of the window, namely the first target content, and the laptop computer no longer displays the window.
[0173] In one scenario, the laptop computer may further generate first guidance information for guiding a user to drag a document, webpage, window, or other content to the left, right, up, or down. The laptop computer receives a drag operation on the document, webpage, window, or other content; in response to the drag operation, the laptop computer sends the document, webpage, window, or other content to the display interface of the tablet computer for display.
[0174] For example, if the relative position information indicates that the tablet computer is located in the upper area of the laptop computer (such as the upper back of the screen), the laptop computer generates the first guidance information. The first guidance information is used to guide the user: the document, web page, window, etc. displayed on the display interface of the laptop computer can be dragged upward. For another example, if the relative position information indicates that the tablet computer is located in the left area of the laptop computer, the laptop computer generates the first guidance information. The first guidance information is used to guide the user: the document, web page, window, etc. displayed on the display interface of the laptop computer can be dragged to the left.
[0175] Exemplarily, the first guidance information can be displayed in the display interface of the laptop computer in the form of text. For example, if the relative position information indicates that the tablet computer is located in the right area of the laptop computer, then the first guidance information can be "Please drag XX to the right" displayed in the display interface. Exemplarily, the first guidance information can be displayed in the display interface of the laptop computer in the form of animation. For example, the laptop computer can simulate an animation of a person's hand dragging the window to the right on a certain window. Exemplarily, the first guidance information can be displayed in the display interface of the laptop computer in the form of a combination of animation and text. For example, the laptop computer can simulate an animation of a person's hand dragging the window to the right on a certain window and related text instructions.
[0176] After the laptop's display interface displays a first guidance message, such as the text "Please drag XX to the right," the user can use a mouse or touch screen to drag the document, webpage, window, or other content displayed on the laptop's display interface to the right. In response to this right-dragging operation, the laptop sends the document, webpage, window, or other content to the tablet computer. The tablet computer receives the document, webpage, window, or other content and displays it on its display interface. This allows the document, webpage, window, or other content in the laptop to be expanded and displayed on the tablet computer's display interface, located to the right of the laptop.
[0177] Of course, during the specific implementation process, the laptop computer may not display the first boot information, and the embodiment of the present application does not limit this.
[0178] In another scenario, if the laptop and / or tablet computer moves, causing the relative position information between the tablet computer and the laptop computer to change, and the changed relative position information indicates a different area than the original relative position information, the expansion direction between the laptop computer and the tablet computer will correspondingly change to point in the direction of the area indicated by the changed relative position information. For example, if the relative position information before the change indicates that the tablet computer is located in the right area of the laptop computer, and the relative position information after the change indicates that the tablet computer is located in the left area of the laptop computer, the expansion direction between the laptop computer and the tablet computer will correspondingly change from rightward expansion to leftward expansion.
[0179] Among them, the expansion direction may include rightward expansion, leftward expansion, upward expansion, and downward expansion. Rightward expansion can be: the user drags the document, web page, window and other content to the right in the display interface of the laptop computer, and the document, web page, window and other content is expanded to the tablet computer located in the right area of the laptop computer for display. Leftward expansion can be: the user drags the document, web page, window and other content to the left in the display interface of the laptop computer, and the document, web page, window and other content is expanded to the tablet computer located in the left area of the laptop computer for display. Upward expansion can be: the user drags the document, web page, window and other content upward in the display interface of the laptop computer, and the document, web page, window and other content is expanded to the tablet computer located in the upper area of the laptop computer for display. Downward expansion can be: the user drags the document, web page, window and other content downward in the display interface of the laptop computer, and the document, web page, window and other content is expanded to the tablet computer located in the front area of the laptop computer (in front of the keyboard or below the screen) for display.
[0180] Of course, during implementation, if the laptop computer and / or tablet computer moves, causing the relative position information between the tablet computer and the laptop computer to change, and the changed relative position information indicates a different area than the original relative position information, the extension direction between the laptop computer and the tablet computer may not change. This embodiment of the present application does not impose any limitation on this.
[0181] The movement of the tablet computer and / or laptop computer includes: movement of the tablet computer, movement of the laptop computer, or movement of the tablet computer and the laptop computer together.
[0182] In one scenario, if the expansion direction between the laptop and the tablet is changed, the laptop may generate a prompt message indicating that the expansion direction has changed to alert the user.
[0183] In one scenario, there can be multiple tablet computers, distributed to the left and top of the laptop (above and behind the screen). If a user drags a document, webpage, or window to the left on the laptop, the laptop responds to the drag and sends the document, webpage, or window to the tablet computer on the left side of the laptop for display. If a user drags the document, webpage, or window upward on the laptop, the laptop responds to the drag and sends the document, webpage, or window to the tablet computer on the top side of the laptop for display.
[0184] It is understood that in other scenarios where the relative position between two electronic devices needs to be identified, the relative position information between the two electronic devices can also be determined by the position determination method in the embodiment of the present application. This embodiment of the present application will not be described in detail.
[0185] The following will take ultrasonic signals as an example to describe in detail the process of determining the relative position information between two electronic devices provided in the embodiments of the present application.
[0186] For ease of introduction, in the embodiment of the present application, one of the two electronic devices may be referred to as a first electronic device, and the other electronic device may be referred to as a second electronic device.
[0187] FIG5 is a schematic diagram of a process for determining relative position information between a first electronic device and a second electronic device according to an embodiment of the present application. As shown in FIG5 , the process for determining relative position information between the first electronic device and the second electronic device may include:
[0188] S500: The first electronic device determines a measurement speaker and a measurement microphone on the first electronic device and the second electronic device for transmitting and receiving ultrasonic signals.
[0189] In this embodiment of the present application, the total number of measurement microphones and measurement speakers determined by the first electronic device and the second electronic device is at least six, and these measurement microphones and measurement speakers cannot be arranged in the same straight line. The first electronic device has at least one measurement speaker and at least one measurement microphone, and the second electronic device has at least one measurement speaker and at least one measurement microphone.
[0190] There are at least three different combinations between the measurement speaker and measurement microphone of the first electronic device and the measurement speaker and measurement microphone of the second electronic device, each combination including a measurement speaker and a measurement microphone of the first electronic device, and a measurement speaker and a measurement microphone of the second electronic device.
[0191] In the embodiment of the present application, the measurement speakers on the first electronic device may be all speakers on the first electronic device, or some speakers on the first electronic device. The measurement speakers on the second electronic device may be all speakers on the second electronic device, or some speakers on the second electronic device.
[0192] In a possible implementation, the first electronic device and the second electronic device may each have two measurement speakers and two measurement microphones.
[0193] As an example, as shown in Figure 6, the measurement speaker and measurement microphone on the first electronic device 601 may include speaker A, speaker B, microphone C and microphone D, and the measurement speaker and measurement microphone on the second electronic device 602 may include speaker E and speaker F, microphone G and microphone H.
[0194] There are 16 different combinations between the measurement speaker and the measurement microphone of the first electronic device 601 and the measurement speaker and the measurement microphone of the second electronic device 602, as shown in Table 1:
[0195] Table 1
[0196] Optionally, the first electronic device has at least three speakers. The first electronic device may select two speakers from the at least three speakers as measurement speakers of the first electronic device.
[0197] Optionally, the second electronic device has at least three speakers. The second electronic device can select two speakers from the at least three speakers as measurement speakers of the second electronic device.
[0198] In one possible implementation, the first electronic device may have one measurement speaker and three measurement microphones, and the second electronic device may have one measurement speaker and one measurement microphone. Alternatively, the first electronic device may have one measurement speaker and one measurement microphone, and the second electronic device may have one measurement speaker and three measurement microphones.
[0199] For example, the measurement speaker and measurement microphone on the first electronic device may include speaker a, microphone b, microphone c, and microphone d, and the measurement speaker and measurement microphone on the second electronic device may include speaker e and microphone f. There are three different combinations of the measurement speaker and measurement microphone of the first electronic device and the measurement speaker and measurement microphone of the second electronic device, as shown in Table 2:
[0200] Table 2
[0201] It should be noted that the first electronic device and the second electronic device may include other numbers of measurement microphones and measurement speakers. For example, the first electronic device has three measurement speakers and one measurement microphone, and the second electronic device has one measurement speaker and one measurement microphone. The above-mentioned numbers of measurement microphones and measurement speakers that the first electronic device and the second electronic device may include are only for illustration purposes and are not limited in the embodiments of the present application. It is sufficient to meet the aforementioned requirements, that is, the total number of microphones and speakers possessed by the two electronic devices is at least six, each of the two electronic devices has at least one microphone and at least one speaker, and these microphones and speakers cannot be arranged in the same straight line.
[0202] In some embodiments, after the first electronic device and the second electronic device establish a communication connection via a wired or wireless method (such as Bluetooth, Wi-Fi, etc.), the first electronic device and the second electronic device may determine a measurement speaker and a measurement microphone for transmitting and receiving ultrasonic signals.
[0203] As one approach, after a first electronic device successfully establishes a communication connection with a second electronic device, if the first electronic device needs to determine the location of the second electronic device relative to the first electronic device, the first electronic device can obtain the device information of the second electronic device and, based on this device information, determine information such as the number and location of speakers and microphones on the second electronic device. The first electronic device can then determine the measurement speakers and measurement microphones on the first and second electronic devices for transmitting and receiving ultrasonic signals based on the number and location information of its own speakers and microphones, as well as the number and location information of speakers and microphones on the second electronic device, in accordance with the aforementioned requirements for measurement speakers and measurement microphones.
[0204] In one scenario, the default determination method may be to determine two measurement speakers and two measurement microphones on each of the first electronic device and the second electronic device. When the microphones and speakers on the first electronic device and / or the second electronic device do not meet the default determination method, they can be determined according to the above-mentioned requirements for the measurement speakers and measurement microphones, that is, the total number of measurement microphones and measurement speakers determined by the first electronic device and the second electronic device is at least six, and these measurement microphones and measurement speakers cannot be arranged in the same straight line. The first electronic device has at least one measurement speaker and at least one measurement microphone, and the second electronic device has at least one measurement speaker and at least one measurement microphone.
[0205] Optionally, the first electronic device may notify the second electronic device of the determined measurement speaker and measurement microphone information on the second electronic device through the communication connection channel, so that the second electronic device can activate the corresponding measurement speaker to transmit ultrasonic signals and activate the corresponding measurement microphone to monitor ultrasonic signals.
[0206] In one scenario, when the first electronic device needs to perform extended display, such as detecting that an extended display application is opened or a preset operation is detected, the first electronic device needs to determine the position information of the second electronic device relative to the first electronic device.
[0207] Optionally, the embodiment of the present application uses an FMCW sequence with better autocorrelation performance as the ultrasonic signal for measurement, so that a sharper correlation peak can be extracted from the received signal, a more accurate signal arrival time can be obtained, and a more accurate position determination result can be obtained.
[0208] The FMCW sequence can be:
[0209] where f min is the minimum frequency of the signal, B is the signal bandwidth, and T is the period of the signal.
[0210] When using f s When sampling, The signal sampling points are:
[0211] At this time, the frequency of the signal increases linearly with time and is f at time 0. min , at time T is f max =f min +B.
[0212] Optionally, other sequences such as Zadoff-Chu sequence, Gold pseudo-random sequence, orthogonal frequency division multiplexing (OFDM) sequence, etc. may be used as ultrasonic signals for measurement, which is not limited in the embodiment of the present application.
[0213] S510: The first electronic device sends a first ultrasonic signal to the second electronic device through a measuring speaker, and receives the first ultrasonic signal through a measuring microphone.
[0214] After the first electronic device determines the measurement speaker and the measurement microphone, the first electronic device can turn on the measurement speaker to emit ultrasonic signals and turn on the measurement microphone to monitor ultrasonic signals. If the first electronic device has multiple measurement microphones, each measurement microphone on the first electronic device can monitor ultrasonic signals.
[0215] If the first electronic device has multiple measurement speakers, such as a left-channel speaker and a right-channel speaker, the first electronic device can sequentially transmit the first ultrasonic signal to the second electronic device through the multiple measurement speakers. Since the measurement microphone on the first electronic device is already monitoring, the measurement microphone on the first electronic device will also receive the multiple first ultrasonic signals.
[0216] Optionally, the first ultrasonic signals transmitted successively by the multiple measuring speakers on the first electronic device are ultrasonic signals with different characteristics, such as ultrasonic signals of different frequency bands or ultrasonic signals of different orthogonal sequences. Of course, the first ultrasonic signals transmitted successively by the multiple measuring speakers may also be ultrasonic signals with the same characteristics.
[0217] Optionally, multiple measurement speakers on the first electronic device sequentially transmit first ultrasonic signals at first time intervals, with each first ultrasonic signal lasting for a first duration. The first time interval and the first duration can be reasonably set in advance based on the application scenario, and the embodiments of the present application do not limit the first time interval and the first duration. For example, the first time interval can be 100ms, and the first duration can be 60ms.
[0218] In one possible implementation, when the first electronic device monitors a signal through the measurement microphone, the first electronic device may perform signal detection on the signal monitored by the measurement microphone to determine whether the first ultrasonic signal is detected. When the first electronic device successfully detects the signal from the measurement microphone, that is, detects the first ultrasonic signal, it can be determined that the measurement microphone on the first electronic device has successfully received the first ultrasonic signal.
[0219] When the first electronic device fails to detect the signal of the measuring microphone, that is, when the first ultrasonic signal is not detected, it can be determined that the measuring microphone on the first electronic device has not successfully received the first ultrasonic signal. The first electronic device can continue to monitor the signal through the measuring microphone. If the signal detection still fails after continuing to monitor for the preset time, the first electronic device can resend the first ultrasonic signal to the second electronic device through the measuring speaker until the signal detection of the measuring microphone on the first electronic device is successful. It can be understood that if the first electronic device resends the first ultrasonic signal, even if the second electronic device has previously received the first ultrasonic signal, the second electronic device will still discard the first ultrasonic signal received last time in order to re-receive the first ultrasonic signal resent by the first electronic device.
[0220] Optionally, the first electronic device may filter noise on the signal monitored by the measuring microphone and then match the filtered non-noise signal with a pre-stored template of the first ultrasonic signal to determine whether the monitored signal is the first ultrasonic signal based on the matching result.
[0221] S520: After receiving the first ultrasonic signal through the measuring microphone, the second electronic device sends a second ultrasonic signal to the first electronic device through the measuring speaker, and receives the second ultrasonic signal through the measuring microphone.
[0222] After the second electronic device determines the measuring speaker and the measuring microphone, the second electronic device can turn on the measuring microphone to monitor the ultrasonic signal. Therefore, when the first electronic device sends the first ultrasonic signal through the measuring speaker, the second electronic device can receive the first ultrasonic signal through the measuring microphone.
[0223] In one possible implementation, when the second electronic device monitors a signal through the measurement microphone, the second electronic device may perform signal detection on the signal monitored by the measurement microphone to determine whether the first ultrasonic signal is detected. When the second electronic device successfully detects the signal from the measurement microphone, that is, detects the first ultrasonic signal, it can be determined that the measurement microphone on the second electronic device has successfully received the first ultrasonic signal.
[0224] When the second electronic device fails to detect the signal from the measuring microphone, that is, when it does not detect the first ultrasonic signal, it can be determined that the measuring microphone on the second electronic device has not successfully received the first ultrasonic signal. The measuring microphone on the second electronic device can continue to monitor for signals. If the signal detection fails after continuing to monitor for a preset period of time, the first electronic device can resend the first ultrasonic signal to the second electronic device through the measuring speaker until the measuring microphone on the second electronic device successfully detects the signal.
[0225] Optionally, the second electronic device can filter the noise of the signal monitored by the measuring microphone and then match the filtered non-noise signal with a pre-stored template of the first ultrasonic signal to determine whether the monitored signal is the first ultrasonic signal based on the matching result.
[0226] In one possible implementation, when the second electronic device performs signal detection on the signal monitored by the measurement microphone, the second electronic device may transmit a result of signal detection success or signal detection failure to the first electronic device via the communication connection channel, so that the first electronic device can determine whether to resend the first ultrasonic signal.
[0227] Optionally, when the first electronic device sends the first ultrasonic signal in sequence through multiple measuring speakers, the second electronic device can receive the first ultrasonic signal sent from each measuring speaker on the first electronic device through the measuring microphone.
[0228] Optionally, when there are multiple measuring microphones on the second electronic device, each measuring microphone on the second electronic device may receive the first ultrasonic signal from the first electronic device.
[0229] In an embodiment of the present application, after the second electronic device receives the first ultrasonic signal via the measurement microphone, the second electronic device may transmit a second ultrasonic signal to the first electronic device via the measurement speaker. At this time, since the measurement microphone on the second electronic device has been enabled for monitoring, the measurement microphone on the second electronic device will also receive the second ultrasonic signal. The second ultrasonic signal and the first ultrasonic signal may have different characteristics, or they may have the same characteristics. This embodiment of the present application is not limited to this.
[0230] Optionally, the second electronic device again detects the signal monitored by the measuring microphone to determine whether a second ultrasonic signal is detected. If the second electronic device successfully detects the signal from the measuring microphone, i.e., detects the second ultrasonic signal, it can be determined that the measuring microphone on the second electronic device has successfully received the second ultrasonic signal.
[0231] When the second electronic device fails to detect the signal from the measuring microphone, that is, when the second ultrasonic signal is not detected, it can be determined that the measuring microphone on the second electronic device has not successfully received the second ultrasonic signal. The second electronic device can continue to monitor the signal through the measuring microphone. If the signal detection still fails after continuing to monitor for the preset time, the second electronic device can resend the second ultrasonic signal to the first electronic device through the measuring speaker until the signal detection of the measuring microphone on the second electronic device is successful. It can be understood that if the second electronic device resends the second ultrasonic signal, even if the first electronic device has previously received the second ultrasonic signal, the first electronic device will still discard the second ultrasonic signal received last time in order to re-receive the second ultrasonic signal resent by the second electronic device.
[0232] Optionally, when the second electronic device has multiple measurement speakers, such as a left-channel speaker and a right-channel speaker, the second electronic device sequentially transmits the second ultrasonic signals to the first electronic device through the multiple measurement speakers. At this time, because the measurement microphone on the second electronic device is already monitoring, the second electronic device also receives the multiple second ultrasonic signals through the measurement microphone.
[0233] Optionally, the second ultrasonic signals transmitted successively by the multiple measuring speakers on the second electronic device are ultrasonic signals with different characteristics, such as ultrasonic signals of different frequency bands or ultrasonic signals of different orthogonal sequences. Of course, the second ultrasonic signals transmitted successively by the multiple measuring speakers may also be ultrasonic signals with the same characteristics.
[0234] Optionally, multiple measurement speakers on the second electronic device sequentially transmit second ultrasonic signals at second time intervals, with each second ultrasonic signal lasting for a second duration. The second time interval and the second duration can be reasonably set in advance based on the application scenario, and the embodiments of this application do not limit the second time interval and the second duration. For example, the second time interval can be 100ms, and the second duration can be 60ms.
[0235] In a possible implementation, after the measuring speakers on the first electronic device complete sending the first ultrasonic signal, the measuring speakers on the second electronic device complete sending the second ultrasonic signal.
[0236] As an example, in combination with the first electronic device and the second electronic device in Figure 6, Figure 7 shows a schematic diagram of a signal transmission process provided by an embodiment of the present application. As shown in Figure 7, the speaker A and the speaker B on the first electronic device first send a first ultrasonic signal at an interval of 100ms, and each first ultrasonic signal lasts for 50ms. After the microphones C, D, G, and H on the first electronic device and the second electronic device confirm that they have received the above two first ultrasonic signals, the speaker F and the speaker E on the second electronic device then send a second ultrasonic signal at an interval of 100ms, and each second ultrasonic signal lasts for 50ms.
[0237] In another possible implementation, the measuring speaker on the first electronic device and the measuring speaker on the second electronic device are switched back and forth (ie, transmitted in turn) to complete the transmission of the ultrasonic signal.
[0238] As an example, in combination with the first electronic device and the second electronic device in Figure 6, Figure 8 shows a schematic diagram of another signal transmission process provided by an embodiment of the present application. As shown in Figure 8, the first ultrasonic signal is first sent by the speaker A on the first electronic device. After the microphones C, D, G, and H on the first electronic device and the second electronic device confirm receipt of the first ultrasonic signal, the second ultrasonic signal is sent by the speaker F on the second electronic device. After the microphones C, D, G, and H on the first electronic device and the second electronic device confirm receipt of the second ultrasonic signal, the first ultrasonic signal is sent back to the speaker B on the first electronic device. After the microphones C, D, G, and H on the first electronic device and the second electronic device confirm receipt of the first ultrasonic signal, the second ultrasonic signal is sent back to the speaker E on the second electronic device.
[0239] In one possible implementation, as shown in FIG7 or FIG8 , each measuring speaker on the first electronic device and the second electronic device transmits the ultrasonic signal only once. When any measuring microphone on the first electronic device or the second electronic device fails to detect the signal, the corresponding measuring speaker will retransmit the first ultrasonic signal.
[0240] In another possible implementation, each measuring speaker on the first electronic device and the second electronic device may send ultrasonic signals multiple times to ensure a success rate of signal detection.
[0241] As an example, in combination with the first electronic device and the second electronic device in Figure 6, Figure 9 shows a schematic diagram of another signal transmission process provided by an embodiment of the present application. As shown in Figure 9, the speaker A and the speaker B on the first electronic device first send out a first ultrasonic signal three times at an interval of 100ms, and each first ultrasonic signal lasts for 50ms. After the microphones C, D, G, and H on the first electronic device and the second electronic device confirm that they have received the first ultrasonic signal sent by the above-mentioned two speakers A and speaker B, the speaker F and the speaker E on the second electronic device then send out a second ultrasonic signal three times at an interval of 100ms, and each second ultrasonic signal lasts for 50ms.
[0242] Optionally, when multiple ultrasonic signal detections fail, the first electronic device abandons subsequent steps, i.e., stops determining the relative position information between the first electronic device and the second electronic device. Optionally, when a change in the position of the first electronic device and / or the second electronic device is detected, the first electronic device restarts the position determination method provided in the embodiment of the present application to restart determining the relative position information between the first electronic device and the second electronic device.
[0243] S530. After the first electronic device receives the second ultrasonic signal through the measuring microphone, the sum of the round-trip distances between the measuring speaker and the measuring microphone in each combination is determined based on the time difference between the first ultrasonic signal and the second ultrasonic signal received by each measuring microphone of the first electronic device and the second electronic device.
[0244] Because the measurement microphone on the first electronic device has been enabled for monitoring, when the second electronic device sends the second ultrasonic signal to the first electronic device through the measurement speaker, the first electronic device can receive the second ultrasonic signal through the measurement microphone.
[0245] In one possible implementation, when the first electronic device monitors a signal through the measurement microphone, the first electronic device may perform signal detection on the signal monitored by the measurement microphone to determine whether the second ultrasonic signal is detected. When the first electronic device successfully detects the signal from the measurement microphone, that is, when the second ultrasonic signal is detected, it can be determined that the measurement microphone on the first electronic device has successfully received the second ultrasonic signal.
[0246] When the first electronic device fails to detect the signal from the measuring microphone, i.e., fails to detect the second ultrasonic signal, it can be determined that the measuring microphone on the first electronic device has failed to successfully receive the second ultrasonic signal. The measuring microphone on the first electronic device can continue to monitor for signals. If the signal detection fails after continuing to monitor for a preset period of time, the second electronic device can resend the second ultrasonic signal to the first electronic device through the measuring speaker until the measuring microphone on the first electronic device successfully detects the signal.
[0247] Optionally, the first electronic device may filter noise on the signal monitored by the measuring microphone and then match the filtered non-noise signal with a pre-stored template of the second ultrasonic signal to determine whether the monitored signal is the second ultrasonic signal based on the matching result.
[0248] In one possible implementation, when the first electronic device performs signal detection on the signal monitored by the measurement microphone, the first electronic device may transmit a result of signal detection success or signal detection failure to the second electronic device via the communication connection channel, so that the second electronic device can determine whether to resend the second ultrasonic signal.
[0249] Optionally, when the second electronic device sends the second ultrasonic signal in sequence through a plurality of measuring speakers, the first electronic device may receive the second ultrasonic signal sent from each measuring speaker on the second electronic device through the measuring microphone.
[0250] Optionally, when there are multiple measuring microphones on the first electronic device, each measuring microphone on the first electronic device may receive the second ultrasonic signal from the second electronic device.
[0251] In the embodiment of the present application, after the first electronic device receives the second ultrasonic signal through the measuring microphone, the first electronic device can determine the time difference between the first ultrasonic signal and the second ultrasonic signal received by the respective measuring microphones of the first electronic device and the second electronic device.
[0252] When each of the measurement microphones of the first and second electronic devices receives the first and second ultrasonic signals, the first and second electronic devices may record a first arrival time of the first ultrasonic signal at each of the measurement microphones, as well as a second arrival time of the second ultrasonic signal at each of the measurement microphones. The second electronic device then transmits all recorded arrival time results to the first electronic device via the communication channel.
[0253] In this way, for any measuring microphone on the first electronic device and the second electronic device, the first electronic device can determine the arrival time difference between the first ultrasonic signal and the second ultrasonic signal on the measuring microphone based on the first arrival time of the first ultrasonic signal and the second arrival time of the second ultrasonic signal, that is, the time difference between the second arrival time and the first arrival time.
[0254] In one scenario, for any measuring microphone on the second electronic device, the second electronic device can also determine the arrival time difference between the first ultrasonic signal and the second ultrasonic signal at that measuring microphone based on the recorded arrival times, and then send all arrival time difference results for all measuring microphones to the first electronic device. In this way, the first and second electronic devices can each calculate all arrival time difference results for their respective measuring microphones.
[0255] In one scenario, for any measuring microphone on the second electronic device, the second electronic device can also send audio information of the first ultrasonic signal and the second sound wave signal received by the measuring microphone to the first electronic device, and the first electronic device determines the arrival time difference between the first ultrasonic signal and the second ultrasonic signal on the measuring microphone based on the audio information.
[0256] In one possible implementation, when calculating the arrival time of an ultrasonic signal received by any measuring microphone, a convolution operation can be performed on the audio data stream received by the measuring microphone and the original ultrasonic signal sent by the corresponding measuring speaker to obtain a signal correlation peak, and then the arrival time of the ultrasonic wave can be determined based on the position of the signal correlation peak, i.e., the delay.
[0257] Optionally, the arrival time of the ultrasonic wave can be determined based on the location of the signal's maximum correlation peak. The signal correlation peak can indicate the similarity between the audio data stream received by the measurement microphone and the original ultrasonic signal. When the maximum correlation peak appears, it can be understood that the audio data stream currently received by the measurement microphone has the highest similarity to the original ultrasonic signal. It can be assumed that the audio data stream currently received by the measurement microphone contains the original ultrasonic signal transmitted by the corresponding measurement speaker, meaning that the measurement microphone has successfully received the original ultrasonic signal transmitted by the corresponding measurement speaker.
[0258] In one possible implementation, the first electronic device and / or the second electronic device may calculate and record the arrival time of each ultrasonic signal in real time when each measuring microphone receives each ultrasonic signal, or may calculate and record the arrival time of each ultrasonic signal uniformly after all ultrasonic signals are received. This embodiment of the present application is not limited to this.
[0259] Optionally, when the first electronic device sends the first ultrasonic signal successively through multiple measuring speakers, any measuring microphone on the first electronic device and the second electronic device will receive the first ultrasonic signal sent by each measuring speaker on the first electronic device, and thus record the first arrival time of the first ultrasonic signal sent by each measuring speaker reaching the measuring microphone.
[0260] Thus, even with the same measurement microphone, the first arrival times recorded for the first ultrasonic signal transmitted by different measurement speakers on the first electronic device are different. Similarly, the second arrival times recorded for the second ultrasonic signal transmitted by different measurement speakers on the second electronic device are also different. Consequently, the time differences between the first and second ultrasonic signals from different measurement speakers are also different.
[0261] In the embodiment of the present application, the first electronic device can determine the time difference between the first ultrasonic signal and the second ultrasonic signal received by the measurement microphone in each combination based on the first ultrasonic signal and the second ultrasonic signal sent by the measurement speakers in the aforementioned different combinations.
[0262] For example, in conjunction with the first electronic device and the second electronic device shown in FIG6 , the first electronic device 601 transmits a first ultrasonic signal through two measurement speakers A and B, and the second electronic device 602 transmits a second ultrasonic signal through two measurement speakers E and F. The first electronic device 601 receives the first ultrasonic signal transmitted from the measurement speakers A and B and the second ultrasonic signal transmitted from the measurement speakers E and F through two measurement microphones C and D, and the second electronic device 602 receives the first ultrasonic signal transmitted from the measurement speakers A and B and the second ultrasonic signal transmitted from the measurement speakers E and F through two measurement microphones G and H.
[0263] Since there are 16 different combinations of the measurement speaker and measurement microphone of the first electronic device 601 and the measurement speaker and measurement microphone of the second electronic device 602, as shown in Table 1, the first electronic device 601 can determine the time difference between the first ultrasonic signal and the second ultrasonic signal received by the measurement microphone in the corresponding combination based on the first ultrasonic signal and the second ultrasonic signal sent by the measurement speaker in each combination.
[0264] Taking combination 1 in Table 1 as an example, if the first electronic device transmits a first ultrasonic signal through speaker A, microphone C on the first electronic device receives the first ultrasonic signal at time t1, and microphone G on the second electronic device receives the first ultrasonic signal at time t2, and then the second electronic device transmits a second ultrasonic signal through speaker F, microphone C on the first electronic device receives the second ultrasonic signal at time t3, and microphone G on the second electronic device receives the second ultrasonic signal at time t4. In combination 1, the time difference between microphone C on the first electronic device receiving the first ultrasonic signal from speaker A and the second ultrasonic signal from speaker F is (t3-t1), and the time difference between microphone G on the second electronic device receiving the first ultrasonic signal from speaker A and the second ultrasonic signal from speaker F is (t4-t2).
[0265] Taking combination 2 in Table 1 as an example, if the second electronic device transmits a second ultrasonic signal through speaker E, microphone C on the first electronic device receives the second ultrasonic signal at time t5, and microphone G on the second electronic device receives the second ultrasonic signal at time t6. In combination 2, the time difference between microphone C on the first electronic device receiving the first ultrasonic signal from speaker A and the second ultrasonic signal from speaker E is (t5 - t1), and the time difference between microphone G on the second electronic device receiving the first ultrasonic signal from speaker A and the second ultrasonic signal from speaker E is (t6 - t2).
[0266] It is understandable that the time difference between the first ultrasonic signal and the second ultrasonic signal received by the measuring microphone in other combinations can also be obtained, which will not be introduced here.
[0267] It can be understood that, based on the introduction of the aforementioned two-way ranging algorithm, the sum of the round-trip distances of a group of speakers and microphones between two devices can be obtained by converting the time difference between the two sound wave signals received by the microphone in the group and the distance between the speakers and microphones inside the devices in the group by the speed of sound wave signal propagation. Therefore, in an embodiment of the present application, after determining the time difference between the first ultrasonic signal and the second ultrasonic signal received by the measuring microphone in each combination, the first electronic device can determine the sum of the round-trip distances between the measuring speaker and the measuring microphone in each combination according to the principle of the aforementioned two-way ranging algorithm.
[0268] For example, taking combination 1 in Table 1 as an example, the sum of the round-trip distances of the speaker A and microphone C on the first electronic device and the speaker F and microphone G on the second electronic device is: AG+CF=C[(t3-t1)-(t4-t2)]+d AC +d FG , formula (10)
[0269] Among them, d AC is the distance between the speaker A and the microphone C in the first electronic device, d FG is the distance between the speaker F and the microphone G in the first electronic device.
[0270] Taking combination 2 in Table 1 as an example, the sum of the round-trip distances of the speaker A and microphone C on the first electronic device and the speaker E and microphone G on the second electronic device is: AG + CE = C [(t5 - t1) - (t6 - t2)] + d AC +d EG , formula (11)
[0271] Among them, d AC is the distance between the speaker A and the microphone C in the first electronic device, d EG is the distance between the speaker E and the microphone G in the first electronic device.
[0272] It is understandable that the sum of the distances between the measuring speakers and the measuring microphones in other combinations can also be obtained, which will not be introduced here.
[0273] Because the device form factors are fixed, the positions of the speaker and microphone on the first electronic device are also fixed, and the positions of the speaker and microphone on the second electronic device are also fixed. The first electronic device can obtain the distance between the speaker and microphone in the first electronic device based on the device information of the first electronic device, and can also obtain the distance between the speaker and microphone in the second electronic device based on the device information of the second electronic device.
[0274] Optionally, after the first electronic device establishes a communication connection with the second electronic device, the first electronic device reads device information, such as the device model, of the second electronic device through the communication connection channel. The first electronic device then searches the database for device information corresponding to the device model, thereby accurately determining the distance between the speaker and microphone in the second electronic device.
[0275] In this way, the first electronic device can obtain the sum of the distances between the measuring speaker and the measuring microphone in each combination by using the known distance between the speaker and the microphone in the first electronic device, the known distance between the speaker and the microphone in the second electronic device, and the recorded time difference between the first ultrasonic signal and the second ultrasonic signal received by the measuring microphone in each combination.
[0276] S540: The first electronic device determines relative position information between the first electronic device and the second electronic device according to the sum of the distances of each combination.
[0277] In one possible implementation, after obtaining the sum of the distances between the speaker and the microphone in each combination, the first electronic device can construct a mathematical model based on the sum of the distances of each combination to solve the relative position information between the first electronic device and the second electronic device through the mathematical model.
[0278] Optionally, as shown in Figure 10, the first electronic device first establishes a three-dimensional coordinate system O-XYZ with the center point O of the first electronic device as the origin, and then the first electronic device obtains the relative position information between the first electronic device and the second electronic device by solving the coordinates of the center point P of the second electronic device in the three-dimensional coordinate system.
[0279] As an example, when the center point O of the first electronic device is used as the origin, the first electronic device can directly obtain the coordinates of the measurement microphone and measurement speaker on the first electronic device based on the known positions of the speaker and microphone on the first electronic device. Since the positions of the speaker and microphone on the second electronic device are fixed, the first electronic device can set the coordinates of the center point P of the second electronic device to (x, y, z) and represent the coordinates of the measurement microphone and measurement speaker on the second electronic device using the coordinates of P (x, y, z). The first electronic device can then represent the sum of the distances of each combination using the coordinates of the measurement microphone and measurement speaker on the first and second electronic devices.
[0280] Since the coordinates of the measurement microphone and measurement speaker on the second electronic device can be represented by the coordinates (x, y, z) of P, and the coordinates of the measurement microphone and measurement speaker on the first electronic device are known, the sum of the distances of each combination can ultimately be represented by the coordinates (x, y, z) of P. Since the sum of the distances of each combination has been calculated in step S540, the first electronic device can therefore solve for the coordinates (x, y, z) of P. Thus, based on the solved coordinates (x, y, z) of P, the first electronic device can obtain the relative position information between the first and second electronic devices. This relative position information can include the position coordinates of the second electronic device relative to the first electronic device, or can include the four directions of the second electronic device relative to the first electronic device: front, back, left, right (or up, down, left, right).
[0281] It is understood that the first electronic device may also establish a three-dimensional coordinate system with the center point of the second electronic device as the origin. The first electronic device then obtains the relative position information between the first and second electronic devices by solving the coordinates of the center point of the first electronic device in the three-dimensional coordinate system. This relative position information may include the three-dimensional coordinates of the first electronic device relative to the second electronic device, or may include the four orientations of the first electronic device relative to the second electronic device: front, back, left, right (or up, down, left, and right).
[0282] In a possible implementation, the first electronic device may use a spatial traversal search method to find the most likely location of the second electronic device as the determined location of the second electronic device.
[0283] Optionally, the first electronic device first establishes a three-dimensional coordinate system O-XYZ with the center point O of the first electronic device as the origin, and selects a rectangular area in the three-dimensional coordinate system for search. For example, the ranges of the rectangular area on the X, Y and Z axes are [-50cm, 50cm], [-50cm, 50cm] and [0cm, 50cm] respectively. The first electronic device then divides the area into grids with a step size of 2cm, and the center point of each grid is used as the candidate position of the second electronic device. For each candidate position, the first electronic device can calculate the true value of the sum of the distances of each combination between the second electronic device and the first electronic device, and use the sum of the distances of each combination calculated using the time difference as the measured value. The first electronic device can then match the true value with the measured value to obtain the best-matching grid to determine as the determined position of the second electronic device. After determining the position of the second electronic device, the first electronic device obtains the relative position information between the first electronic device and the second electronic device based on the position of the second electronic device.
[0284] Alternatively, the first electronic device may perform a subtraction between the true value and the measured value and sum the subtraction to obtain an error value. The first electronic device may determine the network with the smallest error value as the most matching grid.
[0285] In a possible implementation, after determining the position of the second electronic device, the first electronic device may determine the orientation of the second electronic device relative to the first electronic device.
[0286] As an example, the first electronic device may divide the surrounding area into four areas: front, back, left, and right (or top, bottom, left, and right). The first electronic device may determine the relative position of the second electronic device based on the area where the second electronic device is located in the four areas.
[0287] For example, as shown in (a) and (b) of FIG11 , when the center point O of the first electronic device is the origin and a three-dimensional coordinate system O-XYZ is established, in the XY plane (i.e., the horizontal plane) of the coordinate system, with the Y axis at 0° and the clockwise direction of the top-down viewing angle as the angle growth direction, the XY plane is divided into four sector-shaped areas, covering [-45°, 45°], [45°, 135°], [135°, 225°], and [225°, 315°], respectively, corresponding to the four areas of 'rear area (upper area)', 'right area', 'front area (lower area)', and 'left area'. This corresponds to the four directions of 'rear (upper)', 'right', 'front (lower)', and 'left' of the first electronic device.
[0288] When the position of the second electronic device obtained in the above manner falls within the above four areas, the first electronic device can convert the relative position of the second electronic device.
[0289] Optionally, after the position of the first electronic device and / or the second electronic device is changed, the first electronic device may re-determine the relative position information between the first electronic device and the second electronic device.
[0290] Exemplarily, the first electronic device and the second electronic device can both detect whether their respective positions have changed through built-in accelerometer sensors, gyroscope sensors, or magnetometer sensors. If the position of the first electronic device and / or the second electronic device changes, the relative position information between the first electronic device and the second electronic device may change. For example, the second electronic device is located in the left area of the first electronic device. After the position of the first electronic device and / or the second electronic device changes, the second electronic device may be located in the front area (or lower area) of the first electronic device. Therefore, after the position of the first electronic device and / or the second electronic device changes, it is necessary to redetermine the relative position information between the first electronic device and the second electronic device.
[0291] In one scenario, when the first electronic device detects a change in the position of the first electronic device through a built-in accelerometer sensor, gyroscope sensor, or magnetometer sensor, the first electronic device re-executes the steps of sending a first sound wave signal to the second electronic device through a measuring speaker and receiving a first ultrasonic signal through a measuring microphone, as well as subsequent steps, to re-determine the relative position information between the first electronic device and the second electronic device.
[0292] In another scenario, if the second electronic device detects a change in its position via a built-in accelerometer, gyroscope, or magnetometer sensor, the second electronic device sends a relative position information determination request to the first electronic device via the communication channel. In response to the relative position information determination request, the first electronic device re-executes the steps of sending the first sound wave signal to the second electronic device via the measurement speaker and receiving the first ultrasonic signal via the measurement microphone, as well as subsequent steps, to re-determine the relative position information between the first and second electronic devices.
[0293] In a possible implementation manner, the position determination method of the embodiment of the present application may also be performed by a second electronic device. For example, the second electronic device determines the measuring speaker and measuring microphone for sending and receiving ultrasonic signals on the first electronic device and the second electronic device. For another example, the second electronic device first sends a first ultrasonic signal to the first electronic device through the measuring speaker, and receives the first ultrasonic signal through the measuring microphone. After the first electronic device receives the first ultrasonic signal through the measuring microphone, the first electronic device sends a second ultrasonic signal to the second electronic device through the measuring speaker, and receives the second ultrasonic signal through the measuring microphone. For another example, after the second electronic device receives the second ultrasonic signal through the measuring microphone, the second electronic device determines the sum of the distances between the measuring speaker and the measuring microphone in each combination based on the time difference between the first ultrasonic signal and the second ultrasonic signal received by each measuring microphone of the first electronic device and the second electronic device, and the second electronic device determines the relative position information between the first electronic device and the second electronic device based on the sum of the distances of each combination.
[0294] The position determination method provided in the embodiment of the present application can realize two-way ranging of multiple speakers and microphones between the first electronic device and the second electronic device by measuring ultrasonic signals using multiple speakers and microphones between the first electronic device and the second electronic device, so that the four directions of the front, back, left, right (or up, down, left, right) of the second electronic device relative to the first electronic device can be identified in combination with the distance between multiple pairs of speakers and microphones, or the three-dimensional coordinates of the second electronic device relative to the first electronic device can be identified. In this way, the relative position information between the first electronic device and the second electronic device can be automatically identified without the user actively setting it. Therefore, in some scenarios, the interactive operation between the first electronic device and the second electronic device can be realized based on the relative position information, thereby enhancing the degree of cooperation between the first electronic device and the second electronic device and expanding the use scenarios of the first electronic device and the second electronic device.
[0295] In some scenarios, when the first electronic device has at least two speakers and at least two microphones, and the second electronic device has at least two speakers and at least two microphones, the first electronic device can select two measurement speakers and two measurement microphones to implement the position determination method provided in the embodiment of the present application, and the second electronic device can select two measurement speakers and two measurement microphones to implement the position determination method provided in the embodiment of the present application.
[0296] For example, as shown in FIG12 , when the first electronic device has a first speaker A, a second speaker B, a first microphone C, and a second microphone D, and the second electronic device has a third speaker F, a fourth speaker E, a third microphone G, and a fourth microphone H, all the speakers and microphones on the first electronic device and the second electronic device can be directly used as measurement speakers and measurement microphones to implement the position determination method provided in the embodiment of the present application.
[0297] The following will take the first electronic device and the second electronic device shown in Figure 12 as an example to illustrate the process of determining the relative position information between the first electronic device and the second electronic device provided in the embodiment of the present application.
[0298] FIG13 is a schematic diagram of a process for determining relative position information between a first electronic device and a second electronic device according to an embodiment of the present application. As shown in FIG13 , the process for determining relative position information between the first electronic device and the second electronic device may include:
[0299] Optionally, the first electronic device and the second electronic device first establish a pairing connection via a wired or wireless method. For example, the pairing connection is established via Bluetooth wirelessly. In some embodiments, before the first electronic device and the second electronic device establish a pairing connection, the first electronic device has already opened the extended display application. Alternatively, after the first electronic device and the second electronic device establish a pairing connection, the first electronic device may open the extended display application. For related descriptions, please refer to the content of the aforementioned extended screen scenario and will not be repeated here.
[0300] Since the extended display application needs to obtain the relative position information between the first electronic device and the second electronic device, the first electronic device can execute the position determination method provided in the embodiment of the present application when detecting that the extended display application is running.
[0301] Optionally, when the first electronic device detects that the extended display application is running, it can turn on the first microphone C and the second microphone D for monitoring, and notify the second electronic device through the above connection channel to turn on the third microphone G and the fourth microphone H for monitoring. The first electronic device can then start to perform the following steps.
[0302] S1310: The first electronic device sends a first ultrasonic signal to the second electronic device through the first speaker and the second speaker, and receives the first ultrasonic signal through the first microphone and the second microphone.
[0303] Optionally, after the first electronic device transmits the first ultrasonic signal through the first speaker and the second speaker, the first electronic device performs signal detection on the signals monitored by the first microphone and the second microphone to determine whether the first ultrasonic signal is detected. If the first ultrasonic signal is detected, the first electronic device determines that the first microphone and the second microphone have successfully received the first ultrasonic signal. If the first ultrasonic signal is not detected, the first electronic device may continue to monitor for signals and perform signal detection.
[0304] Optionally, if the first ultrasonic signal is still not detected after continuing to monitor for a preset period of time, the first electronic device re-sends the first ultrasonic signal through the first speaker and the second speaker.
[0305] S1320: The second electronic device receives the first ultrasonic signal through the third microphone and the fourth microphone.
[0306] Optionally, the second electronic device performs signal detection on the signals monitored by the third microphone and the fourth microphone to determine whether the first ultrasonic signal is detected.
[0307] If the first ultrasonic signal is detected, the second electronic device determines that the third and fourth microphones have successfully received the first ultrasonic signal. If the first ultrasonic signal is not detected, the second electronic device may continue to monitor for signals and perform signal detection. Optionally, if the first ultrasonic signal is still not detected after a preset monitoring period, the first electronic device may retransmit the first ultrasonic signal through the first and second speakers.
[0308] Optionally, the second electronic device transmits the result of the signal detection success to the first electronic device, so that the first electronic device can determine whether the microphone of the second electronic device successfully received the first ultrasonic signal. If, after a predetermined period of time, the microphone of the second electronic device still fails to receive the first ultrasonic signal, the first electronic device retransmits the first ultrasonic signal through the first speaker and the second speaker.
[0309] S1330: The second electronic device sends a second ultrasonic signal to the first electronic device through the third speaker and the fourth speaker, and receives the second ultrasonic signal through the third microphone and the fourth microphone.
[0310] Optionally, after the microphones on both the first and second electronic devices detect the first ultrasonic signal, the second electronic device transmits a second ultrasonic signal to the first electronic device via the third and fourth speakers. The second electronic device then performs a signal detection on the signals monitored by the third and fourth microphones to determine whether the second ultrasonic signal is detected. If the second ultrasonic signal is detected, the second electronic device determines that the third and fourth microphones have successfully received the second ultrasonic signal. If the second ultrasonic signal is not detected, the first electronic device may continue to monitor for signals and perform signal detection.
[0311] Optionally, if the second ultrasonic signal is still not detected after continuing to monitor for a preset time period, the second electronic device re-sends the second ultrasonic signal through the third speaker and the fourth speaker.
[0312] S1340: The first electronic device receives a second ultrasonic signal through the first microphone and the second microphone.
[0313] Optionally, after the microphones on both the first electronic device and the second electronic device detect the first ultrasonic signal, the microphone on the first electronic device continues to maintain the monitoring state to receive the second ultrasonic signal from the second electronic device. The first electronic device then again detects the signals monitored by the first microphone and the second microphone to determine whether the second ultrasonic signal is detected.
[0314] If the second ultrasonic signal is detected, the first electronic device determines that the first microphone and the second microphone have successfully received the second ultrasonic signal. If the second ultrasonic signal is not detected, the first electronic device may continue to monitor the signal and perform signal detection. Optionally, if the second ultrasonic signal is still not detected after the preset monitoring period, the second electronic device may re-send the second ultrasonic signal through the third speaker and the fourth speaker.
[0315] Optionally, the first electronic device transmits the signal detection success or failure result to the second electronic device, so that the second electronic device can determine whether the microphone of the first electronic device successfully received the second ultrasonic signal. If, after a predetermined period of time, the microphone of the first electronic device still fails to receive the second ultrasonic signal, the second electronic device retransmits the second ultrasonic signal through the third and fourth speakers.
[0316] S1350: The first electronic device calculates arrival times of all first ultrasonic signals and second ultrasonic signals received by the first microphone and the second microphone, and receives the arrival time calculation result sent by the second electronic device.
[0317] The arrival time calculation result sent by the second electronic device includes the arrival times of all first ultrasonic signals and second ultrasonic signals received by the third microphone and the fourth microphone calculated by the second electronic device.
[0318] Optionally, after the microphones on both the first and second electronic devices detect the second ultrasonic signal, the first and second electronic devices each calculate an arrival time based on the received first and second ultrasonic signals. The second electronic device can then send the calculated arrival time result to the first electronic device, so that all arrival times are aggregated for the first electronic device.
[0319] In one scenario, the first electronic device and the second electronic device may also calculate and record the arrival time in real time after receiving the ultrasonic signal, and finally aggregate all the recorded arrival times to the first electronic device.
[0320] In one scenario, the first electronic device may send the calculated result of the arrival time to the second electronic device, so as to aggregate all the arrival times to the second electronic device.
[0321] As an example, as shown in FIG14 , after the first electronic device sends the first ultrasonic signal through the first speaker A, the first electronic device can detect that the time when the first microphone C receives the first ultrasonic signal is t AC The time when the second microphone D receives the first ultrasonic signal is t AD The second electronic device can detect that the time when the third microphone G receives the first ultrasonic signal is tAG The time when the second microphone H receives the first ultrasonic signal is t AH .
[0322] After the first electronic device sends the first ultrasonic signal through the second speaker B, the first electronic device can detect that the time when the first microphone C receives the first ultrasonic signal is t BC The time when the second microphone D receives the first ultrasonic signal is t BD The second electronic device can detect that the time when the third microphone G receives the first ultrasonic signal is t BG The time when the second microphone H receives the first ultrasonic signal is t BH .
[0323] After the first electronic device completes sending the first ultrasonic signal through the first speaker A and the second speaker B, the second electronic device may send the second ultrasonic signal through the third speaker F and the fourth speaker E.
[0324] Similarly, after the second electronic device sends the second ultrasonic signal through the third speaker F, the first electronic device can detect that the time when the first microphone C receives the second ultrasonic signal is t FC The time when the second microphone D receives the second ultrasonic signal is t FD The second electronic device can detect that the time when the third microphone G receives the second ultrasonic signal is t FG The time when the second microphone H receives the second ultrasonic signal is t FH .
[0325] After the second electronic device sends the second ultrasonic signal through the fourth speaker E, the first electronic device can detect that the time when the first microphone C receives the second ultrasonic signal is t EC The time when the second microphone D receives the second ultrasonic signal is t ED The second electronic device can detect that the time when the third microphone G receives the second ultrasonic signal is t EG The time when the second microphone H receives the second ultrasonic signal is t EH .
[0326] S1360: The first electronic device determines relative position information between the first electronic device and the second electronic device based on all arrival times.
[0327] Optionally, the first electronic device may calculate the sum of the round-trip distances of any set of speakers and microphones between the first electronic device and the second electronic device based on all arrival times, so as to determine the relative position information between the first electronic device and the second electronic device based on the sum of the round-trip distances of multiple sets of speakers and microphones. The set of speakers and microphones includes one speaker and one microphone of the first electronic device, and one speaker and one microphone of the second electronic device.
[0328] As an example, as shown in Figure 12, the first electronic device can establish a three-dimensional coordinate system O-XYZ with the center point O of the first electronic device as the origin, and then the first electronic device can obtain the relative position information between the first electronic device and the second electronic device by solving the coordinates of the center point P of the second electronic device in the three-dimensional coordinate system.
[0329] It can be understood that since the positions of the first speaker A, the second speaker B, the first microphone C and the second microphone D on the first electronic device are fixed, the coordinates of the first speaker A, the second speaker B, the first microphone C and the second microphone D can be determined based on the known device information of the first electronic device.
[0330] As for the second electronic device, its built-in magnetometer, accelerometer, and gyroscope can provide information about its posture relative to the Earth's coordinate system. The positions of the third speaker F, fourth speaker E, third microphone G, and fourth microphone H on the second electronic device are known. The second electronic device is typically placed horizontally, such as on a tabletop, or the screens of the second and first electronic devices are typically facing the user. Therefore, based on this information, the coordinates of the vectors of the third speaker F, fourth speaker E, third microphone G, and fourth microphone H on the second electronic device relative to the center point P of the second electronic device (the aforementioned O-XYZ coordinate system) can be approximated.
[0331] In addition, the sum of the round-trip distances of any set of speakers and microphones between the first electronic device and the second electronic device can also be calculated using the aforementioned recorded arrival times.
[0332] In this way, a mathematical model can be established by combining the above known conditions to solve the coordinates of the center point P of the second electronic device.
[0333] For example, if it is known that:
[0334] First speaker A (x0, y0, z0), second speaker B (x1, y1, z1), first microphone C (x2, y2, z2), second microphone C (x3, y3, z3);
[0335] The vector of the fourth speaker E relative to P The vector of the third loudspeaker F relative to P The vector of the third microphone G relative to P The vector of the fourth microphone H relative to P
[0336] The sum of the round-trip distances of the first speaker A, the first microphone C, and the third speaker F, the third microphone G is AG+CF=D1;
[0337] The sum of the round-trip distances of the first speaker A, the first microphone C, the fourth speaker E, and the third microphone G is AG+CE=D2;
[0338] The sum of the round-trip distances of the first speaker A, the first microphone C, the third speaker F, and the fourth microphone H is AH+CF=D3;
[0339] The sum of the round-trip distances of the first speaker A, the first microphone C, the fourth speaker E, and the fourth microphone H is AH+CE=D4;
[0340] The sum of the round-trip distances of the second speaker B, the first microphone C, and the third speaker F, the third microphone G is BG+CF=D5;
[0341] The sum of the round-trip distances of the second speaker B, the first microphone C, the fourth speaker E, and the third microphone G is BG+CE=D6;
[0342] The sum of the round-trip distances of the second speaker B, the first microphone C, the third speaker F, and the fourth microphone H is BH+CF=D7;
[0343] The sum of the round-trip distances of the second speaker B, the first microphone C, the fourth speaker E, and the fourth microphone H is BH+CE=D8;
[0344] The sum of the round-trip distances of the first speaker A, the first microphone D, and the third speaker F, the third microphone G is AG+DF=D9;
[0345] The sum of the round-trip distances of the first speaker A, the second microphone D, the fourth speaker E, and the third microphone G is AG+DE=D 10 ;
[0346] The sum of the round-trip distances of the first speaker A, the second microphone D, the third speaker F, and the fourth microphone H is AH+DF=D 11 ;
[0347] The sum of the round-trip distances of the first speaker A, the second microphone D, the fourth speaker E, and the fourth microphone H is AH+DE=D12 ;
[0348] The sum of the round-trip distances of the second speaker B, the second microphone D, the third speaker F, and the third microphone G is BG+DF=D 13 ;
[0349] The sum of the round-trip distances of the second speaker B, the second microphone D, the fourth speaker E, and the third microphone G is BG+DE=D 14 ;
[0350] The sum of the round-trip distances of the second speaker B, the second microphone D, the third speaker F, and the fourth microphone H is BH+DF=D 15 ;
[0351] The sum of the round-trip distances of the second speaker B, the second microphone D, the fourth speaker E, and the fourth microphone H is BH+DE=D 16 .
[0352] According to the principle of the two-way ranging algorithm, the above D1~D 16 It can be expressed as the following arrival time: AG+CF=D1=C[(t AG -t FG )-(t AC -t FC )]+d AC +d FG ; AG+CE=D2=C[(t AG -t EG )-(t AC -t EC )]+d AC +d EG ; AH+CF=D3=C[(t AH -t FH )-(t AC -t FC )]+d AC +d FH ; AH+CE=D4=C[(t AH -t EH )-(t AC -t EC )]+d AC +d EH ; BG+CF=D5=C[(t BG -t FG )-(t BC -t FC )]+d BC +d FG ; BG+CE=D6=C[(t BG -t EG )-(tBC -t EC )]+d BC +d EG ; BH + CF = D7 = C[(t BH -t FH )-(t BC -t FC )]+d BC +d FH ; BH + CE = D8 = C[(t BH -t EH )-(t BC -t EC )]+d BC +d EH ; AG + DF = D9 = C[(t AG -t FG )-(t AD -t FD )]+d AD +d FG ; AG + DE = D 10 = C[(t AG -t EG )-(t AD -t ED )]+d AD +d EG ; Formula (12) AH + DF = D 11 = C[(t AH -t FH )-(t AD -t FD )]+d AD +d FH ; AH + DE = D 12 = C[(t AH -t EH )-(t AD -t ED )]+d AD +d EH ; BG + DF = D 13 = C[(t BG -t FG )-(t BD -t FD )]+d BD +d FG ; BG + DE = D 14 = C[(t BG -t EG )-(t BD -t ED )]+d BD +d EG ; BH + DF = D15 =C[(t BH -t FH )-(t BD -t FD )]+d BD +d FH ; BH+DE=D 16 C[(t BH -t EH )-(t BD -t ED )]+d BD +d EH ;
[0353] Where dij represents the distance between points i and j inside the device.
[0354] Similarly, let the coordinates of the center point P of the second electronic device be (x, y, z), then the above D1 to D 16 It can also be expressed using the coordinates of P, where:
[0355] Substituting formula (13) into formula (12) establishes a three-variable nonlinear equation system for the coordinates of point P. Solving this equation system yields the coordinates of point P. Based on the coordinates of point P, the relative position information between the first electronic device and the second electronic device can be obtained.
[0356] The position determination method provided in the embodiment of the present application can perform two-way ultrasonic measurement through the two microphones and two speakers on the first electronic device, and the two microphones and two speakers on the second electronic device, and can obtain the sum of the round-trip distances of any group of speakers and microphones between the first electronic device and the second electronic device. Then, based on the sum of the round-trip distances of multiple groups of speakers and microphones, the relative position information between the first electronic device and the second electronic device can be determined. In this way, the relative position information between the first electronic device and the second electronic device can be automatically identified without the user actively setting it. Therefore, in some scenarios, the interactive operation between the first electronic device and the second electronic device can be realized based on the relative position information, which enhances the degree of coordination between the first electronic device and the second electronic device and expands the use scenario of the first electronic device and the second electronic device.
[0357] In some scenarios, when the total number of microphones and speakers on the first electronic device and the second electronic device is less than six, an embodiment of the present application provides another location determination method, which can also realize the determination of the relative location information between the first electronic device and the second electronic device.
[0358] The first electronic device has at least two speakers and one microphone, and the two speakers are arranged on the left and right sides, and the microphone is located on the front edge of the first electronic device or on the upper body of the first electronic device (such as the screen notch position). The second electronic device has at least one speaker and one microphone.
[0359] FIG15 is a schematic diagram of another process for determining relative position information between a first electronic device and a second electronic device according to an embodiment of the present application. As shown in FIG15 , the process for determining relative position information between the first electronic device and the second electronic device may include:
[0360] S1500: The first electronic device determines a measurement speaker and a measurement microphone on the first electronic device and the second electronic device for transmitting and receiving ultrasonic signals.
[0361] In the embodiment of the present application, the first electronic device has two measurement speakers and one measurement microphone, and the second electronic device has one measurement speaker and one measurement microphone.
[0362] The measurement speakers on the first electronic device can be all the speakers on the first electronic device, or some of the speakers on the first electronic device. The measurement speakers on the second electronic device can be all the speakers on the second electronic device, or some of the speakers on the second electronic device. That is to say, when the first electronic device has two speakers and one microphone, and the second electronic device has one speaker and one microphone, the position determination method provided in the embodiment of the present application can be implemented. When the first electronic device and the second electronic device have more speakers and microphones on this basis, the position determination method provided in the embodiment of the present application can also be implemented.
[0363] Optionally, when the first electronic device has multiple speakers and multiple microphones, the first electronic device can select two measurement speakers and one measurement microphone to implement the position determination method provided in the embodiment of the present application, and the second electronic device can select one measurement speaker and one measurement microphone to implement the position determination method provided in the embodiment of the present application.
[0364] In some embodiments, after a first electronic device establishes a communication connection with a second electronic device via a wired or wireless method (such as Bluetooth, Wi-Fi, etc.), the first electronic device can obtain device information of the second electronic device and, based on the device information, determine information such as the number and location of speakers and microphones on the second electronic device. The first electronic device can then determine the measurement speakers and measurement microphones on the first and second electronic devices for transmitting and receiving ultrasonic signals based on the number and location information of the first electronic device's speakers and microphones and the number and location information of the speakers and microphones on the second electronic device.
[0365] Optionally, when the first electronic device determines that the requirements of the position determination method of the aforementioned embodiment are met based on the number and position information of its own speakers and microphones, and the number and position information of the speakers and microphones on the second electronic device, the first electronic device adopts the position determination method of the aforementioned embodiment to determine the relative position information between the first electronic device and the second electronic device.
[0366] The position determination method of the aforementioned embodiment requires that the total number of measurement microphones and measurement speakers determined by the first electronic device and the second electronic device is at least six, and these measurement microphones and measurement speakers cannot be arranged in the same straight line. The first electronic device has at least one measurement speaker and at least one measurement microphone, and the second electronic device has at least one measurement speaker and at least one measurement microphone.
[0367] Optionally, when the first electronic device determines that the requirements of the position determination method of the aforementioned embodiment are not met based on the number and position information of its own speakers and microphones, as well as the number and position information of the speakers and microphones on the second electronic device, the first electronic device uses the position determination method of the embodiment of the present application to determine the relative position information between the first electronic device and the second electronic device. Alternatively, regardless of whether the requirements of the position determination method of the aforementioned embodiment are met, the first electronic device uses the position determination method of the embodiment of the present application to determine the relative position information between the first electronic device and the second electronic device.
[0368] Optionally, the first electronic device may transmit the determined measurement speaker and measurement microphone information of the second electronic device to the second electronic device via the communication connection channel, so that the second electronic device can activate the corresponding measurement speaker to transmit ultrasonic signals and activate the corresponding measurement microphone to monitor ultrasonic signals.
[0369] S1510: The first electronic device sends a third ultrasonic signal to the second electronic device through two measurement speakers respectively.
[0370] After the first electronic device determines two measuring speakers for transmitting and receiving ultrasonic signals, the first electronic device may turn on the two measuring speakers to transmit ultrasonic signals.
[0371] Optionally, the two measurement speakers of the first electronic device may be a left channel speaker and a right channel speaker of the first electronic device.
[0372] In one possible implementation, the first electronic device may transmit the third ultrasonic signal to the second electronic device via two measuring speakers in sequence, so that the second electronic device may receive the third ultrasonic signal transmitted respectively from the two measuring speakers on the first electronic device via the measuring microphone.
[0373] Optionally, the third ultrasonic signals transmitted successively by the two measuring speakers on the first electronic device are ultrasonic signals with different characteristics, such as ultrasonic signals of different frequency bands or ultrasonic signals of different orthogonal sequences. Of course, the third ultrasonic signals transmitted successively by the two measuring speakers may also be ultrasonic signals with the same characteristics.
[0374] Optionally, the two measuring speakers on the first electronic device sequentially transmit third ultrasonic signals at a third time interval, with each third ultrasonic signal lasting a third duration. The third time interval and the third duration can be reasonably set in advance based on the application scenario, and are not limited in this embodiment of the application.
[0375] In one possible implementation, the first electronic device can simultaneously transmit a third ultrasonic signal to the second electronic device via two measuring speakers. The third ultrasonic signals transmitted by the two measuring speakers have different characteristics, such as ultrasonic signals in different frequency bands or ultrasonic signals in different orthogonal sequences. This allows the second electronic device to distinguish which measuring speaker the ultrasonic signal originated from when it receives it.
[0376] S1520: The second electronic device receives a third ultrasonic signal through the measuring microphone, and determines a first receiving result of receiving the third ultrasonic signal.
[0377] After the second electronic device determines the measurement microphone, it can turn on the measurement microphone to monitor the ultrasonic signal. Thus, when the first electronic device transmits the third ultrasonic signal through the two measurement speakers, the second electronic device can receive the third ultrasonic signal transmitted by the two measurement speakers through the measurement microphone. In other words, the second electronic device needs to receive two third ultrasonic signals.
[0378] In one possible implementation, the second electronic device may perform signal detection on the signal monitored by the measuring microphone to determine whether the third ultrasonic signal is detected. When the third ultrasonic signal is detected, it can be determined that the measuring microphone on the second electronic device has successfully received the third ultrasonic signal.
[0379] When the third ultrasonic signal is not detected, it can be determined that the measuring microphone on the second electronic device has not successfully received the third ultrasonic signal. The measuring microphone on the second electronic device can continue to monitor for signals. If the third ultrasonic signal is still not detected after the preset monitoring period, the first electronic device can resend the third ultrasonic signal to the second electronic device through the two measuring speakers until the measuring microphone on the second electronic device detects the third ultrasonic signal.
[0380] In a possible implementation, the second electronic device may send a result of whether the signal is detected to the first electronic device, so that the first electronic device can determine whether to resend the third ultrasonic signal.
[0381] In the embodiment of the present application, after the second electronic device receives the two third ultrasonic signals through the measuring microphone, it can determine a first reception result of receiving the two third ultrasonic signals.
[0382] Optionally, the first receiving result is the arrival time of the two third ultrasonic signals at the measuring microphone of the second electronic device.
[0383] In one scenario, when the measurement microphone of the second electronic device receives the third ultrasonic signal sent by the left channel speaker of the first electronic device, it can record the first arrival time of the third ultrasonic signal; when it receives the third ultrasonic signal sent by the right channel speaker of the first electronic device, it can record the second arrival time of the third ultrasonic signal.
[0384] Optionally, the first reception result is a time difference between the two third ultrasonic signals received by the measuring microphone of the second electronic device. The second electronic device may determine the time difference between the two third ultrasonic signals received by the measuring microphone according to the second arrival time and the first arrival time.
[0385] In one example, the time difference is determined by subtracting the first arrival time from the second arrival time. In another example, when two measuring speakers of the first electronic device transmit the third ultrasonic signal sequentially at a third time interval, the time difference is determined by subtracting the first arrival time from the second arrival time and then subtracting the third time interval.
[0386] Optionally, the first receiving result is the signal strength of the two third ultrasonic signals received by the measuring microphone of the second electronic device.
[0387] In one scenario, when the measurement microphone of the second electronic device receives the third ultrasonic signal sent by the left channel speaker of the first electronic device, the first power of the third ultrasonic signal, that is, the signal strength of the third ultrasonic signal, can be recorded. When the measurement microphone of the second electronic device receives the third ultrasonic signal sent by the right channel speaker of the first electronic device, the second power of the third ultrasonic signal, that is, the signal strength of the third ultrasonic signal, can be recorded.
[0388] In one scenario, the second electronic device may also obtain a signal correlation peak by performing a convolution operation on the audio data stream received by the measuring microphone with the original third ultrasonic signal sent by the left channel speaker of the first electronic device, and then record the amplitude value of the signal correlation peak as the signal strength of the third ultrasonic signal.
[0389] Optionally, the first reception result is a signal strength difference between the two third ultrasonic signals received by the measuring microphone of the second electronic device. The second electronic device may determine a time difference between the two third ultrasonic signals received by the measuring microphone based on the second power and the first power. In one example, the signal strength difference is calculated by subtracting the first power from the second power. In another example, the signal strength difference is calculated by dividing the second power by the first power.
[0390] Optionally, the first reception result is audio information of the two third ultrasonic signals received by the measuring microphone of the second electronic device, so that the first electronic device determines the time difference or signal strength difference between the two third ultrasonic signals received by the measuring microphone of the second electronic device based on the audio information.
[0391] S1530: The first electronic device determines first relative position information between the first electronic device and the second electronic device according to the first reception result.
[0392] The first relative position information may be that the second electronic device is located in the left area of the first electronic device, the right area of the first electronic device, or the front and back areas (or upper and lower areas) of the first electronic device.
[0393] Optionally, after determining the first reception result, the second electronic device sends the first reception result to the first electronic device through the communication connection channel, and the first electronic device determines the first relative position information between the first electronic device and the second electronic device based on the first reception result.
[0394] In a possible implementation, the second electronic device may determine the first relative position information between the first electronic device and the second electronic device based on the first reception result, and then send the first relative position information to the first electronic device, so that the first electronic device can obtain the first relative position information.
[0395] Optionally, the first reception result is a time difference between two third ultrasonic signals received by a measuring microphone of the second electronic device. The first electronic device determines first relative position information between the first electronic device and the second electronic device based on the time difference.
[0396] In one scenario, if the first time difference (t8-t7) between the first arrival time t7 of the third ultrasonic signal sent by the left channel speaker of the first electronic device arriving at the measuring microphone of the second electronic device and the second arrival time t8 of the third ultrasonic signal sent by the right channel speaker of the first electronic device arriving at the measuring microphone of the second electronic device is greater than the first time threshold Threshold1, that is, t7 is earlier than t8 by a certain time, then it can be considered that the second electronic device is closer to the left channel speaker of the first electronic device, and it can be determined that the second electronic device is located in the left area of the first electronic device.
[0397] If the second time difference (t7-t8) between the first arrival time t7 and the second arrival time t8 is greater than the first time threshold Threshold1, that is, t8 is earlier than t7 by a certain time, it can be considered that the second electronic device is closer to the right channel speaker of the first electronic device, and it can be determined that the second electronic device is located in the right area of the first electronic device.
[0398] If the absolute value of the time difference |t7-t8| between the first arrival time t7 and the second arrival time t8 is less than (or equal to) the first time threshold Threshold1, it can be considered that the ultrasonic signals sent by the left channel speaker and the right channel speaker of the first electronic device reach the measurement microphone of the second electronic device almost at the same time, and it can be determined that the second electronic device is located in the front and back side areas (or upper and lower side areas) of the first electronic device.
[0399] In a possible embodiment, the time difference can also be converted using the propagation speed of the ultrasonic signal to obtain the distance difference between the measurement microphone of the second electronic device and the two speakers of the first electronic device, so as to determine the first relative position information between the first electronic device and the second electronic device based on the distance difference.
[0400] In one scenario, as shown in Figure 16, if the first distance d3 between the left channel speaker of the first electronic device and the measurement microphone of the second electronic device converted according to the first arrival time t7 and the second distance d4 between the right channel speaker of the first electronic device and the measurement microphone of the second electronic device converted according to the second arrival time t8 is greater than the first distance threshold Threshold2, it can be considered that the second electronic device is closer to the left channel speaker of the first electronic device, and it can be determined that the second electronic device is located in the left area of the first electronic device.
[0401] If the first distance difference (d3-d4) between the first distance d3 and the second distance d4 is greater than the first distance threshold Threshold2, it can be considered that the second electronic device is closer to the right channel speaker of the first electronic device, and it can be determined that the second electronic device is located in the right area of the first electronic device.
[0402] If the absolute value of the distance difference between the first distance d3 and the second distance d4 |d4-d3| is less than (or equal to) the first distance threshold Threshold2, it can be considered that the distances between the left channel speaker and the right channel speaker of the first electronic device and the measurement microphone of the second electronic device are almost the same, and it can be determined that the second electronic device is located in the front and back side areas (or upper and lower side areas) of the first electronic device.
[0403] Optionally, the first reception result is a signal strength difference between two third ultrasonic signals received by a measuring microphone of the second electronic device. The first electronic device determines first relative position information between the first electronic device and the second electronic device based on the signal strength difference.
[0404] In one scenario, the first intensity difference (W1-W2) between the first power W1 of the third ultrasonic signal sent by the left channel speaker of the first electronic device and the second power W2 of the third ultrasonic signal sent by the right channel speaker of the first electronic device received by the measurement microphone of the second electronic device is greater than the first intensity threshold Threshold3, that is, the first power W1 is stronger than the second power W2 to a certain extent. In this case, it can be considered that the second electronic device is closer to the left channel speaker of the first electronic device, and it can be determined that the second electronic device is located in the left area of the first electronic device.
[0405] If the second intensity difference (W2-W1) between the first power W1 and the second power W2 is greater than the first intensity threshold Threshold3, that is, the first power W2 is stronger than the second power W1 to a certain extent, it can be considered that the second electronic device is closer to the right channel speaker of the first electronic device, and it can be determined that the second electronic device is located in the right area of the first electronic device.
[0406] If the absolute value of the intensity difference between the first power W1 and the second power W2 |W1-W2| is less than (or equal to) the first time threshold Threshold3, it can be considered that the intensity of the ultrasonic signals received by the measurement microphone of the second electronic device sent by the left channel speaker and the right channel speaker of the first electronic device is almost the same, and it can be determined that the second electronic device is located in the front and back side areas (upper and lower side areas) of the first electronic device.
[0407] It can be understood that, based on the first reception result, it is possible to accurately identify whether the second electronic device is located to the left or right of the first electronic device, but it is not possible to accurately identify whether the second electronic device is located in the front (lower) or rear (upper) position of the first electronic device. Therefore, in an embodiment of the present application, when it is determined through the first reception result that the second electronic device is located in a non-left or right area of the first electronic device, that is, when it is determined that the second electronic device is located in the front and rear areas (upper and lower areas) of the first electronic device, but it is not possible to specifically determine whether it is located in the front area (lower area) or the rear area (upper area), the following steps can be performed to make a specific determination of the front and rear positions (upper and lower positions). In other words, the following steps S1540 to S1560 are optional steps.
[0408] S1540: The second electronic device sends a fourth ultrasonic signal to the first electronic device through the measuring speaker.
[0409] Optionally, after obtaining the first relative position information between the first electronic device and the second electronic device, if the first relative position information indicates that the second electronic device is located in the front and rear areas (upper and lower areas) of the first electronic device, the first electronic device sends a second relative position information confirmation request to the second electronic device via the communication channel. The first electronic device can then activate the measurement microphone to monitor the ultrasonic signal.
[0410] Optionally, in response to the second relative position information determination request, the second electronic device transmits a fourth ultrasonic signal to the first electronic device via the measurement speaker. The fourth ultrasonic signal and the third ultrasonic signal may have different characteristics or the same characteristics. This embodiment of the present application is not limited thereto.
[0411] Optionally, the measurement speaker of the second electronic device may be a left channel speaker of the second electronic device, or may be a right channel speaker of the second electronic device.
[0412] S1550: The first electronic device receives a fourth ultrasonic signal through the measuring microphone, and determines a second receiving result of receiving the fourth ultrasonic signal.
[0413] After the first electronic device sends the second relative position information to confirm the request and instructs the second electronic device to send the fourth ultrasonic signal, the first electronic device can turn on the measurement microphone to monitor the ultrasonic signal. Thus, when the second electronic device sends the fourth ultrasonic signal through the measurement speaker, the first electronic device can receive the fourth ultrasonic signal through the measurement microphone.
[0414] In one possible implementation, the first electronic device may perform signal detection on the signal monitored by the measurement microphone to determine whether the fourth ultrasonic signal is detected. When the fourth ultrasonic signal is detected, it can be determined that the measurement microphone on the first electronic device has successfully received the fourth ultrasonic signal.
[0415] When the fourth ultrasonic signal is not detected, it can be determined that the measurement microphone on the first electronic device has not successfully received the fourth ultrasonic signal. The measurement microphone on the first electronic device can continue to monitor for signals. If the fourth ultrasonic signal is still not detected after the preset monitoring period, the second electronic device can resend the fourth ultrasonic signal to the first electronic device through the measurement speaker until the measurement microphone on the first electronic device detects the fourth ultrasonic signal.
[0416] In a possible implementation, the first electronic device may send the result of whether the signal is detected to the second electronic device through the communication connection channel, so that the second electronic device can determine whether to resend the fourth ultrasonic signal.
[0417] In the embodiment of the present application, after the first electronic device receives the fourth ultrasonic signal through the measuring microphone, it can determine the second reception result of receiving the fourth ultrasonic signal.
[0418] Optionally, the second reception result is the amplitude of the signal correlation peak, or may be the maximum amplitude of the signal correlation peak.
[0419] In one scenario, the first electronic device may obtain a signal correlation peak by performing a convolution operation on the audio data stream received by the measurement microphone and the original fourth ultrasonic signal sent by the measurement speaker of the second electronic device, and then determine the amplitude value of the signal correlation peak.
[0420] S1560: The first electronic device determines second relative position information between the first electronic device and the second electronic device according to the second reception result.
[0421] The second relative position information may be that the second electronic device is located in the front area (lower area) of the first electronic device, or that the second electronic device is located in the rear area (upper area) of the first electronic device.
[0422] Optionally, after determining the second reception result, the first electronic device determines second relative position information between the first electronic device and the second electronic device according to the second reception result.
[0423] In a possible implementation, after determining the second reception result, the first electronic device may also send the first reception result to the second electronic device through the above-mentioned communication connection channel, and the second electronic device may determine the second relative position information between the first electronic device and the second electronic device based on the second reception result.
[0424] Optionally, the second reception result is an amplitude of a signal correlation peak. The first electronic device determines second relative position information between the first electronic device and the second electronic device based on a maximum value of the amplitude of the signal correlation peak.
[0425] In one scenario, when the measurement microphone of the first electronic device is located at the front edge of the first electronic device, if the maximum value of the correlation peak amplitude of the fourth ultrasonic signal from the second electronic device received by the measurement microphone of the first electronic device is greater than the first amplitude threshold Threshold 4, it can be considered that the second electronic device is closer to the front side of the first electronic device, and it can be determined that the second electronic device is located in the front area (lower area) of the first electronic device. The first amplitude threshold is a positive number.
[0426] If the maximum value of the correlation peak amplitude of the fourth ultrasonic signal from the second electronic device received by the measuring microphone of the first electronic device is less than (or equal to) the first amplitude threshold Threshold4, it can be considered that the second electronic device is closer to the upper side of the first electronic device, and it can be determined that the second electronic device is located in the rear area (upper area) of the first electronic device.
[0427] It is understandable that when the measurement microphone of the first electronic device is located toward the upper portion of the body of the first electronic device (eg, at the screen notch), the above-mentioned judgment condition may be correspondingly reversed.
[0428] For example, when the measurement microphone of the first electronic device is located on the upper part of the body of the first electronic device, if the maximum value of the correlation peak amplitude of the fourth ultrasonic signal from the second electronic device received by the measurement microphone of the first electronic device is less than the first amplitude threshold Threshold 4, it can be considered that the second electronic device is closer to the front side of the first electronic device, and it can be determined that the second electronic device is located in the front area (lower area) of the first electronic device. If the maximum value of the correlation peak amplitude of the fourth ultrasonic signal from the second electronic device received by the measurement microphone of the first electronic device is greater than (or equal to) the first amplitude threshold Threshold 4, it can be considered that the second electronic device is closer to the upper side of the first electronic device, and it can be determined that the second electronic device is located in the rear area (upper area) of the first electronic device.
[0429] In this way, the fourth ultrasonic signal replied by the second electronic device can accurately identify whether the second electronic device is located in the front position (below position) or the rear position (above position) of the first electronic device when the specific front and back position (upper and lower position) cannot be determined by the third ultrasonic signal mentioned above.
[0430] It is understood that the position determination method provided in the embodiments of the present application can be implemented even if the total number of microphones and speakers is greater than six. In other words, when the total number of microphones and speakers is greater than six, the position determination method provided in the previous embodiment and the position determination method provided in the embodiments of the present application can be selectively implemented, and the embodiments of the present application are not limiting.
[0431] The position determination method provided in an embodiment of the present application is that the first electronic device has at least two speakers and one microphone, and the second electronic device has at least one speaker and at least one microphone. The first electronic device sends a third sound wave signal respectively through the two speakers, and the second electronic device receives the third sound wave signal through a microphone. After receiving the two third sound wave signals from the two speakers of the first electronic device, the second electronic device determines the first relative position information between the first electronic device and the second electronic device based on the time difference between the two third sound wave signals received by the microphone, or the signal strength between the two third sound wave signals. The first relative position information can be a left orientation, a right orientation, or a front-back orientation (upper and lower orientation).
[0432] Furthermore, when the first relative position information is the front and back orientation (up and down orientation), the second electronic device may send a fourth sound wave signal through a speaker, and the first electronic device may receive the fourth sound wave signal through a microphone. After receiving the fourth sound wave signal from a speaker of the second electronic device, the first electronic device determines the second relative position information between the first electronic device and the second electronic device based on the correlation peak amplitude of the fourth sound wave signal received by the microphone. The second relative position information may be a front orientation (upper orientation) or a rear orientation (lower orientation). In this way, the four orientations of front (lower), back (up), left and right between the first electronic device and the second electronic device can be automatically identified without the user actively setting it. Therefore, in some scenarios, the interactive operation between the first electronic device and the second electronic device can be realized based on the four orientations of front (lower), back (up), left and right, thereby enhancing the degree of collaboration between the first electronic device and the second electronic device and expanding the usage scenarios of the first electronic device and the second electronic device.
[0433] It can be understood that compared with the aforementioned embodiment in which the total number of microphones and speakers of the first electronic device and the second electronic device needs to be at least six, in the embodiment of the present application, the total number of microphones and speakers of the first electronic device and the second electronic device only needs to be five, wherein the first electronic device has two speakers and one microphone, and the second electronic device has one speaker and one microphone.
[0434] It is understandable that, in order to implement the above functions, the electronic device includes hardware and / or software modules that perform the corresponding functions. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of this application.
[0435] In this embodiment, the electronic device can be divided into functional modules according to the above-mentioned method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into a single processing module. The above-mentioned integrated modules can be implemented in the form of hardware. It should be noted that the module division in this embodiment is illustrative and is only a logical functional division. In actual implementation, other division methods may be used.
[0436] An embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device implements the various functions or steps executed by the electronic device in the above-mentioned various method embodiments.
[0437] The present application also provides a position determination device, which can be applied to the above electronic device and is used to perform the functions or steps performed by the electronic device in the above method embodiment.
[0438] The present application also provides a chip system comprising at least one processor and at least one interface circuit. The processor and the interface circuit may be interconnected via a circuit. The interface circuit may read instructions stored in a memory and send the instructions to the processor. When the instructions are executed by the processor, the electronic device may perform the various functions or steps performed by the vehicle in the above-described method embodiment. Of course, the chip system may also include other discrete components, which are not specifically limited in the present application.
[0439] An embodiment of the present application further provides a computer storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes the various functions or steps executed by the electronic device in the above-mentioned method embodiment.
[0440] An embodiment of the present application further provides a computer program product. When the computer program product is run on an electronic device, the electronic device is enabled to perform the functions or steps performed by the electronic device in the above method embodiment.
[0441] Among them, the electronic device, position determination device, computer storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0442] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0443] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, 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.
[0444] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0445] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0446] If the 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 readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0447] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A method for determining a position, characterized in that: Applied to a first electronic device, the method includes: Sending a first sound wave signal to a second electronic device through two speakers respectively, where the first sound wave signal is used to determine first relative position information between the first electronic device and the second electronic device; receiving the first relative position information sent by the second electronic device, wherein the first relative position information includes any one of: the second electronic device is located on the left side of the first electronic device, the second electronic device is located on the right side of the first electronic device, and the second electronic device is located in front of or behind the first electronic device; When the first relative position information indicates that the second electronic device is located at the front or rear side of the first electronic device, receiving a second sound wave signal sent by a speaker of the second electronic device through a microphone, and determining a reception result of the second sound wave signal; According to the receiving result, second relative position information between the first electronic device and the second electronic device is determined, and the second relative position information includes any one of the following: the second electronic device is located in front of the first electronic device, and the second electronic device is located in the back of the first electronic device.
2. The method according to claim 1, characterized in that: The receiving result is the correlation peak amplitude of the second sound wave signal received by the microphone of the first electronic device.
3. The method according to claim 2, characterized in that When the microphone of the first electronic device is located at the front edge of the first electronic device, determining second relative position information between the first electronic device and the second electronic device according to the receiving result includes: When the correlation peak amplitude is greater than a first amplitude threshold, the second electronic device is located in front of the first electronic device; When the correlation peak amplitude is less than the first amplitude threshold, the second electronic device is located at the rear side of the first electronic device.
4. The method according to claim 2, characterized in that: When the microphone of the first electronic device is located at an upper edge of the first electronic device, determining second relative position information between the first electronic device and the second electronic device according to the receiving result includes: When the correlation peak amplitude is less than a first amplitude threshold, the second electronic device is located in front of the first electronic device; When the correlation peak amplitude is greater than the first amplitude threshold, the second electronic device is located at the rear side of the first electronic device.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: When the first relative position information indicates that the second electronic device is located on the left side of the first electronic device, or when the first relative position information indicates that the second electronic device is located on the right side of the first electronic device, performing multi-screen interaction between the first electronic device and the second electronic device according to the first relative position information; When the first relative position information indicates that the second electronic device is located at the front and rear sides of the first electronic device, multi-screen interaction is performed between the first electronic device and the second electronic device according to the second relative position information.
6. The method according to claim 5, characterized in that The second electronic device includes a third electronic device located on the left side of the first electronic device and a fourth electronic device located behind the first electronic device, and the method further includes: Detecting a first operation on first target content displayed by the first electronic device; The performing multi-screen interaction between the first electronic device and the second electronic device according to the first relative position information includes: If the first operation is an operation of expanding the first target content to the left, the first electronic device sends the first target content to a display interface of a third electronic device located on the left side of the first electronic device for display; The performing multi-screen interaction between the first electronic device and the second electronic device according to the second relative position information includes: If the first operation is an operation of upwardly expanding the first target content, the first electronic device sends the first target content to a display interface of a fourth electronic device located behind the first electronic device for display.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: After the position of the first electronic device and / or the second electronic device changes, the first relative position information or the second relative position information between the first electronic device and the second electronic device is re-determined.
8. A method for determining a position, characterized in that: Applied to a first electronic device, the method includes: Sending a first sound wave signal to a second electronic device through two speakers respectively; receiving a first reception result sent by the second electronic device, where the first reception result is a reception result of a microphone of the second electronic device receiving the first sound wave signal; Determine, according to the first receiving result, first relative position information between the first electronic device and the second electronic device, the first relative position information including any one of the following: the second electronic device is located on the left side of the first electronic device, the second electronic device is located on the right side of the first electronic device, and the second electronic device is located in the front and rear sides of the first electronic device; When the first relative position information indicates that the second electronic device is located at the front or rear side of the first electronic device, receiving a second sound wave signal sent by a speaker of the second electronic device through a microphone, and determining a second reception result of receiving the second sound wave signal; According to the second reception result, second relative position information between the first electronic device and the second electronic device is determined, and the second relative position information includes any one of the following: the second electronic device is located in front of the first electronic device, and the second electronic device is located in the back of the first electronic device.
9. The method according to claim 8, characterized in that The second receiving result is a correlation peak amplitude of the second sound wave signal received by the microphone of the first electronic device.
10. The method according to claim 9, characterized in that The microphone of the first electronic device is located at a front edge of the first electronic device, and determining second relative position information between the first electronic device and the second electronic device according to the second receiving result includes: When the correlation peak amplitude is greater than a first amplitude threshold, the second electronic device is located in front of the first electronic device; When the correlation peak amplitude is less than the first amplitude threshold, the second electronic device is located at the rear side of the first electronic device; Or the microphone of the first electronic device is located at an upper edge of the first electronic device, and determining second relative position information between the first electronic device and the second electronic device according to the second receiving result includes: When the correlation peak amplitude is less than a first amplitude threshold, the second electronic device is located in front of the first electronic device; When the correlation peak amplitude is greater than the first amplitude threshold, the second electronic device is located at the rear side of the first electronic device.
11. The method according to any one of claims 8 to 10, characterized in that: The first receiving result is the time or time difference when the microphone of the second electronic device receives the first sound wave signal from the two speakers; or the audio information when the microphone of the second electronic device receives the first sound wave signal from the two speakers; Or the signal strength of the first sound wave signal received by the microphone of the second electronic device from the two speakers.
12. A method for determining a position, characterized in that: Applied to a first electronic device, the method includes: Sending a first sound wave signal to a second electronic device through a speaker, and receiving the first sound wave signal through a microphone; receiving, through the microphone, a second sound wave signal sent by a speaker of the second electronic device; Determine a first reception result of the microphone receiving the first sound wave signal and the second sound wave signal; receiving a second reception result sent by the second electronic device, where the second reception result is a reception result of the microphone in the second electronic device receiving the first sound wave signal and the second sound wave signal; Based on the first reception result and the second reception result, relative position information between the first electronic device and the second electronic device is determined.
13. The method according to claim 12, characterized in that The first receiving result is the time or time difference between when the microphone receives the first sound wave signal and the second sound wave signal; The second reception result is the time or time difference when the microphone in the second electronic device receives the first sound wave signal and the second sound wave signal, or the audio information when the microphone in the second electronic device receives the first sound wave signal and the second sound wave signal.
14. The method according to claim 12 or 13, characterized in that The determining, based on the first receiving result and the second receiving result, relative position information between the first electronic device and the second electronic device includes: Based on the first receiving result and the second receiving result, determine whether the first electronic device and the second electronic device The sum of the round-trip distances between the microphone and the speaker of the first electronic device, the round-trip distance including the distance between the speaker of the first electronic device and the microphone of the second electronic device, and the distance between the microphone of the first electronic device and the speaker of the second electronic device; The relative position information between the first electronic device and the second electronic device is determined according to the sum of the round-trip distances.
15. The method according to claim 14, characterized in that The determining, according to the sum of the round-trip distances, the relative position information between the first electronic device and the second electronic device includes: determining a plurality of candidate positions of the second electronic device relative to the first electronic device; Based on each of the candidate positions, determine candidate distances between microphones and speakers in the first electronic device and the second electronic device, respectively, the candidate distances including a distance between the speaker of the first electronic device and the microphone of the second electronic device, and a distance between the microphone of the first electronic device and the speaker of the second electronic device; The relative position information between the first electronic device and the second electronic device is determined based on the candidate position corresponding to the target candidate distance, wherein the target candidate distance is a candidate distance whose matching result with the sum of the round-trip distances satisfies a preset condition among the candidate distances of each candidate position.
16. The method according to any one of claims 12 to 15, characterized in that: At least three combinations are formed between the microphones and speakers in the first electronic device and the second electronic device, each combination includes a speaker and a microphone of the first electronic device, and a speaker and a microphone of the second electronic device, and each combination is not exactly the same or completely different.
17. The method according to claim 16, characterized in that The determining, based on the first receiving result and the second receiving result, relative position information between the first electronic device and the second electronic device includes: Based on the first receiving result and the second receiving result, determining the sum of the round-trip distances between the microphone and the speaker in each combination, wherein the round-trip distance includes the distance between the speaker of the first electronic device and the microphone of the second electronic device, and the distance between the microphone of the first electronic device and the speaker of the second electronic device; The relative position information between the first electronic device and the second electronic device is determined according to the sum of the round-trip distances of each combination.
18. The method according to any one of claims 12 to 17, characterized in that: The method further comprises: A multi-screen interaction is performed between the first electronic device and the second electronic device according to the relative position information.
19. The method according to claim 18, characterized in that The second electronic device includes a fifth electronic device located on the right side of the first electronic device and a sixth electronic device located in front of the first electronic device, and performing multi-screen interaction between the first electronic device and the second electronic device according to the relative position information includes: Detecting a first operation on first target content displayed by the first electronic device; If the first operation is an operation of expanding the first target content to the right, the first electronic device sends the first target content to a display interface of a fifth electronic device located on the right side of the first electronic device for display; If the first operation is an operation of downwardly expanding the first target content, the first electronic device sends the first target content to a display interface of a sixth electronic device located in front of the first electronic device for display.
20. The method according to any one of claims 12 to 19, characterized in that: The method further comprises: After the position of the first electronic device and / or the second electronic device changes, the relative position information between the first electronic device and the second electronic device is re-determined.
21. A method for determining a position, characterized in that: Applied to a first electronic device, the method includes: Sending a first sound wave signal to a second electronic device through a first speaker and a second speaker, and receiving the first sound wave signal through a first microphone and a second microphone; receiving, through the first microphone and the second microphone, a second sound wave signal sent by a third speaker and a fourth speaker of the second electronic device; Determine a first reception result of the first microphone and the second microphone receiving the first sound wave signal and the second sound wave signal; receiving a second reception result sent by the second electronic device, where the second reception result is a reception result of the third microphone and the fourth microphone in the second electronic device receiving the first sound wave signal and the second sound wave signal; Based on the first receiving result and the second receiving result, determining whether the first electronic device and the second electronic device are The relative position information between them.
22. The method according to claim 21, characterized in that The first receiving result includes the time or time difference when the first microphone receives the first sound wave signal and the second sound wave signal, and the time or time difference when the second microphone receives the first sound wave signal and the second sound wave signal; The second reception result includes the time or time difference or audio information when the third microphone receives the first sound wave signal and the second sound wave signal, and the time or time difference or audio information when the fourth microphone receives the first sound wave signal and the second sound wave signal.
23. The method according to claim 21 or 22, characterized in that The first electronic device has the first speaker, the second speaker, the first microphone and the second microphone which are not located in a straight line, and the second electronic device has the third speaker, the fourth speaker, the third microphone and the fourth microphone which are not located in a straight line.
24. An electronic device, characterized in that: The electronic device includes a memory and one or more processors; the memory and the processor are coupled; the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor executes the computer instructions, the electronic device executes the method as described in any one of claims 1-23.
25. A chip system, characterized in that: The chip system is applied to an electronic device; the chip system includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through lines; the interface circuit is used to receive a signal from a memory of the electronic device and send the signal to the processor, the signal including a computer instruction stored in the memory; when the processor executes the computer instruction, the electronic device executes the method as described in any one of claims 1-23.
26. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 23.
27. A computer program product, characterized in that When the computer program product runs on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 23.
Citation Information
Patent Citations
Device and method for device-to-device angle detection with ultrasound and wireless signal
CN104981983A
Positioning method and electronic equipment
CN113873444A
Method, device and system for adjusting position information
CN114363457A
Device interaction method, position determination method, electronic device and chip system
CN114895244A
Bidirectional distance measurement technology
CN1491050A
