Antenna switching method and related device

By detecting and switching antennas, the packet loss problem caused by antenna switching when multiple communication modules share the same antenna is solved, and the optimization of communication quality of specific communication modules and the reduction of the impact of communication between other modules is achieved.

CN118944719APending Publication Date: 2024-11-12GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310528711.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-10
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

When multiple communication modules share the same antenna, when antenna switching optimizes the communication quality of a single communication module, it is easy to cause data packets of other communication modules that share the same antenna, affecting their communication quality.

Method used

By detecting whether the communication quality parameters of the first antenna meet the preset switching conditions of a specific communication module, and when both communication modules are in a state of no data transmission, switch their shared antennas to other antennas to avoid antenna switching caused by antenna switching packet loss and communication impact.

Benefits of technology

While meeting the communication quality requirements of specific communication modules, the impact of antenna switching on other communication modules is avoided, ensuring the optimization and stability of communication quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118944719A_ABST
    Figure CN118944719A_ABST
Patent Text Reader

Abstract

The invention provides an antenna switching method and a related device, which are applied to electronic equipment, and a first communication module and a second communication module of the electronic equipment share a first antenna in a plurality of antennas. The method comprises the following steps: when a value of a communication quality parameter of a first antenna meets a preset antenna switching condition of a first communication module, detecting a first data transmission state of the first communication module and a second data transmission state of a second communication module; and when the first data transmission state and the second data transmission state are both target states, the first communication module and the second communication module are switched to share a second antenna except the first antenna in the multiple antennas, and the target states refer to states in which the communication modules have no data transmission. According to the embodiment of the invention, when the antenna is switched to meet the communication quality requirement of the specific communication module, the problem that the communication of other communication modules is affected due to the loss of data packets of other communication modules sharing the antenna with the specific communication module caused by antenna switching is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of mobile terminal technology, and in particular to an antenna switching method and related devices. Background Art

[0002] In order to save device layout space in electronic devices, multiple communication modules are usually set to share the same antenna for data transmission and reception. At present, when switching antennas to optimize the communication quality of a single communication module, it usually affects the communication of other communication modules that share the same antenna with the single communication module. Summary of the invention

[0003] The embodiments of the present application provide an antenna switching method and related devices, so as to switch the antenna to meet the communication quality requirements of a specific communication module while avoiding the problem of data packet loss of other communication modules sharing the same antenna with the specific communication module due to antenna switching, thereby affecting the communication of other communication modules.

[0004] In a first aspect, an embodiment of the present application provides an antenna switching method, which is applied to an electronic device, wherein the electronic device includes a first communication module, a second communication module, and multiple antennas, and the first communication module and the second communication module share a first antenna among the multiple antennas; the method includes:

[0005] When the value of the communication quality parameter of the first antenna meets the preset antenna switching condition of the first communication module, detecting a first data transmission state of the first communication module and a second data transmission state of the second communication module, the preset antenna switching condition being used to characterize that the value of the communication quality parameter of the first antenna is lower than a preset quality parameter value;

[0006] When both the first data transmission state and the second data transmission state are target states, the first communication module and the second communication module are switched to share a second antenna other than the first antenna among the multiple antennas, and the target state refers to a state where the communication module has no data transmission.

[0007] In a second aspect, an embodiment of the present application provides an antenna switching device, which is applied to an electronic device, wherein the electronic device includes a first communication module, a second communication module, and multiple antennas, and the first communication module and the second communication module share a first antenna among the multiple antennas; the device includes:

[0008] a detection unit, configured to detect a first data transmission state of the first communication module and a second data transmission state of the second communication module when the value of the communication quality parameter of the first antenna satisfies a preset antenna switching condition of the first communication module, wherein the preset antenna switching condition is used to indicate that the value of the communication quality parameter of the first antenna is lower than a preset quality parameter value;

[0009] A switching unit is used to switch the first communication module and the second communication module to share a second antenna other than the first antenna among the multiple antennas when the first data transmission state and the second data transmission state are both target states, and the target state refers to a state in which the communication module has no data transmission.

[0010] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:

[0011] one or more processors;

[0012] One or more memories for storing programs,

[0013] The one or more memories and the program are configured so that the one or more processors control the device to execute the steps in the method according to the first aspect.

[0014] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute some or all of the steps described in the first aspect of the embodiment of the present application.

[0015] In a fifth aspect, the present application provides a computer program, wherein the computer program is operable to cause a computer to execute some or all of the steps described in any method of the first aspect of the present application. The computer program may be a software installation package.

