Method and electronic device for determining orientation information

By receiving and analyzing sequence information, electronic devices can automatically determine the location of other devices, solving the problem of complex manual configuration in existing technologies, realizing automated location configuration and simplified operation, and improving user experience.

CN116070000BActive Publication Date: 2025-11-21HUAWEI DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111285137.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-01
Publication Date
2025-11-21
Estimated Expiration
2041-11-01

AI Technical Summary

Technical Problem

In existing technologies, the orientation configuration of multiple electronic devices requires manual user intervention, which is complex and results in a poor user experience.

Method used

By receiving and analyzing sequence information, electronic devices can automatically determine the location information of the other device, avoiding manual configuration. For example, the position and angle of the other device can be determined by interacting with ultrasonic signals and Bluetooth signals.

Benefits of technology

It reduces operational complexity, improves user experience, enables automated orientation configuration, and simplifies the setup process for multi-device collaboration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116070000B_ABST
    Figure CN116070000B_ABST
Patent Text Reader

Abstract

The application provides a method and an electronic device for determining orientation information. In the method, a first electronic device can determine, according to a received second sequence, whether a device that sends a first sequence associated with the second sequence is a second electronic device. If the device that sends the first sequence is the second electronic device, the first electronic device can determine orientation information of the second electronic device according to the first sequence. This is beneficial for determining the orientation of the second electronic device or the orientation of the first electronic device according to the orientation information, avoiding the need for manual user participation in configuring the orientation, reducing the complexity of operation, and improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communications, and more specifically to methods and electronic devices for determining location information in the field of communications. Background Technology

[0002] In some scenarios, multiple electronic devices can collaborate to achieve certain functions. When multiple electronic devices are positioned in a preset location, their collaboration is more effective. In existing technologies, users need to manually configure the positions of multiple electronic devices, which is demanding and complex. For example, a large screen can achieve a stereo effect by playing different audio signals from multiple speakers. Users can configure the channel of each speaker through the screen's interface, allowing multiple speakers to play different audio signals from the screen to achieve a stereo effect. However, this process requires manual configuration and necessitates a certain level of knowledge about channel allocation, making it complex and resulting in a poor user experience. Summary of the Invention

[0003] This application provides a method and electronic device for determining location information, which can reduce the complexity of operation and improve the user experience.

[0004] In a first aspect, a method for determining location information is provided, the method being applicable to a first electronic device, the method comprising: receiving a first sequence; receiving a second sequence, the first sequence being associated with the second sequence; determining, based on the second sequence, whether the device sending the first sequence is a second electronic device; if, based on the second sequence, the device sending the first sequence is determined to be the second electronic device, then determining the location information of the second electronic device based on the first sequence.

[0005] In the above scheme, the first electronic device can determine whether the device that sent the first sequence associated with the second sequence is the second electronic device based on the received second sequence. If the device that sent the first sequence is the second electronic device, the first electronic device can determine the location information of the second electronic device based on the first sequence. This is beneficial for determining the location of the second electronic device or the first electronic device based on the location information, avoiding the need for the user to manually configure the location, reducing the complexity of operation, and improving the user experience.

[0006] Optionally, the first electronic device may receive the first sequence first and then the second sequence, or receive the second sequence first and then the first sequence. In this embodiment, the order in which the first electronic device receives the first sequence and the second sequence is not limited.

[0007] Optionally, the first electronic device can be a large screen, and the second electronic device can be a speaker. The large screen can determine the speaker's location information, which helps the large screen to allocate channels to the speaker based on the speaker's location information.

[0008] Optionally, the first electronic device can be a speaker, and the second electronic device can be a large screen. The speaker can determine the orientation information of the large screen. Optionally, the speaker can send the determined orientation information of the large screen to the large screen. The large screen determines the angle of the large screen relative to the speaker and / or the distance between the large screen and the speaker based on the orientation information determined by the speaker. The large screen then assigns sound channels to the speaker based on the angle of the large screen relative to the speaker and / or the distance between the large screen and the speaker.

[0009] Optionally, the first sequence is a sequence that the first electronic device and the second electronic device can know. Specifically, before receiving the first sequence, the second electronic device will notify the first electronic device that the first sequence is about to be sent, or the first electronic device will notify the second electronic device that the first sequence is about to be sent before receiving the first sequence.

[0010] Optionally, the association between the first sequence and the second sequence can be replaced by: the first sequence and the second sequence have a corresponding relationship, and the first electronic device can determine the second sequence based on the first sequence. For example, the first electronic device can determine the second sequence based on the first sequence and the corresponding relationship, and determine whether the device that sent the first sequence is the second electronic device based on the second sequence.

[0011] Optionally, the orientation information of the second electronic device can be used to indicate the angle of the second electronic device relative to the first electronic device, and / or the distance between the first electronic device and the second electronic device. Optionally, the orientation information of the second electronic device can be used to indicate the angle of the second electronic device relative to the first electronic device, and / or, first time information, the first time information being used to determine the distance between the first electronic device and the second electronic device.

[0012] Optionally, the angle of the second electronic device relative to the first electronic device and the angle of the first electronic device relative to the second electronic device are relative concepts. The angle of the second electronic device relative to the first electronic device is the angle of the second electronic device with reference to the first electronic device, and the angle of the first electronic device relative to the second electronic device is the angle of the first electronic device with reference to the second electronic device.

[0013] Optionally, receiving the first sequence includes: receiving an ultrasonic signal including the first sequence. Determining the location information of the second electronic device based on the first sequence includes: determining the location information of the second electronic device based on the ultrasonic signal including the first sequence.

[0014] Optionally, receiving a second sequence includes receiving an ultrasonic signal including the second sequence.

[0015] Optionally, associating the first sequence with the second sequence can be a temporal resource association between receiving the first sequence and receiving the second sequence.

[0016] Optionally, associating the first sequence with the second sequence can be associating the frequency domain resources of receiving the first sequence with receiving the second sequence.

[0017] In some possible implementations, the association between the first sequence and the second sequence can specifically be: the interval between receiving the time-domain resources of the first sequence and receiving the time-domain resources of the second sequence is a preset time-domain interval, and / or, the interval between receiving the frequency-domain resources of the first sequence and receiving the frequency-domain resources of the second sequence is a preset frequency-domain interval.

[0018] In the above scheme, after receiving the first sequence, the first electronic device can determine another time domain resource based on the time domain resource of the received first sequence and a preset time domain interval, and determine the sequence received on the other time domain resource as the second sequence; and / or, after receiving the first sequence, the first electronic device can determine another frequency domain resource based on the frequency domain resource of the received first sequence and a preset frequency domain interval, and determine the sequence received on the other frequency domain resource as the second sequence.

[0019] In some possible implementations, the method further includes: sending a third sequence to the second electronic device; wherein determining whether the device sending the first sequence is the second electronic device based on the second sequence includes:

[0020] If the second sequence is the same as the third sequence, then the device that sent the first sequence is determined to be the second electronic device;

[0021] If the second sequence is different from the third sequence, then it is determined that the device that sent the first sequence is not the second electronic device.

[0022] In the above scheme, the first electronic device can send a third sequence to the second electronic device. If the second sequence received by the first electronic device from the second electronic device is the third sequence sent by the first electronic device to the second electronic device, it means that the first sequence associated with the second sequence was also sent by the first electronic device. If the second sequence received by the first electronic device from the second electronic device is not the third sequence sent by the first electronic device to the second electronic device, it means that the first sequence associated with the second sequence was not sent by the second electronic device.

[0023] In some possible implementations, a third sequence is sent to the second electronic device, including:

[0024] Receive the first operation command;

[0025] In response to the first operation command, the third sequence is sent to the second electronic device.

[0026] In the above scheme, after the first electronic device receives the first operation instruction input by the user, it can send a third sequence to the second electronic device in response to the first operation instruction. That is to say, the first electronic device can send a third sequence to the second electronic device based on the user operation, thus avoiding the first electronic device blindly sending the third sequence.

[0027] In some possible implementations, the method further includes: obtaining the identifier of the second electronic device; wherein, determining whether the device sending the first sequence is the second electronic device based on the second sequence includes: if the second sequence is the identifier of the second electronic device, then determining that the device sending the first sequence is the second electronic device; if the second sequence is not the identifier of the second electronic device, then determining that the device sending the first sequence is not the second electronic device.

[0028] In the above scheme, the first electronic device can obtain the identifier of the second electronic device, and the identifier of the second electronic device is associated with the first sequence. If the second sequence is the identifier of the second electronic device, then the first electronic device determines that the device that sent the first sequence is the second electronic device.

[0029] Optionally, the second electronic device may broadcast a first Bluetooth signal, which includes the identifier of the second electronic device, and the first electronic device may obtain the identifier of the second electronic device from the first Bluetooth signal.

[0030] In some possible implementations, the method further includes receiving a third sequence from the second electronic device before receiving the first sequence;

[0031] Wherein, determining whether the device that sent the first sequence is a second electronic device based on the second sequence includes:

[0032] If the second sequence is the same as the third sequence, then the device that sent the first sequence is determined to be the second electronic device;

[0033] If the second sequence is different from the third sequence, then it is determined that the device that sent the first sequence is not the second electronic device.

[0034] In the above scheme, the second electronic device can send a third sequence to the first electronic device. That is, the second electronic device assigns a third sequence to the first electronic device. If the second electronic device needs to send a first sequence to the first electronic device, the second electronic device can send a first sequence and a second sequence (using the third sequence as the second sequence) to the first electronic device. If the second sequence received by the first electronic device is the third sequence sent by the second electronic device, it means that the second electronic device sent the first sequence to the first electronic device, thus avoiding the situation where the first electronic device cannot know whether the first sequence was sent by the second electronic device.

[0035] Optionally, if the second sequence is the same as the third sequence, then it is determined that the first sequence is sent by the second electronic device to the first electronic device and not to other electronic devices; if the second sequence is different from the third sequence, then it is determined that the first sequence is not sent to the first electronic device but to other electronic devices.

[0036] In some possible implementations, the method further includes:

[0037] The fourth sequence is transmitted through the first speaker;

[0038] The fourth sequence is received at the first moment via the first microphone;

[0039] The step of determining the location information of the second electronic device based on the first sequence includes:

[0040] The angle of the second electronic device relative to the first electronic device is determined based on the first sequence;

[0041] First time information is determined based on the second time of receiving the first sequence and the first time, wherein the orientation information includes the angle of the second electronic device relative to the first electronic device and the first time information;

[0042] The location information is sent to the second electronic device.

[0043] In the above scheme, the first electronic device can determine the first time information based on the first moment of receiving the fourth sequence sent by its own first speaker and the second moment of receiving the first sequence, and the first electronic device can determine the angle of the second electronic device relative to the first electronic device based on the first sequence, and send the determined first time information and the angle of the second electronic device relative to the first electronic device as orientation information to the second electronic device.

[0044] Optionally, after determining that the device sending the first sequence is the second electronic device, the first electronic device sends the fourth sequence through the first speaker. That is, the first electronic device determines that the device sending the first sequence is the second electronic device and triggers the sending of the fourth sequence through the first speaker. If the first electronic device determines that the device sending the first sequence is not the second electronic device, the first electronic device does not send the fourth sequence.

[0045] Optionally, the first electronic device transmits the fourth sequence via a speaker after a preset time period following its determination that the device transmitting the first sequence is the second electronic device. That is, if the first electronic device determines that the device transmitting the first sequence is the second electronic device, then the first electronic device transmits the fourth sequence via the first speaker after the preset time period.

[0046] In some possible implementations, the method further includes: transmitting the third sequence through the first speaker, wherein the fourth sequence is associated with the third sequence.

[0047] In the above scheme, after the first electronic device sends the third sequence through the first speaker, if the third sequence is the second sequence sent by the second electronic device to the first electronic device, then the second electronic device can determine that the device sending the fourth sequence is the first electronic device, and the second electronic device needs to determine the location of the first electronic device.

[0048] Optionally, the first electronic device may send the third sequence first and then the fourth sequence, or send the fourth sequence first and then the third sequence. In this embodiment of the application, there is no limitation on the order in which the first electronic device sends the third sequence and the fourth sequence.

[0049] Optionally, the fourth sequence is a sequence that the first electronic device and the second electronic device can know. Specifically, before receiving the fourth sequence, the first electronic device will notify the second electronic device that the fourth sequence is about to be sent, or the second electronic device will notify the first electronic device that the fourth sequence is about to be sent before receiving the fourth sequence.

[0050] Optionally, the association between the fourth sequence and the third sequence can be replaced by: the fourth sequence and the third sequence have a corresponding relationship, and the first electronic device can determine the third sequence based on the fourth sequence. For example, after the first electronic device sends the fourth sequence, it can determine to send the third sequence based on the fourth sequence and the corresponding relationship.

[0051] Optionally, associating the third sequence with the fourth sequence can be a temporal resource association between transmitting the third sequence and transmitting the fourth sequence.

[0052] Optionally, associating the third sequence with the fourth sequence can be done by associating the frequency domain resources for transmitting the third sequence with those for transmitting the fourth sequence.

[0053] In some possible implementations, the association between the third sequence and the fourth sequence specifically means that the interval between the time-domain resources for transmitting the third sequence and the time-domain resources for transmitting the fourth sequence is a preset time-domain interval, and / or, the interval between the frequency-domain resources for transmitting the third sequence and the frequency-domain resources for transmitting the fourth sequence is a preset frequency-domain interval.

[0054] In the above scheme, the first electronic device can determine another time domain resource based on the time domain resource for transmitting the fourth sequence and a preset time domain interval, and transmit the third sequence on the other time domain resource; and / or, the first electronic device can determine another frequency domain resource based on the frequency domain resource for transmitting the fourth sequence and a preset frequency domain interval, and transmit the third sequence on the other frequency domain resource.

[0055] In some possible implementations, the method further includes:

[0056] Receive the fifth sequence;

[0057] Receive the second sequence, wherein the fifth sequence is associated with the second sequence;

[0058] Wherein, determining the angle of the second electronic device relative to the first electronic device based on the first sequence includes:

[0059] If the third sequence is the same as the second sequence, the device that sent the fifth sequence is determined to be the second electronic device.

[0060] The angle of the second electronic device relative to the first electronic device is determined based on the first sequence and the fifth sequence.

[0061] In the above scheme, the second electronic device can transmit a first sequence and a fifth sequence. If the second sequence related to the first sequence is a third sequence, and the second sequence related to the fifth sequence is a third sequence, then the first electronic device can determine that the first and fifth sequences were transmitted by the second electronic device. The first electronic device can determine the angle of the second electronic device relative to itself based on the first and fifth sequences. That is, the first electronic device can use the first sequence to determine the angle of the second electronic device relative to itself. In this case, the first electronic device can include two microphones, and the first electronic device can determine the angle of the second electronic device relative to itself based on the sampling point difference between the first sequences received by the two microphones. Alternatively, the first electronic device can use the first and fifth sequences to determine the angle of the second electronic device relative to itself. In this case, the second electronic device can transmit the first and fifth sequences through two different speakers respectively, and the first electronic device can determine the angle of the second electronic device relative to itself based on the sampling point difference between the first and fifth sequences transmitted by the two different speakers respectively.

[0062] Optionally, the first electronic device may receive the fifth sequence first and then the second sequence, or receive the second sequence first and then the fifth sequence. In this application embodiment, there is no limitation on the order in which the first electronic device receives the fifth sequence and the second sequence.

[0063] Optionally, the fifth sequence is a sequence that the first electronic device and the second electronic device can know. Specifically, before receiving the fifth sequence, the second electronic device will notify the first electronic device that the fifth sequence is about to be sent, or the first electronic device will notify the second electronic device that the fifth sequence is about to be sent before receiving the fifth sequence.

[0064] Optionally, the association of the fifth sequence with the second sequence can be replaced by: the fifth sequence and the second sequence have a corresponding relationship, and the first electronic device can determine the second sequence based on the fifth sequence. For example, the first electronic device can determine the second sequence based on the fifth sequence and the corresponding relationship, and determine whether the device that sent the fifth sequence is the second electronic device based on the second sequence.

[0065] Optionally, associating the fifth sequence with the second sequence can be a temporal resource association between receiving the fifth sequence and receiving the second sequence.

[0066] Optionally, associating the fifth sequence with the second sequence can be an association of the frequency domain resources of receiving the fifth sequence and receiving the second sequence.

[0067] In some possible implementations, the association of the fifth sequence with the second sequence specifically means that the interval between the time-domain resources of receiving the fifth sequence and the time-domain resources of receiving the second sequence is a preset time-domain interval, and / or, the interval between the frequency-domain resources of receiving the fifth sequence and the frequency-domain resources of receiving the second sequence is a preset frequency-domain interval.

[0068] In the above scheme, the first electronic device can determine another time domain resource based on the time domain resource of the received fifth sequence and a preset time domain interval, and receive the second sequence on the other time domain resource; and / or, the first electronic device can determine another frequency domain resource based on the frequency domain resource of the received fifth sequence and a preset frequency domain interval, and receive the second sequence on the other frequency domain resource.

[0069] In some possible implementations, the method further includes: determining the audio channel of the second electronic device based on the orientation information of the second electronic device, wherein the second electronic device is a speaker;

[0070] Audio signals are sent to the second electronic device according to the audio channel of the second electronic device.

[0071] In the above scheme, the first electronic device can determine the speaker channels based on the speaker's location information and send audio signals to the speakers according to the channel information. In a stereo surround sound scenario, the first electronic device can be a large screen. The large screen can assign different channels to speakers in different locations and send different audio signals to each speaker according to the different speaker channels. Each speaker can play the audio signal from the large screen, thereby achieving a stereo surround sound effect. This avoids the need for users to manually set the channels of each speaker, which is beneficial to improving the user experience.

[0072] In some possible implementations, the method further includes:

[0073] Receives the first Bluetooth signal broadcast by the second electronic device;

[0074] The first Bluetooth signal and the first ultrasonic signal are used to determine whether the second electronic device and the first electronic device are in the same space. The first ultrasonic signal is the ultrasonic signal that sends the first sequence.

[0075] Wherein, determining the audio channel of the second electronic device based on the orientation information of the second electronic device includes:

[0076] If the second electronic device and the first electronic device are in the same space, the audio channel of the second electronic device is determined based on the orientation information of the second electronic device.

[0077] In the above scheme, the first electronic device can determine whether the second electronic device and the first electronic device are in the same space based on the first Bluetooth signal and the first ultrasonic signal that sends the first sequence. If the second electronic device and the first electronic device are in the same space, the first electronic device can determine the audio channel of the second electronic device based on the location information of the second electronic device, and thus send audio signals to the second electronic device according to the audio channel of the second electronic device, avoiding the first electronic device blindly sending audio signals to the second electronic device. If the second electronic device and the first electronic device are not in the same space, and the first electronic device still determines the audio channel of the second electronic device based on the location of the second electronic device and sends audio signals to the second electronic device according to the audio channel of the second electronic device, then a stereo surround sound effect may not be formed, or the stereo surround sound effect formed may be poor.

[0078] Optionally, determining the location information of the second electronic device based on the first sequence includes: if the second electronic device and the first electronic device are in the same space, determining the location information of the second electronic device based on the first sequence. In other words, if the first electronic device determines that the second electronic device and the first electronic device are in the same space, then the first electronic device further determines the location information of the second electronic device; otherwise, the location information of the second electronic device is uncertain.

[0079] In some possible implementations, receiving the first sequence includes: receiving N sequences, wherein the received N sequences include the first sequence, and N is a positive integer greater than 1;

