Antenna Switching Method, Apparatus, Electronic Device, and Readable Storage Medium

The relative orientation of the second device is obtained by the first device and the antenna mode is determined based on the information, which solves the problem of low antenna switching efficiency in the prior art, and realizes efficient antenna switching and communication quality improvement.

CN115225110BActive Publication Date: 2025-05-27HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110426777.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-20
Publication Date
2025-05-27
Estimated Expiration
2041-04-20

AI Technical Summary

Technical Problem

In the prior art, APs need to traverse all antenna patterns to determine the mode with the best communication quality, resulting in low antenna switching efficiency.

Method used

The relative orientation of the second device is obtained through the first device, and based on the relative orientation, the attitude of the device and the mapping relationship, the antenna mode with the best communication quality is directly determined and used for communication.

Benefits of technology

The efficiency of antenna switching is improved so that the antenna beams of the two devices can be aligned with each other, thereby improving communication quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115225110B_ABST
    Figure CN115225110B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides an antenna switching method, device, electronic device, and readable storage medium. The method includes: a first device communicates with a second device using a second target antenna mode based on a first relative orientation, the attitude of the first device, and a second mapping relationship. In the second target antenna mode, the antenna beam of the first device is aligned with the second device. The second device communicates with the first device using a first target antenna mode based on a second relative orientation, the attitude of the second device, and a first mapping relationship. In the first target antenna mode, the antenna beam of the second device is aligned with the first device. In the embodiment provided by the present application, there is no need to adopt a traversal method. Instead, based on the relative orientation of the two devices and the attitude of the devices, the antenna mode with the best communication quality is used for communication. The antenna switching efficiency is high, and the embodiment of the present application can achieve the mutual alignment of the antenna beams of the two devices, which can improve the communication quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to antenna technologies, and in particular, to an antenna switching method, apparatus, electronic device, and readable storage medium. Background Art

[0002] With the development of wireless communication technologies, users' demands for high-speed and highly reliable communication scenarios are increasing day by day. A station (STA) device can access the Internet through an access point (AP). The communication quality between the STA device and the AP determines the communication rate and reliability between the STA device and the AP.

[0003] To improve the communication quality between the STA device and the AP, current APs are equipped with smart antennas. The smart antennas include multiple antenna modes, and the pointing directions of the antenna beams are different under different antenna modes. The AP can traverse each antenna mode and select the antenna mode with the best communication quality for the communication between the AP and the STA device based on the communication quality between the AP and the STA device under each antenna mode. Among them, in the antenna mode with the best communication quality, the pointing direction of the antenna beam of the AP is aligned with the STA device.

[0004] In the current technical solution, the AP needs to traverse all antenna modes to determine the antenna mode with the best communication quality, and the switching efficiency of the antenna is low. Summary of the Invention

[0005] Embodiments of the present application provide an antenna switching method, apparatus, electronic device, and readable storage medium, which can improve the switching efficiency of the antenna and enable the antenna beams of two devices to be aligned with each other.

[0006] In a first aspect, an antenna switching method provided by an embodiment of the present application is applied to a first device. The method may include: The first device obtains a first relative orientation, where the first relative orientation includes: the orientation of a second device relative to the first device. In one embodiment, if the first device has an active positioning function, the first device can position the second device to obtain the first relative orientation. In one embodiment, if the first device does not have an active positioning function, the first device can rely on a third device with an active positioning function to position the second device. Among them, the third device can obtain the orientation of the second device relative to the first device, that is, the first relative orientation, based on the relative orientation of the first device relative to the third device and the relative orientation of the second device relative to the third device.

[0007] The first device may determine a second target antenna pattern based on the first relative orientation, the attitude of the first device, and a second mapping relationship, and then communicate with the second device using the second target antenna pattern. Among them, in the second target antenna pattern, the antenna beam of the first device is aligned with the second device. It should be understood that the second mapping relationship includes: the antenna patterns corresponding to each relative orientation in at least one attitude of the first device. In other words, the second mapping relationship includes: the antenna patterns with the best communication quality for each relative orientation in at least one attitude of the first device. In the embodiments of the present application, the first device may use the antenna pattern corresponding to the first relative orientation and the attitude of the first device in the first mapping relationship as the second target antenna pattern.

[0008] In the embodiments of the present application, the first device may not determine the second target antenna pattern for communicating with the second device by traversing the antenna patterns, but determine the second target antenna pattern based on the relative orientation between the first device and the second device and the attitude of the second device, with high antenna switching efficiency.

[0009] It should be noted that in the embodiments of the present application, the second device may determine the first target antenna pattern for communicating with the first device in the same manner as the first device. In the first target antenna pattern, the antenna beam of the second device is aligned with the first device, and thus the antenna beams of the first device and the second device can be aligned with each other, improving the communication quality between the first device and the second device.

[0010] Among them, the second device may obtain a second relative orientation, where the second relative orientation is the orientation of the first device relative to the second device. The second device communicates with the first device using the first target antenna pattern based on the second relative orientation, the attitude of the second device, and the first mapping relationship. Among them, the first mapping relationship includes: the antenna patterns corresponding to each relative orientation in at least one attitude of the second device.

[0011] In one embodiment, the second device may be a device that does not have an active positioning function but has a passive positioning function. After the first device obtains the first relative orientation, it may obtain the second relative orientation based on the first relative orientation and then send the second relative orientation to the second device. In one embodiment, if the first device does not have an active positioning function, the second device may obtain the second relative orientation with the help of a third device that has an active positioning function, and reference may be made to the relevant description of how the third device obtains the first relative orientation.

[0012] It should be understood that the manner in which the second device determines and adopts the first target antenna pattern based on the second relative orientation, the attitude of the second device, and the first mapping relationship may be the same as the manner in which the first device determines and adopts the second target antenna pattern. The following takes the manner in which the first device determines and adopts the second target antenna pattern as an example for illustration:

[0013] Among them, the first device may use the antenna pattern corresponding to the first relative orientation and the attitude of the first device in the first mapping relationship as the second target antenna pattern.

[0014] In a possible implementation manner, if the second mapping relationship does not include the first relative orientation, the first device obtains the first target relative orientation closest to the first relative orientation in the second mapping relationship, and in the second mapping relationship, uses the antenna pattern corresponding to the first target relative orientation and the attitude of the first device as the second target antenna pattern.

[0015] Among them, the first relative orientation includes: the theta angle in the elevation plane and the phi angle in the azimuth plane; obtaining the first target relative orientation closest to the first relative orientation in the second mapping relationship includes: if the second mapping relationship includes the theta angle and does not include the phi angle, then using the phi angle with the smallest difference from the phi angle in the second mapping relationship and the theta angle as the first target relative orientation.

[0016] If the second mapping relationship includes the phi angle and does not include the theta angle, then using the theta angle with the smallest difference from the theta angle in the second mapping relationship and the phi angle as the first target relative orientation.

[0017] If the second mapping relationship does not include the theta angle and the phi angle, then using the theta angle with the smallest difference from the theta angle and the phi angle with the smallest difference from the phi angle in the second mapping relationship as the first target relative orientation.

[0018] In a possible implementation manner, if the second mapping relationship does not include the attitude of the first device, the first device may obtain the antenna patterns corresponding to each relative orientation in the attitude of the first device based on the existing attitudes in the second mapping relationship; use the antenna pattern corresponding to the first relative orientation in the attitude of the first device as the second target antenna pattern.

[0019] Among them, the first device can obtain the rotation information of the attitude of the first device relative to the existing attitude; based on the antenna patterns corresponding to each relative orientation in the existing attitude and the rotation information, obtain the antenna patterns corresponding to each relative orientation in the attitude of the first device.

[0020] In a possible scenario, the first device can locate the second device. Among them, when the first device locates the second device, it can detect whether the second device has a positioning function. Among them, the first device can send a positioning request to the second device. If the second device has a positioning function, the second device can send a positioning response to the first device based on the positioning request. If the second device does not have a positioning function, the second device does not send a positioning response to the first device. That is to say, if the first device can receive a positioning response from the second device based on the positioning request, it is determined that the second device has a positioning function. That the second device has a positioning function means that the second device has an active positioning function and / or a passive positioning function. When the first device determines that the second device has a positioning function, it can locate the second device to obtain the first relative orientation.

[0021] In a possible implementation manner, if the second device has an active positioning function, the second device can locate the first device to actively obtain the second relative orientation.

[0022] Among them, after the first device obtains the first relative orientation, it can obtain the second relative orientation based on the first relative orientation, and then send the second relative orientation to the second device. After receiving the second relative orientation, the second device can detect whether the second device has an attitude detection function. Specifically, the second device can perform attitude detection to obtain the attitude of the second device. Among them, if the second device can obtain the attitude of the second device, the second device can send a message indicating successful attitude detection to the first device, and then the first device can determine that the first device has an attitude detection function based on this message indicating successful attitude detection.

[0023] Accordingly, when both the first device and the second device have a positioning function and an attitude detection function, the first device can communicate with the second device based on the above method for determining the second target antenna pattern, and the second device can communicate with the first device based on the above method for determining the first target antenna pattern to achieve antenna beam alignment between the first device and the second device and improve communication quality.

[0024] In a possible scenario, neither the first device nor the second device has an active positioning function. Then, the third device can actively locate the first device and the second device to obtain a first relative orientation and a second relative orientation, and then send the first relative orientation to the first device and the second relative orientation to the second device. In this way, the first device and the second device can achieve antenna beam alignment between the first device and the second device based on the method described above.

[0025] In a possible implementation manner, the triggering condition for the first device to actively locate the second device can be any one of the following:

[0026] The first device periodically obtains the first relative orientation; or,

[0027] In response to detecting that the communication quality between the first device and the second device is lower than a preset communication quality, the first device obtains the first relative orientation; or,

[0028] In response to the first device being in a preset scenario, the first device obtains the first relative orientation.

[0029] In a possible implementation manner, the third device can periodically locate the first device and the second device.

[0030] In an embodiment, the first mapping relationship may include: the antenna polarization modes corresponding to the respective antenna modes of the second device, and the antenna polarization mode of the second device in the first target antenna mode is the first antenna polarization mode. In this embodiment, after the second device communicates with the first device using the first target antenna mode based on the second relative orientation, the attitude of the second device, and the first mapping relationship, the second device can also send antenna polarization information of the second device to the first device, and the antenna polarization information is used to indicate the first antenna polarization mode of the second device in the first target antenna mode.

[0031] In a possible implementation manner, the first device can independently adjust the antenna beam and the antenna polarization mode. After the first device receives the antenna polarization information of the second device, the first device can communicate with the second device using the second target antenna mode based on the first relative orientation, the attitude of the first device, and the second mapping relationship. Moreover, the first device can also adjust the antenna polarization mode of the first device to be the same as the first antenna polarization mode, thereby achieving antenna polarization matching between the first device and the second device and further improving the communication quality.

[0032] In a possible implementation, the first device cannot independently adjust the antenna beam and the antenna polarization mode. That is to say, the antenna beam and the antenna polarization mode are adjusted simultaneously. In this implementation, the second mapping relationship further includes: the antenna polarization mode corresponding to each antenna mode of the first device. The first device can communicate with the second device using the second target antenna mode based on the first relative azimuth, the attitude of the first device, the first antenna polarization mode, and the second mapping relationship. It should be understood that when the first device is in the second target antenna mode, the antenna beam of the first device is aligned with the second device, and the antenna polarization mode of the first device is the same as the first antenna polarization mode, which can also achieve the alignment of the antenna beams of the first device and the second device and the matching of the antenna polarizations.

[0033] In a possible scenario, if the first device does not have a positioning function and / or an attitude detection function, and / or, the first device detects that the second device does not have a positioning function and / or an attitude detection function, then the first device and the second device can adopt the method of traversing antenna modes to achieve the alignment of the antenna beams of the first device and the second device and the matching of the antenna polarizations.

[0034] In this scenario, the first device can send a first message to the second device, and the first message is used to instruct the second device to switch to the first antenna mode. When the second device receives the first message, the second device can switch to the first antenna mode. When the second device is in the first antenna mode, traverse each antenna mode of the first device, and obtain the first communication quality between the first device and the second device in each antenna mode of the first device.

[0035] The first device can send a second message to the second device, and the second message is used to instruct the second device to switch to the second antenna mode. When the second device receives the second message, the second device can switch to the second antenna mode, and the second antenna mode is different from the first antenna mode. When the second device is in the second antenna mode, traverse each antenna mode of the first device, and obtain the second communication quality between the first device and the second device in each antenna mode of the first device.

[0036] That is to say, when the antenna mode of the second device remains unchanged, the first device can traverse its own antenna modes to achieve traversal of all antenna modes of the first device and the second device. The first device can select the best target communication quality from the first communication quality and the second communication quality, and then communicate with the second device using the second target antenna mode. The antenna mode of the first device is the first target antenna mode, the first target antenna mode is the antenna mode of the second device corresponding to the target communication quality, and the second target antenna mode is the antenna mode of the first device corresponding to the target communication quality.

[0037] In this way, the first device and the second device can use the method of traversing antenna modes to achieve alignment of antenna beams and antenna polarization matching between the first device and the second device, and the communication quality between the first device and the second device is high.

[0038] In a second aspect, an embodiment of the present application provides an antenna switching method applied to a second device. The method may include: obtaining a second relative azimuth, where the second relative azimuth is: the azimuth of the first device relative to the second device; based on the second relative azimuth, the attitude of the second device, and a first mapping relationship, communicating with the first device using a first target antenna mode, where the antenna beam of the second device in the first target antenna mode is aligned with the first device, the antenna mode of the second device is a second target antenna mode, the antenna beam of the first device in the second target antenna mode is aligned with the second device, and the first mapping relationship includes: antenna modes corresponding to each relative azimuth in at least one attitude of the second device.

[0039] In a possible implementation manner, the first mapping relationship further includes: the antenna polarization method corresponding to each antenna mode of the second device, the antenna polarization method of the first target antenna mode is the first antenna polarization method, and after communicating with the first device using the first target antenna mode, the method further includes: sending antenna polarization information of the second device to the first device, where the antenna polarization information is used to indicate the first antenna polarization method, and the antenna polarization information is used to instruct the first device to adjust the antenna polarization method of the first device, so that the antenna polarizations of the first device and the second device after adjusting the antenna polarization method are matched.

[0040] In a possible implementation manner, the method further includes: in the first mapping relationship, using the antenna mode corresponding to the second relative azimuth and the attitude of the second device as the first target antenna mode.

[0041] In a possible implementation, the method further includes: if the first mapping relationship does not include the second relative orientation, obtaining a second target relative orientation that is closest to the second relative orientation in the first mapping relationship; in the first mapping relationship, using the antenna pattern corresponding to the second target relative orientation and the attitude of the second device as the first target antenna pattern.

[0042] In a possible implementation, the second relative orientation includes: an angle theta in the elevation plane and an angle phi in the azimuth plane; the obtaining of the second target relative orientation that is closest to the second relative orientation in the first mapping relationship includes: if the first mapping relationship includes the angle theta but does not include the angle phi, using the phi angle with the smallest difference from the phi angle in the first mapping relationship and the theta angle as the second target relative orientation; if the first mapping relationship includes the angle phi but does not include the angle theta, using the theta angle with the smallest difference from the theta angle in the first mapping relationship and the phi angle as the second target relative orientation; if the first mapping relationship does not include the angle theta and the angle phi, using the theta angle with the smallest difference from the theta angle and the phi angle with the smallest difference from the phi angle in the first mapping relationship as the second target relative orientation.

