Audio link latency budget aware scheduling method, system, storage medium, and bluetooth communication device

CN122994835APending Publication Date: 2026-10-27LANYUN JINGXIN MICROELECTRONICS (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611463307.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-20
Publication Date
2026-10-27

AI Technical Summary

Benefits of technology

[0015]第四方面,本申请提供了一种蓝牙通信设备,包括存储器,处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现上述任一项所述的音频链路延迟预算感知调度方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122994835A_ABST
    Figure CN122994835A_ABST
Patent Text Reader

Abstract

The application discloses an audio link delay budget perception scheduling method, a system, a storage medium and a Bluetooth communication device, wherein the audio link delay budget perception scheduling method comprises the following steps: acquiring deadline information of audio data packets in each audio link on two Bluetooth controllers; calculating the residual delay budget of each audio data packet according to the current system time, the deadline information and the necessary processing time; acquiring link state information of each audio link; generating a dynamic scheduling score of each audio link based on the link state information and the residual delay budget; determining a target Bluetooth controller which is currently preferentially scheduled from the two Bluetooth controllers according to the dynamic scheduling score, and determining a target audio link and a target audio data packet which are currently preferentially scheduled from the audio links carried by the target Bluetooth controller, and generating a corresponding scheduling result; and outputting the scheduling result to a global time slot scheduling module to generate a corresponding double-Bluetooth time slot plan.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of wireless audio technology, specifically to an audio link delay budget-aware scheduling method, system, storage medium, and Bluetooth communication device. Background Technology

[0002] With the rapid development of wireless audio technology, Bluetooth audio devices have evolved from simple music playback or voice call functions to complex devices that need to simultaneously support multiple audio services. In typical application scenarios such as gaming headsets, audio dongles, and wireless audio hubs, these devices often need to process multiple services in parallel, including classic Bluetooth A2DP music playback, HFP voice calls, LE Audio low-latency audio streaming, BLE device control signaling, and broadcast audio synchronization. To meet these multi-service concurrency requirements, an on-chip dual Bluetooth system architecture has emerged. This type of system integrates a first Bluetooth controller and a second Bluetooth controller within a single chip, enabling the two Bluetooth controllers to handle different audio services respectively, thereby improving the system's service concurrency capability and spectrum utilization.

[0003] In an on-chip dual Bluetooth audio system, the two Bluetooth controllers share the chip's internal bus bandwidth, baseband processing resources, and radio frequency time slot resources. Currently, existing dual Bluetooth systems typically use either a fixed-priority scheduling method or a simple round-robin scheduling method to manage the time slot allocation between the two controllers. The fixed-priority scheduling method pre-sets a fixed priority order for different types of audio services (e.g., HFP voice is the highest, A2DP music is the next highest, and BLE control is the lowest), and the scheduler responds to each link request sequentially according to this fixed order. The simple round-robin scheduling method allows the two Bluetooth controllers to alternately obtain time slot usage rights.

[0004] However, the current solution has the following drawbacks: First, high real-time audio packets (such as low-latency game audio packets and LEAudio synchronous audio packets) are easily blocked by A2DP music packets or ordinary data packets, causing the low-latency link to fail to meet end-to-end latency requirements; Second, music links with large playback buffers, such as A2DP, occupy too many time slot resources, squeezing the scheduling opportunities of low-latency links and voice links; Third, when the data packets of the low-latency audio link are close to the playback deadline, the system lacks a perception mechanism to identify this urgent state and give it priority scheduling, causing audio packets to miss the playback window due to untimely scheduling; Fourth, ordinary data links or BLE control links may not receive scheduling opportunities for a long time in fixed priority mode, which may cause link timeout disconnection or severe delay in control response; Fifth, the system cannot dynamically adjust the scheduling priority according to the remaining latency budget of different audio data packets, making it difficult to balance multiple performance goals such as low latency guarantee, voice continuity, timely control response, and spectrum utilization when multiple audio links are running concurrently. Summary of the Invention

[0005] This application provides an audio link latency budget-aware scheduling method, system, storage medium, and Bluetooth communication device, which can ensure the real-time requirements of low-latency audio links.

[0006] In a first aspect, embodiments of this application provide an audio link delay budget-aware scheduling method applied to an on-chip dual Bluetooth system, wherein the on-chip dual Bluetooth system includes two Bluetooth controllers, and the audio link delay budget-aware scheduling method includes: Obtain the cutoff time information of audio data packets in each audio link on the two Bluetooth controllers; Based on the current system time, the aforementioned deadline information, and the required processing time, calculate the remaining delay budget for each audio data packet; Obtain the link status information of each audio link; Based on the link status information and the remaining delay budget, a dynamic scheduling score is generated for each audio link; Based on the dynamic scheduling score, the target Bluetooth controller to be scheduled first is determined from the two Bluetooth controllers, and the target audio link and target audio data packet to be scheduled first are determined from the audio link carried by the target Bluetooth controller, and the corresponding scheduling result is generated. The scheduling results are output to the global time slot scheduling module to generate the corresponding dual Bluetooth time slot plan.

[0007] In the audio link delay budget-aware scheduling method provided in this application embodiment, the link status information includes at least one scheduling influencing factor among link type, link direction, connection period, current buffer depth, pending transmission queue depth, packet loss rate, packet error rate, retransmission status, and keep-alive remaining time. The step of generating a dynamic scheduling score for each audio link based on the link status information and the remaining delay budget includes: For each audio link, obtain the actual value of each scheduling influence factor corresponding to the audio link; According to the preset mapping rules, each of the actual values ​​is mapped to the corresponding score contribution value; If an audio link corresponds to multiple scheduling influence factors, the weighted summation or accumulation of each score contribution value is performed to generate a dynamic scheduling score for each audio link; if an audio link corresponds to only one scheduling influence factor, its corresponding score contribution value is used as the dynamic scheduling score.

[0008] In the audio link delay budget-aware scheduling method provided in this application embodiment, after generating the dynamic scheduling score for each audio link, it further includes: For a receiving audio link, if the current buffer depth is lower than a first threshold, the dynamic scheduling score is increased by a first magnitude; if the current buffer depth is lower than a second threshold, the dynamic scheduling score is increased by a second magnitude, wherein the second threshold is less than the first threshold and the second magnitude is greater than the first magnitude. For a transmitting audio link, if the backlog of audio data packets to be transmitted exceeds a preset threshold and the remaining time indicated by the deadline information of some audio data packets is less than a preset time threshold, then the dynamic scheduling score will be increased by a third magnitude value.

[0009] In the audio link delay budget-aware scheduling method provided in this application embodiment, after generating the dynamic scheduling score for each audio link, it further includes: When the link status information indicates that there are audio data packets that need to be retransmitted on a certain audio link, obtain the corresponding remaining delay budget; Determine whether the remaining delay budget is greater than the estimated time required to retransmit the audio data packet; If so, the audio data packet is determined to be within the valid retransmission window, and the dynamic scheduling score is increased by the fourth magnitude value; If not, it is determined that the audio data packet has exceeded the valid retransmission window, the retransmission opportunity of the audio data packet is abandoned, and the dynamic scheduling score is not increased or decreased.

[0010] In the audio link delay budget-aware scheduling method provided in this application embodiment, after generating the dynamic scheduling score for each audio link, it further includes: Iterate through the deadline information of audio data packets in each of the aforementioned audio links; If the deadline indicated by the deadline information of an audio data packet is later than the current system time, then the audio data packet is determined to have expired. For expired audio data packets, remove them from the scheduling queue or set their dynamic scheduling score to the lowest value so that they do not participate in the arbitration of the current scheduling cycle.

[0011] In the audio link delay budget-aware scheduling method provided in this application embodiment, after generating the dynamic scheduling score for each audio link, it further includes: Obtain the continuous unscheduled duration of each audio link; If the continuous unscheduled duration of a certain audio link exceeds the preset aging time threshold, the dynamic scheduling score will be gradually increased by accumulating the aging coefficient. Once the audio link is successfully scheduled, its continuous unscheduled duration is reset to zero, and the aging coefficient is reset to its initial value.

[0012] In the audio link latency budget-aware scheduling method provided in this application embodiment, the step of determining the target Bluetooth controller to be prioritized for scheduling from two Bluetooth controllers based on the dynamic scheduling score, and determining the target audio link and target audio data packet to be prioritized for scheduling from the audio links carried by the target Bluetooth controller, includes: The dynamic scheduling scores are sorted, and the audio link with the highest score is selected as the target audio link, and its Bluetooth controller is selected as the target Bluetooth controller. In the target audio link, each audio data packet is sorted according to the remaining delay budget, and the audio data packet with the smallest remaining delay budget is selected as the target audio data packet.

[0013] Secondly, embodiments of this application provide an audio link delay budget-aware scheduling system applied to an on-chip dual Bluetooth system, wherein the on-chip dual Bluetooth system includes two Bluetooth controllers, and the audio link delay budget-aware scheduling system includes: The time acquisition module is used to acquire the cutoff time information of audio data packets in each audio link on the two controllers; The delay calculation module is used to calculate the remaining delay budget for each audio data packet based on the current system time, the deadline information, and the required processing time. The status acquisition module is used to acquire the link status information of each audio link; The dynamic scoring module is used to generate a dynamic scheduling score for each audio link based on the link status information and the remaining delay budget. The audio scheduling module is used to determine the target Bluetooth controller to be scheduled first from the two Bluetooth controllers based on the dynamic scheduling score, and to determine the target audio link and target audio data packet to be scheduled first from the audio link carried by the target Bluetooth controller, and generate the corresponding scheduling result. The time slot scheduling module is used to output the scheduling result to the global time slot scheduling module to generate the corresponding dual Bluetooth time slot plan.

[0014] Thirdly, this application provides a storage medium storing a plurality of instructions that are adapted for loading by a processor to execute the audio link delay budget-aware scheduling method described in any of the preceding claims.

[0015] Fourthly, this application provides a Bluetooth communication device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the audio link delay budget-aware scheduling method described in any of the above claims.

[0016] In summary, the audio link delay budget-aware scheduling method provided in this application includes: obtaining the deadline information of audio data packets in each audio link on two Bluetooth controllers; calculating the remaining delay budget of each audio data packet based on the current system time, the deadline information, and the required processing time; obtaining the link status information of each audio link; generating a dynamic scheduling score for each audio link based on the link status information and the remaining delay budget; determining the target Bluetooth controller for current priority scheduling from the two Bluetooth controllers based on the dynamic scheduling score, and determining the target audio link and target audio data packet for current priority scheduling from the audio links carried by the target Bluetooth controller, generating a corresponding scheduling result; and outputting the scheduling result to the global time slot scheduling module to generate a corresponding dual Bluetooth time slot plan. This application decouples the audio service layer from the underlying time slot scheduling layer, enabling scheduling decisions to reflect the time urgency of each audio data packet, effectively solving the technical problem of inflexible fixed-priority scheduling in dual Bluetooth concurrent scenarios, and significantly improving the real-time guarantee capability and system scalability when multiple audio services are concurrent. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart illustrating the audio link delay budget-aware scheduling method provided in this application embodiment.

[0019] Figure 2 This is a schematic diagram of different audio link delay budgets provided in the embodiments of this application.

[0020] Figure 3 This is a schematic diagram illustrating the dynamic change of priority between dual Bluetooth audio links provided in an embodiment of this application.

[0021] Figure 4 This is a schematic diagram of the structure of the audio link delay budget-aware scheduling system provided in the embodiments of this application.

[0022] Figure 5 This is a schematic diagram of the structure of the Bluetooth communication device provided in the embodiments of this application. Detailed Implementation

[0023] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0024] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, components, features, and elements with the same names in different embodiments of this application may have the same meaning or different meanings, the specific meaning of which must be determined by its interpretation in that specific embodiment or further in conjunction with the context of that specific embodiment.