[0016] It can be seen that in the embodiment of the present application, when the first communication module and the second communication module in the electronic device share the first antenna, the electronic device detects the first data transmission state of the first communication module and the second data transmission state of the second communication module when the value of the communication quality parameter of the first antenna meets the preset antenna switching condition of the first communication module, and when the first data transmission state and the second data transmission state are both target states with no data transmission, the second antenna other than the first antenna among the multiple antennas shared by the first communication module and the second communication module is switched. That is, when the communication quality of the first antenna is lower than the preset communication quality required by the first communication module, the electronic device can detect the data transmission state of the first communication module and the second communication module that share the same antenna with the first communication module, and when both communication modules are in a state with no data transmission, the first antenna shared by the two communication modules is switched to the second antenna. While switching the antenna to meet the communication quality requirements of a specific communication module, it avoids the problem that the data packets of other communication modules that share the antenna with the specific communication module are lost due to antenna switching, thereby affecting the communication of other communication modules. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1a It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0019] Figure 1b is a schematic diagram of a radio frequency circuit of another electronic device provided in an embodiment of the present application;

[0020] Figure 2a is a flowchart of an antenna switching method provided in an embodiment of the present application;

[0021] Figure 2b It is a schematic diagram of the antenna arrangement position of an electronic device provided in an embodiment of the present application;

[0022] Figure 2c is a flowchart of another antenna switching method provided in an embodiment of the present application;

[0023] Figure 3a It is a schematic diagram of the structure of an antenna switching device provided in an embodiment of the present application;

[0024] Figure 3bIt is a schematic diagram of the composition structure of another antenna switching device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0026] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0027] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0028] The electronic devices involved in the embodiments of the present application may include various handheld devices with wireless communication functions, vehicle-mounted devices, wearable devices, computing devices or other processing devices connected to a wireless modem, as well as various forms of user equipment (UE), mobile stations (MS), terminal devices, etc. For the convenience of description, the above-mentioned devices are collectively referred to as electronic devices.

[0029] The embodiment of the present application provides an antenna switching method and related devices, and the embodiment of the present application is described in detail below with reference to the accompanying drawings.

[0030] The components and structures of the electronic devices in this application can be as follows: Figure 1aAs shown, the electronic device may include a processor 110, a memory 120, a communication interface 130, and one or more programs 121, wherein the one or more programs 121 are stored in the above-mentioned memory 120 and are configured to be executed by the above-mentioned processor 110, and the one or more programs 121 include instructions for executing any step of the electronic device in the above-mentioned method embodiment. Among them, the communication interface 130 is used to support communication between the electronic device and other devices. In a specific implementation, the processor 110 is used to execute any step performed by the electronic device in the following method embodiment, and when performing data transmission such as sending, the communication interface 130 can be selectively called to complete the corresponding operation. It should be noted that the structural diagram of the above-mentioned electronic device is only an example, and the specific devices included may be more or less, and are not uniquely limited here.

[0031] The communication interface 130 may include the first communication module and the second communication module described in the embodiment of the present application. The first communication module and the second communication module may support different communication types. For example, the first communication module may be a WiFi communication module for supporting the electronic device to perform WiFi communication with other electronic devices, and the second communication module may be a Bluetooth communication module for supporting the electronic device to perform Bluetooth communication with other electronic devices.

[0032] Also, see Figure 1b , Figure 1b is a schematic diagram of a radio frequency circuit of an electronic device provided in an embodiment of the present application. The electronic device may include multiple antennas, such as Figure 1b In the exemplary antenna 1, antenna 2 and antenna 3 shown in the figure, both the first communication module and the second communication module can be directly connected to the antenna 3, or both the first communication module and the second communication module can select to connect to the antenna 1 or the antenna 2 through the radio frequency switch.

[0033] in, Figure 1b The connection relationship between one communication module and the antenna is only shown as an example. In actual applications, when multiple communication modules are connected to the antenna, the connection method between each communication module and the antenna can be as follows: Figure 1b shown.