[0043] In a possible implementation, the method further includes: if the first mapping relationship does not include the attitude of the second device, obtaining the antenna patterns corresponding to each relative orientation in the attitude of the second device based on the existing attitudes in the first mapping relationship; using the antenna pattern corresponding to the second relative orientation in the attitude of the second device as the first target antenna pattern.

[0044] In a possible implementation, the obtaining of the antenna patterns corresponding to each relative orientation in the attitude of the second device based on the existing attitudes in the first mapping relationship includes: obtaining the rotation information of the attitude of the second device relative to the existing attitude; based on the antenna patterns corresponding to each relative orientation in the existing attitude and the rotation information, obtaining the antenna patterns corresponding to each relative orientation in the attitude of the second device.

[0045] In a possible implementation, the obtaining of the second relative orientation includes: receiving the second relative orientation from the first device.

[0046] In a possible implementation, before receiving the second relative orientation from the first device, it further includes: receiving a positioning request from the first device; based on the positioning request, sending a positioning response to the first device, where the positioning response indicates that the second device has a positioning function.

[0047] In a possible implementation, after receiving the second relative orientation from the first device, it further includes: sending a message indicating successful attitude detection to the first device, where the message indicating successful attitude detection indicates that the second device has an attitude detection function.

[0048] In a possible implementation, obtaining the second relative orientation includes: receiving the second relative orientation from a third device.

[0049] In a possible implementation, the method further includes: receiving a first message from the first device; switching to a first antenna mode; receiving a second message from the first device; switching to a second antenna mode, where the second antenna mode is different from the first antenna mode.

[0050] In a third aspect, an embodiment of the present application provides an antenna switching device, which may be the first device in the first aspect above or a chip in the first device. The antenna switching device includes:

[0051] A positioning module, configured to obtain a first relative orientation, where the first relative orientation includes: the orientation of the second device relative to the first device.

[0052] An antenna module, configured to communicate with the second device in a second target antenna mode based on the first relative orientation, the attitude of the first device, and a second mapping relationship, where in the second target antenna mode, the antenna beam of the first device is aligned with the second device, the antenna mode of the first device is a first target antenna mode, in the first target antenna mode, the antenna beam of the second device is aligned with the first device, and the second mapping relationship includes: antenna modes corresponding to respective relative orientations in at least one attitude of the first device.

[0053] In a possible implementation, the antenna module is further configured to receive antenna polarization information from the second device, where the antenna polarization information is used to indicate the first antenna polarization mode of the second device in the first target antenna mode.

[0054] The antenna module is further configured to adjust the antenna polarization mode of the first device based on the first antenna polarization mode, so that the antenna polarizations of the first device and the second device are matched after the adjustment of the antenna polarization mode.

[0055] In a possible implementation, the antenna module is specifically configured to adjust the antenna polarization mode of the first device to be the same as the first antenna polarization mode.

[0056] In a possible implementation, the second mapping relationship further includes: the antenna polarization mode corresponding to each antenna mode of the first device. The antenna module is specifically configured to communicate with the second device using the second target antenna mode based on the first relative azimuth, the attitude of the first device, the first antenna polarization mode, and the second mapping relationship, where the antenna beam of the first device in the second target antenna mode is aligned with the second device, and the antenna polarization mode of the first device is the same as the first antenna polarization mode.

[0057] In a possible implementation, the antenna module is further configured to use, in the second mapping relationship, the antenna mode corresponding to the first relative azimuth and the attitude of the first device as the second target antenna mode.

[0058] In a possible implementation, the antenna module is specifically configured to, if the first relative azimuth is not included in the second mapping relationship, obtain the first target relative azimuth that is closest to the first relative azimuth in the second mapping relationship; and use, in the second mapping relationship, the antenna mode corresponding to the first target relative azimuth and the attitude of the first device as the second target antenna mode.

[0059] In a possible implementation, the first relative azimuth includes the angle theta in the elevation plane and the angle phi in the azimuth plane. The antenna module is specifically configured to, if the angle theta is included in the second mapping relationship but the angle phi is not, use the phi angle with the smallest difference from the phi angle in the second mapping relationship and the theta angle as the first target relative azimuth; if the angle phi is included in the second mapping relationship but the angle theta is not, use the theta angle with the smallest difference from the theta angle in the second mapping relationship and the phi angle as the first target relative azimuth; if neither the angle theta nor the angle phi is included in the second mapping relationship, use the theta angle with the smallest difference from the theta angle and the phi angle with the smallest difference from the phi angle in the second mapping relationship as the first target relative azimuth.

[0060] In a possible implementation, the antenna module is further configured to, if the attitude of the first device is not included in the second mapping relationship, obtain the antenna patterns corresponding to each relative azimuth in the attitude of the first device based on the existing attitudes in the second mapping relationship; and use the antenna pattern corresponding to the first relative azimuth in the attitude of the first device as the second target antenna pattern.

[0061] In a possible implementation, the antenna module is specifically configured to obtain the rotation information of the attitude of the first device relative to the existing attitude; and obtain the antenna patterns corresponding to each relative azimuth in the attitude of the first device based on the antenna patterns corresponding to each relative azimuth in the existing attitude and the rotation information.

[0062] In a possible implementation, the positioning module is further configured to detect whether the second device has a positioning function.

[0063] The antenna module is specifically configured to obtain a first relative azimuth if it is determined that the second device has a positioning function.

[0064] In a possible implementation, the positioning module is specifically configured to send a positioning request to the second device, and determine that the second device has a positioning function if a positioning response from the second device based on the positioning request is received.

[0065] In a possible implementation, the positioning module is specifically configured to locate the second device to obtain the first relative azimuth.

[0066] In a possible implementation, the antenna module is further configured to send a second relative azimuth to the second device based on the first relative azimuth, where the second relative azimuth is the azimuth of the first device relative to the second device.

[0067] In a possible implementation, the antenna module is further configured to determine that the second device has an attitude detection function.

[0068] In a possible implementation, the antenna module is further configured to receive a message indicating successful attitude detection from the second device, and determine that the second device has an attitude detection function.

[0069] In a possible implementation, the positioning module is specifically configured to receive the first relative azimuth from a third device.

[0070] In a possible implementation, the positioning module is specifically configured to periodically obtain the first relative orientation; or, in response to detecting that the communication quality between the first device and the second device is lower than a preset communication quality, obtain the first relative orientation; or, in response to the first device being in a preset scenario, obtain the first relative orientation.

[0071] In a possible implementation, the antenna module is further configured to, in response to the first device not having a positioning function and / or an attitude detection function, and / or the second device not having a positioning function and / or an attitude detection function, when the second device is in the first antenna mode, traverse each antenna mode of the first device, and obtain the first communication quality between the first device and the second device in each antenna mode of the first device; when the second device is in the second antenna mode, traverse each antenna mode of the first device, and obtain the second communication quality between the first device and the second device in each antenna mode of the first device, where the second antenna mode is different from the first antenna mode; select the target communication quality with the best quality from the first communication quality and the second communication quality; communicate with the second device using the second target antenna mode, where the antenna mode of the first device is the first target antenna mode, the first target antenna mode is the antenna mode of the second device corresponding to the target communication quality, and the second target antenna mode is the antenna mode of the first device corresponding to the target communication quality.

[0072] In a possible implementation, the antenna module is further configured to send a first message to the second device, where the first message is used to instruct the second device to switch to the first antenna mode; and send a second message to the second device, where the second message is used to instruct the second device to switch to the second antenna mode.

[0073] Fourthly, an embodiment of the present application provides an antenna switching method. The antenna switching device may be the second device or a chip in the second device in the second aspect above. The antenna switching device includes:

[0074] A positioning module, configured to obtain a second relative orientation, where the second relative orientation is: the orientation of the first device relative to the second device.

[0075] An antenna module is used to communicate with the first device in a first target antenna pattern based on the second relative orientation, the attitude of the second device, and a first mapping relationship. In the first target antenna pattern, the antenna beam of the second device is aligned with the first device. The antenna pattern of the second device is a second target antenna pattern. In the second target antenna pattern, the antenna beam of the first device is aligned with the second device. The first mapping relationship includes: antenna patterns corresponding to each relative orientation in at least one attitude of the second device.

[0076] In a possible implementation manner, the first mapping relationship further includes: the antenna polarization method corresponding to each antenna pattern of the second device, and the antenna polarization method of the first target antenna pattern is a first antenna polarization method. The antenna module is further configured to send the antenna polarization information of the second device to the first device. The antenna polarization information is used to indicate the first antenna polarization method, and is used to instruct the first device to adjust the antenna polarization method of the first device, so that the antenna polarizations of the first device and the second device after adjusting the antenna polarization method are matched.

[0077] In a possible implementation manner, the antenna module is specifically configured to use, in the first mapping relationship, the antenna pattern corresponding to the second relative orientation and the attitude of the second device as the first target antenna pattern.

[0078] In a possible implementation manner, the antenna module is specifically configured to, if the second relative orientation is not included in the first mapping relationship, obtain a second target relative orientation closest to the second relative orientation in the first mapping relationship; and use, in the first mapping relationship, the antenna pattern corresponding to the second target relative orientation and the attitude of the second device as the first target antenna pattern.

[0079] In a possible implementation manner, the second relative orientation includes: an angle theta in the elevation plane and an angle phi in the azimuth plane. The antenna module is specifically configured to, if the angle theta is included in the first mapping relationship and the angle phi is not included, use the phi angle with the smallest difference from the phi angle in the first mapping relationship and the theta angle as the second target relative orientation; if the angle phi is included in the first mapping relationship and the angle theta is not included, use the theta angle with the smallest difference from the theta angle in the first mapping relationship and the phi angle as the second target relative orientation; if neither the angle theta nor the angle phi is included in the first mapping relationship, use the theta angle with the smallest difference from the theta angle and the phi angle with the smallest difference from the phi angle in the first mapping relationship as the second target relative orientation.

[0080] In a possible implementation, the antenna module is specifically configured to, if the attitude of the second device is not included in the first mapping relationship, obtain the antenna patterns corresponding to the relative azimuths in the attitude of the second device based on the existing attitudes in the first mapping relationship; and use the antenna pattern corresponding to the second relative azimuth in the attitude of the second device as the first target antenna pattern.

[0081] In a possible implementation, the antenna module is specifically configured to obtain the rotation information of the attitude of the second device relative to the existing attitude; and obtain the antenna patterns corresponding to the relative azimuths in the attitude of the second device based on the antenna patterns corresponding to the relative azimuths in the existing attitude and the rotation information.

[0082] In a possible implementation, the positioning module is specifically configured to receive the second relative azimuth from the first device.

[0083] In a possible implementation, the positioning module is further configured to receive a positioning request from the first device; and send a positioning response to the first device based on the positioning request, where the positioning response indicates that the second device has a positioning function.

[0084] In a possible implementation, the antenna module is further configured to send a message indicating successful attitude detection to the first device, where the message indicating successful attitude detection indicates that the second device has an attitude detection function.

[0085] In a possible implementation, the positioning module is further configured to receive the second relative azimuth from a third device.

[0086] In a possible implementation, the antenna module is further configured to receive a first message from the first device and switch to a first antenna mode; and receive a second message from the first device and switch to a second antenna mode, where the second antenna mode is different from the first antenna mode.

[0087] In a fifth aspect, an embodiment of the present application provides an electronic device, which may be the above-mentioned first device or second device. In one embodiment, the first device may be an access network device, such as an AP, and the second device may be a terminal device. In one embodiment, the first device may be a terminal device, and the second device may also be a terminal device.

[0088] The electronic device includes: a processor and a memory; where the memory is used to store computer-executable program code, and the program code includes instructions; when the processor executes the instructions, the instructions cause the electronic device to execute the methods provided in the first aspect and the second aspect.

[0089] In a sixth aspect, an embodiment of the present application provides an electronic device, including units, modules or circuits for executing the methods provided in the above first and second aspects. The electronic device may be the second device or the second device, or may be a module applied to the second device or the second device. For example, it may be a chip applied to the second device or the second device.

[0090] In a seventh aspect, an embodiment of the present application provides an electronic device (such as a chip), on which a computer program is stored. When the computer program is executed by the electronic device, the methods provided in the first and second aspects are implemented.

[0091] In an eighth aspect, an embodiment of the present application provides a computer program product containing instructions. When it runs on a computer, the computer is caused to execute the methods in the above first and second aspects.

[0092] In a ninth aspect, an embodiment of the present application provides a computer-readable storage medium, in which instructions are stored. When it runs on a computer, the computer is caused to execute the methods in the above first and second aspects.

[0093] In a tenth aspect, an embodiment of the present application provides an antenna switching system, which includes the antenna switching device in the above third aspect and the antenna switching device in the fourth aspect. In one embodiment, the antenna switching system includes the antenna switching device in the above third aspect, the antenna switching device in the fourth aspect, and the third device described in the first aspect.

[0094] For the second to tenth aspects above, the beneficial effects can be referred to the beneficial effects brought by the first aspect above, and will not be elaborated here.

[0095] An embodiment of the present application provides an antenna switching method, apparatus, electronic device, and readable storage medium. The method includes: a first device obtaining a first relative orientation of a second device with respect to the first device; the first device communicating with the second device in a second target antenna mode based on the first relative orientation, the attitude of the first device, and a second mapping relationship, where the antenna beam of the first device in the second target antenna mode is aligned with the second device; the second device obtaining the orientation of the first device with respect to the second device, and communicating with the first device in a first target antenna mode based on the second relative orientation, the attitude of the second device, and a first mapping relationship, where the antenna beam of the second device in the first target antenna mode is aligned with the first device. The antenna switching method provided by the embodiment of the present application does not require the first device or the second device to traverse and obtain the antenna mode with the best communication quality, but communicates in the antenna mode with the best communication quality based on the relative orientation between the first device and the second device and the attitude of the device. The antenna switching efficiency is high, and in the embodiment of the present application, the antenna beams of the first device and the second device can be aligned with each other, which can improve the communication quality between the first device and the second device. Description of the Drawings

[0096] Figure 1 FIG. is a schematic diagram of a scenario applicable to an embodiment of the present application;

[0097] Figure 2 FIG. is a schematic diagram of an antenna beam;

[0098] Figure 3 FIG. is a schematic diagram of another antenna beam;

[0099] Figure 4A FIG. is a schematic structural diagram of an intelligent antenna provided by an embodiment of the present application;

[0100] Figure 4B FIG. is another schematic structural diagram of an intelligent antenna provided by an embodiment of the present application;

[0101] Figure 4C FIG. is another schematic structural diagram of an intelligent antenna provided by an embodiment of the present application;

[0102] Figure 5A FIG. is a schematic diagram of switching an antenna mode provided by an embodiment of the present application;

[0103] Figure 5B FIG. is another schematic diagram of switching an antenna mode provided by an embodiment of the present application;

[0104] Figure 6 FIG. is a schematic flowchart of an embodiment of the antenna switching method provided by an embodiment of the present application;

[0105] Figure 7 FIG. is a schematic diagram of beam alignment provided by an embodiment of the present application;

[0106] Figure 8 Another schematic diagram of beam alignment provided by the embodiment of the present application;

[0107] Figure 9A A flowchart of another embodiment of the method for antenna switching provided by the embodiment of the present application;

[0108] Figure 9B A flowchart of another embodiment of the method for antenna switching provided by the embodiment of the present application;

[0109] Figure 10A A schematic diagram of beam alignment and polarization matching provided by the embodiment of the present application;

[0110] Figure 10B A schematic diagram of beam alignment and polarization matching provided by the embodiment of the present application;