[0025] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0026] In the following description, the use of suffixes such as "module," "part," or "unit" to denote elements is solely for the purpose of illustrative purposes and has no specific meaning in itself. Therefore, "module," "part," or "unit" may be used interchangeably.

[0027] In the description of this application, it should be noted that the terms "upper," "lower," "left," "right," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application. In addition, terms such as "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0028] Based on this, embodiments of this application provide an audio link delay budget-aware scheduling method, system, storage medium, and Bluetooth communication device. Specifically, the audio link delay budget-aware scheduling system can be integrated into a Bluetooth communication device, which can be a mobile phone, wearable smart device (e.g., smartwatch, smart bracelet, smart glasses, smart head-mounted device, etc.), tablet computer, laptop computer, personal computer (PC), game controller, game headset, Bluetooth headset, Bluetooth speaker, Bluetooth transmitter (dongle), in-vehicle Bluetooth device, smart home device (e.g., smart speaker, smart TV, smart projector, etc.), augmented reality (AR) device, or virtual reality (VR) device, etc.

[0029] In this embodiment, the on-chip dual Bluetooth system refers to a system architecture that integrates two Bluetooth controllers (a first Bluetooth controller BT0 and a second Bluetooth controller BT1) within a single chip. The two Bluetooth controllers can each carry different audio services. For example, the first Bluetooth controller can carry classic Bluetooth A2DP music playback or HFP voice calls, while the second Bluetooth controller can carry LE Audio low-latency audio streaming, low-latency game audio, or BLE device control signaling. By distributing different types of audio services across the two Bluetooth controllers, the system's concurrent processing capability and spectrum utilization can be effectively improved.

[0030] The technical solutions shown in this application will be described in detail below through specific embodiments. It should be noted that the order of description of the following embodiments is not intended to limit the priority of the embodiments.

[0031] Please see Figure 1 , Figure 1 This is a flowchart illustrating the audio link delay budget-aware scheduling method provided in this application embodiment. This audio link delay budget-aware scheduling method is applied to an on-chip dual Bluetooth system, which includes two Bluetooth controllers. The specific flow of the audio link delay budget-aware scheduling method is as follows: 101. Obtain the deadline information of audio data packets in each audio link on the two Bluetooth controllers.

[0032] An audio link refers to the logical connection established between two Bluetooth controllers and peripheral Bluetooth devices for transmitting audio data. On each audio link, audio data is transmitted in the form of audio data packets. Deadline information refers to the time constraints that require audio data packets to be played, sent, or synchronized before a specific time point.

[0033] For example, deadline information can include a playback deadline. The playback deadline indicates that audio data packets must be written to the audio playback device (such as a digital-to-analog converter or audio codec) before this time; otherwise, they cannot be played normally, resulting in stuttering, interruptions, or popping sounds. For receiver-type audio links (i.e., on-chip dual Bluetooth systems acting as audio receivers, such as Bluetooth headsets or Bluetooth speakers), the playback deadline is a key deadline type that needs to be considered in scheduling decisions. In a practical application scenario, Bluetooth headsets receive A2DP music audio data packets from a mobile phone through a first Bluetooth controller. These audio data packets are sent to the audio playback buffer to await playback. Each audio data packet carries a playback deadline. If the audio data packet is not scheduled and written to the digital-to-analog converter before the deadline, the audio data packet will be discarded or cause playback interruptions.

[0034] For example, deadline information can include a transmission deadline. The transmission deadline indicates that audio data packets must be sent via the Bluetooth link before this time; otherwise, the receiving end will not receive the audio data packet before the playback deadline, resulting in dropped frames during playback. For transmit-type audio links (i.e., on-chip dual Bluetooth systems acting as audio transmitters, such as a gaming headset Dongle or a wireless microphone), the transmission deadline is a key deadline type that needs to be considered in scheduling decisions. In a practical application scenario, a gaming headset Dongle collects uplink voice data from the microphone via a second Bluetooth controller and encapsulates it into audio data packets for transmission to the game console. Each uplink audio data packet carries a transmission deadline. If the audio data packet is not scheduled and transmitted via the Bluetooth link before the deadline, it will not be able to obtain a valid position in the receiving end's playback buffer, causing interruptions in the audio heard by the recipient.

[0035] For example, deadline information can include a synchronization deadline. A synchronization deadline indicates that audio data packets must complete synchronized multicast transmission or reception before this time. For instance, in LE Audio's Synchronous (ISO) channel, broadcast or unicast audio streams need to complete data transmission and reception at a precise synchronization time to meet the audio-visual synchronization or multi-channel synchronization requirements between multiple receiving devices. Synchronization deadlines are primarily used in broadcast audio synchronization scenarios, such as multiple Bluetooth speakers simultaneously playing multi-channel content from the same audio source, or low-latency audio-visual synchronization transmission between Bluetooth headphones and a television.

[0036] In practice, each audio data packet is assigned a corresponding deadline upon entering the scheduling queue. This deadline can be generated based on timing parameters provided by the upper-layer audio application. For example, in LE Audio applications, the link layer can calculate the deadline for each audio data packet based on the ISO interval and presentation time. In classic Bluetooth A2DP applications, the decoding and playback deadline for each audio data packet can be calculated based on the media stream timing parameters defined in the A2DP protocol. In game audio scenarios, the transmission deadline can be calculated based on the audio frame timestamps provided by the game engine and the wireless transmission latency budget.

[0037] In this embodiment, by independently maintaining deadline information for each audio data packet, the scheduler can perceive the time constraints of each audio data packet at the data packet level, overcoming the coarse granularity problem caused by scheduling decisions based only on link or service type in traditional solutions.

[0038] 102. Based on the current system time, deadline information, and required processing time, calculate the remaining delay budget for each audio data packet.

[0039] The remaining delay budget quantifies the tolerable remaining scheduling wait time for a given audio data packet without affecting playback, call continuity, or synchronization. A smaller remaining delay budget indicates that the audio data packet is closer to its deadline, its scheduling urgency is higher, and it needs to obtain a higher priority in subsequent scheduling arbitration.

[0040] For each audio data packet, the deadline indicated by the deadline information of that audio data packet can be obtained, the current system time can be obtained, and the required processing time necessary to process that audio data packet can be obtained. Then, the remaining delay budget can be calculated according to the following formula: Remaining delay budget = Deadline - Current system time - Required processing time.

[0041] The required processing time refers to the fixed processing time that must be consumed from the completion of the scheduling decision until the audio data packet is actually played or sent out. If the calculated result of the remaining delay budget is positive, it means that the audio data packet still has remaining time slack for the scheduler to schedule and wait; if the remaining delay budget is zero or negative, it means that the audio data packet is in a critical state or has expired and needs to be urgently scheduled or discarded.

[0042] Please see Figure 2 , Figure 2 This is a schematic diagram illustrating different audio link delay budgets provided in the embodiments of this application. For example... Figure 2As shown, different types of audio links have different latency budget characteristics. Low-latency gaming audio links have small latency budgets (e.g., 10 to 30 milliseconds) and extremely high requirements for real-time scheduling; HFP voice links have medium to small latency budgets (e.g., 30 to 60 milliseconds) and high requirements for scheduling continuity and interaction latency; LE Audio unicast audio links have medium latency budgets (e.g., 20 to 40 milliseconds); A2DP music links, due to their large playback buffer, have large latency budgets (e.g., 80 to 150 milliseconds) and relatively high tolerance for instantaneous scheduling latency; BLE control links have small data volumes and relatively relaxed latency budget requirements (e.g., 100 to 200 milliseconds). Figure 2 It can be clearly seen that the latency budgets for different audio link types differ significantly. This application can accurately quantify the actual time urgency of each link at any given moment by calculating the remaining latency budget for each audio data packet.

[0043] In some embodiments, the required processing time may include wireless reception or transmission time. Wireless reception or transmission time refers to the over-the-air transmission time required for audio data packets to be received or transmitted at the Bluetooth RF physical layer. This time is determined by the payload size of the audio data packets and the current Bluetooth PHY rate (such as 1M PHY, 2M PHY, or LE Coded PHY). In a practical application scenario, if the current link uses a 2M PHY for transmission, the wireless transmission time for each audio data packet is approximately several hundred microseconds. This time needs to be deducted from the remaining latency budget in advance to ensure that the scheduler does not misjudge this unavoidable transmission time as idle time available for scheduling.

[0044] In some embodiments, the required processing time may include baseband processing time. Baseband processing time refers to the time required for the Bluetooth baseband controller to perform baseband processing operations such as framing, scrambling, encoding, and interleaving of audio data packets. Different types of audio data packets may have different baseband processing times. For example, the baseband processing flow of LE Audio sync data packets differs from that of classic Bluetooth ACL data packets, and their processing times also differ accordingly.

[0045] In some embodiments, the required processing time may include decoding or encoding time. For a receive-type audio link, decoding time refers to the time required to decode received audio encoded frames (such as SBC, LC3, or CVSD encoded frames) into PCM audio data; for a transmit-type audio link, encoding time refers to the time required to encode PCM audio data into the audio encoding format specified by the Bluetooth protocol. Decoding or encoding time is typically determined by the processing power of the audio codec and the complexity of the audio frame. This time needs to be deducted in advance from the remaining latency budget to ensure that the scheduler does not misjudge the processing time required for decoding or encoding as a time window available for scheduling.

[0046] In some embodiments, the required processing time may include packet loss concealment (PLC) processing time. Packet loss concealment processing time refers to the processing time required for the system to call the packet loss concealment algorithm to generate replacement audio data when an audio data packet is lost or corrupted. Packet loss concealment processing is typically performed after the audio data packet is determined to be lost or corrupted but before audio output, and its time consumption needs to be included in the required processing time. In a practical application scenario, if an audio data packet is about to miss its playback deadline due to untimely scheduling, it is necessary to assess whether the time required to initiate packet loss concealment processing can catch up with the playback output. If it cannot catch up, the audio data packet cannot be played normally even if it is successfully scheduled.

