WO2025246794A1 - 一种蓝牙传输码率的控制方法及电子设备 - Google Patents

一种蓝牙传输码率的控制方法及电子设备

Info

Publication number
WO2025246794A1
WO2025246794A1 PCT/CN2025/092388 CN2025092388W WO2025246794A1 WO 2025246794 A1 WO2025246794 A1 WO 2025246794A1 CN 2025092388 W CN2025092388 W CN 2025092388W WO 2025246794 A1 WO2025246794 A1 WO 2025246794A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
bluetooth
transmission
bitrate
tablet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2025/092388
Other languages
English (en)
French (fr)
Inventor
李炜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Publication of WO2025246794A1 publication Critical patent/WO2025246794A1/zh
Pending legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup

Definitions

  • This application relates to the field of communication technology, and in particular to a method for controlling Bluetooth transmission rate and an electronic device.
  • Electronic devices can connect to multiple Bluetooth devices simultaneously. When an electronic device is sending data to one Bluetooth device, it cannot transmit data from another Bluetooth device.
  • a tablet computer supports simultaneous connection of Bluetooth headphones and a stylus via Bluetooth. While listening to music from the tablet with the Bluetooth headphones, the user can write on the tablet with the stylus.
  • the tablet's data transmission to the Bluetooth headphones consumes significant Bluetooth channel resources, the stylus data cannot be transmitted to the screen in a timely manner, potentially causing abnormalities such as hooks and broken lines in the stylus writing on the tablet screen.
  • This application provides a Bluetooth transmission rate control method and electronic device, which ensures that the tablet computer has sufficient Bluetooth channel resources to transmit data from other Bluetooth devices when transmitting data to a Bluetooth headset.
  • a method for controlling Bluetooth transmission rate is provided, applied to a first electronic device.
  • the method includes:
  • a first electronic device establishes a Bluetooth connection with a second electronic device, and the first electronic device sends data to the second electronic device at a first transmission rate.
  • the first electronic device monitors the Bluetooth status, such as the Bluetooth channel quality.
  • the Bluetooth status of the first electronic device meets preset conditions, the first electronic device sends data to the second electronic device at a second transmission rate.
  • the second transmission rate is lower than the first transmission rate used when sending data to the second electronic device at the first time point.
  • Meeting the preset conditions for the Bluetooth status of the first electronic device includes: the Bluetooth channel quality of the first electronic device at the second time point is lower than the Bluetooth channel quality at the first time point. This ensures that the transmission rate used by the first electronic device to send data to the second electronic device is not too high, guaranteeing that the first electronic device has sufficient Bluetooth channel resources to allocate to other Bluetooth devices.
  • the method further includes: after the first electronic device establishes a Bluetooth connection with the second electronic device, the first electronic device enables a dynamic bitrate adjustment function.
  • This dynamic bitrate adjustment function is used to select an appropriate transmission bitrate based on the current Bluetooth state.
  • the first electronic device can enable the dynamic bitrate adjustment function as soon as it detects the establishment of a Bluetooth connection with the second electronic device. This allows for timely adjustment of the transmission bitrate used to send data to the second electronic device when the Bluetooth state is subsequently monitored to meet preset conditions.
  • the transmission bitrate of the second electronic device is greater than or equal to a preset threshold. That is, the first electronic device only triggers the dynamic bitrate adjustment function when it detects an electronic device that has established a Bluetooth connection with it, and certain conditions (such as preset device conditions) are met. Thus, if the transmission bitrate of the electronic device that has established a Bluetooth connection with the first electronic device is low, the dynamic bitrate adjustment function will not be activated. Therefore, when an electronic device is connected to the first electronic device, its transmission bitrate will not be adjusted based on the Bluetooth status. Consequently, when an electronic device with a low transmission bitrate connects to the first electronic device, it can avoid having its transmission bitrate adjusted, thus preventing a decrease in data transmission performance.
  • the Bluetooth state of the first electronic device meets preset conditions, further including: the number of devices establishing Bluetooth connections with the first electronic device is greater than or equal to two. That is, the first electronic device will only adjust the transmission rate used to send data to the second electronic device when it detects that the Bluetooth channel quality at the second time point is lower than the Bluetooth channel quality at the first time point, if it has established Bluetooth connections with at least two electronic devices. Thus, the first electronic device will not adjust the transmission rate used to send data to the second electronic device if it only has a Bluetooth connection with the second electronic device. This avoids the problem of the second electronic device's data transmission performance deteriorating due to adjusting the transmission rate.
  • the method further includes: at a second time point, the first electronic device establishes a Bluetooth connection with a third electronic device.
  • the first electronic device establishing a new Bluetooth connection with another electronic device may cause a degradation in Bluetooth channel quality.
  • the second electronic device establishes a Bluetooth connection with the third electronic device, causing the Bluetooth channel quality at the second time point to be lower than the Bluetooth channel quality at the first time point. Therefore, based on this state, the first electronic device selects to send data to the third electronic device at a lower second transmission rate.
  • the method further includes: at a third time point, after the first time point and before the second time point, the first electronic device establishes a Bluetooth connection with the third electronic device and enables dynamic bitrate adjustment.
  • This dynamic bitrate adjustment function is used to select an appropriate transmission bitrate based on the current Bluetooth state.
  • the first electronic device only enables the dynamic bitrate adjustment function when at least two devices are connected. Thus, if the first electronic device only establishes a Bluetooth connection with the second electronic device, it will not adjust the transmission bitrate used to send data to the second electronic device. This avoids the problem of the data transmission performance of the second electronic device deteriorating due to bitrate adjustment.
  • the transmission bitrate of the second electronic device is greater than or equal to a preset threshold. That is, the first electronic device will only activate the dynamic bitrate adjustment function if it detects at least two electronic devices connected to it via Bluetooth, and one of these devices meets certain conditions (such as preset device conditions). If the transmission bitrate of the electronic device connected to the first electronic device is low, the dynamic bitrate adjustment function will not be activated. This avoids the problem of reduced data transmission performance caused by the lower transmission bitrate being adjusted when the first electronic device connects to it. Alternatively, if some of the electronic devices connected to the first electronic device have a higher transmission bitrate, but the first electronic device is currently only connected to one Bluetooth device, the dynamic bitrate adjustment function will not be activated. This way, when the first electronic device is only connected to the second electronic device, the transmission bitrate used to send data to the second electronic device will not be adjusted. This avoids the problem of reduced data transmission performance caused by adjusting the transmission bitrate.
  • the method further includes: disconnecting the Bluetooth connection between the first electronic device and the second electronic device, and disabling the dynamic bitrate adjustment function on the first electronic device. This avoids the first electronic device monitoring the Bluetooth status even when it has only established a Bluetooth connection with the third electronic device, reducing unnecessary power consumption.
  • the method further includes: disconnecting the Bluetooth connection between the first electronic device and the third electronic device, and disabling the dynamic bitrate adjustment function on the first electronic device. This avoids the first electronic device monitoring the Bluetooth status even when it has only established a Bluetooth connection with the second electronic device, reducing unnecessary power consumption.
  • the first electronic device disconnects its Bluetooth connection from the second electronic device, and also disconnects its Bluetooth connection from the third electronic device, while the first electronic device disables dynamic bitrate adjustment. This reduces unnecessary power consumption.
  • the transmission code rate corresponding to the second electronic device is greater than or equal to a preset threshold, which may specifically include: the first transmission code rate being greater than or equal to the preset threshold.
  • the second transmission code rate is less than or equal to a preset threshold. That is, when the first electronic device adjusts the transmission code rate used to send data to the second electronic device, it will adjust the transmission code rate that is greater than or equal to the preset threshold to be less than the preset threshold. This ensures that after the first electronic device lowers the transmission code rate used to send data to the second electronic device, the first electronic device has sufficient Bluetooth channel resources allocated for transmitting data from other Bluetooth devices.
  • the first electronic device transmits data to the second electronic device at a second transmission code rate.
  • this may include: the first electronic device determining target encoding information matching the Bluetooth state; the target code rate information being used to characterize the second transmission code rate.
  • the first electronic device controls a target encoder of its own device to transmit data to the second electronic device based on the target code rate information and using the second transmission code rate.
  • the target encoder is the encoder used by the first electronic device to transmit data to the second electronic device.
  • a first electronic device controls a target encoder to send data to a second electronic device using a second transmission code rate based on target code rate information.
  • this may include: the first electronic device sending the target code rate information to the target encoder via Bluetooth; and the target encoder sending data to the second electronic device using the second transmission code rate based on the target code rate information.
  • the first electronic device determines target coding information matching the Bluetooth state. Specifically, this may include: the first electronic device determining target bitrate information based on the Bluetooth channel quality. For example, the Bluetooth channel quality can be divided into different ranges, each range corresponding to a bitrate information. The first electronic device may pre-store the correspondence between Bluetooth channel quality and bitrate information to find the matching target bitrate information from this correspondence based on the Bluetooth channel quality.
  • the target bit rate information includes a second transmission bit rate.
  • the target bit rate information includes a target bit rate level, which corresponds to the second transmission bit rate.
  • the method further includes: In response to the first electronic device activating Bluetooth, registering a preset callback function in the Bluetooth protocol stack.
  • the preset callback function is used to trigger the first electronic device to control the target encoder to adjust the transmission code rate used to send data to the second electronic device based on target code rate information, when the Bluetooth state of the first electronic device meets preset conditions.
  • the first electronic device detects that the Bluetooth state meets the preset conditions, it can promptly control the target encoder to adjust the transmission code rate used to send data to the second electronic device.
  • the method further includes: In response to establishing a Bluetooth connection between the first electronic device and the second electronic device, the first electronic device registers a preset callback function in the Bluetooth protocol stack.
  • the preset callback function is used to trigger the first electronic device to control the target encoder to adjust the transmission code rate used to send data to the second electronic device based on target code rate information, when the Bluetooth state of the first electronic device meets preset conditions.
  • the method can promptly control the target encoder to adjust the transmission code rate used to send data to the second electronic device.
  • the method further includes: disconnecting the Bluetooth connection between the first electronic device and the second electronic device, and disabling the dynamic bitrate adjustment function in the first electronic device.
  • the second electronic device is a Bluetooth headset.
  • the transmission bit rate of the Bluetooth headset can be greater than a preset threshold.
  • the third electronic device could be a stylus or a Bluetooth keyboard, etc.
  • the target encoder used by the first electronic device to transmit data to the second electronic device is based on either Low Latency Audio Codec (LDAC) or Low Latency High Definition Audio Codec (LHDC). Both LDAC and LHDC encoders support higher maximum transmission bitrates. When both the first and second electronic devices support either LDAC or LHDC encoding, the first electronic device will transmit data to the second electronic device at a higher transmission bitrate. Therefore, the first electronic device can dynamically adjust the transmission bitrate used to transmit data to the second electronic device based on its Bluetooth status, ensuring that the first electronic device has sufficient Bluetooth channel resources allocated to other electronic devices.
  • LDAC Low Latency Audio Codec
  • LHDC Low Latency High Definition Audio Codec
  • this application also provides a method for controlling the Bluetooth transmission rate, applied to a first electronic device.
  • the method includes: at a first time point, when the first electronic device has established a Bluetooth connection only with a second electronic device, the first electronic device transmits data to the second electronic device at a first transmission rate.
  • the first electronic device transmits data to the second electronic device at a second transmission rate; the second transmission rate is less than the first transmission rate.
  • the first electronic device when the first electronic device is connected to only one Bluetooth device, it sends data to that device at a higher transmission rate. When the first electronic device is connected to two Bluetooth devices, it sends data to that device at a lower transmission rate. This ensures that the first electronic device has sufficient Bluetooth channel resources for transmitting data from other electronic devices.
  • the transmission code rate corresponding to the second electronic device is greater than a preset threshold.
  • the first time point is before the second time point.
  • the first electronic device establishes a Bluetooth connection with the second electronic device.
  • the second electronic device establishes a connection with the third electronic device.
  • the first electronic device lowers the transmission rate used to send data to the second electronic device.
  • the second time point is prior to the first time point.
  • the first electronic device simultaneously establishes Bluetooth connections with both the first and second electronic devices.
  • the first electronic device disconnects its Bluetooth connection with the third electronic device.
  • the first electronic device is only connected to the second electronic device, and therefore, based on the second time point, the first electronic device can increase the transmission rate used to send data to the second electronic device.
  • the second electronic device is a Bluetooth headset.
  • the transmission bit rate of the Bluetooth headset can be greater than a preset threshold.
  • the third electronic device could be a stylus or a Bluetooth keyboard, etc.
  • this application also provides an electronic device.
  • This electronic device can be the first electronic device described above.
  • the electronic device may include a processor and a memory.
  • the memory stores computer execution instructions, and when the electronic device is running, the processor executes the computer execution instructions stored in the memory to cause the electronic device to perform the Bluetooth transmission rate control method as described in any of the first aspects above.
  • this application provides a computer-readable storage medium storing instructions that, when executed on a computer, enable the computer to perform the Bluetooth transmission rate control method of any of the first aspects described above.
  • a computer program product containing instructions which, when run on an electronic device, enables the electronic device to execute the Bluetooth transmission rate control method of any one of the first aspects described above.
  • an apparatus e.g., a system-on-a-chip
  • a processor for supporting an electronic device in performing the functions described in the first aspect above.
  • the apparatus further comprises a memory for storing program instructions and data necessary for the electronic device.
  • the apparatus may be composed of chips or may include chips and other discrete devices.
  • Figure 1 is a schematic diagram of a communication system provided in an embodiment of this application.
  • Figure 2 is a schematic diagram of the handwriting of a stylus provided in an embodiment of this application.
  • Figure 3A is a schematic diagram of the data flow of Bluetooth transmission data provided in an embodiment of this application.
  • Figure 3B is a schematic diagram of partial information from the Bluetooth logs of some tablet computers in some examples.
  • Figure 3C is a schematic diagram showing the actual audio encoding bit rate and corresponding time of a tablet computer in some examples
  • FIG. 4 is a flowchart of a Bluetooth transmission rate control method provided in an embodiment of this application.
  • FIG. 5 is a flowchart of a Bluetooth transmission rate control method provided in an embodiment of this application.
  • FIG. 6 is a flowchart of a Bluetooth transmission rate control method provided in an embodiment of this application.
  • FIG. 7 is a flowchart of a Bluetooth transmission rate control method provided in an embodiment of this application.
  • FIG. 8 is a flowchart of a Bluetooth transmission rate control method provided in an embodiment of this application.
  • FIG. 9 is a hardware structure diagram of an electronic device provided in an embodiment of this application.
  • Figure 10 is a software framework diagram of an electronic device provided in an embodiment of this application.
  • Figure 11 is a structural block diagram of a chip system provided in an embodiment of this application.
  • LDAC Low latency audio coding
  • LHDC Low-latency high-definition audio codec
  • A2DP Bluetooth audio distribution profile
  • Transmission rate is the number of bits transmitted per unit of time, usually expressed in bits per second (bps). Different Bluetooth codecs typically have different rate ranges and adjustment methods.
  • the Bluetooth interface is the entry point for applications to access the protocol stack library through the Java Native Interface (JNI).
  • JNI Java Native Interface
  • Bluetooth audio/video interface vendor-specific event callbacks are typically related to Bluetooth audio transmission.
  • Transparent transmission also known as pass-through, refers to the process in which, regardless of the content of the transmitted business, the system only transmits the content from the source address to the destination address without making any changes to the business data content.
  • Electronic devices can support simultaneous connection to two or more Bluetooth devices.
  • the tablet computer 10 supports connecting a stylus 30 via Bluetooth while playing music through a connected Bluetooth headset 20.
  • the stylus 30 can then be used for writing on the screen of the tablet computer 10.
  • the tablet computer 10 also supports connection to Bluetooth devices such as Bluetooth speakers, car infotainment systems, mobile phones, smartwatches, or Bluetooth keyboards.
  • FIG. 2a shows the handwriting displayed on the screen in response to the stylus writing operation under normal conditions. In abnormal conditions, hooks may appear as shown in the dotted circle in Figure 2b, or broken lines may appear as shown in the dotted circle in Figure 2c.
  • users can perform clicks on the tablet screen using a stylus, and the tablet can respond to these clicks. For example, if a user clicks the back control on the screen with the stylus, the tablet will respond by returning to the previous page. If a user clicks a thumbnail on the screen with the stylus, the tablet will respond by displaying the image corresponding to the thumbnail.
  • tablets may exhibit response delays or other anomalies to click operations.
  • the tablet computer can send audio data to Bluetooth headsets while simultaneously receiving writing data from a stylus.
  • the tablet's Bluetooth reports the writing data from the stylus to the screen so that the screen can draw the handwriting.
  • Sending writing data from the tablet to the headset does not consume Bluetooth channel resources; however, reporting writing data to the screen does. Therefore, if the tablet still uses the first transmission rate to send data to the Bluetooth headset, and the transmission rate is too high, consuming too much Bluetooth channel resources, it may affect the transmission of writing data reported to the screen.
  • Bluetooth cannot report the writing data from the stylus to the screen in a timely manner, and the screen cannot draw the handwriting promptly.
  • the writing data reported by Bluetooth to the screen may be delayed; this can easily lead to backlash or response delays.
  • the writing data reported by Bluetooth to the screen may be lost; in this case, disconnection or unresponsiveness may occur.
  • FIG. 3B shows partial information from the host controller interface (HCI) Bluetooth logs of handwriting data reported to the screen via Bluetooth in some specific examples.
  • the Bluetooth logs show the time and time delta corresponding to multiple attribute protocol (ATT) notification packets.
  • ATT notification packet corresponds to one instance of handwriting data reported to the screen via Bluetooth.
  • the time delta represents the interval between the reporting time of this handwriting data and the reporting time of the previous handwriting data. It can be seen that the data highlighted with dashed lines and displayed in bold corresponds to a larger time delta.
  • Figure 3C illustrates, in some specific examples, the actual encoded audio bitrate of the tablet computer and the corresponding time when the tablet computer sends data to the Bluetooth headset.
  • This actual encoded audio bitrate is the transmission bitrate used by the tablet computer to send data to the Bluetooth headset. It can be seen that the actual encoded audio bitrate of the tablet computer is relatively high for most of the time, such as exceeding 1 megabit per second (Mbit/s). Comparing the information shown in Figures 3B and 3C, it can be determined that at the points in time when the tablet computer uses a higher transmission bitrate to send data to the Bluetooth headset, the time interval for the tablet computer's Bluetooth to report the writing time to the screen is relatively long.
  • this application proposes a Bluetooth transmission rate control method.
  • This method is used in scenarios where multiple Bluetooth devices, such as tablets, are simultaneously connected, to lower the transmission rate of one Bluetooth device to ensure that data from other Bluetooth devices can be transmitted normally.
  • the first electronic device sends data to the second electronic device at a first transmission rate.
  • the first electronic device detects a decrease in Bluetooth channel quality compared to the first time point, it sends data to the second electronic device at a second transmission rate.
  • the second transmission rate is lower than the first transmission rate.
  • the transmission rate of the second electronic device is lowered. This ensures that the first electronic device has more Bluetooth channel resources allocated to other devices that need them, guaranteeing that the first electronic device can transmit data from other devices normally.
  • the transmission bitrate corresponding to a Bluetooth device can refer to the transmission bitrate at which electronic devices such as tablets send data to the Bluetooth device, such as when a tablet sends audio data to Bluetooth headphones.
  • the transmission bitrate corresponding to a Bluetooth device can refer to the data transmitted by electronic devices such as tablets to the Bluetooth device, such as when a tablet's Bluetooth reports writing data from a stylus to the screen.
  • the first electronic device supports simultaneous connection to at least two Bluetooth devices.
  • the first electronic device establishes a Bluetooth connection with a second electronic device, and the first electronic device sends data to the second electronic device at a first transmission code rate.
  • the transmission code rate corresponding to the second electronic device is greater than or equal to a preset threshold.
  • the first electronic device establishes a Bluetooth connection with a third electronic device. At this time, the first electronic device adds a new Bluetooth connection, which may cause a decrease in Bluetooth channel quality.
  • the first electronic device detects that the Bluetooth channel quality at the second time point is lower than that at the first time point, it sends data to the second electronic device at a second transmission code rate, which is lower than the first transmission code rate. That is, when the first electronic device is simultaneously connected to multiple electronic devices (including the second electronic device), the transmission code rate used when sending data to the second electronic device will be appropriately reduced. In this way, by reducing the code rate used when sending data to the second electronic device, the data transmission rate of other electronic devices (such as the third electronic device) can be guaranteed, the time interval between two adjacent data transmissions can be reduced, and latency can be reduced.
  • a tablet computer as the first electronic device, a Bluetooth headset as the second electronic device, and a stylus as the third electronic device as an example
  • the tablet computer when the tablet computer is only connected to the Bluetooth headset, it sends data to the Bluetooth headset at a first transmission code rate, which is greater than or equal to a preset threshold.
  • the tablet computer When the tablet computer is simultaneously connected to both the Bluetooth headset and the stylus, it sends data to the Bluetooth headset at a second transmission code rate, which is lower than the first transmission code rate. Therefore, in this embodiment of the application, when the tablet computer is simultaneously connected to both the Bluetooth headset and the stylus, the tablet computer will send data to the Bluetooth headset at a second transmission code rate lower than the first transmission code rate.
  • the writing data from the stylus can be pressure-sensitive data.
  • the tablet computer reports the writing data to the screen via Bluetooth, which can be achieved through pass-through.
  • the first electronic device sends data to the second electronic device using a preset encoder.
  • the preset encoder may be based on LDAC or LHDC encoding.
  • the scenario corresponding to the data sent by the first electronic device to the second electronic device is: the first electronic device sends audio data or call data to the second electronic device.
  • the aforementioned first electronic device may be a mobile phone, tablet computer, personal computer (PC), smart screen, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, smartwatch and other wearable devices, artificial intelligence (AI) speaker, and in-vehicle equipment. It may also be various teaching aids (e.g., learning machines, early education machines), smart toys, portable robots, personal digital assistants (PDAs), augmented reality (AR)/virtual reality (VR) devices, media players, and other Bluetooth-enabled devices. Furthermore, it may be a device with mobile office functions, a smart home function, an audio-visual entertainment function, a device supporting smart travel, or other Bluetooth-enabled devices. This application does not impose any special limitations on the specific form of the device.
  • the second electronic device can be a Bluetooth speaker, Bluetooth headset, stylus, Bluetooth keyboard, smartwatch, smart bracelet, etc.
  • the third electronic device can also be a Bluetooth speaker, Bluetooth headset, stylus, Bluetooth keyboard, smartwatch, smart bracelet, etc.
  • FIG. 4 illustrates the flowchart of a Bluetooth transmission rate control method in some embodiments of this application.
  • a tablet computer is used as the first electronic device and a Bluetooth headset is used as an example for illustration.
  • the tablet computer establishes a Bluetooth connection with the Bluetooth headset.
  • the tablet computer sends data to the Bluetooth headset at the first transmission bit rate.
  • the data sent by the tablet to the Bluetooth headphones can specifically be audio data.
  • Bluetooth headsets Users can also use Bluetooth headsets to answer audio or video calls on the tablet.
  • the tablet sends data to the Bluetooth headset, including sending call data from the tablet to the Bluetooth headset.
  • the tablet computer sends data to the Bluetooth headset, specifically through the tablet's Bluetooth. That is, S203 above can specifically include: the tablet computer's Bluetooth sending data to the Bluetooth headset at a first transmission code rate.
  • Bluetooth can specifically refer to a Bluetooth control module.
  • This Bluetooth control module can include a Bluetooth application at the application layer, a Bluetooth framework at the application framework layer, a Bluetooth manager at the hardware abstraction layer, and a Bluetooth driver at the kernel layer.
  • the transmission bitrate used by the tablet to send data to the Bluetooth headset can be controlled by the encoder used to send data to the Bluetooth headset (hereinafter referred to as the encoder corresponding to the Bluetooth headset).
  • the initial transmission bitrate used by the encoder corresponding to the Bluetooth headset is determined by the encoder itself based on the information of both parties.
  • the first transmission bitrate is the initial transmission bitrate used by the tablet to send data to the Bluetooth headset.
  • the encoder is an LDAC encoder
  • both parties support LDAC encoding
  • the initial transmission bitrate can be 990 kbps.
  • the second electronic device such as a Bluetooth headset
  • the tablet computer can execute subsequent processes, such as S204 and S205, after establishing a Bluetooth connection with a device that meets the preset device conditions.
  • the method further includes: the tablet computer determining whether the device (in this embodiment, a Bluetooth headset) that has established a Bluetooth connection with the tablet computer meets the preset device conditions. If so, steps S204 and S205 are executed. If the Bluetooth headset does not meet the preset device conditions, steps S204 and S205 do not need to be executed, and data can be continuously sent to the Bluetooth headset at the first transmission rate.
  • the aforementioned preset device conditions may specifically include: the transmission bit rate used by the tablet computer to transmit data to the Bluetooth headset is greater than or equal to a preset threshold. That is, when the tablet computer detects that the transmission bit rate of the device establishing a Bluetooth connection with it is greater than or equal to the preset threshold, it needs to execute steps S204 and S205.
  • the preset threshold can be set according to actual conditions, for example, it can be set to 600kbps, 660kbps, etc.
  • the aforementioned preset device conditions may specifically include: the Bluetooth headset belongs to a preset device.
  • the preset device may be a device that requires dynamic bitrate adjustment in advance.
  • the tablet computer may pre-store device identifiers for one or more preset devices.
  • the device identifier may specifically be a device model, such as Bluetooth headset model 1, Bluetooth headset model 2, Bluetooth speaker model 3, etc.
  • the aforementioned preset device conditions may specifically include: the encoder corresponding to the Bluetooth headset belongs to a preset encoder. As described above, different Bluetooth encoders have different bitrate ranges. Some encoders use higher transmission bitrates. If the encoder corresponding to the device establishing a Bluetooth connection with the tablet belongs to the aforementioned preset encoder, the tablet needs to execute S204 and S205. Therefore, in some embodiments, the tablet may also pre-store encoder identifiers of some preset encoders. For example, the encoder identifier may be the encoder type or device code, etc. In some specific examples, the encoder types of the preset encoders include LDAC and LHDC.
  • the tablet computer only executes S204 and S205 when connecting to certain specific Bluetooth devices. For example, if the condition is set to a higher transmission bitrate for the Bluetooth device connected to the tablet computer, then the tablet computer is triggered to execute S204 and S205. In this way, for devices with a lower initial transmission bitrate, the subsequent process will not be executed, and the tablet computer will not adjust the bitrate when transmitting data from these devices.
  • the tablet computer detected that the Bluetooth channel quality at the second time point was lower than that at the first time point.
  • the method may further include: at a second time point, the tablet computer acquires the Bluetooth channel quality at the second time point. Then, the Bluetooth channel quality at the second time point can be compared with the Bluetooth channel quality at the first time point to determine whether the Bluetooth channel quality of the tablet computer has decreased compared to the first time point.
  • Bluetooth channel quality indicates the quality of the tablet's current Bluetooth transmission; the higher the Bluetooth channel quality, the faster the Bluetooth transmission rate and the higher the transmission quality; conversely, the lower the Bluetooth channel quality, the lower the Bluetooth transmission rate and the lower the transmission quality.
  • the Bluetooth channel quality has corresponding quantization parameters.
  • the tablet computer can obtain the current Bluetooth channel quality by acquiring these quantization parameters. For example, a higher parameter value indicates a higher Bluetooth channel quality.
  • S204 may include: the tablet computer detecting a parameter value for the Bluetooth channel quality at a second time point that is lower than the parameter value for the Bluetooth channel quality at the first time point.
  • the tablet computer detects Bluetooth channel quality, specifically by monitoring the Bluetooth channel quality through the tablet computer's Bluetooth chip.
  • the tablet computer sends data to the Bluetooth headset at a second transmission rate, which is lower than the first transmission rate.
  • the tablet computer switches the transmission bitrate used to send data to the Bluetooth headset from a first transmission bitrate to a second transmission bitrate; this can also be referred to as the tablet computer updating the transmission bitrate used to send data to the Bluetooth headset.
  • the specific implementation process of the tablet computer updating the transmission bitrate used to send data to the Bluetooth headset will be described in detail in later embodiments.
  • the tablet computer triggers an update to the transmission rate used to send data to the Bluetooth headset after detecting a degradation in Bluetooth channel quality.
  • the Bluetooth channel quality can be denoted as the Bluetooth state
  • the condition that the tablet computer needs to meet to update the transmission rate can be denoted as the first preset condition. That is, in some embodiments, the tablet computer updates the transmission rate used to send data to the Bluetooth headset when it detects that the Bluetooth state meets the first preset condition.
  • the tablet's Bluetooth chip can send a notification message to the tablet's Bluetooth system indicating a deterioration in Bluetooth channel quality.
  • the tablet's Bluetooth system can determine a second transmission code rate lower than the first transmission code rate, and then, in S205, send the second transmission code rate to the encoder corresponding to the Bluetooth headset, so that the encoder corresponding to the Bluetooth headset encodes according to the second transmission code rate.
  • the tablet's Bluetooth chip can select appropriate bitrate information based on the current Bluetooth state (such as Bluetooth channel quality).
  • the selected bitrate information can be the target bitrate information described in the above embodiments.
  • the process by which the Bluetooth chip selects appropriate bitrate information based on the current Bluetooth state can be referred to as the Bluetooth chip's dynamic bitrate adjustment function.
  • the Bluetooth chip needs to enable the dynamic bitrate adjustment function before performing the above method. The specific implementation process of enabling the Bluetooth chip's dynamic bitrate adjustment function will be described in detail in later embodiments.
  • the dynamic bitrate adjustment function of the Bluetooth chip is specifically used to adaptively adjust the transmission bitrate of the tablet computer to devices that meet preset device conditions, such as Bluetooth headsets.
  • the tablet's Bluetooth chip can select a suitable transmission bitrate based on the current Bluetooth state (e.g., the selected transmission bitrate could be the second transmission bitrate mentioned above), and then send the suitable transmission bitrate to the tablet's Bluetooth.
  • the tablet's Bluetooth then sends the suitable transmission bitrate to the encoder corresponding to the Bluetooth headset, so that the encoder corresponding to the Bluetooth headset can encode according to the transmission bitrate.
  • the tablet's Bluetooth chip can also select a suitable transmission bitrate level based on the current Bluetooth status; this transmission bitrate level corresponds to the transmission bitrate.
  • the selected transmission bitrate level can correspond to the second transmission bitrate mentioned above.
  • the Bluetooth chip selects a suitable transmission bitrate level, it can send the selected transmission bitrate level to the tablet's Bluetooth, so that it can send the transmission bitrate level to the encoder corresponding to the Bluetooth headset, and the encoder can encode according to the transmission bitrate corresponding to the transmission bitrate level.
  • the suitable transmission bitrate level selected by the Bluetooth chip can be the bitrate level corresponding to the second transmission bitrate.
  • the transmission bitrate used by the tablet computer to send data to the Bluetooth headset is controlled by the encoder corresponding to the Bluetooth headset.
  • the bitrate used by the encoder corresponding to the Bluetooth headset can be updated to adjust the transmission bitrate for sending data to the Bluetooth headset.
  • updating the bitrate used by the encoder corresponding to the Bluetooth headset can be achieved by the tablet computer's Bluetooth sending the transmission bitrate to be updated to the encoder corresponding to the Bluetooth headset. That is, S205 specifically includes: the tablet computer's Bluetooth sending target bitrate information to the encoder corresponding to the Bluetooth headset, the target bitrate information representing the second transmission bitrate.
  • the encoder corresponding to the Bluetooth headset controls the transmission bitrate used to send data to the Bluetooth headset to switch from the first transmission bitrate to the second transmission bitrate.
  • the target bitrate information can be the second transmission bitrate or a bitrate level corresponding to the second transmission bitrate.
  • the tablet's Bluetooth can send a bitrate update command to the Bluetooth chip, which carries target bitrate information.
  • the tablet's Bluetooth sends the target bitrate information to the encoder corresponding to the Bluetooth headset, which can be achieved through a preset callback function.
  • This preset callback function is used to trigger the tablet's Bluetooth to send the target bitrate information to the encoder corresponding to the Bluetooth headset.
  • the tablet's Bluetooth After receiving the target bitrate information reported by the Bluetooth chip, the tablet's Bluetooth calls the preset callback function to send the target bitrate information to the encoder corresponding to the Bluetooth headset.
  • the tablet's Bluetooth sends target bitrate information to the encoder of the Bluetooth headset by calling a preset callback function, the tablet's Bluetooth needs to register the preset callback function first.
  • the tablet computer's Bluetooth can register a preset callback function when the Bluetooth function is turned on.
  • the method may further include: registering a preset callback function for the tablet computer's Bluetooth.
  • the tablet's Bluetooth can register a preset callback function when the tablet connects to a Bluetooth headset.
  • the method may further include: registering a preset callback function for the tablet's Bluetooth. Specifically, after detecting that a Bluetooth connection has been established between the tablet and a device, the tablet's Bluetooth can determine whether the device meets preset conditions. If the device that has established the Bluetooth connection meets the preset device conditions, then the tablet's Bluetooth registers the preset callback function.
  • the tablet's Bluetooth registration preset callback function can specifically be a preset callback function registered by the tablet's Bluetooth within the Bluetooth protocol stack.
  • the preset callback function could be a btif av vendor-specific event callback.
  • a pre-registered callback function is used to trigger the sending of target bitrate information to the corresponding encoder. This ensures that after receiving the target bitrate information, Bluetooth can accurately send it to the encoder corresponding to the Bluetooth headset. Furthermore, this ensures that when the tablet establishes a Bluetooth connection with the Bluetooth headset and the Bluetooth channel quality degrades, it controls the encoder corresponding to the Bluetooth headset to lower the transmission bitrate.
  • the tablet computer can monitor the Bluetooth channel quality. If it is found that the Bluetooth channel quality deteriorates after the tablet computer and the Bluetooth headset establish a Bluetooth connection, the tablet computer can reduce the transmission bit rate used to send data to the Bluetooth headset. By reducing the transmission bit rate used by the tablet computer to send data to the Bluetooth headset, more Bluetooth channel resources can be allocated to other devices that need them.
  • the Bluetooth chip enables the dynamic bitrate adjustment function.
  • the tablet computer's Bluetooth sends an enable command to the Bluetooth chip, and the Bluetooth chip responds to the enable command to enable the dynamic bitrate adjustment function.
  • the Bluetooth chip can monitor Bluetooth channel quality. Therefore, in some embodiments, the tablet computer's Bluetooth can send an enable command to the Bluetooth chip after connecting the Bluetooth headset, causing the Bluetooth chip to activate the dynamic bitrate adjustment function. Subsequently, the tablet computer's Bluetooth chip can perform the dynamic bitrate adjustment operation. Specifically, when the Bluetooth chip detects a degradation in Bluetooth channel quality, it selects appropriate bitrate information and sends it to Bluetooth; Bluetooth then sends the appropriate bitrate information to the encoder corresponding to the Bluetooth headset.
  • the tablet's Bluetooth can control the Bluetooth chip to enable the dynamic bitrate adjustment function after detecting that the tablet has established a Bluetooth connection with a device that meets the preset device conditions.
  • the tablet's Bluetooth can send an enable command to the Bluetooth chip when it detects that the device that has established a Bluetooth connection with the tablet meets the preset device conditions.
  • the Bluetooth chip can respond to the enable command and enable the dynamic bitrate adjustment function. This ensures that the tablet can monitor the Bluetooth channel quality in a timely manner and update the transmission bitrate used to send data to the Bluetooth headset when the Bluetooth channel quality meets certain conditions.
  • the tablet computer can control the Bluetooth chip to disable the dynamic bitrate adjustment function after disconnecting the Bluetooth connection with the device that meets the preset device conditions.
  • the implementation further includes: the tablet computer disconnecting the Bluetooth headset, and the tablet computer's Bluetooth sending a shutdown command to the Bluetooth chip.
  • the Bluetooth chip responds to the shutdown command and disables the dynamic bitrate adjustment function.
  • the Bluetooth channel quality changes e.g., degrades
  • the Bluetooth chip may stop reporting the target bitrate information to Bluetooth. This ensures that when Bluetooth devices that do not meet the preset device conditions establish a connection with the tablet computer, the tablet computer can send data to these Bluetooth devices at a normal transmission bitrate.
  • the tablet computer after the tablet computer lowers the transmission rate used to send data to the Bluetooth headset, if it detects an improvement in the Bluetooth channel quality, it can readjust the transmission rate, such as increasing it. In one specific example, after the Bluetooth channel quality improves, the transmission rate used to send data to the Bluetooth headset can be restored to the first transmission rate. In some embodiments, after S205, if the tablet computer detects that the Bluetooth channel quality at a third time point is higher than that at a second time point, it sends data to the Bluetooth headset at a third transmission rate. The third transmission rate is greater than the second transmission rate. It should be noted that the third transmission rate and the first transmission rate can be equal or unequal.
  • the Bluetooth headset while sending data to the Bluetooth headset at a lower transmission rate (such as the second transmission rate mentioned above), if the Bluetooth channel quality improves, the transmission rate used to send data to the Bluetooth headset can be increased. Therefore, while ensuring the tablet computer can transmit data to other Bluetooth devices, the sound quality of the Bluetooth headset can be improved.
  • a lower transmission rate such as the second transmission rate mentioned above
  • Bluetooth channel quality Common factors affecting Bluetooth channel quality include the connection and disconnection of other Bluetooth devices, and interference from other wireless devices (such as Wi-Fi being turned on or off). Specifically, when Bluetooth channel quality degrades because another Bluetooth device establishes a Bluetooth connection with the tablet, and the tablet sends data to the Bluetooth headset at a high transmission rate, the Bluetooth headset consumes a significant amount of the tablet's Bluetooth channel resources. This can lead to insufficient Bluetooth channel resources for the tablet to allocate to other Bluetooth devices, resulting in lower data transmission rates, longer data intervals, and higher latency. In the technical solution proposed in this application, after the tablet and Bluetooth headset establish a connection, if the tablet establishes a Bluetooth connection with other devices, the Bluetooth channel quality of the tablet will degrade. In this case, the tablet will lower the transmission rate used to send data to the Bluetooth headset. This allows the tablet to allocate sufficient Bluetooth channel resources to other newly established Bluetooth devices, ensuring their Bluetooth transmission rate, reducing data intervals, and lowering latency.
  • the first electronic device is a tablet computer
  • the second electronic device is a Bluetooth headset
  • the third electronic device is a stylus.
  • the tablet computer establishes a Bluetooth connection with the Bluetooth headset.
  • the tablet's Bluetooth sends data to the Bluetooth headset at the first transmission bit rate.
  • the tablet establishes a Bluetooth connection with the stylus.
  • the tablet Since the tablet established a Bluetooth connection with the Bluetooth headset at the first time point, prior to the second time point, the tablet simultaneously established Bluetooth connections with both the Bluetooth headset and the stylus after the second time point. Typically, after establishing a Bluetooth connection with the stylus, the stylus primarily sends data to the tablet.
  • the stylus sends writing data to the tablet via Bluetooth.
  • the tablet's Bluetooth sends the written data to the screen.
  • the tablet screen can draw and display the corresponding handwriting based on the writing data, or respond to the writing data by updating the page.
  • the tablet computer can obtain the Bluetooth channel quality after establishing a Bluetooth connection with the stylus at the second time point and compare it with the Bluetooth channel quality at the first time point.
  • the tablet computer determines whether the Bluetooth channel quality is lower than the Bluetooth channel quality at the first time point.
  • the tablet compares the Bluetooth channel quality at the second time point after the tablet and stylus establish a Bluetooth connection, with the Bluetooth channel quality at the first time point. Understandably, the tablet can execute S305 and S306 first, then S307. Alternatively, the tablet can execute S307 first, then S305 and S306. Or, the tablet can execute S305, S306, and S307 simultaneously.
  • the result of S307 is yes, it means that after the tablet and stylus establish a Bluetooth connection, the Bluetooth channel quality has decreased compared to the initial time point. In this case, the transmission bit rate used by the tablet to send data to the Bluetooth headset can be reduced, as in S308. It should be noted that if the result of S307 is no, the tablet's Bluetooth does not need to perform any operation; the case where the result of S307 is no is not shown in Figure 5.
  • the tablet computer's Bluetooth sends data to the Bluetooth headset at a second transmission rate, which is lower than the first transmission rate.
  • the tablet first establishes a Bluetooth connection with the headset, and then with the stylus. Therefore, at the first point in time before establishing a Bluetooth connection with the stylus, the tablet sends data to the headset at a first transmission rate. At the second point in time, after establishing a Bluetooth connection with the stylus, the tablet sends data to the headset at a second transmission rate. In other words, after establishing a Bluetooth connection with the stylus, the tablet lowers the transmission rate used to send data to the headset.
  • the tablet computer can send data to the Bluetooth headset at a lower transmission rate. Reducing the transmission rate used to send data to the Bluetooth headset also reduces the Bluetooth channel resources occupied by the Bluetooth headset on the tablet computer. This allows the tablet computer's Bluetooth to allocate more Bluetooth channel resources for transmitting data from the stylus. Therefore, at the second time point, the tablet computer can ensure a higher data transmission rate from the stylus, reducing the time interval between two data transmissions and lowering latency. As explained above, the tablet computer transmits data from the stylus, primarily by sending the received writing data from the stylus to the screen via Bluetooth.
  • the tablet will still only be connected to the Bluetooth headset.
  • lowering the transmission bitrate used by the tablet to send data to the Bluetooth headset may affect the transmission quality of the Bluetooth headset, such as reducing the sound quality.
  • the tablet can, when simultaneously connected to the Bluetooth headset and other Bluetooth devices, decide whether to adjust (e.g., lower) the transmission bitrate used to send data to the Bluetooth headset based on the Bluetooth channel quality, ensuring that the tablet has sufficient Bluetooth channel resources to transmit data from other Bluetooth devices besides the Bluetooth headset.
  • the above solution can be implemented in any of the following ways:
  • the Bluetooth chip can monitor the Bluetooth channel quality when the dynamic bitrate adjustment function is enabled, and determine whether the transmission bitrate needs to be adjusted based on the Bluetooth channel quality. Therefore, the tablet computer can control the Bluetooth chip to enable the dynamic bitrate adjustment function only when at least two Bluetooth devices are connected simultaneously, including devices that meet preset device conditions (such as Bluetooth headsets). In this way, the Bluetooth chip can perform dynamic bitrate adjustment operations.
  • the second method involves enabling dynamic bitrate adjustment via the tablet's Bluetooth chip after connecting a Bluetooth headset.
  • the Bluetooth chip determines whether to adjust the transmission bitrate based on whether the tablet is connected to two Bluetooth devices and the Bluetooth channel quality. If the Bluetooth chip detects that the tablet is connected to two Bluetooth devices, including a device that meets preset device conditions (such as a Bluetooth headset), it can perform dynamic bitrate adjustment.
  • Figure 6 shows the flowchart of the Bluetooth transmission rate control method in some embodiments of this application.
  • S400 tablet PC Turn on Bluetooth.
  • the tablet computer establishes a Bluetooth connection with the Bluetooth headset.
  • the tablet computer sends data to the Bluetooth headset at the first transmission bit rate.
  • the tablet and stylus establish a Bluetooth connection.
  • the tablet computer can execute S305 and S306 as shown in Figure 5. This process is not shown in Figure 6.
  • the tablet computer determines whether at least two Bluetooth devices are connected simultaneously, and whether the transmission bit rate of at least one of the Bluetooth devices is greater than or equal to a preset threshold.
  • the tablet can execute S404 at any time after Bluetooth is enabled.
  • the tablet can execute S404 before S401, S402, or S403, but the result will be negative; this situation is not shown in Figure 6. If the result of S404 is negative, the tablet does not need to perform any other operations.
  • the transmission bit rate corresponding to the Bluetooth headset is greater than or equal to a preset threshold, and the tablet computer simultaneously establishes a Bluetooth connection with both the Bluetooth headset and the stylus. Therefore, the determination result of S404 is that the tablet computer can control the Bluetooth chip to enable the dynamic bit rate adjustment function.
  • the tablet computer's Bluetooth sends an enable command to the Bluetooth chip.
  • the S406 Bluetooth chip responds to the power-on command and enables the dynamic bitrate adjustment function.
  • the S407 Bluetooth chip When the S407 Bluetooth chip detects that the Bluetooth status meets the first preset condition, it reports the target bitrate information that matches the current Bluetooth status to the tablet's Bluetooth.
  • the Bluetooth chip can determine whether to adjust the transmission bit rate based solely on the Bluetooth channel quality. That is, the aforementioned Bluetooth state includes Bluetooth channel quality.
  • the Bluetooth state meeting the first preset condition can specifically include a decrease in Bluetooth channel quality.
  • the tablet computer's Bluetooth sends the target bit rate information to the encoder corresponding to the Bluetooth headset.
  • the encoder corresponding to the Bluetooth headset sends data to the Bluetooth headset using a second transmission code rate based on the target code rate information; the second transmission code rate is lower than the first transmission code rate.
  • the encoder corresponding to the Bluetooth headset can send data to the Bluetooth headset using a second transmission bit rate based on the target bit rate information, switching from the first transmission bit rate to the second transmission bit rate.
  • the tablet computer when the tablet computer is connected to only one Bluetooth device, the transmission bitrate of that Bluetooth device will not be adjusted regardless of its actual transmission bitrate.
  • the tablet computer when the tablet computer is connected to two or more Bluetooth devices simultaneously, and the transmission bitrate of one of the Bluetooth devices (e.g., the Bluetooth headset mentioned above) is greater than or equal to a preset threshold, the tablet computer will lower the transmission bitrate of Bluetooth device A if the Bluetooth channel quality degrades. This ensures that the tablet computer has sufficient Bluetooth channel resources for transmitting data from other Bluetooth devices.
  • the tablet computer can disable the dynamic bitrate adjustment function after enabling it.
  • the tablet computer's Bluetooth is connected to at least two Bluetooth devices simultaneously, and the transmission bitrate of at least one of the Bluetooth devices is greater than or equal to a preset threshold, the tablet computer controls the Bluetooth chip to enable the dynamic bitrate adjustment function. Based on this, when the Bluetooth devices connected to the tablet computer no longer meet the conditions for enabling the dynamic bitrate adjustment function, the tablet computer can control the Bluetooth chip to disable the dynamic bitrate adjustment function.
  • the conditions for enabling the dynamic bitrate adjustment function are no longer met in any of the following situations: the number of Bluetooth devices connected to the tablet computer is less than 2 (e.g., 0 or 1), or the transmission bitrate of all Bluetooth devices connected to the tablet computer is less than or equal to the preset threshold.
  • the tablet computer's Bluetooth detects that the tablet computer has disconnected from the Bluetooth headset or the stylus, the tablet computer's Bluetooth can send a shutdown command to the Bluetooth chip.
  • the Bluetooth chip responds to the shutdown command and disables the dynamic bitrate adjustment function.
  • the tablet's Bluetooth detects that the tablet and stylus have disconnected via Bluetooth, it means that the tablet's Bluetooth does not need to transmit data from the stylus.
  • the transmission bitrate for sending data to the Bluetooth headset can be adjusted again, such as by increasing the transmission bitrate. Specifically, the transmission bitrate of the encoder corresponding to the Bluetooth headset can be restored to the first transmission bitrate.
  • the tablet's Bluetooth while sending a shutdown command to the Bluetooth chip, can also send a bitrate update command (which can be denoted as bitrate update command 1) to the encoder corresponding to the Bluetooth headset.
  • This bitrate update command 1 instructs the encoder corresponding to the Bluetooth headset to restore the transmission bitrate to the first transmission bitrate. Therefore, it can be ensured that the tablet can send data to the Bluetooth headset at a higher transmission bitrate when only establishing a Bluetooth connection with the Bluetooth headset, thus guaranteeing the sound quality of the Bluetooth headset.
  • S500 tablet PC Turn on Bluetooth.
  • the tablet computer establishes a Bluetooth connection with the Bluetooth headset.
  • the S502 tablet computer sends data to the Bluetooth headset at the first transmission bit rate.
  • the tablet computer determines whether the transmission bit rate of the connected Bluetooth device is greater than or equal to a preset threshold.
  • the tablet can execute S503 at any time after Bluetooth is enabled. For example, in the example shown in Figure 7, the tablet can execute S503 before S501, but the result is negative; this situation is not shown in Figure 7. If the result of S503 is negative, the tablet does not need to perform any other operations.
  • the transmission bit rate corresponding to the Bluetooth headset is greater than or equal to a preset threshold. Therefore, the determination result of S503 is yes, and the tablet computer can control the Bluetooth chip to enable the dynamic bit rate adjustment function.
  • the tablet computer's Bluetooth sends an enable command to the Bluetooth chip.
  • the S505 Bluetooth chip responds to the power-on command and enables the dynamic bitrate adjustment function.
  • the tablet and stylus establish a Bluetooth connection.
  • the S507 Bluetooth chip When the S507 Bluetooth chip detects that the Bluetooth status meets the second preset condition, it reports the target bitrate information that matches the current Bluetooth status to the tablet's Bluetooth.
  • the Bluetooth chip Since the tablet computer sends an enable command to the Bluetooth chip when it detects that the transmission code rate of the Bluetooth device connected to the tablet is greater than or equal to a preset threshold, the Bluetooth chip needs to jointly determine whether to adjust the transmission code rate based on the Bluetooth channel quality and the number of Bluetooth devices connected to the tablet. That is, the aforementioned Bluetooth state can include Bluetooth transmission state and Bluetooth connection state.
  • the Bluetooth transmission state includes Bluetooth channel quality.
  • the Bluetooth connection state includes the number of Bluetooth devices connected to the tablet.
  • the Bluetooth state meeting the second preset condition includes: Bluetooth channel quality deteriorating, and the number of Bluetooth devices connected to the tablet being greater than or equal to 2.
  • the Bluetooth chip can determine at any time whether the Bluetooth state meets the second preset condition, and when the Bluetooth state meets the second preset condition, it reports the target bitrate information matching the current Bluetooth state to the tablet's Bluetooth.
  • the tablet can determine whether the Bluetooth state meets the second preset condition before S506, but the result is no; this situation is not shown in Figure 7. If the Bluetooth state does not meet the second preset condition, the tablet does not need to perform any other operations.
  • the Bluetooth state not meeting the second preset condition can specifically include the following situations: (1) The Bluetooth channel quality decreases, remains unchanged, or increases, and the number of Bluetooth devices connected to the tablet is less than 2. (2) The Bluetooth channel quality remains unchanged or increases, and the number of Bluetooth devices connected to the tablet is greater than or equal to 2.
  • the tablet since the tablet has established Bluetooth connections with both the Bluetooth headset and the stylus, the number of devices connected to the tablet via Bluetooth is equal to two. Therefore, if the Bluetooth channel quality degrades, the Bluetooth state satisfies the second preset condition.
  • the tablet computer's Bluetooth sends the target bit rate information to the encoder corresponding to the Bluetooth headset.
  • the encoder corresponding to the Bluetooth headset responds to the target bit rate information and sends data to the Bluetooth headset using a second transmission bit rate; the second transmission bit rate is lower than the first transmission bit rate.
  • the technical solution proposed in this application also achieves the following technical effects:
  • the tablet computer When the tablet computer is connected to only one Bluetooth device, the transmission bitrate of that Bluetooth device will not be adjusted regardless of its actual transmission bitrate.
  • the tablet computer when the tablet computer is connected to two or more Bluetooth devices simultaneously, and the transmission bitrate of one of the Bluetooth devices (e.g., the Bluetooth headset mentioned above) is greater than or equal to a preset threshold, the tablet computer will lower the transmission bitrate of Bluetooth device A when the Bluetooth channel quality deteriorates. This ensures that the tablet computer can transmit data from other Bluetooth devices normally.
  • the Bluetooth devices connected to the tablet no longer meet the conditions for enabling the dynamic bitrate adjustment function as follows: the transmission bitrate of all Bluetooth devices connected to the tablet is less than or equal to a preset threshold. After S505, if it is detected that the tablet has lost its Bluetooth connection with the Bluetooth headset, the tablet's Bluetooth can send a shutdown command to the Bluetooth chip to control the Bluetooth chip to disable the dynamic bitrate adjustment function.
  • the above embodiments illustrate how a tablet computer establishes a Bluetooth connection with a Bluetooth headset before establishing a connection with any other Bluetooth device, such as a stylus, without first establishing a Bluetooth connection with any other device.
  • the tablet computer may also establish a Bluetooth connection with other Bluetooth devices (such as the stylus mentioned above) before establishing a Bluetooth connection with the Bluetooth headset.
  • the tablet computer can report the writing data to the screen at normal data intervals.
  • the tablet computer establishes a Bluetooth connection with the Bluetooth headset, it cannot report the writing data to the screen while sending data to the Bluetooth headset.
  • the tablet computer uses a high transmission bitrate when sending data to the Bluetooth headset (e.g., the transmission bitrate is greater than or equal to a preset threshold)
  • the rate at which the tablet computer reports writing data to the screen may decrease, and the interval between two reports of writing data may increase.
  • the received writing data may experience significant latency, leading to abnormal issues such as hooks or broken lines when the writing is displayed on the screen.
  • the tablet computer's Bluetooth chip detects that the Bluetooth channel quality is lower after connecting the Bluetooth headset compared to when only the stylus is connected, it lowers the transmission code rate used by the tablet computer to send data to the Bluetooth headset, such as changing it from the first transmission code rate to a second transmission code rate.
  • FIG. 8 illustrates the complete flow of the Bluetooth transmission rate control method in some embodiments.
  • an LDAC encoder corresponding to the Bluetooth headset is used as an example for illustration.
  • the tablet computer first enables Bluetooth.
  • the tablet's Bluetooth settings determine if the Bluetooth chip supports dynamic bitrate adjustment (MBR). If it does, the tablet registers a preset callback function in the Bluetooth protocol stack. After establishing a Bluetooth connection between the tablet and the headset, the tablet's Bluetooth sends an enable command to the Bluetooth chip. The Bluetooth chip responds to this command by enabling MBR. Subsequently, when the Bluetooth chip detects a degradation in Bluetooth channel quality, it reports the target bitrate information to the tablet's Bluetooth. The tablet's Bluetooth then sends this target bitrate information to the LDAC encoder by calling the preset callback function. Finally, the LDAC encoder determines the corresponding target transmission bitrate based on this information and sends data to the Bluetooth headset at that target bitrate.
  • MBR dynamic bitrate adjustment
  • the enable command is specifically implemented by calling the HCI interface.
  • FIG. 9 shows a schematic diagram of the structure of an electronic device 900 provided in an embodiment of this application.
  • the electronic device 900 may include a processor 910, an external memory interface 920, an internal memory 921, a universal serial bus (USB) interface 930, a charging management module 940, a power management module 941, a battery 942, antenna 1, antenna 2, a mobile communication module 950, a wireless communication module 960, an audio module 970, an encoder 970A, a sensor module 980, a button 990, a motor 991, a camera 992, a display screen 993, and a subscriber identification module (SIM) card interface 994, etc.
  • the sensor module 980 may include a pressure sensor 980A, a touch sensor 980B, etc.
  • the electronic device 900 may be the first electronic device in the above embodiments.
  • the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 900.
  • the electronic device 900 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • Processor 910 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, a neural network processing unit (NPU), and/or a Bluetooth chip.
  • processing units such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, a neural network processing unit (NPU), and/or a Bluetooth chip.
  • AP application processor
  • GPU graphics processing unit
  • ISP image signal processor
  • DSP digital signal processor
  • NPU neural network processing unit
  • Bluetooth chip a Bluetooth chip.
  • Different processing units may be independent devices or integrated into one or more processors.
  • processor 910 is used to execute the Bluetooth transmission rate control method in the embodiments of this
  • the Bluetooth chip is the core component responsible for Bluetooth wireless communication, including the transmission, reception, and processing of wireless signals.
  • the Bluetooth chip can be used to monitor the Bluetooth channel quality and adaptively adjust the Bluetooth transmission rate when the Bluetooth channel quality meets certain conditions, or when the Bluetooth channel quality and the number of connected Bluetooth devices both meet certain conditions.
  • the controller can be the nerve center and command center of the electronic device 900.
  • the controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.
  • the processor 910 may also include a memory for storing instructions and data.
  • the memory in the processor 910 is a cache memory. This memory can store instructions or data that the processor 910 has just used or that are used repeatedly. If the processor 910 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 910, and thus improves the efficiency of the system.
  • the USB interface 930 is a USB standard compliant interface, which can be a Mini USB interface, Micro USB interface, USB Type-C interface, etc.
  • the USB interface 930 can be used to connect a charger to charge the electronic device 900, and can also be used for data transfer between the electronic device 900 and peripheral devices.
  • the external memory interface 920 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 900.
  • the external memory card communicates with the processor 910 through the external memory interface 920 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
  • the internal memory 921 can be used to store executable program code, which includes instructions.
  • the processor 910 executes various functional applications and data processing of the electronic device 900 by running the instructions stored in the internal memory 921.
  • the internal memory 921 may include a program storage area and a data storage area.
  • the program storage area may store the operating system and at least one application program required for a given function (such as sound playback, image playback, etc.).
  • the internal memory 921 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
  • non-volatile memory such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
  • the charging management module 940 is used to receive charging input from a charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 940 can receive charging input from the wired charger via a USB interface 930.
  • the power management module 941 is used to connect the battery 942, the charging management module 940, and the processor 910.
  • the power management module 941 receives input from the battery 942 and/or the charging management module 940 to power the processor 910, internal memory 921, external memory, display 993, camera 992, and wireless communication module 960, etc.
  • the power management module 941 may also be located within the processor 910. In still other embodiments, the power management module 941 and the charging management module 940 may also be located in the same device.
  • the wireless communication function of electronic device 900 can be implemented through antenna 1, antenna 2, mobile communication module 950, wireless communication module 960, modem processor, and baseband processor.
  • Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 900 can be used to cover one or more communication frequency bands.
  • Different antennas can also be multiplexed to improve antenna utilization.
  • antenna 1 can be multiplexed as a diversity antenna for a wireless local area network.
  • the antennas can be used in conjunction with a tuning switch.
  • the mobile communication module 950 can provide solutions for wireless communication, including 2G/3G/4G/5G, applied to the electronic device 900.
  • the mobile communication module 950 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
  • the mobile communication module 950 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation.
  • the mobile communication module 950 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1.
  • the wireless communication module 960 can provide solutions for wireless communication applications on the electronic device 900, including wireless local area networks (WLANs) (such as Wi-Fi), Bluetooth, Global Navigation Satellite System (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR).
  • WLANs wireless local area networks
  • GNSS Global Navigation Satellite System
  • FM frequency modulation
  • NFC near field communication
  • IR infrared
  • the wireless communication module 960 can be one or more devices integrating at least one communication processing module.
  • the wireless communication module 960 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to processor 910.
  • the wireless communication module 960 can also receive signals to be transmitted from processor 910, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
  • the electronic device 900 establishes a Bluetooth connection with other electronic devices through the Bluetooth in the wireless communication module 960.
  • antenna 1 of electronic device 900 is coupled to mobile communication module 950, and antenna 2 is coupled to wireless communication module 960, enabling electronic device 900 to communicate with networks and other devices via wireless communication technology.
  • Electronic device 900 can implement audio functions, such as music playback and recording, through audio module 970 and application processor.
  • the audio module 970 is used to convert digital audio signals into analog audio signals for output, and also to convert analog audio inputs into digital audio signals.
  • the audio module 970 can also be used for encoding and decoding audio signals.
  • the audio module 970 may be located in the processor 910, or some functional modules of the audio module 970 may be located in the processor 910.
  • the audio module 970 may specifically include an encoder 970A, which encodes audio data to be transmitted by the electronic device 900.
  • the electronic device 900 may include one or more encoders 970As.
  • the encoder 970A may include an LDAC encoder.
  • Pressure sensor 980A is used to sense pressure signals and convert them into electrical signals.
  • pressure sensor 980A may be disposed on display screen 993.
  • pressure sensors 980A such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors.
  • a capacitive pressure sensor may include at least two parallel plates with conductive material.
  • Electronic device 900 determines the pressure intensity based on the change in capacitance.
  • electronic device 900 detects the touch operation intensity based on pressure sensor 980A.
  • Electronic device 900 can also calculate the touch position based on the detection signal from pressure sensor 980A.
  • Touch sensor 980B also known as a "touch panel,” can be located on display screen 993.
  • the touch sensor 980B and display screen 993 together form a touchscreen, also known as a "touch screen.”
  • Touch sensor 980B detects touch operations applied to or near it.
  • the touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to the touch operation can be provided through display screen 993.
  • touch sensor 980B may also be located on the surface of electronic device 900, in a different position than display screen 993.
  • Buttons 990 include a power button, volume buttons, etc. Buttons 990 can be mechanical buttons or touch-sensitive buttons. Electronic device 900 can receive button input and generate key signal inputs related to user settings and function control of electronic device 900.
  • Motor 991 can generate vibration alerts. Motor 991 can be used for incoming call vibration alerts or for touch vibration feedback.
  • the camera 992 is used to capture still images or videos.
  • the electronic device 900 may include one or N cameras 992, where N is a positive integer greater than 1.
  • Electronic device 900 implements display functions through a GPU, a display screen 993, and an application processor.
  • the GPU is a microprocessor for image processing, connected to the display screen 993 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations and for graphics rendering.
  • Processor 910 may include one or more GPUs, which execute program instructions to generate or modify display information.
  • the display screen 993 is used to display images, videos, etc.
  • the electronic device 900 may include one or N display screens 993, where N is a positive integer greater than 1.
  • the SIM card interface 994 is used to connect a SIM card.
  • the SIM card can be inserted into or removed from the SIM card interface 994 to make contact with or separate from the electronic device 900.
  • the electronic device 900 can support one or N SIM card interfaces, where N is a positive integer greater than 1.
  • Figure 10 illustrates a software framework diagram of an electronic device in some embodiments of this application.
  • the electronic device includes an application layer, an application framework layer, an Android runtime (ART), a hardware abstraction layer (HAL), and a kernel layer.
  • ART Android runtime
  • HAL hardware abstraction layer
  • the application layer can include a series of application packages.
  • applications such as calling, Bluetooth, video, audio, and user interface.
  • the application framework layer provides application programming interfaces (APIs) and a programming framework for applications within the application layer.
  • the application framework layer includes predefined functions. As shown in Figure 10, the application framework layer may include a window manager, content provider, view system, input manager, and Bluetooth framework, among others.
  • the window manager provides a window management service (WMS), which can be used for window management, window animation management, surface management, and as a relay station for the input system.
  • WMS window management service
  • Content providers store and retrieve data, making that data accessible to applications.
  • This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, etc.
  • a view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications.
  • a display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
  • the input manager can provide an input management service (IMS), which can be used to manage system inputs, such as touchscreen input, keypad input, and sensor input.
  • IMS input management service
  • IMS retrieves events from input device nodes and, through interaction with the WMS, distributes these events to the appropriate windows.
  • the Hardware Abstraction Layer runs in user space, encapsulates kernel-level drivers, and provides calling interfaces to upper layers.
  • the HAL includes a call manager, Bluetooth manager, audio manager, and display manager, among others.
  • the Android runtime consists of the core libraries and the Android runtime itself.
  • the Android runtime is responsible for converting source code into machine code.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer can contain display drivers, audio drivers, Bluetooth drivers, etc.
  • This electronic device may be the first electronic device described in the above embodiments.
  • the electronic device may include a memory and one or more processors.
  • the memory is coupled to the processors.
  • the memory is also used to store computer program code, which includes computer instructions.
  • the processor executes the computer instructions, the electronic device can perform various functions or steps performed by the tablet computer in the above method embodiments.
  • the structure of this electronic device can be referenced to the structure of the electronic device 900 shown in FIG. 9.
  • the chip system 1100 includes at least one processor 1101 and at least one interface circuit 1102.
  • the processor 1101 and the interface circuit 1102 are interconnected via lines.
  • the interface circuit 1102 can be used to receive signals from other devices (e.g., a computer's memory).
  • the interface circuit 1102 can be used to send signals to other devices (e.g., the processor 1101).
  • the interface circuit 1102 can read instructions stored in memory and send those instructions to the processor 1101. When the instructions are executed by the processor 1101, the computer can perform the steps in the above embodiments.
  • the chip system may also include other discrete devices, which are not specifically limited in this application.
  • This application also provides a computer-readable storage medium including computer instructions that, when executed on the electronic device, cause the electronic device to perform various functions or steps performed by the tablet computer in the above method embodiments.
  • This application also provides a computer program product that, when run on a computer, causes the computer to perform the various functions or steps performed by the tablet computer in the above method embodiments.
  • the computer can be an electronic device, such as a tablet computer.
  • the disclosed apparatus and methods can be implemented in other ways.
  • the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods.
  • multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
  • a component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
  • the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
  • the integrated unit can be implemented in hardware or as a software functional unit.
  • the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application.
  • the aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请提出一种蓝牙传输码率的控制方法及电子设备,应用于通信技术领域,用于在平板电脑向蓝牙耳机传输数据时,保证平板电脑能够有足够的蓝牙信道资源传输其他蓝牙设备的数据。该方法应用于第一电子设备,包括:在第一时间点,第一电子设备与第二电子设备建立蓝牙连接,第一电子设备以第一传输码率向第二电子设备发送数据。在第二时间点,在第一电子设备的蓝牙状态满足预设条件的情况下,第一电子设备以第二传输码率向第二电子设备发送数据;第二传输码率小于第一传输码率。其中,第一电子设备的蓝牙状态满足预设条件包括:第一电子设备在第二时间点的蓝牙信道质量低于第一时间点的蓝牙信道质量。

Description

一种蓝牙传输码率的控制方法及电子设备
本申请要求于2024年05月31日提交国家知识产权局、申请号为202410709343.9、发明名称为“一种蓝牙传输码率的控制方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及通信技术领域,尤其涉及一种蓝牙传输码率的控制方法及电子设备。
背景技术
电子设备可以同时连接多个蓝牙设备。电子设备在通过蓝牙向其中一个蓝牙设备发送数据时,无法传输另一个蓝牙设备的数据。
示例性的,平板电脑支持通过蓝牙同时连接蓝牙耳机和手写笔。用户在使用蓝牙耳机收听来自平板电脑的音乐的同时,使用手写笔在平板电脑上书写。但是,由于平板电脑向蓝牙耳机传输数据占用大量的蓝牙信道资源,手写笔的数据无法被及时的传输至屏幕,导致手写笔在平板电脑的屏幕上的笔迹可能会出现回勾和断线等异常情况。
发明内容
本申请实施例提供一种蓝牙传输码率的控制方法及电子设备,用于在平板电脑向蓝牙耳机传输数据时,保证平板电脑能够有足够的蓝牙信道资源传输其他蓝牙设备的数据。
为达到上述目的,本申请的实施例采用如下技术方案:
第一方面,提供了一种蓝牙传输码率的控制方法,应用于第一电子设备。该方法包括:
在第一时间点,第一电子设备与第二电子设备建立蓝牙连接,第一电子设备以第一传输码率向第二电子设备发送数据。第一电子设备在与第二电子设备建立蓝牙连接后,将会监测蓝牙状态,如蓝牙信道质量。在第二时间点,在第一电子设备的蓝牙状态满足预设条件的情况下,第一电子设备以第二传输码率向第二电子设备发送数据。其中,第二传输码率小于第一时间点向第二电子设备发送数据所采用的第一传输码率。其中,第一电子设备的蓝牙状态满足预设条件包括:第一电子设备在第二时间点的蓝牙信道质量低于第一时间点的蓝牙信道质量。这样,第一电子设备向第二电子设备发送数据所采用的传输码率不会过高,能够保证第一电子设备有足够的蓝牙信道资源,分配给其他蓝牙设备。
在第一方面的一种可能的实现方式中,上述方法还包括:在第一电子设备与第二电子设备建立蓝牙连接后,第一电子设备开启动态码率调整功能。该动态码率调整功能用于根据当前的蓝牙状态,选择合适的传输码率。在该方案中,第一电子设备在检测到与第二电子设备建立蓝牙连接,即可开启该动态码率调整功能。以便在后面监测到蓝牙状态满足预设条件的情况下,及时调整向第二电子设备发送数据采用的传输码率。
在第一方面的一种可能的实现方式中,第二电子设备对应的传输码率是大于或者等于预设阈值的。也就是说,第一电子设备只有在检测到与第一电子设备建立蓝牙连接的电子设备,是满足一定条件(如预设设备条件)的情况下,才会触发开启动态码率调整功能。这样,如果与第一电子设备建立蓝牙连接的电子设备对应的传输码率较低,则不会开启该动态码率调整功能。从而在电子设备连接该设备的情况下,不会结合蓝牙状态调整该设备对应的传输码率。由此,对应的传输码率较低的电子设备连接第一电子设备后,可以避免被调整传输码率,从而导致这类设备的数据传输效果降低的问题。
在第一方面的一种可能的实现方式中,第一电子设备的蓝牙状态满足预设条件,还包括:与第一电子设备建立蓝牙连接的设备的数量大于或者等于2。也就是说,第一电子设备只有在第一电子设备与至少两个电子设备建立蓝牙连接的情况下,才会在监测到第二时间点的蓝牙信道质量小于第一时间点的蓝牙信道质量时,调整向第二电子设备发送数据采用的传输码率。这样,第一电子设备仅与第二电子设备建立蓝牙连接的情况下,不会调整向第二电子设备发送数据采用的传输码率。从而,避免调整传输码率导致第二电子设备的数据传输效果变差的问题。
在第一方面的一种可能的实现方式中,该方法还包括:在第二时间点,第一电子设备与第三电子设备建立蓝牙连接。第一电子设备新增与其他电子设备建立蓝牙连接,有可能会导致蓝牙信道质量下降。在该方案中,第二时间点,第二电子设备与第三电子设备建立蓝牙连接,导致第二时间点的蓝牙信道质量相较于第一时间点的蓝牙信道质量下降,从而第一电子设备根据该状态,选择以较低的第二传输码率向第二电子设备发送数据。
在第一方面的一种可能的实现方式中,该方法还包括:在第一时间点之后,且在第二时间点之前的第三时间点,第一电子设备与第三电子设备建立蓝牙连接,并开启动态码率调整功能。该动态码率调整功能用于根据当前的蓝牙状态,选择合适的传输码率。在该方案中,第一电子设备在连接至少两个设备的情况下,才会开启动态码率调整功能。这样,第一电子设备仅与第二电子设备建立蓝牙连接的情况下,不会调整向第二电子设备发送数据采用的传输码率。从而,避免调整传输码率导致第二电子设备的数据传输效果变差的问题。
在第一方面的一种可能的实现方式中,第二电子设备对应的传输码率是大于或者等于预设阈值的。也就是说,第一电子设备只有在检测到与第一电子设备建立蓝牙连接的电子设备存在至少两个,并且其中一个电子设备是满足一定条件(如预设设备条件)的情况下,才会触发开启动态码率调整功能。如果与第一电子设备建立蓝牙连接的电子设备对应的传输码率较低,则不会开启该动态码率调整功能。这样,对应的传输码率较低的电子设备连接第一电子设备后,可以避免被调整传输码率,从而导致这类设备的数据传输效果降低的问题。或者,与第一电子设备建立蓝牙连接的电子设备中存在对应的传输码率较高,但是当前第一电子设备仅连接一个蓝牙设备,不会开启该动态码率调整功能。这样,第一电子设备仅与第二电子设备建立蓝牙连接的情况下,不会调整向第二电子设备发送数据采用的传输码率。从而,避免调整传输码率导致第二电子设备的数据传输效果变差的问题。
在第一方面的一种可能的实现方式,在第一电子设备开启动态码率调整功能后,该方法还包括:第一电子设备与第二电子设备断开蓝牙连接,第一电子设备关闭动态码率调整功能。这样,避免第一电子设备仅与第三电子设备建立了蓝牙连接的情况下,第一电子设备仍对蓝牙状态进行监控,减少不必要的功耗浪费。
在第一方面的一种可能的实现方式,在第一电子设备开启动态码率调整功能后,该方法还包括:第一电子设备与第三电子设备断开蓝牙连接,第一电子设备关闭动态码率调整功能。这样,避免第一电子设备仅与第二电子设备建立了蓝牙连接的情况下,第一电子设备仍对蓝牙状态进行监控,减少不必要的功耗浪费。
在第一方面的一种可能的实现方式,第一电子设备与第二电子设备断开蓝牙连接,以及,第一电子设备与第三电子设备断开蓝牙连接,第一电子设备关闭动态码率调整功能。减少不必要的功耗浪费。
在第一方面的一种可能的实现方式中,第二电子设备对应的传输码率大于或者等于预设阈值,具体可以包括:第一传输码率大于或者等于预设阈值。
在第一方面的一种可能的实现方式中,第二传输码率小于或者等于预设阈值。也就是说,第一电子设备在调整向第二电子设备发送数据采用的传输码率时,会将大于或者等于预设阈值的传输码率调整为小于预设阈值。这样,确保第一电子设备调低向第二电子设备发送数据采用的传输码率后,第一电子设备能够有足够的蓝牙信道资源分配用于传输其他蓝牙设备的数据。
在第一方面的一种可能的实现方式中,第一电子设备以第二传输码率向第二电子设备发送数据,具体可以包括:第一电子设备确定与蓝牙状态匹配的目标编码信息;目标码率信息用于表征第二传输码率。第一电子设备控制第一电子设备的目标编码器基于目标码率信息,采用第二传输码率向第二电子设备发送数据。其中,目标编码器是第一电子设备向第二电子设备发送数据所采用的编码器。
在第一方面的一种可能的实现方式中,第一电子设备控制第一电子设备的目标编码器基于目标码率信息,采用第二传输码率向第二电子设备发送数据,具体可以包括:第一电子设备的蓝牙向目标编码器发送目标码率信息。目标编码器基于目标码率信息,采用第二传输码率向第二电子设备发送数据。
在第一方面的一种可能的实现方式中,第一电子设备确定与蓝牙状态匹配的目标编码信息,具体可以包括:第一电子设备根据蓝牙信道质量确定匹配的目标码率信息。示例性的,蓝牙信道质量可以划分为不同区间范围,每一区间范围对应一个码率信息。第一电子设备可以预先存储蓝牙信道质量与码率信息的对应关系,以便根据蓝牙信道质量从该对应关系中查找匹配的目标码率信息。
在第一方面的一种可能的实现方式中,目标码率信息包括第二传输码率。或者,目标码率信息包括目标码率等级,目标码率等级与第二传输码率对应。
在第一方面的一种可能的实现方式中,该方法还包括:第一电子设备响应于第一电子设备打开蓝牙功能,在蓝牙协议栈注册预设回调函数。其中,预设回调函数用于在第一电子设备的蓝牙状态满足预设条件的情况下,触发第一电子设备控制目标编码器基于目标码率信息,调整第二传输码率向第二电子设备发送数据采用的传输码率。这样,在第一电子设备检测到蓝牙状态满足预设条件的情况下,能够及时控制目标编码器调整向第二电子设备发送数据采用的传输码率。
在第一方面的一种可能的实现方式中,该方法还包括:第一电子设备响应于第一电子设备与第二电子设备建立蓝牙连接,在蓝牙协议栈注册预设回调函数。其中,预设回调函数用于在第一电子设备的蓝牙状态满足预设条件的情况下,触发第一电子设备控制目标编码器基于目标码率信息,调整第二传输码率向第二电子设备发送数据采用的传输码率。这样,第一电子设备与第二电子设备建立蓝牙连接后,在检测到蓝牙状态满足预设条件的情况下,能够及时控制目标编码器调整向第二电子设备发送数据采用的传输码率。
在第一方面的一种可能的实现方式中,在第一电子设备开启动态码率调整功能后,该方法还包括:第一电子设备与第二电子设备断开蓝牙连接,第一电子设备关闭动态码率调整功能。
在第一方面的一种可能的实现方式中,第二电子设备是蓝牙耳机。该蓝牙耳机对应的传输码率可以大于预设阈值。
在第一方面的一种可能的实现方式中,第三电子设备可以是手写笔或蓝牙键盘等。
在第一方面的一种可能的实现方式中,第一电子设备向第二电子设备发送数据所采用的目标编码器,是基于低延迟音频编码LDAC或者低延迟高清音频编解码器LHDC实现的。LDAC编码器和LHDC编码器最高支持的传输码率较高。在第一电子设备和第二电子设备均支持LDAC编码或者LHDC编码中的一个时,第一电子设备都会以较高的传输码率向第二电子设备发送数据。因此,第一电子设备可以结合第一电子设备的蓝牙状态,动态的调整向第二电子设备发送数据采用的传输码率,可以保证第一电子设备有足够的蓝牙信道资源分配给其他电子设备。
第二方面,本申请还提供了一种蓝牙传输码率的控制方法,应用于第一电子设备。该方法包括:在第一时间点,在第一电子设备仅与第二电子设备建立了蓝牙连接的情况下,第一电子设备以第一传输码率向第二电子设备发送数据。在第二时间点,在第一电子设备同时与第二电子设备和第三电子设备建立蓝牙连接的情况下,第一电子设备以第二传输码率向第二电子设备发送数据;第二传输码率小于第一传输码率。
在该方案中,第一电子设备在仅连接第一电子设备的情况下,以较高的传输码率向该第一电子设备发送数据。而在第一电子设备连接两个蓝牙设备的情况下,以较低的传输码率向第一电子设备发送数据。能够保证第一电子设备能够有足够的蓝牙信道资源用于传输其他电子设备的数据。
在第二方面的一种可能的实现方式中,第二电子设备对应的传输码率大于预设阈值。
在第二方面的一种可能的实现方式中,第一时间点在第二时间点之前。第一电子设备在第一时间点,与第二电子设备建立蓝牙连接。在第二时间点,第二电子设备与第三电子设备建立连接。在第二时间点,第一电子设备在与第三电子设备建立连接后,调低向第二电子设备发送数据采用的传输码率。
在第二方面的一种可能的实现方式中,第二时间点在第一时间点之前。第一电子设备在第二时间点,同时与第一电子设备和第二电子设备建立了蓝牙连接。而在第一时间点,第一电子设备断开了与第三电子设备的蓝牙连接。此时,第一电子设备仅连接第二电子设备,则第一电子设备在第二时间点的基础上,可以调高向第二电子设备发送数据采用的传输码率。
在第一方面的一种可能的实现方式中,第二电子设备是蓝牙耳机。该蓝牙耳机对应的传输码率可以大于预设阈值。
在第一方面的一种可能的实现方式中,第三电子设备可以是手写笔或蓝牙键盘等。
第三方面,本申请还提供了一种电子设备。该电子设备可以是上述第一电子设备。电子设备可以包括:处理器和存储器。该存储器用于存储计算机执行指令,当该电子设备运行时,该处理器执行该存储器存储的该计算机执行指令,以使该电子设备执行如上述第一方面中任一项的蓝牙传输码率的控制方法。
第四方面,本申请提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机可以执行上述第一方面中任一项的蓝牙传输码率的控制方法。
第五方面,提供了一种包含指令的计算机程序产品,当其在电子设备上运行时,使得电子设备可以执行上述第一方面中任一项的蓝牙传输码率的控制方法。
第六方面,提供了一种装置(例如,该装置可以是芯片系统),该装置包括处理器,用于支持电子设备实现上述第一方面中所涉及的功能。在一种可能的设计中,该装置还包括存储器,该存储器,用于保存电子设备必要的程序指令和数据。该装置是芯片系统时,可以由芯片构成,也可以包含芯片和其他分立器件。
其中,第二方面至第六方面中任一种设计方式所带来的技术效果可参见第一方面中不同设计方式所带来的技术效果,此处不再赘述。
附图说明
图1为本申请实施例提供的一种通信系统的结构示意图;
图2为本申请实施例提供的一种手写笔的笔迹示意图;
图3A为本申请实施例提供的蓝牙传输数据的数据走向示意图;
图3B为一些示例中平板电脑的蓝牙日志的部分信息示意图;
图3C为一些示例中提供平板电脑的实际音频编码比特率以及对应的时间示意图;
图4为本申请实施例提供的一种蓝牙传输码率的控制方法的流程图;
图5为本申请实施例提供的一种蓝牙传输码率的控制方法的流程图;
图6为本申请实施例提供的一种蓝牙传输码率的控制方法的流程图;
图7为本申请实施例提供的一种蓝牙传输码率的控制方法的流程图;
图8为本申请实施例提供的一种蓝牙传输码率的控制方法的流程图;
图9为本申请实施例提供的一种电子设备的硬件结构图;
图10为本申请实施例提供的一种电子设备的软件框架图;
图11为本申请实施例提供的一种芯片系统的结构框图。
具体实施方式
以下对本申请实施例可能涉及的技术名词进行简单说明。
低延迟音频编码(low latency audio coding,LDAC)是一种高效的蓝牙音频编码技术,旨在解决传统蓝牙传输中音质损失的问题。
低延迟高清音频编解码器(low-latency hi-definition audio codec,LHDC),是一种基于蓝牙音频传输模型协定(advanced audio distribution profile,A2DP)协议所开发的高音质蓝牙音频编解码器。
传输码率是单位时间内传输的比特数,通常用每秒比特数(bite per second,bps)表示。通常不同的蓝牙编码器(codec)有不同的码率范围和调节方式。
蓝牙接口(bluetooth interface,BTIF)是应用程序通过java(一种编程语言)本地接口(java native interface,JNI)进入协议栈库的入口。
蓝牙音视频接口供应商的特殊事件回调(btif av vendor specific event callback)通常与蓝牙音频传输有关。
透传,即透明传输,指的是在通讯中不管传输的业务内容如何,只负责将传输的内容由源地址传输到目的地址,而不对业务数据内容做任何改变。
电子设备可以支持同时连接两个及以上蓝牙设备。以电子设备是平板电脑为例,如图1所示,平板电脑10支持在连接蓝牙耳机20播放音乐的同时,通过蓝牙连接手写笔30,手写笔30能够在平板电脑10的屏幕上书写操作。在其他实施例中,该平板电脑10还支持连接蓝牙音响、车机、手机、智能手表或者蓝牙键盘等蓝牙设备。
手写笔在平板电脑的屏幕上书写的过程中,屏幕对应书写操作显示的笔迹,应当与手写笔在屏幕上的书写轨迹相对应。然而在一些场景下,屏幕显示的笔迹与手写笔在屏幕上的书写轨迹不对应,例如出现断线或者回勾等现象。如图2的a为正常状态下,屏幕响应于手写笔的书写操作显示的笔迹。在异常状态下,可能出现如图2的b虚线圈出部分所示的回勾现象,或者出现如图2的c虚线圈出部分所示的断线现象。
或者,用户在使用手写笔在平板电脑的屏幕上执行点击操作等,平板电脑响应于该点击操作,可以做出响应。例如,用户使用手写笔在屏幕上点击返回控件,平板电脑响应于该点击操作,返回上一级页面。用户使用手写笔在屏幕上点击缩略图,平板电脑响应于该点击操作,显示缩略图对应的图片等。然而,一些场景下,平板电脑对于点击操作容易出现响应延迟等异常情况。
经分析发现,平板电脑在向一些蓝牙耳机发送数据的同时,还连接手写笔进行操作,则容易出现上述回勾和断线或者响应延迟等异常情况。如图3A所示,平板电脑通过蓝牙向蓝牙耳机发送音频数据的同时,还可以接收手写笔向平板电脑发送的书写数据。之后,平板电脑的蓝牙向平板电脑的屏幕上报来自手写笔的书写数据,以便屏幕能够根据手写笔的书写数据,在屏幕上绘制笔迹。其中,平板电脑蓝牙向平板发送书写数据,不占用平板电脑的蓝牙信道资源;而平板电脑的蓝牙向屏幕上报书写数据需要占用蓝牙信道资源。因此如果平板电脑仍采用第一传输码率向蓝牙耳机发送数据,如果传输码率过高导致占用过多的蓝牙信道资源,则有可能会影响到平板电脑的蓝牙向屏幕上报书写数据的传输。从而,蓝牙没有办法及时的向屏幕上报来自手写笔的书写数据,屏幕也就没有办法及时的绘制笔迹。一种情况,蓝牙向屏幕上报的书写数据可能出现延迟;此时容易出现回勾或响应延迟的现象。另一种情况,蓝牙向屏幕上报的书写数据可能出现丢失;此时容易出现断线或不响应的现象。
图3B示出了一些具体示例中,蓝牙向屏幕上报的书写数据的主机控制接口(host controller interface)蓝牙日志的部分信息。该蓝牙日志示出了多条属性协议(attribute protocol,ATT)通知包(notification packet)对应的时间和时间增量(time delta)。其中每一条ATT notification packet对应一次蓝牙向屏幕上报的书写数据。时间增量表示该条书写数据的上报时间与上一条书写数据的上报时间之间的间隔。可以看出,其中虚线圈出且字体加粗显示的部分数据对应的时间增量是较大的。
图3C示出了一些具体示例中,平板电脑在向蓝牙耳机发送数据时,平板电脑的实际音频编码比特率(actual encoded audio bitrate)以及对应的时间。该实际音频编码比特率即平板电脑向蓝牙耳机发送数据所采用的传输码率。可以看出,平板电脑的大部分实际音频编码比特率较高,如高于1兆比特每秒(Mbit/s)。比较图3B和图3C所示的信息可以确定,在平板电脑向蓝牙耳机发送数据采用的传输码率较高的时间点,平板电脑的蓝牙向屏幕上报书写时间的时间间隔较大。
基于此,本申请实施例提出一种蓝牙传输码率的控制方法,用于在平板电脑等电子设备同时连接多个蓝牙设备的场景中,调低其中一个蓝牙设备对应的传输码率,以保证其他蓝牙设备的数据能够被正常传输。以该方法应用于第一电子设备为例,在第一时间点,第一电子设备与第二电子设备建立蓝牙连接后,第一电子设备以第一传输码率向第二电子设备发送数据。在第二时间点,第一电子设备监测到第一电子设备的蓝牙信道质量相比第一时间点有所下降,则第一电子设备以第二传输码率向第二电子设备发送数据。其中,第二传输码率小于第一传输码率。即,在第一电子设备在与第二电子设备建立蓝牙连接,且蓝牙信道质量下降的情况下,调低第二电子设备对应的传输码率。这样,保证第一电子设备的蓝牙有更多的蓝牙信道资源分配给其他需要的设备,保证第一电子设备的蓝牙能够正常传输其他设备的数据。
其中,蓝牙设备对应的传输码率,具体可以指平板电脑等电子设备向该蓝牙设备发送数据的传输码率,如平板电脑向蓝牙耳机发送音频数据等。或者,蓝牙设备对应的传输码率,具体可以指平板电脑等电子设备传输该蓝牙设备的数据,如平板电脑的蓝牙向屏幕上报手写笔的书写数据。
在本申请的一些实施例中,上述第一电子设备支持同时连接至少两个蓝牙设备。在第一时间点,第一电子设备与第二电子设备建立蓝牙连接,并且第一电子设备以第一传输码率向第二电子设备发送数据。其中,第二电子设备对应的传输码率大于或者等于预设阈值。在第二时间点,第一电子设备与第三电子设备建立蓝牙连接。此时,第一电子设备新增加了蓝牙连接,可能会导致蓝牙信道质量下降。如果第一电子设备监测到第二时间点的蓝牙信道质量低于第一时间点的蓝牙信道质量,则以第二传输码率向第二电子设备发送数据,且第二传输码率低于第一传输码率。也就是说,在第一电子设备同时连接多个电子设备(包括第二电子设备)时,将会适当调低向第二电子设备发送数据时采用的传输码率。这样,可以通过减少向第二电子设备发送数据采用的码率,保证其他电子设备(如第三电子设备)数据的传输速率,降低相邻两次传输数据之间的时间间隔,减少时延。
以第一电子设备是平板电脑,第二电子设备是蓝牙耳机,第三电子设备是手写笔为例,平板电脑仅连接蓝牙耳机时,以第一传输码率向蓝牙耳机发送数据,第一传输码率大于或者等于预设阈值。平板电脑同时连接蓝牙耳机和手写笔时,则以第二传输码率向蓝牙耳机发送数据;并且,第二传输码率低于第一传输码率。由此,在本申请的实施例中,在平板电脑同时连接蓝牙耳机和手写笔的情况下,平板电脑将以小于第一传输码率的第二传输码率向蓝牙耳机发送数据。从而,保证平板电脑对于手写笔的书写数据上报的速率,降低相邻两次上报书写数据之间的时间间隔,减少时延。进而保证手写笔数据能够及时的上报到屏幕,屏幕能够及时的根据手写笔的书写数据绘制笔迹,也就能够避免手写笔的笔迹显示出现回勾和断线等异常情况。
其中,手写笔的书写数据具体可以是压感数据。平板电脑的蓝牙向屏幕上报书写数据,具体可以通过透传的方式实现。
在本申请的一些实施例中,第一电子设备向第二电子设备发送数据,所采用的编码器是预设编码器。示例性的,预设编码器可以基于LDAC或者LHDC实现编码。
在本申请的一些实施例中,第一电子设备向第二电子设备发送的数据对应的场景为:第一电子设备向第二电子设备发送音频数据或者通话数据。
在一些实施例中,上述第一电子设备可以是手机、平板电脑、个人计算机(personal computer,PC)、智慧屏、桌面型、膝上型、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、智能手表等穿戴设备、人工智能(artificial intelligence,AI)音箱以及车载设备,也可以是各种教学辅助工具(例如学习机、早教机)、智能玩具、便携式机器人、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)\虚拟现实(virtual reality,VR)设备、媒体播放器等支持蓝牙的设备,还可以是具有移动办公功能的设备、具有智能家居功能的设备、具有影音娱乐功能的设备、支持智能出行的设备等支持蓝牙的设备。本申请实施例对该设备的具体形态不作特殊限制。
上述第二电子设备和第三电子设备均是支持蓝牙的电子设备,示例性的,上述第二电子设备可以是蓝牙音响、蓝牙耳机、手写笔、蓝牙键盘、智能手表、智能手环等。上述第三电子设备同样可以是蓝牙音响、蓝牙耳机、手写笔、蓝牙键盘、智能手表、智能手环等。
以下将结合附图对本申请实施例提出的蓝牙传输码率的控制方法进行详细说明。
图4示出了本申请一些实施例中蓝牙传输码率的控制方法的流程。在该实施例中,以第一电子设备是平板电脑,第二电子设备是蓝牙耳机为例进行说明。
S201.平板电脑打开蓝牙功能。
平板电脑打开蓝牙功能的具体实现过程可以参照相关技术中的描述,在本申请实施例中不予赘述。
S202.在第一时间点,平板电脑与蓝牙耳机建立蓝牙连接。
平板电脑与蓝牙耳机建立蓝牙连接的具体实现过程,也可以参照相关技术中的描述,在本申请实施例中不予赘述。
S203.平板电脑以第一传输码率向蓝牙耳机发送数据。
在用户使用蓝牙耳机收听平板电脑的音乐,或者用户使用蓝牙耳机连接平板电脑时,收看平板电脑的视频的场景中,平板电脑向蓝牙耳机发送的数据,具体可以是音频数据。
用户还可以使用蓝牙耳机接听平板电脑的音频通话或者视频通话。在通话场景中,平板电脑向蓝牙耳机发送数据,包括平板电脑向蓝牙耳机发送通话数据。
平板电脑向蓝牙耳机发送数据,具体是通过平板电脑的蓝牙实现。即,上述S203具体可以包括:平板电脑的蓝牙以第一传输码率向蓝牙耳机发送数据。其中,蓝牙具体可以是指蓝牙控制模块。该蓝牙控制模块可以包括应用程序层的蓝牙应用,应用程序框架层中的蓝牙框架,硬件抽象层中的蓝牙管理器,以及内核层中的蓝牙驱动。
平板电脑向蓝牙耳机发送数据时采用的传输码率,具体可以由向蓝牙耳机发送数据所采用的编码器(以下记为蓝牙耳机对应的编码器)控制。平板电脑与蓝牙耳机建立蓝牙连接后,蓝牙耳机对应的编码器所采用的初始传输码率,是由蓝牙耳机对应的编码器本身根据连接双方的信息决定的。在上述示例中,第一传输码率即为平板电脑向蓝牙耳机发送数据采用的初始传输码率。例如,编码器是LDAC编码器,连接双方均支持LDAC编码,且均支持990千比特每秒(kbps),则上述初始传输码率可以是990kbps。
在一些实施例中,第二电子设备,如蓝牙耳机满足一定条件,平板电脑再执行S204和S205。其中,蓝牙耳机需要满足的条件可以记为预设设备条件。平板电脑的蓝牙可以在平板电脑与符合预设设备条件的设备建立蓝牙连接之后,执行后面的流程,如S204和S205。在一些实施例中,在上述S202之后,上述方法还包括:平板电脑判断与平板电脑建立蓝牙连接的设备(在该实施例中为蓝牙耳机)是否满足预设设备条件。若是,则执行S204和S205。若该蓝牙耳机不满足预设设备条件,则不需要执行S204和S205,可以一直以第一传输码率向该蓝牙耳机发送数据。
在一些实施例中,上述预设设备条件具体可以包括:平板电脑向蓝牙耳机传输数据采用的传输码率大于或者等于预设阈值。也就是说,平板电脑在检测到与平板电脑建立蓝牙连接的设备对应的传输码率大于或者等于预设阈值的情况下,需要执行S204和S205。其中,预设阈值可以根据实际情况进行设置,例如可以设置为600kbps、660kbps等。
在另一些实施例中,上述预设设备条件具体可以包括:蓝牙耳机属于预设设备。其中,预设设备可以是预先设置的需要进行动态码率调整的设备。在一些实施例中,平板电脑中可以预先存储一个或多个预设设备的设备标识。示例性的,设备标识具体可以是设备型号,如型号1的蓝牙耳机,型号2的蓝牙耳机,型号3的蓝牙音响等。
在又一些实施例中,上述预设设备条件具体可以包括:蓝牙耳机对应的编码器属于预设编码器。由上述说明可知,不同的蓝牙编码器有不同的码率范围。部分编码器采用的传输码率较高。如果与平板电脑建立蓝牙连接的设备对应的编码器属于上述预设编码器,则平板电脑需要执行S204和S205。因此,在一些实施例中,平板电脑也可以预先存储部分预设编码器的编码器标识。示例性的,编码器标识可以是编码器的类型或者设备编码等。在一些具体示例中,预设编码器的编码器类型包括LDAC和LHDC。
在本申请实施例提出的技术方案中,平板电脑只有在连接部分特殊的蓝牙设备时,才执行S204和S205。例如将条件设置为连接平板电脑的蓝牙设备对应的传输码率较高,则触发平板电脑执行S04和S205。这样,对于初始传输码率较低的设备,不会执行后面的流程,平板电脑在传输这部分设备的数据时,不会进行码率调整。
在图4所示示例中,以蓝牙耳机是满足预设设备条件为例进行说明。则平板电脑在检测到连接了蓝牙耳机之后,会触发执行S204和S205。
S204.平板电脑监测到第二时间点的蓝牙信道质量低于第一时间点的蓝牙信道质量。
在上述方法的S204之前,还可以包括:在第二时间点,平板电脑获取第二时间点的蓝牙信道质量。之后,可以将第二时间点的蓝牙信道质量与第一时间点的蓝牙信道质量进行比较,确定平板电脑的蓝牙信道质量相较于第一时间点是否下降。
蓝牙信道质量用于表示平板电脑当前蓝牙传输的质量;蓝牙信道质量越高,则蓝牙传输速率越快,传输质量越高;反之,蓝牙信道质量越低,则蓝牙传输速率越低,传输质量越低。
在一些实施例中,蓝牙信道质量有相应的量化参数,平板电脑可以通过获取该蓝牙信道质量对应的量化参数,获取到当前蓝牙的信道质量。示例性的,蓝牙信道质量对应的参数值越高,表征蓝牙信道质量越高。上述S204具体可以包括:平板电脑在第二时间点检测到蓝牙信道质量对应的参数值,低于第一时间点的蓝牙信道质量对应的参数值。
在一些实施例中,平板电脑检测蓝牙信道质量,具体可以是通过平板电脑的蓝牙芯片监测蓝牙信道质量。
S205.平板电脑以第二传输码率向蓝牙耳机发送数据,第二传输码率低于第一传输码率。
平板电脑将向蓝牙耳机发送数据采用的传输码率由第一传输码率切换为第二传输码率,也可以称为平板电脑更新向蓝牙耳机发送数据采用的传输码率。平板电脑更新向蓝牙耳机发送数据采用的传输码率的具体实现过程,将在后实施例中详细说明。
在图4所示示例中,平板电脑是在监测到蓝牙信道质量下降后,触发平板电脑更新向蓝牙耳机发送数据采用的传输码率。在一些实施例中,可以将蓝牙信道质量记为蓝牙状态,平板电脑更新传输码率需要满足的条件记为第一预设条件。即,在一些实施例中,平板电脑在监测到蓝牙状态满足第一预设条件的情况下,更新向蓝牙耳机发送数据采用的传输码率。
在由蓝牙芯片监测蓝牙信道质量的一些实施例中,在上述S204之后,平板电脑的蓝牙芯片可以向平板电脑的蓝牙发送通知消息,该通知消息用于指示蓝牙信道质量下降。平板电脑的蓝牙响应于接收到该通知消息,可以确定比第一传输码率低的第二传输码率,然后在S205中,将第二传输码率发送至蓝牙耳机对应的编码器,以使蓝牙耳机对应的编码器按照第二传输码率进行编码。
在由蓝牙芯片检测蓝牙信道质量的另一些实施例中,在上述S204之后,平板电脑的蓝牙芯片可以根据当前的蓝牙状态(如蓝牙信道质量),选择合适的码率信息(选择出的码率信息可以为上述实施例中的目标码率信息)。在一些实施例中,蓝牙芯片根据当前的蓝牙状态,选择合适的码率信息的过程,可以称为蓝牙芯片的动态码率调整功能。在一些实施例中,在执行上述方法之前,蓝牙芯片需要开启动态码率调整功能。蓝牙芯片开启动态码率调整功能的具体实现过程,将在后实施例中详细说明。
需要说明的是,蓝牙芯片的动态码率调整功能,具体是用于自适应调整平板电脑向满足预设设备条件的设备,如蓝牙耳机对应的传输码率的。
进一步的,以目标码率信息是传输码率为例,在上述S204之后,平板电脑的蓝牙芯片可以根据当前的蓝牙状态,选择合适的传输码率(如选择出的传输码率可以为上述第二传输码率),然后将该合适的传输码率发送给平板电脑的蓝牙。再由平板电脑的蓝牙将合适的传输码率发送至蓝牙耳机对应的编码器,以使蓝牙耳机对应的编码器按照该传输码率进行编码。
或者,以目标码率信息是码率等级为例,在上述S204之后,平板电脑的蓝牙芯片根据当前的蓝牙状态也可以选择合适的传输码率等级;该传输码率等级与传输码率对应。如,选择除的传输码率等级可以与上述第二传输码率对应。在蓝牙芯片选择出合适的传输码率等级后,可以将选择的传输码率等级发送给平板电脑的蓝牙,以便其将传输码率等级发送给蓝牙耳机对应的编码器后,该编码器能够按照传输码率等级对应的传输码率进行编码。在上述实施例中,蓝牙芯片选择的合适的传输码率等级可以是第二传输码率对应的码率等级。
由上述实施例的说明可知,平板电脑向蓝牙耳机发送数据时采用的传输码率由蓝牙耳机对应的编码器控制,上述S205中可以更新蓝牙耳机对应的编码器采用的码率,以实现调整向蓝牙耳机发送数据的传输码率的目的。在本申请实施例中,更新蓝牙耳机对应的编码器采用的码率,可以由平板电脑的蓝牙向蓝牙耳机对应的编码器下发待更新的传输码率。即,上述S205具体可以包括:平板电脑的蓝牙向蓝牙耳机对应的编码器发送目标码率信息,目标码率信息用于表征上述第二传输码率。蓝牙耳机对应的编码器基于目标码率信息,控制向蓝牙耳机发送数据采用的传输码率由第一传输码率切换为第二传输码率。在一些实施例中,目标码率信息可以是上述第二传输码率,也可以是与第二传输码率对应的码率等级。
在一些实施例中,平板电脑的蓝牙可以向蓝牙芯片发送码率更新指令,该码率更新指令携带目标码率信息。
其中,平板电脑的蓝牙向蓝牙耳机对应的编码器发送目标码率信息,可以通过预设回调函数实现。该预设回调函数用于触发平板电脑的蓝牙向蓝牙耳机对应的编码器发送目标码率信息。在平板电脑的蓝牙在接收到蓝牙芯片上报的目标码率信息后,调用预设回调函数,向蓝牙耳机对应的编码器发送目标码率信息。
若平板电脑的蓝牙通过调用预设回调函数的方式,实现像蓝牙耳机对应的编码器发送目标码率信息,则平板电脑的蓝牙需要先注册预设回调函数。
在一些实施例中,平板电脑的蓝牙可以在打开蓝牙功能时,注册预设回调函数。在该实施例中,在上述S201之后,上述方法还可以包括:平板电脑的蓝牙注册预设回调函数。
在另一些实施例中,平板电脑的蓝牙可以在平板电脑连接蓝牙耳机时,注册预设回调函数。在该实施例中,在上述S202之后,上述方法还可以包括:平板电脑的蓝牙注册预设回调函数。具体的,平板电脑的蓝牙可以在检测到平板电脑与设备建立蓝牙连接后,判断该设备是否满足预设条件。若建立蓝牙连接的设备满足预设设备条件,则平板电脑的蓝牙注册预设回调函数。
进一步的,平板电脑的蓝牙注册预设回调函数,具体可以是平板电脑的蓝牙在蓝牙协议栈注册预设回调函数。示例性的,预设回调函数可以是btif av vendor specific event callback。
在本申请实施例提出的技术方案中,注册预设回调函数用于触发向相应的编码器发送目标码率信息,可以保证蓝牙在接收到目标码率信息后,能够将目标码率信息精准的发送至蓝牙耳机对应的编码器。进而,保证平板电脑在与蓝牙耳机建立蓝牙连接,且蓝牙信道质量下降的情况下,控制蓝牙耳机对应的编码器调低传输码率。
在本申请实施例提出的技术方案中,在平板电脑与蓝牙耳机建立蓝牙连接后,平板电脑可以对蓝牙信道质量进行监控。如果发现平板电脑与蓝牙耳机建立蓝牙连接后,蓝牙信道质量下降,则平板电脑可以调低向蓝牙耳机发送数据采用的传输码率。平板电脑调低向蓝牙耳机发送数据采用的传输码率,可以使蓝牙有更多的蓝牙信道资源分配给其他需要的设备。
接下来,对蓝牙芯片开启动态码率调整功能的具体实现过程进行详细说明。
在一些实施例中,蓝牙芯片开启动态码率调整功能,具体可以是由平板电脑的蓝牙向蓝牙芯片发送开启指令,蓝牙芯片响应于开启指令开启动态码率调整功能。
在图4所示示例中,平板电脑在连接了蓝牙耳机,且检测到蓝牙信道质量下降的情况下,需要进行动态码率调整。由上述说明可知,蓝牙芯片可以监测蓝牙信道质量。那么,在一些实施例中,平板电脑的蓝牙可以在连接蓝牙耳机之后,即可向蓝牙芯片发送开启指令,以使蓝牙芯片开启动态码率调整功能。之后,平板电脑的蓝牙芯片可以执行动态码率调整的操作。其中,蓝牙芯片执行动态码率调整的操作是指,蓝牙芯片在监测到蓝牙信道质量下降时,选择合适的码率信息,并将其发送至蓝牙;再由蓝牙将合适的码率信息发送至蓝牙耳机对应的编码器。
由上述实施例的说明可知,第二电子设备,如蓝牙耳机在满足预设设备条件的情况下,才会执行后面的流程。因此,平板电脑的蓝牙可以在检测到平板电脑与满足预设设备条件的设备建立蓝牙连接后,控制蓝牙芯片开启动态码率调整功能。在一些实施例中,平板电脑的蓝牙可以在检测到与平板电脑建立蓝牙连接的设备满足预设设备条件时,向蓝牙芯片发送开启指令。之后,蓝牙芯片可以响应于该开启指令,开启动态码率调整功能。这样,确保平板电脑能够及时的监测蓝牙信道质量,并在蓝牙信道质量满足一定条件时,更新向蓝牙耳机发送数据采用的传输码率。
在平板电脑的蓝牙在检测到平板电脑与满足预设设备条件的设备建立蓝牙连接的情况下,控制蓝牙芯片开启动码率调整功能的实现中,在平板电脑与该满足预设设备条件的设备断开蓝牙连接后,平板电脑可以控制蓝牙芯片关闭动态码率调整功能。在一些实施例中,在S205之后还包括:平板电脑与蓝牙耳机断开蓝牙连接,平板电脑的蓝牙向蓝牙芯片发送关闭指令。蓝牙芯片响应于该关闭指令关闭动码率调整功能。之后,蓝牙芯片在蓝牙信道质量发生变化(如下降),可以不再向蓝牙上报目标码率信息。这样,确保不满足预设设备条件的蓝牙设备与平板电脑建立连接,平板电脑能够以正常的传输码率向这些蓝牙设备发送数据。
在另一些实施例中,平板电脑在调低向蓝牙耳机发送数据采用的传输码率之后,如果监测到蓝牙信道质量上升时,也可以再次调整向蓝牙耳机发送数据的传输码率,如调高向蓝牙耳机发送数据的传输码率。在一个具体示例中,在蓝牙信道质量上升后,可以将向蓝牙耳机发送数据采用的传输码率恢复至第一传输码率。在一些实施例中,在S205之后,平板电脑监测到第三时间点的蓝牙信道质量高于第二时间点的蓝牙信道质量,则平板电脑以第三传输码率向蓝牙耳机发送数据。第三传输码率大于第二传输码率。需要说明的是,该第三传输码率与第一传输码率可以是相等的,也可以是不相等的。这样,在以较低的传输码率(如上述第二传输码率)向蓝牙耳机发送数据的前提下,如果蓝牙信道质量有所改善,可以提高向蓝牙耳机发送数据采用的传输码率。从而,在保证平板电脑传输其他蓝牙设备的数据的前提下,提升蓝牙耳机的音效。
常见的影响蓝牙信道质量的因素包括:其他蓝牙设备的连接与断开,受到其他无线电设备的影响(如Wi-Fi打开或者关闭)等。其中,在蓝牙信道质量下降是因为其他蓝牙设备与平板电脑建立蓝牙连接的情况下,平板电脑以较高的传输码率向蓝牙耳机发送数据,则蓝牙耳机占用平板电脑较多的蓝牙信道资源,容易出现平板电脑没有足够的蓝牙信道资源分配给其他蓝牙设备,从而导致平板电脑传输其他蓝牙设备的数据的速率较低,数据间隔较大,时延较高。在本申请实施例提出的上述技术方案中,在平板电脑与蓝牙耳机建立连接之后,如果平板电脑与其他设备建立蓝牙连接,将会导致平板电脑的蓝牙信道质量下降,此时平板电脑会调低向蓝牙耳机发送数据采用的传输码率。从而,使得平板电脑能够有足够的蓝牙信道资源分配给新建立蓝牙连接的其他设备,保证该其他设备的蓝牙传输速率,降低数据间隔,以及降低时延。
以下结合图5,以平板电脑同时与两个蓝牙设备建立连接的场景为例,对本申请实施例提出的蓝牙传输码率的控制方法进行说明。在该实施例中,以第一电子设备是平板电脑,第二电子设备是蓝牙耳机,以及第三电子设备是手写笔为例进行说明。
S301.平板电脑打开蓝牙功能。
S302.在第一时间点,平板电脑与蓝牙耳机建立蓝牙连接。
S303.平板电脑的蓝牙以第一传输码率向蓝牙耳机发送数据。
S304.在第二时间点,平板电脑与手写笔建立蓝牙连接。
平板电脑与手写笔建立蓝牙连接的具体实现过程,也可以参照相关技术中的描述,在本申请实施例中不予赘述。
由于在第二时间点之前,在第一时间点,平板电脑与蓝牙耳机建立了蓝牙连接,因此在第二时间点之后,平板电脑同时与蓝牙耳机和手写笔建立了蓝牙连接。通常平板电脑与手写笔建立蓝牙连接后,主要是手写笔向平板电脑发送数据。
S305.手写笔向平板电脑的蓝牙发送书写数据。
S306.平板电脑的蓝牙将书写数据发送至屏幕。
由上述说明可知,平板电脑的屏幕接收到来自手写笔的书写数据后,可以根据书写数据绘制和显示对应的笔迹,或者响应于书写数据做出响应,如页面更新等。
由上述实施例的说明可知,平板电脑在第二时间点新增与手写笔的蓝牙连接,将会导致平板电脑的蓝牙信道质量下降。在一些实施例中,平板电脑可以在第二时间点平板电脑与手写笔建立蓝牙连接之后,获取蓝牙信道质量,并将其与第一时间点的蓝牙信道质量进行比较。
S307.平板电脑判断是否蓝牙信道质量小于第一时间点的蓝牙信道质量。
在S307中,平板电脑比较的是在第二时间点平板电脑与手写笔建立蓝牙连接后的蓝牙信道质量,与第一时间点的蓝牙信道质量。可以理解的,平板电脑可以先执行S305和S306,再执行S307。平板电脑也可以先执行S307,再执行S305和S306。或者,平板电脑还可以同时执行S305、S306和S307。
如果S307的判断结果为是,则表示在平板电脑与手写笔建立蓝牙连接之后,蓝牙信道质量相比于第一时间点有所下降,此时可以调低平板电脑向蓝牙耳机发送数据采用的传输码率,如S308。需要说明的是,如果S307的判断结果为否,平板电脑的蓝牙可以不执行操作;S307的判断结果为否的情况,在图5中未示出。
S308.平板电脑的蓝牙以第二传输码率向蓝牙耳机发送数据,第二传输码率低于第一传输码率。
在图5所示的示例中,平板电脑先与蓝牙耳机建立蓝牙耳机,然后再与手写笔建立蓝牙连接。因此,平板电脑在还未与手写笔建立蓝牙连接的第一时间点,平板电脑以第一传输码率向蓝牙耳机发送数据。而在第二时间点,平板电脑在与手写笔建立蓝牙连接后,平板电脑向蓝牙耳机发送数据采用的传输码率为第二传输码率。也就是说,在平板电脑与手写笔建立蓝牙连接之后,平板电脑调低了向蓝牙耳机发送数据采用的传输码率。
在本申请实施例提出的技术方案中,在平板电脑同时与手写笔和蓝牙耳机建立蓝牙的第二时间点,平板电脑可以以较低的传输码率向蓝牙耳机发送数据。降低向蓝牙耳机发送采用的传输码率也就减少了蓝牙耳机在平板电脑所占用的蓝牙信道资源。这样,平板电脑的蓝牙有更多的蓝牙信道资源可以分配用于传输手写笔的数据。从而在第二时间点可以保证平板电脑传输手写笔的数据的速率较高,减少平板电脑两次手写笔的数据之间的时间间隔,降低时延。由上述说明可知,平板电脑传输手写笔的数据,主要是平板电脑的蓝牙将接收到的手写笔的书写数据发送至屏幕。在采用上述方法后,即便平板电脑同时连接蓝牙耳机和手写笔,平板电脑的蓝牙也能够及时的向屏幕上报来自手写笔的数据,保证屏幕能够及时的绘制和显示对应的笔迹。进而,也就能够避免回勾和断线等异常情况。
如果在图4所示示例的S204中,影响平板电脑的蓝牙信道质量的原因是因为平板电脑开启了Wi-Fi功能,那么在第二时间点,平板电脑仍仅与蓝牙耳机建立了蓝牙耳机。在这种情况下,如果调低平板电脑向蓝牙耳机发送数据采用的传输码率,则可能会影响到蓝牙耳机的传输效果,比如降低蓝牙耳机的音效等。为了避免这种情况发生,平板电脑可以在同时连接了蓝牙耳机以及其他蓝牙设备的情况下,再根据蓝牙信道质量决定是否调整(如调低)向蓝牙耳机发送数据采用的传输码率,以保证平板电脑能够有足够的蓝牙信道资源传输蓝牙耳机以外的其他蓝牙设备的数据。上述方案可以通过以下任一种方式实现:
第一种方式,由上述实施例的说明可知,蓝牙芯片可以在开启动态码率调整功能的情况下,监测蓝牙信道质量,并根据蓝牙信道质量确定是否需要调整传输码率。基于此,平板电脑可以在至少同时连接两个蓝牙设备,且其中包括满足预设设备条件的设备(如蓝牙耳机)的情况下,再控制蓝牙芯片开启动态码率调整功能。如此,蓝牙芯片可以执行动态码率调整的操作。
第二种方式,平板电脑的蓝牙也可以在连接蓝牙耳机后,先控制蓝牙芯片开启动态码率调整功能。之后,由蓝牙芯片根据平板电脑是否连接两个蓝牙设备,以及蓝牙信道质量,决定是否需要调整传输码率。如果蓝牙芯片检测到平板电脑连接了两个蓝牙设备,并且其中包括满足预设设备条件的设备(如蓝牙耳机),可以执行动态码率调整的操作。
以下结合图6先对上述第一种方式进行说明。图6示出了本申请一些实施例中,蓝牙传输码率的控制方法的流程。
S400.平板电脑打开蓝牙功能。
S401.平板电脑与蓝牙耳机建立蓝牙连接。
S402.平板电脑以第一传输码率向蓝牙耳机发送数据。
S403.平板电脑与手写笔建立蓝牙连接。
可以理解的,在S403之后,平板电脑可以执行如图5所示的S305和S306。这一过程在图6中未示出。
S404.平板电脑的蓝牙判断是否同时连接了至少两个蓝牙设备,并且其中至少一个蓝牙设备对应的传输码率大于或者等于预设阈值。
需要说明的是,平板电脑在开启蓝牙功能后,可以在任意时刻执行S404。例如,在图6所示示例中,平板电脑在S401、S402或者S403之前都可以执行S404,但是判断结果为否;这种情况在图6中未示出。在S404的判断结果为否的情况下,平板电脑不需要执行其他操作。
在图6所示的实施例中,蓝牙耳机对应的传输码率大于或者等于预设阈值,并且平板电脑同时与蓝牙耳机和手写笔建立了蓝牙连接。因此,S404的判断结果为是,此时平板电脑可以控制蓝牙芯片开启动态码率调整功能。
S405.平板电脑的蓝牙向蓝牙芯片发送开启指令。
S406.蓝牙芯片响应于开启指令,开启动态码率调整功能。
S407.蓝牙芯片在监测到蓝牙状态满足第一预设条件时,向平板电脑的蓝牙上报与当前的蓝牙状态匹配的目标码率信息。
由于平板电脑的蓝牙是在检测到平板电脑连接了至少两个蓝牙设备,且其中一个设备对应的传输码率大于或者等于预设阈值,才向蓝牙芯片发送开启指令。因此蓝牙芯片可以仅根据蓝牙信道质量判断是否需要调整传输码率。即,上述蓝牙状态包括蓝牙信道质量。蓝牙状态满足第一预设条件,具体可以包括蓝牙信道质量下降。
S408.平板电脑的蓝牙向蓝牙耳机对应的编码器发送目标码率信息。
S409.蓝牙耳机对应的编码器基于目标码率信息,采用第二传输码率向蓝牙耳机发送数据;第二传输码率低于第一传输码率。
在一些实施例中,蓝牙耳机对应的编码器基于目标码率信息,具体可以将采用第二传输码率向蓝牙耳机发送数据,由第一传输码率切换为第二传输码率。
在本申请实施例提出的技术方案中,平板电脑在仅连接一个蓝牙设备时,无论该蓝牙设备对应的传输码率是多少,都不会调整该蓝牙设备对应的传输码率。而在平板电脑同时连接两个以上蓝牙设备,且其中一个蓝牙设备A对应的传输码率大于或者等于预设阈值(如上述蓝牙耳机)的情况下,则如果蓝牙信道质量出现下降,平板电脑调低该蓝牙设备A对应的传输码率。进而保证平板电脑有足够的蓝牙信道资源,用于传输其他蓝牙设备的数据。
由上述实施例的说明可知,平板电脑在控制打开动态码率调整功能后,还可以关闭动态码率调整功能。在图6所示的实施例中,平板电脑的蓝牙在同时连接了至少两个蓝牙设备,并且其中至少一个蓝牙设备对应的传输码率大于或者等于预设阈值的情况下,控制蓝牙芯片开启动态码率调整功能。基于此,在平板电脑连接的蓝牙设备不再满足开启动态码率调整功能的条件时,可以控制蓝牙芯关闭动态码率调整功能。具体的,在以下任意一种情况下,表示平板电脑连接的蓝牙设备不再满足开启动态码率调整功能的条件:平板电脑连接的蓝牙设备的数量小于2(如为0或1),或者平板电脑连接的所有蓝牙设备对应的传输码率均小于或者等于预设阈值。具体的,在上述S405之后,如果平板电脑的蓝牙在检测到平板电脑与蓝牙耳机断开蓝牙连接,或者平板电脑与手写笔断开蓝牙连接,平板电脑的蓝牙可以向蓝牙芯片发送关闭指令。蓝牙芯片响应于关闭指令,关闭动态码率调整功能。
其中,如果平板电脑的蓝牙检测到平板电脑与手写笔断开蓝牙连接,则表示平板电脑的蓝牙不需要传输手写笔的数据。此时,为了保证蓝牙耳机的音效,可以再次调整向蓝牙耳机发送数据的传输码率,如调高向蓝牙耳机发送数据的传输码率。具体的,可以将蓝牙耳机对应的编码器的传输码率恢复至第一传输码率。在一些实施例中,在上述S405之后,如果平板电脑的蓝牙在检测到平板电脑与手写笔断开蓝牙连接,平板电脑的蓝牙在向蓝牙芯片发送关闭指令的同时,还可以向蓝牙耳机对应的编码器发送码率更新指令(可以记为码率更新指令1),该码率更新指令1用于指示蓝牙耳机对应的编码器将传输码率恢复至第一传输码率。从而,可以保证平板电脑在仅与蓝牙耳机建立蓝牙连接的情况下,能够以较高的传输码率向蓝牙耳机发送数据,保证蓝牙耳机的音效。
这样,能够保证平板电脑在状态更新为仅连接第二电子设备,如蓝牙耳机时,恢复该蓝牙耳机对应的传输码率。
以下结合图7对上述第二种方式进行说明。
S500.平板电脑打开蓝牙功能。
S501.平板电脑与蓝牙耳机建立蓝牙连接。
S502.平板电脑以第一传输码率向蓝牙耳机发送数据。
S503.平板电脑的蓝牙判断是否连接的蓝牙设备对应的传输码率大于或者等于预设阈值。
需要说明的是,平板电脑在开启蓝牙功能后,可以在任意时刻执行S503。例如,在图7所示示例中,平板电脑在S501之前可以执行S503,但是判断结果为否;这种情况在图7中未示出。在S503的判断结果为否的情况下,平板电脑不需要执行其他操作。
在图7所示的实施例中,蓝牙耳机对应的传输码率大于或者等于预设阈值。因此,S503的判断结果为是,此时平板电脑可以控制蓝牙芯片开启动态码率调整功能。
S504.平板电脑的蓝牙向蓝牙芯片发送开启指令。
S505.蓝牙芯片响应于开启指令,开启动态码率调整功能。
S506.平板电脑与手写笔建立蓝牙连接。
S507.蓝牙芯片在监测到蓝牙状态满足第二预设条件时,向平板电脑的蓝牙上报与当前的蓝牙状态匹配的目标码率信息。
由于平板电脑的蓝牙是在检测到平板电脑连接的蓝牙设备对应的传输码率大于或者等于预设阈值的情况下,向蓝牙芯片发送开启指令。因此,蓝牙芯片需要根据蓝牙信道质量和平板电脑连接的蓝牙设备的数量,共同判断是否需要调整传输码率。即,上述蓝牙状态可以包括蓝牙传输状态和蓝牙连接状态。示例性的,蓝牙传输状态包括蓝牙信道质量。蓝牙连接状态包括平板电脑连接的蓝牙设备的数量。在一些实施例中,蓝牙状态满足第二预设条件包括:蓝牙信道质量下降,且平板电脑连接的蓝牙设备的数量大于或者等于2。
可以理解的,蓝牙芯片在开启动态码率调整功能之后,可以在任意时刻判断蓝牙状态是否满足第二预设条件,并在蓝牙状态满足第二预设条件时,向平板电脑的蓝牙上报与当前的蓝牙状态匹配的目标码率信息。例如,在图7所示示例中,平板电脑在S506之前可以判断蓝牙状态是否满足第二预设条件,但是判断结果为否;这种情况在图7中未示出。在蓝牙状态是否不满足第二预设条件的情况下,平板电脑不需要执行其他操作。示例性的,蓝牙状态不满足第二预设条件,具体可以包括以下几种情况:(1)蓝牙信道质量下降、不变或上升,且平板电脑连接的蓝牙设备的数量小于2。(2)蓝牙信道质量不变或上升,且平板电脑连接的蓝牙设备的数量大于或者等于2。
在图7所示的示例中,由于平板电脑与蓝牙耳机和手写笔分别建立了蓝牙连接,即与平板电脑建立蓝牙连接的设备的数量等于2。因此,若蓝牙信道质量下降,则蓝牙状态满足第二预设条件。
S508.平板电脑的蓝牙向蓝牙耳机对应的编码器发送目标码率信息。
S509.蓝牙耳机对应的编码器响应于目标码率信息,采用第二传输码率向蓝牙耳机发送数据;第二传输码率低于第一传输码率。
在本申请实施例提出的技术方案中,同样能够实现以下技术效果:平板电脑在仅连接一个蓝牙设备时,无论该蓝牙设备对应的传输码率是多少,都不会调整该蓝牙设备对应的传输码率。而在平板电脑同时连接两个以上蓝牙设备,且其中一个蓝牙设备A对应的传输码率大于或者等于预设阈值(如上述蓝牙耳机)的情况下,则平板电脑会在蓝牙信道质量下降时,调低该蓝牙设备A对应的传输码率。进而保证平板电脑能够正常的传输其他蓝牙设备的数据。
在图7所示示例中,平板电脑连接的蓝牙设备不再满足开启动态码率调整功能的条件如下:平板电脑连接的所有蓝牙设备对应的传输码率均小于或者等于预设阈值。在S505之后,如果检测到平板电脑与蓝牙耳机断开蓝牙连接,则平板电脑的蓝牙可以向蓝牙芯片发送关闭指令,以控制蓝牙芯片关闭动态码率调整功能。
上述实施例均是以平板电脑在未与任何设备建立蓝牙连接的情况下,先与蓝牙耳机建立蓝牙连接,再与其他蓝牙设备,如手写笔建立连接为例进行说明的。在另一些实施例中,平板电脑在打开蓝牙后,也有可能先与其他蓝牙设备(如上述手写笔)建立蓝牙连接,再与蓝牙耳机建立蓝牙连接。以平板电脑先与手写笔建立蓝牙连接为例,由于当前平板电脑的蓝牙仅连接了手写笔,那么平板电脑在向屏幕上报手写笔的书写数据时,能够按照正常的数据间隔上报书写数据。然而,在平板电脑与蓝牙耳机建立蓝牙连接之后,平板电脑在向蓝牙耳机发送数据的同时,无法向屏幕上报手写笔的书写数据。如果平板电脑向蓝牙耳机发送数据采用的传输码率较高(如传输码率大于或者等于预设阈值),则容易出现平板电脑向屏幕上报书写数据速率降低,两次上报书写数据之间的间隔增加的现象。对于屏幕而言,接收到的书写数据则容易出现时延较大的问题,从而导致屏幕显示书写笔迹时的回勾或断线等异常问题。基于此,在本申请实施例提出的技术方案中,在平板电脑与蓝牙耳机建立蓝牙连接之后,可以先采用第一传输码率向蓝牙耳机发送数据。之后,平板电脑的蓝牙芯片如果检测到连接蓝牙耳机后的蓝牙信道质量,相比于仅连接手写笔时的蓝牙信道质量下降,调低平板电脑向蓝牙耳机发送数据采用的传输码率,如由第一传输码率调整为第二传输码率。
图8示出了一些实施例中蓝牙传输码率的控制方法的完整流程。在该实施例中,以蓝牙耳机对应的编码器是LDAC编码器为例进行说明。
平板电脑打开蓝牙功能。平板电脑的蓝牙可以先判断蓝牙芯片是否支持动态码率调整功能。若蓝牙芯片支持动态码率调整功能,则平板电脑的蓝牙在蓝牙协议栈注册预设回调函数。在平板电脑与蓝牙耳机建立蓝牙连接后,平板电脑的蓝牙向蓝牙芯片发送开启指令。蓝牙芯片响应于开启指令,开启动态码率调整功能。之后,蓝牙芯片在监测到蓝牙信道质量下降时,向平板电脑的蓝牙上报目标码率信息。平板电脑的蓝牙通过调用预设回调函数,向LDAC编码器发送目标码率信息。最后,LDAC编码器基于目标码率信息确定对应的目标传输码率,以目标传输码率向蓝牙耳机发送数据。
在一些实施例中,开启指令具体是通过调用HCI接口实现的。
以上介绍了本申请实施例提供的蓝牙传输码率的控制方法。下面介绍实施该方法的设备。如图9所示为本申请一实施例提供的电子设备900的结构示意图。电子设备900可以包括处理器910,外部存储器接口920,内部存储器921,通用串行总线(universal serial bus,USB)接口930,充电管理模块940,电源管理模块941,电池942,天线1,天线2,移动通信模块950,无线通信模块960,音频模块970,编码器970A,传感器模块980,按键990,马达991,摄像头992,显示屏993,以及用户标识模块(subscriber identification module,SIM)卡接口994,等。其中,传感器模块980可以包括压力传感器980A,触摸传感器980B等。示例性的,该电子设备900可以是上述实施例中的第一电子设备。
可以理解的是,本申请实施例示意的结构并不构成对电子设备900的具体限定。在本申请另一些实施例中,电子设备900可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器910可以包括一个或多个处理单元,例如:处理器910可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,神经网络处理器(neural-network processing unit,NPU)和/或蓝牙芯片等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。例如,处理器910用于执行本申请实施例中的蓝牙传输码率的控制方法。
其中,蓝牙芯片是负责蓝牙无线通信的核心组件,包括无线信号的收发和处理。在本申请的实施例中,蓝牙芯片可以用于监测蓝牙信道质量,并在蓝牙信道质量满足一定条件,或者蓝牙信道质量和连接的蓝牙设备的数量共同满足一定条件的情况下,自适应调整蓝牙的传输码率。
其中,控制器可以是电子设备900的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器910中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器910中的存储器为高速缓冲存储器。该存储器可以保存处理器910刚用过或循环使用的指令或数据。如果处理器910需要再次使用该指令或数据,可从存储器中直接调用。避免了重复存取,减少了处理器910的等待时间,因而提高了系统的效率。
USB接口930是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口930可以用于连接充电器为电子设备900充电,也可以用于电子设备900与外围设备之间传输数据。
外部存储器接口920可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备900的存储能力。外部存储卡通过外部存储器接口920与处理器910通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器921可以用于存储计算机可执行程序代码,可执行程序代码包括指令。处理器910通过运行存储在内部存储器921的指令,从而执行电子设备900的各种功能应用以及数据处理。内部存储器921可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)。
此外,内部存储器921可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
充电管理模块940用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块940可以通过USB接口930接收有线充电器的充电输入。
电源管理模块941用于连接电池942,充电管理模块940与处理器910。电源管理模块941接收电池942和/或充电管理模块940的输入,为处理器910,内部存储器921,外部存储器,显示屏993,摄像头992,和无线通信模块960等供电。
在其他一些实施例中,电源管理模块941也可以设置于处理器910中。在另一些实施例中,电源管理模块941和充电管理模块940也可以设置于同一个器件中。
电子设备900的无线通信功能可以通过天线1,天线2,移动通信模块950,无线通信模块960,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备900中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块950可以提供应用在电子设备900上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块950可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块950可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块950还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。
无线通信模块960可以提供应用在电子设备900上的包括无线局域网(wireless local area networks,WLAN)(如Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块960可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块960经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器910。无线通信模块960还可以从处理器910接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在本申请的实施例中,电子设备900通过无线通信模块960中的蓝牙与其他电子设备建立蓝牙连接。
在一些实施例中,电子设备900的天线1和移动通信模块950耦合,天线2和无线通信模块960耦合,使得电子设备900可以通过无线通信技术与网络以及其他设备通信。
电子设备900可以通过音频模块970,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块970用于将数字音频信号转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块970还可以用于对音频信号编码和解码。在一些实施例中,音频模块970可以设置于处理器910中,或将音频模块970的部分功能模块设置于处理器910中。
在一些实施例中,音频模块970具体可以包括编码器970A,编码器970A用于对电子设备900待发送的音频数据进行编码。电子设备900可以包括一个或多个编码器970A。在本申请的一些实施例中,编码器970A可以包括LDAC编码器。
压力传感器980A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器980A可以设置于显示屏993。压力传感器980A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器980A,电极之间的电容改变。电子设备900根据电容的变化确定压力的强度。当有触摸操作作用于显示屏993,电子设备900根据压力传感器980A检测触摸操作强度。电子设备900也可以根据压力传感器980A的检测信号计算触摸的位置。
触摸传感器980B,也称“触控面板”。触摸传感器980B可以设置于显示屏993,由触摸传感器980B与显示屏993组成触摸屏,也称“触控屏”。触摸传感器980B用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏993提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器980B也可以设置于电子设备900的表面,与显示屏993所处的位置不同。
按键990包括开机键,音量键等。按键990可以是机械按键。也可以是触摸式按键。电子设备900可以接收按键输入,产生与电子设备900的用户设置以及功能控制有关的键信号输入。
马达991可以产生振动提示。马达991可以用于来电振动提示,也可以用于触摸振动反馈。
摄像头992用于捕获静态图像或视频。在一些实施例中,电子设备900可以包括1个或N个摄像头992,N为大于1的正整数。
电子设备900通过GPU,显示屏993,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏993和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器910可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏993用于显示图像,视频等。在一些实施例中,电子设备900可以包括1个或N个显示屏993,N为大于1的正整数。
SIM卡接口994用于连接SIM卡。SIM卡可以通过插入SIM卡接口994,或从SIM卡接口994拔出,实现和电子设备900的接触和分离。电子设备900可以支持1个或N个SIM卡接口,N为大于1的正整数。
图10示出了本申请一些实施例中电子设备的软件框架图。电子设备包括应用程序层、应用程序框架层,安卓运行时(android runtime,ART),硬件抽象层(hardware abstract layer,HAL)以及内核层。
应用程序层可以包括一系列应用程序包。例如,通话、蓝牙、视频、音频以及界面等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。如图10所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,输入管理器,以及蓝牙框架等。
窗口管理器提供窗口管理服务(window manager service,WMS),WMS可以用于窗口管理、窗口动画管理、surface管理以及作为输入系统的中转站。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。该数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
输入管理器可以提供输入管理服务(input manager service,IMS),IMS可以用于管理系统的输入,例如触摸屏输入、按键输入、传感器输入等。IMS从输入设备节点取出事件,通过和WMS的交互,将事件分配至合适的窗口。
硬件抽象层运行于用户空间(user space),对内核层驱动进行封装,向上层提供调用接口。在本申请实施例中,硬件抽象层包括通话管理器、蓝牙管理器、音频管理器以及显示管理器等。
安卓运行时包括核心库和安卓运行时。安卓运行时负责将源代码转换为机器码。
内核层是硬件和软件之间的层。内核层可以包含显示驱动,音频驱动,蓝牙驱动等。
本申请另一些实施例提供了一种电子设备。该电子设备可以是上述实施例中的第一电子设备。该电子设备可以包括:存储器和一个或多个处理器。该存储器与处理器耦合。该存储器还用于存储计算机程序代码,该计算机程序代码包括计算机指令。当处理器执行计算机指令时,电子设备可执行上述方法实施例中平板电脑执行的各个功能或者步骤。该电子设备的结构可以参考图9所示的电子设备900的结构。
本申请实施例还提供一种芯片系统,如图11所示,该芯片系统1100包括至少一个处理器1101和至少一个接口电路1102。处理器1101和接口电路1102可通过线路互联。例如,接口电路1102可用于从其它装置(例如计算机的存储器)接收信号。又例如,接口电路1102可用于向其它装置(例如处理器1101)发送信号。示例性的,接口电路1102可读取存储器中存储的指令,并将该指令发送给处理器1101。当指令被处理器1101执行时,可使得计算机执行上述实施例中的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质包括计算机指令,当计算机指令在上述电子设备上运行时,使得该电子设备执行上述方法实施例中平板电脑执行的各个功能或者步骤。
本申请实施例还提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行上述方法实施例中平板电脑执行的各个功能或者步骤。其中,该计算机可以是电子设备,如平板电脑。
通过以上实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (16)

  1. 一种蓝牙传输码率的控制方法,其特征在于,所述方法应用于第一电子设备,所述方法包括:
    在第一时间点,所述第一电子设备与第二电子设备建立蓝牙连接,所述第一电子设备以第一传输码率向所述第二电子设备发送数据;
    在第二时间点,在所述第一电子设备的蓝牙状态满足预设条件的情况下,所述第一电子设备以第二传输码率向所述第二电子设备发送数据;所述第二传输码率小于所述第一传输码率;
    其中,所述第一电子设备的蓝牙状态满足预设条件包括:所述第一电子设备在所述第二时间点的蓝牙信道质量低于所述第一时间点的蓝牙信道质量。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在所述第一电子设备与所述第二电子设备建立蓝牙连接后,所述第一电子设备开启动态码率调整功能。
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一电子设备的蓝牙状态满足预设条件,还包括:
    与所述第一电子设备建立蓝牙连接的设备的数量大于或者等于2。
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:
    在所述第二时间点,所述第一电子设备与第三电子设备建立蓝牙连接。
  5. 根据权利要求3所述的方法,其特征在于,所述方法还包括:
    在第三时间点,所述第一电子设备与第三电子设备建立蓝牙连接,并开启动态码率调整功能;
    其中,所述第三时间点在所述第一时间点之后,且在所述第二时间点之前。
  6. 根据权利要求1-5中任一项所述的方法,其特征在于,所述第二电子设备对应的传输码率大于或者等于预设阈值。
  7. 根据权利要求1-6中任一项所述的方法,其特征在于,所述第一电子设备以第二传输码率向所述第二电子设备发送数据,包括:
    所述第一电子设备确定与所述蓝牙状态匹配的目标码率信息;所述目标码率信息用于表征所述第二传输码率;
    所述第一电子设备控制所述第一电子设备的目标编码器基于所述目标码率信息,采用所述第二传输码率向所述第二电子设备发送数据;所述目标编码器是所述第一电子设备向所述第二电子设备发送数据所采用的编码器。
  8. 根据权利要求7所述的方法,其特征在于,所述目标码率信息包括所述第二传输码率;或者,所述目标码率信息包括目标码率等级,所述目标码率等级与所述第二传输码率对应。
  9. 根据权利要求7或8所述的方法,其特征在于,所述方法还包括:
    所述第一电子设备响应于所述第一电子设备打开蓝牙功能,在蓝牙协议栈注册预设回调函数;或者,所述第一电子设备响应于所述第一电子设备与第二电子设备建立蓝牙连接,在蓝牙协议栈注册预设回调函数;
    其中,所述预设回调函数用于在所述第一电子设备的蓝牙状态满足预设条件的情况下,触发所述第一电子设备控制所述目标编码器基于所述目标码率信息,调整所述第二传输码率向所述第二电子设备发送数据采用的传输码率。
  10. 根据权利要求2所述的方法,其特征在于,在所述第一电子设备开启动态码率调整功能后,所述方法还包括:
    所述第一电子设备与所述第二电子设备断开蓝牙连接,所述第一电子设备关闭所述动态码率调整功能。
  11. 根据权利要求4所述的方法,其特征在于,在第一电子设备开启动态码率调整功能后,所述方法还包括:
    所述第一电子设备与所述第二电子设备断开蓝牙连接,和/或,所述第一电子设备与所述第三电子设备断开蓝牙连接,所述第一电子设备关闭所述动态码率调整功能。
  12. 根据权利要求1-11中任一项所述的方法,其特征在于,所述第一电子设备向所述第二电子设备发送数据所采用的目标编码器,是基于低延迟音频编码LDAC或者低延迟高清音频编解码器LHDC实现的。
  13. 一种蓝牙传输码率的控制方法,其特征在于,所述方法应用于第一电子设备,所述方法包括:
    在第一时间点,在所述第一电子设备仅与第二电子设备建立了蓝牙连接的情况下,所述第一电子设备以第一传输码率向所述第二电子设备发送数据;
    在第二时间点,在所述第一电子设备同时与所述第二电子设备和第三电子设备建立蓝牙连接的情况下,所述第一电子设备以第二传输码率向所述第二电子设备发送数据;所述第二传输码率小于所述第一传输码率。
  14. 一种电子设备,其特征在于,所述电子设备是第一电子设备,所述第一电子设备包括:处理器、存储器以及存储在所述存储器上的计算机程序;所述存储器分别与所述处理器耦合;
    当所述第一电子设备运行时,所述处理器执行所述计算机程序,以实现如权利要求1-13中任一项所述的方法。
  15. 一种计算机可读存储介质,其特征在于,存储有计算机程序,所述计算机程序被电子设备的处理器运行时,实现如权利要求1-13中任一项所述的方法。
  16. 一种计算机程序产品,其特征在于,包括计算机程序,所述计算机程序被处理器执行时,实现如权利要求1-13中任一项所述的方法。
PCT/CN2025/092388 2024-05-31 2025-04-30 一种蓝牙传输码率的控制方法及电子设备 Pending WO2025246794A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410709343.9A CN121099287A (zh) 2024-05-31 2024-05-31 一种蓝牙传输码率的控制方法及电子设备
CN202410709343.9 2024-05-31

Publications (1)

Publication Number Publication Date
WO2025246794A1 true WO2025246794A1 (zh) 2025-12-04

Family

ID=97869517

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2025/092388 Pending WO2025246794A1 (zh) 2024-05-31 2025-04-30 一种蓝牙传输码率的控制方法及电子设备

Country Status (2)

Country Link
CN (1) CN121099287A (zh)
WO (1) WO2025246794A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015137601A1 (ko) * 2014-03-12 2015-09-17 엘지전자(주) 무선통신 시스템에서 데이터 전송률 조절 방법 및 장치
CN110248341A (zh) * 2018-03-08 2019-09-17 华为技术有限公司 传输速率切换方法、蓝牙设备及计算机可读介质
CN114244383A (zh) * 2021-12-27 2022-03-25 东莞市阿尔法电子科技有限公司 信号处理方法、系统、蓝牙耳机及存储介质
CN114698031A (zh) * 2020-12-31 2022-07-01 Oppo广东移动通信有限公司 码率确定方法、装置、蓝牙播放设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015137601A1 (ko) * 2014-03-12 2015-09-17 엘지전자(주) 무선통신 시스템에서 데이터 전송률 조절 방법 및 장치
CN110248341A (zh) * 2018-03-08 2019-09-17 华为技术有限公司 传输速率切换方法、蓝牙设备及计算机可读介质
CN114698031A (zh) * 2020-12-31 2022-07-01 Oppo广东移动通信有限公司 码率确定方法、装置、蓝牙播放设备及存储介质
CN114244383A (zh) * 2021-12-27 2022-03-25 东莞市阿尔法电子科技有限公司 信号处理方法、系统、蓝牙耳机及存储介质

Also Published As

Publication number Publication date
CN121099287A (zh) 2025-12-09

Similar Documents

Publication Publication Date Title
JP7329073B2 (ja) 指示情報の伝送方法及び通信機器
US12414129B2 (en) Resource determining method, resource indication method, and device
CN112997470B (zh) 音频输出控制方法和装置、计算机可读存储介质、电子设备
CN112804755B (zh) 一种上行资源确定方法、指示方法、终端和网络设备
CN109743737B (zh) 一种降低多种网络共存干扰的方法、终端及基站
CN110958710B (zh) 信道接入方法、配置方法、终端及网络侧设备
JP2022519553A (ja) 指示信号の伝送方法、端末及びネットワーク機器
WO2020216209A1 (zh) 指示空间关系信息的方法及装置、通信设备
US20230006711A1 (en) Audio transmission method and electronic device
WO2021057965A1 (zh) 能力参数确定方法、上行调度方法、终端和网络侧设备
CN111278117B (zh) 带宽部分切换方法及装置、通信设备
CN111050422B (zh) 一种非连续接收的控制方法及终端
CN110198560B (zh) 一种功率配置方法和终端
JP7148046B2 (ja) リソース割り当て、リソース使用方法、ユーザ機器及びネットワーク側機器
JP2022543007A (ja) 上りリンク制御情報の伝送方法、端末機器及び記憶媒体
CN110856219A (zh) 一种上行数据传输方法及装置
JP2021521737A (ja) アクセス制御方法、メッセージ放送方法及び関連装置
WO2021088906A1 (zh) Lbt失败的处理方法、终端及网络侧设备
CN111278005A (zh) 能力信息上报方法、预编码矩阵指示反馈方法和相关设备
CN111835481B (zh) 上行传输方法、终端和网络侧设备
JP7332688B2 (ja) 受信方法、送信方法、端末及びネットワーク側機器
WO2021093767A1 (zh) 资源确定、资源配置方法、终端及网络设备
CN110035504A (zh) 一种空间关系的确定方法、终端及基站
CN113556217B (zh) 通信方法、网络设备、终端设备及存储介质
JP2022522207A (ja) 伝送リソース指示方法、伝送方法、ネットワーク機器及び端末

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 25814571

Country of ref document: EP

Kind code of ref document: A1