[0034] Among them, the same communication module can be connected to different RF amplification modules through different data transmission interfaces, and then connected to different antennas (for example Figure 1b The first communication module or the second communication module is connected to different RF amplification modules and different antennas 1 and 3 through different data transmission interfaces, or different signal paths between different antennas and the same communication module can be switched through a RF switch (for example, by controlling Figure 1bThe state of the RF switch in the middle can choose to open the signal path between the first communication module or the second communication module and the antenna 1, or choose to open the signal path between the first communication module or the second communication module and the antenna 2).

[0035] Different antennas can be set at different positions in the electronic device, and when part of the antenna is blocked, the communication quality of the antenna can be optimized by switching to other antennas. For example, antenna 2 can be used as a diversity antenna for antenna 1, and antenna 1 and antenna 2 are set at different positions of the electronic device. When antenna 1 is blocked and the signal quality deteriorates, the RF switch can be controlled to select the signal path where the unblocked antenna 2 is located, thereby optimizing the signal quality.

[0036] It should be noted that in actual applications, the components included in the RF circuit may be fewer or more, and the connection relationship between the components in the circuit may also be the same. Figure 1b For example, when more antennas are included, it is also possible to set Figure 1b The antenna 4 and the antenna 3 other than the antenna shown are connected to the same RF amplification module through a RF switch, and then connected to the first communication module or the second communication module. The number of antennas is not limited to Figure 1b The three examples in the example can all be set according to actual needs and are not specifically limited here.

[0037] See also Figure 2a , Figure 2a is a flow chart of an antenna switching method provided in an embodiment of the present application. The antenna switching method can be applied to Figure 1a The electronic device shown in the figure comprises a first communication module, a second communication module and a plurality of antennas, wherein the first communication module and the second communication module share a first antenna among the plurality of antennas. Figure 2a As shown, the antenna switching method includes the following steps:

[0038] Step 201: When the communication quality parameter of the first antenna meets a preset antenna switching condition of the first communication module, a first data transmission state of the first communication module and a second data transmission state of the second communication module are detected.

[0039] The preset antenna switching condition is used to indicate that a value of a communication quality parameter of the first antenna is lower than a preset quality parameter value.

[0040] The first communication module and the second communication module may be communication modules for transmitting and receiving signals of the same or similar frequency bands. For example, the first communication module may be a WiFi communication module, and the second communication module may be a Bluetooth module.

[0041] The value of the communication quality parameter may be, for example, a transmission rate, a signal strength, etc. A higher value of the communication quality parameter indicates better communication quality.

[0042] In a specific implementation, the preset antenna condition of the first communication module may be, for example: detecting that the value of the communication quality parameter of the antenna in the signal path where the first communication module is currently located is lower than the preset quality parameter value.

[0043] Furthermore, the electronic device may save a first mapping relationship between different communication modules and parameter value sets. In step 201, the electronic device may determine a quality parameter value set corresponding to the first communication module based on the saved first mapping relationship. A single quality parameter value set may also include a mapping relationship between different applications and quality parameter values. Further, after determining the quality parameter value set corresponding to the first communication module, the value of the quality parameter corresponding to the source application of the data currently transmitted by the first communication module may be further determined based on the second mapping relationship as the preset quality parameter value, and further using the preset quality parameter value as a standard to determine whether the communication quality parameter of the first antenna meets the preset antenna switching condition of the first communication module.

[0044] Furthermore, the electronic device may be arranged to determine whether the communication quality parameters of the first antenna meet the preset antenna switching conditions of the first communication module at regular intervals after the first communication module is started. Alternatively, the electronic device may be arranged to detect whether the communication quality parameters of the first antenna meet the preset antenna switching conditions of the first communication module when detecting specific event information of the electronic device, such as when detecting that the first communication module is transmitting game application data or other data with high communication quality requirements. No specific restrictions are made here.

[0045] Step 202: When both the first data transmission state and the second data transmission state are target states, switch the first communication module and the second communication module to share a second antenna among the multiple antennas except the first antenna.

[0046] The target state refers to a state where the communication module has no data transmission.

[0047] In a specific implementation, when selecting the second antenna in step 202, for example, the second antenna may be determined from antennas other than the first antenna among the multiple antennas according to the user's holding posture or the horizontal / vertical screen usage state of the electronic device, for example Figure 2b As shown, assuming that the first antenna is detected to be located within the user's hand holding area marked by the dotted box, when determining the second antenna, an antenna located outside the user's hand holding area may be selected as the second antenna. For example, Figure 2bIn addition, the second antenna can be determined by combining one or more information such as the communication type of the first communication module, the signal frequency band of the data transmitted by the first communication module, and the communication quality of each antenna actually detected.

[0048] Alternatively, the electronic device may directly store the switching antenna corresponding to each antenna, and when the antenna needs to be switched, the current antenna is directly switched to the switching antenna corresponding to the current antenna.

[0049] Among them, when the communication module is not started or the communication module is in a sleep state, the communication module will not transmit data. Therefore, when it is detected that the communication module is in the aforementioned specific state where no data transmission is performed, or when it is detected that the communication module is not in the above state (for example, in an active state where data transmission can be performed), the communication module does not actually perform the data transmission action, it can be determined that the data transmission state of the communication module is detected to be the target state.

[0050] It can be seen that in the embodiment of the present application, when the first communication module and the second communication module in the electronic device share the first antenna, the electronic device detects the first data transmission state of the first communication module and the second data transmission state of the second communication module when the value of the communication quality parameter of the first antenna meets the preset antenna switching condition of the first communication module, and when the first data transmission state and the second data transmission state are both target states with no data transmission, the second antenna other than the first antenna among the multiple antennas shared by the first communication module and the second communication module is switched. That is, when the communication quality of the first antenna is lower than the preset communication quality required by the first communication module, the electronic device can detect the data transmission state of the first communication module and the second communication module that share the same antenna with the first communication module, and when both communication modules are in a state with no data transmission, the first antenna shared by the two communication modules is switched to the second antenna. While switching the antenna to meet the communication quality requirements of a specific communication module, it avoids the problem that the data packets of other communication modules that share the antenna with the specific communication module are lost due to antenna switching, thereby affecting the communication of other communication modules.

[0051] In one possible example, detecting the first data transmission status of the first communication module and the second data transmission status of the second communication module includes: delaying for a first preset time period and then simultaneously detecting whether the first communication module and the second communication module have data transmission; if the first communication module is detected to have data transmission, then continuing to detect whether the first communication module has data transmission at intervals of the first preset time period until it is detected that the first communication module has no data transmission, then stopping detecting whether the first communication module has data transmission, and determining that the first data transmission status is the target status; if the second communication module is detected to have data transmission, then continuing to detect whether the second communication module has data transmission at intervals of the first preset time period until it is detected that the second communication module has no data transmission, then stopping detecting whether the second communication module has data transmission, and determining that the second data transmission status is the target status.

[0052] The first preset duration can be set as required, for example, can be set to 10us.

[0053] In a specific implementation, after respectively detecting whether two communication modules are transmitting data, if it is detected that a communication module is not transmitting data, the data transmission status of the communication module may be stopped from being detected, and the communication module may be set to a state where it no longer transmits data. At the same time, the communication module that is still transmitting data is detected at intervals of a first preset time length until it is detected that the communication module is not transmitting data, and the communication module is again set to a state where it no longer transmits data. When both communication modules are in the target state of no data transmission, other subsequent antenna switching steps may be performed.

[0054] It can be seen that in this example, the electronic device simultaneously detects whether there is data transmission in the first communication module and the second communication module after delaying for the first preset time period. If data transmission is detected in a communication module, it continues to detect whether there is data transmission in the communication module at every first preset time interval until it is detected that there is no data transmission in the communication module. Then it stops detecting whether there is data transmission in the communication module, and determines that the data transmission status of the communication module is the target status, which is conducive to accurately and orderly detecting whether the data transmission status corresponding to each communication module is the target transmission status.

[0055] In one possible example, when the first data transmission state and the second data transmission state are both target states, switching the first communication module and the second communication module to share the second antenna other than the first antenna among the multiple antennas includes: when it is detected that the first data transmission state is the target state, switching the first communication module to the sleep state; when it is detected that the second data transmission state is the target state, switching the second communication module to the sleep state; in the sleep state, neither the first communication module nor the second communication module performs data transmission; when both the first communication module and the second communication module are switched to the sleep state, the data transmission path between the first communication module and the second communication module and the second antenna is turned on, and the data transmission path between the first communication module and the second communication module and the first antenna is turned off; the first communication module and the second communication module are switched to the active state, and the data transmission function of the first communication module and the second communication module is enabled in the active state.

[0056] In a specific implementation, considering that the time for detecting that the data transmission status of different communication modules is the target state may be different, the electronic device can control the communication module to be in a sleep state when it detects that the data transmission status of any communication module is the target state. The communication module then suspends transmission of subsequent data and waits for the data transmission status of another communication module to also be the target state. Then, the other communication module can also be switched to a sleep state.

[0057] When the data transmission function is in an enabled state, the communication module can perform normal data transmission. When the communication module is in a sleep state or an unstarted state, the data transmission function is not enabled, and normal data transmission cannot be performed.

[0058] It can be seen that in this example, after the electronic device switches the first communication module and the second communication module to the sleep state, it then turns on the data transmission path between the first communication module and the second communication module and the second antenna, and cuts off the data transmission path between the first communication module and the second communication module and the first antenna, and then switches the first communication module and the second communication module to the active state. In the active state, the data transmission function of the first communication module and the second communication module is in an enabled state, which is beneficial to avoid the communication module starting data transmission before the antenna switching is completed, thereby ensuring the reliability of the equipment operation during the antenna switching process.

[0059] In a possible example, controlling the first communication module and the second communication module to switch to the active state includes: switching the first communication module and the second communication module to the active state after a second preset time interval.

[0060] In a specific implementation, considering that when an electronic device controls the connection status of a device such as a radio frequency switch to change the conduction status between a communication module and different antennas, there is usually a certain delay in the operation of the device. Therefore, after changing the input and output status of the first communication module and the second communication module (i.e., turning on the signal path between the first communication module and the second communication module and the second antenna, and cutting off the signal path between the first communication module and the second communication module and the first antenna), the first communication module and the second communication module may be switched to the active state again after a certain delay, i.e., appropriately delaying the time for resuming data transmission of the communication module, and also avoiding the communication module starting data transmission before the signal path is turned on, thereby causing data transmission errors.

[0061] The second preset time length can be set as needed, for example, can be set to 10us.

[0062] It can be seen that in this example, the electronic device switches the first communication module and the second communication module to the active state after the second preset time interval, which is beneficial to further ensure the reliability of the device operation during the antenna switching process.

[0063] In one possible example, when the first data transmission state and the second data transmission state are both target states, switching the first communication module and the second communication module to share a second antenna other than the first antenna among the multiple antennas includes: determining whether the data transmitted by the first communication module and the data transmitted by the second communication module meet preset conditions, and the preset conditions include: the data transmitted by the first communication module is preset high transmission priority data, and the data transmitted by the second communication module is preset low transmission priority data; if not, then when the first data transmission state and the second data transmission state are both target states, switching the first communication module and the second communication module to share the second antenna; if yes, then when it is detected that the first data transmission state is the target state, switching the first communication module and the second communication module to share the second antenna.

[0064] That is to say, when the data transmitted by the first communication module is the preset high transmission priority data, and the data transmitted by the second communication module is the preset low transmission priority data, the antenna switching is performed when it is detected that the first data transmission state is the target state; and when the data transmitted by the first communication module and the second communication module are both the preset high transmission priority data, or the data transmitted by the first communication module and the second communication module are both the preset low transmission priority data, or the data transmitted by the first communication module is the preset low transmission priority data, and the data transmitted by the second communication module is the preset high transmission priority data, the antenna shared by the first communication module and the second communication module can be switched from the first antenna to the second antenna after it is detected that the first data transmission state is the target state and the second data transmission state is the target state.

[0065] In a specific implementation, the preset high transmission priority data may be, for example, data generated by a specific application in an electronic device, such as data generated in a game application, voice call data, etc., and the low transmission priority data may be, for example, data generated by a picture sharing application, etc.

[0066] Specifically, taking the case where the first communication module and the second communication module are a WiFi communication module and a Bluetooth communication module respectively, the low transmission priority data may be data transmitted using protocols other than the A2DP protocol and the eSCO protocol.

[0067] That is to say, when the data transmitted by the first communication module has a high requirement for immediacy and the data transmitted by the second communication module has a relatively low requirement for transmission quality, when the first data transmission state of the first communication module is the target state, the antenna can be directly switched, allowing the data of the second communication module to be lost.

[0068] It can be seen that in this example, the electronic device can determine whether the data transmitted by the first communication module and the data transmitted by the second communication module meet the preset conditions, and when the preset conditions are met, that is, the data transmitted by the first communication module is the preset high transmission priority data, and the data transmitted by the second communication module is the preset low transmission priority data, when it is detected that the first data transmission state is the target state, the first communication module and the second communication module are switched to share the second antenna; otherwise, the electronic device switches the first communication module and the second communication module to share the second antenna only when it detects that the first data transmission state and the second data transmission state are both the target state. This is beneficial to flexibly optimize the communication quality of the first communication module and reduce the impact on the communication of the second communication module in different application scenarios, so as to adapt to the actual communication quality requirements of the user.

[0069] In one possible example, when it is detected that the first data transmission state is the target state, the first communication module and the second communication module are switched to share the second antenna, including: when it is detected that the first data transmission state is the target state, if the second data state is the target state, the first communication module and the second communication module are switched to share the second antenna; when it is detected that the first data transmission state is the target state, if the second data state is not the target state, waiting for a target time length; if the second data transmission state is detected to be the target state within the target time length, when it is detected that the second data transmission state is the target state, the first communication module and the second communication module are switched to share the second antenna; if the second data transmission state is not detected to be the target state within the target time length, at the end of the target time length, the first communication module and the second communication module are switched to share the second antenna.

[0070] The target duration can be pre-set and pre-stored in the electronic device as required.

[0071] That is to say, when the data transmitted by the first communication module has a high requirement for immediacy, and the data transmitted by the second communication module has a relatively low requirement for transmission quality, after detecting that the first data transmission state is the target state, if the second data transmission state is not the target state, the target time length can be waited for. If the second data transmission state is detected to be the target state within the target time length, the antenna can be switched immediately. At this time, neither the transmission data of the first communication module nor the second communication module will be lost. If the second data transmission state is still not detected to be the target state after waiting for the target time length, the antenna can be switched directly at the end of the target time length, allowing the data transmitted by the second communication module to be lost, thereby avoiding long waiting times that affect the transmission efficiency of the data with high immediacy requirements in the first communication module.

[0072] It can be seen that in this example, if the data transmitted by the first communication module is the preset high transmission priority data, and the data transmitted by the second communication module is the preset low transmission priority data, when the electronic device detects that the first data transmission state is the target state, if the second data state is not the target state, it waits for the target time length, and if the second data transmission state is detected as the target state within the target time length, then when the second data transmission state is detected to be the target state, the antenna is switched; otherwise, at the end of the target time length, the antenna is directly switched, which is beneficial to flexibly optimize the communication quality of the first communication module and reduce the impact on the communication of the second communication module in different application scenarios, so as to adapt to the actual communication quality requirements of the user.

[0073] In a possible example, the target duration is determined by querying a preset correspondence based on a source application of the first data, the preset correspondence includes a correspondence between an application and a waiting duration, and the first data is data transmitted by the first communication module.

[0074] In a specific implementation, for applications such as gaming applications that have high requirements for the timeliness of data transmission, if the antenna switching process takes too long, it will also have a significant adverse impact on the user's application experience. Therefore, the waiting time corresponding to such applications can be set to be shorter. For applications such as video playback applications that pre-cache some video data, the antenna switching process takes a little longer and will not have much impact on the user's application experience. In this case, the waiting time corresponding to such applications can be set to be longer, so as to ensure that data from multiple communication modules will not be lost during the antenna switching process.

[0075] It can be seen that in this example, the target duration is determined by querying the preset correspondence based on the source application of the first data transmitted by the first communication module. The preset correspondence includes the correspondence between the application and the waiting time, which is conducive to flexibly optimizing the communication quality of the first communication module and reducing the impact on the communication of the second communication module during the use of different applications, so as to adapt to the actual communication quality requirements of the user.

[0076] See also Figure 2c , the process of the antenna switching method is described below with reference to specific examples. Take the first communication module and the second communication module as a WiFi communication module and a Bluetooth communication module, respectively, and the first preset duration and the second preset duration are both 10us as an example. If the electronic device detects that the communication quality parameter of the first antenna reaches the preset antenna switching condition, when the Bluetooth communication module follows the A2DP protocol or the eSCO protocol, then for each communication module in the WiFi communication module and the Bluetooth communication module, it is detected whether the communication module is transmitting data at intervals of 10us, until it is detected that the communication module has no data transmission, the data transmission state of the communication module is determined as the target state, and the communication module is switched to the sleep state. After both communication modules are in the target state and both are switched to the sleep state, the general input and output states of the two communication modules can be modified, and after modifying the general input and output states of the two communication modules, a delay of 10us is applied, and then both communication modules are switched back to the active state. In addition, if the Bluetooth communication module does not follow the A2DP protocol or the eSCO protocol, it is only necessary to determine whether the data transmission status of the WiFi communication module is the target state, and when the data transmission status of the WiFi communication module is the target state, both the WiFi communication module and the Bluetooth communication module are switched to the sleep state, and the subsequent antenna switching steps are continued.

[0077] See also Figure 3a , Figure 3a is a functional unit block diagram of an antenna switching device provided in an embodiment of the present application, which can be applied to Figure 1a The electronic device shown in the figure includes a first communication module, a second communication module and multiple antennas, the first communication module and the second communication module share a first antenna among the multiple antennas, and the antenna switching device 30 includes:

[0078] a detection unit 301, configured to detect a first data transmission state of the first communication module and a second data transmission state of the second communication module when the communication quality parameter of the first antenna meets a preset antenna switching condition of the first communication module, wherein the preset antenna switching condition is used to indicate that a value of the communication quality parameter of the first antenna is lower than a preset quality parameter value;

[0079] The switching unit 302 is used to switch the first communication module and the second communication module to share a second antenna other than the first antenna among the multiple antennas when the first data transmission state and the second data transmission state are both target states, and the target state refers to a state in which the communication module has no data transmission.

[0080] In one possible example, the detection unit 301 is specifically used to: after a delay of a first preset time length, respectively and simultaneously detect whether the first communication module and the second communication module have data transmission; if the first communication module is detected to have data transmission, continue to detect whether the first communication module has data transmission at every interval of the first preset time length until it is detected that the first communication module has no data transmission, stop detecting whether the first communication module has data transmission, and determine that the first data transmission status is the target status; if the second communication module is detected to have data transmission, continue to detect whether the second communication module has data transmission at every interval of the first preset time length until it is detected that the second communication module has no data transmission, stop detecting whether the second communication module has data transmission, and determine that the second data transmission status is the target status.

[0081] In a possible example, the switching unit 302 is specifically used to: when it is detected that the first data transmission state is the target state, switch the first communication module to the sleep state; when it is detected that the second data transmission state is the target state, switch the second communication module to the sleep state; in the sleep state, neither the first communication module nor the second communication module performs data transmission; when both the first communication module and the second communication module are switched to the sleep state, turn on the data transmission path between the first communication module and the second communication module and the second antenna, and cut off the data transmission path between the first communication module and the second communication module and the first antenna; switch the first communication module and the second communication module to an active state, and in the active state, the data transmission function of the first communication module and the second communication module is in an enabled state.

[0082] In a possible example, in terms of controlling the first communication module and the second communication module to switch to the active state, the switching unit 302 is specifically used to: switch the first communication module and the second communication module to the active state after an interval of a second preset time length.

[0083] In one possible example, the switching unit 302 is specifically used to: determine whether the data transmitted by the first communication module and the data transmitted by the second communication module meet preset conditions, and the preset conditions include: the data transmitted by the first communication module is preset high transmission priority data, and the data transmitted by the second communication module is preset low transmission priority data; if not, when the first data transmission state and the second data transmission state are both target states, switch the first communication module and the second communication module to share the second antenna; if yes, when it is detected that the first data transmission state is the target state, switch the first communication module and the second communication module to share the second antenna.

[0084] In one possible example, in terms of switching the first communication module and the second communication module to share the second antenna when the first data transmission state is detected to be the target state, the switching unit 302 is specifically used to: when the first data transmission state is detected to be the target state, if the second data state is the target state, switch the first communication module and the second communication module to share the second antenna; when the first data transmission state is detected to be the target state, if the second data state is not the target state, wait for a target time length; if the second data transmission state is detected to be the target state within the target time length, then when the second data transmission state is detected to be the target state, switch the first communication module and the second communication module to share the second antenna; if the second data transmission state is not detected to be the target state within the target time length, then at the end of the target time length, switch the first communication module and the second communication module to share the second antenna.

[0085] In a possible example, the target duration is determined by querying a preset correspondence based on a source application of the first data, the preset correspondence includes a correspondence between an application and a waiting duration, and the first data is data transmitted by the first communication module.

[0086] In the case of using an integrated unit, a functional unit composition block diagram of another antenna switching device provided by an embodiment of the present application is as follows: Figure 3b As shown. Figure 3b In the embodiment, the antenna switching device includes: a processing module 310 and a communication module 311. The processing module 310 is used to control and manage the actions of the antenna switching device, for example, the steps performed by the detection unit 301 and the switching unit 302, and / or other processes for performing the technology described in this application. The communication module 311 is used to support the interaction between the antenna switching device and other devices. Figure 3b As shown, the antenna switching device may further include a storage module 312, and the storage module 312 is used to store program codes and data of the antenna switching device.

[0087] Among them, the processing module 310 can be a processor or a controller, for example, a central processing unit (CPU), a general processor, a digital signal processor (DSP), an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like. The communication module 311 can be a transceiver, an RF circuit or a communication interface, and the like. The storage module 312 can be a memory.

[0088] Among them, all relevant contents of each scenario involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here. Figure 2a The antenna switching method shown is performed by an electronic device.

[0089] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps of any method described in the above method embodiments, and the above computer includes an electronic device.

[0090] An embodiment of the present application further provides a computer program product, which includes a computer program. The computer program can be operated to enable a computer to execute part or all of the steps of any method recorded in the above method embodiments.

[0091] The computer program product may be a software installation package, and the computer includes an electronic device.

[0092] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and units involved are not necessarily required by the present application.

[0093] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

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

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

[0096] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0097] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution 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, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the above-mentioned methods of each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or CD-ROM and other media that can store program codes.

