Antenna switching method, wireless network card, and antenna switching apparatus

By introducing antenna switching switches into wireless network cards, dynamically switching target antennas is solved, and the problems of increasing wireless network card costs and wireless network transmission stability are achieved, and efficient wireless signal coverage and anti-interference capability are improved.

WO2025001337A1PCT designated stage expired Publication Date: 2025-01-02HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/082825
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-27
Filing Date
2024-03-20
Publication Date
2025-01-02

AI Technical Summary

Technical Problem

When existing wireless network cards improve wireless signal coverage and anti-interference capabilities, the cost increases greatly, and the wireless network transmission throughput performance varies greatly when electronic devices are placed in different locations, making it difficult to ensure stable performance.

Method used

By introducing antenna switching switches into the wireless network card, dynamically switch the target antenna connected to the wireless communication module, selecting the appropriate antenna according to the signal reception strength, so that multiple antennas work together, and improving wireless signal coverage and anti-interference ability.

Benefits of technology

Without increasing the number of antenna interfaces, wireless communication performance is improved, production costs are reduced, wireless signal coverage and anti-interference capabilities are improved, while avoiding differences in wireless network transmission throughput performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024082825_02012025_PF_FP_ABST
    Figure CN2024082825_02012025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of communications. Provided are an antenna switching method, a wireless network card, and an antenna switching apparatus. The method is used for performing switching control on an antenna in a wireless network card. The wireless network card comprises a wireless communication module, an antenna switching switch and antennas, wherein the wireless communication module is provided with an antenna interface, which is configured to connect the antennas, and each antenna interface among at least one antenna interface is provided with the antenna switching switch, which is used for switching target antennas connected to the antenna interface. When a preset condition is met, the antenna switching switch is instructed to be connected to each antenna among a plurality of antennas, so as to acquire the signal receiving strength of the plurality of antennas. Then, a target antenna among the plurality of antennas can be accurately determined according to the signal receiving strength, and the switching switch is connected to the target antenna. In this way, an anti-interference capability and the communication performance of wireless communication can be improved without changing an antenna interface.
Need to check novelty before this filing date? Find Prior Art

Description

Antenna switching method, wireless network card and antenna switching device

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on June 27, 2023, with application number 202310762309.3 and invention name “An antenna switching method, wireless network card and antenna switching device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of communication technology, and in particular to an antenna switching method, a wireless network card, and an antenna switching device. Background Art

[0003] Some electronic devices achieve communication functions through one or more antennas configured in the wireless network card. As the number of antennas increases, the wireless network card's ability to receive and send wireless signals improves, and the reliability and anti-interference ability of the wireless network card will also be improved to a certain extent.

[0004] However, increasing the number of antennas also increases the cost of wireless network cards. Therefore, taking into account both cost and wireless signal transmission and reception capabilities, wireless network cards commonly used in devices such as laptops and desktop computers are generally equipped with two antennas. Since antennas have directional radiation gain and the coverage range of wireless signal transmission or reception by two antennas is limited, the different placement of electronic devices in the same location will lead to significant differences in the throughput performance of wireless network transmission. Currently, in order to ensure the stability of communication performance, wireless communication modules with more antenna interfaces are generally used, so that more antennas can be connected. However, the more antenna interfaces and antennas a wireless communication module has, the higher the cost.

[0005] Summary of the Invention

[0006] In view of this, the present application provides an antenna switching method, a wireless network card and an antenna switching device, which can switch the target antenna connected to the antenna interface of the wireless communication module through the antenna switching switch, thereby ensuring that multiple antennas can work together while ensuring a small cost increase, thereby improving the coverage of the wireless signal and enhancing the anti-interference ability of the wireless network card.

[0007] In a first aspect, the present application provides an antenna switching method, which is used to switch and control the antenna in a wireless network card. The wireless network card includes a wireless communication module, an antenna switching switch, and an antenna; the wireless communication module is provided with an antenna interface, and the antenna interface is used to connect the antenna; wherein each antenna interface of at least one antenna interface is provided with an antenna switching switch, and the antenna switching switch is used to switch the target antenna connected to the antenna interface. When the target application meets the preset conditions, the antenna switching switch is instructed to connect to multiple antennas respectively to obtain the signal reception strength of the multiple antennas. Afterwards, according to the signal reception strength, the target antenna among the multiple antennas is determined; and the antenna switching switch is connected to the target antenna.

[0008] In some examples, the wireless communication module is provided with at least one antenna interface.

[0009] In some examples, each of at least one antenna interface of the wireless communication module is provided with an antenna switching switch, which is connected to multiple antennas. The antenna switching switch can switch the antenna interface to connect to a target antenna, thereby allowing the wireless communication module to receive wireless signals through the target antenna.

[0010] In the above implementation, by providing an antenna switching switch in the wireless network card, the number of operable antennas is increased. The antenna switching switch is used to switch the target antenna connected to the antenna interface. This allows, when preset conditions are met, the wireless switching switch to be controlled to select a suitable antenna from the multiple antennas based on their signal strengths, enabling the multiple antennas to work collaboratively, effectively improving the communication performance of the electronic device. For example, if one of the multiple antennas is blocked from receiving or transmitting wireless signals, one of the remaining antennas that can normally receive and transmit wireless signals can be switched to connect to the wireless communication module, thereby improving the anti-interference capability of the wireless network card. In this way, without changing the antenna interface, or on the basis of a smaller number of antenna interfaces in the wireless communication module included in the wireless network card, a communication effect similar to that of increasing the number of antenna interfaces can be achieved, thereby improving the communication performance of the wireless network card while ensuring a minimal increase in cost.

[0011] In one possible implementation of the first aspect, the multiple antennas include a first antenna and a second antenna. When determining a target antenna among the multiple antennas based on received signal strength, the relationship between the first signal received strength of the first antenna and the second signal received strength of the second antenna can be first determined. If the first signal received strength is greater than the second signal received strength, the first antenna can be determined as the target antenna; if the first signal received strength is less than the second signal received strength, the second antenna can be determined as the target antenna.

[0012] In some examples, the difference between the first and second signal reception strengths can be calculated to compare the strengths of the two signals. If the difference is greater than 0, the first signal reception strength is stronger, and the first antenna can be determined to be the target antenna. If the difference is less than 0, the second signal reception strength is stronger, and the second antenna can be determined to be the target antenna.

[0013] In a possible implementation of the first aspect, the signal reception strengths of the first antenna and the second antenna may be obtained multiple times, and numerical comparisons may be performed based on the multiple sets of obtained signal reception strengths, and then the target antenna may be determined based on the comparison results. If the comparison result indicates that the first signal reception strength is multiple times greater than the second signal reception strength, the first antenna may be determined to be the target antenna. If the comparison result indicates that the first signal reception strength is multiple times less than the second signal reception strength, the second antenna may be determined to be the target antenna. In some examples, multiple differences are calculated based on each set of signal reception strengths, and in response to the difference being greater than 0 for the mth time, the first antenna is determined to be the target antenna, where m is a positive integer. In response to the difference being less than 0 for the mth time, the second antenna is determined to be the target antenna.

[0014] In the above implementation, by comparing the first signal reception strength with the second signal reception strength multiple times, an accurate comparison result can be obtained, and then the target antenna can be accurately determined.

[0015] In another possible implementation of the first aspect, the multiple antennas include a first antenna and a second antenna. When determining a target antenna among the multiple antennas based on received signal strength, the antenna currently connected to the antenna switching switch may be determined as the target antenna based on the absolute value of the difference between the first received signal strength of the first antenna and the second received signal strength of the second antenna. In some examples, if the absolute value of the difference between the first received signal strength and the second received signal strength is less than a first preset threshold, the antenna currently connected to the antenna switching switch is determined to be the target antenna, and the connection with the target antenna is maintained for a first preset duration.

[0016] In the above process, the absolute value of the difference can be used to determine the difference in signal reception capabilities between the two antennas. If the difference is not significant, the antenna with the higher signal strength can be considered to have better signal reception in the short term. However, the probability of the signal strength decreasing for that antenna is high. In this case, the antenna switch can be controlled to switch the connection to the target antenna for a short period of time, thereby improving wireless communication performance. If the difference is small, the antenna switch can be controlled to maintain the connection to the currently connected antenna for a short period of time. This way, wireless communication can be stabilized without switching antennas.

[0017] In a possible implementation of the first aspect, when controlling the antenna switching switch to connect to the target antenna, the freeze time of the antenna switching switch and whether the antenna switching switch needs to switch to the target antenna can also be determined based on the absolute value of the difference. In some examples, in response to the absolute value of the difference being greater than or equal to a second preset threshold, the antenna switching switch can be controlled to switch to the target antenna and maintain the connection with the target antenna for a second preset duration. In response to the absolute value of the difference being less than the second preset threshold and the absolute value of the difference being greater than or equal to the first preset threshold, the antenna switching switch can be controlled to switch to the target antenna and maintain the connection with the target antenna for a third preset duration. The second preset duration is greater than the third preset duration.

[0018] In the above implementation, the length of time the antenna switching switch remains connected to the target antenna after it is switched to the target antenna can be determined by measuring the difference between the first signal strength and the second signal strength. If the absolute value of the difference is greater than or equal to the second preset threshold, it means that the signal reception strength of the target antenna is much greater than the signal reception strength of the other antenna. In this case, the antenna switching switch can be controlled to maintain a longer connection time with the target antenna, thereby improving the stability of wireless communication of the wireless network card. If the absolute value of the difference is less than the second preset threshold, and the absolute value of the difference is greater than or equal to the first preset threshold, it means that the signal reception strength of the target antenna is greater than the signal reception strength of the other antenna, but the difference is not significant. In this case, the antenna switching switch can be controlled to maintain a shorter connection time with the target antenna, thereby timely determining whether antenna switching is required to ensure high wireless communication performance of the wireless network card.

[0019] In one possible implementation of the first aspect, the wireless communication module is configured to measure and output the received signal strength of an antenna connected to the antenna switch. The wireless communication module can be instructed to measure the received signal strength of the antenna connected to the antenna switch, thereby enabling measurement of the received signal strength for each antenna connected to the antenna switch.

[0020] In some examples, chip firmware can be configured in the wireless communication module to enable the module to measure the received signal strength of each antenna. For example, a program for measuring the received signal strength of each antenna can be burned into the wireless communication module to enable the module to measure and output the received signal strength of each antenna.

[0021] In the above implementation, the wireless communication module in the wireless network card can directly and accurately measure the signal reception strength of each antenna, thereby improving the accuracy and efficiency of the antenna signal reception strength measurement, and then the antenna switching switch can be accurately and quickly controlled based on the measurement results.

[0022] In a possible implementation of the first aspect, when instructing a wireless communication module in the wireless network card to measure the signal reception strength of an antenna connected to the antenna switch, the wireless communication module may be instructed to measure the signal reception strength of the antenna connected to the antenna switch within a fourth preset time period. The signal reception strength measured within the fourth preset time period is stable, thereby ensuring accurate measurement of the antenna signal reception strength.

[0023] In a possible implementation of the first aspect, the preset conditions include one or more of the target application being in a stuck state, the target application having a network delay greater than a preset delay threshold, and the target application being in a startup state.

[0024] In another possible implementation of the first aspect, the antenna switching method is applied to a controller connected to a wireless network card. The controller can control switching of an antenna switch based on the signal reception strength of multiple antennas; the controller includes a wireless transmit antenna selection (WiTAS) module. In the antenna switching method, the WiTAS module in a first state can determine whether a current situation meets a preset condition. In response to the current situation meeting the preset condition, the WiTAS module transitions from the first state to a second state. The WiTAS module in the second state determines whether the current situation meets the preset condition and instructs the antenna switch to connect to each of the multiple antennas to obtain the signal reception strength of the multiple antennas. Subsequently, the WiTAS module in the second state can determine a target antenna among the multiple antennas based on the signal reception strength. In response to the current situation meeting the preset condition and the target antenna being determined, the WiTAS module transitions from the second state to a third state, and the WiTAS module in the third state connects the antenna switch to the target antenna.

[0025] In some examples, the controller used in the antenna switching method may be a central processing unit or an electronic device.

[0026] In the above implementation process, the controller includes a wireless transmitting antenna selection WiTAS module. The controller can determine whether the current situation meets the preset conditions through the WiTAS module in the first state. For example, if the WiTAS module in the first state determines that the current situation meets the preset conditions, the controller controls the WiTAS module to change from the first state to the second state. The WiTAS module in the second state determines whether the current situation meets the preset conditions, and instructs the antenna switching switch to connect to multiple antennas respectively, obtains the signal reception strength of the multiple antennas, and determines the target antenna among the multiple antennas based on the signal reception strength. If the WiTAS module in the second state determines that the current situation meets the preset conditions and determines the target antenna, the controller controls the WiTAS module to change from the second state to the third state. The controller connects the antenna switching switch to the target antenna through the WiTAS module in the third state.

[0027] In a possible implementation of the first aspect, if the WiTAS module in the second state determines that the current situation does not meet the preset condition, the WiTAS module is controlled to transition from the second state to the first state.

