Bluetooth communication scheduling method and apparatus, bluetooth device, and chip

By acquiring the status information and data transmission completion delay of the Bluetooth communication link and adjusting the number of controller buffers, the resource consumption problem caused by poor Bluetooth link quality was solved, and the Bluetooth transmission efficiency was improved.

WO2025162356A9PCT designated stage Publication Date: 2026-05-15HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2025-01-26
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In Bluetooth communication scenarios with multiple concurrent connections, poor Bluetooth link quality can lead to excessive resource consumption and reduce overall transmission efficiency.

Method used

By acquiring communication link status information, such as link status and data transmission completion delay, the number of controller buffers available for communication links in the Bluetooth device can be adjusted to ensure that more resources are allocated to communication links with good link quality.

Benefits of technology

It improves the utilization of Bluetooth link resources, enhances overall transmission efficiency, and avoids the additional consumption of Bluetooth resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025075100_15052026_PF_FP_ABST
    Figure CN2025075100_15052026_PF_FP_ABST
Patent Text Reader

Abstract

A Bluetooth communication scheduling method, comprising: acquiring first state information on a first communication link, wherein the first state information includes link state information and / or a data transmission completion delay, and the first communication link is a communication link between a first Bluetooth device and any second Bluetooth device; and on the basis of the first state information, adjusting the number of available controller buffers on the first communication link in the first Bluetooth device. In this way, since state information of a communication link can well reflect the quality of the communication link, and the number of available controller buffers on the communication link may directly affect the number of cacheable data packets to be transmitted on the communication link, it can be ensured in this controller buffer allocation mode that more resources are allocated to the communication link having high link quality, improving the utilization rate of Bluetooth link resources, thereby better allocating and using the Bluetooth link resources.
Need to check novelty before this filing date? Find Prior Art

Description

A Bluetooth communication scheduling method, apparatus, Bluetooth device, and chip.

[0001] This application claims priority to Chinese Patent Application No. 202410134710.7, filed on January 30, 2024, entitled "A Bluetooth Communication Scheduling Method, Apparatus, Bluetooth Device and Chip", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of information technology (IT) technology, and in particular to a Bluetooth communication scheduling method, apparatus, Bluetooth device and chip. Background Technology

[0003] With the widespread adoption of smart devices and the increasing number of Bluetooth peripherals, usage scenarios have gradually emerged centered around mobile phones, tablets, or laptops, using Bluetooth as the communication channel. In these scenarios, the central device, such as a mobile phone, tablet, or laptop, establishes Bluetooth transmission channels with at least two Bluetooth devices. Therefore, these scenarios involve the need for multiple concurrent connections and transmissions.

[0004] In related technologies, in Bluetooth communication scenarios with multiple concurrent connections, transmission priorities can be determined first based on service priorities. Then, higher-priority connections are prioritized for scheduling, while connections with the same priority are scheduled in a round-robin fashion to complete data transmission between Bluetooth devices. This scheduling method is effective when Bluetooth connection quality is good or service priorities are clear. However, when the number of Bluetooth devices increases, leading to Bluetooth link congestion, or when the distance between devices increases, causing Bluetooth link degradation, poor link transmission will occupy more resources for a longer period, resulting in connections with good link quality not being guaranteed, thus reducing the overall Bluetooth transmission efficiency. Therefore, how to improve Bluetooth transmission efficiency in scenarios with multiple concurrent connections is a pressing technical problem that needs to be solved. Summary of the Invention

[0005] This application provides a Bluetooth communication scheduling method, apparatus, Bluetooth device, chip, computer storage medium, and computer product, which can improve Bluetooth transmission efficiency in scenarios with multiple concurrent connections.

[0006] In a first aspect, this application provides a Bluetooth communication scheduling method applied to a first Bluetooth device, wherein the first Bluetooth device establishes communication connections with at least two second Bluetooth devices. The method includes: acquiring first state information on a first communication link, the first state information including: link state information and / or data transmission completion delay, the first communication link being a communication link between the first Bluetooth device and any one of the second Bluetooth devices; and adjusting the number of controller buffers available for use on the first communication link in the first Bluetooth device based on the first state information.

[0007] In this way, since the status information of the communication link can well reflect the quality of the communication link, and the number of controller buffers that the communication link can use directly affects the number of data packets to be sent on the communication link that can be cached, this controller buffer allocation method can ensure that communication links with good link quality are allocated more resources, thereby improving the utilization rate of Bluetooth link resources and making the entire Bluetooth link resources better allocated and used.

[0008] In one possible implementation, the protocol stack of the first Bluetooth device includes: a Logical Channel Control and Adaptation Protocol (L2CAP) and a controller. The first state information includes link state information, which is recorded in the controller. In this case, obtaining the first state information on the first communication link involves L2CAP retrieving the link state information from the controller. This allows a single end to evaluate the quality of the communication link without requiring cooperation from both ends, avoiding additional Bluetooth resource consumption and further improving the utilization rate of Bluetooth link resources.

[0009] In one possible implementation, the link state information includes one or more of the following: Received Signal Strength Indication (RSSI), retransmission rate, and packet loss rate.

[0010] In one possible implementation, the protocol stack of the first Bluetooth device includes: a Logical Channel Control and Adaptation Protocol (L2CAP) and a controller. The first state information includes: a data transmission completion delay. In this case, acquiring the first state information on the first communication link includes: L2CAP recording the first moment when the first data packet transmission is completed, as reported by the controller, where the first data packet is sent by the controller through the first communication link; and L2CAP calculating the data transmission completion delay based on the first and second moments, where the second moment is the moment L2CAP sends the first data packet to the controller. In this way, a single end can evaluate the quality of the communication link without requiring cooperation from both ends, avoiding additional Bluetooth resource consumption and further improving the utilization rate of Bluetooth link resources.

