Bluetooth communication scheduling method and apparatus, bluetooth device, and chip
By obtaining the status information of the Bluetooth communication link and the data transmission completion delay, adjusting the number of controller buffers, solving the problem of unbalanced resource occupation caused by poor Bluetooth link quality, and improving Bluetooth transmission efficiency.
Patent Information
- Application Number
- PCT/CN2025/075100
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-30
- Filing Date
- 2025-01-26
- Publication Date
- 2025-08-07
AI Technical Summary
In the Bluetooth communication scenario of multiple connections and concurrent transmission, when the quality of Bluetooth links is poor, the resource usage is unbalanced and the overall transmission efficiency is reduced.
By obtaining the status information of the communication link and the completion delay of data transmission, adjust the number of controller buffers that can be used by the communication link in the Bluetooth device to ensure that the communication link with good link quality allocates more resources.
It improves the utilization rate of Bluetooth link resources, achieves better resource allocation and use, and improves overall transmission efficiency.
Smart Images

Figure CN2025075100_07082025_PF_FP_ABST
Abstract
Description
Bluetooth communication scheduling method, device, Bluetooth device and chip
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on January 30, 2024, with application number 202410134710.7 and application name “A Bluetooth communication scheduling method, device, Bluetooth device and chip”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of information technology (IT), and in particular to a Bluetooth communication scheduling method, apparatus, Bluetooth device, and chip. Background Art
[0003] With the prevalence of smart devices and the increase in Bluetooth peripherals, scenarios have gradually emerged, with mobile phones, tablets, or laptops as the central device and Bluetooth as the communication channel. In these scenarios, the central device, such as a mobile phone, tablet, or laptop, will establish a Bluetooth transmission channel with at least two Bluetooth devices, thus requiring multiple concurrent connections.
[0004] In the related art, in this Bluetooth communication scenario with multiple connections and concurrent transmission, the transmission priority can be determined first according to the service priority, and then the connection with the higher priority can be scheduled first, and the connections with the same priority can be scheduled in turn to complete the data transmission between Bluetooth devices. This scheduling method is more effective in scenarios where the Bluetooth connection link quality is good or the service priority is clear. However, when the number of Bluetooth devices increases, resulting in Bluetooth link congestion or the distance between devices increases, resulting in the Bluetooth link becoming worse, the transmission of the poor link will occupy more resources for a long time, resulting in the inability to guarantee the connection with good link quality, thereby reducing the overall Bluetooth transmission efficiency. Therefore, how to improve the Bluetooth transmission efficiency in the scenario of multiple connections and concurrent transmission is a technical problem that needs to be solved urgently. Summary of the Invention
[0005] The present 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 connections and concurrent transmission.
[0006] In a first aspect, the present application provides a Bluetooth communication scheduling method, applied to a first Bluetooth device, wherein the first Bluetooth device establishes a communication connection with at least two second Bluetooth devices. The method comprises: obtaining first status information on a first communication link, the first status information comprising: link status information and / or a 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, based on the first status information, a number of controller buffers available for the first communication link in the first Bluetooth device.
[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 can be used by the communication link will directly affect 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 better allocation and use of the entire Bluetooth link resources.
[0008] In one possible implementation, the protocol stack of the first Bluetooth device includes the Logical Channel Control and Adaptation Protocol (L2CAP) and a controller, and the first status information includes link status information, which is recorded in the controller. In this case, obtaining the first status information on the first communication link includes L2CAP obtaining the link status information from the controller. This allows a single-ended assessment of the communication link quality without requiring dual-ended coordination, avoiding additional Bluetooth resource usage and further improving Bluetooth link resource utilization.
[0009] In a possible implementation, the link state information includes one or more of a received signal strength indicator (RSSI), a retransmission rate, and a packet loss rate.
[0010] In one possible implementation, the protocol stack of the first Bluetooth device includes: Logical Channel Control and Adaptation Protocol (L2CAP) and a controller, and the first status information includes: data transmission completion delay. At this time, the first status information on the first communication link is obtained, including: L2CAP records the first moment when the first data packet feedback from the controller is completed, wherein the first data packet is sent by the controller through the first communication link; L2CAP calculates the data transmission completion delay based on the first moment and the second moment, and the second moment is the moment when L2CAP sends the first data packet to the controller. In this way, the quality of the communication link is evaluated by a single end without the need for dual-end cooperation, avoiding the additional occupation of Bluetooth resources and further improving the utilization rate of Bluetooth link resources.
[0011] In one possible implementation, L2CAP calculates the data transmission completion delay based on the first time point and the second time point, including: L2CAP calculates the first delay based on the first time point and the second time point; L2CAP corrects the first delay based on historical data transmission completion delays on the first communication link to obtain the data transmission completion delay. In this way, the first delay can be corrected based on historical data, thereby improving statistical accuracy.
[0012] In one possible implementation, adjusting the number of controller buffers available for a first communication link in a first Bluetooth device based on the first state information includes: determining, based on the first state information and in combination with a service priority and a controller buffer allocation table, the number of controller buffers available for the first communication link at different service priorities; and adjusting the number of controller buffers available for the first communication link at different service priorities. In this way, the number of controller buffers available for a communication link at different service priorities can be adjusted.
[0013] In one possible implementation, after adjusting the number of controller buffers available for a first communication link in the first Bluetooth device based on the first status information, the method further includes: sending data using the first communication link when the first communication link is required, and increasing the number of used controller buffers by one for each data packet sent; and ceasing to send data using the first communication link when the number of used controller buffers equals the number of controller buffers available for the first communication link. In this way, control of resources used by the communication link is achieved.
[0014] In a second aspect, the present application provides a Bluetooth communication scheduling device, which is deployed on a first Bluetooth device, wherein the first Bluetooth device establishes a communication connection with at least two second Bluetooth devices. The device includes: an acquisition module and a processing module. The acquisition module is used to obtain first status information on the first communication link, and 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. The processing module is used to adjust the number of controller buffers (controller buffers) available for the first communication link in the first Bluetooth device based on the first status information.
[0015] In one possible implementation, the first state information includes link state information. In this case, when acquiring the first state information on the first communication link, the acquisition module is specifically configured to acquire the link state information from a controller in a protocol stack of the first Bluetooth device, wherein the controller records the first state information.
[0016] In a possible implementation, the link state information includes one or more of a received signal strength indicator (RSSI), a retransmission rate, and a packet loss rate.
[0017] In one possible implementation, the first status information includes a data transmission completion delay. In this case, when acquiring the first status information on the first communication link, the acquisition module is specifically configured to: record a first moment of completion of transmission of a first data packet, as reported by a controller in a protocol stack of the first Bluetooth device, wherein the first data packet is sent by the controller via the first communication link; and calculate the data transmission completion delay based on the first moment and a second moment, wherein the second moment is the moment when the acquisition module sends the first data packet to the controller.
[0018] In one possible implementation, the acquisition module calculates the data sending completion delay based on the first moment and the second moment, and is specifically used to: calculate the first delay based on the first moment and the second moment; and correct the first delay based on the historical data sending completion delay on the first communication link to obtain the data sending 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 status 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 status 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.
[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 status information, the processing module is further configured to: when data needs to be sent using the first communication link, use the first communication link to send data, and increase the number of used controller buffers by one each time a data packet is sent; and when the number of used controller buffers is equal to the number of controller buffers available for the first communication link, stop using the first communication link to send data.
[0021] In a third aspect, the present 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 one or more processors, the one or more processors implement the method described in the first aspect or any possible implementation of the first aspect.
[0022] In a fourth aspect, the present application provides a chip comprising: at least one processor and an interface circuit; at least one processor obtains program instructions or data through the interface circuit; and at least one processor is used to execute program line instructions to implement the method described in the first aspect or any possible implementation of the first aspect.
[0023] In a fifth aspect, the present application provides a computer-readable storage medium comprising computer program instructions. When the computer program instructions are executed by an electronic device, the electronic device executes the method described in the first aspect or any possible implementation of the first aspect.
[0024] In a sixth aspect, the present application provides a computer program product comprising instructions, which, when executed by an electronic device, enables the electronic device to execute the method described in the first aspect or any possible implementation of the first aspect.
[0025] It can be understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] FIG1 is a schematic diagram of a Bluetooth communication scenario provided by an embodiment of the present application;
[0027] FIG2 is a schematic diagram of the hardware structure of a Bluetooth device provided in an embodiment of the present application;
[0028] FIG3 is a schematic diagram of the architecture of a Bluetooth protocol stack provided in an embodiment of the present application;
[0029] FIG4 is a schematic diagram of a communication process between Bluetooth devices provided in an embodiment of the present application;
[0030] FIG5 is a schematic diagram of data interaction between L2CAP and a controller during communication between Bluetooth devices provided in an embodiment of the present application;
[0031] FIG6 is a schematic diagram of a process for transmitting data using service priority and round-robin scheduling according to an embodiment of the present application;
[0032] FIG7 is a flow chart of a Bluetooth communication scheduling method provided in an embodiment of the present application;
[0033] FIG8 is a schematic structural diagram of a Bluetooth communication scheduling device provided in an embodiment of the present application;
[0034] FIG9 is a schematic structural diagram of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The term "and / or" as used herein describes an association between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. The symbol " / " as used herein indicates that the related objects are in an "or" relationship, for example, A / B means either A or B.
[0036] The terms "first" and "second" in this specification and claims are used to distinguish different objects rather than to describe a specific order of objects. For example, "first response message" and "second response message" are used to distinguish different response messages rather than to describe a specific order of response messages.
[0037] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0038] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more, for example, multiple processing units means two or more processing units, etc.; multiple elements means two or more elements, etc.
[0039] Exemplarily, FIG1 shows a schematic diagram of a Bluetooth communication scenario provided by an embodiment of the present application. As shown in FIG1 , the Bluetooth communication scenario may include: a Bluetooth device 110 and at least two Bluetooth devices 120. A communication connection can be established between the Bluetooth devices 110 and 120 via Bluetooth. Exemplarily, the Bluetooth device 110 can be understood as a central device, which establishes a Bluetooth communication connection 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 the Bluetooth device 110.
[0040] It is understood that the Bluetooth device 110 and the Bluetooth device 120 are electronic devices that support Bluetooth communication technology. Examples include mobile phones, smart watches, Bluetooth headsets, Bluetooth keyboards, Bluetooth mice, styluses, tablet computers, laptop computers, 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. The embodiments of the present application do not impose any particular restrictions on the specific types of the Bluetooth device 110 and the 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 the present application. As shown in Figure 2, the Bluetooth device 110 may include a Bluetooth chip 111, a radio frequency transceiver 112, and a power supply 113. The Bluetooth chip 111, the radio frequency transceiver 112, and the power supply 113 may be connected via, but not limited to, a bus. The Bluetooth chip 111 is primarily responsible for processing all layers of the Bluetooth protocol stack and implementing the various functions of the Bluetooth device 110 (e.g., data transmission, voice communication, control communication, etc.). The radio frequency transceiver 112 is primarily responsible for sending and receiving radio frequency signals to enable wireless communication between Bluetooth devices. The radio frequency transceiver 112 can convert digital signals into radio frequency signals for transmission, as well as receive radio frequency signals transmitted by other Bluetooth devices and convert them into digital signals. The Bluetooth device 111 and the radio frequency transceiver 112 can be arranged separately or integrated together, depending on the actual situation and is not limited here. The power supply 113 is primarily responsible for providing power to the Bluetooth chip 111 and the radio frequency transceiver 112. It is understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the Bluetooth device 110. In other embodiments of the present application, the Bluetooth device 110 may include more or fewer components than shown, or combine or separate certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware. In addition, for the hardware structure of the Bluetooth device 120, reference may be made to the hardware structure of the Bluetooth device 110, and no further description will be given here.
[0042] Each Bluetooth device 110 or 120 may include a Bluetooth protocol stack to enable communication between Bluetooth devices. For example, FIG3 illustrates an architectural diagram of a Bluetooth protocol stack provided in an embodiment of the present application. As shown in FIG3 , 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. The application layer can provide various services to meet the needs of applications, such as file transfer, audio transmission, data exchange, etc.
[0044] L2CAP is the middle layer of the Bluetooth protocol stack and is responsible for providing logical link control functions. L2CAP encapsulates application layer data into PDUs and then sends the PDUs to the controller. L2CAP also provides functions such as data flow control and error detection. When two Bluetooth devices establish a connection, they negotiate to establish at least one L2CAP channel. The communication link between 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, while another L2CAP channel can be used to transmit control data. An L2CAP channel is a logical link provided by L2CAP. Each L2CAP channel has a unique channel identifier (CID). The application layer can transmit data to L2CAP through the L2CAP channel. 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 Bluetooth hardware. The controller can convert PDUs transmitted by L2CAP into physical layer data frames and then send them to other Bluetooth devices. In addition, the controller is also responsible for receiving physical layer data frames from other Bluetooth devices, converting the physical layer data frames into PDUs, and passing them to L2CAP. It should be understood that the Bluetooth protocol stack architecture illustrated in the embodiments of the present application does not constitute a specific limitation on the Bluetooth protocol stack of Bluetooth device 110 or 120. In other embodiments of the present application, the Bluetooth protocol stack of Bluetooth device 110 or 120 may include more or fewer layers or protocols than shown, for example, including a Bluetooth module (BTM), a service discovery protocol (SDP), a logical link control and adaptation protocol (L2CAP), a radio frequency communication (RFCOMM) protocol, and / or a host controller interface (HCI).
[0046] Under the Bluetooth protocol stack architecture shown in Figure 3, the communication process between Bluetooth devices 110 and 120 can be shown 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. Subsequently, the L2CAP in Bluetooth device 110 can detect the need to send data to Bluetooth device 120 through the association between the L2CAP channel and the communication link. The L2CAP in Bluetooth device 110 can then encapsulate the SDU into a protocol data unit (PDU), add the CID of the corresponding L2CAP channel to the PDU, and transmit it to the controller in Bluetooth device 110 via the 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 the data frame sent by the controller in the Bluetooth device 110, the controller in the Bluetooth device 120 can convert the data frame into a PDU and pass it to the L2CAP in the Bluetooth device 120 via the HCI. The L2CAP in the Bluetooth device 120 can then convert and parse the PDU into an SDU and obtain the CID of the L2CAP channel. The L2CAP in the Bluetooth device 120 can then use the L2CAP channel that matches the parsed CID to pass the SDU to the application layer in the Bluetooth device 120 for use by the application in the application layer. Furthermore, after receiving the data frame sent by the controller in the Bluetooth device 110, the controller in the Bluetooth device 120 can also return an acknowledgment (ACK) message to the controller in the Bluetooth device 110. It should be understood that the process of Bluetooth device 120 transmitting data to Bluetooth device 110 can refer to the process of Bluetooth device 110 transmitting data to Bluetooth device 120, and will not be further described here.
[0047] In this embodiment, as shown in FIG5 , the L2CAP of the Bluetooth device 110 may 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 statistics on the status information of each communication link. A communication link refers to a physical channel connection between the Bluetooth device 110 and the Bluetooth device 120, used to transmit data between the two Bluetooth devices. Furthermore, the link status statistics module may also be responsible for collecting statistics on the delay in transmitting data packets on each communication link. The link quality assessment module is primarily responsible for assessing the number of controller buffers available for each communication link based on the communication link status information collected by the link status statistics module. The L2CAP scheduling module is primarily responsible for obtaining the number of available buffers for a communication link from the link quality assessment module when data needs to be transmitted via the communication link, and for sending data to the controller based on the available buffers for the communication link, so that the controller can transmit data via the communication link.
[0048] Continuing with Figure 5, the controller of Bluetooth device 110 may be configured with a certain number of buffers (also referred to as "controller buffers") to 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. Furthermore, the controller may also be configured with a link status information recording module. This link status information recording module is primarily responsible for recording status information for 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 may be transmitted to Bluetooth device 110 by Bluetooth device 120 when it is acting as the receiving end, or calculated by Bluetooth device 110 itself when it is acting as the receiving end. The specific method is determined based on actual circumstances and is not limited here. Furthermore, the controller of Bluetooth device 110 may also record the time when data is sent on each communication link, the time when ACK messages are sent back by other devices indicating that data has been received, and other information. In some embodiments, the modules or components configured in the L2CAP and controller of the Bluetooth device 120 can refer to, but are not limited to, the configurations in the Bluetooth device 110 and are not described in detail here.
[0049] To facilitate understanding of the content described in FIG. 5 , the data transmission between the two will be described below with reference to FIG. 5 , taking the communication link between the Bluetooth devices 110 and 120 as the communication link L as an example.
[0050] For example, referring to FIG. 5 , at S51 , after receiving data transmitted by the application layer, the L2CAP scheduling module in the Bluetooth device 110 can determine, based on the association between the L2CAP channel used by the application layer to transmit the data and the communication link, that the data needs to be transmitted to the Bluetooth device 120. Simultaneously, the type of service corresponding to the data can also be determined. For example, if the L2CAP channel used is for transmitting audio data, the service corresponding to the data is an audio service.
[0051] In S52 , the L2CAP scheduling module in the Bluetooth device 110 may query the link quality evaluation module for the number of controller buffers available for the communication link L between the Bluetooth devices 110 and 120 .
[0052] At S53, the L2CAP scheduling module in the Bluetooth device 110 sends data packets to the controller in the Bluetooth device 110 based on the number of controller buffers available for the communication link L. The number of used controller buffers is incremented by one each time a data packet is sent. When the number of controller buffers available for the communication link L is less than or equal to the number of controller buffers already used for the communication link L, or when there are no data packets to be sent, the L2CAP scheduling module may stop sending data to the controller.
[0053] In S54 , after receiving the data packet sent by the L2CAP scheduling module, the controller in the Bluetooth device 110 may convert the data packet into a data frame of the physical layer and send the data frame to the Bluetooth device 120 .
[0054] In S55 , after receiving the data frame sent by the Bluetooth device 110 , the controller in the Bluetooth device 120 may return an ACK message to the Bluetooth device 110 .
[0055] In S56 , after each data packet in the controller of the Bluetooth device 110 is sent, the controller may send a completion confirmation message to the link status statistics module in the Bluetooth device 110 to notify L2CAP that the data packet is sent successfully.
[0056] At S57, the link statistics module in the Bluetooth device 110 obtains link status information for each communication link from the controller and counts the transmission time and transmission completion time (i.e., the time when the packet transmission completion confirmation message is received) of each data packet on each communication link to obtain the transmission completion delay of each data packet. For any data packet, the transmission completion delay of the data packet 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, because the communication time between L2CAP and the controller is substantially the same, 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 the receipt of the data packet (i.e., |T3-T4|). In this case, the controller can calculate the transmission completion delay independently and pass it to the link statistics module; of course, the link statistics module can also calculate it independently, depending on the actual situation and is not limited here.
[0057] In S58 , the link quality assessment module in the Bluetooth device 110 obtains link status statistics of each communication link from the link statistics module, such as link status information, transmission completion delay of each data packet on each communication link, and the like.
[0058] At S59, the link quality assessment module in the Bluetooth device 110 assesses the amount of controller buffer available for each communication link based on the link status statistics of each communication link. The link quality assessment module can assess the quality of each communication link based on the link status information of each communication link. For example, when the RSSI of a communication link is below a preset RSSI threshold, the signal of the communication link can be determined to be poor, i.e., poor quality; when the RSSI of a communication link is above the preset RSSI threshold, the signal of the communication link can be determined to be good, i.e., good quality. Furthermore, when the link status information includes multiple parameters, the quality of the communication link can be assessed based on each parameter separately, and then the parameter with the worst quality can be selected as the quality of the communication link. For example, when the link status information includes RSSI and retransmission rate, if the RSSI determines that the quality of the communication link is high, while the retransmission rate determines that the quality of the communication link is poor, the quality of the communication link will be considered poor. Alternatively, a weighted average of the assessment results can be taken, and the result used as the final quality of the communication link.
[0059] Furthermore, when multiple data packets are sent on a communication link, the transmission completion delays of these multiple data packets can be counted, and the statistical result can be used as the data packet transmission completion delay on the communication link. In some embodiments, the historical data packet transmission completion delays on the communication link can also be combined with the current transmission completion delay, for example, by weighted summation, to obtain the data packet transmission completion delay on the communication link, thereby improving the accuracy of the statistics.
[0060] After determining the link quality of a communication link and the packet transmission completion delay for that communication link, the number of controller buffers available for the communication link can be determined by combining service priorities (e.g., voice call services are high priority, hardware control services are medium priority, and file transfer services are low priority) with a pre-configured controller buffer allocation table. For example, if the pre-configured controller buffer allocation table is 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 communication quality of a communication link is poor, the packet transmission completion delay for that link is also necessarily poor, the delay-based breakdown is no longer necessary. However, further breakdown is possible, depending on the actual situation and is not a limitation here.
[0061] Table 1
[0062] It should be understood that the above method uses the two dimensions of communication link quality and transmission completion delay to determine the number of controller buffers available for the communication link. In other instances, one dimension (for example, the communication link quality dimension or the transmission completion delay dimension) 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 also be adaptively modified. The specific method can be determined according to actual conditions and is not limited here.
[0063] It should be understood that the link quality assessment module in the Bluetooth device 110 can evaluate 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 that the entire Bluetooth link resource is better allocated and utilized. In addition, link quality assessment can be completed using a single end, without the need for dual-end coordination, which avoids the additional occupation of Bluetooth resources. Because L2CAP, as part of the Bluetooth standard, does not have a receiver feedback mechanism, using dual-end coordination would require implementing a proprietary protocol on top of L2CAP, which would require additional protocol implementation and be more difficult to deploy. Therefore, the single-end link quality assessment method provided in this embodiment can reduce the complexity of link quality assessment.
[0064] Figure 5 illustrates data transmission from Bluetooth device 110 to a single Bluetooth device 120. Because Bluetooth device 110 establishes communication connections with multiple Bluetooth devices 120, Bluetooth device 110 can utilize absolute service priority and round-robin scheduling to select a communication link to transmit data, thereby improving Bluetooth transmission efficiency. This scheduling approach is described below.
[0065] For example, FIG6 shows a schematic diagram of a process for transmitting data using service priority and round-robin scheduling according to an embodiment of the present application. The process may be, but is not limited to, performed in L2CAP in the Bluetooth device 110, such as by an L2CAP scheduling module. For ease of description, the following description will be based on L2CAP as an example. As shown in FIG6 , the process of transmitting data using service priority and round-robin scheduling may include the following steps:
[0066] S601, L2CAP selects the highest service priority queue. Each service priority can form a queue. For example, when the service priority is divided into high, medium and low, there are three service priority queues. When performing scheduling, L2CAP can first select the queue with the highest service priority. For example, after receiving the data packet sent by the upper application layer, L2CAP can store the data packet in its own buffer, and obtain the service type corresponding to the data packet and the communication link required to be used from the L2CAP channel that transmits the data packet. L2CAP adds the communication link required to be used to the corresponding service priority queue based on the service type. For example, when the service type is audio service and the priority of the audio service is the highest priority, L2CAP can add the communication link associated with the service type to the highest service priority queue.
[0067] S602: L2CAP determines whether there are any communication links in the selected service priority queue that need to be scheduled. After selecting the service priority queue, L2CAP can determine whether there are any communication links in the queue. If so, 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. L2CAP selects the communication link at the head of the queue and removes the communication link from the queue.
[0069] S604: L2CAP determines whether there are any data packets to be sent on the communication link. L2CAP searches its own buffer for data packets related to the services in the current service priority queue that need to be sent using the communication link. If a data packet is found, S605 is executed; otherwise, the process returns to S602.
[0070] S605: L2CAP determines whether the number of controller buffers used by the communication link is less than the number of available controller buffers. If so, execute S606; otherwise, return to execute S602.
[0071] S606 : L2CAP sends a data packet to the controller, increases the number of buffers used by the communication link, and inserts the communication link into the tail of the queue.
[0072] S607. L2CAP determines whether all service priority queues have been scheduled.
[0073] If yes, then end; otherwise, execute S608
[0074] S608 : L2CAP selects the next service priority queue and returns to execute S602 .
[0075] In this way, the scheduling of data to be sent in the Bluetooth device is achieved, and the Bluetooth transmission efficiency is improved.
[0076] Next, a Bluetooth communication scheduling method provided in an embodiment of the present application is introduced.
[0077] Exemplarily, FIG7 shows a flow chart of a Bluetooth communication scheduling method provided by an embodiment of the present application. It is understandable that the method can be executed by any device, equipment, platform, or device cluster with computing and processing capabilities. Exemplarily, the method can be applied to a first Bluetooth device, and the first Bluetooth device establishes a communication connection with at least two second Bluetooth devices. For ease of description, the following is introduced with the execution subject being the first Bluetooth device as an example, wherein the solution of replacing the first Bluetooth device with other devices, components, or devices is still within the scope of protection of the present application, for example, replacing the execution subject with LACP in the protocol stack of the first Bluetooth device, etc., and the solution after this replacement is still within the scope of protection of the present application. As shown in FIG7 , the Bluetooth communication scheduling method includes:
[0078] S701: Acquire first status information on a first communication link, where the first status information includes: link status information and / or data transmission completion delay. The first communication link is a communication link between a first Bluetooth device and any second Bluetooth device.
[0079] In this embodiment, on the first Bluetooth device, the first Bluetooth device can independently obtain the status information of the communication link between it 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 moment when the first Bluetooth device sends data to the second Bluetooth device and the moment 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 moment when L2CAP in the protocol stack of the first Bluetooth device sends a data packet to the controller and the moment when L2CAP receives the data transmission completion feedback from the controller.
[0080] As a possible implementation, when the first state information is link state information, the link state information may be recorded in a controller in a protocol stack of the first Bluetooth device. In this case, the first Bluetooth device may obtain the link state information from the controller via L2CAP in its protocol stack.
[0081] As another possible implementation method, when the first status information is the data transmission completion delay, the first Bluetooth device can record the first moment when the first data packet feedback by the controller is sent through the L2CAP in its protocol stack. The first data packet is sent by the controller to the second Bluetooth device through 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 moment and the second moment. The second moment is the moment when L2CAP sends the first data packet to the controller. In addition, in order to improve the accuracy of delay calculation, L2CAP can first calculate the first delay based on the first moment and the second moment; then, 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. In this way, the delay is smoothed.
[0082] As another possible implementation, when the first status information is link status information and data transmission completion delay, the first Bluetooth device may combine the above methods for obtaining the first status information to obtain the link status information and the data transmission completion delay.
[0083] S702: Based on the first status 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 the first state information. This ensures that more resources are allocated to communication links with good link quality, thereby improving Bluetooth link resource utilization and ensuring that the entire Bluetooth link resource is better allocated and utilized. Specifically, the number of controller buffers available for the first communication link at different service priorities can be obtained based on the first state information, combined with the service priority and the controller buffer allocation table. For example, the number of controller buffers available for the first communication link at different service priorities can be obtained by querying the controller buffer allocation table based on the first state information and the service priority, or by comparing the first state information and the service priority with the conditions in the controller buffer allocation table. After obtaining the number of controller buffers available for the first communication link at different service priorities, the number of controller buffers available for the first communication link at 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 communication links with good link quality are allocated more resources, thereby improving the utilization 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, if data needs to be sent using the first communication link, the first communication link can be used to send data, and the number of controller buffers used by the first communication link is increased by one for each data packet sent. Furthermore, 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. Therefore, data transmission using the first communication link can be stopped. In this way, control of the resources used by the communication link is completed.
[0087] It should be understood that the order of execution of the steps in the above embodiments does not necessarily imply a specific order of execution. The order of execution of each process should be determined by its function and inherent 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 circumstances, and the combined solutions are still within the scope of protection of this application.
[0088] Next, based on the method in the above embodiment, the Bluetooth communication scheduling device provided in the embodiment of the present application is introduced.
[0089] Exemplarily, Figure 8 shows a structural diagram of a Bluetooth communication scheduling device provided in an embodiment of the present application. The Bluetooth communication scheduling device can be deployed on a first Bluetooth device, wherein the first Bluetooth device establishes a communication connection 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. Among them, the acquisition module 801 is used to obtain the first status information on the first communication link, and the first status information includes: link status information and / or data transmission completion delay. The first communication link is the communication link between the first Bluetooth device and any second Bluetooth device. The processing module 802 is used to adjust the number of controller buffers that can be used in the first communication link in the first Bluetooth device based on the first status information. Exemplarily, the acquisition module 801 and the processing module 802 can be, but are not limited to, modules or units included in L2CAP in the protocol stack of the first Bluetooth device.
[0090] In some embodiments, the first state information includes link state information. In this case, when acquiring the first state information on the first communication link, the acquisition module 801 is specifically configured 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, the link status information includes one or more of: a received signal strength indication (RSSI), a retransmission rate, and a packet loss rate.
[0092] In some embodiments, the first status information includes a data transmission completion delay. In this case, when acquiring the first status information on the first communication link, the acquisition module 801 is specifically configured to: record the first moment at which the transmission of the first data packet is completed, as reported by a controller in the protocol stack of the first Bluetooth device, where the first data packet is sent by the controller via the first communication link; and calculate the data transmission completion delay based on the first moment and a second moment, where the second moment is the moment at which the acquisition module 801 sends the first data packet to the controller.
[0093] In some embodiments, the acquisition module 801 calculates the data sending completion delay based on the first moment and the second moment, and is specifically used to: calculate the first delay based on the first moment and the second moment; and correct the first delay based on the historical data sending completion delay on the first communication link to obtain the data sending 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 status information, it is specifically used to: obtain the number of controller buffers available for the first communication link under different business priorities based on the first status information and in combination with the business priority and the controller buffer allocation table; and adjust the number of controller buffers available for the first communication link under different business 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 status information, the processing module 802 is further used to: when the first communication link needs to be used to send data, use the first communication link to send data, and increase the number of used controller buffers by one each time a data packet is sent; and when the number of used controller buffers is equal to the number of controller buffers available for the first communication link, stop using the first communication link to send data.
[0096] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment. The implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method and will not be repeated here.
[0097] Based on the methods in the above embodiments, embodiments of the present application provide 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, the one or more processors execute the methods in the above embodiments. For example, the Bluetooth device may be, but is not limited to, an electronic device such as a mobile phone, a watch, a speaker, or a computer.
[0098] Based on the methods in the above embodiments, the present application also provides a chip. Please refer to Figure 9, which is a schematic diagram of the structure of a chip provided in the present application. As shown in Figure 9, the chip 900 includes one or more processors 901 and an interface circuit 902. Optionally, the chip 900 may also include a bus 903.
[0099] The processor 901 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 901 or an instruction in the form of software. The above-mentioned processor 901 can be a general-purpose processor, a digital communicator (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The various methods and steps disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[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 it, and can send the processing completion information through the interface circuit 902.
[0101] Optionally, the chip 900 further includes a memory, which may include a read-only memory and a random access memory, and provides operation instructions and data to the processor. Part of the memory may also include a non-volatile random access memory (NVRAM).
[0102] Optionally, the memory stores an executable software module or a data structure, and the processor can perform corresponding operations by calling an operation instruction stored in the memory (the operation instruction may be stored in an operating system).
[0103] Optionally, the interface circuit 902 may be configured to output the execution result of the processor 901 .
[0104] It should be noted that the corresponding 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, and there is no limitation here.
[0105] It should be understood that each step of the above method embodiment can be completed by a hardware-based logic circuit or a software-based instruction in a processor.
[0106] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, including computer program instructions, which, when executed by an electronic device (such as the aforementioned Bluetooth device, etc.), causes the electronic device to execute the method described in the above embodiment. 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 (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state drive), etc.
[0107] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product containing instructions. When the instructions are executed by an electronic device (such as the aforementioned Bluetooth device, etc.), the electronic device executes the method described in the above embodiment.
[0108] It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0109] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed 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, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium 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 be located in an ASIC.
[0110] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part 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, the process or function described in the embodiment of the present application is generated in whole or in part. 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 via 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 a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. 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 includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)).
[0111] It will be understood that the various numerical numbers involved in the embodiments of the present application are merely distinctions for the convenience of description and are not intended to limit the scope of the embodiments of the present application.
[0112] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the embodiments of the present 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 comprises: Acquire first status information on a first communication link, the first status information including: link status 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; Based on the first status information, the number of controller buffers available for the first communication link in the first Bluetooth device is adjusted.
2. The method according to claim 1, characterized in that 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: the link state information; the first state information is recorded in the controller; The obtaining of 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: received signal strength indication (RSSI), retransmission rate and packet loss rate.
4. The method according to any one of claims 1 to 3, characterized in that: The protocol stack of the first Bluetooth device includes: a Logical Channel Control and Adaptation Protocol (L2CAP) and a controller, and the first status information includes: a delay in completing the data transmission; The obtaining of first status information on the first communication link includes: The L2CAP records a first moment at which the first data packet fed back by the controller is sent. 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 a 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 and the second time, including: The L2CAP calculates a first delay based on the first time and the second time; The L2CAP corrects the first delay based on a historical data sending completion delay on the first communication link to obtain the data sending completion delay.
6. The method according to any one of claims 1 to 5, characterized in that: The adjusting, based on the first state information, the number of controller buffers available for use by the first communication link on the first Bluetooth device includes: Based on the first state information, and in combination with the service priority and the controller buffer allocation table, obtain the number of controller buffers available for the first communication link under different service priorities; 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 to 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 data needs to be sent using the first communication link, use the first communication link to send data, and increase the number of used controller buffers by one each time a data packet is sent; When the number of used controller buffers is equal to the number of controller buffers available for the first communication link, 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 a communication connection with at least two second Bluetooth devices; The device comprises: an acquisition module, configured to acquire first status information on a first communication link, the first status information including link status 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; A processing module is configured to adjust, based on the first status information, a number of controller buffers available for use in the first communication link in the first Bluetooth device.
9. The device according to claim 8, characterized in that The first state information includes: the link state information; When acquiring the first status information on the first communication link, the acquisition module is specifically configured to: The link status information is obtained from a controller in a protocol stack of the first Bluetooth device, wherein the first status information is recorded in the controller.
10. The device according to claim 9, characterized in that The link status information includes: one or more of: received signal strength indication (RSSI), retransmission rate and packet loss rate.
11. The device according to any one of claims 8 to 10, characterized in that: The first status information includes: the data transmission completion delay; When acquiring the first status information on the first communication link, the acquisition module is specifically configured to: Recording a first moment at which a first data packet fed back by a controller in a protocol stack of the first Bluetooth device is sent, wherein the first data packet is sent by the controller through the first communication link; The data transmission completion delay is calculated 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.
12. The device according to claim 11, characterized in that The acquisition module calculates the data transmission completion delay based on the first moment and the second moment, specifically for: Calculating a first time delay based on the first moment and the second moment; 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 device according to any one of claims 8 to 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, the processing module is specifically configured to: Based on the first state information, and in combination with the service priority and the controller buffer allocation table, obtain the number of controller buffers available for the first communication link under different service priorities; Adjust the number of controller buffers available for the first communication link under different service priorities.
14. The device according to any one of claims 8 to 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 data needs to be sent using the first communication link, use the first communication link to send data, and increase the number of used controller buffers by one each time a data packet is sent; When the number of used controller buffers is equal to the number of controller buffers available for the first communication link, stop using the first communication link to send data.
15. A Bluetooth device, characterized in that: include: one or more processors; 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 are enabled to implement the method according to any one of claims 1 to 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 according to any one of claims 1 to 7.
17. A computer-readable storage medium, characterized in that The method comprises computer program instructions, which, when executed by an electronic device, enable the electronic device to perform the method according to any one of claims 1 to 7.
18. A computer program product comprising instructions, characterized in that When the instruction is executed by an electronic device, the electronic device executes the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Bluetooth communication scheduling method and device, Bluetooth equipment and chip
CN120417090A
Communication processing method, apparatus, electronic device, and storage medium
CN109275129A
Control method and communication method of Bluetooth audio transmitter
CN111294777A
Buffer area setting method and device for Bluetooth audio playing, equipment and storage medium
CN111556361A
Playing adjustment method, playing equipment, electronic device and storage medium
CN113452570A
Cited By
Data transmission method and device based on low-power-consumption Bluetooth device and medium
CN121078412A