[0028] In one possible implementation of the first aspect, after the controller connects the antenna switch to the target antenna via the WiTAS module in the third state, the controller determines, via the WiTAS module in the third state, whether a current situation satisfies a preset condition. If the WiTAS module in the third state determines that the current situation satisfies the preset condition, the controller controls the WiTAS module to transition from the third state to the second state.

[0029] In one possible implementation of the first aspect, after the controller connects the antenna switch to the target antenna via the WiTAS module in the third state, the controller determines, via the WiTAS module in the third state, whether a current situation satisfies a preset condition. If the WiTAS module in the third state cannot determine whether the current situation satisfies the preset condition, the controller controls the WiTAS module to transition from the third state to the first state.

[0030] In one possible implementation of the first aspect, after the controller connects the antenna switch to the target antenna via the WiTAS module in the third state, the controller determines, via the WiTAS module in the third state, whether a current situation satisfies a preset condition. If the WiTAS module in the third state determines that the current situation does not satisfy the preset condition, the controller controls the WiTAS module to remain in the third state.

[0031] In a second aspect, the present application provides a wireless network card comprising a wireless communication module, an antenna switching switch, and an antenna. The wireless communication module of the wireless network card is provided with an antenna interface for connecting to an antenna. Each of the at least one antenna interface is provided with an antenna switching switch for switching the target antenna connected to the antenna interface. The target antenna is determined based on the signal reception strength of all antennas connected to the antenna switching switch.

[0032] In the above implementation, the number of working antennas is increased by setting an antenna switching switch in the wireless network card. After determining the target antenna based on the signal reception strength of each antenna, the antenna switching switch can be used to switch the target antenna connected to the antenna interface to achieve the switching of the working antenna, so that multiple antennas can work together. In the case that one of the multiple antennas is blocked from receiving and transmitting wireless signals, one of the remaining antennas that can normally receive and transmit wireless signals can be switched to connect to the wireless communication module, thereby improving the anti-interference ability of the wireless network card. In this way, a communication effect similar to that of increasing the number of antenna interfaces can be achieved without changing the number of antenna interfaces, thereby improving the communication performance of the wireless network card and ensuring a small increase in cost.

[0033] In a possible implementation of the second aspect, the wireless communication module is used to measure and output the signal reception strength of each antenna connected to the antenna switching switch.

[0034] In the above implementation, the wireless communication module in the wireless network card can directly and accurately measure the signal reception strength of each antenna, thereby improving the accuracy and efficiency of the antenna signal reception strength measurement, and then the antenna switching switch can be accurately and quickly controlled based on the measurement results.

[0035] In a possible implementation manner of the second aspect, the radiation type of the antenna is a directional antenna or an omnidirectional antenna, and the radiation type of the antenna can be selected based on different requirements.

[0036] In a third aspect, the present application provides a wireless network card, comprising a wireless communication module, an antenna switching switch, and an antenna. The wireless communication module of the wireless network card is provided with an antenna interface for connecting to an antenna. Each of the at least one antenna interface is provided with an antenna switching switch for switching the target antenna connected to the antenna interface.

[0037] In a fourth aspect, the present application provides an antenna switching device, which is used to execute the method of the first aspect and any possible implementation thereof.

[0038] In a fifth aspect, the present application provides an antenna switching device, which includes a controller and a wireless network card as described in the second aspect and any possible implementation thereof.

[0039] In a sixth aspect, the present application provides an antenna switching device, which includes a controller and a wireless network card as a possible implementation method of the third aspect mentioned above.

[0040] In the seventh aspect, the present application provides an electronic device, which includes a processor and a memory, the memory and the processor are coupled, the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor reads the computer instructions from the memory, the electronic device executes the method as described in the first aspect and any possible design method thereof.

[0041] Among them, when the processor executes the computer instructions, the electronic device performs the following: when the preset conditions are met, instruct the antenna switching switch to connect to each of the multiple antennas respectively to obtain the signal reception strength of the multiple antennas; determine the target antenna among the multiple antennas based on the signal reception strength; and connect the antenna switching switch to the target antenna.

[0042] In a possible implementation of the seventh aspect, the multiple antennas include a first antenna and a second antenna. When the processor executes the computer instructions, the electronic device performs: determining the magnitude relationship between the first signal reception strength of the first antenna and the second signal reception strength of the second antenna; in response to the first signal reception strength being greater than the second signal reception strength, determining that the first antenna is the target antenna; in response to the first signal reception strength being less than the second signal reception strength, determining that the second antenna is the target antenna.

[0043] In a possible implementation of the seventh aspect, the multiple antennas include a first antenna and a second antenna. When the processor executes the computer instructions, the electronic device performs: in response to the absolute value of the difference between the first signal reception strength and the second signal reception strength being less than a first preset threshold, determining that the antenna currently connected to the antenna switching switch is the target antenna, and maintaining the connection with the target antenna within a first preset time period.

[0044] In a possible implementation of the seventh aspect, when the processor executes the computer instructions, the electronic device executes: connecting the antenna switching switch to the target antenna, including: in response to the absolute value of the difference between the first signal reception strength and the second signal reception strength being greater than or equal to the second preset threshold, controlling the antenna switching switch to switch to the target antenna and maintain the connection with the target antenna within the second preset time length; in response to the absolute value of the difference between the first signal reception strength and the second signal reception strength being less than the second preset threshold, and the absolute value of the difference being greater than or equal to the first preset threshold, controlling the antenna switching switch to switch to the target antenna and maintain the connection with the target antenna within a third preset time length, and the second preset time length is greater than the third preset time length.

[0045] In a possible implementation of the seventh aspect, the wireless communication module in the wireless network card is used to measure and output the signal reception strength of the antenna connected to the antenna switching switch.

[0046] In a possible implementation of the seventh aspect, the preset conditions include one or more of the target application's running state being stuck, the target application's network delay being greater than a preset delay threshold, and the target application being in a startup state.

[0047] In one possible implementation of the seventh aspect, the antenna switching method is applied to a controller connected to a wireless network card, the controller being configured to control switching of an antenna switch based on the signal reception strengths of multiple antennas; the controller including a wireless transmit antenna selection (WiTAS) module. When a processor executes computer instructions, the electronic device performs the following steps: determining, by the WiTAS module in a first state, whether a current situation satisfies a preset condition; in response to the current situation satisfying the preset condition, the WiTAS module transitioning from the first state to a second state; determining, by the WiTAS module in the second state, whether the current situation satisfies the preset condition, and instructing the antenna switch to connect to each of the multiple antennas to obtain the signal reception strengths of the multiple antennas; determining, by the WiTAS module in the second state, a target antenna among the multiple antennas based on the signal reception strengths; in response to the current situation satisfying the preset condition and the target antenna being determined, the WiTAS module transitioning from the second state to a third state, and connecting the antenna switch to the target antenna via the WiTAS module in the third state.

[0048] In an eighth aspect, the present application provides a computer-readable storage medium comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method of the first aspect and any possible implementation thereof.

[0049] In a ninth aspect, the present application provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute the method of the first aspect and any possible implementation thereof.

[0050] In a tenth aspect, the present application provides a device, which is included in an electronic device, and has the function of implementing the electronic device behavior in any of the methods in the seventh aspect and possible implementation methods. This function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes at least one module or unit corresponding to the above function. For example, a processing module or unit, a transceiver module or unit, and a storage module or unit, etc.

[0051] It can be understood that the electronic device of the seventh aspect and any possible design thereof provided above, the computer-readable storage medium of the eighth aspect, and the computer program product of the ninth aspect are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] FIG1 is a schematic diagram of an antenna coverage area provided in an embodiment of the present application;

[0053] FIG2 is a schematic diagram of an electronic device provided in an embodiment of the present application;

[0054] FIG3 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0055] FIG4 is a schematic structural diagram of a wireless network card provided in an embodiment of the present application;

[0056] FIG5 is a schematic diagram of the coverage range of an antenna of a wireless network card provided in an embodiment of the present application;

[0057] FIG6 is a schematic diagram of the coverage range of an antenna of another wireless network card provided in an embodiment of the present application;

[0058] FIG7 is a schematic structural diagram of another wireless network card provided in an embodiment of the present application;

[0059] FIG8 is a schematic structural diagram of another wireless network card provided in an embodiment of the present application;

[0060] FIG9 is a software structure block diagram of an electronic device provided in an embodiment of the present application;

[0061] FIG10 is a schematic diagram of a flow chart of an antenna switching method provided in an embodiment of the present application;

[0062] FIG11 is a schematic diagram of a connection between an electronic device and a wireless network card provided by an embodiment of the present application;

[0063] FIG12 is a schematic diagram of a WiTAS module provided in an embodiment of the present application;

[0064] FIG13 is a flowchart of an antenna switching method provided in an embodiment of the present application;

[0065] FIG14 is a schematic structural diagram of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0066] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0067] During the production process of electronic devices such as laptops and desktop computers, the motherboard and wireless network card are generally produced separately and then assembled. The motherboard is equipped with a central processing unit (CPU). A wireless network interface controller (WNIC) is a terminal wireless network device. For example, a wireless network card is a wireless communication module such as a WiFi module or Bluetooth module equipped with an antenna. Laptops, desktop computers, and other electronic devices can use wireless network connections, such as WiFi or Bluetooth, through wireless network cards.

[0068] In some examples, the WiFi module is provided with an antenna interface for connecting an antenna, which can be used to receive or transmit wireless signals. The wireless signals received by the antenna can be transmitted to the CPU via the WiFi module, and the CPU can also transmit wireless signals via the antenna on the WiFi module.

[0069] Antennas can be categorized according to different scenarios. For example, antennas can be divided into non-transmitting antennas, receiving antennas, and antennas for both transmission and reception based on their nature of operation. Based on their directivity, antennas can be categorized into omnidirectional and directional antennas. An omnidirectional antenna distributes both the transmitted and received signal energy more evenly within the same radiation plane, while a directional antenna concentrates both the transmitted and received signal energy in a specific direction. Therefore, given the same antenna transmit power or the same signal field, a directional antenna has a stronger ability to transmit and receive signals in the direction of the directional antenna's radiation than an omnidirectional antenna. This means that directional antennas can achieve wireless communication over longer distances in a specific direction and have stronger interference immunity. The position and direction in which electronic devices, such as laptops and desktop computers, receive wireless signals are uncertain. To ensure wireless communication performance, current laptop WiFi modules generally incorporate omnidirectional antennas.

[0070] For example, in actual use, because the laptop's antenna is located inside the laptop, its coverage may be blocked. This means that when using the laptop's internal antenna, there are issues with the directionality of the radiation gain, which can lead to significant differences in wireless signal transmission throughput performance when the laptop is placed at different angles in the same location.

[0071] In some embodiments, the number of antenna interfaces provided on the laptop's WiFi module is generally 1-3. Among them, WiFi modules with more than 3 antenna interfaces are uncommon and more expensive, and will not be discussed here for the time being. A WiFi module with one antenna interface can only connect to one antenna, so its communication capabilities are relatively weak. It is more common in early laptop products, but uncommon in products currently on the market. A WiFi module with two antenna interfaces can connect to two antennas, and a WiFi module with three antenna interfaces can connect to three antennas. Three antennas working simultaneously is equivalent to signal coverage in three layers compared to two antennas working simultaneously, so the coverage rate is higher and the anti-interference performance is stronger, thereby ensuring stronger communication performance. Figure 1 (a) shows the coverage range of two antennas of a WiFi module, and Figure 1 (b) shows the coverage range of three antennas of a WiFi module. It can be seen that the coverage range of three antennas is higher than the coverage rate of two antennas. Therefore, a laptop equipped with three antennas can receive and send wireless signals with stronger anti-interference capabilities, and thus better communication performance. For example, if one of the two antennas is affected by a nearby object, only one antenna can transmit wireless signals. If one of the three antennas is affected by a nearby object, two antennas can still transmit wireless signals. Therefore, a Wi-Fi module with three antenna ports has better transmission performance than one with two.

[0072] However, the cost of a WiFi module with three antenna interfaces is higher than that of a WiFi module with two antenna interfaces. Therefore, WiFi modules with two antenna interfaces are often configured in electronic devices such as laptops.

[0073] It can be seen from this that for electronic devices such as laptops and desktop computers, it is difficult to ensure that the performance of the product is improved while the price remains unchanged or increases slightly.

[0074] To this end, an embodiment of the present application provides an antenna switching method, in which an antenna switching switch is configured in a wireless network card of an electronic device. The wireless network card increases the number of connectable antennas through the antenna switching switch, thereby ensuring the signal coverage of the wireless network card. The method can also effectively improve the communication performance of the electronic device by controlling the wireless switching switch to select a suitable antenna under different circumstances. Through the wireless network card and antenna switching method provided by the embodiment of the present application, the wireless communication module included in the wireless network card can achieve the same communication effect as a wireless communication module with a large number of antenna interfaces on the basis of a small number of antenna interfaces, thereby ensuring that the communication effect is improved while the production cost does not increase or increases less.

[0075] The wireless communication module includes, for example, a WiFi module, a Bluetooth module, and the like.