[0011] In one possible implementation, L2CAP calculates the data transmission completion delay based on a first time point and a second time point. This includes: L2CAP calculating a first delay based on the first and second time points; and L2CAP correcting the first delay based on historical data transmission completion delays on the first communication link to obtain the final data transmission completion delay. This allows for correction of the first delay using historical data, improving the accuracy of the statistics.

[0012] In one possible implementation, adjusting the number of controller buffers available for the first communication link in the first Bluetooth device based on the first state information includes: obtaining the number of controller buffers available for the first communication link under different service priorities based on the first state information and in conjunction with service priorities and a controller buffer allocation table; and adjusting the number of controller buffers available for the first communication link under different service priorities. This allows for the adjustment of the number of controller buffers available for the communication link under different service priorities.

[0013] In one possible implementation, after adjusting the number of controller buffers available for the first communication link in the first Bluetooth device based on the first state information, the method further includes: using the first communication link to send data when it is necessary, and increasing the number of used controller buffers by one for each data packet sent; and stopping the use of the first communication link to send data when the number of used controller buffers equals the number of controller buffers available for the first communication link. This completes the control of the resources used by the communication link.

[0014] Secondly, this application provides a Bluetooth communication scheduling device deployed on a first Bluetooth device, wherein the first Bluetooth device establishes communication connections with at least two second Bluetooth devices. The device includes an acquisition module and a processing module. The acquisition module is used to acquire first state information on a first communication link, the first state information including link state information and / or data transmission completion delay, wherein the first communication link is a communication link between the first Bluetooth device and any one of the second Bluetooth devices. The processing module is used to adjust the number of controller buffers available for the first communication link in the first Bluetooth device based on the first state information.

[0015] In one possible implementation, the first state information includes link state information. In this case, when the acquisition module acquires the first state information on the first communication link, it specifically acquires the link state information from the controller in the protocol stack of the first Bluetooth device, where the controller records the first state information.

[0016] In one possible implementation, the link state information includes one or more of the following: Received Signal Strength Indication (RSSI), retransmission rate, and packet loss rate.

[0017] In one possible implementation, the first state information includes: data transmission completion delay. In this case, when the acquisition module acquires the first state information on the first communication link, it specifically records: the first moment when the first data packet transmission is completed, as reported by the controller in the protocol stack of the first Bluetooth device, wherein the first data packet is sent by the controller through the first communication link; and calculates the data transmission completion delay based on the first moment and the second moment, where the second moment is the moment when the acquisition module sends the first data packet to the controller.

[0018] In one possible implementation, when the acquisition module calculates the data transmission completion delay based on the first time and the second time, it is specifically used to: calculate the first delay based on the first time and the second time; and correct the first delay based on the historical data transmission completion delay on the first communication link to obtain the data transmission completion delay.

[0019] In one possible implementation, when the processing module adjusts the number of controller buffers available for the first communication link in the first Bluetooth device based on the first state information, it specifically performs the following steps: based on the first state information and in conjunction with the service priority and the controller buffer allocation table, it obtains the number of controller buffers available for the first communication link under different service priorities; and adjusts the number of controller buffers available for the first communication link under different service priorities.

[0020] In one possible implementation, after adjusting the number of controller buffers available for the first communication link in the first Bluetooth device based on the first state information, the processing module is further configured to: use the first communication link to send data when it is necessary to use the first communication link, and increase the number of used controller buffers by one for each data packet sent; and stop using the first communication link to send data when the number of used controller buffers is equal to the number of controller buffers available for the first communication link.

[0021] Thirdly, this application provides a Bluetooth device, comprising: one or more processors; a memory for storing one or more programs; and, when the one or more programs are executed by the one or more processors, causing the one or more processors to implement the method described in the first aspect or any possible implementation of the first aspect.

[0022] Fourthly, this application provides a chip comprising: at least one processor and an interface circuit; at least one processor acquires program instructions or data through the interface circuit; at least one processor is configured to execute program line instructions to implement the method described in the first aspect or any possible implementation of the first aspect.

[0023] Fifthly, this application provides a computer-readable storage medium including computer program instructions that, when executed by an electronic device, cause the electronic device to perform the method described in the first aspect or any possible implementation thereof.

[0024] In a sixth aspect, this application provides a computer program product containing instructions that, when executed by an electronic device, cause the electronic device to perform the method described in the first aspect or any possible implementation thereof.

[0025] It is understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0026] Figure 1 is a schematic diagram of a Bluetooth communication scenario provided in an embodiment of this application;

[0027] Figure 2 is a schematic diagram of the hardware structure of a Bluetooth device provided in an embodiment of this application;

[0028] Figure 3 is a schematic diagram of the architecture of a Bluetooth protocol stack provided in an embodiment of this application;

[0029] Figure 4 is a schematic diagram of a communication process between Bluetooth devices provided in an embodiment of this application;

[0030] Figure 5 is a schematic diagram of data interaction between L2CAP and controller during communication between Bluetooth devices according to an embodiment of this application;

[0031] Figure 6 is a schematic diagram of a data transmission process using service priority and round-robin scheduling provided in an embodiment of this application;

[0032] Figure 7 is a flowchart illustrating a Bluetooth communication scheduling method provided in an embodiment of this application;

[0033] Figure 8 is a schematic diagram of a Bluetooth communication scheduling device provided in an embodiment of this application;

[0034] Figure 9 is a schematic diagram of the structure of a chip provided in an embodiment of this application. Detailed Implementation