[0111] Figure 11 A flowchart of another embodiment of the method for antenna switching provided by the embodiment of the present application;

[0112] Figure 12 A flowchart of another embodiment of the method for antenna switching provided by the embodiment of the present application;

[0113] Figure 13 A flowchart of another embodiment of the method for antenna switching provided by the embodiment of the present application;

[0114] Figure 14A A flowchart of another embodiment of the method for antenna switching provided by the embodiment of the present application;

[0115] Figure 14B A flowchart of another embodiment of the method for antenna switching provided by the embodiment of the present application;

[0116] Figure 14C A flowchart of another embodiment of the method for antenna switching provided by the embodiment of the present application;

[0117] Figure 15 A flowchart for pre-obtaining the first mapping relationship;

[0118] Figure 16 A schematic diagram of the structure of an antenna switching device provided by the embodiment of the present application;

[0119] Figure 17 Another schematic diagram of the structure of an antenna switching device provided by the embodiment of the present application;

[0120] Figure 18 A schematic diagram of the structure of an electronic device provided by the embodiment of the present application. Detailed implementation manners

[0121] Figure 1 FIG. is a schematic diagram of a scenario applicable to an embodiment of the present application. As Figure 1 shown, this scenario may include an access point (AP) and a station (STA) device. Figure 1 Taking the AP as a router and the STA device as a mobile phone as an example for illustration, the STA device can be connected to the AP to access the Internet.

[0122] Term interpretation of the embodiment of the present application:

[0123] Antenna beam: It can be understood as the main lobe of the antenna pattern, representing the most concentrated part of the antenna's capabilities. Figure 1 In FIG., an ellipse is used to represent the antenna beams of the AP and the STA device, and the direction of the major axis of the ellipse is the pointing direction of the antenna beam.

[0124] Antenna polarization: It is a parameter describing the spatial orientation of the electromagnetic wave vector radiated by the antenna. Since there is a constant relationship between the electric field and the magnetic field, the spatial orientation of the electric field vector can be used as the polarization direction of the electromagnetic wave radiated by the antenna. Figure 1 In FIG., an arrow is used to represent the polarization direction in the linear polarization of the antenna, such as vertical polarization. In one embodiment, the antenna polarization may include linear polarization, elliptical polarization, and circular polarization. Among them, linear polarization may include, but is not limited to, horizontal polarization, vertical polarization, and angular polarization, and angular polarization such as 45° polarization, etc. Elliptical polarization may include, but is not limited to, left-handed elliptical polarization and right-handed elliptical polarization. Circular polarization may include, but is not limited to, left-handed circular polarization and right-handed circular polarization. In one embodiment, if the antenna polarization modes are the same, it can be represented that the antenna polarizations of the AP and the STA device are both left-handed elliptical polarization or right-handed elliptical polarization in elliptical polarization. In one embodiment, if the antenna polarization modes are the same, it can be represented that the antenna polarizations of the AP and the STA device are both left-handed circular polarization or right-handed circular polarization in circular polarization. It should be understood that in the following embodiments, the antenna polarization is taken as an example of linear polarization for illustration, and the antenna polarization modes in the following embodiments are the same, representing that the antenna polarizations of the AP and the STA device are both vertical polarization, or horizontal polarization, or angular polarization in linear polarization.

[0125] An antenna is provided in the AP, and an antenna is also provided in the STA device. Refer to Figure 1, when the antenna beam of the STA device is aligned with the antenna beam of the AP and the antenna polarization of the STA device matches the antenna polarization of the AP, the STA device and the AP can receive the electromagnetic radiation energy from each other to the maximum extent, and at this time, the communication quality between the STA device and the AP is the best. Good communication quality between the STA device and the AP can result in high antenna throughput, high communication rate, and high signal-to-noise ratio between the STA device and the AP. Among them, the alignment of the antenna beam of the STA device with the antenna beam of the AP can be understood as: the pointing direction of the antenna beam of the STA device is the same as the pointing direction of the antenna beam of the AP, referring to Figure 1 , the direction of the major axis of the ellipse of the STA device is the same as the direction of the major axis of the ellipse of the AP. The matching of the antenna polarization of the STA device with the antenna polarization of the AP can be understood as: the antenna polarization mode of the STA device is the same as the antenna polarization mode of the AP, referring to Figure 1 , the direction of the arrow in the ellipse of the STA device is the same as the direction of the arrow in the ellipse of the AP.

[0126] However, since the positions of the AP and the STA device are arbitrary and movable, there will be situations where the antenna beams are not aligned and the polarizations do not match between the AP and the STA device, which will lead to poor communication quality between the STA device and the AP. To improve the communication quality between the STA device and the AP, smart antennas can be set in the AP currently. The smart antenna can include multiple antenna modes, and the pointing directions of the antenna beams are different under different antenna modes. Figure 2 Schematic diagram of the smart antenna in the AP. Referring to Figure 2 , for example, in antenna mode 1, the pointing direction of the antenna beam is "south", and in antenna mode 2, the pointing direction of the antenna beam is "southeast". In order to improve the communication quality with the STA device, the AP can select the antenna mode with the best communication quality for the communication between the AP and the STA device by traversing each antenna mode. For example, the AP can switch to antenna mode 1 to obtain the communication quality between the AP and the STA device, and the AP can switch to antenna mode 2 to obtain the communication quality between the AP and the STA device. If the communication quality in antenna mode 1 is higher than that in antenna mode 2, the AP can select antenna mode 1 for the communication between the AP and the STA device, such as the AP can switch to antenna mode 1 to communicate with the STA device.

[0127] In this technical solution that traverses all antenna modes, the switching efficiency of the antenna is low, the energy consumption is high, and when there are other electronic devices operating on the same frequency near the AP, it will affect the communication quality between the AP and the STA device during detection, thereby affecting the accuracy of antenna switching. In addition, in this solution, the AP can switch the antenna mode of the AP to achieve the alignment of the antenna beam of the AP with the STA device, but the antenna beam of the STA device cannot be aligned with the AP, and the STA device and the AP cannot receive the electromagnetic radiation energy from each other to the maximum extent, resulting in poor communication quality between the AP and the STA device.

[0128] Currently, a technical solution for antenna switching is also provided. Referring to Figure 3 , the AP can obtain the orientation of the STA device relative to the AP through a combination of multiple sensors, and then switch the antenna mode to an antenna mode in which the "pointing direction of the antenna beam" is the same as the "orientation of the STA device relative to the AP", so that the antenna beam of the AP is aligned with the STA device. Exemplarily, if the STA device is located "north" of the AP, the AP can switch the antenna mode to an antenna mode in which the "pointing direction of the antenna beam is 'north'". It should be understood that the orientation of the STA device relative to the AP can be understood as: with the AP as the center of the sphere, the direction of any position (the position of the STA) on the sphere relative to the center of the sphere. In this technical solution, the problem of the AP switching the antenna mode in a traversing manner is avoided, the problems of low switching efficiency and high energy consumption of the antenna can be solved, and the accuracy of antenna switching can also be improved. However, in this technical solution, only the antenna beam of the AP is aligned with the STA device, but the antenna beam of the STA device cannot be aligned with the AP, and the communication quality between the AP and the STA device is still poor.

[0129] The embodiment of the present application provides a method for antenna switching. Smart antennas are set in both the AP and the STA device. The AP and the STA device can switch the antenna mode in themselves according to the relative orientation between the AP and the STA device, and can achieve the purpose of mutual alignment of the antenna beams of the AP and the STA device, improving the communication quality between the AP and the STA device. It should be understood that the antenna switching method in the embodiment of the present application can be applied not only between the AP and the STA device, but also is not limited to: between STA devices, between a base station and an STA device, and between a network device and an AP. It should be understood that the antenna switching method in the embodiment of the present application can be but is not limited to being applied to: wireless communication technologies such as Wi-Fi communication systems, long term evolution (LTE) communication systems, and 5th-generation new radio (5GNR) communication systems.

[0130] Among them, the AP can be, but is not limited to, a router or other electronic devices, such as customer premise equipment (CPE). Among them, any device accessing the AP can be called a STA device, and the STA device can be a mobile device or a fixed device. The STA device can be, but is not limited to: devices with antennas such as mobile phones, tablets, laptops, speakers, headphones, wearable devices, smart screens, smart household appliances, Internet of Things (IoT) devices, camera devices, etc. Optionally, the STA device can also be a personal digital assistant (PDA), a handheld device with wireless communication functions, a computing device, a virtual reality (VR) terminal device, a drone device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in a smart home, etc.

[0131] The network device can be a base transceiver station (BTS) in a GSM system or a CDMA system, or a base station (NodeB, NB) in a WCDMA system, or an evolved base station (evolutional Node B, eNB or eNodeB) in an LTE system, or a radio controller in a cloud radio access network (CRAN), or the network device can be a mobile switching center, a relay station, an access point, a vehicle-mounted device, a wearable device, a hub, a switch, a bridge, a router, a network-side device in a 5G network, or a network device in an evolved public land mobile network (PLMN), etc. The network device can also be a (radio) access network (RAN) device in an NR system. The RAN device in the NR system can be: an access network other than 3GPP, such as an access point (AP) of a WiFi network, a next-generation base station (collectively referred to as a new generation radio access network node (NG-RAN node), where the next-generation base station includes a new radio node B (NR nodeB, gNB), a new generation evolved base station (NG-eNB), a central unit (CU), and a gNB in a separated form of a distributed unit (DU), etc.), a new radio controller (NRcontroller), a radio remote head, a micro base station, a relay, a transmission receive point (TRP), a transmission point (TP), or other nodes. In the embodiments of the present application, the forms of the AP, the STA device, and the network device are not specifically limited.

[0132] In the following embodiments, the antenna switching method in the present application is described by taking a first device and a second device as examples. Exemplarily, for "AP and STA devices", the first device can be an AP, and the second device can be an STA device. Or, the first device can be an STA device, and the second device can be an AP. It should be understood that smart antennas are provided in both the first device and the second device. The smart antenna can include at least two antenna modes, and the pointing direction and / or the antenna polarization mode of the antenna beam are different in each antenna mode.

[0133] Before introducing the antenna switching method in the embodiments of the present application, the structure of the smart antenna in the first device and the second device and how to switch the antenna mode are described first:

[0134] Both the first device and the second device are provided with smart antennas. Hereinafter, the structure of the smart antenna and the way for the first device to switch the antenna mode will be described by taking the first device as an example. In the attached drawings, the first device is taken as a router for example. As Figure 4A shown, in one embodiment, the smart antenna in the first device can be one antenna, and this one antenna can correspond to at least two antenna modes. As Figure 4B shown, in one embodiment, the smart antenna in the first device can be multiple antennas, and each antenna corresponds to one antenna mode. As Figure 4C shown, in one embodiment, the smart antenna in the first device can be multiple antennas, and each antenna corresponds to at least two antenna modes. Different antenna modes refer to: different pointing directions of the antenna beam and / or different antenna polarization modes. Different antenna modes can be implemented by different circuit structures. The implementation solutions of smart antennas in the prior art can be referred to and will not be elaborated here. The embodiment of the present application does not limit the structure of the smart antenna in the first device.

[0135] Each antenna mode corresponds to a radio frequency switch. The first device can switch the antenna mode by controlling the opening and closing of the radio frequency switch. Referring to Figure 4A , when the first device disconnects the radio frequency switch corresponding to antenna mode 1 and closes the radio frequency switch corresponding to antenna mode 2, the first device switches from antenna mode 1 to antenna mode 2. Referring to Figure 4B , when the first device disconnects the radio frequency switch corresponding to antenna 1 and closes the radio frequency switch corresponding to antenna 2, the first device switches from antenna 1 to antenna 2, that is, from antenna mode 1 to antenna mode 2. Referring to Figure 4C , when the first device disconnects the radio frequency switch corresponding to antenna mode 1 in antenna 1 and closes the radio frequency switch corresponding to antenna mode 2 in antenna 2, the first device switches from antenna mode 1 to antenna mode 2. The embodiment of the present application does not limit the way for the first device to switch the antenna mode. It should be understood that Figures 4A - 4C the radio frequency switch is not drawn in , and the radio frequency switch can also be any other switch tube that can be turned on or off based on control. For example, an insulated gate bipolar transistor (IGBT), or a metal oxide semiconductor (MOS), or a triode, or a thyristor. The types of switch tubes corresponding to different antenna modes can be different.

[0136] In one embodiment, the first device can independently control the pointing direction of the antenna beam and the antenna polarization mode. Taking the smart antenna in the first device as an example of an antenna, for the same pointing direction of the antenna beam, different antenna polarization modes can be corresponding. Exemplarily, when the pointing direction of the antenna beam is "south", this pointing direction of the antenna beam can correspond to different antenna polarization modes, such as "vertical polarization" and "horizontal polarization". The pointing directions of different antenna beams can be switched by controlling the radio frequency switch. Under the same pointing direction of the antenna beam, different antenna polarization modes can also be switched by controlling the radio frequency switch. The first device can control the radio frequency switch corresponding to the pointing direction of the antenna beam and the radio frequency switch corresponding to the antenna polarization mode to switch the antenna mode. Exemplarily, if antenna mode 1 is "the pointing direction of the antenna beam is "south"" and the antenna polarization mode is "vertical polarization", then the first device can close the radio frequency switch corresponding to "the pointing direction of the antenna beam is "south"" and the radio frequency switch corresponding to the antenna polarization mode of "vertical polarization" under this "the pointing direction of the antenna beam is "south"" to switch to antenna mode 1, as Figure 5A shown.

[0137] In one embodiment, the pointing direction of the antenna beam and the antenna polarization mode are controlled together, and the first device cannot independently switch the pointing direction of the antenna beam and the antenna polarization mode. Taking the smart antenna in the first device as an example of an antenna, the pointing direction of the antenna beam can correspond to an antenna polarization mode. For example, the antenna polarization mode corresponding to the pointing direction of the antenna beam being "south" is "vertical polarization", and the antenna polarization mode corresponding to the pointing direction of the antenna beam being "east" is "horizontal polarization". The first device can control the radio frequency switch corresponding to the pointing direction of the antenna beam to achieve the purpose of simultaneously controlling "switching the pointing direction of the antenna beam" and "the antenna polarization mode", and cannot independently control "switching the pointing direction of the antenna beam" and "the antenna polarization mode". Exemplarily, if the antenna polarization mode corresponding to the pointing direction of the antenna beam being "south" is "vertical polarization", antenna mode 1 is "the pointing direction of the antenna beam is "south"" and the antenna polarization mode is "vertical polarization", then the first device can close the radio frequency switch corresponding to "the pointing direction of the antenna beam is "south"" to switch to antenna mode 1, achieving the purpose of simultaneously switching the pointing direction of the antenna beam and the polarization mode, as Figure 5B shown. It should be understood that Figure 5A and Figure 5B do not show the radio frequency switches in other antenna modes.

[0138] The following uses specific embodiments to illustrate the antenna switching method provided by the embodiments of the present application. These several specific embodiments below can be combined with each other, and for the same or similar concepts or processes, they may not be repeated in some embodiments. Figure 6The flowchart of an embodiment of the antenna switching method provided by the embodiment of the present application is shown as follows. As Figure 6 shown, the antenna switching method may include:

[0139] S601, the first device locates the second device to obtain the first relative orientation between the first device and the second device.