[0080] The method further includes: determining the sequence corresponding to the reception with the best signal quality among the N receptions as the first sequence.

[0081] In the above scheme, the first electronic device can determine the sequence corresponding to the one with the best signal quality among N receptions as the first sequence, which can ensure the accuracy of reception. The first electronic device can determine the second sequence associated with the first sequence, and thus determine the device that sent the first sequence as the second electronic device based on the second sequence.

[0082] In a second aspect, a method for determining location information is provided, the method being applicable to a second electronic device, comprising: sending a first sequence to a first electronic device; sending a second sequence to the first electronic device, the first sequence being associated with the second sequence, the second sequence being used by the first electronic device to determine the electronic device that sent the first sequence, and the first sequence being used by the first electronic device to determine the location information of the second electronic device.

[0083] In the above scheme, the second electronic device can send a first sequence and a second sequence. The first electronic device can determine whether the device that sent the first sequence associated with the second sequence is the second electronic device based on the received second sequence. If the device that sent the first sequence is the second electronic device, the first electronic device can determine the location information of the second electronic device based on the first sequence. This is beneficial for determining the location of the second electronic device or the first electronic device based on the location information, avoiding the need for the user to manually configure the location, and improving the user experience.

[0084] In some possible implementations, associating the first sequence with the second sequence specifically means that the interval between the time-domain resources for transmitting the first sequence and the time-domain resources for transmitting the second sequence is a preset time-domain interval, and / or, the interval between the frequency-domain resources for transmitting the first sequence and the frequency-domain resources for transmitting the second sequence is a preset frequency-domain interval; and / or,

[0085] In some possible implementations, prior to sending the second sequence to the first electronic device, the method further includes:

[0086] Receive the second sequence from the first electronic device; or,

[0087] In some possible implementations, the method further includes sending the second sequence to the first electronic device.

[0088] In some possible implementations, sending the first sequence to the first electronic device includes:

[0089] The first sequence is transmitted through the second speaker;

[0090] The method further includes:

[0091] The first sequence is received via a second microphone at the third moment;

[0092] Receive the fourth sequence at the fourth time point;

[0093] The second time information is determined based on the third time and the fourth time.

[0094] The orientation information is received from the first electronic device, and the orientation information includes the angle of the second electronic device relative to the first electronic device and first time information;

[0095] The distance between the second electronic device and the first electronic device is determined based on the first time information and the second time information.

[0096] In the above scheme, the second electronic device can send a first sequence through its own second speaker and receive the first sequence at a third moment. The second time information is determined based on the third moment of receiving the first sequence sent by its own speaker and the fourth moment of receiving the fourth sequence sent by the first electronic device. The distance between the second electronic device and the first electronic device is determined based on the second time information and the first time information from the first electronic device.

[0097] In some possible implementations, the method further includes: determining the audio channel of the first electronic device based on the distance between the second electronic device and the first electronic device and the angle of the second electronic device relative to the first electronic device, wherein the first electronic device is a speaker;

[0098] Audio signals are sent to the first electronic device according to the audio channel of the first electronic device.

[0099] In the above scheme, the second electronic device can determine the sound channel of the first electronic device based on the distance between the second electronic device and the first electronic device and the angle of the second electronic device relative to the first electronic device, and send audio signals to the first electronic device according to the sound channel of the first electronic device, thereby achieving a stereo surround sound effect.

[0100] In some possible implementations, the method further includes: receiving a third sequence from the first electronic device, the third sequence being associated with the fourth sequence; and determining, if the third sequence is the same as the second sequence, that the device sending the fourth sequence is the first electronic device.

[0101] In the above scheme, if the third sequence is the same as the second sequence, the second electronic device determines that the device sending the fourth sequence is the first electronic device, so that the second electronic device can determine the location of the first electronic device.

[0102] In some possible implementations, the association of the third sequence with the fourth sequence specifically means that the interval between the time-domain resources of receiving the third sequence and the time-domain resources of receiving the fourth sequence is a preset time-domain interval, and / or, the interval between the frequency-domain resources of receiving the third sequence and the frequency-domain resources of receiving the fourth sequence is a preset frequency-domain interval.

[0103] In some possible implementations, sending the second sequence to the first electronic device includes:

[0104] The second sequence is transmitted to the first electronic device via the second speaker;

[0105] The method further includes:

[0106] The second sequence is transmitted to the first electronic device via a third speaker;

[0107] A fifth sequence, associated with the second sequence, is transmitted to the first electronic device via the third speaker.

[0108] In the above scheme, the second electronic device can transmit a first sequence and a second sequence through a second speaker, and then transmit a second sequence and a fifth sequence through a third speaker. The first electronic device determines that the device transmitting the first sequence is the second electronic device based on the second sequence transmitted through the second speaker, and determines that the device transmitting the fifth sequence is the second electronic device based on the second sequence transmitted through the third speaker. The first electronic device can determine the angle of the second electronic device relative to itself based on the first sequence and the fifth sequence.

[0109] In some possible implementations, the distance between the second speaker and the third speaker is greater than a preset distance.

[0110] In the above scheme, the distance between the two speakers of the second electronic device is greater than a preset distance, which helps the first electronic device to determine the angle of the second electronic device relative to the first electronic device based on the first sequence and the fifth sequence.

[0111] Optionally, the distance between the second speaker and the third speaker can be preset, and the second electronic device can send the distance between the second speaker and the third speaker to the first electronic device.

[0112] In some possible implementations, the association of the fifth sequence with the second sequence specifically means that the interval between the time domain resources for transmitting the fifth sequence and the time domain resources for transmitting the second sequence is a preset time domain interval, and / or, the interval between the frequency domain resources for transmitting the fifth sequence and the frequency domain resources for transmitting the second sequence is a preset frequency domain interval.

[0113] In some possible implementations, sending the first sequence to the first electronic device includes:

[0114] Multiple first sequences are sent to the first electronic device through multiple speakers, and each of the multiple speakers corresponds to one of the multiple first sequences.

[0115] The step of sending the second sequence to the first electronic device includes: sending multiple second sequences to the first electronic device through the plurality of speakers, wherein the plurality of speakers correspond one-to-one with the multiple second sequences; wherein a first sequence sent through the same speaker is associated with a second sequence.

[0116] In the above scheme, the second electronic device can transmit a first sequence multiple times through different multiple speakers, and then transmit a second sequence multiple times through the same multiple speakers. Each first sequence transmitted through the same speaker is associated with a second sequence. The first electronic device can determine the first sequence with the best signal quality among the multiple received first sequences, and use the second sequence associated with that first sequence to determine whether the device that sent the first sequence is the second electronic device. In this way, if a speaker of the second electronic device is close to the first electronic device, or happens to have the best transmission quality with the first electronic device, then the signal quality of the pair of associated first and second sequences transmitted by the second electronic device through that speaker will be the best, which is beneficial to improving the signal quality of the first electronic device receiving the first and second sequences.

[0117] Optionally, the second electronic device may transmit the fifth sequence multiple times through multiple speakers, and transmit the second sequence multiple times through the same multiple speakers, wherein a fifth sequence transmitted through the same speaker is associated with a second sequence.

[0118] Optionally, the second electronic device may transmit multiple third sequences through multiple speakers, and transmit multiple fourth sequences through the same multiple speakers, wherein a third sequence transmitted through the same speaker is associated with a fourth sequence.

[0119] Understandably, the beneficial effects of the second aspect can be found in the description of the first aspect, but will not be described in detail to avoid redundancy.

[0120] Thirdly, this application provides an apparatus included in an electronic device, which has the function of implementing the behavior of a first electronic device as described in the first aspect and possible implementations of the first aspect. The function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above-described functions. For example, a determining module or unit, a transceiver module or unit, etc.

[0121] Optionally, the device may be the first electronic device described above.

[0122] Fourthly, this application provides an apparatus included in an electronic device, which has the function of implementing the behavior of a second electronic device as described in the second aspect and possible implementations of the second aspect. The function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above-described functions. For example, a determining module or unit, a transceiver module or unit, etc.

[0123] Alternatively, the device may be the second electronic device described above.

[0124] Fifthly, this application provides an apparatus comprising a processor coupled to a memory for storing computer programs or instructions, and the processor for executing the computer programs or instructions stored in the memory, such that the methods described in the first aspect and possible implementations thereof are performed.

[0125] For example, a processor is used to execute computer programs or instructions stored in memory, causing the device to perform the methods described in the first aspect and possible implementations of the first aspect.

[0126] Optionally, the device may include one or more processors.

[0127] Optionally, the device may also include a memory coupled to the processor.

[0128] Optionally, the device may include one or more memories.

[0129] Alternatively, the memory can be integrated with the processor or set up separately.

[0130] Optionally, the device may also include a transceiver.

[0131] Optionally, the device may be the first electronic device described above.

[0132] In a sixth aspect, this application provides an apparatus comprising a processor coupled to a memory for storing computer programs or instructions, the processor for executing the computer programs or instructions stored in the memory, such that the methods in the second aspect and possible implementations thereof are performed.

[0133] For example, a processor is used to execute computer programs or instructions stored in memory, causing the device to perform the methods described in the second aspect and possible implementations of the second aspect.

[0134] Optionally, the device may include one or more processors.

[0135] Optionally, the device may also include a memory coupled to the processor.

[0136] Optionally, the device may include one or more memories.

[0137] Alternatively, the memory can be integrated with the processor or set up separately.

[0138] Optionally, the device may also include a transceiver.

[0139] Alternatively, the device may be the second electronic device described above.

[0140] In a seventh aspect, this application provides an electronic device, including: one or more processors; a memory; multiple application programs; and one or more computer programs. The one or more computer programs are stored in the memory, and each computer program includes instructions. When the instructions are executed by the electronic device, the electronic device performs the method for determining location information in the first aspect or any possible implementation thereof, or the method for determining location information described in any embodiment of this application.

[0141] Optionally, the electronic device may also include: a touch display screen and / or a camera, wherein the touch display screen includes a touch-sensitive surface and a display.

[0142] Eighthly, this application provides an electronic device, including: one or more processors; a memory; multiple application programs; and one or more computer programs. The one or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed by the electronic device, the electronic device performs the method for determining orientation information in the second aspect or any possible implementation of the second aspect, or the method for determining orientation information described in any embodiment of this application.

[0143] Optionally, the electronic device may also include: a touch display screen and / or a camera, wherein the touch display screen includes a touch-sensitive surface and a display.

[0144] Ninthly, this application provides a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform any of the above-described aspects or any possible methods for determining location information, or methods for determining location information described in any embodiment of this application.

[0145] In a tenth aspect, this application provides a computer program product that, when run on an electronic device, causes the electronic device to execute the method for determining location information described in the first aspect or any possible method of the first aspect, or the method for determining location information described in any embodiment of this application.

[0146] Eleventhly, this application provides an apparatus comprising units for performing the methods described in any embodiment of this application. Attached Figure Description

[0147] Figure 1 This is a schematic block diagram of the structure of the electronic device provided in the embodiments of this application.

[0148] Figure 2 This is a schematic diagram of the software architecture of the electronic device provided in the embodiments of this application.

[0149] Figure 3 This is a schematic diagram of the scene between the speaker and the large screen provided in the embodiments of this application.

[0150] Figure 4 This is a schematic diagram of another scenario between a speaker and a large screen provided in an embodiment of this application.

[0151] Figure 5 This is a method for allocating audio channels with user participation in configuration, provided in the embodiments of this application.

[0152] Figure 6 This is a schematic diagram of the user settings interface provided in an embodiment of this application.

[0153] Figure 7 This is a schematic diagram of a method for determining orientation provided in an embodiment of this application.

[0154] Figure 8 This is a schematic diagram of the network setup provided in the embodiments of this application.

[0155] Figure 9 This is a schematic diagram of the time-domain resources for transmitting the first sequence and the second sequence provided in an embodiment of this application.

[0156] Figure 10 This is a schematic diagram of the frequency domain resources for transmitting the first sequence and the second sequence provided in an embodiment of this application.

[0157] Figure 11 This is a schematic diagram of time-frequency resources for transmitting the first sequence and the second sequence provided in an embodiment of this application.

[0158] Figure 12 This is a schematic diagram of the interface provided in the embodiments of this application, prompting the user whether a network is needed.

[0159] Figures 13-15 This is a schematic diagram illustrating the principle of determining the angle of the second electronic device relative to the first electronic device, as provided in an embodiment of this application.

[0160] Figure 16 This is a schematic diagram of another method for determining orientation provided in an embodiment of this application.

[0161] Figure 17 This is a schematic diagram of a method for a second electronic device to transmit a first sequence and a second sequence through multiple speakers, as provided in an embodiment of this application.

[0162] Figure 18 This is a schematic diagram of a speaker provided in an embodiment of this application.

[0163] Figure 19 This is a schematic diagram of a second electronic device provided in an embodiment of this application transmitting a first sequence and a second sequence through multiple speakers.

[0164] Figure 20 This is a schematic diagram of another second electronic device provided in this application embodiment transmitting a first sequence and a second sequence through multiple speakers.

[0165] Figure 21 This is a schematic diagram of another method for determining orientation provided in the embodiments of this application.

[0166] Figure 22 This is a schematic diagram showing the positional relationship between the speaker and the microphone provided in an embodiment of this application.

[0167] Figure 23 This is a schematic diagram of another method for determining orientation provided in the embodiments of this application.

[0168] Figure 24 This is a schematic diagram illustrating the principle of determining the distance between the first electronic device and the second electronic device, provided in an embodiment of this application.

[0169] Figure 25 This is a schematic diagram of another method for determining orientation provided in the embodiments of this application. Detailed Implementation

[0170] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0171] The technical solutions in the embodiments of this application will now be described clearly and in detail with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.

[0172] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0173] For example, Figure 1A schematic diagram of the structure of electronic device 100 is shown. Electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0174] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. For example, if the electronic device 100 is a speaker, the electronic device 100 may include a processor 110, an internal memory 121, an external memory 120, a power management module 140, a mobile communication module 150, a wireless communication module 160, and an audio module 170.

[0175] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0176] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0177] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0178] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0179] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0180] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.

[0181] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0182] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback through Bluetooth headphones.

[0183] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 100 to display images.

[0184] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0185] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as augmented reality (AR) devices.

[0186] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0187] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via a USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device 100 via the power management module 141.

[0188] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.

[0189] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0190] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.

[0191] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0192] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.

[0193] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0194] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), 5G (the 5th Generation of wireless communication system), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0195] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0196] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may 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 miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.

[0197] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0198] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0199] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0200] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.

[0201] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0202] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0203] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0204] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio signals, phonebooks, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0205] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0206] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.

[0207] Speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. Electronic device 100 can listen to music or make hands-free calls through speaker 170A. In some embodiments, speaker 170A is used to transmit ultrasonic signals. In some embodiments, electronic device 100 may include multiple speakers, for example, electronic device 100 includes a second speaker and a third speaker, the distance between the second speaker and the third speaker being greater than a preset distance, for example, a preset distance of 10cm or 8cm.

[0208] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.

[0209] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 100 may have at least one microphone 170C. In some embodiments, electronic device 100 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc. In some embodiments, the two microphones 170C of electronic device 100 can receive ultrasonic signals transmitted by the speaker of another electronic device. Optionally, the distance between the two microphones 170C of electronic device 100 is greater than a preset distance, such as 2cm, 4cm, 6cm, 8cm, or 10cm.

[0210] The 170D headphone jack is used to connect wired headphones. The 170D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.

[0211] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A may be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When a force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the intensity of the touch operation based on pressure sensor 180A. Electronic device 100 may also calculate the touch position based on the detection signal from pressure sensor 180A.

[0212] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can detect the angle of rotation of the electronic device 100. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of shake of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.

[0213] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.

[0214] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip cover. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover using the magnetic sensor 180D. Then, based on the detected opening and closing state of the cover or the flip cover, features such as automatic flip unlocking can be set.

[0215] The 180E accelerometer can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices and applied to applications such as screen orientation switching and pedometers.

[0216] A distance sensor 180F is used to measure distance. Electronic device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, electronic device 100 can utilize the distance sensor 180F to measure distance for rapid focusing.

[0217] The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 may use the proximity sensor 180G to detect when a user holds the electronic device 100 close to their ear for a call, so as to automatically turn off the screen to save power. The proximity sensor 180G can also be used in holster mode and pocket mode for automatic unlocking and locking of the screen.

[0218] The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 based on the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also work with the proximity sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0219] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.

[0220] Temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 uses the temperature detected by temperature sensor 180J to execute a temperature handling strategy. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs thermal protection by reducing the performance of a processor located near temperature sensor 180J to reduce power consumption. In other embodiments, when the temperature is below another threshold, electronic device 100 heats battery 142 to prevent abnormal shutdown of electronic device 100 due to low temperature. In still other embodiments, when the temperature is below yet another threshold, electronic device 100 boosts the output voltage of battery 142 to prevent abnormal shutdown due to low temperature.

[0221] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch screen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.

[0222] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals from the vibrating bone segments of the human vocal cords. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure signals. In some embodiments, the bone conduction sensor 180M can also be incorporated into headphones to form bone conduction headphones. The audio module 170 can parse the voice signals from the vibrating bone segments of the vocal cords acquired by the bone conduction sensor 180M to realize voice functionality. The application processor can parse heart rate information from the blood pressure signals acquired by the bone conduction sensor 180M to realize heart rate detection functionality.

[0223] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.

[0224] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to touch operations performed on different applications (such as taking photos, playing audio, etc.). Motor 191 can also correspond to different vibration feedback effects for touch operations performed on different areas of the display screen 194. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.

[0225] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.

[0226] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0227] It should be noted that any electronic device mentioned in the embodiments of this application may include more or fewer modules in electronic device 100.

[0228] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.

[0229] Figure 2 This is a software structure block diagram of an electronic device 100 according to an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer. The application layer may include a series of application packages.

[0230] like Figure 2 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, settings, music, video, and SMS.

[0231] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0232] like Figure 2As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0233] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0234] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0235] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0236] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).

[0237] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0238] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0239] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

[0240] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

[0241] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0242] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), image processing libraries, etc.

[0243] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0244] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0245] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0246] A 2D graphics engine is a graphics engine for 2D drawing.

[0247] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0248] In some scenarios, multiple electronic devices can collaborate to achieve certain functions. During collaboration, the devices working in preset positions can improve their performance. However, current technology requires users to manually set the positions of the devices, which is demanding and complex.

[0249] For example, when multiple electronic devices in a user's home are networked, the main electronic device needs to know the location of each electronic device in order to better network the devices.

[0250] For example, a large screen can achieve a stereo effect by playing different audio signals from multiple speakers. The large screen could be a TV, computer, or projector. Users can configure the channel for each speaker through the screen's interface. Multiple speakers playing different audio signals from the screen can achieve a stereo effect. However, this process requires manual configuration and some knowledge of channel allocation, making it complex and resulting in a poor user experience. Figure 3 As shown, users need to assign a left channel to the left speaker and a right channel to the right speaker on the large screen display interface. Specifically, the large screen display interface can display the identifier of the left speaker, and the user assigns the left channel to the left speaker according to the identifier of the left speaker. The large screen display interface can also display the identifier of the right speaker, and the user assigns the right channel to the right speaker according to the identifier of the right speaker.

[0251] The following describes in detail how users set the audio channels.