[0035] In this article, the term "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The symbol " / " in this article indicates that the related objects are in an "or" relationship; for example, A / B means A or B.

[0036] The terms "first" and "second," etc., used in the specification and claims herein are used to distinguish different objects, not to describe a specific order of objects. For example, "first response message" and "second response message," etc., are used to distinguish different response messages, not to describe a specific order of response messages.

[0037] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0038] In the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more, for example, multiple processing units means two or more processing units, multiple elements means two or more elements, etc.

[0039] Figure 1 illustrates, for example, a Bluetooth communication scenario provided by an embodiment of this application. As shown in Figure 1, this Bluetooth communication scenario may include one Bluetooth device 110 and at least two Bluetooth devices 120. Bluetooth devices 110 and 120 can establish a communication connection via Bluetooth. For example, Bluetooth device 110 can be understood as a central device, which has established Bluetooth communication connections with each Bluetooth device 120 and can transmit data or instructions to each Bluetooth device 120. Of course, each Bluetooth device 120 can also transmit data or instructions to Bluetooth device 110.

[0040] It is understood that both Bluetooth device 110 and Bluetooth device 120 are electronic devices that support Bluetooth communication technology. Examples include: mobile phones, smartwatches, Bluetooth headsets, Bluetooth keyboards, Bluetooth mice, styluses, tablets, laptops, ultra-mobile personal computers (UMPCs), netbooks, as well as augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, in-vehicle devices, smart home devices, and / or smart city devices, etc. This application embodiment does not impose any special restrictions on the specific types of Bluetooth device 110 and Bluetooth device 120.

[0041] For example, Figure 2 shows a schematic diagram of the hardware structure of a Bluetooth device provided in an embodiment of this application. As shown in Figure 2, the Bluetooth device 110 may include: a Bluetooth chip 111, an RF transceiver 112, and a power supply 113. The Bluetooth chip 111, the RF transceiver 112, and the power supply 113 may be connected, but are not limited to, via a bus. The Bluetooth chip 111 is mainly responsible for processing all layers of the Bluetooth protocol stack and implementing various functions of the Bluetooth device 110 (e.g., data transmission, voice communication, control communication, etc.). The RF transceiver 112 is mainly responsible for transmitting and receiving RF signals to realize wireless communication between Bluetooth devices. Specifically, the RF transceiver 112 can convert digital signals into RF signals for transmission, and receive RF signals transmitted by other Bluetooth devices and convert them into digital signals. The Bluetooth device 111 and the RF transceiver 112 can be arranged separately or integrated together, depending on the actual situation, and are not limited here. The power supply 113 is mainly responsible for providing power to the Bluetooth chip 111 and the RF transceiver 112. It is understood that the structure illustrated in the embodiments of this application does not constitute a specific limitation on the Bluetooth device 110. In other embodiments of this application, the Bluetooth device 110 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. Furthermore, for the hardware structure of the Bluetooth device 120, reference can be made to the hardware structure of the Bluetooth device 110, which will not be repeated here.

[0042] Both Bluetooth devices 110 and 120 can have a Bluetooth protocol stack to enable communication between Bluetooth devices. For example, Figure 3 shows a schematic diagram of a Bluetooth protocol stack architecture provided in an embodiment of this application. As shown in Figure 3, the Bluetooth protocol stack may include: an application layer, a logical link control and adaptation protocol (L2CAP), and a controller.

[0043] The application layer is the highest layer of the Bluetooth protocol stack and is responsible for interacting with applications. It provides various services to meet the needs of applications, including file transfer, audio transmission, and data exchange.

[0044] L2CAP is a middle layer in the Bluetooth protocol stack, responsible for providing logical link control functions. L2CAP encapsulates application layer data into PDUs and then sends the PDUs to the controller. Additionally, L2CAP also provides data flow control, error detection, and other functions. When two Bluetooth devices establish a connection, they negotiate and establish at least one L2CAP channel. The communication link between the two Bluetooth devices can be associated with at least one L2CAP channel. Each L2CAP channel is used to transmit different data types or services. For example, one L2CAP channel can be used to transmit audio data, and another L2CAP channel can be used to transmit control data. The L2CAP channel is the logical link provided by L2CAP. Each L2CAP channel has a unique channel identifier (CID). The application layer can transmit data to L2CAP through L2CAP channels. For example, when audio data needs to be transmitted, the application layer can transmit data to L2CAP through the L2CAP channel used for audio data transmission.

[0045] The controller is the lowest layer of the Bluetooth protocol stack and is responsible for interacting with the Bluetooth hardware. The controller can convert PDUs transmitted by L2CAP into physical layer data frames and then send them to other Bluetooth devices. Additionally, the controller is also responsible for receiving physical layer data frames from other Bluetooth devices, converting them back into PDUs, and transmitting them to L2CAP. It is understood that the Bluetooth protocol stack architecture illustrated in the embodiments of this application does not constitute a specific limitation on the Bluetooth protocol stack of Bluetooth devices 110 or 120. In other embodiments of this application, the Bluetooth protocol stack of Bluetooth devices 110 or 120 may include more or fewer layers or protocols than illustrated, such as: Bluetooth module (BTM), service discovery protocol (SDP), logical link control and adaptation protocol (L2CAP), radio frequency communication (RFCOMM) protocol, etc., and / or, host controller interface (HCI), etc.