[0047] In some embodiments, the required processing time may include audio DMA transfer time. Audio DMA transfer time refers to the time required to transfer decoded PCM audio data to the FIFO buffer of an audio output device (such as an I2S interface or a digital-to-analog converter) via DMA (Direct Memory Access). DMA transfer time is determined by both the size of the audio data and the DMA transfer rate. This time represents the last mile of audio data transmission from memory to the playback hardware and must be deducted from the remaining latency budget in advance.

[0048] In some embodiments, the required processing time may include a safety margin before audio buffer output. A safety margin is a protective time window reserved to ensure that audio data packets are reliably written to the playback device before the playback deadline. The introduction of a safety margin prevents scheduling timeouts caused by unpredictable factors such as system clock jitter, interrupt response delays, or bus arbitration delays. For example, in one embodiment, the safety margin may be set to a value between 200 microseconds and 1 millisecond, the specific value of which can be configured according to the real-time performance of the on-chip dual Bluetooth system.

[0049] For example, in a practical application scenario, the on-chip dual Bluetooth system acts as the receiver of a gaming headset. It receives a low-latency gaming audio data packet with a playback deadline of 3 milliseconds after the current system time. The required processing time for this audio data packet includes decoding time (0.5 milliseconds), DMA transfer time (0.2 milliseconds), and a safety margin of 0.3 milliseconds. Therefore, the remaining latency budget for this audio data packet is 3 milliseconds - 0.5 milliseconds - 0.2 milliseconds - 0.3 milliseconds = 2.0 milliseconds. This means that the audio data packet has 2.0 milliseconds remaining for the scheduler to schedule and wait. If another A2DP music audio data packet has a playback deadline of 15 milliseconds after the current system time, and the corresponding required processing time is decoding time (0.8 milliseconds), DMA transfer time (0.3 milliseconds), and a safety margin of 0.5 milliseconds, then the remaining latency budget for this A2DP music audio data packet is 15 milliseconds - 0.8 milliseconds - 0.3 milliseconds - 0.5 milliseconds = 13.4 milliseconds. The remaining latency budget of the game audio data packet (2.0 milliseconds) is significantly smaller than that of the A2DP music audio data packet (13.4 milliseconds). Therefore, in the subsequent scheduling arbitration, the game audio data packet will receive a higher scheduling priority, thereby ensuring that the real-time requirements of low-latency game audio are met.

[0050] In this embodiment, by incorporating various processing times such as wireless reception or transmission time, baseband processing time, decoding or encoding time, packet loss concealment processing time, audio DMA transfer time, and safety margin into the calculation of the remaining delay budget, the time window in which audio data packets are truly available for resource arbitration by the scheduler after deducting fixed processing overhead can be accurately reflected. This avoids the scheduler making incorrect decisions due to ignoring these fixed processing times and effectively prevents audio data packets from missing the playback deadline or transmission deadline due to inaccurate scheduling judgment.

[0051] 103. Obtain the link status information of each audio link.

[0052] It should be noted that this link status information reflects the current transmission status, service attributes, data backlog, and link health status of each audio link, and is an important input parameter for generating dynamic scheduling scores.

[0053] Specifically, the link status information can include the link type. Different audio link types correspond to different service attributes. For example, low-latency gaming audio links have strict requirements for end-to-end latency, HFP voice links require high interaction latency and continuity, A2DP music links have a large playback buffer and a higher tolerance for instantaneous scheduling latency, LEAudio broadcast links need to meet periodic reception or transmission time limits, and BLE control links have a small data volume but cannot be blocked for extended periods. Different link types have different basic priority weights in scheduling decisions, and this weight serves as a dimension of the link status information in subsequent dynamic scheduling scoring calculations.

[0054] Optionally, the link status information may also include the link direction. The link direction indicates the data transmission direction of the audio link, including the receiving direction (i.e., the on-chip dual Bluetooth system acts as an audio receiver to receive audio data from peripheral devices) and the transmitting direction (i.e., the on-chip dual Bluetooth system acts as an audio transmitter to send audio data to peripheral devices). The link direction information is used to distinguish between receiving audio links and transmitting audio links, as different types of audio links differ in their buffer depth monitoring and scheduling strategies.

[0055] Optionally, link state information may also include connection period. Connection period refers to the Bluetooth link's connection interval or ISO interval, which determines the link's natural scheduling window in wireless time slots. For example, for a link using a 50-millisecond connection interval, the system has only one time slot opportunity to communicate with the peer device within each 50-millisecond period, and the scheduler needs to complete the scheduling of audio data packet transmission and reception within the available time slot window for that link. Connection period information is of significant reference value for the global time slot scheduling module when generating a time slot plan in conjunction with a unified Bluetooth clock.

[0056] Optionally, the link status information may also include the current buffer depth. The current buffer depth refers to the amount of audio data currently buffered in the audio playback buffer (playback buffer) of a receiving audio link, typically expressed in audio frames or milliseconds. The current buffer depth reflects the playback margin of the audio link—when the buffer depth is sufficient, the link has a higher tolerance for scheduling latency and can appropriately relinquish scheduling opportunities to other more pressing links; when the buffer depth is insufficient, the link faces the risk of playback interruption and needs to obtain scheduling opportunities as soon as possible to replenish the playback buffer.

[0057] Optionally, the link status information may also include the pending transmission queue depth. The pending transmission queue depth refers to the number of audio data packets currently backed up in the pending transmission queue of a transmitting audio link. The pending transmission queue depth reflects the uplink data backlog status of the link—when the pending transmission queue depth is too large and some audio data packets are close to the transmission deadline, the scheduling urgency of the link increases, and priority needs to be given to obtaining scheduling opportunities to send the backlogged data packets out in a timely manner.

[0058] Optionally, link state information may also include packet loss rate. Packet loss rate refers to the proportion of data packets lost during historical transmissions of an audio link. A high packet loss rate indicates that the link is currently in a poor wireless environment, requiring more scheduling opportunities to ensure successful data packet transmission, or requiring retransmission mechanisms to compensate for lost data packets. Packet loss rate information provides a quantitative basis for link quality in scheduling decisions.

[0059] Optionally, the link status information may also include the packet error rate. The packet error rate refers to the proportion of erroneous data packets received by the audio link during historical transmissions. Similar to the packet loss rate, a high packet error rate indicates a deterioration in link quality, requiring the system to allocate additional scheduling resources to that link to meet retransmission demands. In a practical application scenario, when the packet error rate of an audio link exceeds a preset threshold, the system can increase the scheduling priority of that link to avoid audio quality degradation or link timeout due to continuous packet errors.

[0060] Optionally, the link status information may also include retransmission status. Retransmission status indicates whether there are audio data packets on a given audio link that need to be retransmitted, as well as the identifier of the retransmitted data packet and the remaining number of retransmissions. Retransmission status information enables the scheduler to identify which links have incomplete retransmission tasks, thereby prioritizing links with retransmission needs in subsequent dynamic scheduling score generation.

[0061] Optionally, the link status information may also include the remaining keep-alive time. The remaining keep-alive time refers to the time remaining before the audio link times out (Supervision Timeout). When the remaining keep-alive time for a link is short, it indicates that the link will face the risk of disconnection if it continues to receive no scheduling opportunities for an extended period. The remaining keep-alive time information allows the scheduler to increase the link's scheduling priority before it times out, thereby maintaining the link's normal connection state by sending keep-alive packets or link maintenance packets.

[0062] In a practical application scenario, for example, an on-chip dual Bluetooth system used as a gaming headset, the first Bluetooth controller carries the A2DP music link, and the second Bluetooth controller carries the low-latency gaming audio link and the BLE control link. In step 103, the system obtains the link status information of the A2DP music link, including link type A2DP music, link direction receiving, current buffer depth of 120 milliseconds, and packet loss rate of 0.1%; obtains the link status information of the low-latency gaming audio link, including link type low-latency gaming audio, link direction receiving, current buffer depth of 15 milliseconds, and packet loss rate of 0.5%; and obtains the link status information of the BLE control link, including link type BLE control, link direction bidirectional, pending transmission queue depth of 3 data packets, and keep-alive time remaining of 500 milliseconds.

[0063] In this embodiment, by acquiring various link status information such as link type, link direction, connection period, current buffer depth, pending transmission queue depth, packet loss rate, packet error rate, retransmission status, and remaining keep-alive time, the scheduler can comprehensively perceive the current status of each audio link from multiple dimensions such as service attributes, data backlog, link quality, and connection stability. This provides a sufficient data foundation for generating accurate dynamic scheduling scores and avoids the blind spots in status perception caused by relying solely on fixed link priorities for scheduling decisions in traditional solutions.

[0064] 104. Based on link status information and remaining delay budget, generate dynamic scheduling scores for each audio link.

[0065] The dynamic scheduling score is a quantitative indicator used to characterize the priority of each audio link in obtaining scheduling resources within the current scheduling cycle. The higher the score, the more priority the audio link should be scheduled.

[0066] It should be noted that the link status information includes at least one scheduling influencing factor among link type, link direction, connection period, current buffer depth, pending transmission queue depth, packet loss rate, packet error rate, retransmission status, and remaining keep-alive time. In other words, in practical implementation, one or more of these scheduling influencing factors can be selected for dynamic scheduling score calculation based on the actual application scenario and system configuration, rather than using all scheduling influencing factors each time.

[0067] In some embodiments, step 104 may include the following steps: 1041. For each audio link, obtain the actual values ​​of each scheduling influence factor corresponding to the audio link.

[0068] Specifically, the actual values ​​corresponding to the currently configured scheduling impact factors can be extracted from the link status information. For example, if the currently configured scheduling impact factors include link type, current buffer depth, and retransmission status, then the link type identifier (such as A2DP music, low-latency game audio, or HFP voice), the specific value of the current buffer depth (such as 80 milliseconds or 15 milliseconds), and the specific indication of the retransmission status (such as whether there is a retransmission requirement or not) can be obtained for each audio link.

[0069] 1042. According to the preset mapping rules, each actual value is mapped to the corresponding score contribution value.

[0070] Specifically, the actual value of each scheduling impact factor can be converted into a unified score contribution value through a preset mapping rule. The preset mapping rule defines the mapping relationship from the actual value to the score contribution value, enabling different types of scheduling impact factors to be compared and accumulated under the same scale.

[0071] To clearly illustrate how to set the preset mapping rules, this application categorizes the scheduling influence factors into the following types, which are then described in detail. It should be noted that the mapping rule parameters in each of the following categories (such as the specific values ​​of the scoring contribution value, segmentation thresholds, etc.) are merely illustrative examples and can be adjusted according to system configuration and performance requirements in practical applications.