[0076] In the above embodiments, the terms "fewer antenna interfaces" and "more antenna interfaces" are relative. For example, two antenna interfaces represent a smaller number of antenna interfaces than three, while three antenna interfaces represent a larger number of antenna interfaces than two. The present embodiments do not specifically limit the number of antenna interfaces in a WiFi module; in different application scenarios, a WiFi module may be configured with more or fewer antenna interfaces.

[0077] The wireless network card and antenna switching method provided in the embodiment of the present application can be applied to an electronic device 100. For example, as shown in FIG2 , the electronic device 100 can be a tablet computer 21, a smart screen 22, a laptop computer 23, a vehicle-mounted device, a desktop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), an artificial intelligence (AI) device, or other terminal device with wireless communication capabilities. The operating system installed on the electronic device 100 includes but is not limited to MAC The embodiment of the present application does not limit the specific type of the electronic device 100 or the installed operating system.

[0078] 3 shows a schematic structural diagram of an electronic device 100. The electronic device 100 may include a processor 310, an external memory interface 320, an internal memory 321, a universal serial bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, a wireless communication device 360, an audio module 370, a sensor module 380, a button 390, an indicator 392, a camera 393, and a display 394.

[0079] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0080] The processor 310 may include one or more processing units. For example, the processor 310 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0081] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0082] Processor 310 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 310 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 310. If processor 310 needs to use the same instruction or data again, it can directly retrieve it from the memory. This avoids duplicate accesses, reduces processor 310 latency, and thus improves system efficiency.

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

[0084] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 310 to the camera 393, display 394, wireless communication device 360, audio module 370, sensor module 380, and the like. In some embodiments, the processor 310 and wireless communication device 360 ​​communicate via the GPIO interface to implement antenna switching functionality for the electronic device 100.

[0085] The USB interface 330 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 330 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as AR devices.

[0086] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0087] The charging management module 340 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While charging the battery 342, the charging management module 340 can also power the electronic device through the power management module 341.

[0088] The power management module 341 is used to connect the battery 342, the charging management module 340, and the processor 310. The power management module 341 receives input from the battery 342 and / or the charging management module 340 and provides power to the processor 310, the internal memory 321, the external memory, the display 394, the camera 393, and the wireless communication device 360. In other embodiments, the power management module 341 may also be provided in the processor 310. In other embodiments, the power management module 341 and the charging management module 340 may also be provided in the same device.

[0089] As shown in FIG3 , the wireless communication function of the electronic device 100 can be implemented through the antenna 1 , the wireless communication device 360 ​​, a modem processor, and a baseband processor.

[0090] Antenna 1 is used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antenna can be used in conjunction with a tuning switch.

[0091] Electronic device 100 implements display functionality through a GPU, display screen 394, and an application processor. A GPU is a microprocessor for image processing that connects display screen 394 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 310 may include one or more GPUs that execute program instructions to generate or modify display information.

[0092] Display screen 394 is used to display images, videos, etc. Display screen 394 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N display screens 394, where N is a positive integer greater than 1.

[0093] The electronic device 100 can implement a shooting function through an ISP, a camera 393, a video codec, a GPU, a display screen 394, and an application processor.

[0094] The external memory interface 320 can be used to connect an external memory card, such as an SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 310 via the external memory interface 320 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0095] The internal memory 321 can be used to store computer executable program code, which includes instructions. The processor 310 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 321. In addition, the internal memory 321 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0096] Buttons 390 include a power button, a volume button, and the like. Buttons 390 may be mechanical buttons or touch buttons. Indicator 392 may be an indicator light that can be used to indicate charging status, battery level changes, messages, notifications, and the like.

[0097] The wireless communication device 360, such as a wireless network card, can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication device 360 ​​can be one or more devices integrating at least one communication processing module. The wireless communication device 360 ​​receives electromagnetic waves via the antenna 1, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 310. The wireless communication device 360 ​​can also receive the signal to be sent from the processor 310, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 1.

[0098] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the wireless communication device 360, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS) and / or satellite-based augmentation system (SBAS).

[0099] In some examples, the wireless communication device 360 ​​is configured with a wireless communication module, such as a WiFi module, a Bluetooth module, etc. The following description takes the WiFi module as an example. The WiFi module is configured with one or more antenna interfaces for connecting to antennas to implement the wireless communication function of the wireless communication device 360 ​​through the antennas. It should be understood that the antenna 1 shown in Figure 3 includes multiple antennas connected to the WiFi module in the wireless network card. For example, Figure 4 shows a structural schematic diagram of a wireless network card provided in an embodiment of the present application. As shown in Figure 4, the wireless network card includes a WiFi module, and Figure 4 takes a WiFi module including two antenna interfaces as an example. One antenna interface A of the WiFi module can be connected to an antenna ANT1, and the other antenna interface B can be connected to multiple antennas through an antenna switching switch SW, such as taking the antenna switching switch SW connecting two antennas (such as antennas ANT2 and ANT3) as an example. The antenna switching switch SW is also provided with a GPIO interface, and the antenna switching switch SW can be controlled through the GPIO interface to achieve switching of the connection between the WiFi module and the antenna ANT2 and the antenna ANT3.

[0100] For example, as shown in Figure 4, terminal a of the antenna switching switch SW is connected to terminal b, and the WiFi module is connected to antenna ANT2. If switching instruction A is used to instruct the antenna switching switch SW to switch to terminal a connected to terminal c, then when the GPIO interface receives switching instruction A, the antenna switching switch SW can be switched to a state where terminal a is connected to terminal c, ensuring that the WiFi module is connected to antenna ANT3. If switching instruction B is used to instruct the antenna switching switch SW to switch to terminal a connected to terminal b, then when the GPIO interface receives switching instruction B, the antenna switching switch SW can be switched to a state where terminal a is connected to terminal b, ensuring that the WiFi module is connected to antenna ANT2. Based on the switching instruction received by the GPIO interface, the antenna switching switch can be controlled, thereby achieving antenna switching.

[0101] In some examples, the GPIO interface connected to the antenna switching switch SW can be set in an embedded controller (EC) chip, and the CPU can control the antenna switching switch through the EC chip. Since CPUs come in different models, some models may not have a GPIO interface or may not have redundant GPIO interfaces. Therefore, by setting the GPIO interface in the EC chip as described above, it is ensured that the CPU can control the antenna switching switch SW through the EC chip, thereby achieving switching control of the antenna. Therefore, through the above method, the applicability of the wireless network card provided in the embodiment of the present application in different products is improved.

[0102] In some embodiments, the wireless network card provided by the embodiment of the present application can improve the coverage of wireless signals. The coverage range of the antenna of the wireless network card in Figure 4 is shown in Figure 5. Terminal a in the antenna switching switch SW is connected to terminal c. At this time, antenna ANT1 and antenna ANT3 are in working state, and their coverage range is shown as the shaded part in Figure 5 (a). Terminal a in the antenna switching switch SW is connected to terminal b. At this time, antenna ANT1 and antenna ANT2 are in working state, and their coverage range is shown as the shaded part in Figure 5 (b). It can be seen from this that the embodiment of the present application, such as the wireless network card shown, by setting an antenna switching switch SW for switching antennas on the antenna interface, makes it possible to switch the antenna interface to another antenna through the antenna switching switch when the coverage range of a certain antenna connected to the antenna interface is limited, and still ensure the normal operation of the antenna interface, that is, to ensure that the antenna interface is still connected to the normal working antenna, and will not reduce the antenna coverage range corresponding to the antenna interface. As shown in the coverage range diagram in Figure 1 (a), after the coverage range of one of the antennas is limited, the overall antenna coverage range is reduced accordingly. Therefore, the wireless network card provided by the embodiment of the present application can improve the coverage of the antenna through antenna switching, thereby ensuring that the performance of wireless communication is improved while the cost is similar.

[0103] In some embodiments, antenna ANT1 shown in FIG4 may be an omnidirectional antenna, while antenna ANT2 and antenna ANT3 may be directional antennas. An omnidirectional antenna transmits signals in all directions, allowing signals to be transmitted or received in all directions. In contrast, directional antennas transmit and receive signals in a single direction. Therefore, by configuring the antenna connected to antenna switch SW as a directional antenna, if interference occurs in a particular direction, the antenna switch SW can be used to switch between different directional antennas, thereby improving the wireless network card's anti-interference capabilities.

[0104] It should be understood that antenna ANT1 can also be set as a directional antenna, and some or all of the multiple antennas connected to the antenna switching switch can also be set as omnidirectional antennas, such as antenna ANT2 and / or antenna ANT3 can also be omnidirectional antennas. The embodiments of the present application do not limit this.

[0105] For example, as shown in Figures 6(a) and 6(b), within a certain horizontal plane, the coverage of the omnidirectional antenna ANT1 can be considered a circle with a radius of r, while the coverage of the directional antenna ANT2 and the directional antenna ANT3 can be considered an ellipse with directionality. The omnidirectional antenna emits wireless signals with uniform radiation energy in all directions, and the sensing range of the received wireless signals near the antenna is also uniform. Therefore, the coverage of the omnidirectional antenna ANT1 in Figure 6 is relatively uniform. The radiation energy of the wireless signals emitted by the directional antenna is concentrated in a certain direction, and the sensing range of the received wireless signals is also concentrated in this direction. Therefore, the directional antenna can transmit wireless signals in this direction over a longer distance and has strong anti-interference capabilities. For example, as shown in Figure 6, the coverage diameter of the omnidirectional antenna ANT1 is 50m, while the coverage of the directional antenna ANT2 and the directional antenna ANT3 is an ellipse with a major axis length of 100m. By using the directional antenna ANT2 and the directional antenna ANT3, the anti-interference capability and long-distance transmission capability of the wireless network card can be improved.

[0106] In some examples, the radiation energy of each directional antenna is concentrated in different directions. Using multiple directional antennas radiating in different directions can achieve all-round signal coverage, thereby ensuring improved coverage. For example, directional antenna A and directional antenna B have different radiation ranges on a certain plane. Directional antenna A has a radiation range of 0°-90°, with the signal coverage distance gradually increasing from 0° to 45° and gradually decreasing from 45° to 90°. Directional antenna B can actually cover a range of 90°-180°, with the signal coverage distance gradually increasing from 90° to 135° and gradually decreasing from 135° to 180°. Therefore, directional antennas A and B can achieve signal coverage within a range of 0°-180°.

[0107] It should be noted that the descriptions of the coverage shapes of each antenna in Figures 1, 5, and 6 are merely illustrative. The actual coverage shapes should be determined based on the actual antenna performance. For example, the directional antenna coverage shapes shown for directional antennas ANT2 and ANT3 in Figure 6 are merely for illustrative purposes, and do not imply that there is an uncovered area at the intersection of the coverage shapes of directional antennas ANT2 and ANT3. In practice, centered on the wireless network card, the actual coverage range of directional antenna ANT2 in Figure 6 is 0-180°, with the signal coverage distance increasing from 0 to 90° and decreasing from 90° to 180°. The actual coverage range of directional antenna ANT3 is 180°-360°, with the signal coverage distance increasing from 180° to 270° and decreasing from 270° to 360°. This ensures that there are no blind spots for wireless signal reception or transmission, thereby improving wireless signal coverage.

[0108] In some embodiments, the antenna switching switch can be connected to multiple antennas to achieve switching between multiple antennas, thereby ensuring the wireless communication capability of the wireless network card. For example, the number of antennas connected to the antenna interface B of the WiFi module through the antenna switching switch SW in Figure 4 can be greater than 2. As shown in Figure 7, the antenna connected to the antenna interface A of the WiFi module is an antenna ANT1, and the antennas connected to the antenna interface B through the antenna switching switch SW are antenna ANT2, antenna ANT3 and antenna ANT4. Then, the total number of antennas of the wireless network card is four, and the coverage rate of the four antennas can be further improved. In this way, when one of the multiple antennas is blocked from receiving and sending wireless signals, the remaining antennas can still receive and send wireless signals normally, and then one of the antennas is switched to connect to the WiFi module through the antenna switching switch, which can improve the anti-interference capability of the wireless network card. Among them, the situation where the antenna is blocked from receiving and sending wireless signals includes but is not limited to electromagnetic interference such as antenna damage and obstruction.

[0109] In some embodiments, each antenna interface of the WiFi module can be connected to multiple antennas through an antenna switching switch, thereby improving the communication capability of the wireless network card. For example, in Figure 8, the antennas connected to the antenna interface A of the WiFi module through the antenna switching switch SW1 are ANT1 and ANT2, and the antennas connected to the antenna interface B of the WiFi module through the antenna switching switch SW2 are ANT3 and ANT4. The EC chip is provided with a GPIO1 interface and a GPIO2 interface, so that the CPU can control the antenna switching switch SW1 through the GPIO1 interface and control the antenna switching switch SW2 through the GPIO2 interface respectively. The CPU can switch the connection between antenna ANT1 and antenna ANT2 and the WiFi module by controlling the connection switching between terminal a and terminal b or terminal c of the antenna switching switch SW1. The CPU can also switch the connection between antenna ANT3 and antenna ANT4 and the WiFi module by controlling the connection switching between terminal d and terminal e or terminal f of the antenna switching switch SW2.