[0140] The first device may locate the second device to obtain the first relative orientation between the first device and the second device. The first relative orientation may be: the orientation of the second device relative to the first device. Exemplarily, the second device is in the "south" of the first device. In one embodiment, the first relative orientation may be: the orientation of the second device relative to the first device, and the orientation of the first device relative to the second device. Exemplarily, the second device is in the "south" of the first device, and the first device is in the "north" of the second device. In one embodiment, the first relative orientation may be represented by "phi angle and theta angle". Exemplarily, if the orientation of the second device relative to the first device is: the phi angle is 30°, and the theta angle is 60°. It should be understood that the phi angle is the angle in the horizontal plane (or azimuth plane), and the theta angle is the angle in the vertical plane (or elevation plane). If the first device is the center of the sphere, the range of the angle in the horizontal plane is -180° - 180°, and the range of the angle in the vertical plane is 0° - 180°.

[0141] In one embodiment, the first device may, but is not limited to, use ultra-wideband (UWB) technology, or WI-FI angle of arrival (AOA) positioning technology, or Bluetooth beacon positioning technology to locate the second device, and reference may be made to the relevant descriptions in the prior art. In one embodiment, a first positioning module may be integrated in the first device, and a second positioning module may be integrated in the second device. The first positioning module and the second positioning module may be, but are not limited to, global positioning system (GPS) modules. The first device may locate the position of the first device through the first positioning module, and the second device may locate the position of the second device through the second positioning module. When the first device locates the second device, the first device may send a positioning message to the second device, and the positioning message is used to instruct the second device to feedback the position of the second device. After receiving the positioning message from the first device, the second device may feedback the position of the second device to the first device. The first device receives the position from the second device and may obtain the first relative orientation between the first device and the second device based on the position of the first device. The embodiments of the present application do not limit the manner in which the first device locates the second device.

[0142] In one embodiment, before the first device locates the second device or when the first device locates the second device, the first device may send a location request to the second device, and this location request is used for the first device to determine whether the second device has a location function. Among them, if the second device has a location function, the second device may send a location response to the first device in response to the location request from the first device. If the first device receives the location response from the second device, it may determine that the second device has a location function, and then may locate the second device. If the second device does not have a location function, the second device receives the location request from the first device and does not send a location response to the first device. If the first device does not receive the location response from the second device after sending the location request, the first device may determine that the second device does not have a location function. When the first device determines that the second device does not have a location function, the following S1101 - S1105 may be executed, and specific reference may be made to the relevant descriptions below.

[0143] In one embodiment, the first device may locate the second device periodically, which may be referred to as periodic triggering. Exemplarily, the first device may locate the second device once every certain period of time (such as 30 s). In one embodiment, the first device may locate the second device when it detects that the communication quality between the first device and the second device is lower than a preset communication quality, which may be referred to as communication quality triggering. Exemplarily, the way for the first device to detect that the communication quality between the first device and the second device is lower than the preset communication quality may be: the first device detects that the communication rate between the first device and the second device is less than the preset rate, and / or the first device detects that the packet error rate (PER) between the first device and the second device is greater than the preset packet error rate, and / or the first device detects that the received signal strength indicator (RSSI) between the first device and the second device is less than the preset received signal strength indicator, and / or the first device detects that the error vector magnitude (EVM) between the first device and the second device is greater than the preset error vector magnitude, and / or the first device detects that the equivalent isotropically radiated power between the first device and the second device is less than the preset equivalent isotropically radiated power, and the first device may determine that the communication quality between the first device and the second device is lower than the preset communication quality. In one embodiment, the first device may locate the second device when it is in a preset scenario, which may be referred to as preset scenario triggering. Among them, the preset scenario may include but is not limited to: game scenarios, high-definition video scenarios, live broadcast scenarios, and other scenarios that require relatively high communication quality.

[0144] In one embodiment, when the first device triggers the positioning of the second device, such as periodically triggering, triggering by communication quality, or triggering the first device to position the second device in a preset scenario, the first device can determine whether the smart antenna in the first device is idle. When the smart antenna in the first device is idle, the first device positions the second device. If the smart antenna in the first device is idle, the first device can position the second device. If the smart antenna in the first device is busy, the first device does not position the second device, and the first device can use an omnidirectional antenna. The first device using an omnidirectional antenna means that the antenna radiation pattern of the first device is approximately circular, and the radiation power in all directions is basically the same, without strong directivity. In one embodiment, the first device can determine whether the smart antenna in the first device is idle based on the number of second devices interacting with the first device. Exemplarily, when the first device determines that the number of second devices interacting with the first device is greater than or equal to a preset number, the first device determines that the smart antenna in the first device is busy. When the first device determines that the number of second devices interacting with the first device is less than the preset number, the first device determines that the smart antenna in the first device is idle. The preset number can be preset or user-defined. In one embodiment, the first device can determine whether the smart antenna in the first device is idle based on whether there is an idle antenna mode in the smart antenna in the first device. Among them, if the smart antenna in the first device includes an idle antenna mode, the first device determines that the smart antenna in the first device is idle. If the smart antenna in the first device does not include an idle antenna mode, the first device determines that the smart antenna in the first device is busy. In one embodiment, a busy / idle decision maker can be set in the first device, and the busy / idle decision maker can determine whether the smart antenna in the first device is idle based on the above judgment methods.

[0145] S602, the first device sends the second relative azimuth to the second device.

[0146] It should be noted that if the first relative azimuth is: the azimuth of the second device relative to the first device. The first device can calculate the azimuth of the first device relative to the second device based on this first relative azimuth, and then use the azimuth of the first device relative to the second device as the second relative phase. If the first relative azimuth is: the azimuth of the second device relative to the first device, and the azimuth of the first device relative to the second device, then the first device can use the azimuth of the first device relative to the second device as the second relative phase.

[0147] In one embodiment, after positioning the second device, the first device can send the second relative azimuth to the second device.

[0148] In one embodiment, the second device has a positioning function and also has an attitude detection function. The second device can detect the attitude of the second device based on a positioning request from the first device and feedback a message indicating successful attitude detection of the second device to the first device. Alternatively, the second device can detect the attitude of the second device after sending a positioning response to the first device and feedback a message indicating successful attitude detection of the second device to the first device. Among them, the first device can send a second relative orientation to the second device in response to the message indicating successful attitude detection from the second device. It should be understood that the message indicating successful attitude detection is used to represent that the second device has an attitude detection function, and the positioning response is used to represent that the second device has a positioning function. In one embodiment, the second device can notify the first device that the second device has or does not have an attitude detection function by sending a message of "having an attitude detection function" or "not having an attitude detection function" to the first device. The embodiments of the present application do not limit the manner in which the second device feeds back that the second device has a positioning function and an attitude detection function.

[0149] In one embodiment, the second device has a positioning function but does not have an attitude detection function. The second device can, in response to a positioning request from the first device or in response to a positioning response from the first device, not feedback a message indicating successful attitude detection of the second device to the first device. If the first device does not detect a message indicating successful attitude detection from the second device, it can determine that the second device does not have an attitude detection function. If the first device does not send a second relative orientation to the second device, it can execute the following S1101 - S1105, and specific reference can be made to the relevant descriptions below. Alternatively, the second device can, in response to a positioning request from the first device or in response to a positioning response from the first device, feedback a message indicating failed attitude detection of the second device to the first device. If the first device receives a message indicating failed attitude detection from the second device, it can determine that the second device does not have an attitude detection function. If the first device does not send a second relative orientation to the second device, it can execute the following S1101 - S1105, and specific reference can be made to the relevant descriptions below.

[0150] S603. The second device determines a first target antenna pattern of the second device based on the attitude of the second device, the second relative orientation, and the first mapping relationship, and switches to the first target antenna pattern. In the first target antenna pattern, the antenna beam of the second device is aligned with the first device.

[0151] In one embodiment, S603 can be replaced with: The second device communicates with the first device using the first target antenna pattern based on the second relative orientation, the attitude of the second device, and the first mapping relationship. In the first target antenna pattern, the antenna beam of the second device is aligned with the first device.

[0152] In one embodiment, a gyroscope is provided in the second device. The second device can determine the attitude of the second device based on the gyroscope data, and the relevant description of using a gyroscope to determine the attitude of a device in the prior art can be referred to. The attitude of the second device can be, but is not limited to: landscape, portrait, horizontal or vertical. A first mapping relationship can be pre-stored in the second device. The first mapping relationship represents the mapping relationship among the attitude of the second device, the relative orientation, and the antenna mode. Wherein, the relative orientation in the first mapping relationship refers to the orientation of other devices relative to the second device. That is to say, the first mapping relationship includes: under the attitude of the second device, the antenna modes corresponding to each relative orientation. Among them, "under the attitude of the second device, the antenna modes corresponding to each relative orientation" in the first mapping relationship can be understood as: under the attitude of the second device, the antenna mode with the best communication quality with other devices in each relative orientation. It can also be understood as: under the attitude of the second device, the antenna mode in which "the beam of the antenna aligns with other devices" in each relative orientation. It should be understood that the second device can store the first mapping relationship in the form of a table, a database, or a matrix. The embodiment of the present application does not limit the storage form of the first mapping relationship. It should be understood that the first mapping relationship can be pre-obtained and stored in the second device, and the obtaining process of the first mapping relationship can be referred to the following Figure 15 related description.

[0153] In one embodiment, the first mapping relationship may include: an attitude of the second device (such as landscape), and the antenna modes corresponding to each relative orientation in this attitude (landscape). In one embodiment, the first mapping relationship may include multiple attitudes of the second device (such as landscape, portrait, horizontal or vertical), and the antenna modes corresponding to each relative orientation in this attitude (landscape, portrait, horizontal or vertical), as shown in Table 1 and Table 2 below.

[0154] Table 1 shows the antenna modes corresponding to each relative orientation when the second device is in landscape, and Table 2 shows the antenna modes corresponding to each relative orientation when the second device is in portrait. It should be understood that in Table 1 and Table 2, the relative orientation is represented by "phi angle and theta angle", and the antenna mode is represented by "Mode 1 - Mode 4". Wherein, "Mode" in the table represents "antenna mode". In the embodiment of the present application, other methods can also be used to characterize the antenna mode, such as using the identifier of the RF switch corresponding to the antenna mode to represent the antenna mode. Exemplarily, for example, RF switch 1 can represent antenna mode 1.

[0155] Table 1 (landscape)

[0156]

[0157]

[0158] Table 2 (portrait)

[0159]

[0160] In one embodiment, the above Table 1 and Table 2 can be combined into one table, and the combined table is used to represent: the antenna patterns corresponding to each relative orientation in each posture of the second device in landscape and portrait screens.

[0161] Supplement the antenna structures corresponding to the patterns in Table 1 and Table 2.

[0162] Referring to the first mapping relationship shown in Table 1 and Table 2 above, the second device can determine the antenna pattern corresponding to the posture and the second relative orientation of the second device based on the posture of the second device, the second relative orientation, and the first mapping relationship stored in the second device, and use the antenna pattern corresponding to the posture and the second relative orientation of the second device as the first target antenna pattern. That is to say, the second device can query the first mapping relationship based on the posture of the second device and the second relative orientation, and use the antenna pattern corresponding to "the posture and the second relative orientation of the second device" in the first mapping relationship as the first target antenna pattern.

[0163] Exemplarily, if the posture of the second device is in landscape and the second relative orientation is "phi angle is 30°, theta angle is 60°", then according to the above Table 1, it can be determined that "Mode 3" is the first target antenna pattern, and the second device can switch to the first target antenna pattern "Mode 3". In one embodiment, the second device can switch from the current first antenna pattern to the first target antenna pattern. It should be understood that the current first antenna pattern can be the antenna pattern of the second device before switching, and the first target antenna pattern can be understood as the antenna pattern to be switched by the second device. The current first antenna pattern can be the same as or different from the first target antenna pattern. If the current first antenna pattern can be the same as the first target antenna pattern, the second device can not switch the antenna pattern and maintain the current first antenna pattern, that is, maintain the first target antenna pattern.

[0164] In one embodiment, because the postures of the second device are diverse, if the first mapping relationship does not include the posture of the second device, the second device can obtain the antenna patterns corresponding to each relative orientation in the posture of the second device by means of coordinate transformation based on the existing postures in the first mapping relationship. Among them, the second device can obtain the rotation information of the posture of the first device relative to the existing posture, and then obtain the antenna patterns corresponding to each relative orientation in the posture of the first device based on the antenna patterns corresponding to each relative orientation in the existing posture and the rotation information.

[0165] The second device can store the antenna patterns corresponding to the relative orientations in the posture of the second device into the first mapping relationship, so that when the second device is in this posture next time, it can query the first mapping relationship to obtain the antenna patterns corresponding to the relative orientations in this posture.

[0166] Exemplarily, the posture of the second device is the horizontal posture, and Table 1 and Table 2 above characterize the antenna patterns corresponding to the relative orientations of the second device in the landscape and portrait screen modes. Therefore, the second device can, based on Table 1 and Table 2 above, obtain the posture "landscape screen" that is closest to the "horizontal posture", and then, according to the antenna patterns corresponding to the relative orientations in the "landscape screen", obtain the antenna patterns corresponding to the relative orientations in the "horizontal posture" through coordinate transformation.

[0167] Exemplarily, taking the case where the first mapping relationship includes the antenna patterns corresponding to the relative orientations of the second device in the landscape screen mode and does not include the antenna patterns corresponding to the relative orientations of the second device in the portrait screen mode, and the second device can obtain the antenna patterns corresponding to the relative orientations in the portrait screen mode based on the antenna patterns corresponding to the relative orientations in the landscape screen as an example. Taking the geodetic coordinate system as the reference coordinate system, the local coordinate system of the second device is defined. If the second device is a laptop computer, when the laptop computer is in the landscape screen mode, assume that the long side of the laptop computer faces the Y-axis of the geodetic coordinate system, the short side faces the X-axis of the geodetic coordinate system, and the direction perpendicular to the "plane where the long side and the short side are located" faces the Z-axis of the geodetic coordinate system, thereby forming the local coordinate system of the second device. When the second device is in the portrait screen mode, the portrait screen can be regarded as obtained by rotating the landscape screen, so the local coordinate system in the landscape screen mode can also be rotated accordingly to obtain the local coordinate system in the portrait screen mode. Based on the rotation of the second device in the portrait screen relative to the landscape screen, the second device can determine that it has rotated y degrees around the Z-axis, p degrees around the Y-axis, and r degrees around the X-axis. Then, the second device can determine that the local coordinate system in the portrait screen mode has rotated y degrees around the Z-axis, p degrees around the Y-axis, and r degrees around the X-axis compared with the local coordinate system in the landscape screen mode.

[0168] Assume that the second device stores the above Table 1 in matrix form, and the matrix corresponding to the above Table 1 (landscape screen) is M 1 , then the matrix M 2 (antenna patterns corresponding to the relative orientations in the portrait screen mode) can be obtained by the following formula 1:

[0169] M 2 = M x · M y · M z · M 1 Formula 1

[0170] Where, (M x , M y , M z) is the rotation matrix of the vertical screen relative to the horizontal screen. The rotation matrix is related to y degrees, p degrees, and r degrees. In one embodiment, the rotation information may be a rotation matrix or a rotation angle. The above formula (1) is described by taking the rotation information as a rotation matrix as an example.

[0171] In one embodiment, since the orientation of the first device relative to the second device, that is, the second relative orientation, is also diverse. If the second relative orientation is not included in the first mapping relationship, the second device may use, in the first mapping relationship, the antenna pattern corresponding to the orientation closest to the second relative orientation in the same posture as the first target antenna pattern. In one embodiment, the orientation closest to the second relative orientation in the same posture may be referred to as the second target relative orientation. Among them,