[0098] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a magnetic disk or an optical disk, etc.

[0099] The embodiments of the present application are introduced in detail above. Specific examples are used in the present application to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in the field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. An antenna switching method, characterized in that: Applied to an electronic device, the electronic device comprises a first communication module, a second communication module and a plurality of antennas, the first communication module and the second communication module share a first antenna among the plurality of antennas; the method comprises: When the communication quality parameter of the first antenna meets a preset antenna switching condition of the first communication module, detecting a first data transmission state of the first communication module and a second data transmission state of the second communication module, wherein the preset antenna switching condition is used to characterize that a value of the communication quality parameter of the first antenna is lower than a preset quality parameter value; When both the first data transmission state and the second data transmission state are target states, the first communication module and the second communication module are switched to share a second antenna other than the first antenna among the multiple antennas, and the target state refers to a state where the communication module has no data transmission.

2. The method according to claim 1, characterized in that The detecting a first data transmission state of the first communication module and a second data transmission state of the second communication module includes: After a delay of a first preset time, simultaneously detecting whether the first communication module and the second communication module have data transmission; If it is detected that the first communication module has data transmission, continue to detect whether the first communication module has data transmission at intervals of the first preset time length until it is detected that the first communication module has no data transmission, stop detecting whether the first communication module has data transmission, and determine that the first data transmission state is the target state; If it is detected that the second communication module has data transmission, continue to detect whether the second communication module has data transmission at every first preset time interval until it is detected that the second communication module has no data transmission, stop detecting whether the second communication module has data transmission, and determine that the second data transmission state is the target state.