[0110] It should be noted that the embodiments of the present application do not limit the number of antenna interfaces of the WiFi module or whether the antenna interfaces are connected to an antenna switching switch. Specifically, some or all of the antenna interfaces of the WiFi module are connected to an antenna switching switch, and each antenna switching switch is used to switch the connection between two or more antennas and the WiFi module.

[0111] Optionally, in the wireless network card provided in the embodiment of the present application, the radiation type of the antenna connected to the antenna interface of the WiFi module can be determined according to actual conditions. Among them, the radiation type includes omnidirectional antennas and directional antennas. For example, in the wireless network card shown in Figure 7, antenna ANT1, antenna ANT2, antenna ANT3, and antenna ANT4 can all be omnidirectional antennas, or all can be directional antennas. In addition, some of antenna ANT1, antenna ANT2, antenna ANT3, and antenna ANT4 can be omnidirectional antennas, and the other part can be directional antennas.

[0112] In some embodiments, in the wireless network card provided by the embodiments of the present application, the type of antenna connected to the antenna interface of the WiFi module can be a single-function antenna or a multi-function antenna module, and the type of antenna connected to the antenna interface can be determined specifically according to actual conditions. For example, the antenna ANT1 shown in Figure 4 can be an antenna module with WiFi and Bluetooth functions, and the antenna ANT2 and the antenna ANT3 can be WiFi antennas. In this way, it can be ensured that the wireless network card has WiFi and Bluetooth functions. For example, as shown in Figure 8, the antenna ANT1 can be a WiFi antenna, the antenna ANT2 can be a Bluetooth antenna, and the antenna ANT3 and the antenna ANT4 can both be WiFi antennas. In this way, it can be ensured that the Bluetooth antenna and the WiFi antenna of the wireless network card are independent, the accuracy of signal transmission is improved, and the ability of the WiFi antenna to transmit WiFi signals can be improved.

[0113] Therefore, for the wireless network card of the embodiment of the present application, an antenna switching method is also provided. The antenna switching method provided in the embodiment of the present application can be applied to electronic devices, and the software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention adopts a layered architecture. Taking the system as an example, the software structure of the electronic device is illustrated.

[0114] Figure 9 is a software structure diagram of an electronic device 100 provided by an embodiment of the present invention. The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, The system is divided into four layers, from top to bottom: application layer, executive layer, hardware abstraction layer (HAL), and kernel layer.

[0115] The application layer can include a series of application packages. As shown in Figure 9, the application package can include camera, gallery, calendar, WLAN, Bluetooth, music, video, email, conference, game, short message and other applications.

[0116] The executive layer provides an application programming interface (API) and programming framework for applications in the application layer. The executive layer includes some predefined functions.

[0117] As shown in FIG9 , the executive layer may include a window manager, a process and thread manager, a memory manager, a view system, a resource manager, a wireless transmitting antenna selection (WiTAS) module, and the like.

[0118] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0119] The process and thread manager is used to create or terminate processes and threads corresponding to applications.

[0120] The memory manager is used to store and retrieve data and make this data accessible to the application process. It provides a private address space for each process and supports memory sharing between processes.

[0121] The view system includes visual controls, such as those for displaying text and images. The view system can be used to build applications. A display interface can consist of one or more views. For example, a display interface containing a message notification icon can include a view for displaying text and a view for displaying images.

[0122] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0123] The WiTAS module monitors the operation of applications in the application layer. If a specified application is started, it monitors its operation. If it determines that the application is operating abnormally, it interacts with the antenna switching driver in the kernel layer through the HAL layer, causing the antenna switching driver to trigger the antenna switching switch in the wireless network card to perform antenna switching to improve the application's operation. The specified application is a pre-set application that can trigger antenna switching, such as an application with high network latency or an application that meets preset classification rules.

[0124] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, sensor driver, antenna switching driver, etc.

[0125] The HAL layer is an interface layer between the operating system kernel and the hardware circuit. Its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform and provides a virtual hardware platform for the operating system, making it hardware-independent and portable across multiple platforms.

[0126] Currently, each antenna interface of a WiFi module is connected to one antenna. Therefore, the WiFi module can only output one signal reception strength, and this signal reception strength can only reflect the maximum signal reception strength among the signal reception strengths corresponding to multiple antennas, and it is impossible to determine which antenna the maximum signal reception strength corresponds to. For example, the two antenna interfaces of a common WiFi module currently on the market are connected to antenna ANT1 and antenna ANT2, respectively. The following uses the received signal strength indicator (RSSI) as an example to illustrate the communication performance of the WiFi module. RSSI1 represents the signal reception strength of antenna ANT1, and RSSI2 represents the signal reception strength of antenna ANT2. Then, according to the current antenna signal reception strength detection technology, the WiFi module can only output one signal reception strength, which is the signal reception strength with the larger value between RSSI1 and RSSI2, but it is impossible to determine whether the signal strength corresponds to antenna ANT1 or antenna ANT2.

[0127] The technology used to measure the signal reception strength of the antenna using the current WiFi module cannot accurately measure the wireless network signal provided by the embodiment of the present application and realize antenna switching. For example, taking the wireless network card shown in Figure 4 as an example, one antenna interface A of the WiFi module is connected to the antenna ANT1, and the other antenna interface B is connected to the antenna ANT2 and the antenna ANT3 through the antenna switching switch. For example, RSSI1 represents the signal reception strength of the antenna ANT1, RSSI2 represents the signal reception strength of the antenna ANT1, and RSSI3 represents the signal reception strength of the antenna ANT3. As a case, if the actual situation is that RSSI1 is greater than RSSI2, and RSSI1 is greater than RSSI3, then based on the antenna signal reception strength detection technology of the existing WiFi module, when the terminal a of the antenna switching switch SW is connected to the terminal b, the measured value is R1=MAX(RSSI1, RSSI2)=RSSI1. Afterwards, when the antenna switching switch SW is switched to connect terminal a to terminal c, the measured value is R2=MAX(RSSI1, RSSI3)=RSSI1. Since the values ​​of R1 and R2 are actually the same in different antenna switching situations, it is not possible to directly determine whether to switch the antenna through the antenna switch based on the antenna signal reception strength.

[0128] The following embodiment uses the wireless network card structure shown in Figure 4 as an example to provide a detailed description of the antenna switching method provided in the embodiments of the present application. The wireless network card includes an antenna switching switch, and the antenna switching switch is used to switch between two antennas located on the same antenna interface. It should be understood that in actual applications, the wireless network card may include more or fewer antenna switching switches, and each antenna switching switch may be used to control the switching of a greater or lesser number of antennas, and the embodiments of the present application are not limited thereto.

[0129] Optionally, Figure 10 is a flow chart of an antenna switching method provided in an embodiment of the present application. It should be noted that the method is not limited to the specific sequence shown in Figure 10 and below. It should be understood that in other embodiments, the order of some steps in the method can be interchanged according to actual needs, or some steps can be omitted or deleted. The method includes the following steps:

[0130] S1001. The WiTAS module sends an instruction for measuring the signal reception strength of antenna A to the HAL layer.

[0131] In some embodiments, the WiTAS module may be used to monitor the operation of an application. When it is determined that an abnormality has occurred in the operation of the application, the WiTAS module may trigger the measurement of the antenna signal reception strength to determine whether antenna switching is required and to determine the target antenna for the switching connection.

[0132] Optionally, the WiTAS module monitors the running status of specified applications, where the specified applications are pre-set applications that can be used to trigger antenna switching, such as applications with high network latency, applications of preset categories, etc. Pre-set categories include video and conference categories, for example.

[0133] For example, after determining that the electronic device has started a conference application, the WiTAS module begins to monitor the operation of the conference application. When the WiTAS module determines that the conference application has an abnormal freeze or a high network delay, it can determine to trigger the antenna switching process. Then, the WiTAS module sends an instruction to the HAL layer to measure the signal reception strength of antenna A. Antenna A is the antenna currently connected to the antenna switching switch, and the WiTAS module measures the signal reception strength of multiple antennas connected to the antenna switching switch through subsequent steps to determine the target antenna to be switched. Optionally, the target antenna is any antenna whose signal reception strength meets the conditions among the multiple antennas connected to the antenna switching switch, and the specific method for determining the target antenna is detailed in the following steps.

[0134] Exemplarily, as shown in FIG4 , antenna A is the antenna currently connected to the WiFi module through the antenna switching switch, for example, antenna A is antenna ANT2.

[0135] In some examples, the instruction for measuring the received signal strength of an antenna includes a measurement duration and a measurement type. The measurement type indicates the performance type of the antenna signal being measured, such as received signal strength or signal transmission speed. The WiFi module then measures the antenna signal based on the measurement type to obtain the corresponding measurement value, such as the received signal strength of antenna A. The measurement duration indicates the duration of the antenna signal measurement. For example, the WiFi module measures the received signal strength of antenna A for 0.5 seconds based on the measurement duration.

[0136] S1002 : The HAL layer sends a command for measuring the signal reception strength of antenna A to the WiFi module.

[0137] The WiFi module is used to measure and output the signal reception strength of a single antenna. Compared to the prior art WiFi module, which can only output a single signal reception strength, the antenna switching method provided in this embodiment can output the measurement of the signal reception strength of a single antenna. This allows the subsequent WiTAS module to determine whether to switch antennas and the target antenna to switch to based on the measurement results of the signal reception strength of each antenna.

[0138] In some embodiments, the WiFi module includes a measurement unit for measuring the signal reception strength of each antenna interface. The chip firmware can be configured to enable the wireless network card to output the signal reception strength of each antenna.

[0139] In some examples, the wireless network card can output the signal receiving strength of each antenna by configuring the chip firmware in the WiFi module. For example, the current common WiFi module is configured with chip firmware A, which is used to obtain the signal receiving strength of each antenna interface measured by the measuring unit, and calculate the maximum signal receiving strength among the signal strengths of all antenna interfaces, so that the WiFi module can output the maximum signal receiving strength. Afterwards, the electronic device can display the maximum signal receiving strength to facilitate the user to view the signal strength. The chip firmware B configured in the WiFi module provided in the embodiment of the present application can obtain the signal receiving strength of each antenna interface measured by the measuring unit, and ensure that the WiFi module can directly output the signal receiving strength of each antenna interface, so as to facilitate the subsequent determination of the target antenna based on the signal receiving strength of each antenna.

[0140] Optionally, the wireless network card provided in the embodiment of the present application may not be configured with chip firmware A and chip firmware B, and the measuring unit directly outputs the signal reception strength of each antenna. Alternatively, the wireless network card provided in the embodiment of the present application may be configured with chip firmware A and chip firmware B at the same time, so that the electronic device can display the signal strength based on the maximum signal reception strength calculated by chip firmware A, and can control the antenna switching switch based on the signal reception strength of each antenna output by chip firmware B.

[0141] In some examples, chip firmware can be configured in a variety of ways. For example, chip firmware can be configured by software, hardware, or a combination of software and hardware. For example, a program for measuring the signal reception strength of each antenna can be burned into the WiFi module in the wireless network card to realize the configuration of the chip firmware by software. A program for measuring the signal reception strength of each antenna can also be burned into a separate hardware to make the hardware a hardware implementation of the chip firmware.

[0142] In some examples, as shown in Figure 11, the chip firmware can be configured in the WiFi module. It should be understood that the embodiment of the present application does not limit the configuration location of the chip firmware. For example, the chip firmware can be configured on other chips independent of the WiFi module.

[0143] Optionally, the configuration mode and configuration position of the chip firmware can be combined according to the actual application. For example, the chip firmware configuration can be implemented in the software mode of the WiFi module. For example, a program for implementing the function of measuring the signal reception strength of each antenna is burned in the WiFi module. The chip firmware can also be configured in an independent chip so that the chip has the function of measuring and outputting the signal reception strength of each antenna.

[0144] In other embodiments, the WiFi module can also obtain one or more measurement values ​​of bit error rate, packet loss rate, retransmission rate, network delay, and signal-to-noise ratio. Afterwards, the WiFi module calculates the measured values ​​to determine the signal reception strength of the antenna.

[0145] In some examples, if a program is burned into the WiFi module to implement the function of outputting the signal reception strength of each antenna, then the WiFi module can output the signal reception strength of each antenna. For another example, if a program is burned into the WiFi module to implement the function of outputting the signal reception strength of each antenna based on the bit error rate, then the WiFi module can output the signal reception strength of each antenna based on the bit error rate. For another example, if a program is burned into the WiFi module to implement the function of outputting the signal reception strength of each antenna based on four parameters: packet loss rate, retransmission rate, network delay, and signal-to-noise ratio, then the WiFi module can output the signal reception strength of each antenna based on the four parameters.

[0146] Optionally, after obtaining one or more measured values ​​of bit error rate, packet loss rate, retransmission rate, network latency, and signal-to-noise ratio, the WiFi module can directly send the obtained measured values ​​to a controller connected to the wireless network card. The controller can then directly determine whether to switch antennas based on these measured values.