[0046] Under the Bluetooth protocol stack architecture shown in Figure 3, the communication process between Bluetooth devices 110 and 120 can be illustrated in Figure 4. As shown in Figure 4, when Bluetooth device 110 transmits data to Bluetooth device 120, the application layer in Bluetooth device 110 can encapsulate the data into a Service Data Unit (SDU) and transmit it to the L2CAP in Bluetooth device 110 using an L2CAP channel adapted to the data type in the SDU. Next, the L2CAP in Bluetooth device 110 can determine the need to send data to Bluetooth device 120 through the association between the L2CAP channel and the communication link. Then, the L2CAP in Bluetooth device 110 can encapsulate the SDU into a Protocol Data Unit (PDU), add the corresponding L2CAP channel CID to the PDU, and transmit it to the controller in Bluetooth device 110 via HCI. Finally, the controller in Bluetooth device 110 can convert the PDU into a data frame and transmit it to Bluetooth device 120. After receiving a data frame from the controller in Bluetooth device 110, the controller in Bluetooth device 120 can convert the data frame into a PDU and pass it to L2CAP in Bluetooth device 120 via HCI. Then, L2CAP in Bluetooth device 120 can convert and parse the PDU into an SDU and obtain the CID of the L2CAP channel. Then, L2CAP in Bluetooth device 120 can use the L2CAP channel matching the parsed CID to pass the SDU to the application layer in Bluetooth device 120 for use by the application. Additionally, after receiving a data frame from the controller in Bluetooth device 110, the controller in Bluetooth device 120 can also return an acknowledgment (ACK) message to the controller in Bluetooth device 110. It should be understood that the process of Bluetooth device 120 transmitting data to Bluetooth device 110 is similar to the process of Bluetooth device 110 transmitting data to Bluetooth device 120, and will not be elaborated here.

[0047] In this embodiment, as shown in Figure 5, the L2CAP of Bluetooth device 110 can be configured with a link status statistics module, a link quality assessment module, and an L2CAP scheduling module. The link status statistics module is primarily responsible for collecting the status information of each communication link. A communication link refers to the physical channel connection between Bluetooth device 110 and Bluetooth device 120, used for transmitting data between the two Bluetooth devices. Additionally, the link status statistics module can also be responsible for collecting the data packet transmission completion delay on each communication link. The link quality assessment module is primarily responsible for assessing the number of available controller buffers for each communication link based on the status information collected by the link status statistics module. The L2CAP scheduling module is primarily responsible for querying the number of available buffers for a given communication link from the link quality assessment module when data needs to be transmitted using that communication link, and then sending data to the controller based on the available buffers, so that the controller can transmit data through that communication link.

[0048] Referring again to Figure 5, the controller of Bluetooth device 110 can be configured with a certain number of buffers. These buffers (also called "controller buffers") can store and manage communication data between Bluetooth devices. The controller buffer can store data sent to other Bluetooth devices, as well as data received from other Bluetooth devices. Additionally, a link status information recording module can be configured in the controller. This module is mainly responsible for recording the status information of each communication link, such as received signal strength indication (RSSI), retransmission rate, and packet loss rate. For example, the RSSI of the communication link between Bluetooth devices 110 and 120 can be transmitted from Bluetooth device 120 to Bluetooth device 110 when Bluetooth device 120 is the receiving end, or it can be calculated by Bluetooth device 110 itself when Bluetooth device 110 is the receiving end. The specific method depends on the actual situation and is not limited here. Furthermore, the controller in Bluetooth device 110 can also record the time when data is sent on each communication link, the time when ACK messages indicating data reception completion are returned by other devices, etc. In some embodiments, the modules or components configured in the L2CAP and controller of Bluetooth device 120 can refer to, but are not limited to, the configuration in Bluetooth device 110, which will not be described in detail here.

[0049] To facilitate understanding of the content described in Figure 5, the following description, in conjunction with Figure 5 and taking the communication link between Bluetooth devices 110 and 120 as communication link L, will describe the data transmission between them.

[0050] For example, continuing to refer to Figure 5, in S51, after receiving data transmitted from the application layer, the L2CAP scheduling module in Bluetooth device 110 can determine that the data needs to be transmitted to Bluetooth device 120 based on the association between the L2CAP channel used by the application layer to transmit the data and the communication link. Simultaneously, it can also determine the type of service corresponding to the data. For example, when the L2CAP channel used is for transmitting audio data, then the service corresponding to the data is an audio service.

[0051] In S52, the L2CAP scheduling module in Bluetooth device 110 can query the number of controller buffers that can be used in the communication link L between Bluetooth devices 110 and 120 from the link quality assessment module.

[0052] In S53, the L2CAP scheduling module in Bluetooth device 110 sends data packets to the controller in Bluetooth device 110 based on the number of controller buffers available for communication link L, and increments the number of used controller buffers by one for each data packet sent. Specifically, when the number of controller buffers available for communication link L is less than or equal to the number of used controller buffers in communication link L, or when there are no data packets to be sent, the L2CAP scheduling module can stop sending data to the controller.

[0053] After the controller in Bluetooth device 110 receives the data packet sent by the L2CAP scheduling module, it can convert the data packet into a physical layer data frame and send the data frame to Bluetooth device 120.

[0054] After the controller in Bluetooth device 120 receives the data frame sent by Bluetooth device 110, it can return an ACK message to Bluetooth device 110.

[0055] After each data packet is sent in the controller of Bluetooth device 110 in S56, the controller can send a completion confirmation message to the link status statistics module in Bluetooth device 110 to notify L2CAP that the data packet has been sent.