[0172] 1. If the phi angle in the second relative orientation is included in the first mapping relationship and the theta angle is not included, then the antenna pattern corresponding to the orientation with the smallest "difference in theta angle" from the second relative orientation in the same posture in the first mapping relationship is used as the first target antenna pattern. Exemplarily, the posture of the second device is the horizontal screen, and the second relative orientation is "phi angle is 30°, theta angle is 40°". The second device queries the first mapping relationship (as shown in Table 1) and determines that the relative orientation in the first mapping relationship does not include "theta angle is 40°". Then the second device may use "theta angle is 30°", which has the smallest "difference in theta angle" from "theta angle is 40°", as the theta angle in the second relative orientation. Accordingly, the second device may use "mode three" corresponding to "phi angle is 30°, theta angle is 30°" as the first target antenna pattern.

[0173] Among them, if there are multiple theta angles with the smallest "difference in theta angle" from the second relative orientation in the first mapping table in the same posture, any one of these multiple theta angles may be used as the theta angle in the second relative orientation. Exemplarily, the posture of the second device is the horizontal screen, and the second relative orientation is "phi angle is 30°, theta angle is 45°". In the first mapping table, the theta angles with the smallest "difference in theta angle" are "theta angle is 30°" and "theta angle is 60°". Then "theta angle is 30°" or "theta angle is 60°" in the first mapping table may be used as the "theta" in the second relative orientation. Then the first target antenna pattern may be "mode three" corresponding to "phi angle is 30°, theta angle is 30°", or the first target antenna pattern may be "mode three" corresponding to "phi angle is 30°, theta angle is 60°".

[0174] 2. If the first mapping relationship does not include the phi angle in the second relative orientation but includes the theta angle, then the antenna pattern corresponding to the orientation with the smallest "difference in phi angle" from the second relative orientation at the same attitude in the first mapping relationship is used as the first target antenna pattern, and the relevant description in 1 above can be referred to.

[0175] 3. If the first mapping relationship does not include the phi angle in the second relative orientation and does not include the theta angle, then the antenna pattern corresponding to the phi angle with the smallest "difference in phi angle" and the theta angle with the smallest "difference in theta angle" from the second relative orientation at the same attitude in the first mapping relationship is used as the first target antenna pattern, and the relevant description in 1 above can be referred to.

[0176] In the embodiment of the present application, after the second device obtains the first target antenna pattern, it can switch to the first target antenna pattern. The way for the second device to switch the antenna pattern can be: closing the radio frequency switch corresponding to the first target antenna pattern. Specifically, the relevant description above can be referred to. Figures 4A - 5B It should be understood that when the second device switches from the current first antenna pattern to the first target antenna pattern, the antenna beam of the second device aligns with the first device.

[0177] S604. The first device determines the second target antenna pattern of the first device based on the attitude of the first device, the first relative orientation, and the second mapping relationship, and switches to the second target antenna pattern. In the second target antenna pattern, the antenna beam of the first device aligns with the second device.

[0178] It should be understood that there is no distinction in the order between S603 and S604, and the two can be executed simultaneously.

[0179] In one embodiment, S604 can be replaced by: The first device communicates with the second device using the second target antenna pattern based on the first relative orientation, the attitude of the first device, and the second mapping relationship. In the second target antenna pattern, the antenna beam of the first device aligns with the second device.

[0180] Among them, the manner in which the first device obtains the attitude of the first device, and the attitude of the first device can refer to the relevant description of the second device. The first device may pre-store a second mapping relationship, which is used to represent the mapping relationship among the attitude of the second device, the relative orientation, and the antenna mode. Among them, the relative orientation in the second mapping relationship refers to: the orientation of other devices relative to the first device. That is to say, the second mapping relationship includes: under the attitude of the first device, the antenna modes corresponding to each relative orientation. The second mapping relationship can refer to the relevant description of the above-mentioned first mapping relationship. Among them, the "antenna modes corresponding to each relative orientation under the attitude of the first device" in the second mapping relationship can be understood as: under the attitude of the first device, the antenna modes with the best communication quality with other devices in each relative orientation. It can also be understood as: under the attitude of the first device, the antenna modes in which "the antenna beam aligns with other devices" in each relative orientation. It should be understood that the second mapping relationship can be pre-obtained and stored in the first device, and the acquisition process of the second mapping relationship can refer to the relevant description in the following Figure 15 description.

[0181] Among them, the process of "the first device determines the second target antenna mode of the first device based on the attitude of the first device, the first relative orientation, and the second mapping relationship, and switches from the current second antenna mode to the second target antenna mode" can refer to the relevant description in S603 above, and will not be elaborated here. That is to say, it can be understood that: replacing the second device in the above embodiment with the first device and replacing the first mapping relationship with the second mapping relationship can achieve the purpose of "the first device determines the second target antenna mode of the first device and switches to the second target antenna mode". It should be understood that when the first device switches to the second target antenna mode, the antenna beam of the first device aligns with the second device.

[0182] In the embodiments of the present application, since the antenna beam of the second device in the first target antenna mode aligns with the first device, and the antenna beam of the first device in the second target antenna mode aligns with the first device, the antenna beam of the first device can align with the antenna beam of the second device.

[0183] Figure 7 It is a schematic diagram of beam alignment provided by the embodiments of the present application. As Figure 7As shown, the router has three antenna modes, and the pointing directions of the antenna beams of the three antenna modes can be different. The mobile phone has two antenna modes, and the pointing directions of the antenna beams of the two antenna modes can be different. Assuming that the router is the first device and the mobile phone is the second device, after the above S601 - S604, the router can switch to the second target antenna mode. For example, the router closes the RF switch corresponding to the second target antenna mode, and the mobile phone can switch to the first target antenna mode. For example, the mobile phone can close the RF switch corresponding to the first target antenna mode. Among them, the antenna beam of the router in the second target antenna mode is aligned with the antenna beam of the mobile phone in the first target antenna mode (such as the major axis directions of the ellipses are the same).

[0184] Figure 8 Another schematic diagram of beam alignment provided by the embodiment of the present application. As Figure 8 shown, the second device can be multiple. When the first device is connected to multiple second devices, the communication is carried out in a time - sharing manner. For example, at time t1, the router is connected to mobile phone 1 for switching the antenna mode. At time t2, the AP is connected to mobile phone 2 for switching the antenna mode. So from a certain moment, the router is only connected to one STA device, and at this moment, the beam and polarization matching between the router and the corresponding communicating STA device are achieved. That is to say, the first device can close the RF switches corresponding to multiple antenna modes, so that the first device can work in multiple antenna modes. It should be understood that the interaction between the first device and each second device and the scheme for switching the antenna mode are the same, and can refer to Figure 6 the relevant description therein.

[0185] In one embodiment, if t2 is later than t1, after the router and mobile phone 1 interact, the switched second target antenna mode is antenna mode 1, and after the router and mobile phone 2 interact, the switched second target antenna mode is also antenna mode 1. Then when the router interacts with mobile phone 2, it can not switch the antenna mode and do nothing, because the router in antenna mode 1 is aligned with the antenna beam of mobile phone 1 and also with the antenna beam of mobile phone 2.

[0186] Exemplarily, the second device can be a mobile phone and a laptop computer. The laptop computer has two antenna modes, and the pointing directions of the antenna beams of the two antenna modes can be different. The interaction between the router and the mobile phone, and the interaction between the router and the laptop computer are both as described in the above S601 - S604. Refer to Figure 8, the router can interact with the mobile phone to close the RF switch corresponding to the second target antenna mode, and the mobile phone can close the RF switch corresponding to the first target antenna mode, so that the antenna beam of the router is aligned with the antenna beam of the mobile phone. Similarly, the router can interact with the laptop computer to close the RF switch corresponding to the third target antenna mode, and the laptop computer can close the RF switch corresponding to the fourth target antenna mode, so that the antenna beam of the router is aligned with the antenna beam of the laptop computer. Among them, the third target antenna mode can be the same as or different from the second target antenna mode, and the fourth target antenna mode can be the same as or different from the first target antenna mode.

[0187] In one embodiment, before S601, S601a may further be included: the first device and the second device are associated.

[0188] The association of the first device and the second device can be understood as: the first device and the second device establish a connection. Among them, the first device and the second device can be, but are not limited to, wired connections and wireless connections. Wired connections can be, but are not limited to: the first device and the second device are connected through a network cable and a universal serial bus (USB). Wired connections can be, but are not limited to: the first device and the second device are connected through Wi-Fi and a cellular network.

[0189] In the antenna switching method provided by the embodiments of the present application, intelligent antennas are provided in both the first device and the second device. The first device can locate the second device to obtain the first relative orientation between the first device and the second device. The first device can send the second relative orientation to the second device. The second device determines the first target antenna mode of the second device based on the attitude of the second device, the second relative orientation, and the first mapping relationship, and switches to the first target antenna mode. The first device can determine the second target antenna mode of the first device based on the attitude of the first device, the first relative orientation, and the second mapping relationship, and switches to the second target antenna mode. In the embodiments of the present application, the antenna beam of the second device in the first target antenna mode is aligned with the first device, and the antenna beam of the first device in the second target antenna mode is aligned with the first device. Therefore, the antenna beam of the first device can be aligned with the antenna beam of the second device, improving the communication quality between the first device and the second device.

[0190] In the above embodiments, the antenna beam of the first device can be aligned with the antenna beam of the second device, which can improve the communication quality between the first device and the second device compared with the prior art. However, the above embodiments cannot achieve the antenna polarization matching between the first device and the second device. In the embodiments of the present application, in order to achieve the antenna polarization matching between the first device and the second device, reduce the influence of environmental interference and indoor multipath, and improve the signal-to-noise ratio, the following is provided Figure 9A and Figure 9BThe antenna switching method shown. Refer to Figure 9A and Figure 9B , in the embodiment of the present application, the second device may execute S901 after the above S603:

[0191] S901, the second device sends the antenna polarization information of the second device to the first device.

[0192] The antenna polarization information is used to indicate the antenna polarization mode of the second device. In one embodiment, the antenna polarization information may include the antenna polarization mode of the second device. In one embodiment, the first mapping relationship may include: under the posture of the second device, the antenna modes corresponding to each relative azimuth, and the antenna polarization modes corresponding to each antenna mode. In one embodiment, in the first target antenna mode, the antenna polarization mode of the second device may be referred to as the first antenna polarization mode.

[0193] When the second device is in landscape mode, the first mapping relationship includes Table 1 and Table 3. When the second device is in portrait mode, the first mapping relationship includes Table 2 and Table 4. It should be understood that Table 1 corresponds to Table 3, Table 2 corresponds to Table 4, and Table 1 to Table 4 may all be included in the first mapping relationship.

[0194] Table 3

[0195] Mode 1 Vertical polarization Mode 2 Horizontal polarization Mode 3 Horizontal polarization Mode 4 Vertical polarization

[0196] Table 4

[0197] Mode 1 +45° polarization Mode 2 Horizontal polarization Mode 3 Vertical polarization Mode 4 Vertical polarization

[0198] Based on the above S603, the second device can determine the first target antenna mode. The second device can obtain the antenna polarization mode corresponding to the first target antenna mode based on the first mapping relationship (such as Table 3), and then send the antenna polarization mode of the second device to the first device. Exemplarily, as shown in Table 1 above, if the first target antenna mode is "Mode 1", then based on the "antenna polarization modes corresponding to each antenna mode" shown in Table 2, the second device can determine that the antenna polarization mode of the second device is "vertical polarization".

[0199] In one embodiment, if the first device can independently switch the pointing direction and the antenna polarization mode of the antenna beam, then the above S604 can be replaced by "S902 - S903", as Figure 9A shown. In one embodiment, if the first device cannot independently switch the pointing direction and the antenna polarization mode of the antenna beam, then the above S604 can be replaced by S904, as Figure 9B shown. It should be understood that whether the first device can independently switch, or cannot independently switch the "pointing direction and the antenna polarization mode of the antenna beam" can refer to the relevant description of Figures 5A - 5B .

[0200] S902. The first device determines a second target antenna pattern of the first device based on the attitude of the first device, the first relative orientation, and a second mapping relationship, and switches to the second target antenna pattern. In the second target antenna pattern, the antenna beam of the first device is aligned with the second device.

[0201] S902 may refer to the relevant description of S604 above. The first device may determine the pointing direction of the antenna beam of the first device aligned with the second device, and close the RF switch corresponding to the pointing direction of the antenna beam, so that the first device switches to the pointing direction of the antenna beam.

[0202] S903. The first device adjusts the polarization mode of the first device based on the antenna polarization information of the second device, so that the antenna polarizations of the first device and the second device are matched.

[0203] Based on the antenna polarization mode of the second device, the first device determines that in the scenario where the antenna beam of the first device is aligned with the second device, it selects a polarization mode that is the same as the antenna polarization mode of the second device, and switches to the polarization mode that is the same as the antenna polarization mode of the second device, so that the antenna polarizations of the first device and the second device are matched. Exemplarily, for example, the first device may close the RF switch corresponding to the polarization mode that is the same as the antenna polarization mode of the second device, so that the antenna polarizations of the first device and the second device are matched.

[0204] Exemplarily, if the antenna polarization mode of the second device is "vertical polarization", the first device may switch the antenna polarization mode of the first device to "vertical polarization" when the antenna beam of the first device is aligned with the second device, so that the antenna polarizations of the first device and the second device are matched.

[0205] S904. The first device determines a second target antenna pattern of the first device based on the attitude of the first device, the first relative orientation, the second mapping relationship, and the antenna polarization information of the second device, and switches to the second target antenna pattern. In the second target antenna pattern, the antenna beam of the first device is aligned with the second device, and the antenna polarizations of the first device and the second device are matched.

[0206] Among them, the first device can determine the pointing direction of the antenna beam of the first device aligned with the second device based on the attitude of the first device, the first relative orientation, and the second mapping relationship. The first device can also determine the polarization mode that is the same as the antenna polarization mode of the second device based on the antenna polarization mode of the second device. The first device can switch to the antenna mode corresponding to "the pointing direction of the antenna beam of the first device aligned with the second device and the polarization mode that is the same as the antenna polarization mode of the second device", so that when the antenna beam of the first device is aligned with the second device, the antenna polarizations of the first device and the second device are matched. Exemplarily, the first device can close the radio frequency switch corresponding to "the pointing direction of the antenna beam of the first device aligned with the second device and the polarization mode that is the same as the antenna polarization mode of the second device", so as to realize that when the antenna beam of the first device is aligned with the second device, the antenna polarizations of the first device and the second device are matched.

[0207] Figure 10A FIG. is a schematic diagram of beam alignment and polarization matching provided by an embodiment of the present application. Refer to Figure 10A , the router has 3 antenna modes, and the mobile phone has 2 antenna modes. Assuming that the router is the first device and the mobile phone is the second device, then through the above Figure 9A or Figure 9B corresponding steps, the antenna beam of the router is aligned with the antenna beam of the mobile phone (such as the same long axis direction of the ellipse), and the antenna polarizations of the router and the mobile phone are matched (such as the arrow directions are both vertical directions, that is, the polarization mode is vertical polarization).

[0208] In one embodiment, there can be multiple second devices. Refer to Figure 10B shown, the first device can be based on the same method ( Figure 9A or Figure 9B shown steps), to achieve the alignment of the antenna beams of the first device and multiple second devices, and the matching of the antenna polarizations. The specific implementation method can refer to Figure 9A or Figure 9B for relevant descriptions.