[0252] like Figure 4 As shown, there are four speakers around the large screen: speaker 1, speaker 2, speaker 3, and speaker 4. The user manually places the four speakers. (The text abruptly ends here, seemingly mid-sentence.) Figure 5 As shown, speaker 1 is powered on and broadcasts a Bluetooth signal. After the large screen detects the Bluetooth signal broadcast by speaker 1, it displays speaker 1 on its screen. The user clicks the "establish connection" button, and in response, the large screen establishes a Bluetooth connection with speaker 1. Based on speaker 1's location, the user sets the left channel for speaker 1 on the large screen's display. The large screen receives the user's command to set speaker 1 to the left channel, for example... Figure 6 As shown, the user uses the remote control to select the left channel to complete the channel setting for speaker 1. The large screen then sends an audio signal to speaker 1 via a newly established Bluetooth connection based on the user's left channel setting. Speaker 2 powers on and broadcasts a Bluetooth signal. After the large screen detects the Bluetooth signal broadcast by speaker 2, it displays the detected speaker 2 on its screen. The user clicks the "establish connection" button, and in response, the large screen establishes a Bluetooth connection with speaker 2. The user then sets the speaker 2 to left surround sound on the large screen's display based on its location. The large screen receives the user's command to set speaker 2 to left surround sound. For example, if the user selects a channel using the remote control... Figure 6 The left surround sound configuration shown completes the channel setup for speaker 2. The large screen sends audio signals to speaker 2 via Bluetooth based on the user's left surround sound setting. Speaker 3 powers on and broadcasts its Bluetooth signal. After the large screen detects the Bluetooth signal broadcast by speaker 3, it displays the found speaker 3 on its screen. The user clicks the "establish connection" button, and in response, the large screen establishes a Bluetooth connection with speaker 3. The user then sets the right channel for speaker 3 on the large screen's display based on its location. The large screen receives the user's command to set speaker 3 to the right channel. For example, the user can select the right channel using a remote control. Figure 6 The right channel shown completes the channel settings for speaker 3. The large screen sends an audio signal to speaker 3 based on the right channel settings configured by the user. Speaker 4 is powered on and broadcasts a Bluetooth signal. After the large screen detects the Bluetooth signal broadcast by speaker 4, it displays the detected speaker 4 on its screen. The user clicks the "establish connection" button, and in response, the large screen establishes a Bluetooth connection with speaker 4. The user sets the right surround sound for speaker 4 on the large screen's display based on its location, and the large screen receives the user's command to set speaker 4 to right surround sound. For example, the user can select the speaker using a remote control... Figure 6The right surround sound configuration shown completes the channel setup for speaker 4. The large screen sends speaker signals to speaker 4 via a Bluetooth connection based on the right surround sound setting assigned by the user. In other words, the user must turn on each speaker sequentially and assign a channel to each speaker based on their relative position to the large screen. This operation is complex and results in a poor user experience. This is especially true when there are many speakers, requiring multiple steps and further complicating the user experience. Alternatively, in some embodiments, all four speakers can be powered on simultaneously, allowing the user to assign channels to each speaker on the large screen. However, in this scenario, the large screen needs to display the identifiers of all four speakers simultaneously. The user needs to know the identifiers of the speakers in different locations and then assign channels to each speaker based on their position. This places higher demands on the user, requiring them to know the identifiers of different speakers in different locations and assign different channels accordingly. This also requires multiple steps and results in a poor user experience.

[0253] In this embodiment, the second electronic device can send a first sequence and a second sequence. The first sequence is a known sequence. Since the first sequence and the second sequence are associated, the first electronic device determines whether the electronic device that sent the first sequence is the second electronic device based on the received second sequence. If the electronic device that sent the first sequence is the second electronic device, the first electronic device can determine the location information of the second electronic device based on the first sequence. This avoids the need for the user to set the location of the second electronic device, thus improving the user experience. This is especially beneficial when there are many electronic devices; the user experience can be further improved.

[0254] The following is combined Figure 7 The embodiments of this application describe a method 700 for determining orientation.

[0255] S701, the second electronic device broadcasts the first Bluetooth signal, and the first electronic device receives the first Bluetooth signal broadcast by the second electronic device.

[0256] Optionally, after the second electronic device is powered on, it can broadcast a first Bluetooth signal. When the first electronic device receives the first Bluetooth signal broadcast by the second electronic device, it indicates that the first electronic device has found the second electronic device.

[0257] Optionally, the first Bluetooth signal includes an identifier of the second electronic device. Optionally, the identifier of the second electronic device can be the Bluetooth media access control (MAC) address of the second electronic device, which is used to uniquely identify the second electronic device.

[0258] Optionally, after receiving the first Bluetooth signal, the first electronic device can establish a Bluetooth channel with the second electronic device. Since the Bluetooth channel established between the first and second electronic devices is not confirmed by the user, it can be understood as an insecure Bluetooth channel.

[0259] Optionally, after receiving the first Bluetooth signal, the first electronic device can establish a Bluetooth channel with the second electronic device. The Bluetooth channel established between the first electronic device and the second electronic device can be authorized and confirmed by the user. Therefore, the Bluetooth channel between the first electronic device and the second electronic device can be understood as a secure Bluetooth channel.

[0260] Alternatively, the first Bluetooth signal in the S701 can be replaced with other signals, such as a WiFi signal.

[0261] S702, the first electronic device sends a third sequence to the second electronic device, and the second electronic device receives the third sequence from the first electronic device.

[0262] Optionally, S702 includes: a first electronic device sending a third sequence to a second electronic device via a WiFi channel, and the second electronic device receiving the third sequence from the first electronic device via the WiFi channel. In this case, the first Bluetooth signal sent by the second electronic device in S701 can be replaced by a WiFi signal.

[0263] Optionally, S702 includes: a first electronic device transmitting a third sequence to a second electronic device via a cellular channel, and the second electronic device receiving the third sequence from the first electronic device via the cellular channel. In this case, the first Bluetooth signal transmitted by the second electronic device in S701 can be replaced by a cellular signal.

[0264] Optionally, S702 includes: a first electronic device sending a third sequence to a second electronic device via a ZigBee channel, and the second electronic device receiving the third sequence from the first electronic device via a ZigBee channel. In this case, the first Bluetooth signal sent by the second electronic device in S701 can be replaced by a ZigBee signal.

[0265] Based on S701, optionally, S702 includes: a first electronic device sending a third sequence to a second electronic device via a Bluetooth channel, and the second electronic device receiving the third sequence from the first electronic device via a Bluetooth channel. Optionally, the Bluetooth channel can be a secure Bluetooth channel or a non-secure Bluetooth channel.

[0266] If the first electronic device sends a third sequence to the second electronic device via the Bluetooth channel, S702 can be triggered in either of the following two ways.

[0267] In method one, the first electronic device receives a first operation command, responds to the first operation command, and executes S702. Optionally, after receiving the first Bluetooth signal and the first operation command input by the user, the first electronic device executes S702. That is, after the first electronic device searches for the second electronic device and receives the first operation command input by the user, it can execute S702. Figure 8 As shown, the first operation command output by the user is that the user clicked the "One-Click Network Setup" button on the first electronic device. Figure 8 The term "one-click networking" can be replaced with "networking," or in a multi-speaker surround sound scenario, it can be replaced with "channel allocation." Of course, other content is also possible; this application's embodiments do not impose limitations. For example... Figure 8 The options shown are in the "Settings" of the "One-Click Networking" application.

[0268] Method 2: In S701, the first electronic device receives the first Bluetooth signal broadcast by the second electronic device, triggering in S702 the first electronic device to send a third sequence to the second electronic device. In other words, after receiving the first Bluetooth signal broadcast by the second electronic device, the first electronic device is triggered to send a third sequence to the second electronic device that broadcast the first Bluetooth signal.

[0269] It should be noted that if the first electronic device sends a third sequence to the second electronic device through other channels, the triggering method for the first electronic device to send a third sequence to the second electronic device is similar to the triggering method for sending a third sequence to the second electronic device through a Bluetooth channel. To avoid redundancy, it will not be described in detail.

[0270] For example, the third sequence can be a token. That is, the third sequence is the sequence assigned by the first electronic device to the second electronic device, also known as the token assigned by the first electronic device to the second electronic device. When the second electronic device sends the first sequence to the first electronic device, it also needs to send the third sequence assigned by the first electronic device. This makes it easier for the first electronic device to identify the second electronic device.

[0271] Optionally, the length of the third sequence is a preset value, such as 16 bits.

[0272] S703, the second electronic device sends the first sequence, and the first electronic device receives the first sequence.

[0273] Specifically, S702 triggers S703. That is, after receiving the third sequence, the second electronic device triggers the second electronic device to send the first sequence.

[0274] Optionally, the second electronic device transmits the first sequence via a signal for measurement, for example, the second electronic device may transmit the first sequence via an ultrasonic signal or via a sound wave signal.

[0275] Optionally, the second electronic device and the first electronic device may know the first sequence in advance. For example, the first sequence may be specified as a frequency-modulated continuous wave (FMCW) sequence or a Zadoff-Chu sequence.

[0276] Optionally, the second electronic device can notify the first electronic device of the first sequence in advance via a Bluetooth channel. For example, after S701, the first electronic device can establish a Bluetooth channel with the second electronic device. The second electronic device can then notify the first electronic device of the first sequence via the Bluetooth channel established after S701. In other words, the second electronic device will inform the first electronic device that the second electronic device is sending the first sequence.

[0277] Optionally, the first electronic device can notify the second electronic device of the first sequence in advance via a Bluetooth channel. For example, after S701, the first electronic device can establish a Bluetooth channel with the second electronic device. The first electronic device can notify the second electronic device of the first sequence through the Bluetooth channel established after S701. That is, the first electronic device will notify the second electronic device to send the first sequence.

[0278] In other words, for the first electronic device, it can perform correlation operations on the first sequence to determine the first sequence from at least one sequence. For example, if a second electronic device sends the first sequence and another electronic device also sends a sequence, and the first electronic device receives both sequences, since it knows that the second electronic device will send the first sequence, it can use the first sequence to perform correlation operations on the two received sequences. The first electronic device then determines that the sequence with the highest correlation is the first sequence sent by the second electronic device.

[0279] S704, the second electronic device sends a second sequence, and the first electronic device receives the second sequence, wherein the first sequence is associated with the second sequence, and the second sequence is the third sequence in S702.

[0280] In other words, the second electronic device sends the third sequence sent by the first electronic device to the second electronic device and then sends it to the first electronic device.

[0281] S702 triggers S704.

[0282] Optionally, associating the first sequence with the second sequence can be as follows: the second electronic device associates the time domain resources for transmitting the first sequence with those for transmitting the second sequence, and the first electronic device associates the time domain resources for receiving the first sequence with those for receiving the second sequence. Optionally, associating the time domain resources for transmitting the first sequence with those for transmitting the second sequence can be understood as: the interval between the time domain resources for transmitting the first sequence and those for transmitting the second sequence is a preset time domain interval; associating the time domain resources for receiving the first sequence with those for receiving the second sequence can be understood as: the interval between the time domain resources for receiving the first sequence and those for receiving the second sequence is a preset time domain interval. That is, the second electronic device transmits the first sequence and the second sequence according to the preset time domain interval, and the first electronic device receives the first sequence and the second sequence according to the preset time domain interval. For example, the second electronic device transmits the first sequence on a first time domain resource, determines a second time domain resource based on the first time domain resource and the preset time domain interval, transmits the second sequence on the second time domain resource, receives the first sequence on a third time domain resource, determines a fourth time domain resource based on the third time domain resource and the preset time domain interval, and receives the second sequence on the fourth time domain resource. If the first time-domain resource and the third time-domain resource are the same, it means there is no transmission delay. If the first time-domain resource and the third time-domain resource are different, then the difference between the third time-domain resource and the first time-domain resource is the transmission delay. Since the second electronic device determines the second time-domain resource based on the first time-domain resource and the preset time-domain interval, and the first electronic device determines the fourth time-domain resource based on the third time-domain resource and the preset time-domain interval, the difference between the fourth time-domain resource and the second time-domain resource is equal to the difference between the third time-domain resource and the first time-domain resource. In other words, the transmission delay of the second sequence and the first sequence can be the same. That is, the time-domain interval between the first time-domain resource and the second time-domain resource is the preset time-domain interval. The frequency-domain resources used by the second electronic device to transmit the first sequence and the second sequence can be the same or different, such as... Figure 9 As shown, the time-domain interval between the first and second time-domain resources is 10 symbols, and the frequency-domain resources for transmitting the first and second sequences by the second electronic device are the same. That is, the second electronic device transmits the first and second sequences according to a preset time-domain interval. After receiving the first sequence, the first electronic device determines the fourth time-domain resource based on the third time-domain resource and the preset time-domain interval, and parses whether the sequence received on the fourth time-domain resource is the third sequence sent to the second electronic device in S702. If so, it indicates that the device that sent the first sequence is the second electronic device. For example, in... Figure 9In the first symbol, the second electronic device transmits the first sequence, with a preset time interval of 10 symbols. Therefore, the second electronic device transmits the second sequence on the 11th symbol. Due to transmission delay, after the first electronic device receives the first sequence on the second symbol, it determines the 12th symbol based on the 10-symbol interval. The first electronic device parses whether the sequence received on the 12th symbol is the third sequence sent to the second electronic device in S702. If so, it indicates that the device that sent the first sequence is the second electronic device.

[0283] Optionally, associating the first sequence with the second sequence can be as follows: the frequency domain resources for transmitting the first sequence and transmitting the second sequence are associated with the frequency domain resources for receiving the first sequence and receiving the second sequence are associated with the frequency domain resources for receiving the second sequence. Optionally, associating the frequency domain resources for transmitting the first sequence and transmitting the second sequence by the second electronic device can be understood as: the interval between the frequency domain resources for transmitting the first sequence and transmitting the second sequence by the second electronic device is a preset frequency domain interval; associating the frequency domain resources for receiving the first sequence and receiving the second sequence by the first electronic device can be understood as: the interval between the frequency domain resources for receiving the first sequence and receiving the second sequence by the first electronic device is a preset frequency domain interval. That is, the second electronic device transmits the first sequence and the second sequence according to the preset frequency domain interval, and the first electronic device receives the first sequence and the second sequence according to the preset frequency domain interval. For example, the second electronic device transmits the first sequence on a first frequency domain resource, determines a second frequency domain resource based on the first frequency domain resource and the preset frequency domain interval, and transmits the second sequence on the second frequency domain resource; the first electronic device receives the first sequence on a third frequency domain resource, determines a second frequency domain resource based on the first frequency domain resource and the preset frequency domain interval, and receives the second sequence on the second frequency domain resource. In other words, the frequency domain interval between the first and second frequency domain resources is a preset frequency domain interval. The time domain resources used by the second electronic device to transmit the first and second sequences can be the same or different, such as... Figure 10 As shown, the frequency domain interval between the first and second frequency domain resources is 5 subcarriers, and the second electronic device transmits the first and second sequences using the same time domain resources. That is, in S704, the second electronic device transmits the first and second sequences according to a preset frequency domain interval. After receiving the first sequence, the first electronic device determines the second frequency domain resource based on the first frequency domain resource and the preset frequency domain interval, and parses whether the sequence received on the second frequency domain resource is the third sequence sent to the second electronic device in S702. If so, it indicates that the device that transmitted the first sequence is the second electronic device. For example, in... Figure 10In the process, the second electronic device transmits the first sequence on the second subcarrier (from bottom to top). The preset frequency domain interval is 5 subcarriers. Therefore, the second electronic device will transmit the second sequence on the 7th subcarrier. After the first electronic device receives the first sequence on the 2nd subcarrier, it determines the 7th subcarrier according to the preset interval of 5 subcarriers. The first electronic device parses whether the sequence received on the 7th subcarrier is the third sequence in S702.

[0284] Optionally, the association between the first sequence and the second sequence can be as follows: the time-domain resources and frequency-domain resources for the second electronic device to transmit the first sequence are associated with the time-domain resources for transmitting the second sequence, and the time-domain resources and frequency-domain resources for the first electronic device to receive the first sequence are associated with the time-domain resources and frequency-domain resources for receiving the second sequence. Optionally, the association between the time-domain resources for the second electronic device to transmit the first sequence and the time-domain resources for transmitting the second sequence can be understood as follows: the interval between the time-domain resources for the second electronic device to transmit the first sequence and the time-domain resources for transmitting the second sequence is a preset time-domain interval, and the interval between the frequency-domain resources for the second electronic device to transmit the first sequence and the frequency-domain resources for transmitting the second sequence is a preset frequency-domain interval; the association between the time-domain resources for the first electronic device to receive the first sequence and the time-domain resources for receiving the second sequence can be understood as follows: the interval between the time-domain resources for the first electronic device to receive the first sequence and the time-domain resources for receiving the second sequence is a preset time-domain interval, and the interval between the frequency-domain resources for the first electronic device to receive the first sequence and the frequency-domain resources for receiving the second sequence is a preset frequency-domain interval. In other words, the time-domain interval between the second electronic device transmitting the first time-domain resource of the first sequence and the second time-domain resource of the second sequence is a preset time-domain interval, and the frequency-domain interval between the second electronic device transmitting the first frequency-domain resource of the first sequence and the second frequency-domain resource of the second sequence is a preset frequency-domain interval. For example... Figure 11 As shown, the frequency domain spacing between the first frequency domain resource and the second frequency domain resource is 6 subcarriers, and the time domain spacing between the first time domain resource and the second time domain resource is 10 symbols.

[0285] Optionally, the aforementioned preset time interval can be predetermined or determined through negotiation between the first electronic device and the second electronic device.

[0286] Optionally, the aforementioned preset frequency domain interval can be predetermined or determined through negotiation between the first electronic device and the second electronic device.

[0287] Optionally, the preset time-domain interval and / or preset frequency-domain interval can be different for different types of second electronic devices. Optionally, the second electronic device can send the preset time-domain interval and / or preset frequency-domain interval to the first electronic device via a Bluetooth channel, or the second electronic device can carry the preset time-domain interval and / or preset frequency-domain interval in the first Bluetooth signal broadcast in S701. Optionally, in S701, after the first electronic device receives the first Bluetooth signal broadcast by the second electronic device, the first electronic device determines the preset time-domain interval and / or preset frequency-domain interval based on the identifier of the second electronic device in the first Bluetooth signal. Electronic devices with different identifiers have different numbers of speakers. The first electronic device can determine the type of the second electronic device based on the identifier of the second electronic device, determine the number of speakers of the second electronic device based on the type of the second electronic device, and determine the preset time-domain interval and / or preset frequency-domain interval based on the number of speakers of the second electronic device. For example, the more speakers the second electronic device has, the larger the preset time-domain interval and / or preset frequency-domain interval; the fewer speakers the second electronic device has, the smaller the preset time-domain interval and / or preset frequency-domain interval. Since the number of speakers differs for different types of second electronic devices, the preset time-domain interval and / or preset frequency-domain interval can be related to the type of the second electronic device.

[0288] Optionally, if the interval between the frequency domain resources of the first sequence and the second sequence transmitted by the second electronic device is a preset frequency domain interval, then S703 and S704 can be executed simultaneously; alternatively, if the interval between the time domain resources of the first sequence and the second sequence transmitted by the second electronic device is a preset time domain interval, S703 can be performed after S704, or S704 can be performed after S703.

[0289] Optionally, the second electronic device sends the third sequence received from the first electronic device in S702 as the second sequence to the first electronic device.

[0290] Optionally, the second electronic device may perform cyclic redundancy check (CRC) verification, channel coding, constellation modulation, etc. on the second sequence to generate a first ultrasonic data frame, and send the first ultrasonic data frame to the first electronic device.