[0056] In S57, the link statistics module in Bluetooth device 110 obtains the link status information of each communication link from the controller, and calculates the transmission time and transmission completion time (i.e., the time when the data packet transmission completion acknowledgment message is received) of each data packet on each communication link to obtain the transmission completion delay of each data packet. For any given data packet, the transmission completion delay can be the absolute value of the difference between the time T1 when the L2CAP scheduling module sends the data packet to the controller and the time T2 when the controller reports the data packet transmission completion (i.e., |T1-T2|). In some embodiments, since the communication time between L2CAP and the controller is basically consistent, the transmission completion delay of a data packet can also be the absolute value of the difference between the time T3 when the controller sends the data packet and the time T4 when the controller receives the ACK message confirming that the data packet has been received (i.e., |T3-T4|). In this case, the controller can calculate the transmission completion delay itself and pass it to the link statistics module; alternatively, the link statistics module can calculate it itself, depending on the actual situation, and this is not limited here.

[0057] In the S58 and Bluetooth device 110, the link quality assessment module obtains link status statistics for each communication link from the link statistics module, such as link status information and the transmission completion delay of each data packet on each communication link.

[0058] In S59 and Bluetooth device 110, the link quality assessment module evaluates the number of controller buffers available for each communication link based on link state statistics. Specifically, the link quality assessment module can evaluate the quality of each communication link based on its link state information. For example, if the RSSI of a communication link is lower than a preset RSSI threshold, the link's signal is considered poor, i.e., of low quality; conversely, if the RSSI of a communication link is higher than the preset RSSI threshold, the link's signal is considered good, i.e., of high quality. Furthermore, when the link state information includes multiple parameters, the link quality can be assessed separately for each parameter, and then the worst-performing parameter can be selected as the final quality of the communication link. For example, if the link state information includes RSSI and retransmission rate, and RSSI is used to determine high quality while retransmission rate is used to determine poor quality, the link will be considered of poor quality. Alternatively, a weighted average of the assessment results can be used as the final quality of the communication link.

[0059] Furthermore, when multiple data packets are transmitted on a communication link, the transmission completion delays of these multiple data packets can be statistically analyzed, and the statistical result can be used as the transmission completion delay of the data packets on that communication link. In some embodiments, the historical transmission completion delays of data packets on the communication link can also be combined with the current transmission completion delay, for example, by weighted summation, to obtain the transmission completion delay of the data packets on that communication link. This improves the accuracy of the statistics.

[0060] After obtaining the link quality and data packet transmission completion delay of the communication link, the number of controller buffers available for the communication link can be determined by combining the service priority (e.g., high priority for voice calls, medium priority for hardware control services, and low priority for file transfer services) and a pre-configured controller buffer allocation table. For example, if the pre-configured controller buffer allocation table is as shown in Table 1, and the link quality of communication link L is "poor," the service priority is "high," and the transmission completion delay is "300ms," then the number of controller buffers available for communication link L is 5. If the link quality of communication link L is "medium," the service priority is "low," and the transmission completion delay is "40ms," then the number of controller buffers available for communication link L is 7. It should be understood that in Table 1, since the data packet transmission completion delay on a certain communication link is also necessarily poor when the communication quality is poor, further subdivision based on delay is not necessary in this case; however, subdivision is possible depending on the actual situation and is not limited here.

[0061] Table 1

[0062] It should be understood that the above method uses two dimensions—communication link quality and transmission completion delay—to determine the number of controller buffers available for a communication link. In other instances, either dimension (e.g., communication link quality or transmission completion delay) can be selected to determine the number of controller buffers available for the communication link. In this case, the items in the controller buffer allocation table can be modified accordingly. The specific approach depends on the actual situation and is not limited here.

[0063] It should be understood that the link quality assessment module in Bluetooth device 110 can assess the number of controller buffers available for each communication link in real time or periodically. This ensures that communication links with good link quality can be allocated more resources, thereby improving Bluetooth link resource utilization and ensuring better allocation and use of overall Bluetooth link resources. Furthermore, link quality assessment can be completed single-end, without the need for dual-end cooperation, thus avoiding the additional consumption of Bluetooth resources. Since L2CAP in the Bluetooth standard lacks a receiver feedback mechanism, dual-end cooperation would require implementing a proprietary protocol on top of L2CAP, necessitating additional protocol implementation and increasing deployment complexity. Therefore, the single-end link quality assessment method provided in this embodiment reduces the complexity of link quality assessment.

[0064] Figure 5 above illustrates the transmission of data from Bluetooth device 110 to one Bluetooth device 120. Since Bluetooth device 110 establishes communication connections with multiple Bluetooth devices 120, it can select communication links for data transmission using absolute service priority and round-robin scheduling, thereby improving Bluetooth transmission efficiency. This scheduling method is described below.

[0065] For example, Figure 6 illustrates a process of transmitting data using a service priority and round-robin scheduling method according to an embodiment of this application. This process can be, but is not limited to, completed in L2CAP within the Bluetooth device 110, such as by the L2CAP scheduling module. For ease of description, the following description uses L2CAP as an example. As shown in Figure 6, transmitting data using a service priority and round-robin scheduling method may include the following steps:

[0066] S601 and L2CAP select the highest service priority queue. Each service priority can form its own queue. For example, when service priorities are divided into high, medium, and low, there are three service priority queues. During scheduling, L2CAP can first select the queue with the highest service priority. For instance, after receiving a data packet from the upper application layer, L2CAP can store the data packet in its own buffer and, through the L2CAP channel transmitting the data packet, learn the corresponding service type and the required communication link. L2CAP then adds the required communication link to the corresponding service priority queue based on the service type. For example, when the service type is audio and the audio service has the highest priority, L2CAP can add the communication link associated with this service type to the highest service priority queue.

[0067] S602 and L2CAP determine whether there are any communication links that need to be scheduled in the selected service priority queue. Specifically, after selecting a service priority queue, L2CAP can determine whether there are any communication links in the queue. If there are, it indicates that there are schedulable communication links, so S603 can be executed; otherwise, it indicates that there are no schedulable communication links, and the communication links in the service priority queue may be empty, so S607 can be executed.