[0209] In the embodiment of the present application, the second device can report the antenna polarization information of the second device to the first device. The first device can adjust the antenna polarization mode of the first device based on the antenna polarization information of the second device, and thus can realize the matching of the antenna polarizations of the first device and the second device. Therefore, the antenna switching method provided by the embodiment of the present application can not only realize the alignment of the antenna beams of the first device and the second device, but also realize the matching of the antenna polarizations of the first device and the second device. The first device and the second device can communicate through narrow beam signals with the same polarization, which can reduce the influence of environmental interference and indoor multipath, and improve the signal-to-noise ratio.

[0210] In the above embodiments, both the first device and the second device have positioning functions and attitude detection functions. In one embodiment, when the first device and / or the second device does not have a positioning function, or when the first device and / or the second device does not have an attitude detection function, or when the first device cannot locate the second device due to obstacles such as walls and doors between the first device and the second device, the first device and the second device cannot adopt the above Figure 6 or Figure 9A or Figure 9B to implement the switching of the antenna mode. The embodiments of the present application also provide a method for antenna switching. In this method, the first device and the second device can adopt the method of traversing the antenna modes to align the antenna beam of the first device with the antenna beam of the second device and match the antenna polarizations of the first device and the second device. It can be understood that in the line of sight (LOS) scenario of wireless signals, the first device and the second device can adopt the above Figure 6 or Figure 9A or Figure 9B to align the antenna beam of the first device with the antenna beam of the second device and match the antenna polarizations of the first device and the second device. In the non-line of sight (NLOS) scenario of wireless signals, the first device and the second device can adopt the Figure 11 to align the antenna beam of the first device with the antenna beam of the second device and match the antenna polarizations of the first device and the second device. Among them, in the LOS scenario, the first device can locate the second device, and in the NLOS scenario, the first device cannot locate the second device.

[0211] Figure 11 is a schematic flowchart of another embodiment of the antenna switching method provided by the embodiments of the present application. Referring to Figure 11 , the antenna switching method may include:

[0212] S1101, when the second device is in the first antenna mode, the first device traverses and switches the antenna modes of the first device, and obtains the first communication quality between the first device and the second device in each antenna mode.

[0213] In one embodiment, the first device may send a first message to the second device, and the first message is used to instruct the second device to switch to the first antenna mode. The first antenna mode may be any one of the antenna modes of the second device. When the second device switches to the first antenna mode, the first device may traverse and switch the antenna modes of the first device to obtain the first communication quality between the first device and the second device in each antenna mode. That is to say, the first device may interact with the second device. On the premise that the antenna mode of the second device is fixed (that is, when the second device is in the first antenna mode), the first device traverses and switches the antenna modes of the first device. In one embodiment, when switching to the first antenna mode, the second device may feedback a response message of the first message, and the response message of the first message is used to instruct the second device to switch to the first antenna mode.

[0214] The first communication quality between the first device and the second device may be characterized by at least one of the following parameters: the communication rate between the first device and the second device, the packet error rate, the received signal strength indication, the error vector magnitude, and the equivalent isotropic radiated power. Among them, the higher the communication rate, the better the first communication quality between the first device and the second device. The lower the packet error rate, the better the first communication quality between the first device and the second device. The higher the received signal strength indication, the better the first communication quality between the first device and the second device. The lower the error vector magnitude, the better the first communication quality between the first device and the second device. The higher the equivalent isotropic radiated power, the better the first communication quality between the first device and the second device.

[0215] S1102. When the second device is in the second antenna mode, the first device traverses the antenna modes of the first device and obtains the second communication quality between the first device and the second device in each antenna mode.

[0216] In one embodiment, the first device may send a second message to the second device, and the second message is used to instruct the second device to switch to the first antenna mode. The second antenna mode may be any one of the antenna modes of the second device. When the second device switches to the second antenna mode, the first device may traverse and switch the antenna modes of the first device to obtain the first communication quality between the first device and the second device in each antenna mode. Specifically, reference may be made to the relevant description of S1101.

[0217] Among them, the second antenna mode is different from the first antenna mode, and the set of the first antenna mode and the second antenna mode may be all the antenna modes of the second device.

[0218] S1103. Select a target communication quality from the first communication quality and the second communication quality, and determine the second target antenna mode of the first device and the first target antenna mode of the second device corresponding to the target communication quality.

[0219] The target communication quality is the best communication quality among the first communication quality and the second communication quality. The second target antenna pattern of the first device corresponding to the target communication quality is: the antenna pattern of the first device when the target communication quality is achieved. The first target antenna pattern of the second device corresponding to the target communication quality is: the antenna pattern of the second device when the target communication quality is achieved.

[0220] S1104. The first device switches to the second target antenna pattern.

[0221] S1105. The second device switches to the first target antenna pattern.

[0222] For S1104 and S1105, the relevant descriptions of the device switching the antenna pattern in the above embodiments can be referred to. It should be understood that there is no distinction in the order between S1104 and S1105, and the two can be executed simultaneously.

[0223] Based on the relevant descriptions in the above embodiments, when the antenna beam of the first device is aligned with the antenna beam of the second device and the antenna polarizations of the first device and the second device are matched, the communication quality between the first device and the second device is the best, that is, the target communication quality is achieved. Therefore, in the embodiments of the present application, when the first device switches to the second target antenna pattern and the second device switches to the first target antenna pattern, the antenna beam of the first device can be aligned with the antenna beam of the second device, and the antenna polarizations of the first device and the second device can be matched, thereby improving the communication quality between the first device and the second device.

[0224] In one embodiment, based on the relevant descriptions of the above embodiments, the method for antenna switching provided in the embodiments of the present application may be Figure 12 and Figure 13 the steps characterized by Figure 12 and Figure 13 The method for antenna switching shown has the same technical effects as the above embodiments, and the relevant descriptions can be referred to above and will not be elaborated here.

[0225] Refer to Figure 12 , Figure 12 The steps in Figure 6 , Figure 9A , Figure 9B and Figure 11 can be referred to the relevant descriptions in the above

[0226] Refer to Figure 13 , Figure 13 The steps in Figure 6 , Figure 9A can be referred to the relevant descriptions in the aboveFigure 9B and Figure 11 the relevant descriptions in. In one embodiment, the first device may include: a smart antenna trigger, an active positioning system, an attitude detection system, a mode storage and operation system. Among them, the smart antenna trigger can trigger the first device to locate the second device, and the triggering method can refer to the above relevant descriptions. The active positioning system is used for the first device to locate the second device and obtain the first relative azimuth. The attitude detection system is used to obtain the attitude of the first device. The mode storage and operation system is used to select a second target antenna mode based on the second mapping relationship and output a switch logic signal to the RF switch corresponding to the second target antenna mode to control the closing of the RF switch corresponding to the second target antenna mode, so that the first device switches to the second target antenna mode. The mode storage and operation system is also used to store the first mapping relationship, and calculate the antenna modes corresponding to each relative azimuth in the attitude that does not exist in the first mapping relationship based on the existing attitude in the first mapping relationship, and store the antenna modes corresponding to each relative azimuth in this attitude, which can refer to the relevant descriptions of the above embodiments. The mode storage and operation system is also used to calculate the antenna mode corresponding to the relative azimuth that does not exist in the first mapping relationship based on the existing relative azimuth in the first mapping relationship, and store this corresponding relationship.

[0227] Among them, when both the first device and the second device have positioning functions and attitude detection functions, the first device and the second device can execute Figure 6 or Figure 9A or Figure 9B the technical solutions in. When neither the first device nor the second device has positioning functions and / or attitude detection functions, the first device and the second device can execute Figure 11 the technical solutions in.

[0228] The second device may include: a passive positioning system, an attitude detection system, and a mode storage and operation system. The passive positioning system is used to interact with the active positioning system so that the first device can locate the second device, and reference may be made to the relevant description of S601. The attitude detection system is used to obtain the attitude of the second device. The mode storage and operation system is used to select a first target antenna mode based on the first mapping relationship, and output a switch logic signal to the radio frequency switch corresponding to the first target antenna mode to control the radio frequency switch corresponding to the first target antenna mode to close, so that the second device switches to the first target antenna mode, and reference may be made to the relevant description of the above embodiments. The mode storage and operation system is further used to store the second mapping relationship, and calculate the antenna modes corresponding to each relative azimuth in the attitude that does not exist in the second mapping relationship based on the existing attitude in the second mapping relationship, and store the antenna modes corresponding to each relative azimuth in this attitude. The mode storage and operation system is further used to calculate the antenna modes corresponding to the relative azimuth that does not exist in the second mapping relationship based on the existing relative azimuth in the second mapping relationship, and store this corresponding relationship.

[0229] In one embodiment, when neither the first device nor the second device has the function of actively positioning other devices, the positioning between the first device and the second device can be achieved with the help of a third device. Furthermore, the first device and the second device can switch the antenna mode based on the relative azimuth between the two, so as to align the antenna beam of the first device and the antenna beam of the second device, and match the antenna polarization of the first device and the second device. Exemplarily, when two mobile phones need to align the antenna beams and match the antenna polarization, but neither of the two mobile phones has the function of actively positioning other devices, the two mobile phones can obtain the relative azimuth between the two with the help of other third devices with active positioning functions, such as routers. Figure 14A This is a schematic flowchart of another embodiment of the antenna switching method provided by the embodiments of the present application. As Figure 14A shown, the antenna switching method may include:

[0230] S1401, the third device locates the first device and the second device.

[0231] It should be understood that before S1401, both the first device and the second device are associated with the third device, and reference may be made to the relevant description of the above embodiments.

[0232] The third device locates the first device and the second device, which can be understood as: the third device locates the first device and the third device locates the second device. The third device locates the first device and the second device, and reference may be made to the relevant description of the first device locating the second device.

[0233] S1402, the third device sends a third relative azimuth to the first device and a fourth relative azimuth to the second device.

[0234] The third relative orientation may be: the orientation of the second device relative to the first device. The fourth relative orientation may be: the orientation of the first device relative to the second device. In one embodiment, the third relative orientation may be referred to as the first relative orientation, and the fourth relative orientation may be referred to as the second relative orientation.

[0235] In one embodiment, when the third device locates the first device, it can obtain: the orientation of the first device relative to the third device. When the third device locates the second device, it can obtain: the orientation of the second device relative to the third device. The third device can calculate to obtain the orientation of the second device relative to the first device and the orientation of the first device relative to the second device.

[0236] In one embodiment, the third device may send a positioning request to the first device and the second device. After the third device receives the positioning responses from the first device and the second device, it can determine that both the first device and the second device have positioning functions. If both the first device and the second device have attitude detection functions, the first device and the second device may send a message indicating successful attitude detection to the third device. The third device may, in response to the messages indicating successful attitude detection from the first device and the second device, send the third relative orientation to the first device and the fourth relative orientation to the second device.

[0237] In one embodiment, if the third device does not receive the positioning response from the first device and / or the second device, or the third device does not receive the message indicating successful attitude detection from the first device and / or the second device, or the third device receives the message indicating failed attitude detection from the first device and / or the second device, then the third device may send a traversal instruction to the first device and the second device. The traversal instruction is used to instruct the first device and the second device to execute the steps of the traversing antenna mode ( Figure 11 the steps shown), to align the antenna beam of the first device and the antenna beam of the second device, and to match the antenna polarizations of the first device and the second device.

[0238] S1403. The second device determines the first target antenna mode of the second device based on the attitude of the second device, the fourth relative orientation, and the first mapping relationship, and switches to the first target antenna mode. In the first target antenna mode, the antenna beam of the second device is aligned with the first device.

[0239] It should be understood that in this embodiment, the first mapping relationship may include: the antenna modes corresponding to each relative orientation in the attitude of the second device.

[0240] S1404. The first device determines the second target antenna mode of the first device based on the attitude of the first device, the third relative orientation, and the second mapping relationship, and switches to the second target antenna mode. In the second target antenna mode, the antenna beam of the first device is aligned with the second device.

[0241] It should be understood that in this embodiment, the second mapping relationship may include: the antenna patterns corresponding to each relative orientation in the posture of the first device.

[0242] S1403 - S1404 may refer to the relevant descriptions of S603 - S604 in the above - mentioned embodiment, which will not be elaborated here. It should be understood that other detailed descriptions in S1401 - S1404 may refer to the above - mentioned Figure 6 relevant descriptions. There is no distinction in the order between S1403 and S1404.

[0243] In one embodiment, the embodiment of the present application may execute S1405 after the above - mentioned S1403, as Figure 14B and Figure 14C shown:

[0244] S1405, the second device sends the antenna polarization information of the second device to the first device.

[0245] It should be understood that in this embodiment, the first mapping relationship may include: the antenna patterns corresponding to each relative orientation in the posture of the second device, and the antenna polarization methods corresponding to each antenna pattern.

[0246] If the first device can independently switch the pointing direction of the antenna beam and the antenna polarization method, then the above - mentioned S1404 can be replaced by "S1406 - S1407", as Figure 14B shown. In one embodiment, if the first device cannot independently switch the pointing direction of the antenna beam and the antenna polarization method, then the above - mentioned S1404 can be replaced by S1408, as Figure 14C shown. It should be understood that whether the first device can independently switch, or cannot independently switch the "pointing direction of the antenna beam and the antenna polarization method" can refer to Figures 5A - 5B the relevant descriptions.

[0247] S1406, the first device determines the second target antenna pattern of the first device based on the posture of the first device, the third relative orientation, and the second mapping relationship, and switches to the second target antenna pattern, and the antenna beam of the first device in the second target antenna pattern is aligned with the second device.

[0248] It should be understood that in this embodiment, the second mapping relationship may include: the antenna patterns corresponding to each relative orientation in the posture of the first device, and the antenna polarization methods corresponding to each antenna pattern.

[0249] S1407, the first device adjusts the polarization method of the first device based on the antenna polarization information of the second device, so that the antenna polarizations of the first device and the second device are matched.

[0250] S1408. The first device determines a second target antenna pattern of the first device based on the attitude of the first device, the third relative orientation, the second mapping relationship, and the antenna polarization information of the second device, and switches to the second target antenna pattern. In the second target antenna pattern, the antenna beam of the first device aligns with the second device, and the antenna polarizations of the first device and the second device match.

[0251] S1405 - S1408 may refer to S901 - S904 in the foregoing embodiments.

[0252] In the embodiments of the present application, when the first device and the second device do not have the function of actively positioning other devices, the third device can be used to achieve the positioning between the first device and the second device. Then, the first device and the second device can switch the antenna pattern based on the relative orientation between the two, so as to align the antenna beam of the first device with the antenna beam of the second device, and match the antenna polarizations of the first device and the second device, thereby improving the communication quality between the first device and the second device.

[0253] Figure 15 For the schematic flow chart of pre - obtaining the first mapping relationship. It should be understood that the first mapping relationship and the second mapping relationship are obtained by pre - simulation or testing. The first mapping relationship can be pre - stored in the second device, and the second mapping relationship can be pre - stored in the first device. The obtaining method of the second mapping relationship is the same as that of the first mapping relationship. The following takes the process of obtaining the first mapping relationship as an example for description. Refer to Figure 15 , obtaining the first mapping relationship may include:

[0254] S1501. The first test device is associated with the second test device.

[0255] The smart antennas in different types of second devices may be different. The second test device may be: a device having the same smart antenna as the second device, or the second test device may be: a simulation device capable of simulating the same smart antenna as the second device. Exemplarily, if the second device is a mobile phone of model A, the second test device may be a mobile phone of model A or a simulation device. The first test device may be the same as or different from the type of the first device.