[0291] Optionally, if S703 occurs after S704, the first electronic device saves the content received before S703. After receiving the first sequence, the first electronic device determines a fourth time-domain resource based on the third time-domain resource of the received first sequence and a preset time-domain resource interval, and finds the fourth time-domain resource in the received content saved by the first electronic device before S703, determining the sequence received on the fourth time-domain resource. And / or, the first electronic device determines a second frequency-domain resource based on the first frequency-domain resource of the received first sequence and a preset frequency-domain interval, and finds the second frequency-domain resource in the content saved by the first electronic device before S703, determining the sequence received on the second frequency-domain resource.

[0292] Optionally, if S703 precedes S704, after the first electronic device receives the first sequence in S703, the first electronic device determines a fourth time domain resource based on the third time domain resource of the received first sequence and a preset time domain interval, and receives the sequence on the fourth time domain resource, either not receiving sequences on other time domain resources or discarding sequences received from other time domain resources. And / or, the first electronic device determines a second frequency domain resource based on the first frequency domain resource of the received first sequence and a preset frequency domain interval, and the first electronic device receives the sequence on the second frequency domain resource, either not receiving sequences on other frequency domain resources or discarding sequences received from other frequency domain resources.

[0293] Optionally, the association between the first sequence and the second sequence can be other associations, and the embodiments of this application do not limit the association between the first sequence and the second sequence. For example, the second sequence can be the inversion of the first sequence, or the second sequence can be a shift of the first sequence, etc.

[0294] Optionally, the association between the first sequence and the second sequence can be preset or can be determined through negotiation between the first electronic device and the second electronic device.

[0295] In step S705, the first electronic device determines whether it and the second electronic device are in the same space based on the first Bluetooth signal in step S701 and the first sequence in step S703. If they are in the same space, the subsequent steps of method 700 are executed. Otherwise, method 700 ends. The second electronic device transmits the first sequence via an ultrasonic signal.

[0296] Optionally, the first electronic device determines whether it and the second electronic device are in the same space based on the signal strength of the first Bluetooth signal and the signal strength of the ultrasonic signal transmitting the first sequence. Since the obstruction of a wall causes the attenuation of the ultrasonic signal to be much greater than the attenuation of the Bluetooth signal, if the signal strength of the first Bluetooth signal is much stronger than the signal strength of the ultrasonic signal transmitting the first sequence, it indicates that the first electronic device and the second electronic device are not in the same space. Optionally, the first electronic device can use the difference between the signal strength of the first Bluetooth signal and the signal strength of the ultrasonic signal transmitting the first sequence to determine whether the first electronic device and the second electronic device are in the same space.

[0297] For example, the signal strength of the first Bluetooth signal received by the first electronic device is ρ B ,in, P B For the coefficient related to Bluetooth transmission power, the first electronic device can know P B W B Let ρ be the Bluetooth attenuation coefficient due to wall obstruction, and d be the distance between the first electronic device and the second electronic device. The signal strength of the ultrasonic signal received by the first electronic device from the first sequence is ρ. U ,in, P U The coefficient related to ultrasonic transmission power is P, which the first electronic device can obtain. U W U W represents the ultrasonic attenuation coefficient due to wall obstruction. When the first electronic device and the second electronic device are in the same space, i.e., there is no wall obstruction between them, W... B =1, W U =1. When the first electronic device and the second electronic device are not in the same space, that is, when there is a wall between the first electronic device and the second electronic device, the attenuation of ultrasound is much greater than that of Bluetooth. W U The smaller the value, the greater the attenuation; therefore, W U < <W B Therefore, it can be seen that the first electronic device can utilize the ratio of the signal strength of the received first Bluetooth signal to the signal strength of the received first sequence of ultrasonic signals. Determining whether the first electronic device and the second electronic device are in the same space, due to In other words Regardless of the distance between the first electronic device and the second electronic device, due to P U and P B It is a fixed value. Therefore and Relevant. When there is no wall obstructing the view between the first electronic device and the second electronic device, W B =1, WU =1, In other words, if the ratio of the signal strength of the first Bluetooth signal received by the first electronic device to the signal strength of the first sequence of ultrasonic signals received is equal to... This indicates that the first electronic device and the second electronic device are in the same space. If This indicates that the first electronic device and the second electronic device are not in the same space. Optionally, the first electronic device can set a threshold σ, and the first electronic device can test and obtain σ. When When, it indicates that there is a wall between the first electronic device and the second electronic device, and the first electronic device and the second electronic device are not in the same space. This indicates that there is no wall obstructing the first electronic device and the second electronic device, and that the first electronic device and the second electronic device are in the same space. Optionally,

[0298] It is understood that S705 is an optional step. That is, the first electronic device may not be certain whether the first electronic device and the second electronic device are in the same space. It is assumed that the first electronic device and the second electronic device are in the same space, or the method of the embodiment of this application can still be executed regardless of whether the first electronic device and the second electronic device are in the same space. That is, even if the first electronic device and the second electronic device are not in the same space, the first electronic device can still determine the location of the second electronic device. For example, the first electronic device can still allocate a sound channel to the second electronic device according to the determined location of the second electronic device.

[0299] It is understandable that if S705 exists, then the order of S705 and S704 is not restricted.

[0300] It is also understandable that, for ease of description, in S705, the first electronic device uses the signal strength of the first Bluetooth signal in S701 and the signal strength of the received first sequence of ultrasonic signals in S703 to determine whether the first electronic device and the second electronic device are in the same space. The first electronic device can also determine whether the first electronic device and the second electronic device are in the same space based on the signal strength of other Bluetooth signals and / or other ultrasonic measurement signals sent by the second electronic device. The second electronic device can send other Bluetooth signals before, after, or simultaneously with the first Bluetooth signal. The second electronic device can send other ultrasonic signals between, after, or simultaneously with the first sequence of ultrasonic signals. For example, after the second electronic device is powered on, it can send other ultrasonic signals and other Bluetooth signals. These other ultrasonic signals and other Bluetooth signals can have a corresponding relationship. The first electronic device can determine that the device sending the other ultrasonic signals and the device sending the other Bluetooth signals are both the second electronic device based on the MAC address included in the other Bluetooth signals. In other words, the first electronic device's determination of whether the first electronic device and the second electronic device are in the same space is not limited to being determined based on the received first sequence of ultrasonic signals and the first Bluetooth signal; it can also be determined based on other ultrasonic signals and / or other Bluetooth signals.

[0301] Optionally, in a scenario where the first electronic device determines whether the first electronic device and the second electronic device are in the same space based on the signal strength of other Bluetooth signals and other ultrasonic signals sent by the second electronic device, combined with S702, the other Bluetooth signals and other ultrasonic signals sent by the second electronic device are before the first electronic device receives the first operation command. That is, if the first electronic device determines that the first electronic device and the second electronic device are not in the same space based on the signal strength of other Bluetooth signals and other ultrasonic signals before receiving the first operation command, the first electronic device can output a prompt message indicating whether networking is still necessary since the first electronic device and the second electronic device are not in the same space. After the first electronic device receives a user-input confirmation to continue networking, it continues to execute other steps in method 700. When the first electronic device receives a user-input rejection of networking command, method 700 ends. For example, as... Figure 12 As shown, the first electronic device is a large screen, and the second electronic device is a speaker. The prompt message output by the first electronic device is "The large screen and the speaker are not in the same space. Do you want to continue networking?" If the user clicks "Yes", the other steps of method 700 will continue to be executed. If the user clicks "No", method 700 will end.

[0302] Optionally, the signal strength of the first Bluetooth signal can be the received signal strength indication (RSSI) of the first Bluetooth signal. Optionally, the signal strength of other Bluetooth signals can be the RSSI of the other Bluetooth signals.

[0303] In the presence of multiple second electronic devices, the first electronic device will send different third sequences to different second electronic devices. Therefore, after receiving the first sequence, the first electronic device needs to determine whether the received second sequence is the third sequence sent by the first electronic device to the second electronic device, and thus executes S706.

[0304] S706, if the second sequence is the same as the third sequence sent by the first electronic device to the second electronic device in S702, the first electronic device determines that the device that sent the first sequence is the second electronic device.

[0305] Optionally, if the second sequence is a third sequence sent from the first electronic device to the second electronic device in S702, the first electronic device determines that the device that sent the first and second sequences is the second electronic device. In this way, the first electronic device can execute S707.

[0306] It should be noted that after the first electronic device executes S702, the second electronic device, upon receiving the third sequence from S702, will send the third sequence to the first electronic device in S704. The first electronic device, knowing that it is sending the third sequence to the second electronic device, cannot determine whether it is the third sequence in S704 before parsing the second sequence. Therefore, the sequence from the second electronic device can be defined as the second sequence, and the first electronic device needs to determine whether the second sequence is the same as the third sequence.

[0307] Optionally, if the first electronic device determines in S706 that the device sending the first sequence is the second electronic device, then the first electronic device can also determine that the unencrypted Bluetooth channel established between the second electronic device and the first electronic device after S701 is secure, and the first electronic device and the second electronic device can transmit data through the secure Bluetooth channel.

[0308] S707, the first electronic device determines the location of the second electronic device according to the first sequence.

[0309] Optionally, the orientation of the second electronic device determined by the first electronic device can be the angle of the second electronic device relative to the first electronic device, or it can be the distance between the second electronic device and the first electronic device and the angle of the second electronic device relative to the first electronic device.

[0310] Optionally, the first electronic device may include two microphones, and the first electronic device may use the sampling point difference of the first sequence received by the two microphones to determine the angle of the second electronic device relative to the first electronic device.

[0311] The following describes the principle by which a first electronic device determines the angle of the second electronic device relative to the first electronic device using a first sequence sent by a second electronic device. For example... Figure 13 As shown, the second electronic device can transmit a first sequence via its speaker, and the two microphones of the first electronic device can receive the first sequence transmitted by the speaker of the second electronic device. The first electronic device can use the time difference between the first sequences received by the two microphones to measure the angle of the second electronic device relative to itself. For example, the number of sampling points corresponding to the time difference between the first sequences received by the two microphones of the first electronic device is τ. * Let D be the distance between the two microphones of the first electronic device. Assume the distances from the two speakers of the second electronic device to the two microphones of the first electronic device are D1 and D2, respectively. Then, the number of sampling points corresponding to the time difference between the two microphones receiving the first sequence is... f s Let τ be the sampling rate of the second electronic device, and υ be the speed of sound. In other words, the first electronic device can obtain τ. * f s and υ, therefore, The first electronic device can be based on Determine the angle θ between the second electronic device and the first electronic device.

[0312] The following is combined Figure 14 The principle description is based on Determine the angle θ between the second electronic device and the first electronic device. For example... Figure 14 As shown, D1>D2, AC=D1, AB=D2, EC=D1-D2, AE=D2, meaning triangle ABE is an isosceles triangle. Therefore, ∠AEB=∠ABE=β. When D1 and D2 are much larger than D, that is, ω≈0, then ∠AEB=∠ABE=β=90°, and θ+γ≈90°. According to the triangle inequality, we know that: so In other words, if the speaker of the second electronic device is on the same straight line as the two microphones of the first electronic device, and the speaker of the second electronic device is above the two microphones of the first electronic device, then D1 - D2 = D. Therefore, θ = 0.

[0313] The following is combined Figure 15 The principle description is based on Determine the angle θ between the second electronic device and the first electronic device, such as Figure 15 As shown, when D1 < D2, AC = D1, AB = D2, EB = D2 - D1, AE = D1. That is to say, triangle ACE is an isosceles triangle. Therefore, ∠AEC = ∠ACE = β. When D1 and D2 are much larger than D, that is, ω ≈ 0. Therefore, ∠AEC = ∠ACE = β = 90°, then θ = 90° + γ. According to the triangle's trigonometric relationship, So That is to say, if the speaker of the second electronic device and the two microphones of the first electronic device are on the same straight line, and the speaker of the second electronic device is below the two microphones of the first electronic device, then D1 - D2 = -D. Therefore, θ = 180°.

[0314] It should be noted that the angle of the second electronic device relative to the first electronic device can be the angle formed by the speaker of the second electronic device and any one of the two microphones of the first electronic device. For example Figure 13 in, the angle of the second electronic device relative to the first electronic device can be θ. Optionally, the angle of the second electronic device relative to the first electronic device can also be ∠ACB. The calculation method of ∠ACB is similar to that of θ, and will not be described in detail to avoid redundancy. Another example Figure 14 in, the angle of the second electronic device relative to the first electronic device can be θ. Optionally, the angle of the second electronic device relative to the first electronic device can also be ∠ACB. The calculation method of ∠ACB is similar to that of θ, and will not be described in detail to avoid redundancy.

[0315] It should be noted that the angle of the second electronic device relative to the first electronic device can be understood as: the angle of the speaker of the second electronic device relative to the straight line where the two microphones of the first electronic device are located, that is, θ as shown Figures 13-15 in.

[0316] Next, the first electronic device will determine the distance between the second electronic device and the first electronic device by using the first sequence sent by the second electronic device in three cases.

[0317] Case 1: The first electronic device determines the distance between the second electronic device and the first electronic device according to the signal strength of the received first sequence. For example, the first electronic device determines the distance between the second electronic device and the first electronic device according to the average signal strength of the received first sequence. Assume that the distance between the second electronic device and the first electronic device is d, and the average signal strength of the first sequence is ρ U , Then α is a constant coefficient, such as α being related to the ultrasonic transmission power, or α being related to the ultrasonic transmission power and the obstruction between the first electronic device and the second electronic device. For example, in scenario S705 where the first electronic device determines whether the first electronic device and the second electronic device are in the same space, α = P. U W U .

[0318] Scenario 2: The second electronic device sends a second Bluetooth signal simultaneously with the first sequence. After receiving both the first sequence and the second Bluetooth signal, the first device, whose Bluetooth MAC address is the same as that of the second electronic device, can determine that the electronic device sending the second Bluetooth signal is the same one that sent the first Bluetooth signal. The first electronic device determines the distance between itself and the second electronic device based on the difference between the time it receives the first sequence and the time it receives the second Bluetooth signal. Assuming the distance between them is d, the second electronic device sends both the second Bluetooth signal and the first sequence at time T0, receives the second Bluetooth signal at time T1, and receives the first sequence at time T2. For the first electronic device, T1 and T2 are known values, while T0 is unknown. Therefore, the transmission time of the second Bluetooth signal is T1 - T0 = d / c, where c is the speed of light (c = 3 × 10^8 m / s); the transmission time of the first sequence is T2 - T0 = d / v, where v is the speed of sound (typically around 340 m / s). Therefore, the time difference between the transmission of the first sequence and the second Bluetooth signal is (T2-T0)-(T1-T0)=T2-T1=d / vd / c, so d=(T2-T1)cv / (cv). Alternatively, since c is relatively large, d / c is approximately 0, so T2-T1≈d / v, d≈(T2-T1)v.

[0319] Scenario 3: If the first electronic device in S702 sends a third sequence via the Bluetooth channel, the first electronic device uses the sum of the transmission times of the first and third sequences to determine the distance between itself and the second electronic device. Alternatively, the first electronic device uses the difference between the time it receives the first sequence and the time it sends the third sequence to determine the distance between itself and the second electronic device. Assume the distance between the second and first electronic devices is d. The first electronic device sends the third sequence at time T3, and the second electronic device receives the third sequence at time T4. The second electronic device sends the first sequence after a preset time interval T, and the first electronic device receives the first sequence at time T5. The transmission time of the third sequence is T4 - T3 = d / c, where c is the speed of light, c = 3 × 10^8 m / s; the transmission time of the first sequence is T5 - (T4 + T) = d / v, where v is the speed of sound, which is typically around 340 m / s. In other words, the preset time interval T is known. For the first electronic device, T3, T, and T5 are known, while T4 is unknown. The sum of the transmission times of the first sequence and the third sequence is (T5-(T4+T))+(T4-T3)=d / v+d / c. Therefore, d=vc(T5-T-T3) / (c+v). Alternatively, since c is relatively large, d / c is approximately 0. Therefore, T4-T3 is approximately 0, meaning T4 is approximately equal to T3. Thus, d / v=T5-(T4+T)≈T5-(T3+T). Therefore, d≈(T5-(T3+T))v=(T5-T3-T))v, where T5-T3 is the difference between the time when the first electronic device receives the first sequence and the time when it sends the third sequence.

[0320] Optionally, the second electronic device can be an audio device that can play audio signals from the first electronic device. Therefore, the first electronic device can assign channels to the second electronic device based on its location. Method 700 may further include:

[0321] S708, the first electronic device assigns a sound channel to the first electronic device according to the orientation of the second electronic device.

[0322] Optionally, if the orientation of the second electronic device determined by the first electronic device can be the angle of the second electronic device relative to the first electronic device, then the first electronic device assigns a sound channel to the first electronic device according to the angle of the second electronic device relative to the first electronic device.

[0323] Optionally, if the orientation of the second electronic device determined by the first electronic device can be the distance between the second electronic device and the first electronic device and the angle of the second electronic device relative to the first electronic device, then the first electronic device allocates a sound channel to the first electronic device based on the distance between the second electronic device and the first electronic device and the angle of the second electronic device relative to the first electronic device.

[0324] Optionally, if multiple second electronic devices exist, the first electronic device can assign audio channels to each second electronic device based on the angle of each second electronic device relative to the first electronic device. For example, if the first electronic device is a large screen and the two second electronic devices are two speakers, the large screen can assign audio channels to the two speakers based on the angle of each speaker relative to the large screen. For instance, if the large screen determines that the first speaker is 30 degrees to the left of the large screen, then the large screen assigns the left channel to the first speaker; if the large screen determines that the second speaker is 45 degrees to the right of the large screen, then the large screen assigns the right channel to the second speaker.

[0325] Optionally, if the orientation of each second electronic device can be defined as its angle relative to the first electronic device, the first electronic device can determine the relationship between the angles of one second electronic device relative to the first electronic device and the angles of another second electronic device relative to the first electronic device. For example, if the first electronic device is a large screen and the multiple second electronic devices are four speakers, the large screen can assign channels to the four speakers based on their angles relative to the screen. Specifically, the large screen determines whether the four speakers are on the left or right side of the screen based on their respective angles. Then, the large screen assigns the speaker with the larger left angle as the left channel and the speaker with the smaller left angle as the left surround channel, and the speaker with the larger right angle as the right channel and the speaker with the smaller right angle as the right surround channel. For example, if the large screen determines that speakers 1 and 2 are both on the left side of the screen, and speaker 1's angle relative to the screen is greater than speaker 2's angle relative to the screen, then the large screen can assign the left channel to speaker 1 and the left surround channel to speaker 2.

[0326] Optionally, if the orientation of each second electronic device can be the angle of each second electronic device relative to the first electronic device, and the distance of each second electronic device from the first electronic device, the first electronic device can determine the position of each second electronic device relative to itself based on the angle of each second electronic device relative to itself and the distance of each second electronic device from itself. For example, it can determine whether the second electronic device is to the left or right of the first electronic device, and the relative distance between any two second electronic devices and the first electronic device. For example, if the first electronic device is a large screen and the four second electronic devices are four speakers, the large screen can assign channels to the four speakers based on their distances from the screen and their angles relative to the screen. Specifically, the large screen determines whether the four speakers are to the left or right of the screen based on their angles relative to the screen. Then, the large screen sets the speaker closer to the left as the left channel, the speaker farther from the left as the left surround, the speaker closer to the right as the right channel, and the speaker farther from the right as the right surround. S709, the first electronic device sends audio signals to the second electronic devices according to the channels assigned to them.

[0327] Specifically, the first electronic device can send different audio signals to devices with different channels, thereby creating a stereo surround sound effect. Therefore, the first electronic device sends audio signals to the second electronic device according to the channels assigned to it.