[0147] In some embodiments, the WiFi module is connected to the WiTAS module through the HAL layer, and the WiTAS module triggers the WiFi module to measure the corresponding antenna signal through the HAL layer.

[0148] In some examples, the command carries an identifier of antenna A, which is used to indicate antenna A.

[0149] In some examples, to maintain modularity and independence, the WiTAS module operates at the executive layer. Therefore, the WiTAS module can communicate with the underlying layers through the HAL layer interface. The WiTAS module can send instructions, which the HAL layer converts into commands recognizable by the antenna switching driver or WiFi module and sends them to the corresponding antenna switching driver or WiFi module.

[0150] S1003: The WiFi module measures the received signal strength RSSIA of antenna A.

[0151] In some examples, after receiving a command from the WiTAS module via the HAL layer, the WiFi module determines the antenna to be measured, such as antenna A. The WiFi module can then measure the received signal strength of antenna A within a preset measurement duration. For example, the module can measure the average received signal strength of antenna A over a 0.5 second period, thereby ensuring that the received signal strength RSSIA of antenna A can be accurately measured.

[0152] Optionally, the antenna can transmit multiple signals such as WiFi signals and Bluetooth signals. Then, after receiving the command, the WiFi module can measure the signal reception strength of the signal currently transmitted by the antenna. Exemplarily, the WiFi module can be configured with chip firmware corresponding to the measured signal type. For example, the chip firmware measures the signal reception strength RSSIA of WiFi antenna A, then the chip firmware can be WiFi chip firmware. For another example, the chip firmware measures the signal reception strength RSSIA of Bluetooth antenna A, then the chip firmware can be Bluetooth chip firmware.

[0153] S1004. The WiFi module sends the received signal strength RSSIA to the WiTAS module.

[0154] Optionally, when the HAL layer sends a command to the WiFi module to measure the received signal strength of antenna A, it can also send a callback message to the WiFi module, causing it to notify the WiTAS module of the received signal strength (RSSIA). After determining the received signal strength (RSSIA), the WiFi module then feeds the RSSIA back to the WiTAS module based on the callback message.

[0155] S1005 : The WiTAS module sends an instruction for switching antenna A to antenna B to the HAL layer.

[0156] S1006 : The HAL layer sends a command for switching antenna A to antenna B to the antenna switching driver.

[0157] S1007: The antenna switching driver configures the antenna switching switch.

[0158] In some embodiments, the WiTAS module determines that the signal reception strength measurement of antenna A has been completed after receiving the signal reception strength RSSIA. As in the above step S1001, antenna A is antenna ANT2 in Figure 4, then the WiTAS module determines that antenna B (i.e., ANT3) still exists in the current antenna interface B, then the WiTAS module can trigger the measurement of antenna B.

[0159] In some cases, as shown in Figure 4, the antenna switch is not currently connected to antenna B, antenna B is not working, and the signal reception strength of antenna B cannot be determined. Therefore, the WiTAS module can send an instruction to the HAL layer to switch antenna A to antenna B, triggering the HAL layer to send a command to the antenna switch driver to switch antenna A to antenna B, thereby driving the antenna switch to switch antenna A connected to the WiFi module to antenna B.

[0160] For example, as shown in FIG4 , after completing the measurement of the signal reception strength of antenna A, which is currently connected to the WiFi module via the antenna switching switch, the electronic device can send an instruction via the CPU to switch antenna A connected to the WiFi module to antenna B. The antenna switching switch SW receives the instruction via the GPIO interface and, based on the instruction, switches the connection between terminal a and terminal b to a connection between terminal a and terminal c, thereby completing the process of switching antenna A (such as ANT2) to antenna B (such as ANT3).

[0161] S1008. The antenna switching driver sends a feedback message indicating that the switching is completed to the WiTAS module.

[0162] Optionally, when the HAL layer sends a command to the antenna switching driver to switch antenna A to antenna B, it can also send a callback message to the antenna switching driver. This callback message is used to cause the antenna switching driver to send feedback information about the antenna switching completion to the WiTAS module. Then, after completing the antenna switching, the antenna switching driver can send feedback information to the WiTAS module based on the callback message.

[0163] S1009 : The WiTAS module sends an instruction for measuring the signal reception strength of antenna B to the HAL layer.

[0164] S1010 : The HAL layer sends a command for measuring the signal reception strength of antenna B to the WiFi module.

[0165] S1011. The WiFi module measures the received signal strength RSSIB of antenna B.

[0166] S1012: The WiFi module sends the received signal strength RSSIB to the WiTAS module.

[0167] In some embodiments, after switching from antenna A to antenna B in steps S1009-S1012, the WiTAS module then measures the received signal strength RSSIB of antenna B through the WiFi module, facilitating a subsequent comparison of received signal strength RSSIA and received signal strength RSSIB to determine the target antenna. For details regarding the received signal strength measurement in steps S1009-S1012, refer to the relevant content of steps S1001-S1004 above and are not further described here.

[0168] It should be understood that in the case that a single antenna interface of the WiFi module has more antennas, the WiTAS module may repeat steps S1009 to S1012 to obtain the signal reception strength of other antennas.

[0169] Step S1013: The WiTAS module determines the target antenna based on the received signal strength RSSIA and the received signal strength RSSIB.

[0170] In some embodiments, after obtaining the signal reception strength measurement results for each antenna, the WiTAS module can determine a target antenna based on these signal reception strength measurement results. The target antenna can be the antenna to be switched. In some examples, the target antenna can also be the antenna currently connected to the WiFi module.

[0171] Optionally, after determining the target antenna, the WiTAS module may further generate an antenna switching instruction for instructing the target antenna to be switched. For example, the antenna switching instruction carries an identifier for indicating the target antenna.

[0172] In some embodiments, the antenna switching instruction is used to control the connection between the WiFi module and the target antenna. For example, in FIG4 , after the CPU sends the antenna switching instruction to the antenna switching switch SW via the GPIO interface, the antenna switching switch SW switches the connection relationship between the terminals accordingly based on the antenna switching instruction.

[0173] For example, the WiTAS module determines that the target antenna to be switched is antenna B based on the signal reception strength measurement results obtained for each antenna. As shown in Figure 4, antenna B is antenna ANT3, which is not currently connected to the WiFi module. The WiTAS module can generate an antenna switching instruction to instruct the user to switch to antenna ANT3. For example, if identifier Tc represents terminal c corresponding to antenna ANT3, the antenna switching instruction can include identifier Tc.

[0174] In some examples, the WiTAS module determines the maximum signal reception strength among the received signal reception strengths of multiple antennas and identifies the antenna that produces the maximum signal reception strength as the target antenna. For example, the antenna switching switch is used to control the connection of antenna A, antenna B, antenna C, or antenna D to the WiFi module. The WiTAS module detects the signal reception strength RSSIA corresponding to antenna A, the signal reception strength RSSIB corresponding to antenna B, the signal reception strength RSSIC corresponding to antenna C, and the signal reception strength RSSID corresponding to antenna D. If RSSID>RSSIB>RSSIC>RSSIA, the WiTAS module determines that antenna D is the target antenna.

[0175] In some examples, the WiTAS module determines a target antenna based on the difference in received signal strengths from multiple antennas. For example, the WiTAS module calculates the difference M between the received signal strength RSSIA and the received signal strength RSSIB to determine the target antenna based on the difference M. For example, M = RSSIA - RSSIB. When M is greater than 0, it indicates that the received signal strength RSSIA of antenna A is greater than the received signal strength RSSIB of antenna B, meaning that antenna A's performance is better than antenna B's. Therefore, in response to the difference M being greater than 0, the WiTAS module determines that antenna A is the target antenna. When M is less than 0, it indicates that the received signal strength RSSIA of antenna A is less than the received signal strength RSSIB of antenna B, meaning that antenna B's performance is better than antenna A's. Therefore, in response to the difference M being less than 0, the WiTAS module determines that antenna B is the target antenna. When M is equal to 0, it indicates that the received signal strength RSSIA of antenna A is the same as the received signal strength RSSIB of antenna B, meaning that antenna B's performance is the same as antenna A's. Therefore, in response to the difference M being equal to 0, the WiTAS module determines that the antenna currently connected to the WiFi module is the target antenna.

[0176] Optionally, in the process of determining the target antenna based on the numerical value between the signal reception strength RSSIA and the signal reception strength RSSIB, the WiTAS module may also obtain the signal reception strength RSSIA and the signal reception strength RSSIB multiple times, compare the numerical values ​​based on the multiple sets of signal reception strength RSSIA and signal reception strength RSSIB obtained multiple times, and then determine the target antenna based on the comparison results. Among them, after completing a round of obtaining the measurement results of the signal reception strength of multiple antennas corresponding to an antenna interface, the WiTAS module can determine that a set of signal reception strengths has been obtained. Afterwards, the WiTAS module triggers the next round of signal reception strength acquisition process to obtain the next set of signal reception strengths. For example, as shown in Figure 10, steps S1001-S1012 are repeatedly executed to obtain multiple sets of signal reception strengths.

[0177] In some examples, during the comparison process, the WiTAS module determines that the number of times the signal reception strength RSSIA is greater than the signal reception strength RSSIB is greater than or equal to a preset number A, and determines that antenna A is the target antenna. Conversely, if the number of times the signal reception strength RSSIB is greater than the signal reception strength RSSIA is greater than or equal to the preset number A, the WiTAS module determines that antenna B is the target antenna. For example, the WiTAS module calculates M based on each group of signal reception strength RSSIA and signal reception strength RSSIB. i=RSSIA - RSSIB, where i represents the group number of the received signal strength RSSIA and received signal strength RSSIB. For example, if there are five groups of received signal strength RSSIA and received signal strength RSSIB, and the preset number A is 3, then if M1, M2, M3, and M5 are all greater than 0, antenna A can be determined to be the target antenna.

[0178] In some examples, in the process of comparing the results, the WiTAS module determines that the number of times the signal receiving strength RSSIA is continuously greater than the signal receiving strength RSSIB is greater than the preset number B, and antenna A can be determined to be the target antenna. Conversely, the WiTAS module determines that the number of times the signal receiving strength RSSIB is continuously greater than the signal receiving strength RSSIA is greater than the preset number B, and antenna B can be determined to be the target antenna. For example, based on each group of signal receiving strength RSSIA and signal receiving strength RSSIB, M=RSSIA-RSSIB is calculated. When M is less than 0 for the nth time, n is a positive integer, and the WiTAS module determines that antenna B is the target antenna. When M is greater than 0 for the nth time, the WiTAS module determines that antenna A is the target antenna. When M is equal to 0 for the nth time, the WiTAS module determines that the antenna currently connected to the WiFi module is the target antenna. For another example, based on each group of signal receiving strength RSSIA and signal receiving strength RSSIB, M is calculated. i =RSSIA - RSSIB, where i represents the group number of the received signal strength RSSIA and received signal strength RSSIB. For example, if there are seven groups of received signal strength RSSIA and received signal strength RSSIB, and the preset number A is 4, then if M2, M3, M4, M5, and M6 are all greater than 0, it means that the received signal strength RSSIA has been greater than the received signal strength RSSIB five times in a row. Therefore, antenna A can be determined to be the target antenna.

[0179] In some embodiments, the WiTAS module can also determine a freeze time during the process of determining the target antenna. The freeze time is used to indicate the duration for which the antenna switch stops switching the antenna. For example, the electronic device controls the antenna switch according to the freeze time so that after connecting the WiFi module to the target antenna, it will not switch again within the freeze time.

[0180] Optionally, the WiTAS module can also include a freeze time in the antenna switching command it sends. This command ensures that the WiTAS module maintains a connection with the target antenna during the freeze time, preventing ping-pong switching and ensuring stable communication.

[0181] In some examples, the connection between the WiFi module and the target antenna can be controlled to last for a preset duration in various ways. For example, after receiving an antenna switching instruction and controlling the WiFi module to connect to the corresponding target antenna based on the antenna switching instruction, the antenna switching switch can stop receiving antenna switching instructions for a preset duration, or the antenna switching switch can only receive antenna switching instructions for a preset duration but not respond to the received antenna switching instructions.

[0182] Optionally, after determining that the WiFi module is connected to the corresponding target antenna, the electronic device may stop sending antenna switching instructions to the antenna switching switch within a preset time period. For example, the antenna switching switch controls the WiFi module to connect to the corresponding target antenna based on the antenna switching instruction and sends a feedback message to the electronic device indicating that the switch is successful. After receiving this feedback message, the electronic device may stop sending antenna switching instructions to the antenna switching switch within one minute. During this time period, the electronic device may continue or stop the process of determining the target antenna.

[0183] Optionally, in the following scenario, the antenna switching instruction determined after the target antenna is determined based on step S1013 may carry a freeze time but not a target antenna identifier. Exemplarily, after the target antenna is determined through the above step S1013, the antenna switching method may further include the following process: the WiTAS module may determine whether the antenna currently connected to the WiFi module is the target antenna. In response to the fact that the antenna currently connected to the WiFi module is the target antenna, the antenna switching instruction generated by the WiTAS module carries a freeze time. That is, when the antenna currently connected to the WiFi module is the target antenna, the WiTAS module no longer instructs to switch the antenna. It should be understood that the antenna switching instruction is only an exemplary description, and the WiTAS module may also send the identifier of the target antenna separately, and send the freeze time separately.

