Method and device for adjusting coexistence of Bluetooth and WiFi
By adjusting the connection interval between the terminal and the Bluetooth device and the Bluetooth audio sampling rate of the Bluetooth headset, the channel pressure is dealt with according to the WiFi channel performance parameters, the interference problem between the Bluetooth signal and the WiFi signal is solved, and the signal quality is improved.
Patent Information
- Application Number
- CN202311022206.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-14
- Publication Date
- 2025-02-25
AI Technical Summary
When the terminal connects multiple Bluetooth devices and WiFi in the 2.4GHz band at the same time, the Bluetooth signal and the WiFi signal will interfere with each other, resulting in a degradation of signal quality.
By obtaining the channel performance parameters of WiFi in the target frequency band that the terminal has been connected to, adjust the connection interval between the terminal and the Bluetooth device and the Bluetooth audio sampling rate of the Bluetooth headset to cope with channel pressure.
It effectively solves the interference between Bluetooth signals and WiFi signals, improves signal quality, and ensures stable data interaction between the terminal and Bluetooth devices.
Smart Images

Figure CN119521452A_ABST
Abstract
Description
Technical Field
[0001] The disclosed technical solution relates to the field of wireless network technology, and in particular to a method and device for adjusting the coexistence of Bluetooth and WiFi. Background Art
[0002] Since the terminal and the Bluetooth device use the 2.4 GHz frequency band for communication, when the terminal is connected to multiple Bluetooth devices at the same time and connected to WiFi (Wireless Fidelity) in the 2.4 GHz frequency band, the Bluetooth signals and WiFi signals will interfere with each other, resulting in a decrease in the quality of the Bluetooth signals and WiFi signals. Summary of the invention
[0003] In view of this, embodiments of the present disclosure provide a method and device for adjusting the coexistence of Bluetooth and WiFi, a storage medium, and an electronic device.
[0004] According to a first aspect of the present disclosure, a method for adjusting the coexistence of Bluetooth and WiFi is proposed, the method comprising:
[0005] Acquire a channel performance parameter of a WiFi of a target frequency band to which the terminal is connected; the channel performance parameter is used to characterize a channel pressure of a target channel used by the WiFi;
[0006] In response to determining that the channel performance parameter meets a preset parameter condition, a connection interval between the terminal and the Bluetooth device is adjusted; the connection interval is used to represent a time interval for data interaction between the terminal and the Bluetooth device.
[0007] In combination with any implementation manner provided in the present disclosure, in response to determining that the channel performance parameter satisfies a preset parameter condition, adjusting the connection interval between the terminal and the Bluetooth device includes:
[0008] In response to determining that the channel performance parameter satisfies a preset first parameter condition, increasing the connection interval between the terminal and the Bluetooth device; the first parameter condition is used to indicate that the target channel currently has channel pressure; or
[0009] In response to determining that the channel performance parameter satisfies a preset second parameter condition, reducing the connection interval between the terminal and the Bluetooth device; the second parameter condition is used to indicate that the channel pressure does not currently exist on the target channel.
[0010] In combination with any implementation manner provided in the present disclosure, the increasing the connection interval between the terminal and the Bluetooth device includes:
[0011] The increased connection interval is less than or equal to the preset connection interval.
[0012] In combination with any implementation manner provided in the present disclosure, the Bluetooth device includes a Bluetooth headset device;
[0013] The method further comprises:
[0014] In response to determining that the channel performance parameter satisfies a preset parameter condition, a Bluetooth audio sampling rate of the Bluetooth headset is adjusted.
[0015] In combination with any implementation manner provided in the present disclosure, in response to determining that the channel performance parameter satisfies a preset parameter condition, adjusting the Bluetooth audio sampling rate of the Bluetooth headset includes:
[0016] In response to determining that the channel performance parameter satisfies a preset third parameter condition, reducing the Bluetooth audio sampling rate of the Bluetooth headset; the preset third parameter condition is used to indicate that the target channel currently has channel pressure; or
[0017] In response to determining that the channel performance parameter satisfies a preset fourth parameter condition, increasing the Bluetooth audio sampling rate of the Bluetooth headset; the preset fourth parameter condition is used to indicate that the target channel currently does not have the channel pressure.
[0018] In combination with any implementation manner provided in the present disclosure, in response to determining that the channel performance parameter satisfies a preset parameter condition, adjusting the Bluetooth audio sampling rate of the Bluetooth headset includes:
[0019] Obtain a sampling rate set consisting of Bluetooth audio sampling rates supported by the Bluetooth headset;
[0020] According to the channel performance parameter, determine the target Bluetooth audio sampling rate in the sampling rate set; wherein, the greater the channel pressure represented by the channel performance parameter, the lower the determined target Bluetooth audio sampling rate is, and the smaller the channel pressure represented by the channel performance parameter, the higher the determined target Bluetooth audio sampling rate is;
[0021] The Bluetooth audio sampling rate of the Bluetooth headset is adjusted to the target Bluetooth audio sampling rate.
[0022] In combination with any implementation manner provided in the present disclosure, before obtaining the channel performance parameters of the WiFi of the target frequency band to which the terminal is connected, the method further includes:
[0023] It is detected that the terminal is connected to the WiFi of the target frequency band, and the number of the Bluetooth devices that have established Bluetooth connections with the terminal reaches a preset number threshold.
[0024] In combination with any implementation manner provided in the present disclosure, the channel performance parameter includes at least one of the following:
[0025] The throughput requirement of the WiFi;
[0026] The channel information of the target channel; the channel information is used to characterize the busyness of the target channel.
[0027] According to a second aspect of the present disclosure, a device for adjusting the coexistence of Bluetooth and WiFi is provided, the device comprising:
[0028] An acquisition module, used to acquire a channel performance parameter of a WiFi of a target frequency band to which the terminal is connected; the channel performance parameter is used to characterize a channel pressure of a target channel used by the WiFi;
[0029] The first adjustment module is used to adjust the connection interval between the terminal and the Bluetooth device in response to determining that the channel performance parameter meets the preset parameter condition; the connection interval is used to represent the time interval for data interaction between the terminal and the Bluetooth device.
[0030] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, which, when called and executed by a processor, prompts the processor to implement the method for adjusting the coexistence of Bluetooth and WiFi of any embodiment of the present disclosure.
[0031] According to a fourth aspect of the present disclosure, there is provided an electronic device, comprising:
[0032] processor;
[0033] a memory for storing processor-executable instructions;
[0034] The processor is configured to execute the adjustment method for Bluetooth and WiFi coexistence of any embodiment of the present disclosure.
[0035] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0036] In the method and device for adjusting the coexistence of Bluetooth and WiFi, the storage medium and the electronic device provided by the embodiments of the present disclosure, the terminal can flexibly adjust the connection interval with the Bluetooth device according to the channel performance parameters of the WiFi of the currently connected target frequency band, wherein the channel performance parameters are used to characterize the channel pressure of the target channel used by the WiFi. This effectively solves the problem of mutual interference between Bluetooth signals and WiFi signals, resulting in reduced signal quality.
[0037] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0039] Figure 1 is a schematic diagram of a Bluetooth connection according to an exemplary embodiment of the present disclosure;
[0040] Figure 2 is a spectrum diagram shown in the present disclosure according to an exemplary embodiment;
[0041] Figure 3 is a flow chart of a method for adjusting the coexistence of Bluetooth and WiFi according to an exemplary embodiment of the present disclosure;
[0042] Figure 4 is a flow chart of another method for adjusting the coexistence of Bluetooth and WiFi according to an exemplary embodiment of the present disclosure;
[0043] Figure 5 is a flow chart of another method for adjusting the coexistence of Bluetooth and WiFi according to an exemplary embodiment of the present disclosure;
[0044] Figure 6 is a structural schematic diagram of a device for adjusting the coexistence of Bluetooth and WiFi according to an exemplary embodiment of the present disclosure;
[0045] Figure 7 It is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0046] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0047] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0048] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0049] WiFi is mainly divided into 2.4GHz WiFi and 5GHz WiFi. Among them, 2.4GHz is the earliest WiFi band, and 5GHz is a newer WiFi band. Although 5GHz WiFi can provide faster speed and better performance than 2.4GHz WiFi, 2.4GHz WiFi is still irreplaceable in daily use. The reasons are as follows:
[0050] 1. The WiFi coverage of 2.4GHz band is wider: Compared with 5GHz band, the signal wavelength of 2.4GHz band is longer, and under the same power, it has better penetration ability and can transmit signals farther. This means that in the scenario of large-scale coverage, using 2.4GHz band can provide wider WiFi coverage.
[0051] 2. The WiFi signal in the 2.4GHz band is more stable: Compared with the 5GHz band, the 2.4GHz band has a stronger ability to penetrate obstacles (such as walls, furniture, etc.), which makes the 2.4GHz band more stable in environments where the signal needs to pass through obstacles, such as in large residences, offices or public places.
[0052] 3. WiFi in the 2.4GHz band has wider device compatibility: Since the 2.4GHz band is the frequency band adopted by the early WiFi standard, most terminal devices support WiFi in the 2.4GHz band, while fewer terminal devices support WiFi in the 5GHz band.
[0053] 4. WiFi in the 2.4GHz band consumes less power: Compared with the 5GHz band, WiFi in the 2.4GHz band consumes less power. Battery-powered terminal devices can save more power by using WiFi in the 2.4GHz band.
[0054] Since WiFi in the 2.4 GHz band has the above advantages, in daily use, terminal devices often use WiFi in the 2.4 GHz band for communication.
[0055] With the development of communication technology, various Bluetooth devices are widely used. Figure 1 As shown, when the user uses the laptop computer 11, the laptop computer 11 can be connected to Bluetooth devices such as a Bluetooth keyboard 12, a Bluetooth mouse 13, a Bluetooth pen 14, and a Bluetooth headset 15 through Bluetooth. Thus, the user can more conveniently edit documents and input data through the Bluetooth keyboard 12 and the Bluetooth mouse 13, take handwritten notes and draw pictures using the Bluetooth pen 14, and make voice calls and play audio using the Bluetooth headset 15. The terminal devices such as laptop computers and mobile phones also use the 2.4 GHz frequency band for communication with Bluetooth devices.
[0056] like Figure 2 In the spectrum diagram shown, the horizontal axis is frequency and the vertical axis is signal strength. Signal 21 in the diagram is a Bluetooth signal and signal 22 is a WiFi signal. Therefore, when a terminal device is connected to multiple Bluetooth devices at the same time and connected to WiFi in the 2.4GHz band, the Bluetooth signal and the WiFi signal will interfere with each other, resulting in a decrease in the quality of the Bluetooth signal and the WiFi signal.
[0057] Specifically, when using a Bluetooth headset, Bluetooth mouse, Bluetooth keyboard and Bluetooth pen at the same time, the throughput and latency of WiFi will be greatly affected. Similarly, when the terminal uses WiFi to download files, the use of the above Bluetooth devices will be greatly reduced. For example, the Bluetooth headset will freeze, and the latency of the Bluetooth pen, Bluetooth keyboard and Bluetooth mouse will be very high.
[0058] In view of this, the present disclosure provides a method for adjusting the coexistence of Bluetooth and WiFi, in which a terminal can flexibly adjust the connection interval between the terminal and the Bluetooth device according to the actual needs of the currently connected WiFi in the 2.4GHz frequency band. For example, when the terminal needs to use WiFi to download, the terminal can increase the connection interval between the terminal and the Bluetooth device and reduce the frequency of interaction with the Bluetooth device, thereby effectively solving the problem of mutual interference between Bluetooth signals and WiFi signals, resulting in reduced signal quality.
[0059] The following describes in detail the method for adjusting the coexistence of Bluetooth and WiFi in an embodiment of the present disclosure in conjunction with the accompanying drawings.
[0060] Figure 3 FIG. 1 is a flow chart of a method for adjusting the coexistence of Bluetooth and WiFi according to an exemplary embodiment of the present disclosure. Figure 3 As shown, the exemplary embodiment method may include the following steps:
[0061] In step 301, the channel performance parameters of the WiFi of the target frequency band to which the terminal is connected are obtained.
[0062] The target frequency band is the 2.4 GHz frequency band. When the terminal is connected to the WiFi of the 2.4 GHz frequency band, the WiFi of the 2.4 GHz frequency band uses a channel for communication, and the channel is the target channel. The channel performance parameter is used to characterize the channel pressure of the target channel.
[0063] Optionally, the channel performance parameter may include a throughput requirement of the WiFi and / or channel information of the target channel.
[0064] The throughput requirement of the WiFi is used to characterize the data transmission rate currently required by the terminal. In practical applications, the terminal can obtain the throughput requirement of the WiFi by calling a preset interface such as TrafficStats.getPackets(@NonNull String iface). It is easy to imagine that the greater the throughput requirement of the WiFi, the greater the channel pressure of the target channel.
[0065] The channel information is used to characterize the busyness of the target channel. In practical applications, the terminal can obtain the channel information through CCA (Clear Channel Assessment). Specifically, the terminal can determine the channel information by monitoring the electromagnetic energy level on the target channel. Exemplarily, the channel information can be represented by any numerical value in (0, 1), and the closer the numerical value is to 1, the busier the target channel is, and the closer it is to 0, the less busy the target channel is. In this example, the closer the numerical value is to 1, the busier the target channel is, indicating that the channel pressure of the target channel is greater.
[0066] In step 302, in response to determining that the channel performance parameter satisfies a preset parameter condition, a connection interval between the terminal and the Bluetooth device is adjusted.
[0067] The Bluetooth device may include a Bluetooth mouse, a Bluetooth keyboard, a Bluetooth pen, etc. The connection interval is used to represent the time interval for data interaction between the terminal and the Bluetooth device.
[0068] When a terminal is connected to a Bluetooth device via Bluetooth, the terminal will exchange data with the Bluetooth device at a preset connection interval. Moreover, the shorter the connection interval, the better the real-time performance of data transmission between the terminal and the Bluetooth device, but at the same time, it will cause greater channel pressure. The longer the connection interval, the worse the real-time performance of data transmission between the terminal and the Bluetooth device, but it can reduce channel pressure to a certain extent.
[0069] In this example, the terminal can adjust the connection interval between the terminal and the Bluetooth device in real time based on the channel performance parameter, that is, the channel pressure of the target channel. It should be noted that the terminal can adjust the connection interval between all Bluetooth devices at the same time, or can adjust the connection interval between some Bluetooth devices, which is not limited in this disclosure. There are two ways to adjust:
[0070] First way:
[0071] When determining that the channel performance parameter meets a preset first parameter condition, the terminal may increase the connection interval between the terminal and the Bluetooth device.
[0072] The first parameter condition is used to indicate that the target channel currently has channel pressure.
[0073] Optionally, when the channel performance parameter includes the throughput requirement of the WiFi, the first parameter condition may be that the throughput requirement of the WiFi is greater than or equal to a preset value, for example, greater than or equal to 100 kbps. In other words, when the terminal determines that the throughput requirement of the WiFi is greater than or equal to 100 kbps, it indicates that the terminal has a large throughput requirement for WiFi. At this time, the connection interval between the terminal and the Bluetooth device may be increased, thereby reducing the channel pressure caused by Bluetooth communication on the target channel.
[0074] Optionally, when the channel performance parameter includes the channel information of the target channel, the first parameter condition may be that the channel information of the target channel is greater than or equal to a preset value, for example, greater than or equal to 0.7. That is, when the terminal determines that the channel information of the target channel is greater than or equal to 0.7, it indicates that the target channel is currently busy. At this time, the connection interval between the terminal and the Bluetooth device may be increased, thereby reducing the channel pressure on the target channel caused by Bluetooth communication.
[0075] Optionally, the channel performance parameter may further include the throughput requirement of the WiFi and the channel information of the target channel. At this time, when the throughput requirement of the WiFi and the channel information of the target channel respectively meet the above parameter conditions, the connection interval between the terminal and the Bluetooth device may be increased. This avoids unnecessary reduction of Bluetooth performance and improves the user experience.
[0076] Second way:
[0077] When determining that the channel performance parameter meets a preset second parameter condition, the terminal may reduce the connection interval between the terminal and the Bluetooth device.
[0078] The second parameter condition is used to indicate that the channel pressure does not currently exist on the target channel.
[0079] Optionally, when the channel performance parameter includes the throughput requirement of the WiFi, the second parameter condition may be that the throughput requirement of the WiFi is less than or equal to a preset value, for example, less than or equal to 20 kbps. That is, when the terminal determines that the throughput requirement of the WiFi is less than or equal to 20 kbps, it indicates that the terminal has a small throughput requirement for WiFi. At this time, the connection interval between the terminal and the Bluetooth device may be reduced, thereby improving the real-time performance of data transmission.
[0080] Optionally, when the channel performance parameter includes the channel information of the target channel, the second parameter condition may be that the channel information of the target channel is less than a preset value, for example, less than 0.5. That is, when the terminal determines that the channel information of the target channel is less than 0.5, it indicates that the target channel is not currently busy. At this time, the connection interval between the terminal and the Bluetooth device can be reduced, thereby improving the real-time performance of data transmission and ensuring the user experience of the Bluetooth device.
[0081] Optionally, the channel performance parameters may further include the throughput requirement of the WiFi and the channel information of the target channel. At this time, when the throughput requirement of the WiFi and the channel information of the target channel respectively meet the above parameter conditions, the connection interval between the terminal and the Bluetooth device may be reduced. This avoids the situation where the performance pressure of the target channel is increased due to errors in the acquired channel performance parameters.
[0082] In an optional example, the terminal may determine the adjusted connection interval I' based on the following formula (1).
[0083] I'=I+(30-I)×ca (1)
[0084] Wherein, I is the initial connection interval, such as 7.5ms, 11.25ms, etc., which can be set by relevant staff based on actual conditions, and the present disclosure does not limit this. ca is the channel information obtained based on the aforementioned CCA method, which can be in the range of (0, 1).
[0085] At the same time, in order to ensure the user's experience of using the Bluetooth device, the improved connection interval needs to be less than or equal to the preset connection interval, for example, less than or equal to 30ms.
[0086] Combining the above formula (1), it can be known that the adjusted connection interval I' is proportional to the ca value. In other words, the larger the ca value, the larger the determined connection interval I', and the smaller the ca value, the smaller the determined connection interval I'. In other words, the busier the target channel, the larger the determined connection interval I', which can alleviate the channel pressure to a certain extent. The less busy the target channel, the smaller the determined connection interval I', which can improve the real-time performance of data transmission to a certain extent.
[0087] In the adjustment method for coexistence of Bluetooth and WiFi provided in the embodiment of the present disclosure, the terminal can flexibly adjust the connection interval between the terminal and the Bluetooth device according to the channel performance parameters of the WiFi in the currently connected target frequency band, thereby effectively solving the problem of mutual interference between Bluetooth signals and WiFi signals, resulting in reduced signal quality.
[0088] Figure 4 FIG. 1 is a flowchart of another method for adjusting the coexistence of Bluetooth and WiFi according to an exemplary embodiment of the present disclosure. In this embodiment, the same steps as those in the previous embodiment will be briefly described and will not be described in detail. For details, please refer to the relevant description of any of the previous embodiments. In this embodiment, the method for adjusting the coexistence of Bluetooth and WiFi when the Bluetooth device is a Bluetooth headset will be further introduced. Figure 4 As shown, the exemplary embodiment method may include the following steps:
[0089] In step 401, it is detected that the terminal is connected to WiFi of the target frequency band, and the number of Bluetooth devices that have established Bluetooth connections with the terminal reaches a preset number threshold.
[0090] The target frequency band is the 2.4 GHz frequency band. The preset number threshold can be 1 or 3, which can be set based on actual conditions, and the present disclosure does not limit this. In actual applications, the terminal can monitor android.bluetooth.*.profile.action.CONNECTION_STATE_CHANGED (* is the name of each Bluetooth protocol supported by the device, such as a2dp\hfp, etc.) to record the number of Bluetooth devices connected to the terminal.
[0091] In this example, the terminal may execute subsequent steps when it is detected that a WiFi connection with the 2.4 GHz frequency band has been established and the number of Bluetooth devices that have established Bluetooth connections with the terminal reaches the preset number threshold.
[0092] In step 402, the channel performance parameters of the WiFi of the target frequency band to which the terminal is connected are obtained.
[0093] The channel performance parameter is used to characterize the channel pressure of the target channel used by the WiFi.
[0094] Optionally, the channel performance parameter may include a throughput requirement of the WiFi and / or channel information of the target channel.
[0095] In step 403, in response to determining that the channel performance parameter satisfies a preset parameter condition, the connection interval between the terminal and the Bluetooth device and the Bluetooth audio sampling rate of the Bluetooth headset are adjusted.
[0096] The scheme for adjusting the connection interval can be referred to the introduction of the above-mentioned embodiment, which will not be described in detail here. This example focuses on the scheme for adjusting the Bluetooth audio sampling rate of the Bluetooth headset.
[0097] The Bluetooth audio sampling rate of a Bluetooth headset refers to the frequency of sampling the audio signal during audio transmission. Specifically, it indicates the number of audio samples collected per second. The Bluetooth audio sampling rate of a Bluetooth headset is usually expressed in units of "Hz" (Hertz), and common values include 44.1kHz and 48kHz. For example, when the Bluetooth audio sampling rate of a Bluetooth headset is 44.1kHz, it means that the audio signal will be sampled 44,100 times per second.
[0098] A higher sampling rate can restore the original sound more accurately and provide higher audio quality, but it will also increase the amount of data transmission and bring more channel pressure to the target channel. A lower sampling rate can reduce the amount of data transmission and reduce the channel pressure on the target channel, but it will also reduce the audio quality.
[0099] In this example, the Bluetooth audio sampling rate of the Bluetooth headset can be adjusted in the following manner.
[0100] First way:
[0101] The terminal may reduce the Bluetooth audio sampling rate of the Bluetooth headset when determining that the channel performance parameter meets a preset third parameter condition.
[0102] The preset third parameter condition is used to indicate that the target channel currently has channel pressure.
[0103] The third parameter condition may be the same as or different from the first parameter condition, and may be set by relevant staff based on actual conditions, and the present disclosure does not limit this. For the convenience of description, the third parameter condition is taken as the same as the first parameter condition to introduce the subsequent embodiments.
[0104] Optionally, when the channel performance parameter includes the throughput requirement of the WiFi, the third parameter condition may be that the throughput requirement of the WiFi is greater than or equal to a preset value, for example, greater than or equal to 100 kbps. That is, when the terminal determines that the throughput requirement of the WiFi is greater than or equal to 100 kbps, it indicates that the terminal has a large throughput requirement for WiFi, and at this time, the Bluetooth audio sampling rate of the Bluetooth headset may be reduced, that is, the terminal may reduce the number of samples transmitted per second when transmitting audio data to the Bluetooth headset.
[0105] For example, the terminal can obtain the Bluetooth audio sampling rate supported by the Bluetooth headset in advance, and then adjust the Bluetooth audio sampling rate of the Bluetooth headset to any value lower than the Bluetooth audio sampling rate currently used by the Bluetooth headset based on the obtained Bluetooth audio sampling rate supported by the Bluetooth headset. This reduces the amount of data transmitted by Bluetooth to a certain extent, saves the Bluetooth bandwidth and energy consumption between the Bluetooth headset and the terminal, and reduces the channel pressure caused by Bluetooth transmission to the target channel.
[0106] Optionally, when the channel performance parameter includes the channel information of the target channel, the third parameter condition may be that the channel information of the target channel is greater than or equal to a preset value, for example, greater than or equal to 0.7. That is, when the terminal determines that the channel information of the target channel is greater than or equal to 0.7, it indicates that the target channel is currently busy. At this time, the Bluetooth audio sampling rate of the Bluetooth headset may be reduced, thereby reducing the channel pressure caused by Bluetooth transmission to the target channel. The method of reducing the Bluetooth audio sampling rate can be found in the description of the aforementioned embodiment, which will not be repeated here.
[0107] Optionally, the channel performance parameter may further include the throughput requirement of the WiFi and the channel information of the target channel. At this time, when the throughput requirement of the WiFi and the channel information of the target channel respectively meet the above parameter conditions, the Bluetooth audio sampling rate of the Bluetooth headset may be reduced. This avoids unnecessary reduction of Bluetooth performance and improves the user experience.
[0108] Second way:
[0109] The terminal may increase the Bluetooth audio sampling rate of the Bluetooth headset when determining that the channel performance parameter meets a preset fourth parameter condition.
[0110] The preset second parameter condition is used to indicate that the target channel currently does not have the channel pressure.
[0111] The fourth parameter condition may be the same as or different from the aforementioned second parameter condition, and the present disclosure does not limit this. For the convenience of description, the following embodiments are introduced by taking the fourth parameter condition being the same as the aforementioned second parameter condition as an example.
[0112] Optionally, when the channel performance parameter includes the throughput requirement of the WiFi, the fourth parameter condition may be that the throughput requirement of the WiFi is less than or equal to a preset value, for example, less than or equal to 20 kbps. In other words, when the terminal determines that the throughput requirement of the WiFi is less than or equal to 20 kbps, it indicates that the terminal has a small throughput requirement for WiFi. At this time, the Bluetooth audio sampling rate of the Bluetooth headset may be increased, that is, the terminal may increase the number of samples transmitted per second when transmitting audio data to the Bluetooth headset.
[0113] For example, the terminal can obtain the Bluetooth audio sampling rate supported by the Bluetooth headset in advance, and then adjust the Bluetooth audio sampling rate of the Bluetooth headset to any value higher than the Bluetooth audio sampling rate currently used by the Bluetooth headset based on the obtained Bluetooth audio sampling rate supported by the Bluetooth headset. This can more accurately restore the original sound, provide higher audio quality, and enhance the user experience of the Bluetooth headset.
[0114] Optionally, when the channel performance parameter includes the channel information of the target channel, the fourth parameter condition may be that the channel information of the target channel is less than a preset value, for example, less than 0.5. That is, when the terminal determines that the channel information of the target channel is less than 0.5, it indicates that the target channel is not currently busy. At this time, the Bluetooth audio sampling rate of the Bluetooth headset can be increased to improve the user experience of the Bluetooth headset.
[0115] Optionally, the channel performance parameters may further include the throughput requirement of the WiFi and the channel information of the target channel. In this case, when the throughput requirement of the WiFi and the channel information of the target channel respectively meet the above parameter conditions, the Bluetooth audio sampling rate of the Bluetooth headset may be increased, thereby avoiding the situation where the performance pressure of the target channel is increased due to errors in the acquired channel performance parameters.
[0116] In an optional example, when adjusting the Bluetooth audio sampling rate of the Bluetooth headset, it can also be performed based on the following steps:
[0117] A sampling rate set consisting of Bluetooth audio sampling rates supported by the Bluetooth headset is obtained, and then a target Bluetooth audio sampling rate is determined in the sampling rate set according to the channel performance parameter, and the Bluetooth audio sampling rate of the Bluetooth headset is adjusted to the target Bluetooth audio sampling rate.
[0118] Among them, the greater the channel pressure represented by the channel performance parameter, the lower the determined target Bluetooth audio sampling rate is; the smaller the channel pressure represented by the channel performance parameter, the higher the determined target Bluetooth audio sampling rate is.
[0119] For example, in actual applications, the terminal can obtain the sampling rate set consisting of the Bluetooth audio sampling rate CO[n] supported by the Bluetooth headset through getCodecsSelectableCapabilities() (n is the number of Bluetooth audio sampling rate levels actually supported by the Bluetooth headset). For example, the obtained sampling rates are arranged from small to large, and may include: CO[1, 2, 3, 4, 5] = [44.1kHz, 48kHz, 88.2kHz, 96kHz, 192kHz].
[0120] Then, the terminal can determine the target Bluetooth audio sampling rate CO[m] in the sampling rate set based on the acquired channel performance parameters, where m is an integer, which can specifically correspond to the above-mentioned [1, 2, 3, 4, 5]. Optionally, it can be determined based on the following formula (2):
[0121]
[0122] CA is channel information obtained based on the CCA method, and may be specifically in the range of (0, 1).
[0123] For example, if CA is 0.8, m = 1 / 0.8 = 1.25, which is closest to the integer 1, then CO[1] is used, which is 44.1kHz. If CA is 0.6, m = 1 / 0.6 = 1.6667, which is closest to 2, then CO[2] is used, which is 48kHz.
[0124] Finally, the terminal can adjust the Bluetooth audio sampling rate of the Bluetooth headset to CO[m] through setCodecConfigPreference(newCodec). Combined with the above formula (2), it can be seen that the adjusted Bluetooth audio sampling rate is inversely proportional to the ca value. In other words, the larger the determined ca value, the busier the target channel is, and the lower the adjusted Bluetooth audio sampling rate is, which can reduce the channel pressure. The smaller the determined ca value, the less busy the target channel is, and the higher the adjusted Bluetooth audio sampling rate is, which can more accurately restore the original sound, provide higher audio quality, and enhance the user experience of the Bluetooth headset.
[0125] In the adjustment method for the coexistence of Bluetooth and WiFi provided in the embodiment of the present disclosure, the terminal can flexibly adjust the Bluetooth audio sampling rate of the Bluetooth headset according to the channel performance parameters of the WiFi in the currently connected target frequency band, thereby effectively solving the problem of mutual interference between Bluetooth signals and WiFi signals, resulting in reduced signal quality.
[0126] It should be noted that although the above-mentioned embodiments separately introduce the terminal adjusting the connection interval between each Bluetooth device and the terminal adjusting the Bluetooth audio sampling rate of the Bluetooth headset, in actual applications, when the terminal is connected to multiple Bluetooth devices and the multiple Bluetooth devices include a Bluetooth headset, the terminal can adjust both the connection interval between each Bluetooth device and the Bluetooth audio sampling rate of the Bluetooth headset, and the present disclosure does not limit this.
[0127] Figure 5 FIG. 1 is a flow chart of another method for adjusting the coexistence of Bluetooth and WiFi according to an exemplary embodiment of the present disclosure. Figure 5 As shown, the exemplary embodiment method may include the following steps:
[0128] In step 501, it is detected that the terminal is connected to WiFi of the target frequency band, and the number of Bluetooth devices that have established Bluetooth connections with the terminal reaches a preset number threshold.
[0129] The target frequency band is the 2.4 GHz frequency band.
[0130] In step 502, the connection interval between the terminal and each Bluetooth device, the Bluetooth audio sampling rate of the Bluetooth headset, and the channel performance parameters of the WiFi in the target frequency band to which the terminal has been connected are obtained.
[0131] In step 503, in response to determining that the channel performance parameter satisfies a preset first parameter condition, and the connection interval between the terminal and each Bluetooth device is less than or equal to a first preset value, and the Bluetooth audio sampling rate of the Bluetooth headset is greater than or equal to a first preset frequency, the connection interval is increased and the Bluetooth audio sampling rate of the Bluetooth headset is reduced.
[0132] The preset first parameter condition is used to indicate that the target channel currently has channel pressure.
[0133] For example, when it is determined that the channel performance parameter meets the preset first parameter condition, and the connection interval between the terminal and the Bluetooth device is less than or equal to 15ms, and the Bluetooth audio sampling rate of the Bluetooth headset is greater than or equal to 88.2k, the connection interval can be increased and the Bluetooth audio sampling rate of the Bluetooth headset can be reduced.
[0134] In step 504, in response to determining that the channel performance parameter meets the preset second parameter condition, and the connection interval between the terminal and each Bluetooth device is greater than or equal to the second preset value, and the Bluetooth audio sampling rate of the Bluetooth headset is less than or equal to the second preset frequency, the connection interval is reduced and the Bluetooth audio sampling rate of the Bluetooth headset is increased.
[0135] The preset second parameter condition is used to indicate that the target channel currently does not have the channel pressure.
[0136] For example, when it is determined that the channel performance parameter meets the preset second parameter condition, and the connection interval between the terminal and each Bluetooth device is greater than or equal to 25ms, and the Bluetooth audio sampling rate of the Bluetooth headset is less than or equal to 48k, the connection interval can be reduced and the Bluetooth audio sampling rate of the Bluetooth headset can be increased.
[0137] The present disclosure does not limit the execution order of the above steps 403 and 404.
[0138] In the adjustment method for coexistence of Bluetooth and WiFi provided in the embodiment of the present disclosure, the terminal can flexibly adjust the connection interval between each Bluetooth device and the Bluetooth audio sampling rate of the Bluetooth headset according to the channel performance parameters of the WiFi of the currently connected target frequency band, the current connection interval between each Bluetooth device, and the Bluetooth audio sampling rate of the Bluetooth headset. This effectively solves the problem of mutual interference between Bluetooth signals and WiFi signals, resulting in reduced signal quality.
[0139] For the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present disclosure is not limited by the described order of actions, because according to the present disclosure, certain steps can be performed in other orders or simultaneously.
[0140] Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.
[0141] Corresponding to the aforementioned application function implementation method embodiment, the present disclosure also provides an application function implementation device and a corresponding terminal embodiment.
[0142] Figure 6 is a schematic diagram of a structure of a device for adjusting the coexistence of Bluetooth and WiFi according to an exemplary embodiment of the present disclosure, such as Figure 6 As shown, the adjustment device for coexistence of Bluetooth and WiFi may include:
[0143] The acquisition module 61 is used to acquire the channel performance parameters of the WiFi in the target frequency band to which the terminal is connected; the channel performance parameters are used to characterize the channel pressure of the target channel used by the WiFi.
[0144] The first adjustment module 62 is used to adjust the connection interval between the terminal and the Bluetooth device in response to determining that the channel performance parameter meets a preset parameter condition; the connection interval is used to represent the time interval for data interaction between the terminal and the Bluetooth device.
[0145] Optionally, the first adjustment module 62, when used to adjust the connection interval between the terminal and the Bluetooth device in response to determining that the channel performance parameter meets a preset parameter condition, includes:
[0146] In response to determining that the channel performance parameter satisfies a preset first parameter condition, increasing the connection interval between the terminal and the Bluetooth device; the first parameter condition is used to indicate that the target channel currently has channel pressure. or
[0147] In response to determining that the channel performance parameter satisfies a preset second parameter condition, reducing the connection interval between the terminal and the Bluetooth device; the second parameter condition is used to indicate that the channel pressure does not currently exist on the target channel.
[0148] Optionally, the first adjustment module 62, when used to increase the connection interval between the terminal and the Bluetooth device, includes:
[0149] The increased connection interval is less than or equal to the preset connection interval.
[0150] Optionally, the Bluetooth device includes a Bluetooth headset device;
[0151] exist Figure 6 Based on the modules shown, the device for adjusting the coexistence of Bluetooth and WiFi may also include:
[0152] The second adjustment module is used to adjust the Bluetooth audio sampling rate of the Bluetooth headset in response to determining that the channel performance parameter meets a preset parameter condition.
[0153] Optionally, the second adjustment module, when used to adjust the Bluetooth audio sampling rate of the Bluetooth headset in response to determining that the channel performance parameter satisfies a preset parameter condition, includes:
[0154] In response to determining that the channel performance parameter satisfies a preset third parameter condition, reducing the Bluetooth audio sampling rate of the Bluetooth headset; the preset third parameter condition is used to indicate that the target channel currently has channel pressure. or
[0155] In response to determining that the channel performance parameter satisfies a preset fourth parameter condition, increasing the Bluetooth audio sampling rate of the Bluetooth headset; the preset fourth parameter condition is used to indicate that the target channel currently does not have the channel pressure.
[0156] Optionally, the second adjustment module, when used to adjust the Bluetooth audio sampling rate of the Bluetooth headset in response to determining that the channel performance parameter satisfies a preset parameter condition, includes:
[0157] Get a sampling rate set consisting of Bluetooth audio sampling rates supported by the Bluetooth headset.
[0158] According to the channel performance parameters, a target Bluetooth audio sampling rate is determined in the sampling rate set; wherein, the greater the channel pressure represented by the channel performance parameters, the lower the determined target Bluetooth audio sampling rate is, and the smaller the channel pressure represented by the channel performance parameters, the higher the determined target Bluetooth audio sampling rate is.
[0159] The Bluetooth audio sampling rate of the Bluetooth headset is adjusted to the target Bluetooth audio sampling rate.
[0160] Optional, in Figure 6 Based on the modules shown, the device for adjusting the coexistence of Bluetooth and WiFi may also include:
[0161] The detection module is used to detect that the terminal is connected to the WiFi of the target frequency band, and the number of the Bluetooth devices that have established Bluetooth connections with the terminal reaches a preset number threshold.
[0162] Optionally, the channel performance parameter includes at least one of the following:
[0163] The throughput requirement of the WiFi.
[0164] The channel information of the target channel; the channel information is used to characterize the busyness of the target channel.
[0165] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution. A person of ordinary skill in the art may understand and implement it without creative work.
[0166] Figure 7 1 is a schematic diagram of the structure of an electronic device 700 according to an exemplary embodiment. For example, the electronic device 700 may be a user device, and may specifically be a mobile phone, a computer, a digital broadcast terminal, a tablet device, a personal digital assistant, a wearable device such as a smart watch, a smart bracelet, etc.
[0167] Reference Figure 7, the electronic device 700 may include one or more of the following components: a processing component 702 , a memory 704 , a power component 706 , a multimedia component 708 , an audio component 710 , an input / output (I / O) interface 712 , a sensor component 714 , and a communication component 716 .
[0168] The processing component 702 generally controls the overall operation of the electronic device 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 702 may include one or more modules to facilitate the interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate the interaction between the multimedia component 708 and the processing component 702.
[0169] The memory 704 is configured to store various types of data to support operations on the device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phone book data, messages, pictures, videos, etc. The memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0170] The power supply component 706 provides power to the various components of the electronic device 700. The power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 700.
[0171] The multimedia component 708 includes a screen that provides an output interface between the electronic device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front camera and / or a rear camera. When the electronic device 700 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0172] The audio component 710 is configured to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC), and when the electronic device 700 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 704 or sent via the communication component 716. In some embodiments, the audio component 710 also includes a speaker for outputting audio signals.
[0173] I / O interface 712 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0174] The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor assembly 714 can detect the open / closed state of the electronic device 700, the relative positioning of the components, such as the display and keypad of the electronic device 700, and the sensor assembly 714 can also detect the position change of the electronic device 700 or a component of the electronic device 700, the presence or absence of contact between the user and the electronic device 700, the orientation or acceleration / deceleration of the electronic device 700, and the temperature change of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0175] The communication component 716 is configured to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 can access a wireless network based on a communication standard, such as WiFi, 4G or 5G, 4G LTE, 5G NR or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0176] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0177] In an exemplary embodiment, a non-transitory computer-readable storage medium is also provided, such as a memory 704 including instructions. When the instructions in the storage medium are executed by a processor 720 of an electronic device 700, the electronic device 700 is enabled to perform a method for adjusting the coexistence of Bluetooth and WiFi, the method comprising:
[0178] Obtain a channel performance parameter of a WiFi in a target frequency band to which the terminal is connected; the channel performance parameter is used to characterize a channel pressure of a target channel used by the WiFi.
[0179] In response to determining that the channel performance parameter satisfies a preset parameter condition, a connection interval between the terminal and the Bluetooth device is adjusted.
[0180] The non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0181] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0182] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for adjusting the coexistence of Bluetooth and Wireless Fidelity WiFi, characterized in that: The method comprises: Acquire a channel performance parameter of a WiFi of a target frequency band to which the terminal is connected; the channel performance parameter is used to characterize a channel pressure of a target channel used by the WiFi; In response to determining that the channel performance parameter meets a preset parameter condition, a connection interval between the terminal and the Bluetooth device is adjusted; the connection interval is used to represent a time interval for data interaction between the terminal and the Bluetooth device.
2. The method according to claim 1, characterized in that In response to determining that the channel performance parameter satisfies a preset parameter condition, adjusting the connection interval between the terminal and the Bluetooth device includes: In response to determining that the channel performance parameter satisfies a preset first parameter condition, increasing the connection interval between the terminal and the Bluetooth device; the first parameter condition is used to indicate that the target channel currently has channel pressure; or In response to determining that the channel performance parameter satisfies a preset second parameter condition, reducing the connection interval between the terminal and the Bluetooth device; the second parameter condition is used to indicate that the channel pressure does not currently exist on the target channel.
3. The method according to claim 2, characterized in that The increasing the connection interval between the terminal and the Bluetooth device includes: The increased connection interval is less than or equal to the preset connection interval.
4. The method according to claim 1, characterized in that: The Bluetooth device includes a Bluetooth headset device; The method further comprises: In response to determining that the channel performance parameter satisfies a preset parameter condition, a Bluetooth audio sampling rate of the Bluetooth headset is adjusted.
5. The method according to claim 4, characterized in that In response to determining that the channel performance parameter satisfies a preset parameter condition, adjusting the Bluetooth audio sampling rate of the Bluetooth headset includes: In response to determining that the channel performance parameter satisfies a preset third parameter condition, reducing the Bluetooth audio sampling rate of the Bluetooth headset; the preset third parameter condition is used to indicate that the target channel currently has channel pressure; or In response to determining that the channel performance parameter satisfies a preset fourth parameter condition, increasing the Bluetooth audio sampling rate of the Bluetooth headset; the preset fourth parameter condition is used to indicate that the target channel currently does not have the channel pressure.
6. The method according to claim 4, characterized in that In response to determining that the channel performance parameter satisfies a preset parameter condition, adjusting the Bluetooth audio sampling rate of the Bluetooth headset includes: Obtain a sampling rate set consisting of Bluetooth audio sampling rates supported by the Bluetooth headset; According to the channel performance parameter, determine the target Bluetooth audio sampling rate in the sampling rate set; wherein, the greater the channel pressure represented by the channel performance parameter, the lower the determined target Bluetooth audio sampling rate is, and the smaller the channel pressure represented by the channel performance parameter, the higher the determined target Bluetooth audio sampling rate is; The Bluetooth audio sampling rate of the Bluetooth headset is adjusted to the target Bluetooth audio sampling rate.
7. The method according to claim 1, characterized in that Before obtaining the channel performance parameters of the WiFi of the target frequency band to which the terminal is connected, the method further includes: It is detected that the terminal is connected to the WiFi of the target frequency band, and the number of the Bluetooth devices that have established Bluetooth connections with the terminal reaches a preset number threshold.
8. The method according to any one of claims 1 to 7, characterized in that: The channel performance parameter includes at least one of the following: The throughput requirement of the WiFi; The channel information of the target channel; the channel information is used to characterize the busyness of the target channel.
9. A device for adjusting the coexistence of Bluetooth and WiFi, characterized in that: The device comprises: An acquisition module, used to acquire a channel performance parameter of a WiFi of a target frequency band to which the terminal is connected; the channel performance parameter is used to characterize a channel pressure of a target channel used by the WiFi; The first adjustment module is used to adjust the connection interval between the terminal and the Bluetooth device in response to determining that the channel performance parameter meets the preset parameter condition; the connection interval is used to represent the time interval for data interaction between the terminal and the Bluetooth device.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of any method described in claims 1-8 are implemented.
11. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the steps of any one of the methods of claims 1-8.