[0072] Category 1: Numerical factors that are positively correlated with time urgency.

[0073] These scheduling factors include remaining latency budget, whether the data packet is close to the playback deadline, and whether the current link is close to the keep-alive deadline. The remaining latency budget is directly expressed in milliseconds or microseconds as the time remaining before the audio data packet's deadline. Whether a data packet is close to the playback deadline can be quantified by the difference between the data packet's playback deadline and the current system time; the smaller the difference, the closer it is to the deadline. Whether the current link is close to the keep-alive deadline can be quantified by the remaining keep-alive time of the link; the shorter the remaining keep-alive time, the closer the link is to timeout and disconnection.

[0074] For this type of scheduling impact factor, the preset mapping rule is set as follows: the smaller the actual value of the scheduling impact factor (i.e., the more urgent the time), the higher the corresponding score contribution value. In other words, there is a negative correlation between the actual value and the score contribution value of this type of scheduling impact factor.

[0075] In one embodiment, for the scheduling influencing factor of remaining delay budget, the preset mapping rule can be set as follows: the smaller the remaining delay budget, the higher the corresponding score contribution value. Specifically, this rule can be implemented using piecewise linear mapping or nonlinear mapping (such as exponential mapping or logarithmic mapping). For example, when the remaining delay budget is greater than 10 milliseconds, the corresponding score contribution value is 0; when the remaining delay budget is between 5 and 10 milliseconds, the corresponding score contribution value is 10; when the remaining delay budget is between 2 and 5 milliseconds, the corresponding score contribution value is 30; and when the remaining delay budget is less than 2 milliseconds, the corresponding score contribution value is 50. Using the above mapping rule, audio data packets with smaller remaining delay budgets contribute more to the dynamic scheduling score, thereby giving higher scheduling priority to audio links approaching their deadline.

[0076] In another embodiment, the scheduling factor of whether a data packet is close to its playback deadline is essentially related to the remaining delay budget. When the difference between the playback deadline of a data packet and the current system time is less than a first preset difference (e.g., 5 milliseconds), it indicates that the data packet is close to its playback deadline, and the corresponding score contribution value can be set to a higher value (e.g., 35 points). When the difference is greater than or equal to the first preset difference, it indicates that the data packet still has a margin before its playback deadline, and the corresponding score contribution value can be set to 0 or a lower value.

[0077] In another embodiment, regarding the scheduling influence factor of whether the current link is close to the keep-alive deadline, when the remaining keep-alive time of the link is less than the first keep-alive threshold (e.g., 500 milliseconds), it indicates that the link is close to timeout and disconnection, and the corresponding score contribution value can be set to a higher value (e.g., 30 points) to encourage the link to obtain a scheduling opportunity to send a keep-alive packet; when the remaining keep-alive time is greater than or equal to the first keep-alive threshold, the corresponding score contribution value can be set to 0.

[0078] The second category: Identifying factors based on business attributes.

[0079] These scheduling influencing factors include audio link type, whether it is a voice interaction service, whether it is ordinary backend data, and whether the current link is in low-latency mode. These scheduling influencing factors are discrete or enumerated variables, and their actual values ​​are category identifiers rather than continuous numerical values.

[0080] For this type of scheduling impact factor, the preset mapping rule is set as follows: different category identifiers correspond to different preset score contribution values. The preset score contribution value corresponding to each category identifier can be configured according to the sensitivity of the service type to scheduling latency.

[0081] In one embodiment, for the scheduling influence factor of audio link type, different link types correspond to different base score contribution values. Low-latency game audio links and HFP voice links are more sensitive to latency and can be set to a higher score contribution value (e.g., 40 points); LE Audio unicast audio links are also more sensitive to latency and can be set to a second-highest score contribution value (e.g., 30 points); LE Audio broadcast or synchronous audio links need to meet synchronization deadline constraints and can be set to a medium-high score contribution value (e.g., 25 points); A2DP music links have a relatively high tolerance for instantaneous scheduling latency due to their large playback buffer and can be set to a medium score contribution value (e.g., 20 points); BLE control links have a small data volume but require a certain level of response timeliness and can be set to a lower score contribution value (e.g., 10 points); ordinary data links are not sensitive to latency and can be set to an even lower score contribution value (e.g., 5 points); link maintenance or keep-alive links only need to be prioritized when approaching timeout, and their base score contribution value can be set to the lowest value (e.g., 0 points). When the remaining keep-alive time is short, the priority is increased through the keep-alive related mapping in the first type of scheduling influence factor.

[0082] In another embodiment, for the scheduling influence factor of whether it is a voice interaction service, when the actual value of the scheduling influence factor is "yes" (i.e., it is a voice interaction service), the corresponding score contribution value can be set to a higher value (such as 35 points) to reflect the dual requirements of low latency and high continuity for the voice interaction service; when the actual value of the scheduling influence factor is "no", the corresponding score contribution value can be set to 0.

[0083] In another embodiment, for the scheduling influence factor of whether the current link is in low-latency mode, when the actual value of the scheduling influence factor is "yes" (i.e. the current link is in low-latency mode), the corresponding score contribution value can be set to a higher value (e.g., 30 points) to reflect the urgent need for scheduling slots in low-latency mode; when the actual value of the scheduling influence factor is "no", the corresponding score contribution value can be set to 0.

[0084] In another embodiment, for the scheduling influence factor of whether it is ordinary background data, when the actual value of the scheduling influence factor is "yes" (i.e., ordinary background data), the corresponding score contribution value can be set to a negative number (such as -10 points) to reduce the contribution of this type of data to the scheduling priority and avoid background data crowding out the scheduling time slots required by the audio service; when the actual value of the scheduling influence factor is "no", the corresponding score contribution value can be set to 0.

[0085] The third category: numerical factors that reflect the state of link buffering and data backlog.

[0086] These scheduling factors include the current buffer depth and the pending transmission queue depth. The current buffer depth reflects the amount of audio data buffered in the playback buffer of the receiving audio link, while the pending transmission queue depth reflects the number of data packets backlogged in the pending transmission queue of the transmitting audio link.

[0087] For this type of scheduling influencing factor, the preset mapping rules differ depending on the link direction. For receiving audio links, the lower the current buffer depth, the closer the playback buffer is to exhaustion, and the higher the risk of playback interruption. Therefore, the corresponding score contribution value should be higher, meaning there is a negative correlation between the current buffer depth and the score contribution value. For transmitting audio links, the larger the waiting queue depth and the closer some data packets are to their deadline, the more urgent the backlog of data packets needs to be sent. Therefore, the corresponding score contribution value should be higher, meaning there is a positive correlation between the waiting queue depth and the score contribution value after exceeding a threshold.

[0088] In one embodiment, regarding the scheduling influencing factor of the current cache depth, when the cache depth is greater than 100 milliseconds, the corresponding score contribution value is 0, indicating that the cache is sufficient and there is no need to urgently replenish the cache by increasing the scheduling score; when the cache depth is between 50 milliseconds and 100 milliseconds, the corresponding score contribution value is 10, indicating that the cache is at the lower limit of the normal range and needs appropriate attention; when the cache depth is between 20 milliseconds and 50 milliseconds, the corresponding score contribution value is 25, indicating that the cache is low and the scheduling priority needs to be increased to replenish the cache; when the cache depth is less than 20 milliseconds, the corresponding score contribution value is 45, indicating that the cache is severely insufficient and emergency scheduling is required to replenish the cache.

[0089] In another embodiment, regarding the scheduling influence factor of the queue depth to be sent, when the queue depth to be sent is less than or equal to a preset queue threshold (e.g., 3 data packets), the corresponding score contribution value is 0, indicating that the queue backlog is not serious and there is no need to increase the scheduling priority due to the queue backlog; when the queue depth to be sent is greater than the preset queue threshold and the remaining time indicated by the deadline information of some audio data packets is less than a preset time threshold (e.g., 10 milliseconds), the corresponding score contribution value can be set to a higher value (e.g., 25 points) to encourage the backlogged data packets to be sent out in a timely manner.

[0090] The fourth category: numerical factors that reflect link quality.

[0091] These scheduling factors include packet loss rate and packet error rate. Packet loss rate refers to the proportion of data packets lost during historical transmissions of the audio link, while packet error rate refers to the proportion of erroneous data packets received during historical transmissions of the audio link. These two scheduling factors reflect the current wireless transmission quality of the audio link.

[0092] For this type of scheduling impact factor, the preset mapping rule is set as follows: the higher the actual value of the scheduling impact factor (i.e., the worse the link quality), the higher the corresponding score contribution value. In other words, there is a positive correlation between the actual value and the score contribution value of this type of scheduling impact factor.

[0093] In one embodiment, regarding the packet loss rate as a scheduling influencing factor, when the packet loss rate is less than 1%, the corresponding score contribution value is 0, indicating that the link quality is good and there is no need to increase the scheduling priority due to packet loss; when the packet loss rate is between 1% and 5%, the corresponding score contribution value is 10, indicating that the link quality is average and retransmission needs need to be addressed appropriately; when the packet loss rate is between 5% and 10%, the corresponding score contribution value is 20, indicating that the link quality is poor and the scheduling priority needs to be increased to support retransmission; when the packet loss rate is greater than 10%, the corresponding score contribution value is 35, indicating that the link quality is very poor and the scheduling priority needs to be significantly increased to compensate for packet loss.

[0094] In another embodiment, regarding the packet error rate as a scheduling influencing factor, the corresponding score contribution value is 0 when the packet error rate is less than 2%; 15 when the packet error rate is between 2% and 8%; and 30 when the packet error rate is greater than 8%. Links with higher packet error rates require more scheduling opportunities to ensure correct packet reception; therefore, increasing the score contribution value increases the likelihood of them obtaining scheduling opportunities.

[0095] The fifth category: Boolean factors that reflect retransmission requirements.

[0096] This type of scheduling influencing factor includes whether there is a retransmission requirement. This scheduling influencing factor is a Boolean variable, and its actual value is either "there is a retransmission requirement" or "there is no retransmission requirement".

[0097] For this type of scheduling influence factor, the preset mapping rule is set as follows: when the link status information indicates that there are audio data packets that need to be retransmitted, the corresponding score contribution value is a preset positive number (such as 20 points) to reflect the urgent requirement of retransmission demand on scheduling time slots; when there are no audio data packets that need to be retransmitted, the corresponding score contribution value is 0.

[0098] In one embodiment, regarding the scheduling influence factor of whether a retransmission requirement exists, when the system detects that an audio link has audio data packets that need to be retransmitted, it sets the score contribution value corresponding to this scheduling influence factor to 20 points, so that the link receives an additional priority bonus in the synthesis of dynamic scheduling scores. This bonus can be superimposed with the bonus of the fourth type of scheduling influence factor (packet loss rate, packet error rate)—when a link has both a high packet loss rate and data packets to be retransmitted, the two types of scheduling influence factors contribute score values ​​respectively, jointly improving the dynamic scheduling score of the link.