[0068] S603 and L2CAP select the communication link at the head of the queue and remove the communication link from the queue.

[0069] S604, L2CAP determines whether there are any data packets to be sent on the communication link. L2CAP can search its own buffer for data packets related to the current service priority queue that need to be sent using this communication link. If a packet is found, S605 is executed; otherwise, S602 is returned.

[0070] S605, L2CAP determines whether the number of controller buffers used in the communication link is less than the number of controller buffers available. If so, proceed to S606; otherwise, return to S602.

[0071] S606 and L2CAP send a data packet to the controller, increase the number of buffers used for the communication link, and insert the communication link to the end of the queue.

[0072] S607 and L2CAP determine whether all service priority queues have been scheduled.

[0073] If yes, then end; otherwise, execute S608.

[0074] S608 and L2CAP select the next service priority queue and return to execute S602.

[0075] This enables the scheduling of data to be sent in Bluetooth devices, improving Bluetooth transmission efficiency.

[0076] Next, we will introduce a Bluetooth communication scheduling method provided in the embodiments of this application.

[0077] For example, Figure 7 shows a flowchart of a Bluetooth communication scheduling method provided in an embodiment of this application. It is understood that this method can be executed by any device, equipment, platform, or device cluster with computing and processing capabilities. For example, this method can be applied to a first Bluetooth device, and the first Bluetooth device establishes communication connections with at least two second Bluetooth devices. For ease of description, the following description uses the first Bluetooth device as the executing entity. However, replacing the first Bluetooth device with other devices, components, or apparatuses is still within the scope of protection of this application. For example, replacing the executing entity with LACP in the protocol stack of the first Bluetooth device is also within the scope of protection of this application. As shown in Figure 7, the Bluetooth communication scheduling method includes:

[0078] S701. Obtain first status information on the first communication link. The first status information includes: link status information and / or data transmission completion delay. The first communication link is a communication link between the first Bluetooth device and any second Bluetooth device.

[0079] In this embodiment, the first Bluetooth device can independently obtain the status information of the communication link between itself and any second Bluetooth device. The status information of each communication link includes: link status information and / or data transmission completion delay. The link status may include one or more of RSSI, retransmission rate, and packet loss rate. The data transmission completion delay can be the absolute value of the difference between the time when the first Bluetooth device sends data to the second Bluetooth device and the time when the first Bluetooth device receives the ACK message from the second Bluetooth device, or it can be the absolute value of the difference between the time when L2CAP in the first Bluetooth device's protocol stack sends a data packet to the controller and the time when L2CAP receives feedback from the controller that data transmission is complete.

[0080] As one possible implementation, when the first state information is link state information, this link state information can be recorded in the controller of the first Bluetooth device's protocol stack. In this case, the first Bluetooth device can obtain the link state information from the controller through L2CAP in its protocol stack.

[0081] As another possible implementation, when the first state information is a data transmission completion delay, the first Bluetooth device can record the first moment of the first data packet transmission completion reported by the controller through L2CAP in its protocol stack. The first data packet is sent by the controller to the second Bluetooth device via the first communication link. Then, the L2CAP in the protocol stack of the first Bluetooth device can calculate the data transmission completion delay based on the first and second moments. The second moment is the moment when L2CAP sends the first data packet to the controller. Furthermore, to improve the accuracy of delay calculation, L2CAP can first calculate the first delay based on the first and second moments; then, it can correct the first delay based on historical data transmission completion delays on the first communication link to obtain the final data transmission completion delay. This achieves smoothing of the delay.

[0082] As another possible implementation, when the first state information is link state information and data transmission completion delay, the first Bluetooth device can obtain the link state information and data transmission completion delay by combining the above-mentioned methods of obtaining the first state information.

[0083] S702. Based on the first state information, adjust the number of controller buffers available for the first communication link in the first Bluetooth device.

[0084] In this embodiment, after obtaining the first state information, the number of controller buffers available for the first communication link in the first Bluetooth device can be adjusted based on this first state information. This ensures that communication links with good link quality can be allocated more resources, thereby improving the utilization rate of Bluetooth link resources and enabling better allocation and use of the entire Bluetooth link resources. Specifically, the number of controller buffers available for the first communication link under different service priorities can be obtained based on the first state information, combined with service priorities and a controller buffer allocation table. For example, the number of controller buffers available for the first communication link under different service priorities can be obtained by querying the controller buffer allocation table using the first state information and service priorities, or by comparing the first state information and service priorities with the conditions in the controller buffer allocation table. After obtaining the number of controller buffers available for the first communication link under different service priorities, the number of controller buffers available for the first communication link under different service priorities can be adjusted. In some embodiments, the number of controller buffers available for each communication link in the first Bluetooth device can be dynamically adjusted to ensure that the number of controller buffers available for each communication link is the most recently evaluated.

[0085] In this way, since the status information of the communication link can well reflect the quality of the communication link, this controller buffer allocation method can ensure that the communication link with good link quality is allocated more resources, thereby improving the utilization rate of Bluetooth link resources and making the entire Bluetooth link resources better allocated and used.

[0086] Furthermore, after adjusting the number of controller buffers available for the first communication link in the first Bluetooth device, when data transmission via the first communication link is required, it can be used. Each time a data packet is transmitted, the number of controller buffers used by the first communication link is increased by one. When the number of controller buffers used by the first communication link equals the number of controller buffers available for the first communication link, it indicates that the first communication link has exhausted its allocated resources, and therefore, data transmission via the first communication link can be stopped. This completes the control of the resources used by the communication link.