3. The method according to claim 1, characterized in that When both the first data transmission state and the second data transmission state are target states, switching the first communication module and the second communication module to share a second antenna other than the first antenna among the multiple antennas includes: When detecting that the first data transmission state is the target state, switching the first communication module to the sleep state; when detecting that the second data transmission state is the target state, switching the second communication module to the sleep state; in the sleep state, neither the first communication module nor the second communication module performs data transmission; When both the first communication module and the second communication module are switched to the sleep state, the data transmission path between the first communication module and the second communication module and the second antenna is turned on, and the data transmission path between the first communication module and the second communication module and the first antenna is turned off; The first communication module and the second communication module are switched to an active state, in which the data transmission functions of the first communication module and the second communication module are enabled.

4. The method according to claim 3, characterized in that The controlling the first communication module and the second communication module to switch to an active state includes: After a second preset time period, the first communication module and the second communication module are switched to the active state.

5. The method according to claim 1, characterized in that When both the first data transmission state and the second data transmission state are target states, switching the first communication module and the second communication module to share a second antenna other than the first antenna among the multiple antennas includes: Determining whether the data transmitted by the first communication module and the data transmitted by the second communication module meet a preset condition, wherein the preset condition includes: the data transmitted by the first communication module is preset high transmission priority data, and the data transmitted by the second communication module is preset low transmission priority data; If not, when both the first data transmission state and the second data transmission state are target states, switching the first communication module and the second communication module to share the second antenna; If so, when it is detected that the first data transmission state is the target state, the first communication module and the second communication module are switched to share the second antenna.