[0099] It should be noted that, in the specific implementation process, the system can select one or more scheduling influencing factors from the above five categories to participate in the calculation of dynamic scheduling scores, based on the actual application scenario and system configuration. For example, in low-latency game audio scenarios, the system can mainly configure the first category of scheduling influencing factors (remaining latency budget, whether the data packet is close to the playback deadline) and the second category of scheduling influencing factors (audio link type) to highlight the weight of time urgency and business sensitivity; in voice call scenarios in weak signal environments, the system can mainly configure the fourth category of scheduling influencing factors (packet loss rate, packet error rate) and the fifth category of scheduling influencing factors (whether there is a retransmission requirement) to highlight the weight of link quality and retransmission requirements; in comprehensive scenarios that need to take into account multiple services, the system can configure all categories of scheduling influencing factors to achieve multi-dimensional scheduling decisions.

[0100] In this embodiment, scheduling influencing factors are divided into five categories: numerical scheduling influencing factors positively correlated with time urgency, identifier-based scheduling influencing factors based on service attributes, numerical scheduling influencing factors reflecting link buffering and data backlog status, numerical scheduling influencing factors reflecting link quality, and Boolean scheduling influencing factors reflecting retransmission requirements. Corresponding preset mapping rules are set for the characteristics of each category, so that link status information of different types, dimensions, and properties can be uniformly converted into scoring contribution values. This allows for comparison and accumulation under a unified scoring framework, achieving efficient and accurate conversion from multidimensional heterogeneous status information to single-dimensional scheduling priority.

[0101] 1043. If an audio link corresponds to multiple scheduling influence factors, the weighted sum or accumulation of each score contribution value is used to generate a dynamic scheduling score for each audio link; if an audio link corresponds to only one scheduling influence factor, its corresponding score contribution value is used as the dynamic scheduling score.

[0102] When an audio link corresponds to multiple scheduling influencing factors, the score contributions of each factor can be combined into a comprehensive score through weighted summation or accumulation. Weighted summation involves assigning a weight coefficient to each scheduling influencing factor, multiplying each score contribution by its corresponding weight coefficient, and then summing the results. The weight settings can be adjusted according to the emphasis of different application scenarios.

[0103] For example, in gaming headset scenarios, higher weighting coefficients can be assigned to the remaining latency budget and current cache depth to highlight the need for low latency guarantees and anti-dropout requirements; in conferencing system scenarios, higher weighting coefficients can be assigned to the retransmission status and remaining keep-alive time to highlight the need for voice continuity and connection stability. Accumulation refers to directly adding the contribution values ​​of each score without weighting, suitable for scenarios where the importance of each scheduling influencing factor is similar.

[0104] When an audio link corresponds to only one scheduling influence factor, there is no need to perform weighted summation or accumulation; the score contribution value corresponding to that factor can be directly used as the dynamic scheduling score.

[0105] For example, in a real-world application scenario, the on-chip dual Bluetooth system is used as a gaming headset, configured with three scheduling factors: remaining latency budget, link type, and current cache depth. For the low-latency gaming audio link, its remaining latency budget is 2.0 milliseconds, corresponding to a score contribution of 50; the link type is low-latency gaming audio, corresponding to a score contribution of 40; and the current cache depth is 15 milliseconds, corresponding to a score contribution of 45. The system generates a dynamic scheduling score using an additive method, so the dynamic scheduling score for this low-latency gaming audio link is 50 + 40 + 45 = 135. For the A2DP music link, its remaining latency budget is 13.4 milliseconds, corresponding to a score contribution of 0; the link type is A2DP music, corresponding to a score contribution of 20; and the current cache depth is 120 milliseconds, corresponding to a score contribution of 0. The dynamic scheduling score for this A2DP music link is 0 + 20 + 0 = 20. Therefore, in subsequent scheduling arbitration, the low-latency gaming audio link (score 135) will receive scheduling resources before the A2DP music link (score 20). The above scheduling results perfectly match the real-time requirements for low-latency audio in gaming headset scenarios.

[0106] In this embodiment, the actual values ​​of each scheduling influence factor are uniformly mapped to the score contribution value by setting a preset mapping rule, and a dynamic scheduling score is synthesized by weighted summation or accumulation. This enables link status information of different types and dimensions to be compared and arbitrated under a unified scoring framework, achieving efficient conversion from multi-dimensional status information to single-dimensional scheduling priority.

[0107] In some embodiments, to further optimize the accuracy of scheduling decisions, after generating dynamic scheduling scores for each audio link, one or more of the following embodiments may be included. It should be noted that the following embodiments can be used independently or in any combination depending on the actual application scenario.

[0108] The first method: caching depth-aware implementation.

[0109] After generating dynamic scheduling scores for each audio link, a cache depth awareness step can be included. By adjusting the dynamic scheduling scores based on the cache depth status of each audio link, audio links with insufficient cache can be given higher scheduling priority.

[0110] First, the current buffer depth of each audio link can be obtained. For receiving audio links, if the current buffer depth is below a first threshold, the dynamic scheduling score is increased by a first magnitude; if the current buffer depth is below a second threshold, the dynamic scheduling score is increased by a second magnitude, where the second threshold is less than the first threshold and the second magnitude is greater than the first magnitude. For transmitting audio links, if the backlog of audio data packets to be transmitted exceeds a preset threshold and the remaining time indicated by the deadline information of some audio data packets is less than a preset time threshold, the dynamic scheduling score is increased by a third magnitude.

[0111] In some embodiments, the first amplitude value can be set to 10 points to indicate that when the buffer depth of the receiving audio link is below a first threshold, the scheduling priority needs to be moderately increased. The second amplitude value can be set to 25 points, which is greater than the first amplitude value, to indicate that when the buffer depth of the receiving audio link is below a second threshold, the scheduling priority needs to be significantly increased to cope with the emergency situation where the playback buffer is about to run out. The third amplitude value can be set to 20 points to indicate that when there is a backlog of audio data packets to be sent on the transmitting audio link and some data packets are close to the transmission deadline, the scheduling priority needs to be increased.

[0112] It should be noted that the first and second thresholds are pre-set buffer depth thresholds. The first threshold can be set to a medium buffer depth threshold, such as 50 milliseconds or 5 audio frames. When the buffer depth falls below this first threshold, it indicates that the playback buffer of the receiving audio link is being consumed, posing a potential risk of playback interruption. In this case, the dynamic scheduling score needs to be increased to enhance its chances of receiving a scheduling opportunity. The second threshold is smaller than the first threshold and can be set to a low buffer depth threshold, such as 15 milliseconds or 2 audio frames. When the buffer depth falls below this second threshold, it indicates that the receiving audio link is in an emergency state where the playback buffer is about to run out, requiring a higher priority to receive a scheduling opportunity to replenish the playback buffer. By setting a two-tiered buffer depth warning mechanism with first and second thresholds, the system can apply different scheduling priority increases when the buffer depth drops to different dangerous levels, achieving a multi-level response from warning to emergency.

[0113] For example, in a practical application scenario, the on-chip dual Bluetooth system acts as a Bluetooth headset. The first Bluetooth controller carries the A2DP music link (receiving audio link), and the second Bluetooth controller carries the low-latency gaming audio link (receiving audio link). Step 104 generates a dynamic scheduling score of 135 for the low-latency gaming audio link and 20 for the A2DP music link. In the cache depth-aware implementation, the system detects that the current cache depth of the low-latency gaming audio link is 12 milliseconds, lower than the second threshold (15 milliseconds). Therefore, the dynamic scheduling score of this audio link is increased by a second magnitude (e.g., 30 points), resulting in a corrected dynamic scheduling score of 165. The system detects that the current cache depth of the A2DP music link is 120 milliseconds, higher than the first threshold (50 milliseconds), and no correction is made; the dynamic scheduling score remains at 20. This cache depth-aware correction further strengthens the priority advantage of the low-latency gaming audio link, ensuring that this audio link receives the highest priority scheduling guarantee in a cache depth emergency situation.

[0114] The second method: Retransmission window-aware implementation.

[0115] After generating the dynamic scheduling score for each audio link, the process also includes a step of correcting the dynamic scheduling score based on the retransmission status: When the link status information indicates that an audio data packet needs to be retransmitted on a certain audio link, the remaining delay budget for that retransmitted audio data packet is obtained. It is then determined whether the remaining delay budget is greater than the estimated time required to retransmit the audio data packet. If so, the audio data packet is determined to be within the valid retransmission window, and the dynamic scheduling score is increased by a fourth increment. If not, the audio data packet is determined to be outside the valid retransmission window, the retransmission opportunity for that audio data packet is abandoned, and the dynamic scheduling score is neither increased nor decreased.

[0116] In some embodiments, the fourth amplitude value can be set to 20 points to indicate that when there are audio packets within the valid retransmission window, the scheduling priority needs to be increased to ensure that the retransmission packets can be successfully received before the deadline.

[0117] It should be noted that the estimated time required to retransmit the audio data packet can include the time required for the audio data packet to travel in the air (determined by the audio data packet size and physical layer rate) and the time required for the receiving end to provide confirmation. By determining whether the remaining delay budget is greater than the estimated time required for retransmission, the system can accurately assess whether the retransmitted audio data packet still has a chance of being successfully received before the deadline.

[0118] For example, in a real-world application scenario, an on-chip dual Bluetooth system is used as a gaming headset. An audio data packet on the low-latency gaming audio link fails during the initial transmission and needs to be retransmitted. The remaining latency budget for this audio data packet is 3.0 milliseconds, and the estimated time required to retransmit it is 0.8 milliseconds. The system determines that 3.0 milliseconds is greater than 0.8 milliseconds, classifying the audio data packet as being within a valid retransmission window, and increases the dynamic scheduling score of the low-latency gaming audio link by a fourth increment (e.g., 20 points). With this correction, the low-latency gaming audio link receives higher priority in the next scheduling cycle, the retransmission operation is executed promptly, and the audio data packet is successfully received before the playback deadline.

[0119] The third method: Implementation of filtering expired audio data packets.

[0120] After generating dynamic scheduling scores for each audio link, and before determining the target audio data packet for current priority scheduling based on the dynamic scheduling scores, an expired audio data packet filtering step may be included: traversing the deadline information of audio data packets in each audio link. If the deadline information of an audio data packet indicates a deadline later than the current system time, the audio data packet is determined to be expired. For expired audio data packets, they are either removed from the scheduling queue or their dynamic scheduling scores are set to the lowest value, preventing them from participating in the arbitration of the current scheduling cycle.