[0256] S1501 may refer to the relevant description of S601a above and will not be elaborated here.

[0257] S1502. Set the attitude of the second test device to the first attitude, and place the first test device at different orientations of the second test device.

[0258] The first attitude may be, but is not limited to: landscape screen, portrait screen, horizontal or vertical.

[0259] The staff can set the attitude of the second test device to the first attitude and place the first test device in different orientations relative to the second test device to simulate different orientations of the first test device relative to the second test device when the second test device is in different attitudes. Exemplarily, the staff can use the second test device as the center of a sphere and place the first test device at different positions on the sphere surface.

[0260] S1503. The second test device obtains the first received signal strength indication from the first test device corresponding to each antenna pattern in the first orientation in the first attitude, and takes the antenna pattern corresponding to the maximum first received signal strength indication as the antenna pattern corresponding to the first orientation, thereby obtaining the first mapping relationship.

[0261] The first orientation can be any orientation among all orientations, and each antenna pattern is an antenna pattern in the second test device. That is to say, in the first attitude, the second test device traverses and obtains the first received signal strength indication from the first test device corresponding to each antenna pattern in the first orientation. Since different antenna patterns have different pointing directions of antenna beams, the maximum first received signal strength indication indicates that the communication quality between the second test device and the first test device is the best, and it can also indicate that the antenna beam of the second test device is aligned with the first test device. Therefore, the second test device can take the antenna pattern corresponding to the maximum first received signal strength indication as the antenna pattern corresponding to the first orientation. In this way, the second test device can obtain the antenna patterns corresponding to the maximum first received signal strength indication in each orientation under different attitudes, and thus can obtain the first mapping relationship as shown in Table 1 and Table 2 above. It should be understood that the received signal strength indication EIRP is a comprehensive representation of antenna efficiency and gain. The stronger the EIRP of a certain antenna pattern, the greater the antenna radiation intensity in that antenna pattern, that is, the antenna beam direction in that antenna pattern is towards the first orientation.

[0262] In one embodiment, the first mapping relationship may include: the antenna patterns corresponding to each relative orientation in the attitude of the second device, and the antenna polarization modes corresponding to each antenna pattern. Therefore, the above S1503 can be replaced by S1504 and S1505.

[0263] S1504. The second test device obtains the first received signal strength indication from the first test device corresponding to each antenna pattern in the first orientation in the first attitude, and takes the antenna pattern corresponding to the maximum first received signal strength indication as the antenna pattern corresponding to the first orientation.

[0264] S1504 can refer to the relevant description of the above S1503. Different from the first mapping relationship obtained above, the first mapping relationship in this embodiment may include: the antenna polarization modes corresponding to each antenna pattern. Therefore, it is necessary to obtain the antenna polarization modes in each antenna pattern.

[0265] S1505, under the antenna mode corresponding to the maximum first received signal strength indication, traverse and switch the antenna polarization mode, obtain the second received signal strength indication corresponding to each antenna polarization mode, and use the antenna polarization mode corresponding to the maximum second received signal strength indication as the antenna polarization mode corresponding to the "antenna mode corresponding to the maximum first received signal strength indication".

[0266] In the embodiment of the present application, after the second test device obtains the maximum first received signal strength indication in the first azimuth, it can change the antenna polarization mode to obtain the second received signal strength indication corresponding to each antenna polarization mode in the pointing direction of the antenna beam. That is to say, after the second test device obtains the pointing direction of the best antenna beam in the first azimuth, it needs to obtain the best antenna polarization mode in the pointing direction of the best antenna beam. The second test device can use the antenna polarization mode corresponding to the maximum second received signal strength indication as the best antenna polarization mode corresponding to the pointing direction of the best antenna beam in the first azimuth, as shown in Table 3 and Table 4.

[0267] In one embodiment, the staff can also use other parameters to replace the received signal strength indication to obtain the first mapping relationship. Exemplarily, the other parameter can be: the gain pattern of the antenna. The gain pattern of the antenna is used to characterize the gain of the antenna at each angle. By comparing the gains of different antenna modes at a fixed angle, the antenna mode with the maximum gain can be selected as the antenna mode corresponding to this angle.

[0268] In the embodiment of the present application, the first mapping relationship and the second mapping relationship can be obtained through pre-testing or simulation, and then the first mapping relationship can be stored in the second device in advance, and the second mapping relationship can be stored in the first device in advance, so that the first device and the second device can execute the above-mentioned Figure 6 、 Figure 9A 、 Figure 9B and Figure 11 shown technical solutions, so as to achieve the purpose of improving the communication quality between the first device and the second device.

[0269] Figure 16 This is a schematic structural diagram of an antenna switching device provided by an embodiment of the present application. As Figure 16 shown, the antenna switching device can be the first device in the above embodiment, or a module of the first device. For example, it can be a chip of the first device. The antenna switching device can include: a positioning module 1601 and an antenna module 1602. In one embodiment, the positioning module 1601 can be Figure 13 the active positioning system of the first device in Figure 13The functions of the smart antenna trigger, the attitude detection system, and the mode storage and operation system in the first device in

[0270] A positioning module 1601, configured to obtain a first relative orientation, where the first relative orientation includes: the orientation of a second device relative to the first device.

[0271] An antenna module 1602, configured to communicate with the second device using a second target antenna mode based on the first relative orientation, the attitude of the first device, and a second mapping relationship. In the second target antenna mode, the antenna beam of the first device is aligned with the second device. The antenna mode of the first device is a first target antenna mode. In the first target antenna mode, the antenna beam of the second device is aligned with the first device. The second mapping relationship includes: for each relative orientation corresponding to at least one attitude of the first device, the corresponding antenna mode.

[0272] In a possible implementation, the antenna module 1602 is further configured to receive antenna polarization information from the second device, where the antenna polarization information is used to indicate the first antenna polarization mode of the second device in the first target antenna mode.

[0273] The antenna module 1602 is further configured to adjust the antenna polarization mode of the first device based on the first antenna polarization mode, so that the antenna polarizations of the first device and the second device are matched after the adjustment of the antenna polarization mode.

[0274] In a possible implementation, the antenna module 1602 is specifically configured to adjust the antenna polarization mode of the first device to be the same as the first antenna polarization mode.

[0275] In a possible implementation, the second mapping relationship further includes: the antenna polarization mode corresponding to each antenna mode of the first device. The antenna module 1602 is specifically configured to communicate with the second device using a second target antenna mode based on the first relative orientation, the attitude of the first device, the first antenna polarization mode, and the second mapping relationship. In the second target antenna mode, the antenna beam of the first device is aligned with the second device, and the antenna polarization mode of the first device is the same as the first antenna polarization mode.

[0276] In a possible implementation, the antenna module 1602 is further configured to use, in the second mapping relationship, the antenna mode corresponding to the first relative orientation and the attitude of the first device as the second target antenna mode.

[0277] In a possible implementation, the antenna module 1602 is specifically configured to, if the first relative orientation is not included in the second mapping relationship, obtain a first target relative orientation closest to the first relative orientation in the second mapping relationship; and use, in the second mapping relationship, the antenna mode corresponding to the first target relative orientation and the attitude of the first device as the second target antenna mode.

[0278] In a possible implementation, the first relative orientation includes: an angle theta in the elevation plane and an angle phi in the azimuth plane. The antenna module 1602 is specifically configured to, if the second mapping relationship includes the angle theta but does not include the angle phi, use the phi angle with the smallest difference from the phi angle in the second mapping relationship and the theta angle as the first target relative orientation; if the second mapping relationship includes the angle phi but does not include the angle theta, use the theta angle with the smallest difference from the theta angle in the second mapping relationship and the phi angle as the first target relative orientation; if the second mapping relationship does not include the angle theta and the angle phi, use the theta angle with the smallest difference from the theta angle and the phi angle with the smallest difference from the phi angle in the second mapping relationship as the first target relative orientation.

[0279] In a possible implementation, the antenna module 1602 is further configured to, if the second mapping relationship does not include the attitude of the first device, obtain the antenna patterns corresponding to each relative orientation in the attitude of the first device based on the existing attitudes in the second mapping relationship; and use the antenna pattern corresponding to the first relative orientation in the attitude of the first device as the second target antenna pattern.

[0280] In a possible implementation, the antenna module 1602 is specifically configured to obtain the rotation information of the attitude of the first device relative to the existing attitude; and obtain the antenna patterns corresponding to each relative orientation in the attitude of the first device based on the antenna patterns corresponding to each relative orientation in the existing attitude and the rotation information.

[0281] In a possible implementation, the positioning module 1601 is further configured to detect whether the second device has a positioning function;

[0282] The antenna module 1602 is specifically configured to obtain the first relative orientation if it is determined that the second device has a positioning function.

[0283] In a possible implementation, the positioning module 1601 is specifically configured to send a positioning request to the second device, and determine that the second device has a positioning function if a positioning response from the second device based on the positioning request is received.

[0284] In a possible implementation, the positioning module 1601 is specifically configured to locate the second device to obtain the first relative orientation.

[0285] In a possible implementation, the antenna module 1602 is further configured to send a second relative orientation to the second device based on the first relative orientation, where the second relative orientation is: the orientation of the first device relative to the second device.

[0286] In a possible implementation, the antenna module 1602 is further configured to determine that the second device has an attitude detection function.

[0287] In a possible implementation, the antenna module 1602 is further configured to receive a message indicating successful attitude detection from the second device, and determine that the second device has an attitude detection function.

[0288] In a possible implementation, the positioning module 1601 is specifically configured to receive a first relative orientation from a third device.

[0289] In a possible implementation, the positioning module 1601 is specifically configured to periodically obtain the first relative orientation; or, in response to detecting that the communication quality between the first device and the second device is lower than a preset communication quality, obtain the first relative orientation; or, in response to the first device being in a preset scenario, obtain the first relative orientation.

[0290] In a possible implementation, the antenna module 1602 is further configured to, in response to the first device not having a positioning function and / or an attitude detection function, and / or the second device not having a positioning function and / or an attitude detection function, when the second device is in the first antenna mode, traverse the antenna modes of the first device, and obtain the first communication quality between the first device and the second device in each antenna mode of the first device; when the second device is in the second antenna mode, traverse the antenna modes of the first device, and obtain the second communication quality between the first device and the second device in each antenna mode of the first device, where the second antenna mode is different from the first antenna mode; select the target communication quality with the best quality from the first communication quality and the second communication quality; communicate with the second device using the second target antenna mode, where the antenna mode of the first device is the first target antenna mode, the first target antenna mode is the antenna mode of the second device corresponding to the target communication quality, and the second target antenna mode is the antenna mode of the first device corresponding to the target communication quality.

[0291] In a possible implementation, the antenna module 1602 is further configured to send a first message to the second device, where the first message is used to instruct the second device to switch to the first antenna mode; send a second message to the second device, where the second message is used to instruct the second device to switch to the second antenna mode.

[0292] Figure 17 Another structural schematic diagram of the antenna switching device provided by the embodiments of the present application. As Figure 17 shown, the antenna switching device may be the second device in the above embodiments, or a module of the second device. For example, it may be a chip of the second device. The antenna switching device may include: a positioning module 1701 and an antenna module 1702. In one embodiment, the positioning module 1701 may be the above Figure 13In the passive positioning system of the second device, the antenna module 1702 can be integrated Figure 13 with the attitude detection system and the function of the mode storage and operation system in the second device.

[0293] A positioning module 1701, configured to obtain a second relative orientation, where the second relative orientation is: the orientation of the first device relative to the second device.

[0294] An antenna module 1702, configured to communicate with the first device using a first target antenna mode based on the second relative orientation, the attitude of the second device, and a first mapping relationship. In the first target antenna mode, the antenna beam of the second device aligns with the first device. The antenna mode of the second device is a second target antenna mode. In the second target antenna mode, the antenna beam of the first device aligns with the second device. The first mapping relationship includes: for at least one attitude of the second device, the antenna modes corresponding to each relative orientation.

[0295] In a possible implementation, the first mapping relationship further includes: the antenna polarization mode corresponding to each antenna mode of the second device, and the antenna polarization mode of the first target antenna mode is a first antenna polarization mode. The antenna module 1702 is further configured to send the antenna polarization information of the second device to the first device. The antenna polarization information is used to indicate the first antenna polarization mode, and the antenna polarization information is used to instruct the first device to adjust the antenna polarization mode of the first device, so that the antenna polarizations of the first device and the second device are matched after the adjustment.

[0296] In a possible implementation, the antenna module 1702 is specifically configured to use, in the first mapping relationship, the antenna mode corresponding to the second relative orientation and the attitude of the second device as the first target antenna mode.

[0297] In a possible implementation, the antenna module 1702 is specifically configured to, if the second relative orientation is not included in the first mapping relationship, obtain a second target relative orientation that is closest to the second relative orientation in the first mapping relationship; and use, in the first mapping relationship, the antenna mode corresponding to the second target relative orientation and the attitude of the second device as the first target antenna mode.

[0298] In a possible implementation, the second relative orientation includes: an angle theta in the elevation plane and an angle phi in the azimuth plane. The antenna module 1702 is specifically configured to, if the first mapping relationship includes the angle theta but does not include the angle phi, use the phi angle with the smallest difference from the phi angle in the first mapping relationship and the theta angle as the second target relative orientation; if the first mapping relationship includes the angle phi but does not include the angle theta, use the theta angle with the smallest difference from the theta angle in the first mapping relationship and the phi angle as the second target relative orientation; if the first mapping relationship does not include the angle theta and the angle phi, use the theta angle with the smallest difference from the theta angle and the phi angle with the smallest difference from the phi angle in the first mapping relationship as the second target relative orientation.

[0299] In a possible implementation, the antenna module 1702 is specifically configured to, if the first mapping relationship does not include the attitude of the second device, obtain the antenna patterns corresponding to each relative orientation in the attitude of the second device based on the existing attitudes in the first mapping relationship; use the antenna pattern corresponding to the second relative orientation in the attitude of the second device as the first target antenna pattern.

[0300] In a possible implementation, the antenna module 1702 is specifically configured to obtain the rotation information of the attitude of the second device relative to the existing attitude; obtain the antenna patterns corresponding to each relative orientation in the attitude of the second device based on the antenna patterns corresponding to each relative orientation in the existing attitude and the rotation information.

[0301] In a possible implementation, the positioning module 1701 is specifically configured to receive the second relative orientation from the first device.

[0302] In a possible implementation, the positioning module 1701 is further configured to receive a positioning request from the first device; send a positioning response to the first device based on the positioning request, where the positioning response indicates that the second device has a positioning function.

[0303] In a possible implementation, the antenna module 1702 is further configured to send a message indicating successful attitude detection to the first device, where the message indicating successful attitude detection indicates that the second device has an attitude detection function.

[0304] In a possible implementation, the positioning module 1701 is further configured to receive the second relative orientation from the third device.

[0305] In a possible implementation, the antenna module 1702 is further configured to receive a first message from the first device and switch to the first antenna mode; receive a second message from the first device and switch to the second antenna mode, where the second antenna mode is different from the first antenna mode.

[0306] The antenna switching device provided by the embodiments of the present application has a similar implementation principle and technical effect, which will not be elaborated here.

[0307] It should be noted that it should be understood that the above modules can be implemented in the form of software called by processing elements; they can also be implemented in the form of hardware. For example, the acquisition module can be a separately established processing element, or can be integrated in a certain chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and the function of the above processing module can be called and executed by a certain processing element of the above device. In addition, all or part of these modules can be integrated together or can be independently implemented. The processing element mentioned here can be an integrated circuit with signal processing capabilities. During the implementation process, each step of the above method or each of the above modules can be completed by the integrated logic circuit in the processor element in hardware or the instructions in software form.

