Channel determination method and device
By calculating the average and standard deviation of the interference value of the Bluetooth headphone channel, determining the comprehensive score to select the target channel, solving the problem of inaccurate selection of Bluetooth headphone channels, improving channel stability and audio transmission reliability.
Patent Information
- Application Number
- CN202510494584.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-07-22
AI Technical Summary
In the prior art, the channel selection of Bluetooth headphones is affected by interference noise, resulting in poor channel accuracy and stability.
By acquiring multiple channel interference values of the Bluetooth playback device within a certain time interval within a preset time period, calculating the average and standard deviation of each channel, determining the average and standard deviation weights, and selecting the target channel for audio data transmission based on the comprehensive score.
It improves the accuracy and stability of channel selection, enhances the reliability of audio data transmission over the air, and avoids the lag of Bluetooth playback devices.
Smart Images

Figure CN120358622A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of Bluetooth communication, and specifically relates to a channel determination method and device. Background Art
[0002] With the development of wearable electronic products, more and more wearable electronic products support more and more functions, and the functional experience in specific scenarios is particularly important. For example, in scenarios such as running and fitness, users use mobile phones, watches, Bluetooth headsets, and even smart glasses to listen to music to improve the comfort and experience of exercise. In such scenarios, users often need to be unrestrained and free to play, and the venues are diverse and complex. Therefore, users usually use Bluetooth headsets to listen to music, and reliable Bluetooth transmission and high-quality music sound quality are particularly important.
[0003] When using a Bluetooth headset to listen to music, channel selection is required, and audio data is transmitted to the Bluetooth headset through the selected channel. In related technologies, the channel is usually selected by means of moving average. However, the channel selected by the moving average method is affected by interference noise, resulting in poor accuracy and stability of the selected channel. Summary of the Invention
[0004] The purpose of the embodiments of this application is to provide a channel determination method and device, which can solve the problem of poor accuracy and stability of channel selection.
[0005] In a first aspect, the embodiments of this application provide a channel determination method, which is applied to a first electronic device, and the first electronic device is communicatively connected to a Bluetooth playback device; the method includes:
[0006] Within a first preset time period, obtain multiple interference values of each channel among multiple channels communicating with the Bluetooth playback device at intervals of a second preset time period;
[0007] According to the multiple interference values of each channel, determine the average value and standard deviation of the multiple interference values of each channel;
[0008] According to the average value and standard deviation of the multiple interference values of each channel, determine the average value weight and standard deviation weight;
[0009] According to the average value weight and standard deviation weight, determine the comprehensive score corresponding to each channel;
[0010] According to the comprehensive score, determine a target channel from multiple channels, where the target channel is used to transmit audio data to the Bluetooth playback device.
[0011] In a second aspect, the embodiments of this application provide a channel determination device, which is applied to a first electronic device, and the first electronic device is communicatively connected to a Bluetooth playback device; the device includes:
[0012] A first acquisition module, configured to acquire multiple interference values of each channel in multiple channels communicating with a Bluetooth playback device at intervals of a second preset time period within a first preset time period;
[0013] A first determination module, configured to determine an average value and a standard deviation of the multiple interference values of each channel according to the multiple interference values of each channel;
[0014] A second determination module, configured to determine an average value weight and a standard deviation weight according to the average value and the standard deviation of the multiple interference values of each channel;
[0015] A third determination module, configured to determine a comprehensive score corresponding to each channel according to the average value weight and the standard deviation weight;
[0016] A fourth determination module, configured to determine a target channel from multiple channels according to the comprehensive score, where the target channel is used to transmit audio data to the Bluetooth playback device.
[0017] In a third aspect, an embodiment of the present application provides an electronic device, where the electronic device includes a processor and a memory, the memory stores a program or instruction that can run on the processor, and when the program or instruction is executed by the processor, the steps of the channel determination method provided by the embodiment of the present application are implemented.
[0018] In a fourth aspect, an embodiment of the present application provides a readable storage medium, where a program or instruction is stored on the readable storage medium, and when the program or instruction is executed by a processor, the steps of the channel determination method provided by the embodiment of the present application are implemented.
[0019] In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or instruction to implement the steps of the channel determination method provided by the embodiment of the present application.
[0020] In a sixth aspect, an embodiment of the present application provides a computer program product, where the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the steps of the channel determination method provided by the embodiment of the present application.
[0021] In an embodiment of the present application, within a first preset time period, multiple interference values of each channel among multiple channels communicating with a Bluetooth playback device are obtained at intervals of a second preset time period; based on the multiple interference values of each channel, the average value and standard deviation of the multiple interference values of each channel are determined; based on the average value and standard deviation of the multiple interference values of each channel, an average value weight and a standard deviation weight are determined; based on the average value weight and the standard deviation weight, a comprehensive score corresponding to each channel is determined; based on the comprehensive score, a target channel is determined from the multiple channels, where the target channel is used to transmit audio data to the Bluetooth playback device. The average value of the multiple interference values of a channel can measure the magnitude of interference of the channel, and the standard deviation of the multiple interference values of a channel can measure the stability of the interference values of the channel. Through the average value and standard deviation of the multiple interference values of each channel, the average value weight and the standard deviation weight can be determined. Based on the average value weight and the standard deviation weight, a score that comprehensively reflects the magnitude of channel interference and the stability of channel interference values can be obtained. Based on this score, the channel used to transmit audio data to the Bluetooth playback device is determined. In this way, the accuracy and stability of channel selection can be improved, the reliability and stability of audio data transmission in the air can be enhanced, and furthermore, the situation of audio data playback by the Bluetooth playback device being stuck can be avoided. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a flowchart of a channel determination method provided by an embodiment of the present application;
[0023] Figure 2 is a structural schematic diagram of a channel determination device provided by an embodiment of the present application;
[0024] Figure 3 is a structural schematic diagram of an electronic device provided by an embodiment of the present application;
[0025] Figure 4 is a hardware structural schematic diagram of an electronic device implementing the embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0026] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application belong to the scope of protection of the present application.
[0027] The terms "first", "second", etc. in the description and claims of this application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances so that the embodiments of this application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same category, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and / or" in the description and claims means at least one of the connected objects, and the character " / ", generally represents an "or" relationship between the associated objects before and after.
[0028] The following will combine the accompanying drawings and, through specific embodiments and their application scenarios, describe the channel determination method and device provided by the embodiments of this application.
[0029] The channel determination method and device provided by the embodiments of this application can be applied to a first electronic device. The first electronic device is communicatively connected to a Bluetooth playback device. The first electronic device includes, but is not limited to: mobile phones, tablets, smart watches, etc. The Bluetooth playback device includes, but is not limited to: Bluetooth headsets, Bluetooth speakers, etc.
[0030] Figure 1 It is a schematic flowchart of the channel determination method provided by the embodiments of this application. The channel determination method may include:
[0031] Step 101: Within a first preset time period, obtain multiple interference values of each of multiple channels communicating with the Bluetooth playback device at intervals of a second preset time period;
[0032] In some possible implementations of the embodiments of this application, the first preset time period and the second preset time period in the embodiments of this application can be set according to actual needs. For example, the first preset time period is 10 milliseconds, and the second preset time period is 1 millisecond.
[0033] Exemplarily, the first electronic device communicates with the Bluetooth playback device on N channels, where N is a positive integer; the first preset time period is 10 milliseconds, and the second preset time period is 1 millisecond.
[0034] For the i-th channel among the N channels, obtain 10 interference values of the i-th channel within 10 milliseconds, where i is a positive integer less than or equal to N. Suppose the 10 interference values of the i-th channel of Bluetooth communication obtained within 10 milliseconds are: -104 decibel-milliwatts (dBm), -104 dBm, -95 dBm, -95 dBm, -106 dBm, -106 dBm, -102 dBm, -102 dBm, -106 dBm, -106 dBm.
[0035] Step 102: Determine the average value and standard deviation of the multiple interference values of each channel according to the multiple interference values of each channel;
[0036] Exemplarily, taking the above-mentioned i-th channel as an example, the 10 interference values of the i-th channel are respectively: -104dbm, -104dbm, -95dbm, -95dbm, -106dbm, -106dbm, -102dbm, -102dbm, -106dbm, -106dbm.
[0037] Then the average value of the 10 interference values of the i-th channel is: -102.6dbm, and the standard deviation is: 4.08.
[0038] Among them, the average value of the multiple interference values of a channel can measure the magnitude of the interference of this channel. The larger the average value of the multiple interference values of a channel, the greater the interference of this channel; the standard deviation of the multiple interference values of a channel can measure the stability of the interference values of this channel. The larger the standard deviation of the multiple interference values of a channel, the worse the stability of the interference values of this channel, that is, the fluctuation of the interference values of this channel is relatively large.
[0039] Step 103: Determine the average value weight and standard deviation weight according to the average value and standard deviation of the multiple interference values of each channel;
[0040] In some possible implementations of the embodiments of the present application, step 103 may include: generating an average value sequence and a standard deviation sequence corresponding to multiple channels according to the average value and standard deviation of the multiple interference values of each channel; determining the first coefficient of variation of the average value sequence; where the first coefficient of variation is used to measure the degree of dispersion of the average values in the average value sequence; determining the second coefficient of variation of the standard deviation sequence; where the second coefficient of variation is used to measure the degree of dispersion of the standard deviations in the standard deviation sequence; determining the average value weight and the standard deviation weight according to the first coefficient of variation and the second coefficient of variation.
[0041] Among them, the coefficient of variation is the ratio of the standard deviation to the average value of all the numerical values in a sequence. Through the coefficient of variation, the degree of dispersion of the numerical values in this sequence can be measured. The larger the first coefficient of variation of the average value sequence, the greater the average value weight; the larger the second coefficient of variation of the standard deviation sequence, the greater the standard deviation weight.
[0042] In some possible implementations of the embodiments of the present application, the average value of the multiple interference values of the i-th channel is denoted as ai, the standard deviation of the multiple interference values of the i-th channel is denoted as Si, the average value sequence A corresponding to multiple channels, and the standard deviation sequence S corresponding to multiple channels.
[0043] Then the average value sequence A corresponding to multiple channels is a1, a2, ……, ai, ……, aN; the standard deviation sequence S corresponding to multiple channels is S1, S2, ……, Si, ……, SN.
[0044] Step 104: Determine the average value weight and the standard deviation weight according to the average value sequence and the standard deviation sequence;
[0045] In some possible implementations of the embodiments of the present application, when determining the first coefficient of variation of the average value sequence, the ratio of the standard deviation of the average value sequence to the average value of the average value sequence can be used as the first coefficient of variation; when determining the second coefficient of variation corresponding to the standard deviation sequence, the ratio of the standard deviation of the standard deviation sequence to the average value of the standard deviation sequence can be used as the second coefficient of variation.
[0046] In some possible implementations of the embodiments of the present application, the first coefficient of variation of the average value sequence can be calculated by the following formula (1), and the second coefficient of variation of the standard deviation sequence can be calculated by the following formula (2):
[0047]
[0048] Wherein, in formulas (1) and (2), CV(A) is the coefficient of variation of the average value sequence, σ A is the standard deviation of the average value sequence, is the average value of the average value sequence; CV(S) is the coefficient of variation of the standard deviation sequence, σ S is the standard deviation of the standard deviation sequence, is the average value of the standard deviation sequence.
[0049] In some possible implementations of the embodiments of the present application, determining the average value weight and the standard deviation weight according to the first coefficient of variation and the second coefficient of variation may include: calculating the sum of the first coefficient of variation and the second coefficient of variation to obtain a sum value; using the ratio of the first coefficient of variation to the sum value as the average value weight; using the ratio of the second coefficient of variation to the sum value as the standard deviation weight.
[0050] In some possible implementations of the embodiments of the present application, the average value weight can be calculated by the following formula (3), and the standard deviation weight can be calculated by the following formula (4):
[0051]
[0052] Wherein, in formulas (3) and (4), W1 is the average value weight, W2 is the standard deviation weight, CV(A) is the coefficient of variation of the average value sequence, and CV(S) is the coefficient of variation of the standard deviation sequence.
[0053] Step 104: Determine the comprehensive score corresponding to each channel according to the average value weight and the standard deviation weight;
[0054] In some possible implementations of the embodiments of the present application, the larger the comprehensive score of a certain channel, the smaller the interference and the better the stability of the channel.
[0055] In some possible implementations of the embodiments of the present application, step 104 may include: normalizing the average value and the standard deviation of the multiple interference values of each channel to obtain the average value normalization value and the standard deviation normalization value corresponding to each channel; for the first channel, calculating the product of the average value normalization value corresponding to the first channel and the average value weight to obtain the first product value; where the first channel is any one of the multiple channels; calculating the product of the standard deviation normalization value corresponding to the first channel and the standard deviation weight to obtain the second product value; and taking the sum of the first product value and the second product value as the comprehensive score of the first channel.
[0056] In some possible implementations of the embodiments of the present application, when normalizing the average value and the standard deviation of the multiple interference values of each channel, the first difference between the maximum value and the minimum value in the average value sequence may be calculated, the second difference between the maximum value in the average value sequence and the average value of the multiple interference values of the i-th channel may be calculated, and the ratio of the second difference to the first difference may be used as the average value normalization value of the multiple interference values of the i-th channel; the third difference between the maximum value and the minimum value in the standard deviation sequence may be calculated, the fourth difference between the maximum value in the standard deviation sequence and the standard deviation of the multiple interference values of the i-th channel may be calculated, and the ratio of the fourth difference to the third difference may be used as the standard deviation normalization value of the multiple interference values of the i-th channel.
[0057] In some possible implementations of the embodiments of the application, the average value normalization value and the standard deviation normalization value corresponding to each channel may be determined by the following formulas (5) and (6):
[0058]
[0059] where, in formulas (5) and (6), N A (i) is the average value normalization value of the multiple interference values of the i-th channel, max(A) is the maximum value in the average value sequence, ai is the average value of the multiple interference values of the i-th channel, and min(A) is the minimum value in the average value sequence; N S (i) is the standard deviation normalization value of the multiple interference values of the i-th channel, max(S) is the maximum value in the standard deviation sequence, Si is the standard deviation of the multiple interference values of the i-th channel, and min(S) is the minimum value of the standard deviation in the standard deviation sequence.
[0060] In some possible implementations of the embodiments of the present application, the comprehensive score of each channel may be calculated by the following formula (7):
[0061] C(i) = W1 * N A (i0 + W2 * N S (i0 (7)
[0062] Among them, in formula (7), C(i0 is the comprehensive score of the i-th channel, W1 is the average value weight, W2 is the standard deviation weight, and N A (i) is the normalized value of the average of the average values of multiple interference values of the i-th channel, N S (i) is the normalized value of the standard deviation of the standard deviations of multiple interference values of the i-th channel.
[0063] Step 105: Determine a target channel from multiple channels according to the comprehensive score, where the target channel is used to transmit audio data to a Bluetooth playback device.
[0064] In some possible implementations of the embodiments of the present application, in step 105, multiple channels can be sorted in descending order of the comprehensive score, and then the first M channels in the sorting are selected as the target channels, where M is a positive integer less than N.
[0065] In some possible implementations of the embodiments of the present application, Bluetooth communication usually has 79 channels, and at least 20 of them are used during Bluetooth communication, that is, N above can be 79 and M can be 20.
[0066] Exemplarily, assume there are three Bluetooth communication channels, namely channel X, Y, and Z. Among them, the average values of the interference values of channel X, Y, and Z are -100 dbm, -101 dbm, and -103 dbm respectively, and the standard deviations are 1, 7, and 8 respectively. Through the above, the comprehensive scores of channel X, Y, and Z can be calculated as 0.8, 0.18, and 0.2 respectively. Then, channel X with a comprehensive score of 0.8 can be selected to transmit audio data to the Bluetooth playback device.
[0067] In an embodiment of the present application, within a first preset time period, multiple interference values of each channel among multiple channels communicating with a Bluetooth playback device are obtained at intervals of a second preset time period; according to the multiple interference values of each channel, the average value and the standard deviation of the multiple interference values of each channel are determined; according to the average value and the standard deviation of the multiple interference values of each channel, the average value weight and the standard deviation weight are determined; according to the average value weight and the standard deviation weight, a comprehensive score corresponding to each channel is determined; according to the comprehensive score, a target channel is determined from the multiple channels, where the target channel is used to transmit audio data to the Bluetooth playback device. The average value of the multiple interference values of a channel can measure the magnitude of the interference of the channel, and the standard deviation of the multiple interference values of a channel can measure the stability of the interference values of the channel. Through the average value and the standard deviation of the multiple interference values of each channel, the average value weight and the standard deviation weight can be determined. Based on the average value weight and the standard deviation weight, a score that comprehensively reflects the magnitude of the channel interference and the stability of the channel interference values can be obtained. Based on this score, the channel used to transmit audio data to the Bluetooth playback device is determined. In this way, the accuracy and stability of channel selection can be improved, the reliability and stability of audio data transmission in the air can be enhanced, and furthermore, the situation of audio data playback jitter on the Bluetooth playback device can be avoided.
[0068] In some possible implementations of the embodiment of the present application, before step 102, the channel determination method provided by the embodiment of the present application may further include: determining a second channel among the multiple channels and the channels adjacent to the second channel as channels to be excluded, where the second channel is the channel corresponding to the maximum interference value among the interference values of the multiple channels; excluding the channels to be excluded from the multiple channels to obtain remaining channels; correspondingly, step 102 may include: according to the multiple interference values of each channel in the remaining channels, determining the average value and the standard deviation of the multiple interference values of each channel in the remaining channels.
[0069] In some possible implementations of the embodiment of the present application, after obtaining the multiple interference values of each channel, the maximum value of the interference values can be determined from the multiple interference values of the multiple channels. Furthermore, the channel corresponding to the maximum value and the channels adjacent to the channel can be determined as channels to be excluded. Then, the channels to be excluded are excluded from the multiple channels. After that, the average value and the standard deviation of the multiple interference values of each channel in the remaining channels after excluding the channels to be excluded are determined.
[0070] Exemplarily, taking the above 79 channels as an example, assuming that among the multiple interference values of the 5th channel, there is the maximum value of the multiple interference values of the 79 channels, then the 5th channel and the 4th and 6th channels adjacent to the 5th channel are determined as channels to be excluded. The 4th, 5th, and 6th channels are excluded from the 79 channels, and the average value and the standard deviation of the multiple interference values of each channel in the remaining 76 channels are determined.
[0071] In some possible implementations of the embodiments of the present application, before step 103, the channel determination method provided by the embodiments of the present application may further include: determining a third channel among multiple channels and the channels adjacent to the third channel as the channels to be excluded, where the third channel is the channel corresponding to the largest average value; excluding the channels to be excluded from the multiple channels to obtain remaining channels; correspondingly, step 103 may include: determining an average value weight and a standard deviation weight according to the average value and the standard deviation of multiple interference values of each channel in the remaining channels.
[0072] Exemplarily, taking the above 79 channels as an example, assuming that the average value of multiple interference values of the 5th channel is the maximum value of the average values of multiple interference values of the 79 channels, then the 5th channel and the 4th and 6th channels adjacent to the 5th channel are determined as the channels to be excluded, and the 4th, 5th, and 6th channels are excluded from the 79 channels, and an average value sequence and a standard deviation sequence are generated according to the average value and the standard deviation of multiple interference values of each channel in the remaining 76 channels.
[0073] In the embodiments of the present application, by determining the channels to be excluded and then excluding the channels to be excluded, the calculation amount for determining the comprehensive score can be reduced, and the efficiency of determining the target channel can be improved.
[0074] In some possible implementations of the embodiments of the present application, the channel determination method provided by the embodiments of the present application may further include: reducing the bit rate of the audio data when a first condition is satisfied; transmitting the audio data with the reduced bit rate to the Bluetooth playback device through the target channel;
[0075] where the first condition includes at least one of the following:
[0076] The average value of multiple interference values of each channel is greater than a first threshold;
[0077] The average value of the multiple interference values obtained last time is greater than a second threshold;
[0078] The standard deviation of the multiple interference values obtained last time is greater than a third threshold.
[0079] In some possible implementations of the embodiments of the present application, the first threshold, the second threshold, and the third threshold in the embodiments of the present application can be set according to actual requirements.
[0080] Exemplarily, when the average values of the interference values of multiple channels are all relatively large, and the average value of the interference values of multiple channels obtained last time within the first preset time period is also relatively large, and the standard deviation of the interference values of multiple channels obtained last time is also relatively large, it may not be possible to ensure the reliability of transmitting audio data through the Advanced Audio Distribution Profile (A2DP) even by selecting a better target channel, and it will also cause the Bluetooth playback device to experience audio jitter. At this time, reduce the bit rate of the audio data. For example, reduce the bit rate of the audio data from 128 kilobits per second (kbps) to 96 kbps, and transmit the audio data through the target channel at a bit rate of 96 kbps.
[0081] Exemplarily again, when the average values of the interference values of multiple channels are all relatively large, it may not be possible to ensure the reliability of transmitting audio data through the A2DP even by selecting a better target channel, and it will also cause the Bluetooth playback device to experience audio jitter. At this time, reduce the bit rate of the audio data. For example, reduce the bit rate of the audio data from 128 kbps to 96 kbps, and transmit the audio data through the target channel at a bit rate of 96 kbps.
[0082] Exemplarily again, when the average value of the interference values of multiple channels obtained last time within the first preset time period is relatively large, and the standard deviation of the interference values of multiple channels obtained last time is also relatively large, it may not be possible to ensure the reliability of transmitting audio data through the A2DP even by selecting a better target channel, and it will also cause the Bluetooth playback device to experience audio jitter. At this time, reduce the bit rate of the audio data. For example, reduce the bit rate of the audio data from 128 kbps to 96 kbps, and transmit the audio data through the target channel at a bit rate of 96 kbps.
[0083] In the embodiments of the present application, by reducing the bit rate of the audio data, it is possible to further avoid the situation of audio data playback jitter.
[0084] In some possible implementations of the embodiments of the present application, the channel determination method provided by the embodiments of the present application may further include: before transmitting audio data to the Bluetooth playback device through the target channel, obtaining the motion state of the first electronic device; and adjusting the bit rate of the audio data according to the motion state.
[0085] In some possible implementations of the embodiments of the present application, the motion state of the first electronic device in the embodiments of the present application includes that the first electronic device moves from a weak signal strength position to a strong signal strength position, or the first electronic device moves from a strong signal strength position to a weak signal strength position.
[0086] In some possible implementations of the embodiments of the present application, when the first electronic device moves from a position with strong signal strength to a position with weak signal strength, the bit rate of the audio data can be reduced in advance, and then the audio data can be transmitted through the target channel at the reduced bit rate; when the first electronic device moves from a position with weak signal strength to a position with strong signal strength, the bit rate of the audio data can be increased in advance, and then the audio data can be transmitted through the target channel at the increased bit rate.
[0087] In some possible implementations of the embodiments of the present application, the signal strength between the first electronic device and the Bluetooth playback device at each position can be pre-statistically analyzed, and then based on the statistically analyzed signal strength, it can be determined whether the first electronic device moves from a position with weak signal strength to a position with strong signal strength or from a position with strong signal strength to a position with weak signal strength.
[0088] Exemplarily, taking the first electronic device as a watch and the Bluetooth playback device as a Bluetooth headset as an example, during the process of a user running, as the user runs, the signal strength between the watch and the Bluetooth headset will change as the user swings their arm. At this time, the signal strength at three positions, namely when the arm is in the most forward position, the middle position, and the most backward position, can be statistically analyzed. Assuming that the signal strength when the arm is in the most forward position is greater than the signal strength when the arm is in the middle position, and the signal strength when the arm is in the middle position is greater than the signal strength when the arm is in the most backward position; when the arm swings forward, the watch moves from a position with weak signal strength to a position with strong signal strength. At this time, the bit rate of the audio data can be increased in advance, and then the audio data can be transmitted through the target channel at the increased bit rate; when the arm swings backward, the watch moves from a position with strong signal strength to a position with weak signal strength. At this time, the bit rate of the audio data can be reduced in advance, and then the audio data can be transmitted through the target channel at the reduced bit rate.
[0089] Exemplarily, taking the first electronic device as a mobile phone and the Bluetooth playback device as a Bluetooth headset as an example, where the mobile phone may be carried by the user in a waist bag, a trouser pocket, or a mobile phone pouch on the arm. During the user's running process, as the user runs, the signal strength between the mobile phone and the Bluetooth headset will also change as the user moves. At this time, the signal strength between the mobile phone and the Bluetooth headset at each position can be statistically analyzed, and then based on the statistically analyzed signal strength, it can be determined whether the mobile phone moves from a weak signal strength position to a strong signal strength position or from a strong signal strength position to a weak signal strength position. For example, when the mobile phone is carried by the user as a load in a trouser pocket at the calf, the signal strength at two positions, when the leg is lifted to the highest position and when the leg is lowered to the ground, can be statistically analyzed. Suppose it is statistically analyzed that the signal strength when the leg is lifted to the highest position is greater than the signal strength when the leg is lowered to the ground; when the user lifts the leg, the mobile phone moves from a weak signal strength position to a strong signal strength position. At this time, the bit rate of the audio data can be increased in advance, and then the audio data can be transmitted through the target channel at the increased bit rate; when the user lowers the leg, the mobile phone moves from a strong signal strength position to a weak signal strength position. At this time, the bit rate of the audio data can be decreased in advance, and then the audio data can be transmitted through the target channel at the decreased bit rate.
[0090] In the embodiments of the present application, the bit rate can be dynamically adjusted in advance according to the motion state of the electronic device, which can further avoid the situation of audio data playback jamming.
[0091] In some possible implementations of the embodiments of the present application, the channel determination method provided by the embodiments of the present application may further include: controlling the Bluetooth playback device to play audio data after a first time period when a second condition is satisfied;
[0092] Wherein, the second condition includes at least one of the following:
[0093] The first electronic device is in a first position, and the first position is a pre-marked weak signal position;
[0094] The first Bluetooth signal strength is less than a fourth threshold, and the first Bluetooth signal strength is the Bluetooth signal strength between the first electronic device and the Bluetooth playback device when the first electronic device is in the first position.
[0095] In some possible implementations of the embodiments of the present application, the Bluetooth playback device may have a memory for storing the audio data sent by the first electronic device.
[0096] When the first electronic device switches audio data, it can first determine whether the first electronic device is in a weak signal position and whether the signal strength of the first electronic device is weak. When the first electronic device is in a weak signal position and the signal strength of the first electronic device is weak, the audio data switching is postponed for a period of time.
[0097] When the first electronic device switches audio data, it can first determine whether the first electronic device is in a weak signal position. When the first electronic device is in a weak signal position, the audio data switching is postponed for a period of time.
[0098] When the first electronic device switches audio data, it can first determine whether the signal strength of the first electronic device is weak. When the signal strength of the first electronic device is weak, the audio data switching is postponed for a period of time.
[0099] In the embodiments of the present application, the situation of audio jamming during audio data switching can be avoided.
[0100] In some possible implementations of the embodiments of the present application, the first electronic device is also connected to the second electronic device via Bluetooth communication; the channel determination method provided by the embodiments of the present application may further include: determining the audio data transmission mode according to the second Bluetooth signal strength and the third Bluetooth signal strength; where the second Bluetooth signal strength is the Bluetooth signal strength between the first electronic device and the Bluetooth playback device, and the third Bluetooth signal strength is the Bluetooth signal strength between the first electronic device and the second electronic device; transmitting the audio data according to the audio data transmission mode.
[0101] Exemplarily, taking the first electronic device as a watch, the second electronic device as a mobile phone, and the Bluetooth playback device as a Bluetooth headset as an example. At this time, the watch is connected to both the mobile phone and the Bluetooth headset. The audio data played by the Bluetooth headset is essentially sourced from the mobile phone. Especially in the scenario where the Bluetooth headset plays networked audio, the mobile phone needs to obtain the audio data from the network, transmit the audio data to the watch, and then the watch transmits the audio data to the Bluetooth headset.
[0102] When the Bluetooth signal strength between the watch and the mobile phone is strong and the Bluetooth signal strength between the watch and the Bluetooth headset is also strong, after the watch obtains the audio data from the mobile phone, it can directly send the audio data through the determined target channel.
[0103] When the Bluetooth signal strength between the watch and the mobile phone is strong but the Bluetooth signal strength between the watch and the Bluetooth headset is weak, the bit rate of the audio data between the watch and the Bluetooth headset can be reduced, the data transmission bandwidth and the number of retransmissions can be decreased, the bandwidth between the watch and the mobile phone can be increased, and as much audio data as possible can be transmitted to the watch during this period to improve the utilization rate of the Bluetooth bandwidth. When switching the audio data, the audio data transmission is preferentially based on the Bluetooth Serial Port Profile (SPP) protocol.
[0104] When the Bluetooth signal strength between the watch and the mobile phone is weak but the Bluetooth signal strength between the watch and the Bluetooth headset is strong, the cache in the headset can be increased to store audio data, enabling the headset to store more audio data in advance, reducing the number of data packets sent and received by the mobile phone, avoiding excessive retransmissions caused by bandwidth occupation, and maximizing the utilization of the Bluetooth bandwidth as much as possible. When switching audio data, audio data transmission is preferentially based on the SPP protocol.
[0105] When the Bluetooth signal strength between the watch and the mobile phone is weak and the Bluetooth signal strength between the watch and the Bluetooth headset is also weak, when audio data is already being played, while reducing the bit rate of the audio data, data retransmission is preferentially configured to allow transmission based on the A2DP protocol; when switching audio data, audio data transmission is preferentially based on the SPP protocol, and the transmission based on the A2DP protocol is appropriately delayed.
[0106] In some possible implementations of the embodiments of the present application, the Bluetooth playback device may be connected to both the first electronic device and the second electronic device, where the first electronic device is also connected to the second electronic device. For example, the Bluetooth headset is connected to both the mobile phone and the watch, and the mobile phone is connected to the watch. For the Bluetooth headset, the watch and the mobile phone both exist simultaneously in terms of audio data transmission, and the playback progress is strictly synchronized, starting and pausing at the same time.
[0107] When the Bluetooth signal strength between the Bluetooth headset and the mobile phone is strong and the Bluetooth signal strength between the Bluetooth headset and the watch is also strong, when the audio data is from the mobile phone, the mobile phone is preferentially used to transmit the audio data, and when the audio data is from the watch, the watch is preferentially used to transmit the audio data.
[0108] When the Bluetooth signal strength between the Bluetooth headset and the mobile phone is strong but the Bluetooth signal strength between the Bluetooth headset and the watch is weak, when the audio data is from the watch, the watch transmits the audio data to the Bluetooth headset through the mobile phone.
[0109] When the Bluetooth signal strength between the Bluetooth headset and the mobile phone is weak but the Bluetooth signal strength between the Bluetooth headset and the watch is strong, when the audio data is from the mobile phone, the mobile phone transmits the audio data to the Bluetooth headset through the watch.
[0110] When the Bluetooth signal strength between the Bluetooth headset and the mobile phone is weak and the Bluetooth signal strength between the Bluetooth headset and the watch is also weak, the target channel is determined from the communication channels between the Bluetooth headset and the mobile phone and between the Bluetooth headset and the watch through the above-mentioned method of determining the target channel, and then the audio data is transmitted through the device corresponding to the target channel.
[0111] The channel determination method provided by the embodiments of this application may be executed by a channel determination device. In the embodiments of this application, taking the channel determination device executing the channel determination method as an example, the channel determination device provided by the embodiments of this application is described.
[0112] Figure 2 It is a schematic structural diagram of the channel determination device provided by the embodiments of this application. The channel determination device 200 may include:
[0113] A first acquisition module 201, configured to acquire multiple interference values of each channel in multiple channels communicating with a Bluetooth playback device at intervals of a second preset time period within a first preset time period;
[0114] A first determination module 202, configured to determine the average value and standard deviation of the multiple interference values of each channel according to the multiple interference values of each channel;
[0115] A second determination module 203, configured to determine an average value weight and a standard deviation weight according to the average value and standard deviation of the multiple interference values of each channel;
[0116] A third determination module 204, configured to determine a comprehensive score corresponding to each channel according to the average value weight and the standard deviation weight;
[0117] A fourth determination module 205, configured to determine a target channel from multiple channels according to the comprehensive score, where the target channel is used to transmit audio data to the Bluetooth playback device.
[0118] In some possible implementations of the embodiments of this application, the second determination module 203 may include:
[0119] A generation sub-module, configured to generate an average value sequence and a standard deviation sequence corresponding to multiple channels according to the average value and standard deviation of the multiple interference values of each channel;
[0120] A first determination sub-module, configured to determine a first coefficient of variation of the average value sequence; where the first coefficient of variation is used to measure the degree of dispersion of the average values in the average value sequence;
[0121] A second determination sub-module, configured to determine a second coefficient of variation of the standard deviation sequence; where the second coefficient of variation is used to measure the degree of dispersion of the standard deviations in the standard deviation sequence;
[0122] A third determination sub-module, configured to determine the average value weight and the standard deviation weight according to the first coefficient of variation and the second coefficient of variation.
[0123] In some possible implementations of the embodiments of this application, the third determination sub-module is specifically configured to:
[0124] Calculate the sum of the first coefficient of variation and the second coefficient of variation to obtain a sum value;
[0125] Use the ratio of the first coefficient of variation to the sum value as the average weight;
[0126] Use the ratio of the second coefficient of variation to the sum value as the standard deviation weight.
[0127] In some possible implementations of the embodiments of the present application, the third determination module 204 is specifically configured to:
[0128] Normalize the average value and the standard deviation of the multiple interference values of each channel to obtain the average value normalization value and the standard deviation normalization value corresponding to each channel;
[0129] For the first channel, calculate the product of the average value normalization value corresponding to the first channel and the average weight to obtain a first product value; where the first channel is any one of the multiple channels;
[0130] Calculate the product of the standard deviation normalization value corresponding to the first channel and the standard deviation weight to obtain a second product value;
[0131] Use the sum of the first product value and the second product value as the comprehensive score of the first channel.
[0132] In some possible implementations of the embodiments of the present application, the channel determination device provided by the embodiments of the present application further includes:
[0133] A fifth determination module, configured to determine the second channel among the multiple channels and the channels adjacent to the second channel as the channels to be excluded, where the second channel is the channel corresponding to the largest interference value among the multiple interference values of the multiple channels;
[0134] An exclusion module, configured to exclude the channels to be excluded from the multiple channels to obtain the remaining channels;
[0135] The first determination module 202 is specifically configured to:
[0136] According to the multiple interference values of each channel in the remaining channels, determine the average value and the standard deviation of the multiple interference values of each channel in the remaining channels.
[0137] In some possible implementations of the embodiments of the present application, the channel determination device provided by the embodiments of the present application further includes:
[0138] A reduction module, configured to reduce the bit rate of the audio data when a first condition is satisfied;
[0139] A transmission module, configured to transmit the audio data with the reduced bit rate to the Bluetooth playback device through the target channel;
[0140] Wherein, the first condition includes at least one of the following:
[0141] The average value of multiple interference values for each channel is greater than a first threshold value;
[0142] The average value of the multiple interference values obtained last time is greater than a second threshold value;
[0143] The standard deviation of the multiple interference values obtained last time is greater than a third threshold value.
[0144] In some possible implementations of the embodiments of the present application, the channel determination device provided by the embodiments of the present application further includes:
[0145] A second acquisition module, configured to acquire the motion state of the first electronic device before transmitting audio data to the Bluetooth playback device through the target channel;
[0146] An adjustment module, configured to adjust the bit rate of the audio data according to the motion state.
[0147] In some possible implementations of the embodiments of the present application, the channel determination device provided by the embodiments of the present application further includes:
[0148] A control module, configured to control the Bluetooth playback device to play the audio data after a first duration when a second condition is satisfied;
[0149] Wherein, the second condition includes at least one of the following:
[0150] The first electronic device is in a first position, and the first position is a pre-marked weak signal position;
[0151] The first Bluetooth signal strength is less than a fourth threshold value, and the first Bluetooth signal strength is the Bluetooth signal strength between the first electronic device and the Bluetooth playback device when the first electronic device is in the first position.
[0152] In some possible implementations of the embodiments of the present application, the first electronic device is further Bluetooth communication-connected to a second electronic device; the channel determination device provided by the embodiments of the present application further includes:
[0153] A sixth determination module, configured to determine an audio data transmission mode according to a second Bluetooth signal strength and a third Bluetooth signal strength; wherein, the second Bluetooth signal strength is the Bluetooth signal strength between the first electronic device and the Bluetooth playback device, and the third Bluetooth signal strength is the Bluetooth signal strength between the first electronic device and the second electronic device;
[0154] A transmission module is configured to: transmit the audio data according to the audio data transmission mode.
[0155] The channel determination device in the embodiments of the present application may be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal or other devices other than the terminal. Exemplarily, the electronic device may be a mobile phone, a tablet computer, a laptop computer, a handheld computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. It may also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiments of the present application do not make specific limitations.
[0156] The channel determination device in the embodiments of the present application may be a device with an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems. The embodiments of the present application do not make specific limitations.
[0157] The channel determination device provided in the embodiments of the present application can implement Figure 1 each process implemented by the channel determination method embodiments. To avoid repetition, details are not described herein again.
[0158] Optionally, as Figure 3 shown, the embodiments of the present application further provide an electronic device 300, including a processor 301 and a memory 302. A program or instruction that can run on the processor 301 is stored on the memory 302. When the program or instruction is executed by the processor 301, it implements each step of the channel determination method embodiments provided in the embodiments of the present application and can achieve the same technical effects. To avoid repetition, details are not described herein again.
[0159] Figure 4 is a schematic diagram of the hardware structure of the electronic device implementing the embodiments of the present application.
[0160] The electronic device 400 includes, but is not limited to: a radio frequency unit 401, a network module 402, an audio output unit 403, an input unit 404, a sensor 405, a display unit 406, a user input unit 407, an interface unit 408, a memory 409, and a processor 410, etc.
[0161] Those skilled in the art can understand that the electronic device 400 may further include a power source (such as a battery) for powering each component. The power source can be logically connected to the processor 410 through a power management system, so as to manage functions such as charging, discharging, and power consumption management through the power management system. Figure 4 The structure of the electronic device shown in the figure does not limit the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0162] Among them, the processor 410 is configured to: within a first preset time period, obtain multiple interference values of each channel in multiple channels communicating with the Bluetooth playback device at intervals of a second preset time period; determine the average value and standard deviation of the multiple interference values of each channel according to the multiple interference values of each channel; determine the average value weight and standard deviation weight according to the average value and standard deviation of the multiple interference values of each channel; determine the comprehensive score corresponding to each channel according to the average value weight and standard deviation weight; determine a target channel from multiple channels according to the comprehensive score, where the target channel is used to transmit audio data to the Bluetooth playback device.
[0163] In some possible implementations of the embodiments of the present application, the processor 410 is specifically configured to:
[0164] Generate an average value sequence and a standard deviation sequence corresponding to multiple channels according to the average value and standard deviation of the multiple interference values of each channel;
[0165] Determine the first coefficient of variation of the average value sequence; where the first coefficient of variation is used to measure the degree of dispersion of the average values in the average value sequence;
[0166] Determine the second coefficient of variation of the standard deviation sequence; where the second coefficient of variation is used to measure the degree of dispersion of the standard deviations in the standard deviation sequence;
[0167] Determine the average value weight and standard deviation weight according to the first coefficient of variation and the second coefficient of variation.
[0168] In some possible implementations of the embodiments of the present application, the processor 410 is specifically configured to:
[0169] Calculate the sum of the first coefficient of variation and the second coefficient of variation to obtain a sum value;
[0170] Take the ratio of the first coefficient of variation to the sum value as the average value weight;
[0171] Take the ratio of the second coefficient of variation to the sum value as the standard deviation weight.
[0172] In some possible implementations of the embodiments of the present application, the processor 410 is specifically configured to:
[0173] Normalize the average value and standard deviation of multiple interference values for each channel to obtain the average value normalization value and standard deviation normalization value corresponding to each channel;
[0174] For the first channel, calculate the product of the average value normalization value corresponding to the first channel and the average value weight to obtain a first product value; wherein, the first channel is any one of the multiple channels;
[0175] Calculate the product of the standard deviation normalization value corresponding to the first channel and the standard deviation weight to obtain a second product value;
[0176] Take the sum of the first product value and the second product value as the comprehensive score of the first channel.
[0177] In some possible implementations of the embodiments of the present application, the processor 410 is further configured to:
[0178] Determine the second channel among the multiple channels and the channels adjacent to the second channel as the channels to be excluded, wherein the second channel is the channel corresponding to the largest interference value among the interference values of the multiple channels;
[0179] Exclude the channels to be excluded from the multiple channels to obtain the remaining channels;
[0180] According to the multiple interference values of each channel in the remaining channels, determine the average value and standard deviation of the multiple interference values of each channel in the remaining channels.
[0181] In some possible implementations of the embodiments of the present application, the processor 410 is further configured to:
[0182] Reduce the bit rate of the audio data when the first condition is satisfied;
[0183] Transmit the audio data with the reduced bit rate to the Bluetooth playback device through the target channel;
[0184] Wherein, the first condition includes at least one of the following:
[0185] The average value of the multiple interference values of each channel is greater than the first threshold;
[0186] The average value of the multiple interference values obtained last time is greater than the second threshold;
[0187] The standard deviation of the multiple interference values obtained last time is greater than the third threshold.
[0188] In some possible implementations of the embodiments of the present application, the processor 410 is further configured to:
[0189] Before transmitting the audio data to the Bluetooth playback device through the target channel, obtain the motion state of the first electronic device;
[0190] An adjustment module for adjusting the bit rate of audio data according to the motion state.
[0191] In some possible implementations of the embodiments of the present application, the processor 410 is further configured to:
[0192] When the second condition is met, after the first duration, control the Bluetooth playback device to play the audio data;
[0193] Wherein, the second condition includes at least one of the following:
[0194] The first electronic device is in the first position, and the first position is a pre-marked weak signal position;
[0195] The first Bluetooth signal strength is less than the fourth threshold, and the first Bluetooth signal strength is the Bluetooth signal strength between the first electronic device and the Bluetooth playback device when the first electronic device is in the first position.
[0196] In some possible implementations of the embodiments of the present application, the first electronic device is also Bluetooth communication-connected to the second electronic device; the processor 410 is further configured to:
[0197] Determine the audio data transmission method according to the second Bluetooth signal strength and the third Bluetooth signal strength; wherein, the second Bluetooth signal strength is the Bluetooth signal strength between the first electronic device and the Bluetooth playback device, and the third Bluetooth signal strength is the Bluetooth signal strength between the first electronic device and the second electronic device;
[0198] Transmit the audio data according to the audio data transmission method.
[0199] It should be understood that in the embodiments of the present application, the input unit 404 may include a Graphics Processing Unit (GPU) 4041 and a microphone 4042. The graphics processor 4041 processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 406 may include a display panel 4061, and the display panel 4061 may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 407 includes at least one of a touch panel 4071 and other input devices 4072. The touch panel 4071 is also called a touch screen. The touch panel 4071 may include two parts: a touch detection device and a touch controller. The other input devices 4072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, which will not be elaborated here.
[0200] The memory 409 can be used to store software programs and various data. The memory 409 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area may store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 409 may include a volatile memory or a non-volatile memory, or the memory 409 may include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 409 in the embodiments of the present application includes, but is not limited to, these and any other suitable types of memories.
[0201] The processor 410 may include one or more processing units; optionally, the processor 410 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above modem processor may not be integrated into the processor 410 either.
[0202] The embodiments of the present application also provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the embodiment of the channel determination method provided by the embodiments of the present application, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0203] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer-readable storage medium. Examples of computer-readable storage media include non-transitory computer-readable media, such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs, etc.
[0204] An embodiment of the present application also provides a chip. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is configured to run programs or instructions to implement each process of the embodiment of the channel determination method provided by the embodiment of the present application, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0205] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.
[0206] An embodiment of the present application also provides a computer program product. The program product is stored in a storage medium. The program product is executed by at least one processor to implement each process of the embodiment of the channel determination method provided by the embodiment of the present application, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0207] It should be noted that in this article, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed. It may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0208] Through the description of the above embodiments, those skilled in the art can clearly understand that the above method of the embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence or the part that contributes to the prior art, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present application.
[0209] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.
Claims
1. A channel determination method, characterized in that, The method is applied to a first electronic device, which is communicatively connected to a Bluetooth playback device; the method includes: Within a first preset time period, obtain multiple interference values of each of multiple channels communicating with the Bluetooth playback device at intervals of a second preset time period; According to the multiple interference values of each channel, determine the average value and the standard deviation of the multiple interference values of each channel; According to the average value and the standard deviation of the multiple interference values of each channel, determine the average value weight and the standard deviation weight; According to the average value weight and the standard deviation weight, determine the comprehensive score corresponding to each channel; According to the comprehensive score, determine a target channel from the multiple channels, where the target channel is used to transmit audio data to the Bluetooth playback device.
2. The method according to claim 1, wherein The determining the average value weight and the standard deviation weight according to the average value and the standard deviation of the multiple interference values of each channel includes: According to the average value and the standard deviation of the multiple interference values of each channel, generate an average value sequence and a standard deviation sequence corresponding to the multiple channels; Determine a first coefficient of variation of the average value sequence; where the first coefficient of variation is used to measure the degree of dispersion of the average values in the average value sequence; Determine a second coefficient of variation of the standard deviation sequence; where the second coefficient of variation is used to measure the degree of dispersion of the standard deviations in the standard deviation sequence; According to the first coefficient of variation and the second coefficient of variation, determine the average value weight and the standard deviation weight.
3. The method according to claim 2, wherein The determining the average value weight and the standard deviation weight according to the first coefficient of variation and the second coefficient of variation includes: Calculate the sum of the first coefficient of variation and the second coefficient of variation to obtain a sum value; Take the ratio of the first coefficient of variation to the sum value as the average value weight; Take the ratio of the second coefficient of variation to the sum value as the standard deviation weight.
4. The method according to claim 1, characterized in that The determining the comprehensive score corresponding to each channel according to the average value weight and the standard deviation weight includes: Normalize the average value and the standard deviation of the multiple interference values of each channel to obtain an average value normalization value and a standard deviation normalization value corresponding to each channel; For a first channel, calculate the product of the average value normalization value corresponding to the first channel and the average value weight to obtain a first product value; where the first channel is any one of the multiple channels; Calculate the product of the standard deviation normalization value corresponding to the first channel and the standard deviation weight to obtain a second product value; Take the sum of the first product value and the second product value as the comprehensive score of the first channel.
5. The method according to claim 1, characterized in that, Before the determining the average value and the standard deviation of the multiple interference values of each channel according to the multiple interference values of each channel, the method further includes: Determine a second channel among the multiple channels and the channels adjacent to the second channel as the channels to be excluded, where the second channel is the channel corresponding to the largest interference value among the interference values of the multiple channels; Exclude the channels to be excluded from the multiple channels to obtain remaining channels; Determining the average value and standard deviation of the multiple interference values of each channel according to the multiple interference values of each channel includes: Determining the average value and standard deviation of the multiple interference values of each channel in the remaining channels according to the multiple interference values of each channel in the remaining channels.
6. The method according to claim 1, characterized in that, The method further includes: Reducing the bit rate of the audio data when a first condition is satisfied; Transmitting the audio data after reducing the bit rate to the Bluetooth playback device through the target channel; Wherein, the first condition includes at least one of the following: The average value of the multiple interference values of each channel is greater than a first threshold; The average value of the multiple interference values obtained last time is greater than a second threshold; The standard deviation of the multiple interference values obtained last time is greater than a third threshold.
7. The method according to claim 1, characterized in that The method further includes: Before transmitting the audio data to the Bluetooth playback device through the target channel, obtaining the motion state of the first electronic device; Adjusting the bit rate of the audio data according to the motion state.
8. The method according to claim 1, characterized in that The method further includes: When a second condition is satisfied, controlling the Bluetooth playback device to play the audio data after a first time period; Wherein, the second condition includes at least one of the following: The first electronic device is in a first position, and the first position is a pre-marked weak signal position; The first Bluetooth signal strength is less than a fourth threshold, and the first Bluetooth signal strength is the Bluetooth signal strength between the first electronic device and the Bluetooth playback device when the first electronic device is in the first position.
9. The method according to claim 1, characterized in that, The first electronic device is further Bluetooth communication-connected to a second electronic device; the method further includes: Determining an audio data transmission method according to a second Bluetooth signal strength and a third Bluetooth signal strength; wherein, the second Bluetooth signal strength is the Bluetooth signal strength between the first electronic device and the Bluetooth playback device, and the third Bluetooth signal strength is the Bluetooth signal strength between the first electronic device and the second electronic device; Transmitting the audio data according to the audio data transmission method.
10. A channel determination device, characterized in that, The device is applied to a first electronic device, and the first electronic device is communication-connected to a Bluetooth playback device; the device includes: A first acquisition module, configured to acquire multiple interference values of each channel in multiple channels communicating with the Bluetooth playback device at intervals of a second preset time period within a first preset time period; A first determination module, configured to determine the average value and standard deviation of the multiple interference values of each channel according to the multiple interference values of each channel; A second determination module, configured to determine an average value weight and a standard deviation weight according to the average value and standard deviation of the multiple interference values of each channel; A third determination module, configured to determine a comprehensive score corresponding to each channel according to the average value weight and the standard deviation weight; A fourth determination module, configured to determine a target channel from the multiple channels according to the comprehensive score; Wherein, the target channel is used to transmit audio data to the Bluetooth playback device.
Citation Information
Cited By
Bluetooth communication method and system based on edge computing
CN121357520A