[0121] It should be noted that "deadline later than current system time" means that the deadline has already passed, i.e., the deadline is less than the current system time. By removing expired audio data packets from the scheduling queue or setting their dynamic scheduling score to the lowest value, the system ensures that expired audio data packets do not participate in the arbitration of the current scheduling cycle, thus preventing the scheduler from allocating time slot resources to audio data packets that can no longer be played or sent normally.

[0122] For example, in a dual-Bluetooth system used as a Bluetooth speaker, the A2DP music link's scheduling queue contains 10 audio data packets. The system iterates through these audio data packets and finds that audio data packet D's playback deadline is 2 milliseconds before the current system time (i.e., expired 2 milliseconds ago), and audio data packet E's playback deadline is 1 millisecond before the current system time (i.e., expired 1 millisecond ago). The deadlines of the remaining 8 audio data packets are all in the future. The system removes audio data packets D and E from the scheduling queue or sets their dynamic scheduling score to the lowest value. In subsequent scheduling arbitration, only the remaining 8 valid audio data packets participate in the arbitration, preventing the scheduler from allocating time slot resources to the expired audio data packets D and E.

[0123] The fourth method: Implementation of anti-starvation treatment.

[0124] After generating dynamic scheduling scores for each audio link, a starvation prevention step can be included to correct the dynamic scheduling scores based on the duration of continuous unscheduled operation: The duration of continuous unscheduled operation for each audio link is obtained. If the duration of continuous unscheduled operation for a certain audio link exceeds a preset aging time threshold, the dynamic scheduling score is gradually increased by accumulating an aging coefficient. When the audio link is successfully scheduled, its duration of continuous unscheduled operation is reset to zero, and the aging coefficient is reset to its initial value.

[0125] It should be noted that the continuous unscheduled duration refers to the length of time elapsed from the last time an audio link received a scheduling opportunity to the current time. The system maintains a timer for each audio link, which is reset to zero when the audio link is successfully scheduled and continuously incremented when the audio link is not scheduled. The aging coefficient is a score value that increases over time, and its increment rate can be fixed (e.g., 0.1 points per millisecond) or non-linear (e.g., the aging coefficient increases rapidly as the unscheduled duration increases). Through the accumulation of the aging coefficient, even audio links with low priority will gradually increase their dynamic scheduling score when they are not scheduled for a long time, until they surpass other audio links and receive a scheduling opportunity. When an audio link is successfully scheduled, the system resets its continuous unscheduled duration to zero and resets the aging coefficient to its initial value (e.g., 0). The audio link restarts its timer, and will not trigger anti-starvation processing again until the next continuous unscheduled duration exceeds the preset aging time threshold.

[0126] For example, in a dual Bluetooth system serving as a wireless audio hub, the first Bluetooth controller carries the A2DP music link and the HFP voice link, while the second Bluetooth controller carries the BLE control link. The BLE control link transmits device control signals (such as volume adjustment, play / pause, etc.), which involve small amounts of data but require timely response. In fixed priority mode, the BLE control link may not receive scheduling opportunities for extended periods while the A2DP music link and HFP voice link remain active. In this embodiment, the system detects that the continuous unscheduled duration of the BLE control link has reached 800 milliseconds, exceeding the preset aging time threshold (500 milliseconds), and begins to gradually increase the dynamic scheduling score of the BLE control link by accumulating an aging coefficient. When the dynamic scheduling score of the BLE control link exceeds that of the A2DP music link, the BLE control link receives a scheduling opportunity in the next scheduling cycle, its pending control signals are successfully transmitted, and its continuous unscheduled duration is reset to zero, with the aging coefficient set to 0.

[0127] 105. Based on the dynamic scheduling score, determine the target Bluetooth controller to be scheduled first from the two Bluetooth controllers, and determine the target audio link and target audio data packet to be scheduled first from the audio link carried by the target Bluetooth controller, and generate the corresponding scheduling result.

[0128] like Figure 3 As shown, in a dual Bluetooth system, two Bluetooth controllers each support multiple audio links. The dynamic scheduling score of each link changes dynamically over time. For example, link C has the highest score at time t1 due to its low remaining latency budget, but its score decreases at time t2 as its buffer depth is replenished. Link A's score increases at time t3 because its continuous unscheduled time exceeds the aging threshold. The system compares the dynamic scheduling scores of each link in each scheduling cycle and selects the link with the highest score as the target audio link. Figure 3 The paper demonstrates the dynamic change trend of the priorities of different links over time, reflecting the adaptive scheduling capability of the method described in this application in a dynamic environment.

[0129] Specifically, step 105 may include the following steps: 1051. Sort the dynamic scheduling scores, select the audio link with the highest score as the target audio link, and select the Bluetooth controller to which it belongs as the target Bluetooth controller.

[0130] In this embodiment, the dynamic scheduling scores of all audio links on the two Bluetooth controllers are sorted in descending order, and the audio link with the highest score is selected as the target audio link. The Bluetooth controller to which this target audio link belongs is determined as the target Bluetooth controller. Through this method, the audio link with the highest dynamic scheduling score and its corresponding Bluetooth controller are selected as the targets that will have priority in obtaining scheduling resources during the current scheduling period.

[0131] It should be noted that when multiple audio links have the same dynamic scheduling score, the audio link with the smallest remaining latency budget can be prioritized as the target audio link, and its corresponding Bluetooth controller can be designated as the target Bluetooth controller. This priority rule is based on the following considerations: the audio link with the smallest remaining latency budget means that there are audio data packets on that link that are closest to the deadline, and its time urgency is higher than other links with the same score, so it should be given priority in scheduling.

[0132] For example, the first Bluetooth controller carries the A2DP music link (dynamic scheduling score of 20) and the HFP voice link (dynamic scheduling score of 85), while the second Bluetooth controller carries the low-latency gaming audio link (dynamic scheduling score of 135) and the BLE control link (dynamic scheduling score of 10). The system ranks the scores of each link, and the low-latency gaming audio link has the highest score (135), so it is identified as the target audio link, and the second Bluetooth controller is identified as the target Bluetooth controller. In the next scheduling cycle, the system will prioritize using the time slot resources of the second Bluetooth controller to send or receive audio data packets for the low-latency gaming audio link.

[0133] For example, the first Bluetooth controller carries the A2DP music link (dynamic scheduling score of 20), and the second Bluetooth controller carries the BLE control link (dynamic scheduling score of 5). In this case, the A2DP music link has a relatively high score and is identified as the target audio link, and the first Bluetooth controller is identified as the target Bluetooth controller. This ensures that, in a stable wireless environment and without the need for urgent support of low-latency services, mainstream A2DP music playback services can obtain sufficient scheduling resources.

[0134] 1052. In the target audio link, sort the audio data packets according to the remaining delay budget, and select the audio data packet with the smallest remaining delay budget as the target audio data packet.

[0135] In this embodiment, after determining the target audio link, the audio data packets to be sent or received can be further sorted in ascending order according to their remaining delay budget in the scheduling queue of the target audio link, and the audio data packet with the smallest remaining delay budget can be selected as the target audio data packet. That is, within the same target audio link, the audio data packet that is closest to the deadline and most urgent is scheduled first.

[0136] When multiple audio data packets with the same remaining delay budget exist in the target audio link, they can be selected according to their order in the scheduling queue. For example, the audio data packet that enters the queue first can be selected as the target audio data packet, or a preset intra-link scheduling strategy (such as polling, looping, etc.) can be used for selection.

[0137] It should be noted that, in actual implementation, before step 1052, a validity check can be performed on each audio data packet in the target audio link. If the remaining delay budget of an audio data packet is less than zero (i.e., it has expired), it will be removed from the scheduling queue and will not participate in subsequent sorting and selection. The specific implementation method of this validity check will be explained in detail in subsequent steps.

[0138] For example, the target audio link is a low-latency game audio link, and its scheduling queue contains three audio data packets: audio data packet A has a remaining latency budget of 2.0 milliseconds, audio data packet B has a remaining latency budget of 3.5 milliseconds, and audio data packet C has a remaining latency budget of 5.0 milliseconds. The system sorts them in ascending order according to their remaining latency budgets and selects audio data packet A, which has the smallest remaining latency budget, as the target audio data packet. Once audio data packet A is successfully scheduled, in the next scheduling cycle, audio data packet B can be selected as the target audio data packet, and so on.

[0139] For example, the target audio link is an HFP voice link, and its scheduling queue contains three audio data packets: voice packet X has a remaining latency budget of 8.0 milliseconds, voice packet Y has a remaining latency budget of 8.0 milliseconds, and voice packet Z has a remaining latency budget of 8.0 milliseconds. Since the three audio data packets have the same remaining latency budget, the voice packet X, which entered the queue first, can be selected as the target audio data packet according to the order in which the three audio data packets are arranged in the scheduling queue.

[0140] In this embodiment, by first selecting the target Bluetooth controller and target audio link based on dynamic scheduling scores, and then selecting the most urgent audio data packet from the target audio link as the target audio data packet based on the remaining latency budget, a two-level fine-grained scheduling is achieved, from multi-link contention arbitration to data packet sorting within the same link. This ensures fair competition between different links based on comprehensive urgency, and also guarantees first-in-first-out and urgency priority among different data packets within the same link. Furthermore, by prioritizing the audio link with the smallest remaining latency budget when multiple audio links have the same dynamic scheduling score, it ensures that the link with the highest time urgency receives priority scheduling opportunities when scores are identical.

[0141] In this embodiment, a corresponding scheduling result can also be generated based on the above-described determination. This scheduling result includes the core information of this scheduling decision, which is provided to the subsequent global time slot scheduling module to generate the final time slot plan.

[0142] In some embodiments, the scheduling result may include the identifier of the Bluetooth controller that should be prioritized for scheduling, for example, the identifier indicating whether the time slot resources of the first or second Bluetooth controller should be used in this scheduling. Optionally, the scheduling result may include the identifier of the audio link that should be prioritized for scheduling, for example, the identifier indicating which audio link this scheduling is specifically for. Optionally, the scheduling result may include the identifier of the data packet queue that should be sent or received, for example, the identifier indicating from which queue to retrieve data packets for sending or receiving in this scheduling. Optionally, the scheduling result may include indication information on whether to allow the postponement of a certain link, for example, the indication information informing the global time slot scheduling module whether the current scheduling task can be postponed when the current time slot conflicts with other links. Optionally, the scheduling result may include indication information on whether to discard expired data packets, for example, the indication information informing the global time slot scheduling module how to handle expired data packets when the scheduling is performed. Optionally, the scheduling result may include indication information on whether to increase the priority of the retransmission window, for example, the indication information informing the global time slot scheduling module whether the currently scheduled data packet is a retransmission packet and whether it should be allocated higher priority time slot resources. Optionally, the scheduling result may include indication information on whether a global time slot scheduling update is triggered. For example, the indication information may be used to inform the global time slot scheduling module whether it needs to recalculate the global time slot plan based on the current scheduling decision.