[0308] For example, the above modules can be one or more integrated circuits configured to implement the above method, such as: one or more application specific integrated circuits (ASICs), or, one or more digital signal processors (DSPs), or, one or more field programmable gate arrays (FPGAs), etc. Again, when a certain module above is implemented in the form of a processing element scheduling program code, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program code. Again, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0309] Figure 18 It is a schematic structural diagram of an electronic device provided by the embodiments of the present application. As Figure 18As shown, the electronic device may be the first device, the second device, or the third device in the above embodiments. The electronic device may include: a processor 31 (e.g., a CPU), a memory 32, a receiver 33, and a transmitter 34; both the receiver 33 and the transmitter 34 are coupled to the processor 31, and the processor 31 controls the receiver 33 to perform a receiving action and the processor 31 controls the transmitter 34 to perform a transmitting action; the memory 32 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk memory. Various instructions may be stored in the memory 32 to complete various processing functions and implement the method steps of the present application. Optionally, the electronic device involved in the present application may further include: a power supply 35, a communication bus 36, and a communication port 37. The receiver 33 and the transmitter 34 may be integrated in a transceiver of the electronic device, or may be independent transceiver antennas on the electronic device. The communication bus 36 is used to implement communication connections between components. The above communication port 37 is used to implement connection communication between the electronic device and other peripherals.

[0310] In an embodiment of the present application, the above memory 32 is used to store computer-executable program code, and the program code includes instructions; when the processor 31 executes the instructions, the instructions cause the processor 31 of the electronic device to perform the processing actions of the electronic device in the above method embodiment, cause the receiver 33 to perform the receiving actions of the electronic device in the above method embodiment, and cause the transmitter 34 to perform the transmitting actions of the electronic device in the above method embodiment. The implementation principle and technical effects are similar and will not be elaborated here.

[0311] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).

[0312] The term "plurality" in this document refers to two or more. The term "and / or" in this document merely describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally represents an "or" relationship between the associated objects before and after; in a formula, the character " / " represents a "division" relationship between the associated objects before and after.

[0313] It can be understood that the various numerical numbers involved in the embodiments of the present application are only for the convenience of description and are not used to limit the scope of the embodiments of the present application.

[0314] It can be understood that in the embodiments of the present application, the magnitudes of the sequence numbers of the above processes do not mean the order of execution, and the order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

Claims

1. An antenna switching method, characterized in that, applied to a first device, the method includes: acquiring a first relative orientation, where the first relative orientation includes: the orientation of a second device relative to the first device; communicating with the second device using a second target antenna pattern based on the first relative orientation, the attitude of the first device, and a second mapping relationship, where in the second target antenna pattern, the antenna beam of the first device aligns with the second device, the antenna pattern of the second device is a first target antenna pattern, and in the first target antenna pattern, the antenna beam of the second device aligns with the first device, and the second mapping relationship includes: for at least one attitude of the first device, the antenna patterns corresponding to each relative orientation, and the antenna pattern refers to the pointing direction of the antenna beam and / or the antenna polarization method; before communicating with the second device using the second target antenna pattern, it further includes: receiving antenna polarization information from the second device, where the antenna polarization information is used to indicate the first antenna polarization method of the second device in the first target antenna pattern; the method further includes: adjusting the antenna polarization method of the first device based on the first antenna polarization method, so that the antenna polarizations of the first device after adjusting the antenna polarization method and the second device are matched.

2. The method according to claim 1, characterized in that, the adjusting the antenna polarization method of the first device based on the first antenna polarization method includes: adjusting the antenna polarization method of the first device to be the same as the first antenna polarization method.

3. The method according to claim 1, characterized in that, the second mapping relationship further includes: the antenna polarization methods corresponding to each antenna pattern of the first device, and the adjusting the antenna polarization method of the first device based on the first antenna polarization method includes: communicating with the second device using the second target antenna pattern based on the first relative orientation, the attitude of the first device, the first antenna polarization method, and the second mapping relationship, where in the second target antenna pattern, the antenna beam of the first device aligns with the second device, and the antenna polarization method of the first device is the same as the first antenna polarization method.

4. The method according to any one of claims 1-3, characterized in that, the method further includes: in the second mapping relationship, using the antenna pattern corresponding to the first relative orientation and the attitude of the first device as the second target antenna pattern.

5. The method according to claim 4, characterized in that, the method further includes: if the first relative orientation is not included in the second mapping relationship, then acquiring a first target relative orientation closest to the first relative orientation in the second mapping relationship; in the second mapping relationship, using the antenna pattern corresponding to the first target relative orientation and the attitude of the first device as the second target antenna pattern.

6. The method according to claim 5, characterized in that, The first relative orientation includes: an angle theta in the pitch plane and an angle phi in the azimuth plane; obtaining the first target relative orientation closest to the first relative orientation in the second mapping relationship includes: If the second mapping relationship includes the theta angle but does not include the phi angle, then the phi angle with the smallest difference from the phi angle in the second mapping relationship and the theta angle are used as the first target relative orientation; If the second mapping relationship includes the phi angle but does not include the theta angle, then the theta angle with the smallest difference from the theta angle in the second mapping relationship and the phi angle are used as the first target relative orientation; If the second mapping relationship does not include the theta angle and the phi angle, then the theta angle with the smallest difference from the theta angle and the phi angle with the smallest difference from the phi angle in the second mapping relationship are used as the first target relative orientation.

7. The method according to any one of claims 1-3, 5-6, wherein, the method further includes: If the second mapping relationship does not include the attitude of the first device, then based on the attitudes existing in the second mapping relationship, obtain the antenna patterns corresponding to each relative orientation in the attitude of the first device; Take the antenna pattern corresponding to the first relative orientation in the attitude of the first device as the second target antenna pattern.

8. The method according to claim 7, wherein, The obtaining the antenna patterns corresponding to each relative orientation in the attitude of the first device based on the attitudes existing in the second mapping relationship includes: Obtain the rotation information of the attitude of the first device compared to the existing attitude; Based on the antenna patterns corresponding to each relative orientation in the existing attitude and the rotation information, obtain the antenna patterns corresponding to each relative orientation in the attitude of the first device.

9. The method according to any one of claims 1-3, 5-6, 8, wherein, Before obtaining the first relative orientation, it further includes: Detect whether the second device has a positioning function; The obtaining the first relative orientation includes: If it is determined that the second device has a positioning function, then obtain the first relative orientation.

10. The method according to claim 9, wherein, The detecting whether the second device has a positioning function includes: Send a positioning request to the second device; If a positioning response from the second device based on the positioning request is received, then determine that the second device has a positioning function.

11. The method according to any one of claims 1-3, 5-6, 8, 10, wherein, The obtaining the first relative orientation includes: Locate the second device to obtain the first relative orientation.

12. The method according to any one of claims 1-3, 5-6, 8, 10, wherein, After obtaining the first relative orientation, it further includes: Based on the first relative orientation, send the second relative orientation to the second device, where the second relative orientation is: the orientation of the first device relative to the second device.

13. The method according to claim 12, wherein, before sending the second relative orientation to the second device, further comprising: determining that the second device has an attitude detection function.

14. The method according to claim 13, wherein, the determining that the second device has an attitude detection function includes: receiving a message indicating successful attitude detection from the second device.

15. The method according to any one of claims 1-3, 5-6, 8, 10, wherein, the obtaining the first relative orientation includes: receiving the first relative orientation from a third device.

16. The method according to any one of claims 1-3, 5-6, 8, 10, 13-14, wherein, the obtaining the first relative orientation includes: periodically obtaining the first relative orientation; or, in response to detecting that the communication quality between the first device and the second device is lower than a preset communication quality, obtaining the first relative orientation; or, in response to the first device being in a preset scenario, obtaining the first relative orientation.

17. The method according to any one of claims 1-3, 5-6, 8, 10, 13-14, wherein, the method further comprises: in response to the first device not having a positioning function and / or an attitude detection function, and / or, the second device not having a positioning function and / or an attitude detection function, when the second device is in the first antenna mode, traversing each antenna mode of the first device, and obtaining the first communication quality between the first device and the second device in each antenna mode of the first device; when the second device is in the second antenna mode, traversing each antenna mode of the first device, and obtaining the second communication quality between the first device and the second device in each antenna mode of the first device, where the second antenna mode is different from the first antenna mode; selecting the target communication quality with the best quality from the first communication quality and the second communication quality; communicating with the second device using the second target antenna mode, where the antenna mode of the first device is the first target antenna mode, the first target antenna mode is the antenna mode of the second device corresponding to the target communication quality, and the second target antenna mode is the antenna mode of the first device corresponding to the target communication quality.

18. The method according to claim 17, wherein, before traversing each antenna mode of the first device when the second device is in the first antenna mode, further comprising: sending a first message to the second device, where the first message is used to instruct the second device to switch to the first antenna mode; before traversing each antenna mode of the first device when the second device is in the second antenna mode, further comprising: Send a second message to the second device, where the second message is used to instruct the second device to switch to the second antenna mode.

19. An antenna switching method, characterized in that, applied to a second device, the method includes: Obtain a second relative orientation, where the second relative orientation is: the orientation of a first device relative to the second device; Based on the second relative orientation, the attitude of the second device, and a first mapping relationship, communicate with the first device using a first target antenna mode, where in the first target antenna mode, the antenna beam of the second device aligns with the first device, the antenna mode of the first device is a second target antenna mode, and in the second target antenna mode, the antenna beam of the first device aligns with the second device. The first mapping relationship includes: the antenna modes corresponding to each relative orientation in at least one attitude of the second device, and the antenna mode refers to the pointing direction of the antenna beam and / or the antenna polarization method; The antenna polarization method of the first target antenna mode is a first antenna polarization method. After communicating with the first device using the first target antenna mode, the method further includes: Send the antenna polarization information of the second device to the first device, where the antenna polarization information is used to indicate the first antenna polarization method, and the antenna polarization information is used to instruct the first device to adjust the antenna polarization method of the first device, so that the antenna polarizations of the first device and the second device are matched after the antenna polarization method is adjusted.

20. The method according to claim 19, characterized in that, the method further includes: In the first mapping relationship, use the antenna mode corresponding to the second relative orientation and the attitude of the second device as the first target antenna mode.

21. The method according to claim 19, characterized in that, the method further includes: If the second relative orientation is not included in the first mapping relationship, obtain a second target relative orientation closest to the second relative orientation in the first mapping relationship; In the first mapping relationship, use the antenna mode corresponding to the second target relative orientation and the attitude of the second device as the first target antenna mode.

22. The method according to claim 21, characterized in that, the second relative orientation includes: an angle theta in the elevation plane and an angle phi in the azimuth plane; obtaining a second target relative orientation closest to the second relative orientation in the first mapping relationship includes: If the first mapping relationship includes the angle theta but does not include the angle phi, use the phi angle with the smallest difference from the phi angle in the first mapping relationship and the angle theta as the second target relative orientation; If the first mapping relationship includes the angle phi but does not include the angle theta, use the theta angle with the smallest difference from the theta angle in the first mapping relationship and the angle phi as the second target relative orientation; If the theta angle and the phi angle are not included in the first mapping relationship, then use the theta angle with the smallest difference from the theta angle in the first mapping relationship and the phi angle with the smallest difference from the phi angle as the second target relative orientation.

23. The method according to any one of claims 19 - 22, wherein, the method further comprises: if the attitude of the second device is not included in the first mapping relationship, then based on the existing attitudes in the first mapping relationship, obtain the antenna patterns corresponding to each relative orientation in the attitude of the second device; Use the antenna pattern corresponding to the second relative orientation in the attitude of the second device as the first target antenna pattern.

24. The method according to claim 23, wherein, the obtaining the antenna patterns corresponding to each relative orientation in the attitude of the second device based on the existing attitudes in the first mapping relationship includes: Obtain the rotation information of the attitude of the second device compared to the existing attitude; Based on the antenna patterns corresponding to each relative orientation in the existing attitude and the rotation information, obtain the antenna patterns corresponding to each relative orientation in the attitude of the second device.

25. The method according to any one of claims 19 - 22, 24, wherein, the obtaining the second relative orientation includes: Receive the second relative orientation from the first device.

26. The method according to claim 25, wherein, before receiving the second relative orientation from the first device, further includes: Receive a positioning request from the first device; Based on the positioning request, send a positioning response to the first device, and the positioning response indicates that the second device has a positioning function.

27. The method according to claim 26, wherein, after receiving the second relative orientation from the first device, further includes: Send a message indicating successful attitude detection to the first device, and the message indicating successful attitude detection indicates that the second device has an attitude detection function.

28. The method according to any one of claims 19 - 22, 24, wherein, the obtaining the second relative orientation includes: Receive the second relative orientation from a third device.

29. The method according to any one of claims 19 - 22, 24, 26 - 27, wherein, the method further comprises: Receive a first message from the first device; Switch to the first antenna mode; Receive a second message from the first device; Switch to the second antenna mode, and the second antenna mode is different from the first antenna mode.

30. An antenna switching device, wherein, comprises: A positioning module for obtaining a first relative orientation, and the first relative orientation includes: the orientation of the second device relative to the first device; An antenna module, configured to communicate with a second device in a second target antenna pattern based on the first relative orientation, the attitude of the first device, and a second mapping relationship. In the second target antenna pattern, the antenna beam of the first device is aligned with the second device. The antenna pattern of the second device is a first target antenna pattern, in which the antenna beam of the second device is aligned with the first device. The second mapping relationship includes: for at least one attitude of the first device, the antenna patterns corresponding to respective relative orientations, where the antenna pattern refers to the pointing direction of the antenna beam and / or the antenna polarization mode; The antenna module is further configured to receive antenna polarization information from the second device, where the antenna polarization information is used to indicate the first antenna polarization mode of the second device in the first target antenna pattern; Based on the first antenna polarization mode, adjust the antenna polarization mode of the first device, so that the antenna polarizations of the first device and the second device after the adjustment are matched.

31. An antenna switching device, characterized in that, it includes: A positioning module, configured to obtain a second relative orientation, where the second relative orientation is the orientation of a first device relative to a second device; An antenna module, configured to communicate with the first device in a first target antenna pattern based on the second relative orientation, the attitude of the second device, and a first mapping relationship. In the first target antenna pattern, the antenna beam of the second device is aligned with the first device. The antenna pattern of the first device is a second target antenna pattern, in which the antenna beam of the first device is aligned with the second device. The first mapping relationship includes: for at least one attitude of the second device, the antenna patterns corresponding to respective relative orientations, where the antenna pattern refers to the pointing direction of the antenna beam and / or the antenna polarization mode; The antenna polarization mode of the first target antenna pattern is a first antenna polarization mode, and the antenna module is further configured to: Send the antenna polarization information of the second device to the first device, where the antenna polarization information is used to indicate the first antenna polarization mode, and the antenna polarization information is used to instruct the first device to adjust the antenna polarization mode of the first device, so that the antenna polarizations of the first device and the second device after the adjustment are matched.

32. An electronic device, characterized in that, it includes: A memory and a processor; The processor is configured to be coupled to the memory, read and execute instructions in the memory to implement the method according to any one of claims 1-29.

33. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1-29.

34. A computer program product, characterized in that, The computer program product stores computer instructions, and when the computer instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1-29.

Citation Information

Patent Citations

  • Communication connection method and mobile terminal

    CN107466108A