[0328] Optionally, since the first electronic device determines in S706 that the device sending the first sequence is the second electronic device, the first electronic device can also determine that the unencrypted Bluetooth channel established between the first electronic device and the second electronic device after S701 is secure. Therefore, in S709, the first electronic device can send audio signals to the second electronic device through the secure Bluetooth channel, and the second electronic device can play the audio signals from the first electronic device.

[0329] Therefore, in the above method embodiment, the first electronic device can send a third sequence to the second electronic device. After receiving the third sequence, the second electronic device sends a first sequence and a second sequence to the first electronic device. Since the first sequence and the second sequence are related, the first electronic device can obtain the second sequence after receiving the known first sequence. The first electronic device determines whether the device that sent the first sequence is the first electronic device based on the second sequence. If the second sequence is the third sequence sent by the first electronic device to the second electronic device, then the first electronic device determines that the device that sent the first and second sequences is the second electronic device. Therefore, the first electronic device can use the first sequence to determine the location of the second electronic device, avoiding the need for the user to manually configure the location of the second electronic device when the first electronic device cannot determine its location, which is beneficial to improving the user experience. In a stereo surround sound scenario, the first electronic device can assign channels to the second electronic device. The first electronic device can send audio signals to the second electronic device according to the channels assigned by the second electronic device, and the second electronic device can play the audio signals from the first electronic device, avoiding the need for the user to manually assign channels to the second electronic device, which can improve the user experience. Especially when there are many second electronic devices, it can avoid the need for the user to perform multiple configuration operations, which is beneficial to improving the user experience.

[0330] In some embodiments, the first electronic device may not send the third sequence to the second electronic device, and the second sequence sent by the first electronic device may be an identifier of the second electronic device. The following is in conjunction with... Figure 16 Method 1600 is described in the document. For example, method 1600 includes:

[0331] S1601, the second electronic device broadcasts a first Bluetooth signal, and the first electronic device receives the first Bluetooth signal broadcast by the second electronic device. The first Bluetooth signal includes the identifier of the second electronic device.

[0332] Optionally, after the second electronic device is powered on, it can broadcast a first Bluetooth signal. When the first electronic device receives the first Bluetooth signal broadcast by the second electronic device, it indicates that the first electronic device has found the second electronic device.

[0333] Optionally, the identifier of the second electronic device can be the Bluetooth MAC address of the second electronic device, which is used to uniquely identify the second electronic device.

[0334] Optionally, after receiving the first Bluetooth signal, the first electronic device can establish a Bluetooth channel with the second electronic device. Since the Bluetooth channel between the first and second electronic devices is not user-approved, it can be understood as an insecure Bluetooth channel.

[0335] Optionally, after receiving the first Bluetooth signal, the first electronic device can establish a Bluetooth channel with the second electronic device. The Bluetooth channel established between the first electronic device and the second electronic device can be authorized and confirmed by the user. Therefore, the Bluetooth channel between the first electronic device and the second electronic device can be understood as a secure Bluetooth channel.

[0336] Optionally, the first Bluetooth signal in S1601 can be replaced with other signals, such as a WiFi signal, which may include the WiFi MAC address of the second electronic device.

[0337] S1602, the second electronic device sends the first sequence, and the first electronic device receives the first sequence.

[0338] Optionally, the second electronic device can execute S1602 to send the first sequence after being powered on.

[0339] Optionally, after broadcasting the first Bluetooth signal, the second electronic device can send the first sequence, i.e., S1601 can trigger S1602.

[0340] Optionally, the second electronic device and the first electronic device may know the first sequence in advance. For example, the first sequence may be specified as an FMCW sequence or a Zadoff-Chu sequence.

[0341] Optionally, the second electronic device can notify the first electronic device of the first sequence in advance via a Bluetooth channel. For example, after S1601, the first electronic device can establish a Bluetooth channel with the second electronic device. The second electronic device can then notify the first electronic device of the first sequence via the Bluetooth channel established after S1501. In other words, the second electronic device will inform the first electronic device that the second electronic device is sending the first sequence.

[0342] Optionally, the first electronic device can notify the second electronic device of the first sequence in advance via a Bluetooth channel. For example, after S1601, the first electronic device can establish a Bluetooth channel with the second electronic device. The first electronic device can notify the second electronic device of the first sequence through the Bluetooth channel established after S1601. That is, the first electronic device will notify the second electronic device to send the first sequence.

[0343] In other words, the first electronic device can perform correlation operations on the first sequence to determine the first sequence from at least one sequence. For example, if the second electronic device sends the first sequence and another electronic device also sends a sequence, and the first electronic device receives both sequences, since the first electronic device knows that the second electronic device will send the first sequence, the first electronic device uses the first sequence to perform correlation operations on the two received sequences, and the first electronic device determines that the sequence with the highest correlation is the first sequence sent by the second electronic device.

[0344] S1603, the second electronic device sends a second sequence, and the first electronic device receives the second sequence, wherein the first sequence is associated with the second sequence, and the second sequence is an identifier of the second electronic device.

[0345] Optionally, if the identifier of the second electronic device is the Bluetooth MAC address of the second electronic device, then the first sequence is the Bluetooth MAC address of the second electronic device.

[0346] Optionally, if the identifier of the second electronic device is the WiFi MAC address of the second electronic device, then the first sequence is the WiFi MAC address of the second electronic device.

[0347] The relationship between the first sequence and the second sequence is described in S704 of method 700, and will not be described in detail here to avoid redundancy.

[0348] S1604, same as S705.

[0349] S1605, if the second sequence in S1603 is the same as the identifier of the second electronic device, the first electronic device determines that the device that sent the first sequence is the second electronic device.

[0350] Optionally, prior to S1605, the first electronic device may acquire a third sequence identifying the second electronic device.

[0351] Optionally, if the second sequence is the identifier of the second electronic device included in the first Bluetooth signal in S1601, the first electronic device determines that the device sending the first sequence and the second sequence is the second electronic device. In this way, the first electronic device can execute S1606.

[0352] Optionally, if the first electronic device determines in S1605 that the device sending the first sequence is the second electronic device, then the first electronic device can also determine that the unencrypted Bluetooth channel established between the second electronic device and the first electronic device after S1601 is secure, and the first electronic device and the second electronic device can transmit data through the secure Bluetooth channel.

[0353] S1606-S1608 are the same as S707-S709 respectively.

[0354] Therefore, in the above method embodiments, the second electronic device can send a first sequence and a second sequence to the first electronic device. Since the first sequence and the second sequence are associated, the first electronic device can obtain the second sequence after receiving the known first sequence. The first electronic device determines whether the device that sent the first sequence is the first electronic device based on the second sequence. If the second sequence is an identifier sent by the second electronic device, then the first electronic device determines that the device that sent the first and second sequences is the second electronic device. Therefore, the first electronic device can use the first sequence to determine the location of the second electronic device, avoiding the need for the user to manually configure the location of the second electronic device when the first electronic device cannot determine its location, which is beneficial to improving the user experience. In a stereo surround sound scenario, the first electronic device can assign channels to the second electronic device. The first electronic device can send audio signals to the second electronic device according to the assigned channels, and the second electronic device can play the audio signals from the first electronic device, avoiding the need for the user to manually assign channels to the second electronic device, which can improve the user experience, especially when there are many second electronic devices, it can avoid the need for the user to perform multiple configuration operations, which is beneficial to improving the user experience.

[0355] In some embodiments, the second electronic device may include multiple speakers. The second electronic device can transmit multiple first sequences through the multiple speakers, and can also transmit multiple second sequences through the same multiple speakers. A first sequence transmitted through the same speaker is associated with a second sequence. The first electronic device can determine the first received sequence with the best signal quality among the multiple receptions based on the signal quality of the received first sequences, and determine the associated second sequence based on that received first sequence. The first and second sequences are consistent with those in method 700 or method 1600. The following focuses on describing the second electronic device transmitting multiple first sequences and multiple second sequences through the same multiple speakers. Figure 17 As shown, assume the second electronic device has N speakers, where N is an integer greater than 1. Method 1700 includes:

[0356] S1701, the second electronic device transmits the first sequence through the speaker 1, and the first electronic device receives the first sequence.

[0357] Understandably, the steps preceding S1701 can refer to S701 and S702, or refer to S1601.

[0358] Optionally, S1701 includes: a second electronic device transmitting a first sequence at resource location 1 via speaker 1, and a first electronic device receiving the first sequence at resource location 1.

[0359] S1702, the second electronic device transmits the first sequence at resource location 2 via speaker 2, and the first electronic device receives the first sequence at resource location 2.

[0360] Optionally, S1702 includes: a second electronic device transmitting a first sequence at resource location 2 via speaker 2, and a first electronic device receiving the first sequence at resource location 2.

[0361] ...

[0362] S1703, the second electronic device transmits the first sequence at resource location N via speaker N, and the first electronic device receives the first sequence at resource location N.

[0363] Optionally, S1703 includes: a second electronic device transmitting a first sequence at resource location N via a speaker N, and a first electronic device receiving the first sequence at resource location N.

[0364] S1704, the second electronic device transmits the second sequence through the speaker 1, and the first electronic device receives the second sequence.

[0365] Optionally, S1704 includes: a second electronic device transmitting a second sequence at resource location N+1 via speaker 1, and a first electronic device receiving the second sequence at resource location N+1.

[0366] Optionally, the first sequence transmitted in S1701 is associated with the second sequence transmitted in S1704.

[0367] Optionally, associating the first sequence transmitted in S1701 with the second sequence transmitted in S1704 can be achieved by setting the interval between resource position 1 and resource position N+1 to a preset interval of 1. For example, if resource position 1 and resource position N+1 are time-domain resources, then the interval between resource position 1 and resource position N+1 is a preset time-domain interval, i.e., preset interval 1 is a preset time-domain interval. Another example is that if resource position 1 and resource position N+1 are frequency-domain resources, then the interval between resource position 1 and resource position N+1 is a preset frequency-domain interval, i.e., preset interval 1 is a preset frequency-domain interval. Yet another example is that if resource position 1 is a time-frequency domain resource and resource position N+1 is a time-frequency domain resource, then the time-domain resource interval between resource position 1 and resource position N+1 is a preset time-domain interval, and the frequency-domain resource interval is a preset frequency-domain interval, i.e., preset interval 1 is both a preset time-domain interval and a preset frequency-domain interval.

[0368] Optionally, if method 1700 can be combined with method 700, then the second sequence in S1704 is the third sequence in S702.

[0369] Optionally, if method 1700 can be combined with method 1600, then the second sequence in S1704 is an identifier of the second electronic device.

[0370] In other words, the second electronic device transmits a first sequence and a second sequence once through the speaker 1, and the resource locations for transmitting the first sequence and the second sequence are spaced apart by a preset interval of 1.

[0371] S1705, the second electronic device transmits the second sequence through the speaker 2, and the first electronic device receives the second sequence.

[0372] Optionally, S1705 includes: a second electronic device transmitting a second sequence at resource location N+2 via speaker 2, and a first electronic device receiving the second sequence at resource location N+2.

[0373] Optionally, the first sequence transmitted in S1702 is associated with the second sequence transmitted in S1705.

[0374] Optionally, associating the first sequence transmitted in S1702 with the second sequence transmitted in S1704 can be achieved by setting the interval between resource position 2 and resource position N+2 to a preset interval of 2. For example, if resource position 2 and resource position N+2 are time-domain resources, then the interval between resource position 2 and resource position N+2 is a preset time-domain interval, i.e., preset interval 2 is a preset time-domain interval. Another example is that if resource position 2 and resource position N+2 are frequency-domain resources, then the interval between resource position 2 and resource position N+2 is a preset frequency-domain interval, i.e., preset interval 2 is a preset frequency-domain interval. Yet another example is that if resource position 2 is a time-frequency domain resource and resource position N+2 is a time-frequency domain resource, then the time-domain resource interval between resource position 2 and resource position N+2 is a preset time-domain interval, and the frequency-domain resource interval is a preset frequency-domain interval, i.e., preset interval 2 is both a preset time-domain interval and a preset frequency-domain interval.

[0375] Optionally, preset interval 1 is equal to preset interval 2.

[0376] Optionally, if method 1700 can be combined with method 700, then the second sequence in S1705 and the second sequence in S1704 are both the third sequence in S702.

[0377] Optionally, if method 1700 can be combined with method 1600, the second sequence in S1705 and the second sequence in S1704 are both identifiers of the second electronic device.

[0378] In other words, the second electronic device transmits a first sequence and a second sequence once through the speaker 2, and the resource locations for transmitting the first sequence and the second sequence are spaced apart by a preset interval 2.

[0379] ...

[0380] S1706, the second electronic device transmits the second sequence through the speaker N, and the first electronic device receives the second sequence.

[0381] Optionally, S1706 includes: a second electronic device transmitting an ultrasonic data frame N at resource location 2N via a speaker N, and a first electronic device receiving the ultrasonic data frame N at resource location 2N.

[0382] Optionally, the first sequence transmitted in S1703 is associated with the second sequence transmitted in S1706.

[0383] Optionally, associating the first sequence transmitted in S1703 with the second sequence transmitted in S1706 can be achieved by setting the interval between resource position N and resource position 2N to a preset interval N. For example, if resource position N and resource position 2N are time-domain resources, then the interval between resource position N and resource position 2N is a preset time-domain interval, meaning the preset interval N is a preset time-domain interval. As another example, if resource position N and resource position 2N are frequency-domain resources, then the interval between resource position N and resource position 2N is a preset frequency-domain interval, meaning the preset interval N is a preset frequency-domain interval. Yet another example, if resource position N is a time-frequency domain resource and resource position 2N is a time-frequency domain resource, then the time-domain resource interval between resource position N and resource position 2N is a preset time-domain interval, and the frequency-domain resource interval is a preset frequency-domain interval, meaning the preset interval N is both a preset time-domain interval and a preset frequency-domain interval.

[0384] Optionally, preset interval 1, preset interval 2... preset interval N are all equal.

[0385] Optionally, if method 1700 can be combined with method 700, then the second sequence in S1706, the second sequence in S1705, and the second sequence in S1704 are all the third sequence in S702.

[0386] Optionally, if method 1700 can be combined with method 1600, then the second sequence in S1706, the second sequence in S1705, and the second sequence in S1704 are all identifiers of the second electronic device.

[0387] In other words, the second electronic device transmits a first sequence and a second sequence once through the speaker N, and the resource locations for transmitting the first sequence and the second sequence are spaced apart by a preset interval N.

[0388] S1707, the first electronic device determines the first sequence corresponding to the one with the best signal quality from the first sequence of N receptions in S1701-S1703.

[0389] Optionally, in S1701-S1703, the second electronic device transmits ultrasonic signals through N speakers respectively. The ultrasonic signals include a first sequence. In this way, in S1707, the first electronic device can determine the best received signal based on the signal quality of the N ultrasonic signals, and determine the ultrasonic signal in the best received signal as the first sequence in S1707.

[0390] For example, in the scenario of method 1700, the first sequence received in S1702 is the one with the best signal quality.

[0391] S1708, the first electronic device determines the corresponding second sequence based on the first sequence in S1707 and the association between the first sequence and the second sequence.

[0392] Optionally, if the resource location for transmitting the first sequence is associated with the resource location for transmitting the second sequence, the first electronic device determines the second resource location based on the first resource location for receiving the first sequence and a preset interval, and determines the second sequence received at the second resource location. For example, in S1707, it is determined that the first sequence received in S1702 is the one with the best signal quality. Since the first sequence in S1702 corresponds to the second sequence in S1705, the second sequence in S1705 is the second sequence determined in S1708.

[0393] Optionally, the second electronic device includes N speakers. The first and second electronic devices can obtain N kinds of association relationships, with each association relationship corresponding to one speaker. The first and second electronic devices can know the N kinds of association relationships in advance. For example, the first electronic device knows the identifier of the second electronic device, determines the type of the second electronic device based on the identifier, determines the number of speakers of the second electronic device based on the type of the second electronic device, and determines the association relationship based on the number of speakers of the second electronic device.

[0394] Optionally, the aforementioned preset intervals 1, 2, ..., N can be preset, and the first electronic device and the second electronic device can know the preset intervals 1, 2, ..., N.

[0395] Optionally, the resource locations 1, 2, ..., N mentioned above may or may not be related.

[0396] Optionally, the resource locations N+1, N+2, ..., 2N can be associated or not.

[0397] Optionally, the second electronic device may include M loudspeakers, where M is greater than N. That is, if the second electronic device includes multiple loudspeakers, the second electronic device may use some of the loudspeakers to transmit the aforementioned N first sequences and N second sequences of ultrasonic data frames.

[0398] Optionally, the N loudspeakers in method 1700 can be N loudspeaker groups, meaning the second electronic device can simultaneously transmit the first sequence through at least one loudspeaker included in a loudspeaker group. In this way, the first electronic device receives the superimposed first sequence, which can improve gain. Alternatively, the second electronic device can simultaneously transmit the second sequence through at least one loudspeaker included in a loudspeaker group. In this way, the first electronic device receives the superimposed second sequence, which can also improve gain. For example, Figure 18 As shown, the second electronic device includes six speakers: speaker 1 and speaker 2 form one group, speaker 3 and speaker 4 form another group, and speaker 5 and speaker 6 form yet another group. In this case, N in method 1600 is 3.

[0399] Optionally, if method 1700 can be combined with method 700, the steps after the first electronic device determines the first sequence in S1707 and the second sequence in S1708 are described in S705-S709, but will not be described in detail to avoid redundancy.

[0400] Optionally, if method 1700 can be combined with method 1600, the steps after the first electronic device determines the first sequence in S1707 and the second sequence in S1708 are described in S1604-S1608, but will not be described in detail to avoid redundancy.

[0401] Optionally, S1701, S1702, and S1703 are executed before S1704, S1705, and S1706. That is, the second electronic device can transmit the first sequence N times through N speakers, and then transmit the second sequence N times. In this way, after receiving the first sequence N times, if the first electronic device has already determined the first sequence with the best signal quality before the second sequence in S1704, then the first electronic device only receives the second sequence corresponding to that received first sequence, without needing to receive the remaining second sequences. Figure 18 As shown, assume the second electronic device has 6 speakers, numbered Speaker 1, Speaker 2, Speaker 3, Speaker 4, Speaker 5, and Speaker 6. Figure 19As shown, the second electronic device first sends the first sequence 6 times, and then sends the second sequence 6 times. Specifically, the second electronic device sends the first sequence and the second sequence once each through speaker 1, speaker 2, speaker 3, speaker 4, speaker 5, and speaker 6. In this way, after receiving six first sequences, the first electronic device determines the first sequence with the best signal quality among the six received first sequences. The time domain interval between the first sequence and the second sequence transmitted through a speaker is a preset time domain interval. Then, the first electronic device determines another time domain position based on the time domain position of the first sequence with the best signal quality and the preset time domain interval. The first electronic device directly receives the second sequence at the other time domain position. For example, before S1704, the first electronic device determines that the first sequence in S1702 is the first sequence corresponding to the first received sequence with the best signal quality. The first electronic device determines the resource position N+2 based on the resource position 2 of the first sequence in S1702 and the preset time domain interval. The first electronic device only receives the second sequence at the resource position N+2. That is, the first electronic device can only receive the second sequence in S1705 and not receive the second sequences in other steps, or discard the second sequences received in other steps, which helps to save signaling overhead.

[0402] Of course, S1704, S1705 and S1706 can be executed before S1701, S1702 and S1703, that is, the second electronic device can send the second sequence N times through N speakers, and then send the first sequence N times.