[0143] By generating scheduling results containing the above-mentioned multiple indication information, sufficient scheduling instruction information can be provided for the execution of the global time slot scheduling module, enabling the business layer scheduling decisions to be accurately understood and executed by the underlying time slot scheduling module, thus achieving decoupling between the business layer and the underlying scheduling.

[0144] 106. Output the scheduling results to the global time slot scheduling module to generate the corresponding dual Bluetooth time slot plan.

[0145] The global time slot scheduling module is the underlying module responsible for managing the time slot resources of the two Bluetooth controllers in the on-chip dual Bluetooth system. Its functions include unified management of Bluetooth clock, coordination of the transmit and receive time slots of the two Bluetooth controllers to avoid conflicts, and handling dual Bluetooth concurrency constraints.

[0146] Specifically, after receiving the scheduling result, the global time slot scheduling module can generate a specific dual Bluetooth time slot plan based on the unified Bluetooth clock, the current status of the two Bluetooth controllers, and the dual Bluetooth concurrency constraints, combined with the target Bluetooth controller identifier, target audio link identifier, target audio data packet identifier, indications of whether delay is allowed, indications of whether to discard expired data packets, indications of whether to increase the retransmission window priority, and indications of whether to trigger a global time slot scheduling update carried in the scheduling result. This dual Bluetooth time slot plan specifies at which specific time point, which Bluetooth controller will be used, and what type of transmit and receive operations will be performed.

[0147] In this embodiment, when the global time slot scheduling module generates a dual Bluetooth time slot plan, it first needs to identify whether the target Bluetooth controller is available in the current time slot based on the unified Bluetooth clock. The unified Bluetooth clock is the master clock reference of the on-chip dual Bluetooth system, and all transmit and receive operations of the two Bluetooth controllers are referenced to this unified clock. If the target Bluetooth controller is currently available (i.e., the controller is not currently performing other transmit and receive operations, and the current time slot is within the available time slot range of the controller), the global time slot scheduling module will schedule the transmit and receive operations of the target audio data packets in the next available time slot. If the target Bluetooth controller is currently unavailable (e.g., the controller is performing transmit and receive operations on other high-priority links, or the current time slot is a dedicated time slot for another Bluetooth controller), the global time slot scheduling module will suspend the scheduling instruction and execute the scheduling instruction in the first time slot after the Bluetooth controller becomes available again.

[0148] During the generation of the dual Bluetooth time slot plan by the global time slot scheduling module, the radio frequency (RF) conflict constraints between the two Bluetooth controllers also need to be considered. Specifically, when the first and second Bluetooth controllers coexist within a single chip, the two controllers may share a radio frequency (RF) front-end or each have its own independent RF front-end. In either case, the transmit and receive operations of the two controllers cannot overlap in time; otherwise, RF signal conflicts will occur. The global time slot scheduling module coordinates the transmit and receive time slots of the two controllers through a unified Bluetooth clock, ensuring that at any given time, only one Bluetooth controller occupies RF resources for transmit and receive operations. When the target Bluetooth controller is determined to be the first Bluetooth controller, the global time slot scheduling module checks whether the first Bluetooth controller's scheduled transmit and receive operations overlap with the second Bluetooth controller's scheduled transmit and receive operations in the current time slot. If an overlap exists, time slot arbitration is performed based on the priority information in the scheduling result.

[0149] For example, in a gaming headset called Dongle, the on-chip dual Bluetooth system carries the A2DP music downlink, while the second Bluetooth controller carries the low-latency gaming audio uplink and BLE control link. Within a scheduling cycle, step 105 determines the target Bluetooth controller as the second Bluetooth controller, the target audio link as the low-latency gaming audio link, and the target audio data packet as uplink voice data packet A. Step 106 outputs the scheduling result to the global time slot scheduling module. The global time slot scheduling module checks the current state of the second Bluetooth controller according to the unified Bluetooth clock, finding that the second Bluetooth controller is currently idle and that the current time slot does not overlap with the scheduled transmit / receive operation of the first Bluetooth controller. Therefore, it schedules the second Bluetooth controller to send uplink voice data packet A in the next available time slot. Simultaneously, based on the "whether to increase retransmission window priority" indication carried in the scheduling result, the global time slot scheduling module determines that the uplink voice data packet A is a retransmission packet and assigns it a higher time slot priority than ordinary data packets, ensuring that the retransmission packet can be successfully sent within the retransmission window.

[0150] In this embodiment, the decoupling of audio service layer and physical layer time slot scheduling is achieved by outputting the service layer scheduling decision (generated by steps 101 to 105) to the underlying global time slot scheduling module (executed by step 106). The service layer is responsible for making the decision of "what to schedule" based on the time urgency of audio data packets and link status, while the underlying time slot module is responsible for executing the arrangement of "when to schedule" based on Bluetooth clock and radio frequency constraints. This two-layer architecture allows the system to add new audio service types or adjust scheduling strategies by only modifying the dynamic scheduling scoring logic of the service layer, without changing the underlying time slot scheduling module, significantly improving the system's scalability and maintainability.

[0151] In summary, the audio link latency budget-aware scheduling method provided in this application obtains the deadline information of audio data packets in each audio link on two Bluetooth controllers, and calculates the remaining latency budget of each audio data packet based on the current system time, deadline information, and required processing time. This enables the scheduler to accurately perceive the time urgency of each audio data packet at the granular level. Furthermore, by obtaining the link status information of each audio link and generating a dynamic scheduling score for each audio link based on the link status information and remaining latency budget, the method quantifies multi-dimensional status information such as audio link type, current buffer depth, retransmission status, packet loss rate, and remaining keep-alive time into a comparable scheduling score, achieving a dynamic priority conversion from fixed link priority to comprehensive multi-dimensional information. Furthermore, based on the dynamic scheduling score, the target Bluetooth controller for current priority scheduling is determined from the two Bluetooth controllers. Then, the target audio link and target audio data packets for current priority scheduling are determined from the audio links carried by the target Bluetooth controller, generating corresponding scheduling results. This achieves two-level fine-grained scheduling, from multi-link contention arbitration to data packet sorting within the same link. Simultaneously, by prioritizing the audio link with the smallest remaining latency budget when multiple audio links have the same dynamic scheduling score, it ensures that the audio link with the highest time urgency receives priority scheduling opportunities. Finally, the scheduling results are output to the global time slot scheduling module to generate the corresponding dual Bluetooth time slot plan, achieving decoupling between the audio service layer and the underlying time slot scheduling.

[0152] Furthermore, after generating dynamic scheduling scores for each audio link, the scores can be corrected using a buffer depth-aware implementation. For receiving audio links, a first amplitude value is increased when the current buffer depth is below a first threshold, and a second amplitude value is increased when the current buffer depth is below a second threshold, with the second amplitude value being greater than the first amplitude value. For transmitting audio links, a third amplitude value is increased when the backlog of audio data packets to be transmitted exceeds a preset threshold and the remaining time indicated by the deadline information of some audio data packets is less than a preset time threshold, thus achieving multi-level responses when the buffer depth drops to different levels of danger. The dynamic scheduling scores can also be corrected using a retransmission window-aware implementation. A fourth amplitude value is increased when there are audio data packets that need to be retransmitted and their remaining delay budget is greater than the estimated time required for retransmission; and the retransmission opportunity is abandoned when the remaining delay budget is not greater than the estimated time required for retransmission, avoiding the waste of time slot resources due to invalid retransmissions. Alternatively, an expired audio data packet filtering implementation can be used. Expired audio data packets can be removed from the scheduling queue or their dynamic scheduling score can be set to the lowest value, preventing them from participating in the arbitration of the current scheduling cycle and avoiding the scheduler allocating time slot resources to audio data packets that can no longer be played or sent normally. Another implementation can be implemented using anti-starvation processing. When the continuous unscheduled duration of an audio link exceeds a preset aging time threshold, the dynamic scheduling score is gradually increased by accumulating an aging coefficient. After the audio link is successfully scheduled, the continuous unscheduled duration is reset to zero and the aging coefficient is reset to its initial value. This prevents low-priority audio links from timeout disconnections or control response failures due to prolonged lack of scheduling opportunities.

[0153] Therefore, the technical solution provided in this application effectively solves the problems of high real-time audio packets being blocked by ordinary audio packets, links with large buffers such as A2DP occupying too many time slot resources, audio data packets nearing the playback deadline lacking a perception mechanism, ordinary data links being starved for a long time, and the inability to dynamically adjust scheduling priorities according to the remaining latency budget of different audio data packets in on-chip dual Bluetooth systems under multi-audio service concurrency scenarios. It significantly improves the low latency guarantee capability, voice continuity, control response timeliness and system scalability when multiple audio services are concurrent, and is particularly suitable for on-chip dual Bluetooth devices that need to process multiple types of audio services at the same time, such as gaming headsets, audio dongles, wireless audio hubs, and smart speakers.

[0154] To facilitate better implementation of the audio link delay budget-aware scheduling method provided in this application, this application also provides an audio link delay budget-aware scheduling system. The meanings of the terms used are the same as in the audio link delay budget-aware scheduling method described above, and specific implementation details can be found in the descriptions within the method embodiments.

[0155] Please see Figure 4 , Figure 4 This is a schematic diagram of the audio link delay budget-aware scheduling system provided in an embodiment of this application. The audio link delay budget-aware scheduling system is applied to an on-chip dual Bluetooth system, which includes two Bluetooth controllers (a first Bluetooth controller BT0 and a second Bluetooth controller BT1). The audio link delay budget-aware scheduling system may include a time acquisition module 201, a delay calculation module 202, a status acquisition module 203, a dynamic scoring module 204, an audio scheduling module 205, and a time slot scheduling module 206. The time acquisition module 201 is used to acquire the deadline time information of audio data packets in each audio link on the two controllers; The delay calculation module 202 is used to calculate the remaining delay budget for each audio data packet based on the current system time, deadline information, and required processing time. The status acquisition module 203 is used to acquire the link status information of each audio link; The dynamic scoring module 204 is used to generate dynamic scheduling scores for each audio link based on link status information and remaining delay budget. The audio scheduling module 205 is used to determine the target Bluetooth controller to be scheduled first from the two Bluetooth controllers based on the dynamic scheduling score, and to determine the target audio link and target audio data packet to be scheduled first from the audio link carried by the target Bluetooth controller, and generate the corresponding scheduling result. The time slot scheduling module 206 is used to output the scheduling results to the global time slot scheduling module to generate the corresponding dual Bluetooth time slot plan.

[0156] For specific implementation methods of each of the above units, please refer to the embodiments of the audio link delay budget-aware scheduling method described above, which will not be repeated here.