[0184] Accordingly, after step S1013 , the antenna switching method may further include the following process: in response to the antenna currently connected to the WiFi module not being the target antenna, the WiTAS module generates an antenna switching instruction carrying the target antenna identifier and the freeze time.

[0185] For example, during steps S1005 through S1008, the WiTAS module first measures the signal reception strength of antenna A. Then, to measure the signal reception strength of antenna B, the WiTAS module switches the antenna switch, connecting the WiFi module to antenna B via the switch. If the switch does not switch, the antenna currently connected to the WiFi module is antenna B. If the WiTAS module determines that the target antenna is antenna B, it may then issue an antenna switching instruction with a freeze time, instructing the switch not to switch during the freeze time.

[0186] In some embodiments, after the WiTAS module determines that the measurement of the antenna signal reception strength of all antennas to be measured is completed through the above steps S1001-S1012, it can also instruct the antenna switching switch to switch to the initial antenna. For example, in the scenario shown in Figure 4, when the antenna connected to the WiFi module is ANT2, the antenna signal reception strength measurement is triggered. Then, after completing the signal reception strength measurements of ANT2 and ANT3, the WiTAS module can instruct the antenna switching switch to switch to ANT2, that is, switch to the initial antenna connected to the antenna switching switch before measuring the antenna signal reception strength. Afterwards, the WiTAS module determines that the target antenna is ANT3 (such as antenna B) based on the obtained multiple antenna signal reception strengths. Then, the WiTAS module generates an antenna switching instruction corresponding to antenna B. The antenna switching instruction carries the identification of antenna B and the corresponding freeze time. The freeze time is used to instruct the antenna switching switch to no longer perform switching actions during the freeze time after switching antenna A connected to the WiFi module to antenna B.

[0187] In other embodiments, the WiTAS module, in the process of determining the target antenna, can determine the corresponding target antenna and the corresponding freezing time based on whether the difference between the signal reception strengths of different antennas meets a preset range. The preset range is used to indicate the freezing time corresponding to the interval range of different differences and whether the antenna switching switch needs to perform a switching action. For example, in the process of determining the target antenna based on the signal reception strength RSSIA and the signal reception strength RSSIB, the WiTAS module can first calculate the difference M1 between the signal reception strength RSSIA and the signal reception strength RSSIB. If M1 is greater than 0, antenna A can be determined as the target antenna. Afterwards, the WiTAS module further determines the freezing time of the antenna switching switch based on the absolute value of M1, and whether the antenna switching switch needs to be switched to the target antenna. If the absolute value of M1 is greater than or equal to threshold A, it can be determined that the antenna needs to be switched, and the freezing time of the antenna switching switch is duration A; if the absolute value of M1 is less than threshold A and greater than or equal to threshold B, it can be determined that the antenna needs to be switched, and the freezing time of the antenna switching switch is duration B; if the absolute value of M1 is less than threshold B, it can be determined that the antenna does not need to be switched, and the freezing time of the antenna switching switch is duration C.

[0188] For example, threshold A is 6dB, threshold B is 3dB, duration A is 60S, duration B is 30S, and duration C is 20S. If M1>0, it means that the signal strength of antenna A is strong and can be set as the target antenna. Then, if |M1|≥6, it can be determined that the antenna switching switch will not perform any switching action within 60S after switching to antenna A. If 3≤|M1|<6, it can be determined that the antenna switching switch will not perform any switching action within 30S after switching to the WiFi module connected to antenna A. If |M1|<3, it can be determined that the antenna switching switch does not need to perform antenna switching action, and the antenna switching switch will not perform any switching action within 20S.

[0189] In the above process, when |M1| ≥ 6, it indicates that the difference between antenna A and antenna B is large. It can be assumed that the probability of antenna A's signal reception strength being lower than antenna B's is low in the short term. Therefore, the duration A corresponding to this situation can be set to a longer time to avoid repeated antenna switching in the short term. When 3 ≤ |M1| < 6, the difference between antenna A and antenna B is small. It can be assumed that the probability of antenna A's signal reception strength being lower than antenna B's is high or likely to be high in the short term. Therefore, the duration B corresponding to this situation can be set to a shorter time to ensure timely antenna switching. If |M1| < 3, it indicates that antenna A's signal reception strength RSSIA is similar to antenna B's signal reception strength RSSIB. Antenna switching can be avoided to maintain a stable antenna connection.

[0190] Optionally, if there are three or more antennas connected to the antenna switching switch, then in the method flow shown in FIG. 10 , the signal receiving strength RSSI corresponding to each antenna can be measured and obtained similarly through the method shown in S1001-S1004. Afterwards, the signal receiving strength RSSI corresponding to each two antennas can be compared to ultimately determine the target antenna. For example, a WiFi module can be connected to antenna ANT1, antenna ANT2, antenna ANT3, and antenna ANT4 through an antenna switching switch. If antenna ANT4 is determined to have the largest signal receiving strength RSSI value among antenna ANT1, antenna ANT2, antenna ANT3, and antenna ANT4, then the target antenna can be determined to be antenna ANT4.

[0191] Afterwards, if the WiFi module determines that the target antenna is antenna ANT4, the corresponding freezing time may be determined by further checking whether the difference between the signal receiving strength of the antenna currently connected to the WiFi module and the signal receiving strength of the target antenna meets a preset range.

[0192] In this way, the WiTAS module can determine the target antenna based on the signal reception strength of all antennas and control the antenna switch to switch to the target antenna, thereby improving the communication performance of the wireless network card.

[0193] In some embodiments, after the WiTAS module determines the target antenna, it can send an antenna switching instruction to the HAL layer, including the target antenna identifier and the freeze time. The HAL layer then sends the antenna switching instruction to the antenna switching driver, causing the antenna switching driver to configure the antenna switching switch. The process by which the WiTAS module controls the antenna switching switch based on the antenna switching instruction is similar to the implementation process of steps S1005-S1007 described above. Please refer to the relevant content above and will not be repeated here.

[0194] Optionally, if the target antenna is the antenna currently connected to the WiFi module, the WiTAS module may send a freeze time to the antenna switch driver via the HAL layer. Alternatively, the WiTAS module may not determine the freeze time.

[0195] In some implementation scenarios, the electronic device may determine whether to execute the above-mentioned antenna switching method based on the current running status of some specified applications in the electronic device. The specified application may be set by the user or determined by the electronic device based on preset rules. For example, the user may set his or her frequently used email application as the specified application. For another example, if the preset rules specify that an application of the video playback type belongs to the specified application, then the electronic device may determine that the online video player A is the specified application. Among them, the electronic device may determine whether the application is of the type specified in the preset rules based on the classification of the application in the application market.

[0196] In some examples, the designated application includes an application for playing videos. The electronic device then monitors the currently running application. When it determines that the currently running application is an application for playing videos, it can monitor the running status of the video application. By detecting abnormal conditions in the designated application, such as network lag or high network latency, the electronic device can call the WiTAS module to execute the above-mentioned antenna switching method, thereby improving the network fluency of the application running through antenna switching.

[0197] In other instances, the designated applications include video applications, game applications, and conference applications. After the electronic device is turned on, the video application is opened based on the user's operation. Then the electronic device can start to monitor the running status of the video application. After determining that the video application is stuck during video playback, the electronic device can call the WiTAS module to start executing the above-mentioned antenna switching method. If the user closes the video application and opens the document editing application, the electronic device determines that the document editing application does not belong to the designated application and does not execute the above-mentioned antenna switching method, thereby avoiding unnecessary switching of the antenna. If the document editing application is still open and the user opens the game application, the electronic device determines that the game application belongs to the designated application, then the electronic device starts to monitor the running status of the game application. After determining that the network delay of the game application is too high when it is running, the electronic device can start to execute the above-mentioned antenna switching method.

[0198] In some embodiments, the WiTAS module can be represented as a state machine. The WiTAS module can include three different states. When the WiTAS module is in one of the states, the WiTAS module can perform an action corresponding to the state. For example, as shown in FIG12 , the WiTAS module includes three states: idle state, transition state, and steady state.

[0199] A WiTAS module in the idle state can execute action 1. Action 1 can include monitoring application runtime data through the WiTAS monitoring module. Transition condition 1 can then be that the runtime data indicates an abnormality in the operation of at least one specified application. When transition condition 1 is met, the WiTAS module transitions from the idle state to the transit state.

[0200] For example, in response to a user action, the electronic device launches a designated application and places the WiTAS module in the idle state. At this point, the electronic device monitors the application's operational data through the WiTAS monitoring module. As shown in Figure 12, the WiTAS module within the electronic device's CPU can determine that a conferencing application has begun running and that the network latency during the conferencing application's operation exceeds a preset network latency threshold. The electronic device then determines that transition condition 1 has been met and can set the WiTAS module to transition from the idle state to the transit state.

[0201] When the WiTAS module is in the transit state, it can execute action 2, which can include determining the target antenna and the corresponding freeze time based on the signal reception strength, while the WiTAS monitoring module continues to monitor the application's operating data. Accordingly, transition condition 2 can include determining, based on the application's operating data, that the specified application is no longer running. When transition condition 2 is met, the WiTAS module transitions from the transit state to the idle state. Transition condition 3 can include determining the target antenna and freeze time, at least one specified application is still running, and an abnormality occurs in the operation of the specified application. When transition condition 3 is met, the WiTAS module transitions from the transit state to the steady state.

[0202] Exemplarily, when the WiTAS module is in a transit state, the electronic device may execute steps S1001 to S1013 of the antenna switching method in FIG10 , detect the signal reception strength of the antenna, and determine the target antenna and the freezing time based on the signal reception strength.

[0203] Optionally, the electronic device may continue to monitor the running data of the application through the WiTAS monitoring module. If the WiTAS module is in the transit state, the WiTAS module determines based on the running data that the electronic device is no longer running at least one specified application. Then, the WiTAS module determines that the transfer condition 2 is met and will transfer from the transit state to the idle state. If the electronic device determines that the target antenna is antenna A, the corresponding freezing time is 60s, and the running data shows that the electronic device is still running the conference application, and the network delay of the conference application during operation is greater than the preset network delay threshold. Then, the WiTAS module will transfer from the transit state to the steady state to perform antenna switching.

[0204] When the WiTAS module is in steady state, it can execute action 3. Action 3 may include controlling the antenna switching switch based on the target antenna and the corresponding freeze time, ensuring that the WiFi module maintains a connection with the target antenna within the freeze time. Action 3 also includes monitoring the operating data of one or more designated applications through the WiTAS monitoring module. As shown in Figure 12, transition condition 4 is: after the WiFi module's connection with the target antenna exceeds the freeze time, the operating data indicates that at least one designated application has experienced an abnormality. If this transition condition 4 is met, it can transition from steady state to transit state to re-determine the target antenna and switch antennas. Transition condition 5 is: if the operating data indicates that no designated application is running. If this transition condition 5 is met, it can transition from steady state to idle state. While in steady state, it can also have transition condition 6: after the WiFi module's connection with the target antenna exceeds the freeze time, all designated applications have not experienced any lag. If this transition condition 6 is met, it can continue in steady state and execute action 3 again.

[0205] For example, when the WiTAS module is in a steady state, the electronic device can control the antenna switch to switch so that the WiFi module is connected to the target antenna within the freeze time, and the electronic device can continue to monitor the running data of the application through the WiTAS monitoring module.

[0206] For example, if the target antenna is antenna A and the freeze time is 60 seconds, the electronic device controls the antenna switch to switch the WiFi module to antenna A (e.g., the target antenna), and after the connection is maintained for more than 60 seconds (e.g., the freeze time), if the electronic device is still running a conference application, and the operation data shows that the network delay of the conference application during operation is still greater than the preset network delay threshold, or a freeze occurs, the WiTAS module can transition from the steady state to the transit state to re-determine the target antenna.

[0207] For example, if the electronic device controls the antenna switch to switch the WiFi module to antenna A and maintains the connection for more than 60 seconds, and if the electronic device is still running a conferencing application and the operating data shows that the conferencing application is running without any lag or the network latency is less than or equal to the preset network latency threshold, the WiTAS module can continue to maintain the steady state. In this case, the electronic device can control the antenna switch to maintain the WiFi module's connection to the target antenna during the freeze time.

[0208] For another example, after the electronic device controls the antenna switch to switch the WiFi module to antenna A, if, during or after the freeze time, the operating data indicates that the electronic device is no longer running the specified application, the WiTAS module will transition from the transit state to the idle state.

[0209] An embodiment of the present application provides a wireless network card, comprising: a wireless communication module, an antenna switch, and an antenna. The wireless communication module is provided with an antenna interface for connecting to an antenna; each of the at least one antenna interface is provided with an antenna switch for switching the target antenna connected to the antenna interface. The target antenna is determined based on the signal reception strength of all antennas connected to the antenna switch.