6. The method according to claim 5, characterized in that: When detecting that the first data transmission state is the target state, switching the first communication module and the second communication module to share the second antenna includes: When detecting that the first data transmission state is the target state, if the second data state is the target state, switching the first communication module and the second communication module to share the second antenna: When it is detected that the first data transmission state is the target state, if the second data state is not the target state, waiting for a target time length: If it is detected that the second data transmission state is the target state within the target time length, then when it is detected that the second data transmission state is the target state, switching the first communication module and the second communication module to share the second antenna; If the second data transmission state is not detected to be the target state within the target time period, then when the target time period ends, the first communication module and the second communication module are switched to share the second antenna.

7. The method according to claim 6, characterized in that The target duration is determined by querying a preset correspondence relationship based on a source application of the first data, the preset correspondence relationship includes a correspondence between an application and a waiting duration, and the first data is data transmitted by the first communication module.

8. An antenna switching device, characterized in that: Applied to an electronic device, the electronic device comprises a first communication module, a second communication module and a plurality of antennas, the first communication module and the second communication module share a first antenna among the plurality of antennas; the device comprises: a detection unit, configured to detect a first data transmission state of the first communication module and a second data transmission state of the second communication module when the value of the communication quality parameter of the first antenna satisfies a preset antenna switching condition of the first communication module, wherein the preset antenna switching condition is used to indicate that the value of the communication quality parameter of the first antenna is lower than a preset quality parameter value; A switching unit is used to switch the first communication module and the second communication module to share a second antenna other than the first antenna among the multiple antennas when the first data transmission state and the second data transmission state are both target states, and the target state refers to a state in which the communication module has no data transmission.

9. An electronic device, characterized in that: The electronic device comprises: one or more processors; One or more memories for storing programs, The one or more memories and the program are configured so that the one or more processors control the device to execute the steps in the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: in, The computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute the steps in the method according to any one of claims 1 to 7.