[0087] It is understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. In addition, the various embodiments described above can be combined according to actual conditions, and the combined solutions are still within the protection scope of this application.

[0088] Next, based on the methods in the above embodiments, the Bluetooth communication scheduling device provided in this application will be described.

[0089] For example, Figure 8 shows a schematic diagram of a Bluetooth communication scheduling device provided in an embodiment of this application. This Bluetooth communication scheduling device can be deployed on a first Bluetooth device, wherein the first Bluetooth device establishes communication connections with at least two second Bluetooth devices. As shown in Figure 8, the Bluetooth communication scheduling device 800 includes: an acquisition module 801 and a processing module 802. The acquisition module 801 is used to acquire first state information on a first communication link, the first state information including: link state information and / or data transmission completion delay, where the first communication link is a communication link between the first Bluetooth device and any one of the second Bluetooth devices. The processing module 802 is used to adjust the number of controller buffers available for the first communication link in the first Bluetooth device based on the first state information. For example, both the acquisition module 801 and the processing module 802 can be, but are not limited to, modules or units included in the L2CAP protocol stack of the first Bluetooth device.

[0090] In some embodiments, the first state information includes link state information. In this case, when the acquisition module 801 acquires the first state information on the first communication link, it is specifically used to: acquire the link state information from the controller in the protocol stack of the first Bluetooth device, wherein the controller records the first state information.

[0091] In some embodiments, link state information includes one or more of the following: Received Signal Strength Indication (RSSI), retransmission rate, and packet loss rate.

[0092] In some embodiments, the first state information includes: data transmission completion delay. At this time, when the acquisition module 801 acquires the first state information on the first communication link, it is specifically used to: record the first moment when the first data packet transmission is completed, as reported by the controller in the protocol stack of the first Bluetooth device, wherein the first data packet is sent by the controller through the first communication link; and calculate the data transmission completion delay based on the first moment and the second moment, where the second moment is the moment when the acquisition module 801 sends the first data packet to the controller.

[0093] In some embodiments, when the acquisition module 801 calculates the data transmission completion delay based on the first time and the second time, it is specifically used to: calculate the first delay based on the first time and the second time; and correct the first delay based on the historical data transmission completion delay on the first communication link to obtain the data transmission completion delay.

[0094] In some embodiments, when the processing module 802 adjusts the number of controller buffers available for the first communication link in the first Bluetooth device based on the first state information, it is specifically used to: obtain the number of controller buffers available for the first communication link under different service priorities based on the first state information and in combination with the service priority and the controller buffer allocation table; and adjust the number of controller buffers available for the first communication link under different service priorities.

[0095] In some embodiments, after adjusting the number of controller buffers available for the first communication link in the first Bluetooth device based on the first state information, the processing module 802 is further configured to: use the first communication link to send data when it is necessary to use the first communication link, and increase the number of used controller buffers by one for each data packet sent; and stop using the first communication link to send data when the number of used controller buffers is equal to the number of controller buffers available for the first communication link.

[0096] It should be understood that the above-described device is used to execute the methods in the above embodiments. The implementation principle and technical effect of the corresponding program modules in the device are similar to those described in the above methods. The working process of the device can be referred to the corresponding process in the above methods, and will not be repeated here.

[0097] Based on the methods in the above embodiments, this application provides a Bluetooth device, including: one or more processors; and a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors perform the methods in the above embodiments. For example, the Bluetooth device may be, but is not limited to, electronic devices such as mobile phones, watches, speakers, or computers.

[0098] Based on the methods in the above embodiments, this application also provides a chip. Please refer to Figure 9, which is a schematic diagram of the structure of a chip provided in this application. As shown in Figure 9, the chip 900 includes one or more processors 901 and interface circuits 902. Optionally, the chip 900 may also include a bus 903. Wherein:

[0099] The processor 901 can be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed through integrated logic circuits in the processor 901 or through software instructions. The processor 901 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods and steps disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor.

[0100] The interface circuit 902 can be used to send or receive data, instructions or information. The processor 901 can use the data, instructions or other information received by the interface circuit 902 to process the data, instructions or other information, and can send the processed information out through the interface circuit 902.

[0101] Optionally, chip 900 also includes memory, which may include read-only memory and random access memory, and provides operation instructions and data to the processor. A portion of the memory may also include non-volatile random access memory (NVRAM).

[0102] Optionally, the memory stores executable software modules or data structures, and the processor can execute corresponding operations by calling the operation instructions stored in the memory (which may be stored in the operating system).

[0103] Optionally, the interface circuit 902 can be used to output the execution results of the processor 901.

[0104] It should be noted that the functions of the processor 901 and the interface circuit 902 can be implemented through hardware design, software design, or a combination of hardware and software; no restrictions are imposed here.

[0105] It should be understood that each step of the above method embodiments can be completed by hardware logic circuits or software instructions in a processor.

[0106] Based on the methods in the above embodiments, this application provides a computer-readable storage medium including computer program instructions. When the computer program instructions are executed by an electronic device (such as the aforementioned Bluetooth device), the electronic device performs the methods described in the above embodiments. Exemplarily, the computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive).

[0107] Based on the methods in the above embodiments, this application provides a computer program product containing instructions that, when executed by an electronic device (such as the aforementioned Bluetooth device), cause the electronic device to perform the methods described in the above embodiments.

[0108] It is understood that the processor in the embodiments of this application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. A general-purpose processor may be a microprocessor or any conventional processor.

[0109] The method steps in the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an ASIC.

[0110] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0111] It is understood that the various numerical designations used in the embodiments of this application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of this application.

[0112] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of this application.