[0210] In some examples, the wireless network card is connected to a controller, which can obtain the signal receiving strength of each antenna and determine the target antenna based on the signal receiving strength. The controller can then connect the antenna switch to the target antenna.

[0211] Among them, wireless communication modules include but are not limited to WiFi modules, Bluetooth modules, etc.

[0212] In the wireless network card shown in Figure 4, the wireless communication module is a WiFi module. For example, the WiFi module shown in Figure 4 includes two antenna interfaces, each of which can be connected to an antenna. Antenna interface A is directly connected to antenna NAT1, while antenna interface B is provided with an antenna switching switch SW, which enables switching of the antenna connected to antenna interface B. When terminal a of antenna switching switch SW shown in Figure 4 is connected to terminal b, antenna interface B is connected to antenna ANT2.

[0213] In some examples, the antenna switching switch can be used to switch multiple antennas. For example, as shown in FIG7 , the antenna switching switch is used to switch the antenna interface B to be connected to the antenna ANT2 , the antenna ANT3 , or the antenna ANT4 .

[0214] In some examples, the number of antenna switching switches in the wireless network card can be multiple. For example, as shown in FIG8 , the two antenna interfaces of the WiFi module are respectively provided with antenna switching switches.

[0215] In some embodiments, the wireless communication module in the wireless network card is further configured to measure and output the signal reception strength of each antenna connected to the antenna switching switch. In some examples, when the target application meets preset conditions, the wireless communication module can perform measurements under the control of the CPU. Optionally, the measurement instruction sent by the CPU to the wireless communication module carries a measurement duration and a measurement type, where the measurement type indicates the performance type of the antenna signal being measured, such as signal reception strength, signal transmission speed, etc.

[0216] Optionally, the signal reception strength of each antenna may be obtained in other ways, for example, the signal reception strength of each antenna may be calculated based on parameters such as the transmission speed measured when each antenna is in operation.

[0217] In some examples, the radiation type of the antenna is a directional antenna or an omnidirectional antenna. The specific embodiments of the wireless network card can be combined with Figures 4 to 8, and refer to the detailed description of the above embodiments, which will not be repeated here.

[0218] As shown in Figure 13, an embodiment of the present application provides an antenna switching method for switching and controlling the antenna in a wireless network card. The wireless network card includes a wireless communication module, an antenna switching switch, and an antenna. The wireless communication module is provided with an antenna interface for connecting to an antenna. Each of the at least one antenna interface is provided with an antenna switching switch for switching the target antenna connected to the antenna interface.

[0219] The antenna switching method includes the following steps S1310-S1330:

[0220] S1310: When a preset condition is met, instruct the antenna switching switch to connect to multiple antennas respectively to obtain signal reception strengths of the multiple antennas.

[0221] The preset conditions may include one or more of the following: the target application is in a stuck state, the target application's network latency is greater than a preset latency threshold, or the target application is in a startup state. For example, if target application A is in a startup state, target application A may be considered to have met the preset conditions. For another example, if target application B is in a stuck state, target application B may be considered to have met the preset conditions. For another example, if target application C is in a startup state and the target application C's network latency is greater than a preset latency threshold, target application C may be considered to have met the preset conditions.

[0222] In some embodiments, the antenna switching method can be applied to a controller. The controller can include a WiTAS monitoring module. In some examples, as shown in FIG12 , the controller can monitor the operating data of an application through the WiTAS monitoring module. Based on the current operating status of certain designated applications in the electronic device, the electronic device can instruct the antenna switching switch to connect to multiple antennas, thereby ensuring that the signal reception strength of each antenna is measured.

[0223] In some examples, the designated application may be set by the user or determined by the electronic device based on preset rules.

[0224] For example, as shown in FIG12 and the embodiments related to FIG12 , the WiTAS module in the idle state can monitor the application and, when the target application meets the preset conditions, transfer from the idle state to the transit state to perform action 2 to instruct the antenna switching switch to connect to multiple antennas respectively to obtain the signal reception strength of the multiple antennas.

[0225] In some embodiments, the wireless communication module can be configured to measure and output the signal reception strength of each antenna connected to the antenna switch. When measuring the antenna signal reception strength, the wireless communication module in the wireless network card can be instructed to measure the signal reception strength of the antenna connected to the antenna switch, and then the measurement result of the wireless communication module can be obtained.

[0226] In some examples, when instructing the wireless communication module in the wireless network card to measure the signal reception strength of the antenna connected to the antenna switch, the wireless communication module may be instructed to measure the signal reception strength of the antenna connected to the antenna switch within a fourth preset time period. For example, the signal reception strength of the antenna may be measured within 0.5 seconds to ensure the accuracy of the measurement result.

[0227] Some embodiments of step S1310 can be found in the detailed description of the above specific embodiments, which will not be repeated here.

[0228] S1320: Determine a target antenna among the multiple antennas according to the signal reception strength.

[0229] In some embodiments, the multiple antennas include a first antenna and a second antenna. A target antenna among the multiple antennas can be determined based on received signal strength using the following process: First, the relationship between the first received signal strength of the first antenna and the second received signal strength of the second antenna can be determined. If the first received signal strength is greater than the second received signal strength, the first antenna is determined to be the target antenna. If the first received signal strength is less than the second received signal strength, the second antenna is determined to be the target antenna.

[0230] In some examples, the difference between the first signal reception strength of the first antenna and the second signal reception strength of the second antenna can be determined. If the difference is greater than 0, it can be indicated that the first signal reception strength is stronger, and the first antenna can be determined to be the target antenna. If the difference is less than 0, it can be indicated that the second signal reception strength is stronger, and the second antenna can be determined to be the target antenna.

[0231] For example, calculate the difference M between the first antenna's first received signal strength RSSI1 and the second antenna's second received signal strength RSSI2: RSSI1 - RSSI2. If the difference is greater than 0, it indicates that the first antenna's received signal strength RSSI1 is greater than the second antenna's received signal strength RSSI2, and the first antenna can be used as the target antenna. If the difference is less than 0, it indicates that the first antenna's received signal strength RSSI1 is less than the second antenna's received signal strength RSSI2, and the second antenna can be used as the target antenna.

[0232] In some examples, if there are three or more antennas, any one of the multiple antennas can be selected as the first antenna, and the remaining antennas can be compared as second antennas. After comparing any two of the multiple antennas, the target antenna can be determined. For example, the multiple antennas include antenna A, antenna B, and antenna C. Antenna A can be selected as the first antenna, and antennas B and C can be selected as the second antennas. If antenna B is selected as the target antenna from antennas A and B, and antenna C is selected as the target antenna from antennas A and C, antenna B can be selected as the first antenna and antenna C can be selected as the second antenna. The target antenna selected from antennas B and C can be the final target antenna.

[0233] Optionally, if the difference between the first signal reception strength of the first antenna and the second signal reception strength of the second antenna is 0, it means that either the first antenna or the second antenna can be used as the target antenna.

[0234] Optionally, the signal reception strengths of the first and second antennas may be obtained multiple times. Based on the multiple sets of obtained signal reception strengths, numerical comparisons may be performed. The target antenna may then be accurately determined based on the comparison results. If the comparison results indicate that the first signal reception strength is multiple times greater than the second signal reception strength, the first antenna may be determined to be the target antenna. If the comparison results indicate that the first signal reception strength is multiple times less than the second signal reception strength, the second antenna may be determined to be the target antenna. For example, the first signal reception strength of the first antenna and the second signal reception strength of the second antenna may be obtained multiple times, and the difference between the first signal reception strength of the first antenna and the second signal reception strength of the second antenna obtained each time may be calculated. If the difference is greater than 0 for the mth time, the first antenna may be determined to be the target antenna, where m is a positive integer. If the difference is less than 0 for the mth time, the second antenna may be determined to be the target antenna. For example, the first signal reception strength RSSI11 of the first antenna may be obtained as RSSI11 and the second signal reception strength RSSI21 of the second antenna, and the first signal reception strength RSSI12 of the first antenna may be obtained as RSSI22 and the second signal reception strength RSSI22 of the second antenna. Based on the two test results, two differences are calculated: M1 = RSSI11 - RSSI21, and M2 = RSSI12 - RSSI22. If m is 2 and both M1 and M2 are greater than 0, it can be considered that the difference is greater than 0 for the mth time, and the first antenna is determined to be the target antenna.

[0235] S1330: Connect the antenna switch to the target antenna.

[0236] In some embodiments, the antenna switching switch is connected to the antenna interface configured by the wireless communication module in the wireless network card. The target antenna can be connected to the antenna interface of the wireless communication module through the antenna switching switch, so that the wireless communication module is connected to the target antenna, thereby ensuring that the wireless communication module can use the target antenna to receive wireless signals. For example, if the target antenna is antenna ANT3. As shown in Figure 4, at this time, the antenna switching switch is connected to antenna ANT2, then the terminal a of the antenna switching switch can be connected to the terminal c, thereby ensuring that the target antenna ANT3 is connected to the antenna interface B of the wireless communication module through the antenna switching switch SW. Among them, the specific control process of the electronic device on the antenna switching switch can be referred to the above embodiment and will not be repeated here.

[0237] In some embodiments, the connection between the antenna switch and the target antenna can be controlled based on the absolute value of the difference. In response to the absolute value of the difference being greater than or equal to a second preset threshold, the antenna switch is controlled to switch the connection to the target antenna and maintain the connection with the target antenna for a second preset duration. In response to the absolute value of the difference being less than the second preset threshold and greater than or equal to the first preset threshold, the antenna switch is controlled to switch the connection to the target antenna and maintain the connection with the target antenna for a third preset duration. The second preset duration is greater than the third preset duration.

[0238] In some embodiments, after determining the absolute value of the difference, in response to the absolute value of the difference being less than a first preset threshold, the electronic device can determine that the antenna currently connected to the antenna switching switch is the target antenna and maintain the connection with the target antenna within a first preset time period.

[0239] For example, the second preset threshold value A is 6dB, the first preset threshold value B is 3dB, the second preset duration A is 60s, the third preset duration B is 30s, and the first preset duration C is 20s. The difference M between the first antenna's first signal reception strength RSSI1 and the second antenna's second signal reception strength RSSI2 is RSSI1-RSSI2. If M > 0, it indicates that the first antenna has a stronger signal strength and can be set as the target antenna. Next, if |M| ≥ 6, it can be determined that after the antenna switch switches to the first antenna, it will not switch again within 60s and will maintain its connection with the first antenna. If 3 ≤ |M| < 6, it can be determined that after the antenna switch switches to the WiFi module and connects to the first antenna, it will not switch again within 30s and will maintain its connection with the first antenna. If |M| < 3, it can be determined that the antenna switch does not need to switch antennas and will not switch again within 20s, maintaining its connection with the currently connected antenna. In addition, please refer to the above specific embodiment of the WiTAS module determining the corresponding target antenna and the corresponding freezing time according to whether the difference between the signal reception strengths of different antennas meets the preset range, which will not be repeated here.

[0240] In some embodiments, the controller includes a wireless transmit antenna selection WiTAS module. The controller can determine whether the current situation meets the preset conditions (such as action 1 in Figure 12) through the WiTAS module in the first state (such as the idle state in Figure 12). If the WiTAS module in the first state determines that the current situation meets the preset conditions (such as transition condition 1 in Figure 12), the controller controls the WiTAS module to transition from the first state to the second state (such as the transition state in Figure 12). The WiTAS module in the second state determines whether the current situation meets the preset conditions, and instructs the antenna switching switch to connect to multiple antennas respectively, obtains the signal reception strength of the multiple antennas, and determines the target antenna among the multiple antennas based on the signal reception strength (such as action 2 in Figure 12). If the WiTAS module in the second state determines that the current situation meets the preset conditions and determines the target antenna (such as transition condition 3 in Figure 12), the controller controls the WiTAS module to transition from the second state to the third state (such as the stable state in Figure 12). The controller connects the antenna switching switch to the target antenna through the WiTAS module in the third state (action 3 in Figure 12).

[0241] In some examples, if the WiTAS module in the second state determines that the current situation does not meet a preset condition (such as transition condition 2 in FIG. 12 ), the WiTAS module is controlled to transition from the second state to the first state.

[0242] In some examples, after the controller connects the antenna switch to the target antenna via the WiTAS module in the third state, the controller determines whether the current situation satisfies a preset condition via the WiTAS module in the third state (such as action 3 in FIG. 12 ). If the WiTAS module in the third state determines that the current situation satisfies the preset condition (such as transition condition 4 in FIG. 12 ), the controller controls the WiTAS module to transition from the third state to the second state.

[0243] In some examples, after the controller connects the antenna switch to the target antenna via the WiTAS module in the third state, the controller determines whether the current situation satisfies a preset condition via the WiTAS module in the third state (such as action 3 in FIG. 12 ). If the WiTAS module in the third state cannot determine whether the current situation satisfies the preset condition (such as transition condition 5 in FIG. 12 ), where the preset condition is, for example, that the target application is in a stuck state, the controller can control the WiTAS module in the third state to transition from the third state to the first state.