[0157] In summary, the audio link delay budget-aware scheduling system provided in this application embodiment can obtain the deadline information of audio data packets in each audio link on two controllers through the time acquisition module 201; calculate the remaining delay budget of each audio data packet based on the current system time, deadline information, and required processing time by the delay calculation module 202; obtain the link status information of each audio link by the status acquisition module 203; generate a dynamic scheduling score for each audio link based on the link status information and remaining delay budget by the dynamic scoring module 204; determine the target Bluetooth controller for current priority scheduling from the two Bluetooth controllers based on the dynamic scheduling score, and determine the target audio link and target audio data packet for current priority scheduling from the audio links carried by the target Bluetooth controller, generating the corresponding scheduling result; and output the scheduling result to the global time slot scheduling module 206 to generate the corresponding dual Bluetooth time slot plan. This application effectively solves the problems of on-chip dual Bluetooth systems in scenarios with multiple concurrent audio services, such as high-real-time audio packets being blocked by ordinary audio packets, excessive time slot resources being occupied by links with large buffers like A2DP, lack of awareness mechanism for audio data packets nearing playback deadline, long-term starvation of ordinary data links, and inability to dynamically adjust scheduling priorities based on the remaining latency budget of different audio data packets. It significantly improves the low-latency guarantee capability, voice continuity, control response timeliness, and system scalability when multiple audio services are concurrent. It is particularly suitable for on-chip dual Bluetooth devices that need to handle multiple types of audio services simultaneously, such as gaming headsets, audio dongles, wireless audio hubs, and smart speakers.

[0158] This application also provides a Bluetooth communication device, which may integrate the audio link delay budget-aware scheduling system of this application, such as... Figure 5 As shown, it illustrates a structural schematic diagram of the Bluetooth communication device involved in the embodiments of this application. Specifically: The Bluetooth communication device may include components such as a processor 301 with one or more processing cores and a memory 302 of one or more computer-readable storage media. Those skilled in the art will understand that... Figure 5 The Bluetooth communication device structure shown does not constitute a limitation on the Bluetooth communication device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: The processor 301 is the control center of the Bluetooth communication device. It connects various parts of the Bluetooth communication device via various interfaces and lines. By running or executing software programs stored in the memory 302 and / or the methods provided in this application, and by calling data stored in the memory 302, it performs various functions and processes data of the Bluetooth communication device, thereby providing overall monitoring of the Bluetooth communication device. Optionally, the processor 301 may include one or more processing cores; preferably, the processor 301 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operation of the storage medium, user interface, and application programs, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 301.

[0159] The memory 302 can be used to store software programs and the methods provided in this application. The processor 301 executes various functional applications and data processing by running the software programs stored in the memory 302 and the methods provided in this application. The memory 302 may mainly include a program storage area and a data storage area. The program storage area may store applications required for operating the storage medium and at least one function; the data storage area may store data created based on the use of the Bluetooth communication device. In addition, the memory 302 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, or other volatile solid-state storage device. Accordingly, the memory 302 may also include a memory controller to provide the processor 301 with access to the memory 302.

[0160] Although not shown, the Bluetooth communication device may also include a display unit, an input unit, and a power supply, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 301 in the Bluetooth communication device loads the executable files corresponding to the processes of one or more applications into the memory 302 according to the following instructions, and the processor 301 runs the applications stored in the memory 302 to realize various functions, as follows: Obtain the cutoff time information of audio data packets in each audio link on the two Bluetooth controllers; Calculate the remaining delay budget for each audio data packet based on the current system time, deadline information, and required processing time; Obtain the link status information of each audio link; Based on link status information and remaining delay budget, a dynamic scheduling score is generated for each audio link; Based on the dynamic scheduling score, the target Bluetooth controller to be scheduled first is determined from the two Bluetooth controllers, and the target audio link and target audio data packet to be scheduled first are determined from the audio link carried by the target Bluetooth controller, and the corresponding scheduling result is generated. The scheduling results are output to the global time slot scheduling module to generate the corresponding dual Bluetooth time slot plan.

[0161] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0162] Therefore, embodiments of this application provide a storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the methods provided in embodiments of this application. For example, the instructions can execute the following steps: Obtain the cutoff time information of audio data packets in each audio link on the two Bluetooth controllers; Calculate the remaining delay budget for each audio data packet based on the current system time, deadline information, and required processing time; Obtain the link status information of each audio link; Based on link status information and remaining delay budget, a dynamic scheduling score is generated for each audio link; Based on the dynamic scheduling score, the target Bluetooth controller to be scheduled first is determined from the two Bluetooth controllers, and the target audio link and target audio data packet to be scheduled first are determined from the audio link carried by the target Bluetooth controller, and the corresponding scheduling result is generated. The scheduling results are output to the global time slot scheduling module to generate the corresponding dual Bluetooth time slot plan.

[0163] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0164] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0165] Since the instructions stored in the storage medium can execute the steps of any method provided in the embodiments of this application, the beneficial effects that any method provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.

[0166] The audio link delay budget-aware scheduling method, system, storage medium, and Bluetooth communication device provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. An audio link delay budget-aware scheduling method, applied to an on-chip dual Bluetooth system, wherein the on-chip dual Bluetooth system includes two Bluetooth controllers, characterized in that, The audio link delay budget-aware scheduling method includes: Obtain the cutoff time information of audio data packets in each audio link on the two Bluetooth controllers; Based on the current system time, the aforementioned deadline information, and the required processing time, calculate the remaining delay budget for each audio data packet; Obtain the link status information of each audio link; Based on the link status information and the remaining delay budget, a dynamic scheduling score is generated for each audio link; Based on the dynamic scheduling score, the target Bluetooth controller to be scheduled first is determined from the two Bluetooth controllers, and the target audio link and target audio data packet to be scheduled first are determined from the audio link carried by the target Bluetooth controller, and the corresponding scheduling result is generated. The scheduling results are output to the global time slot scheduling module to generate the corresponding dual Bluetooth time slot plan.

2. The audio link delay budget-aware scheduling method as described in claim 1, characterized in that, The link status information includes at least one scheduling influencing factor among link type, link direction, connection period, current buffer depth, pending transmission queue depth, packet loss rate, packet error rate, retransmission status, and remaining keep-alive time. The step of generating a dynamic scheduling score for each audio link based on the link status information and the remaining delay budget includes: For each audio link, obtain the actual value of each scheduling influence factor corresponding to the audio link; According to the preset mapping rules, each of the actual values ​​is mapped to the corresponding score contribution value; If an audio link corresponds to multiple scheduling influence factors, the weighted summation or accumulation of each score contribution value is performed to generate a dynamic scheduling score for each audio link; if an audio link corresponds to only one scheduling influence factor, its corresponding score contribution value is used as the dynamic scheduling score.

3. The audio link delay budget-aware scheduling method as described in claim 2, characterized in that, After generating the dynamic scheduling scores for each of the aforementioned audio links, the process also includes: For a receiving audio link, if the current buffer depth is lower than a first threshold, the dynamic scheduling score is increased by a first magnitude; if the current buffer depth is lower than a second threshold, the dynamic scheduling score is increased by a second magnitude, wherein the second threshold is lower than the first threshold and the second magnitude is greater than the first magnitude. For a transmitting audio link, if the backlog of audio data packets to be transmitted exceeds a preset threshold and the remaining time indicated by the deadline information of some audio data packets is less than a preset time threshold, then the dynamic scheduling score will be increased by a third magnitude value.

4. The audio link delay budget-aware scheduling method as described in claim 2, characterized in that, After generating the dynamic scheduling scores for each of the aforementioned audio links, the process also includes: When the link status information indicates that there are audio data packets that need to be retransmitted on a certain audio link, obtain the corresponding remaining delay budget; Determine whether the remaining delay budget is greater than the estimated time required to retransmit the audio data packet; If so, the audio data packet is determined to be within the valid retransmission window, and the dynamic scheduling score is increased by the fourth magnitude value; If not, it is determined that the audio data packet has exceeded the valid retransmission window, the retransmission opportunity of the audio data packet is abandoned, and the dynamic scheduling score is not increased or decreased.

5. The audio link delay budget-aware scheduling method as described in claim 2, characterized in that, After generating the dynamic scheduling scores for each of the aforementioned audio links, the process also includes: Iterate through the deadline information of audio data packets in each of the aforementioned audio links; If the deadline indicated by the deadline information of an audio data packet is later than the current system time, then the audio data packet is determined to have expired. For expired audio data packets, remove them from the scheduling queue or set their dynamic scheduling score to the lowest value so that they do not participate in the arbitration of the current scheduling cycle.

6. The audio link delay budget-aware scheduling method as described in claim 2, characterized in that, After generating the dynamic scheduling scores for each of the aforementioned audio links, the process also includes: Obtain the continuous unscheduled duration of each audio link; If the continuous unscheduled duration of a certain audio link exceeds the preset aging time threshold, the dynamic scheduling score will be gradually increased by accumulating the aging coefficient. Once the audio link is successfully scheduled, its continuous unscheduled duration is reset to zero, and the aging coefficient is reset to its initial value.

7. The audio link delay budget-aware scheduling method as described in claim 1, characterized in that, The step of determining the target Bluetooth controller for current priority scheduling from the two Bluetooth controllers based on the dynamic scheduling score, and determining the target audio link and target audio data packet for current priority scheduling from the audio link carried by the target Bluetooth controller, includes: The dynamic scheduling scores are sorted, and the audio link with the highest score is selected as the target audio link, and its Bluetooth controller is selected as the target Bluetooth controller. In the target audio link, each audio data packet is sorted according to the remaining delay budget, and the audio data packet with the smallest remaining delay budget is selected as the target audio data packet.

8. An audio link delay budget-aware scheduling system, applied to an on-chip dual Bluetooth system, wherein the on-chip dual Bluetooth system includes two Bluetooth controllers, characterized in that, The audio link delay budget-aware scheduling system includes: The time acquisition module is used to acquire the cutoff time information of audio data packets in each audio link on the two controllers; The delay calculation module is used to calculate the remaining delay budget for each audio data packet based on the current system time, the deadline information, and the required processing time. The status acquisition module is used to acquire the link status information of each audio link; The dynamic scoring module is used to generate a dynamic scheduling score for each audio link based on the link status information and the remaining delay budget. The audio scheduling module is used to determine the target Bluetooth controller to be scheduled first from the two Bluetooth controllers based on the dynamic scheduling score, and to determine the target audio link and target audio data packet to be scheduled first from the audio link carried by the target Bluetooth controller, and generate the corresponding scheduling result. The time slot scheduling module is used to output the scheduling result to the global time slot scheduling module to generate the corresponding dual Bluetooth time slot plan.

9. A storage medium, characterized in that, The storage medium stores multiple instructions, which are applicable to a processor for loading to execute the audio link delay budget-aware scheduling method according to any one of claims 1-7.

10. A Bluetooth communication device, characterized in that, The system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the audio link delay budget-aware scheduling method as described in any one of claims 1-7.