Claims

1. A Bluetooth communication scheduling method, characterized in that, Applied to a first Bluetooth device, wherein the first Bluetooth device establishes a communication connection with at least two second Bluetooth devices; The method includes: Obtain first status information on the first communication link, the first status information including: link status information and / or data transmission completion delay, the first communication link being the communication link between the first Bluetooth device and any one of the second Bluetooth devices; Based on the first state information, adjust the number of controller buffers available for the first communication link in the first Bluetooth device.

2. The method according to claim 1, characterized in that, The protocol stack of the first Bluetooth device includes: Logical Channel Control and Adaptation Protocol (L2CAP) and a controller. The first state information includes: the link state information, and the controller records the first state information. The step of obtaining the first status information on the first communication link includes: The L2CAP obtains the link status information from the controller.

3. The method according to claim 2, characterized in that, The link status information includes one or more of the following: Received Signal Strength Indication (RSSI), retransmission rate, and packet loss rate.

4. The method according to any one of claims 1-3, characterized in that, The protocol stack of the first Bluetooth device includes: Logical Channel Control and Adaptation Protocol (L2CAP) and a controller; the first status information includes: the data transmission completion delay. The step of obtaining the first status information on the first communication link includes: The L2CAP records the first moment when the first data packet sent by the controller is completed, wherein the first data packet is sent by the controller through the first communication link; The L2CAP calculates the data transmission completion delay based on the first time and the second time, where the second time is the time when the L2CAP sends the first data packet to the controller.

5. The method according to claim 4, characterized in that, The L2CAP calculates the data transmission completion delay based on the first time point and the second time point, including: The L2CAP calculates the first time delay based on the first time and the second time. The L2CAP modifies the first delay based on the historical data transmission completion delay on the first communication link to obtain the data transmission completion delay.

6. The method according to any one of claims 1-5, characterized in that, The step of adjusting the number of controller buffers available on the first Bluetooth device for the first communication link based on the first state information includes: Based on the first state information, and in combination with the service priority and controller buffer allocation table, the number of controller buffers that the first communication link can use under different service priorities is obtained; Adjust the number of controller buffers available for the first communication link under different service priorities.

7. The method according to any one of claims 1-6, characterized in that, After adjusting the number of controller buffers available for the first communication link in the first Bluetooth device based on the first state information, the method further includes: When it is necessary to use the first communication link to send data, use the first communication link to send data, and increase the number of used controller buffers by one for each data packet sent; If the number of controller buffers used is equal to the number of controller buffers available for the first communication link, then stop using the first communication link to send data.

8. A Bluetooth communication scheduling device, characterized in that, Deployed on a first Bluetooth device, wherein the first Bluetooth device establishes communication connections with at least two second Bluetooth devices; The device includes: The acquisition module is used to acquire first status information on the first communication link. The first status information includes: link status information and / or data transmission completion delay. The first communication link is a communication link between the first Bluetooth device and any one of the second Bluetooth devices. The processing module is configured to adjust the number of controller buffers available for the first communication link in the first Bluetooth device based on the first state information.

9. The apparatus according to claim 8, characterized in that, The first status information includes: the link status information; When the acquisition module acquires the first status information on the first communication link, it is specifically used for: The link status information is obtained from the controller in the protocol stack of the first Bluetooth device, wherein the controller records the first status information.

10. The apparatus according to claim 9, characterized in that, The link status information includes one or more of the following: Received Signal Strength Indication (RSSI), retransmission rate, and packet loss rate.

11. The apparatus according to any one of claims 8-10, characterized in that, The first status information includes: the data transmission completion delay; When the acquisition module acquires the first status information on the first communication link, it is specifically used for: Record the first moment when the first data packet is sent, as reported by the controller in the protocol stack of the first Bluetooth device; wherein the first data packet is sent by the controller through the first communication link. Based on the first time point and the second time point, the data transmission completion delay is calculated, where the second time point is the time when the acquisition module sends the first data packet to the controller.

12. The apparatus according to claim 11, characterized in that, When the acquisition module calculates the data transmission completion delay based on the first and second moments, it is specifically used for: The first time delay is calculated based on the first time point and the second time point; Based on the historical data transmission completion delay on the first communication link, the first delay is corrected to obtain the data transmission completion delay.

13. The apparatus according to any one of claims 8-12, characterized in that, When the processing module adjusts the number of controller buffers available for the first communication link in the first Bluetooth device based on the first state information, it is specifically used for: Based on the first state information, and in combination with the service priority and controller buffer allocation table, the number of controller buffers that the first communication link can use under different service priorities is obtained; Adjust the number of controller buffers available for the first communication link under different service priorities.

14. The apparatus according to any one of claims 8-13, characterized in that, After adjusting the number of controller buffers available for the first communication link in the first Bluetooth device based on the first state information, the processing module is further configured to: When it is necessary to use the first communication link to send data, use the first communication link to send data, and increase the number of used controller buffers by one for each data packet sent; If the number of controller buffers used is equal to the number of controller buffers available for the first communication link, then stop using the first communication link to send data.

15. A Bluetooth device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method as described in any one of claims 1-7.

16. A chip, characterized in that, include: At least one processor and interface circuitry; The at least one processor obtains program instructions or data through the interface circuit; The at least one processor is configured to execute the program line instructions to implement the method as described in any one of claims 1-7.

17. A computer-readable storage medium, characterized in that, It includes computer program instructions that, when executed by an electronic device, cause the electronic device to perform the method as described in any one of claims 1-7.

18. A computer program product containing instructions, characterized in that, When the instruction is executed by the electronic device, the electronic device performs the method as described in any one of claims 1-7.