[0403] Optionally, S1701 is executed before S1704, S1702 before S1705, and S1703 before S1606. That is, after the second electronic device transmits an ultrasonic measurement signal and an ultrasonic data frame through one speaker, it then transmits a first sequence and a second sequence through another speaker. After receiving N first sequences and N second sequences, the first electronic device needs to save the resource positions of the received N first sequences and N second sequences. After determining the first sequence with the best signal quality based on the signal quality of the received N first sequences, the first electronic device needs to determine the resource position corresponding to the resource position of the received first sequence based on the saved resource positions of the received N first sequences and N second sequences, and then determine the second sequence at that corresponding resource position as the second sequence corresponding to the received first sequence. For example, in... Figure 18 In the scenario shown with 6 speakers, the second electronic device sends the first sequence 6 times and the second sequence 6 times as follows: Figure 20 As shown. The second electronic device first sends a first sequence and a second sequence once through speaker 1, then sends a first sequence and a second sequence once through speaker 2, then sends a first sequence and a second sequence once through speaker 3, then sends a first sequence and a second sequence once through speaker 4, then sends a first sequence and a second sequence once through speaker 5, and finally sends a first sequence and a second sequence once through speaker 6.

[0404] Optionally, S1704 is executed before S1701, S1705 is executed before S1702, and S1706 is executed before S1703. That is, the second electronic device can send a second sequence through a speaker and then send another sequence.

[0405] It should be noted that the above Figure 19 and Figure 20 In the examples, the transmission methods of the first and second sequences in the time domain are used as examples to describe the transmission methods in the frequency domain. The transmission methods in the frequency domain are similar to those in the time domain, but will not be described in detail to avoid redundancy.

[0406] The above embodiments describe a first electronic device determining the location of a second electronic device. In some embodiments, the second electronic device can also determine the location of the first electronic device. The following will combine... Figure 21 This application describes a method for determining orientation provided by embodiments thereof. Figure 21 The method 2100 shown includes:

[0407] S2101, the second electronic device broadcasts the first Bluetooth signal, and the first electronic device receives the first Bluetooth signal broadcast by the second electronic device.

[0408] Optionally, the second electronic device can broadcast the first Bluetooth signal after being powered on.

[0409] Optionally, the first Bluetooth signal includes an identifier of the second electronic device. Optionally, the identifier of the second electronic device can be the Bluetooth MAC address of the second electronic device, which is used to uniquely identify the second electronic device.

[0410] In this process, after the first electronic device receives the first Bluetooth signal broadcast by the second electronic device, it indicates that the first electronic device has found the second electronic device. The display interface of the first electronic device can show the found second electronic device. After the user clicks to connect, the first electronic device and the second electronic device establish a Bluetooth channel. That is to say, the Bluetooth channel established between the first electronic device and the second electronic device is authorized and confirmed by the user. If the user authorizes and confirms the establishment of a Bluetooth channel between the first electronic device and the second electronic device, it can be understood that the user wants to form a network. Therefore, the first electronic device can execute S2102.

[0411] Optionally, similar to method 1600, the second electronic device may also send a first notification message to the first electronic device via a Bluetooth channel. The first notification message is used to notify the second electronic device that it is about to send a first ultrasonic measurement signal. After sending the first notification message, the second electronic device may send the first ultrasonic measurement signal. The first electronic device may receive the first ultrasonic measurement signal. The first electronic device determines whether the first electronic device and the second electronic device are in the same space based on the first ultrasonic measurement signal and the first Bluetooth signal. If they are in the same space, then S2102 is executed.

[0412] The principle by which the first electronic device determines whether the first electronic device and the second electronic device are in the same space based on the first ultrasonic measurement signal and the first Bluetooth signal is similar to the principle by which the first electronic device determines whether the first electronic device and the second electronic device are in the same space based on the first Bluetooth signal and the first sequence in S705. To avoid redundancy, it will not be described in detail.

[0413] S2102, the first electronic device sends a second notification message to the second electronic device via the Bluetooth channel. The second notification message is used to notify the first electronic device that it is about to send a second ultrasonic measurement signal.

[0414] Optionally, the second ultrasonic measurement signal can be an ultrasonic measurement signal that is known to both the first and second electronic devices in advance.

[0415] Optionally, the second electronic device and the first electronic device may have prior knowledge of the second ultrasonic measurement signal. For example, the second ultrasonic measurement signal may be specified as a frequency-modulated continuous wave (FMCW) sequence or a Zadoff-Chu sequence.

[0416] Optionally, the first electronic device can notify the second electronic device of the second ultrasonic measurement signal in advance via a Bluetooth channel. For example, before S2102, the first electronic device can notify the second electronic device of the second ultrasonic measurement signal via a Bluetooth channel. That is, the first electronic device will notify the second electronic device that the ultrasonic measurement signal sent by the first electronic device is the second ultrasonic measurement signal.

[0417] Optionally, the second electronic device can notify the first electronic device of the second ultrasonic measurement signal in advance via a Bluetooth channel. For example, before S2102, the second electronic device can notify the first electronic device to send the second ultrasonic measurement signal. That is, the second electronic device will inform the first electronic device that it is sending the second ultrasonic measurement signal.

[0418] In other words, for the second electronic device, the second ultrasonic measurement signal is a known measurement signal. The second electronic device can perform correlation operations on the second ultrasonic measurement signal to determine the second ultrasonic measurement signal from at least one ultrasonic measurement signal. For example, if the first electronic device sends a second ultrasonic measurement signal, and another electronic device also sends an ultrasonic measurement signal, the second electronic device receives both ultrasonic measurement signals. Since the second electronic device knows that the first electronic device will send a second ultrasonic measurement signal, it uses the second ultrasonic measurement signal to perform correlation operations on the two received ultrasonic measurement signals. The second electronic device then determines that the ultrasonic measurement signal with the highest correlation is the second ultrasonic measurement signal sent by the second electronic device.

[0419] S2103, the first electronic device sends a second ultrasonic measurement signal, and the second electronic device receives the second notification message and then receives the second ultrasonic measurement signal.

[0420] The second electronic device can receive the second ultrasonic measurement signal through two microphones.

[0421] S2104, the second electronic device determines the orientation of the first electronic device relative to the second electronic device based on the second ultrasonic measurement signal.

[0422] Optionally, the orientation of the first electronic device determined by the second electronic device can be the angle of the first electronic device relative to the second electronic device, or it can be the distance between the first and second electronic devices and the angle of the first electronic device relative to the second electronic device. Alternatively, the orientation of the first electronic device relative to the second electronic device determined by the second electronic device can be the angle of the second electronic device relative to the first electronic device, or it can be the distance between the first and second electronic devices and the angle of the second electronic device relative to the first electronic device.

[0423] Optionally, the second electronic device may include two microphones. The second electronic device can determine the angle between the first electronic device and the second electronic device using the sampling point difference of the second ultrasonic measurement signals received by the two microphones. The principle by which the second electronic device determines the angle between the first electronic device and the second electronic device using the second ultrasonic measurement signal sent by the first electronic device is described below. Figure 13 The description is omitted to avoid redundancy.

[0424] Optionally, the first electronic device can transmit a second ultrasonic measurement signal through one speaker and a third ultrasonic measurement signal through another speaker. The second electronic device determines its angle relative to the first electronic device based on the sampling point difference between the second and third ultrasonic measurement signals transmitted by the two speakers of the first electronic device. Optionally, the first electronic device can transmit the second and third ultrasonic measurement signals simultaneously through two speakers respectively. Optionally, the first electronic device can also transmit the second and third ultrasonic measurement signals sequentially through the two speakers. If the first electronic device transmits the second and third ultrasonic measurement signals sequentially through the two speakers, the time difference between the transmission of the second and third ultrasonic measurement signals can be considered.

[0425] For example, such as Figure 22As shown, the first electronic device includes a speaker 1 and a speaker 2. The first electronic device transmits a second ultrasonic measurement signal and a third ultrasonic measurement signal through the speaker 1 and speaker 2. The second electronic device can determine the angle of the second electronic device relative to the first electronic device based on the sampling difference between the second and third ultrasonic measurement signals received by the microphone. If the first electronic device transmits the second and third ultrasonic measurement signals through the speaker 1 and speaker 2 respectively, the second electronic device determines the time difference between the received second and third ultrasonic measurement signals and determines the sampling point difference based on the time difference and the sampling rate. If the first electronic device transmits the second ultrasonic measurement signal first and then the third ultrasonic measurement signal, and the time difference between transmitting the second and third ultrasonic measurement signals is Δt1, and the time difference between the second and third ultrasonic measurement signals received by the second electronic device is Δt2, the second electronic device determines the number of sampling points within Δt2-Δt1 based on the sampling rate, which is the sampling point difference. Figure 22 In the diagram, the distance between speaker 1 and speaker 2 is D', the distance from speaker 1 of the first electronic device to the microphone of the second electronic device is D1', and the distance from speaker 2 of the first electronic device to the microphone of the second electronic device is D'2. Here, D' is a preset value that the second electronic device can obtain, or D' is a value sent by the first electronic device to the second electronic device. D1' and D'2 are unknown. Figure 13 The principle is similar. The second electronic device can determine the angle θ' of the second electronic device relative to the first electronic device based on the sampling point difference between the received second ultrasonic measurement signal and the third ultrasonic measurement signal. To avoid redundancy, it will not be described in detail.

[0426] Optionally, the two speakers of the first electronic device can be a left speaker and a right speaker. Optionally, the distance between the two speakers of the first electronic device is greater than a preset distance, for example, the preset distance can be 10cm. That is, in the process of determining the angle between the first electronic device and the second electronic device, the second electronic device can determine the angle between the first electronic device and the second electronic device by the sampling point difference of the second ultrasonic measurement signals received by the two microphones, or the second electronic device can determine the angle between the second electronic device and the first electronic device by the sampling point difference of the second ultrasonic measurement signals and the third ultrasonic measurement signals respectively sent by the two speakers of the first electronic device. For example, the first electronic device can be a large screen, and the second electronic device can be a speaker. Since the speaker is small in size, it is difficult to set two microphones on the speaker and require the distance between the two microphones to be greater than the preset distance. Therefore, the large screen can send the second ultrasonic measurement signal and the third ultrasonic measurement signal respectively through the two speakers, and the speaker can determine the angle between the speaker and the large screen by the sampling point difference of the second ultrasonic measurement signal and the third ultrasonic measurement signal sent by the two speakers of the large screen.

[0427] The second electronic device measures the distance between the first electronic device and the second electronic device according to the second ultrasonic measurement signal. See the three cases in S707 regarding the principle of the first electronic device measuring the distance between the first electronic device and the second electronic device according to the first sequence. To avoid redundancy, they will not be described in detail.

[0428] S2105, the second electronic device sends the position of the first electronic device relative to the second electronic device to the first electronic device.

[0429] Optionally, the second electronic device can transmit the location of the first electronic device relative to the second electronic device to the first electronic device via a Bluetooth channel.

[0430] Similar to method 700, the orientation of the first electronic device relative to the second electronic device can be the angle between the first electronic device and the second electronic device, or it can be the distance between the first electronic device and the second electronic device and the angle between the first electronic device and the second electronic device.

[0431] Optionally, the second electronic device can be an audio device that can play audio signals from the first electronic device. Therefore, the first electronic device can assign channels to the second electronic device according to its location. Method 2100 may further include:

[0432] S2106, the first electronic device assigns a sound channel to the second electronic device according to the orientation of the first electronic device relative to the second electronic device.

[0433] Specifically, S2106 is described in S708, but will not be described in detail to avoid redundancy.

[0434] S2107, the first electronic device sends an audio signal to the second electronic device according to the audio channel assigned to the second electronic device.

[0435] Specifically, S2107 is described in S709, but will not be described in detail to avoid redundancy.

[0436] In other words, due to the large number or variety of second electronic devices in methods 700 and 1600, the first sequences of different second electronic devices may be the same or different. Therefore, after receiving the first sequence, the first electronic device cannot uniquely identify the second electronic device. Thus, in method 700, the first electronic device can pre-assign a unique third sequence to the second electronic device. If the second sequence returned by the second electronic device is the third sequence assigned by the first electronic device, then the first electronic device can uniquely identify the second electronic device. In method 1600, if the second sequence returned by the second electronic device is an identifier for the second electronic device, then the first electronic device can uniquely identify the second electronic device. Subsequently, the first electronic device can locate the second electronic device based on the first sequence. Especially in a stereo surround sound scenario, the first electronic device can be a large screen, and the second electronic device can be an audio device. The large screen can detect that one or more speakers may be sending the first sequence. If the large screen cannot uniquely identify a speaker upon receiving the first sequence, it can determine that speaker 1 has been found after detecting the first Bluetooth signal sent by speaker 1. Therefore, it assigns a third sequence to speaker 1. The first and second sequences sent by speaker 1 are related. If the large screen determines that the second and third sequences are the same, it can determine that the first sequence was sent by the speaker, and thus can use the first sequence to locate the speaker. In method 1600, the first electronic device can uniquely identify the second electronic device based on whether the second sequence returned by the second electronic device is an identifier of the second electronic device. In method 2100, the second electronic device can determine the location of the first electronic device. Since the second electronic device cannot uniquely determine that the second ultrasonic measurement signal was sent by the first electronic device, the first electronic device can send a second notification message before sending the second ultrasonic measurement signal, indicating that the first electronic device is about to send the second ultrasonic measurement signal. After receiving the second notification message, the second electronic device can determine that the second ultrasonic measurement signal it is about to receive was sent by the first electronic device and not by any other electronic device.

[0437] For example, in the above method embodiments, the first electronic device can be a large screen and the second electronic device can be a speaker.

[0438] It should be noted that the second electronic device can determine the position of the first electronic device relative to itself, or the first electronic device can also determine the position of the second electronic device relative to itself. Furthermore, the first electronic device can also determine the position information of the second electronic device relative to itself. The first electronic device sends the position information of the second electronic device relative to itself to the second electronic device, and the second electronic device can determine the position of the first electronic device relative to itself based on the position information of the second electronic device relative to itself. Specifically, methods 700 and 1600 described above indicate that the first electronic device can also determine the position of the second electronic device relative to itself. In method 2100, the second electronic device can determine the position of the first electronic device relative to itself. As described below in conjunction with method 2300, the first electronic device can also determine the position information of the second electronic device relative to itself. The first electronic device sends the position information of the second electronic device relative to itself to the second electronic device, and the second electronic device can determine the position of the first electronic device relative to itself based on the position information of the second electronic device relative to itself. The following is a description in conjunction with... Figure 23 The method 2300 shown is described below. For example, in method 2300, the first electronic device can be a speaker, and the second electronic device can be a large screen, such as... Figure 23 As shown, method 2300 includes:

[0439] S2301, the first electronic device broadcasts a third Bluetooth signal, and the second electronic device receives the third Bluetooth signal broadcast by the first electronic device.

[0440] Optionally, the first electronic device can broadcast a first Bluetooth signal after being powered on.

[0441] Optionally, the first Bluetooth signal includes an identifier of the first electronic device. Optionally, the identifier of the first electronic device may be the Bluetooth MAC address of the first electronic device, which is used to uniquely identify the first electronic device.

[0442] Optionally, after receiving a third Bluetooth signal broadcast by the first electronic device, the second electronic device can establish a Bluetooth channel with the first electronic device. Optionally, the Bluetooth channel established between the second electronic device and the first electronic device may not require user confirmation; therefore, the Bluetooth channel between the second electronic device and the first electronic device can be understood as an insecure Bluetooth channel. Optionally, the Bluetooth channel established between the second electronic device and the first electronic device may require user confirmation; therefore, the Bluetooth channel between the second electronic device and the first electronic device can be understood as a secure Bluetooth channel.

[0443] S2302, the second electronic device sends a third sequence to the first electronic device, and the first electronic device receives the third sequence from the second electronic device.

[0444] Optionally, S2302 includes: the second electronic device sending a third sequence to the first electronic device via a WiFi channel, and the first electronic device receiving the third sequence from the second electronic device via the WiFi channel. In this case, the third Bluetooth signal sent by the first electronic device in S2301 can be replaced by a WiFi signal.

[0445] Optionally, S2302 includes: the second electronic device sending a third sequence to the first electronic device via a cellular channel, and the first electronic device receiving the third sequence from the second electronic device via a cellular channel. In this case, the third Bluetooth signal sent by the first electronic device in S2301 can be replaced by a cellular signal.

[0446] Optionally, S2302 includes: the second electronic device sending a third sequence to the first electronic device via a ZigBee channel, and the first electronic device receiving the third sequence from the second electronic device via a ZigBee channel. In this case, the third Bluetooth signal sent by the first electronic device in S2301 can be replaced by a ZigBee signal.

[0447] Based on S2301, optionally, S2302 includes: the second electronic device sending a third sequence to the first electronic device via a Bluetooth channel, and the first electronic device receiving the third sequence from the second electronic device via the Bluetooth channel. Optionally, the Bluetooth channel can be a secure Bluetooth channel or a non-secure Bluetooth channel.

[0448] Optionally, if the second electronic device establishes an insecure Bluetooth channel with the first electronic device, the second electronic device can send a third sequence to the first electronic device through the insecure Bluetooth channel, and the first electronic device can receive the third sequence from the second electronic device through the insecure Bluetooth channel. If the second electronic device establishes a secure Bluetooth channel with the first electronic device, the second electronic device can send the third sequence to the first electronic device through the secure Bluetooth channel, and the first electronic device can receive the third sequence from the second electronic device through the secure Bluetooth channel.

[0449] If the second electronic device sends a third sequence to the first electronic device via the Bluetooth channel, S2302 can be triggered in either of the following two ways.

[0450] In method one, the second electronic device receives the first operation command and, in response to the first operation command, executes S2302. Optionally, the second electronic device executes S2302 after receiving the third Bluetooth signal and the first operation command input by the user. That is, the second electronic device can execute S2302 after searching for the first electronic device and receiving the first operation command input by the user. Figure 8 The electronic device in question is a second electronic device, and the first operation command output by the user is that the user clicked the "one-click network setup" button on the second electronic device. Figure 8 The term "one-click networking" can be replaced with "networking," or in a multi-speaker surround sound scenario, it can be replaced with "channel allocation." Of course, other content is also possible; this application's embodiments do not impose limitations. For example... Figure 8 The "One-Click Network Setup" option shown can be found in the "Settings".

[0451] Method 2: In step S2301, the second electronic device receives the third Bluetooth signal broadcast by the first electronic device, triggering step S2302 where the second electronic device sends a third sequence to the first electronic device. In other words, after receiving the third Bluetooth signal broadcast by the first electronic device, the second electronic device is triggered to send a third sequence to the first electronic device that broadcast the third Bluetooth signal.

[0452] It should be noted that if the second electronic device sends a third sequence to the first electronic device through other channels, the triggering method for the second electronic device to send a third sequence to the first electronic device is similar to the triggering method for sending a third sequence to the first electronic device through a Bluetooth channel. To avoid redundancy, it will not be described in detail.

[0453] For example, the third sequence can be a token. That is, the third sequence is the sequence assigned by the first electronic device to the second electronic device, also known as the token assigned by the first electronic device to the second electronic device. When the second electronic device sends the first sequence to the first electronic device, it also needs to send the third sequence assigned by the first electronic device. This makes it easier for the first electronic device to identify the second electronic device.

[0454] Optionally, the length of the third sequence is a preset value, such as 16 bits.