[0244] In some examples, after the controller connects the antenna switch to the target antenna via the WiTAS module in the third state, the controller determines via the WiTAS module in the third state whether the current situation satisfies a preset condition (such as action 3 in FIG. 12 ). If the WiTAS module in the third state determines that the current situation does not satisfy the preset condition (such as transition condition 6 in FIG. 12 ), the controller controls the WiTAS module to remain in the third state.

[0245] Thus, embodiments of the present application provide a wireless network card in which an antenna switch can switch the antenna connected to the wireless communication module. If one of the multiple antennas is blocked from receiving or transmitting wireless signals, the remaining antennas can still receive and transmit wireless signals normally, thereby improving the wireless network card's anti-interference capabilities. Furthermore, the multiple antennas ensure that there are no blind spots for wireless signal reception or transmission, thereby improving wireless signal coverage.

[0246] An antenna switching method provided in an embodiment of the present application configures an antenna switching switch in a wireless network card of an electronic device, and the wireless network card increases the number of connectable antennas through the antenna switching switch, thereby ensuring the signal coverage of the wireless network card. The method can also effectively improve the communication performance of the electronic device by controlling the wireless switching switch to select a suitable antenna when preset conditions are met. Through the wireless network card and antenna switching method provided in an embodiment of the present application, the wireless communication module included in the wireless network card can achieve the same communication effect as a wireless communication module with a larger number of antenna interfaces on the basis of a smaller number of antenna interfaces, thereby ensuring that the communication effect is improved while the production cost does not increase or increases less.

[0247] The present application also provides an antenna switching device, which is used to execute the above-mentioned antenna switching method.

[0248] In some embodiments, the antenna switching device may be an electronic device as shown in Figure 3. In another example, the antenna switching device may be a controller, such as the processor in Figure 3.

[0249] In some embodiments, the antenna switching device further includes a wireless network card as described in the above embodiments.

[0250] In this way, the antenna switching device can determine the operating status of a target application and, if the target application meets preset conditions, instruct the antenna switching switch in the wireless network card to connect to multiple antennas to obtain the signal reception strength of the multiple antennas. The antenna switching device can then select the appropriate antenna by controlling the wireless switching switch, effectively improving the communication performance of the antenna switching device.

[0251] The antenna switching method provided by the embodiment of the present application is described in detail above with reference to Figures 4 to 13. The electronic device provided by the embodiment of the present application is described in detail below with reference to Figure 14.

[0252] In one possible design, Figure 14 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. As shown in Figure 14, electronic device 1400 may include: a processing unit 1401 and a transceiver unit 1402. Electronic device 1400 may be used to implement the functions of the electronic device involved in the above method embodiments.

[0253] Optionally, the processing unit 1401 is used to support the electronic device 1400 to execute S1001-S1013 in Figure 10, and is also used to support the electronic device 1400 to execute S1310-S1330 in Figure 13.

[0254] Optionally, the transceiver unit 1402 is used to support the electronic device 1400 to execute S1001-S1013 in Figure 10, and is also used to support the electronic device 1400 to execute S1310-S1330 in Figure 13.

[0255] The transceiver unit may include a receiving unit and a transmitting unit, and may be implemented by a transceiver or transceiver-related circuit components, and may be a transceiver or a transceiver module. The operations and / or functions of each unit in the electronic device 1400 are respectively for implementing the corresponding processes of the antenna switching method in the above-mentioned method embodiment. All relevant contents of each step involved in the above-mentioned method embodiment can be referred to the functional description of the corresponding functional unit, and for the sake of brevity, they are not repeated here.

[0256] Optionally, the electronic device 1400 shown in FIG14 may further include a storage unit (not shown in FIG14 ) storing a program or instruction. When the processing unit 1401 and the transceiver unit 1402 execute the program or instruction, the electronic device 1400 shown in FIG14 may perform the antenna switching method in the above method embodiment.

[0257] The technical effects of the electronic device 1400 shown in FIG14 may refer to the technical effects of the antenna switching method in the above method embodiment, and will not be described in detail here.

[0258] In addition to being in the form of the electronic device 1400, the technical solution provided in the embodiment of the present application may also be a functional unit or chip in the electronic device, or a device used in conjunction with the electronic device.

[0259] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step in the above-mentioned method embodiment.

[0260] An embodiment of the present application further provides a computer program product, including a computer program. When the computer program runs on an electronic device, the electronic device executes each function or step in the above method embodiment.

[0261] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0262] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0263] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0264] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0265] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0266] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. An antenna switching method, characterized in that: The method is used to control the switching of an antenna in a wireless network card, wherein the wireless network card comprises a wireless communication module, an antenna switching switch, and an antenna; the wireless communication module is provided with an antenna interface, and the antenna interface is used to connect the antenna; wherein each of at least one of the antenna interfaces is provided with the antenna switching switch, and the antenna switching switch is used to switch a target antenna connected to the antenna interface; The method comprises: When a preset condition is met, instructing the antenna switching switch to connect to each of the multiple antennas respectively to obtain signal reception strengths of the multiple antennas; Determining a target antenna among the multiple antennas according to the signal reception strength; Connect the antenna switch to the target antenna.

2. The method according to claim 1, characterized in that The multiple antennas include a first antenna and a second antenna, and determining a target antenna among the multiple antennas according to the signal reception strength includes: Determine a magnitude relationship between a first signal reception strength of the first antenna and a second signal reception strength of the second antenna; In response to the first signal reception strength being greater than the second signal reception strength, determining that the first antenna is a target antenna; In response to the first signal reception strength being less than the second signal reception strength, determining the second antenna as a target antenna.

3. The method according to claim 1, characterized in that The multiple antennas include a first antenna and a second antenna, and determining a target antenna among the multiple antennas according to the signal reception strength includes: In response to the absolute value of the difference between the first signal reception strength of the first antenna and the second signal reception strength of the second antenna being less than a first preset threshold, the antenna currently connected to the antenna switching switch is determined to be the target antenna, and the connection with the target antenna is maintained within a first preset time period.

4. The method according to claim 2 or 3, characterized in that: The step of connecting the antenna switching switch to the target antenna includes: In response to an absolute value of a difference between the first signal reception strength and the second signal reception strength being greater than or equal to a second preset threshold, controlling the antenna switching switch to switch to the target antenna and maintain the connection with the target antenna for a second preset time period; In response to the absolute value of the difference between the first signal reception strength and the second signal reception strength being less than the second preset threshold, and the absolute value of the difference being greater than or equal to the first preset threshold, the antenna switching switch is controlled to switch the connection to the target antenna and maintain the connection with the target antenna within a third preset time length, and the second preset time length is greater than the third preset time length.

5. The method according to any one of claims 1 to 3, characterized in that: The wireless communication module is used to measure and output the signal reception strength of the antenna connected to the antenna switching switch.

6. The method according to any one of claims 1 to 3, characterized in that The preset conditions include one or more of the following: the running state of the target application is stuck, the network delay of the target application is greater than a preset delay threshold, and the target application is in a startup state.

7. The method according to claim 1, characterized in that The method is applied to a controller, the controller is connected to a wireless network card, and the controller is used to switch and control the antenna switch based on the signal reception strength of the multiple antennas; the controller includes a wireless transmission antenna selection WiTAS module; The method of instructing the antenna switching switch to connect to each of the multiple antennas respectively to obtain the signal receiving strength of the multiple antennas when the preset conditions are met includes: Determining, by the WiTAS module in the first state, whether the current situation meets a preset condition; In response to the current situation satisfying a preset condition, the WiTAS module changes from a first state to a second state; Determining whether the current situation meets a preset condition by the WiTAS module in the second state, and instructing the antenna switching switch to connect to multiple antennas respectively to obtain signal reception strengths of the multiple antennas; The step of determining a target antenna among the multiple antennas according to the signal reception strength includes: Determining, by the WiTAS module in the second state, a target antenna among the multiple antennas according to the signal reception strength; The step of connecting the antenna switching switch to the target antenna includes: In response to the current situation satisfying the preset condition and the target antenna being determined, the WiTAS module changes from the second state to the third state, and the antenna switch is connected to the target antenna through the WiTAS module in the third state.

8. A wireless network card, characterized in that: include: Wireless communication module, antenna switching switch, antenna; The wireless communication module is provided with an antenna interface, and the antenna interface is used to connect the antenna; Among them, each of at least one of the antenna interfaces is provided with the antenna switching switch, and the antenna switching switch is used to switch the target antenna connected to the antenna interface; the target antenna is determined based on the signal reception strength of all antennas connected to the antenna switching switch.

9. The wireless network card according to claim 8, characterized in that: The wireless communication module is used to measure and output the signal reception strength of each antenna connected to the antenna switching switch.

10. The wireless network card according to claim 8 or 9, characterized in that: The radiation type of the antenna is a directional antenna or an omnidirectional antenna.

11. An antenna switching device, characterized in that: The antenna switching device is used to execute the method according to any one of claims 1 to 7.

12. An antenna switching device, characterized in that: The antenna switching device includes a controller and a wireless network card as described in any one of claims 8-10.

13. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 7.

14. An antenna switching method, characterized in that: The method is used to control the switching of an antenna in a wireless network card, wherein the wireless network card comprises a wireless communication module, an antenna switching switch, and an antenna; the wireless communication module is provided with an antenna interface, and the antenna interface is used to connect the antenna; wherein each of at least one of the antenna interfaces is provided with the antenna switching switch, and the antenna switching switch is used to switch a target antenna connected to the antenna interface; The method comprises: In the case where a preset condition is met, instructing the antenna switching switch to connect to each of the multiple antennas respectively to obtain the signal reception strength of the multiple antennas; the multiple antennas include a first antenna and a second antenna; Determining a target antenna among the multiple antennas according to the signal reception strength; Connecting the antenna switch to the target antenna; Wherein, connecting the antenna switching switch to the target antenna includes: In response to an absolute value of a difference between a first signal reception strength of the first antenna and a second signal reception strength of the second antenna being greater than or equal to a second preset threshold, controlling the antenna switch to switch to the target antenna and maintain the connection with the target antenna for a second preset time period; In response to the absolute value of the difference between the first signal reception strength and the second signal reception strength being less than the second preset threshold, and the absolute value of the difference being greater than or equal to the first preset threshold, the antenna switching switch is controlled to switch the connection to the target antenna and maintain the connection with the target antenna within a third preset time length, and the second preset time length is greater than the third preset time length.

15. The method according to claim 14, characterized in that The step of determining a target antenna among the multiple antennas according to the signal reception strength includes: Determine a magnitude relationship between a first signal reception strength of the first antenna and a second signal reception strength of the second antenna; In response to the first signal reception strength being greater than the second signal reception strength, determining that the first antenna is a target antenna; In response to the first signal reception strength being less than the second signal reception strength, determining the second antenna as a target antenna.

16. The method according to claim 14, characterized in that The step of determining a target antenna among the multiple antennas according to the signal reception strength includes: In response to the absolute value of the difference between the first signal reception strength of the first antenna and the second signal reception strength of the second antenna being less than a first preset threshold, the antenna currently connected to the antenna switching switch is determined to be the target antenna, and the connection with the target antenna is maintained within a first preset time period.

17. The method according to any one of claims 14 to 16, characterized in that: The wireless communication module is used to measure and output the signal reception strength of the antenna connected to the antenna switching switch.

18. The method according to any one of claims 14 to 16, characterized in that: The preset conditions include one or more of the following: the running state of the target application is stuck, the network delay of the target application is greater than a preset delay threshold, and the target application is in a startup state.

19. The method according to claim 14, characterized in that The method is applied to a controller, the controller is connected to a wireless network card, and the controller is used to switch and control the antenna switch based on the signal reception strength of the multiple antennas; the controller includes a wireless transmission antenna selection WiTAS module; The method of instructing the antenna switching switch to connect to each of the multiple antennas respectively to obtain the signal receiving strength of the multiple antennas when the preset conditions are met includes: Determining, by the WiTAS module in the first state, whether the current situation meets a preset condition; In response to the current situation satisfying a preset condition, the WiTAS module changes from a first state to a second state; Determining whether the current situation meets a preset condition by the WiTAS module in the second state, and instructing the antenna switching switch to connect to multiple antennas respectively to obtain signal reception strengths of the multiple antennas; The step of determining a target antenna among the multiple antennas according to the signal reception strength includes: Determining, by the WiTAS module in the second state, a target antenna among the multiple antennas according to the signal reception strength; The step of connecting the antenna switching switch to the target antenna further includes: In response to the current situation satisfying the preset condition and the target antenna being determined, the WiTAS module changes from the second state to the third state, and the antenna switch is connected to the target antenna through the WiTAS module in the third state.

Citation Information

Patent Citations

  • Antenna switching method, terminal and compute readable storage medium

    CN107483075A

  • Antenna switching method, terminal and computer readable storage medium

    CN107769833A

  • Antenna selection method, electronic equipment and storage medium

    CN114978270A

  • Antenna switching method, wireless network card and antenna switching device

    CN116545491A

  • Wireless communication circuit supporting antenna diversity

    US20130176878A1