[0455] S2303, the second speaker of the second electronic device transmits the first sequence, the first microphone of the first electronic device receives the first sequence at a second moment, and at the same time, the second electronic device can receive the first sequence through the second microphone at a third moment.

[0456] The description of the first sequence in S2303 is the same as that in S703, and will not be described in detail to avoid redundancy.

[0457] Optionally, the second electronic device may also send a fourth Bluetooth signal. The first electronic device determines whether the first electronic device and the second electronic device are in the same space based on the fourth Bluetooth signal and the first sequence. If the first electronic device determines that the second electronic device and the first electronic device are in the same space, the first electronic device executes the subsequent method; otherwise, it does not execute.

[0458] The second electronic device may execute S2303 or S2304 after a preset time following the transmission of the third sequence in S2302.

[0459] In S2304, the second speaker of the second electronic device sends a second sequence, the first electronic device receives the second sequence, the first sequence is associated with the second sequence, and the second sequence is the third sequence in S2302.

[0460] In other words, the second electronic device will send the third sequence sent to the first electronic device, and then send it back to the first electronic device.

[0461] Optionally, in S2304, the first electronic device may receive the second sequence via the first microphone or the first sequence via a microphone other than the first microphone.

[0462] The relationship between the first sequence and the second sequence in S2303 and S2304 can be found in the description in S704, but will not be described in detail to avoid redundancy.

[0463] The second electronic device can execute S2303 or S2304 after a preset time following the transmission of the third sequence in S2302.

[0464] S2305, if the second sequence is the same as the third sequence sent by the second electronic device to the first electronic device in S2302, the first electronic device determines that the device that sent the first sequence is the second electronic device. In other words, the first sequence and the second sequence are sent by the second electronic device to the first electronic device, and not sent to other electronic devices.

[0465] In other words, since the first electronic device can know the association between the first sequence and the second sequence, such as the time domain resource association of transmitting the first sequence and the second sequence in method 700, and / or the frequency domain resource association of transmitting the first sequence and the second sequence, if the second sequence is the same as the third sequence, the first electronic device can determine the transmitting device of the first sequence associated with the second sequence as the second electronic device based on the association.

[0466] Optionally, if the second sequence is a third sequence sent from the second electronic device to the first electronic device in S2302, the first electronic device determines that the device that sent the first and second sequences is the second electronic device. In this way, the first electronic device can execute S2306.

[0467] It should be noted that after the second electronic device executes S2302, the first electronic device learns the third sequence. In S2304, the second electronic device sends the third sequence to the first electronic device. After the first electronic device parses the third sequence, it cannot know whether it is the third sequence. Therefore, the sequence from the second electronic device can be defined as the second sequence. The first electronic device needs to determine whether the second sequence is the same as the third sequence.

[0468] Optionally, if in S2305 the first electronic device determines that the device sending the first sequence and the second sequence is the second electronic device, or if the first sequence and the second sequence are sent to the first electronic device and not to other electronic devices, then the first electronic device can also determine that the unencrypted Bluetooth channel established between the second electronic device and the first electronic device after S2301 is secure, and the first electronic device and the second electronic device can transmit data through the secure Bluetooth channel.

[0469] Optionally, if the first electronic device includes two microphones, the first electronic device can determine the angle of the second electronic device relative to the first electronic device based on the sampling point difference of the first sequence received by the two microphones in S2303. The specific determination principle is described in the method 700.

[0470] S2306, the first speaker of the first electronic device sends a fourth sequence, the second microphone of the second electronic device receives the fourth sequence at the fourth moment, and at the same time the first microphone of the first electronic device can receive the fourth sequence at the first moment.

[0471] Optionally, S2302 can trigger S2306, that is, the first electronic device can send a fourth sequence after receiving the first sequence.

[0472] Optionally, S2303 can trigger S2306, that is, the first electronic device can send a fourth sequence after receiving the second sequence.

[0473] Optionally, the first electronic device sends a fourth sequence after a preset time period following the receipt of the first or second sequence.

[0474] In other words, the embodiments of this application do not impose any restrictions on the triggering conditions for sending the fourth sequence, and the first electronic device can also send the fourth sequence according to its own implementation.

[0475] Optionally, the first electronic device may notify the second electronic device of the fourth sequence in advance via a Bluetooth channel. For example, after S2301, the first electronic device may establish a Bluetooth channel with the second electronic device. The first electronic device may then notify the second electronic device of the fourth sequence via the Bluetooth channel established after S2301. In other words, the first electronic device will inform the second electronic device that the first electronic device is sending the fourth sequence.

[0476] Optionally, the second electronic device can notify the first electronic device of the fourth sequence in advance via a Bluetooth channel. For example, after S2301, the first electronic device can establish a Bluetooth channel with the second electronic device. The second electronic device can then notify the first electronic device of the fourth sequence via the Bluetooth channel established after S2301. In other words, the second electronic device will notify the first electronic device to send the fourth sequence.

[0477] In other words, the second electronic device can perform correlation operations on the fourth sequence to determine the fourth sequence from at least one sequence. For example, if the first electronic device sends a fourth sequence and another electronic device also sends a sequence, and the second electronic device receives both sequences, since the second electronic device knows that the first electronic device will send a fourth sequence, it can use the fourth sequence to perform correlation operations on the two received sequences. The second electronic device then determines that the sequence with the highest correlation is the fourth sequence sent by the first electronic device.

[0478] S2307, the first electronic device sends a third sequence to the second electronic device through a first speaker, the second electronic device receives the third sequence, and a fourth sequence is associated with the third sequence.

[0479] Optionally, the association between the fourth sequence and the third sequence can be as follows: the time-domain resources of the third sequence transmitted by the first electronic device are associated with the time-domain resources of the fourth sequence transmitted by the first electronic device, and / or, the frequency-domain resources of the third sequence transmitted by the first electronic device are associated with the frequency-domain resources of the fourth sequence transmitted by the first electronic device. Specifically, the association relationship between the third sequence and the fourth sequence can be found in method 700, where the association relationship between the first sequence and the second sequence is described, but will not be detailed in detail to avoid redundancy.

[0480] Optionally, in S2307, the second electronic device may receive the fourth sequence via the second microphone or via a microphone other than the second microphone.

[0481] It is understandable that after receiving the third sequence in S2302, the first electronic device will send the third sequence in S2302 to the second electronic device in S2307. However, for the second electronic device, before parsing the third sequence in S2307, the third sequence sent in S2307 can also be defined as the sixth sequence. Therefore, in S2307, the second electronic device receiving the third sequence can be replaced by the second electronic device receiving the sixth sequence.

[0482] S2308, the first electronic device determines the first time information based on the second time and the first time.

[0483] Optionally, the first time information may indicate the difference between the first time point and the second time point, or the first time information may indicate the difference between the second time point and the first time point.

[0484] S2309, the second electronic device sends a second sequence to the first electronic device through a third speaker, and the first electronic device receives the second sequence.

[0485] It should be noted that, for the second electronic device, after sending the third sequence to the first electronic device in S2302, it will send the third sequence as the second sequence once through the second speaker in S2304, and then again through the third speaker in S2309. For the first electronic device, before parsing the second sequence in S2309, the first electronic device cannot know whether it is the second sequence; therefore, the second sequence from the second electronic device can also be defined as the seventh sequence.

[0486] S2310, the second electronic device sends a fifth sequence to the first electronic device through a third speaker, the first electronic device receives the fifth sequence, and the fifth sequence is associated with the second sequence in S2309.

[0487] Optionally, S2310 can be executed simultaneously with S2303. That is, the second electronic device can send different sequences through different speakers. In this way, after receiving the two sequences, the first electronic device can determine the angle of the second electronic device relative to the first electronic device based on the sampling point difference between the two sequences.

[0488] Optionally, S2310 and S2303 can be executed in sequence. Optionally, S2303 can be executed before S2305. The second electronic device can send the first time difference between sending the first sequence and sending the second sequence to the first electronic device. Alternatively, the time difference between the second electronic device sending the first sequence to the first electronic device through the second speaker and sending the second sequence through the third speaker can be preset, and the first electronic device can be aware of the first time difference.

[0489] Optionally, the second electronic device can notify the first electronic device of the fifth sequence in advance via a Bluetooth channel. For example, after S2301, the first electronic device can establish a Bluetooth channel with the second electronic device. The second electronic device can then notify the first electronic device of the first sequence via the Bluetooth channel established after S2301. In other words, the second electronic device will inform the first electronic device that the second electronic device is sending the fifth sequence.

[0490] Optionally, the first electronic device can notify the second electronic device of the fifth sequence in advance via a Bluetooth channel. For example, after S2301, the first electronic device can establish a Bluetooth channel with the second electronic device. The first electronic device can notify the second electronic device of the fifth sequence through the Bluetooth channel established after S2301. That is, the first electronic device will notify the second electronic device to send the fifth sequence.

[0491] In other words, the first electronic device can perform correlation operations on the fifth sequence to determine the fifth sequence from at least one sequence. For example, if the second electronic device sends a fifth sequence and another electronic device also sends a sequence, and the first electronic device receives both sequences, since the first electronic device knows that the second electronic device will send a fifth sequence, it can perform correlation operations on the two received sequences using the fifth sequence. The first electronic device then determines that the sequence with the highest correlation is the fifth sequence sent by the second electronic device.

[0492] S2311, if the second sequence in S2309 is the same as the third sequence in S2302, the first electronic device determines that the device that sends the fifth sequence is the second electronic device.

[0493] In other words, after the first electronic device determines that the device sending the fifth sequence is the second electronic device, the first electronic device can determine the angle of the second electronic device relative to the first electronic device by measuring the fifth sequence.

[0494] It should be noted that steps S2310 and S2311 can be optional. That is, if the first electronic device includes two microphones, the first electronic device can determine the angle of the second electronic device relative to the first electronic device based on the sampling point difference of the two microphones on the first sequence. Steps S2310 and S2311 may not exist. If steps S2310 and S2311 exist, then method 2300 further includes:

[0495] S2312, the first electronic device determines the angle of the first electronic device relative to the second electronic device based on the first sequence sent by the second electronic device through the second speaker in S2303 and the fifth sequence sent by the second electronic device through the third speaker in S2310.

[0496] In this configuration, both the first sequence in S2303 and the fifth sequence in S2310 are known sequences. The first electronic device can determine the angle of the second electronic device relative to the first electronic device using the sampling point difference between the first and fifth sequences sent by the two different speakers of the second electronic device. Optionally, if the first sequence in S2303 and the fifth sequence in S2310 are sent simultaneously, the first electronic device can determine the sampling point difference based on the time difference between receiving the first and fifth sequences and the sampling rate, and determine the angle of the first electronic device relative to the second electronic device based on the sampling point difference. Optionally, if the first sequence in S2303 and the fifth sequence in S2310 are not transmitted simultaneously, the first electronic device can know the first time difference between the second electronic device transmitting the first sequence in S2303 and the fifth sequence in S2310. The first electronic device determines a third time difference based on the first time difference between the second electronic device transmitting the first sequence in S2303 and the fifth sequence in S2310, and the second time difference between the first electronic device receiving the first sequence in S2303 and the fifth sequence in S2310. It then determines the sampling point difference based on the third time difference and the sampling rate, and determines the angle of the first electronic device relative to the second electronic device based on the sampling point difference. For example, as... Figure 22 Speaker 1 shown can be replaced with a second speaker, and speaker 2 can be replaced with a third speaker. Figure 23 The device including the second and third speakers is the second electronic device, and the device including the microphone is the first electronic device. For example, the first time difference between the second electronic device transmitting the first sequence in S2303 and transmitting the fifth sequence in S2310 is Δt1. The second time difference between the first electronic device receiving the first sequence in S2303 and receiving the fifth sequence in S2310 is Δt2, and the third time difference is Δt2-Δt1. Then, the first electronic device determines the sampling point difference based on Δt2-Δt1 and the sampling rate, based on... Figure 22 Similarly, the first electronic device can determine the angle of the first electronic device relative to the second electronic device, but this will not be described in detail to avoid redundancy.

[0497] S2313, the first electronic device sends first time information to the second electronic device, or sends first time information and the angle of the first electronic device relative to the second electronic device.

[0498] Optionally, if S2312 exists, then in S2313, the first electronic device can send first time information and the angle of the first electronic device relative to the second electronic device to the second electronic device. If S2312 does not exist, then the first time information is sent in S2313. Alternatively, if S2312 does not exist, but the first electronic device can determine the angle of the second electronic device relative to the first electronic device based on the first sequence in S2303, then in S2313, the first electronic device can send the first time information and the angle of the second electronic device relative to the first electronic device determined by the first electronic device based on the first sequence in S2303 to the second electronic device.

[0499] Optionally, the first electronic device may send first time information and the angle of the first electronic device relative to the second electronic device simultaneously or sequentially. For example, if the first electronic device first determines the angle of the first electronic device relative to the second electronic device and then determines the first time information, then it will send the angle of the first electronic device relative to the second electronic device first, and then send the first time information.

[0500] Optionally, the first electronic device may send first time information to the second electronic device via a Bluetooth channel, or send first time information and the angle of the first electronic device relative to the second electronic device via a Bluetooth channel.

[0501] It is understandable that the first electronic device can also send first-time information to the second electronic device via a WiFi channel, a cellular channel, or a ZigBee channel, or send first-time information and the angle of the first electronic device relative to the second electronic device.

[0502] S2314, if the third sequence in S2307 is the second sequence in S2304, the second electronic device determines that the device sending the fourth sequence is the first electronic device.

[0503] Since the second sequence is the third sequence, S2310 can be replaced with: if the third sequence in S2307 is the third sequence in S2302, the second electronic device determines that the device sending the fourth sequence is the first electronic device.

[0504] Optionally, if the third sequence received by the second electronic device in S2307 is defined as the sixth sequence, then in S2314 it can be replaced by: if the sixth sequence in S2307 is the same as the third sequence in S2302, then the second electronic device determines that the device sending the fourth sequence is the first electronic device.

[0505] In other words, after the second electronic device determines that the device sending the fourth sequence is the first electronic device, the second electronic device needs to determine the location of the first electronic device. In other words, if the third sequence in S2307 is the same as the second sequence in S2304, the second electronic device needs to determine the location of the second electronic device sending the fourth sequence based on the fourth sequence associated with S2307.

[0506] It is understandable that steps S2307 and S2314 can be optional. That is, the first electronic device may not need to send the third sequence through the first speaker, and the second electronic device is assumed to be able to uniquely identify the first electronic device. For example, if S2313 appears before S2307, the second electronic device can determine that the first time information was sent by the first electronic device based on S2313, or the first time information and the angle of the first electronic device relative to the second electronic device, in which case the second electronic device needs to determine the orientation of the first electronic device.

[0507] S2315, the second electronic device determines the second time information based on the fourth time and the third time.

[0508] Optionally, if the third time point occurs before the fourth time point, the second time point information can indicate the difference between the fourth time point and the third time point.

[0509] S2316, the second electronic device determines the distance between the first electronic device and the second electronic device based on the first time information and the second time information.

[0510] Optionally, S2316 includes: the second electronic device determining the distance between the first electronic device and the second electronic device based on the first time information, the second time information, the distance between the second microphone and the second speaker of the second electronic device, and the distance between the first microphone and the first speaker of the first electronic device.

[0511] Optionally, the second electronic device can obtain the distance between the first microphone and the first speaker of the first electronic device from the first electronic device.

[0512] Optionally, the second electronic device can determine the identifier of the first electronic device based on the first Bluetooth signal, determine the type of the first electronic device based on the identifier of the first electronic device, and determine the distance between the first microphone and the first speaker of the first electronic device based on the type of the first electronic device.

[0513] The following is combined Figure 24 This describes the principle by which the second electronic device determines the distance between the first and second electronic devices based on first and second time information. For example... Figure 24As shown, the first electronic device includes a first microphone and a first speaker, with a distance d1 between them. The second electronic device includes a second microphone and a second speaker, with a distance d3 between them. The second electronic device can know d1 and d3, meaning it can know the distance between the first microphone and the first speaker of the first electronic device, as well as the distance between its own second microphone and its second speaker. The first electronic device can send d1 to the second electronic device, or the second electronic device can receive a first Bluetooth signal from the first electronic device and determine its type based on the identifier in the first Bluetooth signal, and then determine d1 based on that identifier. The distance between the second speaker of the second electronic device and the first microphone of the first electronic device is d3 (unknown), and the distance between the first speaker of the first electronic device and the second microphone of the second electronic device is d4 (unknown). d3 is approximately equal to d4, so d3≈d4≈d, meaning d is the distance between the second electronic device and the first electronic device. The value of d will be calculated below.

[0514] like Figure 24 As shown, if the first sequence and the fourth sequence are transmitted via ultrasonic signals, for step S2303, the second speaker of the second electronic device transmits the first sequence at time t1, the second microphone of the second electronic device receives the first sequence at time t2 (i.e., the aforementioned third time), and the first microphone of the first electronic device receives the first sequence at time t3 (i.e., the aforementioned second time). For step S2306, the first speaker of the first electronic device transmits the fourth sequence at time t4, the first microphone of the first electronic device receives the fourth sequence at time t5 (i.e., the aforementioned first time), and the second microphone of the second electronic device receives the fourth sequence at time t6 (i.e., the aforementioned fourth time). In the following formula, v is the speed of sound, where:

[0515] d1=(t5-t4)v

[0516] d2=(t2-t1)v

[0517] d3=(t3-t1)v

[0518] d4=(t6-t4)v

[0519] d3-d2=(t3-t1)v-(t2-t1)v=(t3-t2)v

[0520] d4-d1=(t6-t4)v-(t5-t4)v=(t6-t5)v

[0521] 2d=d3+d4=(t3-t2)v+(t6-t5)v+d1+d2

[0522] d=((t6-t2)-(t5-t3)v) / 2+(d1+d2) / 2

[0523] Where t6-t2 is the difference between the fourth and third time points mentioned above, and t5-t3 is the difference between the first and second time points.

[0524] It is understood that the derivation of the above formula is only one method for determining the distance between the second electronic device and the first electronic device. Other formulas can be derived based on the above formula, and the embodiments of this application are not limited thereto.

[0525] Optionally, in a stereo surround sound scenario, the first electronic device can be an audio device, and method 2300 may further include:

[0526] S2317, the second electronic device assigns a channel to the first electronic device based on the angle of the first electronic device relative to the second electronic device, or based on the distance between the first electronic device and the second electronic device and the angle of the first electronic device relative to the second electronic device.

[0527] It should be noted that some steps in method 2300 are optional. For example, steps related to calculating the distance between the first electronic device and the second electronic device in method 2300 are optional. For instance, method 2300 may not include S2306-S2308, S2315, and S2316, and S2313 may not include the first time information. In this way, the second electronic device can receive the angle of the first electronic device relative to itself in S2313, and in S2317, the second electronic device can assign a sound channel to the first electronic device based on the angle of the first electronic device relative to itself.

[0528] Optionally, if there are multiple first electronic devices, the second electronic device can assign audio channels to each first electronic device based on the angle of each first electronic device relative to the second electronic device. For example, if the second electronic device is a large screen and the two first electronic devices are two speakers, the large screen can assign audio channels to the two speakers based on the angle of each speaker relative to the large screen. For instance, if the large screen determines that the first speaker is 30 degrees to the left of the large screen, then the large screen assigns the left channel to the first speaker; if the large screen determines that the second speaker is 45 degrees to the right of the large screen, then the large screen assigns the right channel to the second speaker.

[0529] Optionally, if multiple first electronic devices exist, the second electronic device can determine the relationship between the angles of one first electronic device relative to the second electronic device and the angles of another first electronic device relative to the second electronic device, based on the angles of each first electronic device relative to the second electronic device. For example, if the second electronic device is a large screen and the multiple first electronic devices are four speakers, the large screen can assign channels to the four speakers based on their angles relative to the screen. Specifically, the large screen determines whether the four speakers are on the left or right side of the screen based on their respective angles. Then, the large screen assigns the speaker with the larger left angle as the left channel and the speaker with the smaller left angle as the left surround channel, and the speaker with the larger right angle as the right channel and the speaker with the smaller right angle as the right surround channel. For example, if the large screen determines that speakers 1 and 2 are both on the left side of the screen, and the angle of speaker 1 relative to the screen is greater than the angle of speaker 2 relative to the screen, then the large screen can assign the left channel to speaker 1 and the left surround channel to speaker 2.

[0530] Optionally, if multiple first electronic devices exist, the second electronic device assigns audio channels to each first electronic device based on the distance between each first electronic device and the second electronic device, and the angle of each first electronic device relative to the second electronic device. The second electronic device can determine the position of each first electronic device relative to the second electronic device based on the angle of each first electronic device relative to the second electronic device and the distance between each first electronic device and the second electronic device. For example, it can determine whether a first electronic device is to the left or right of the second electronic device, and the relative distance between any two first electronic devices. For instance, if the second electronic device is a large screen and the four first electronic devices are four speakers, the large screen can assign audio channels to the four speakers based on their distances from the screen and their angles relative to the screen. Specifically, the large screen determines whether the four speakers are to the left or right of the screen based on their angles relative to the screen. Then, the large screen sets the speaker closer to the left as the left channel, the speaker farther from the left as the left surround, the speaker closer to the right as the right channel, and the speaker farther from the right as the right surround. S2318, the second electronic device sends audio signals to the first electronic device according to the audio channels assigned to the first electronic devices.

[0531] The first electronic device plays an audio signal from the second electronic device.

[0532] Understandably, in a stereo surround sound scenario, after the first and second electronic devices execute the above method 2300, for another audio device, the third electronic device, the second electronic device can again execute steps similar to method 2300 with the third electronic device. The difference is that the second electronic device can send a sequence different from the third sequence to the third electronic device in S2302. That is, the second electronic device can control different audio devices to form a stereo surround sound scenario. The second electronic device can assign different sequences to different audio devices. Different audio devices can distinguish whether the second electronic device should network with itself based on the received sequence, thereby forming a stereo surround sound scenario.

[0533] It should be noted that the order of the steps in method 2300 is not restricted, and the execution order of each step can be determined according to the internal logic, regardless of the step number. For example, if the first time information is sent in S2313, then S2313 can be after S2308. The order of S2313 and any of the steps in S2309-S2312 is not restricted. After the first electronic device determines the angle of the second electronic device relative to the first electronic device, it then sends the angle of the second electronic device relative to the first electronic device to the second electronic device. Similarly, the order of any of the steps in S2315 and S2306-S2314 is not restricted.

[0534] It should also be noted that some steps in method 2300 are optional. For example, S2309-S2312 are optional steps, meaning that these four steps may not exist in method 2300. In other words, the first electronic device may not be able to determine the angle of the second electronic device relative to the first electronic device. The second electronic device can determine the angle of the first electronic device relative to the second electronic device based on the fourth sequence in S2306. Thus, in S2313, the first electronic device does not send the angle of the second electronic device relative to the first electronic device.

[0535] It is understandable that the first sequence in S2303 and the second sequence in S2304 are a pair of related sequences. For example, the second electronic device sends the first sequence in S2303 at the first resource location, and the second electronic device sends the second sequence in S2304 at the second resource location. The interval between the first resource location and the second resource location is a preset interval. The second electronic device determines the resource location corresponding to the second sequence based on the known resource location of the first sequence and the preset interval, and parses the second sequence at that resource location to determine whether the parsed second sequence is the third sequence in S2302. If so, it means that the first sequence was sent by the second electronic device to the first electronic device and not to other electronic devices. The fourth sequence in S2306 and the third sequence in S2307 are a pair of related sequences. For example, the first electronic device sends the fourth sequence in S2306 at the third resource location and sends the third sequence in S2307 at the fourth resource location. The interval between the third and fourth resource locations is a preset interval. The second electronic device determines the resource location corresponding to the third sequence based on the known resource location of the received fourth sequence and the preset interval, and parses the third sequence at that resource location. It then determines whether the parsed third sequence is consistent with the third sequence in S2304. If so, it indicates that the fourth sequence was sent by the first electronic device to the second electronic device, and the location of the second electronic device needs to be determined. The second sequence in S2309 and the fifth sequence in S2310 are a pair of related sequences. For example, the second electronic device sends the fifth sequence in S2310 at the fifth resource location, and the second electronic device sends the second sequence in S2309 at the sixth resource location. The interval between the fifth resource location and the sixth resource location is a preset interval. The second electronic device determines the resource location corresponding to the second sequence in S2309 based on the resource location of the known fifth sequence and the preset interval, and parses the second sequence at that resource location. It determines whether the parsed second sequence is the third sequence in S2302. If so, it means that the fifth sequence was sent by the second electronic device to the first electronic device and not to other electronic devices. The first electronic device can use the known first sequence and the known fifth sequence to measure the angle of the second electronic device relative to itself.

[0536] In some embodiments, this application also provides, as Figure 25 The method 2500 for determining location information shown can be used as follows: the second electronic device can be a large screen, the first electronic device can be speaker 1, and the third electronic device can be speaker 2, etc. Figure 25 As shown, method 2500 includes:

[0537] S2501, the large screen's Bluetooth module can establish Bluetooth connections with the Bluetooth module of speaker 1 and the Bluetooth module of speaker 2 respectively.

[0538] S2502, the Bluetooth module of the large screen sends a Bluetooth notification to the Bluetooth module of the speaker 1, and the Bluetooth notification includes token 1.

[0539] S2503, the large screen's audio module sends an ultrasonic signal through its left speaker at time t1, and the speaker 1's audio module receives the ultrasonic signal at time t3. The ultrasonic signal includes token 1. Simultaneously, the large screen's audio module receives the ultrasonic signal sent by its own left speaker at time t2.

[0540] S2504, the large screen's audio module sends an ultrasonic signal through the right speaker, and the speaker 1's audio module receives the ultrasonic signal, which includes token 1.

[0541] S2505, the audio module of speaker 1 sends an ultrasonic signal at time t4, and the audio module of the large screen receives the ultrasonic signal at time t6. The ultrasonic signal includes token 1. At the same time, the audio module of speaker 1 receives the ultrasonic signal sent by the audio module of audio 1 at time t5.

[0542] In S2506, speaker 1 calculates t5-t3, and calculates the angle θ1 of the large screen relative to the speaker based on the two ultrasonic signals in S2503 and S2504.

[0543] S2507, Speaker 1 sends the calculated t5-t3, θ1 and token 1 to the Bluetooth module of the large screen via the Bluetooth module.

[0544] Alternatively, in S2508, the speaker may not send token 1, but only t5-t3 and θ1.

[0545] Optionally, the large screen can calculate t6-t2, and calculate the distance from the large screen to the speaker 1 based on t5-t3 and t6-t2.

[0546] S2508, the large screen's Bluetooth module sends a Bluetooth notification to the speaker 2's Bluetooth module, and the Bluetooth notification includes token 2.

[0547] In S2509, the large screen's audio module sends an ultrasonic signal through its left speaker at time t7, and the speaker 2's audio module receives the ultrasonic signal at time t9. The ultrasonic signal includes token 2. Simultaneously, the large screen's audio module receives the ultrasonic signal emitted by its own left speaker at time t8.

[0548] In S2510, the audio module of the large screen sends an ultrasonic signal through the right speaker, and the audio module of speaker 2 receives the ultrasonic signal, which includes token 2.

[0549] S2511, the audio module of speaker 2 sends an ultrasonic signal at time t10, and the audio module of the large screen receives the ultrasonic signal at time t12. The ultrasonic signal includes token 2. At the same time, the audio module of speaker 2 receives the ultrasonic signal sent by the audio module of speaker 2 at time t11.

[0550] In S2512, speaker 2 calculates t11-t9, and calculates the angle θ2 of the large screen relative to the speaker based on the two ultrasonic signals in S2509 and S2510.

[0551] S2513, the speaker 2 sends the calculated t11-t9, θ2 and token 2 to the Bluetooth module of the large screen via the Bluetooth module.

[0552] Alternatively, in S2513, the speaker may not send token 2, but only t11-t9 and θ2.

[0553] Optionally, the large screen can calculate t12-t8, and calculate the distance from the large screen to the speaker 2 based on t11-t9 and t12-t8.

[0554] Furthermore, the large screen can determine the channels of speaker 1 and speaker 2 based on the distance from the large screen to speaker 1, the distance from the large screen to speaker 2, and θ1 and θ2.

[0555] It should also be noted that in the embodiments of this application, the angle of the first electronic device relative to the second electronic device or the angle of the second electronic device relative to the first electronic device is a relative concept. If the angle of the first electronic device relative to the second electronic device is θ, then the angle of the second electronic device relative to the first electronic device is 180-θ; if the angle of the second electronic device relative to the first electronic device is θ, then the angle of the first electronic device relative to the second electronic device is 180-θ.

[0556] Where there is no conflict, the solutions of the above embodiments can be used in combination.

[0557] It is understood that each electronic device includes hardware and / or software modules that perform the aforementioned functions in order to achieve them. Based on the algorithmic steps of the examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by 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 conjunction with the embodiments, but such implementations should not be considered beyond the scope of this application.

[0558] This embodiment can divide the electronic device into functional modules according to the above method example. For example, each function can be divided into a separate functional module, such as a determination unit, a transmission unit, etc., or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0559] It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.

[0560] The electronic device provided in this embodiment is used to execute the above-described method for determining location, and thus can achieve the same effect as the above-described implementation method.

[0561] In the case of integrated units, each electronic device may further include a processing module, a storage module, and a communication module. The processing module is used to control and manage the operation of the electronic device. The storage module supports the execution of stored program code and data by the electronic device. The communication module supports communication between the electronic device and other devices.

[0562] The processing module can be a processor or a controller. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination of functions that implement computing capabilities, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module can be a memory. The communication module can specifically be a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, or other devices that interact with other electronic devices.

[0563] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment can be a device having... Figure 1 The device with the structure shown.

[0564] This embodiment also provides a computer storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the aforementioned method steps to implement the method for determining the location of the user as described in the above embodiment.

[0565] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the method for determining location described in the above embodiment.

[0566] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component, or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute the method for determining the location of the user in the above method embodiments.

[0567] In this embodiment, the electronic device, computer storage medium, computer program product or chip are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding method provided above, and will not be repeated here.

[0568] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above 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.

[0569] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0570] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0571] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0572] If the integrated unit is implemented as 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 solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0573] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for determining directional information, characterized in that, The method is applicable to a first electronic device, including: Receive the first sequence; Receive a second sequence, which is associated with the first sequence; Determine whether the device that sent the first sequence is a second electronic device based on the second sequence; If the device that sent the first sequence is determined to be the second electronic device based on the second sequence, then the location information of the second electronic device is determined based on the first sequence. Specifically, the association between the first sequence and the second sequence is as follows: the interval between receiving the time domain resources of the first sequence and receiving the time domain resources of the second sequence is a preset time domain interval, and / or the interval between receiving the frequency domain resources of the first sequence and receiving the frequency domain resources of the second sequence is a preset frequency domain interval.

2. The method according to claim 1, characterized in that, The method further includes: Send a third sequence to the second electronic device; Wherein, determining whether the device that sent the first sequence is a second electronic device based on the second sequence includes: If the second sequence is the same as the third sequence, then the device that sent the first sequence is determined to be the second electronic device; If the second sequence is different from the third sequence, then it is determined that the device that sent the first sequence is not the second electronic device.

3. The method according to claim 2, characterized in that, Sending the third sequence to the second electronic device includes: Receive the first operation command; In response to the first operation command, the third sequence is sent to the second electronic device.

4. The method according to claim 1, characterized in that, The method further includes: Obtain the identifier of the second electronic device; Wherein, determining whether the device that sent the first sequence is a second electronic device based on the second sequence includes: If the second sequence is the identifier of the second electronic device, then the device that sent the first sequence is determined to be the second electronic device; If the second sequence is not an identifier of the second electronic device, then it is determined that the device that sent the first sequence is not the second electronic device.

5. The method according to claim 1, characterized in that, Prior to receiving the first sequence, the method further includes: Receive a third sequence from the second electronic device; Wherein, determining whether the device that sent the first sequence is a second electronic device based on the second sequence includes: If the second sequence is the same as the third sequence, then the device that sent the first sequence is determined to be the second electronic device; If the second sequence is different from the third sequence, then it is determined that the device that sent the first sequence is not the second electronic device.

6. The method according to claim 5, characterized in that, The method further includes: The fourth sequence is transmitted through the first speaker; The fourth sequence is received at the first moment via the first microphone; The step of determining the location information of the second electronic device based on the first sequence includes: The angle of the second electronic device relative to the first electronic device is determined based on the first sequence; First time information is determined based on the second time of receiving the first sequence and the first time, wherein the orientation information includes the angle of the second electronic device relative to the first electronic device and the first time information; The location information is sent to the second electronic device.

7. The method according to claim 6, characterized in that, The method further includes: The third sequence is transmitted through the first speaker, and the fourth sequence is associated with the third sequence.

8. The method according to claim 7, characterized in that, The association between the third sequence and the fourth sequence is specifically as follows: the interval between the time domain resources for transmitting the third sequence and the time domain resources for transmitting the fourth sequence is a preset time domain interval, and / or, the interval between the frequency domain resources for transmitting the third sequence and the frequency domain resources for transmitting the fourth sequence is a preset frequency domain interval.

9. The method according to any one of claims 5 to 8, characterized in that, The method further includes: Receive the fifth sequence; Receive the second sequence, wherein the fifth sequence is associated with the second sequence; Wherein, determining the angle of the second electronic device relative to the first electronic device based on the first sequence includes: If the third sequence is the same as the second sequence, the device that sent the fifth sequence is determined to be the second electronic device. The angle of the second electronic device relative to the first electronic device is determined based on the first sequence and the fifth sequence.

10. The method according to claim 9, characterized in that, The association between the fifth sequence and the second sequence is specifically defined as follows: the interval between the time domain resources of receiving the fifth sequence and the time domain resources of receiving the second sequence is a preset time domain interval, and / or the interval between the frequency domain resources of receiving the fifth sequence and the frequency domain resources of receiving the second sequence is a preset frequency domain interval.

11. The method according to any one of claims 1 to 4, characterized in that, The method further includes: The sound channel of the second electronic device is determined based on the orientation information of the second electronic device, where the second electronic device is a speaker; Audio signals are sent to the second electronic device according to the audio channel of the second electronic device.

12. The method according to claim 11, characterized in that, The method further includes: Receives the first Bluetooth signal broadcast by the second electronic device; The first Bluetooth signal and the first ultrasonic signal are used to determine whether the second electronic device and the first electronic device are in the same space. The first ultrasonic signal is the ultrasonic signal that sends the first sequence. Wherein, determining the audio channel of the second electronic device based on the orientation information of the second electronic device includes: If the second electronic device and the first electronic device are in the same space, the audio channel of the second electronic device is determined based on the orientation information of the second electronic device.

13. The method according to any one of claims 1 to 8, characterized in that, The receiving of the first sequence includes: Receive N sequences, wherein the received N sequences include the first sequence, and N is a positive integer greater than 1; The method further includes: The sequence corresponding to the reception with the best signal quality among the N receptions is determined as the first sequence.

14. A method for determining directional information, characterized in that, The method is applicable to a second electronic device, including: Send the first sequence to the first electronic device; Send a second sequence to the first electronic device, the first sequence being associated with the second sequence, the second sequence being used by the first electronic device to determine the electronic device that sent the first sequence, and the first sequence being used by the first electronic device to determine the location information of the second electronic device; Specifically, the association between the first sequence and the second sequence is as follows: the interval between the time domain resources for sending the first sequence and the time domain resources for sending the second sequence is a preset time domain interval, and / or the interval between the frequency domain resources for sending the first sequence and the frequency domain resources for sending the second sequence is a preset frequency domain interval.

15. The method according to claim 14, characterized in that, Before sending the second sequence to the first electronic device, the method further includes: Receive the second sequence from the first electronic device; or, The second sequence is sent to the first electronic device.

16. The method according to claim 14, characterized in that, Sending the first sequence to the first electronic device includes: The first sequence is transmitted through the second speaker; The method further includes: The first sequence is received via a second microphone at the third moment; Receive the fourth sequence at the fourth time point; The second time information is determined based on the third time and the fourth time. The orientation information is received from the first electronic device, and the orientation information includes the angle of the second electronic device relative to the first electronic device and first time information; The distance between the second electronic device and the first electronic device is determined based on the first time information and the second time information.

17. The method according to claim 16, characterized in that, The method further includes: The sound channel of the first electronic device is determined based on the distance between the second electronic device and the first electronic device and the angle of the second electronic device relative to the first electronic device, wherein the first electronic device is a speaker; Audio signals are sent to the first electronic device according to the audio channel of the first electronic device.

18. The method according to claim 16, characterized in that, The method further includes: Receive a third sequence from the first electronic device, the third sequence being associated with the fourth sequence; If the third sequence is the same as the second sequence, the device that sent the fourth sequence is determined to be the first electronic device.

19. The method according to claim 18, characterized in that, The association between the third sequence and the fourth sequence is specifically as follows: the interval between receiving the time-domain resources of the third sequence and receiving the time-domain resources of the fourth sequence is a preset time-domain interval, and / or, the interval between receiving the frequency-domain resources of the third sequence and receiving the frequency-domain resources of the fourth sequence is a preset frequency-domain interval.

20. The method according to claim 16 or 18, characterized in that, Sending the second sequence to the first electronic device includes: The second sequence is transmitted to the first electronic device via the second speaker; The method further includes: The second sequence is transmitted to the first electronic device via a third speaker; A fifth sequence, associated with the second sequence, is transmitted to the first electronic device via the third speaker.

21. The method according to claim 20, characterized in that, The distance between the second speaker and the third speaker is greater than a preset distance.

22. The method according to claim 20 or 21, characterized in that, The association between the fifth sequence and the second sequence is specifically as follows: the interval between the time domain resources for transmitting the fifth sequence and the time domain resources for transmitting the second sequence is a preset time domain interval, and / or the interval between the frequency domain resources for transmitting the fifth sequence and the frequency domain resources for transmitting the second sequence is a preset frequency domain interval.

23. The method according to claim 14 or 15, characterized in that, Sending the first sequence to the first electronic device includes: Multiple first sequences are sent to the first electronic device through multiple speakers, and each of the multiple speakers corresponds to one of the multiple first sequences. The step of sending the second sequence to the first electronic device includes: Multiple second sequences are sent to the first electronic device through the plurality of speakers, and the plurality of speakers correspond one-to-one with the multiple second sequences. In this context, a first sequence transmitted through the same speaker is associated with a second sequence.

24. An electronic device, characterized in that, The device includes a processor coupled to a memory, the processor being configured to execute a computer program or instructions stored in the memory to cause the electronic device to perform the method as described in any one of claims 1 to 23.

25. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 23.

Citation Information

Patent Citations

  • Method for cooperation of intelligent sound box and electronic device and electronic device

    CN111628916A

  • Positioning method and device, electronic equipment and computer readable storage medium

    CN113543310A