Data transmission method and device, electronic equipment, storage medium and program product
By using a predictive model to predict the radio frequency duration of Bluetooth data packets in devices that share radio frequency modules and antennas for Bluetooth and Wi-Fi, and informing Wi-Fi to remain silent via CTS frames, the problem of bandwidth waste caused by uncertain Bluetooth data transmission is solved, achieving more efficient resource utilization and data transmission.
Patent Information
- Application Number
- CN202511553395.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-28
- Publication Date
- 2026-02-13
AI Technical Summary
In electronic devices where Bluetooth and Wi-Fi share the same radio frequency module and antenna, the radio frequency occupancy time of Bluetooth data transmission is uncertain due to environmental interference and retransmission, which makes it impossible for Wi-Fi to be accurately muted, resulting in a waste of bandwidth resources.
By collecting the transmission rate, reception rate, and retransmission rate of Bluetooth data packets, a predictive model is used to predict the target radio frequency duration required for Bluetooth data packets. The Wi-Fi connected device is then informed to remain silent via the Wi-Fi CTS frame to ensure that the Bluetooth data packets are transmitted successfully.
Accurate prediction of the radio frequency duration required for Bluetooth data packets reduces bandwidth resource waste, improves the timeliness and stability of Bluetooth data transmission, and reduces Wi-Fi latency.
Smart Images

Figure CN121531329A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a data transmission method, apparatus, electronic device, storage medium, and program product. Background Technology
[0002] In the field of communications, Bluetooth and Wireless Fidelity (WIFI) functions of electronic devices typically share the same set of radio frequency modules and antennas using Time Division Duplexing (TDD) mode.
[0003] In related technologies, Bluetooth transmission and reception are affected by the environment, resulting in uncertain occupation time of the radio frequency module and antenna. When Bluetooth data and WIFI data coexist, the radio frequency module and antenna are usually switched to WIFI after the Bluetooth data transmission is completed. WIFI sends a power save (PS) frame to inform the WIFI connected device to enter the transceiver state in order to transmit WIFI data.
[0004] However, the above methods can easily lead to a waste of bandwidth resources. Summary of the Invention
[0005] This application provides a data transmission method, apparatus, electronic device, storage medium, and program product to achieve the technical effect of reducing bandwidth resource waste.
[0006] In a first aspect, embodiments of this application provide a data transmission method, including:
[0007] Collect the Bluetooth data packet transmission rate, reception rate, and retransmission rate within the current time step;
[0008] Obtain the Bluetooth data packets to be transmitted in the next time step;
[0009] The transmission rate, reception rate, retransmission rate, and the Bluetooth data packet to be transmitted are input into a preset prediction model to predict the target radio frequency duration occupied by transmitting the Bluetooth data packet to be transmitted.
[0010] The target radio frequency duration is sent to the Wi-Fi connected device via the Clear Sending CTS frame of Wi-Fi. The target radio frequency duration is used to keep the Wi-Fi connected device silent during the target radio frequency duration so that the Bluetooth data packets to be transmitted can be transmitted.
[0011] In one possible implementation, the data collection includes the Bluetooth packet transmission rate, reception rate, and retransmission rate within the current time step, including:
[0012] The encoding format for acquiring Bluetooth data includes fixed bit rate encoding or dynamic bit rate encoding.
[0013] If the encoding format is fixed bit rate encoding, then the first preset duration is determined as the time step.
[0014] If the encoding format is dynamic bit rate encoding, then the second preset duration is determined as the time step, and the second preset duration is longer than the first preset duration;
[0015] Collect the Bluetooth data packet transmission rate, reception rate, and retransmission rate within the current time step.
[0016] In one possible implementation, acquiring the Bluetooth data packets to be transmitted in the next time step includes:
[0017] Get the remaining Bluetooth data packets to be transmitted when the current time step ends;
[0018] Based on the encoding format, determine the newly generated Bluetooth data packets in the next time step;
[0019] The remaining Bluetooth data packets to be transmitted are added to the newly generated Bluetooth data packets, and the resulting data packet is determined as the Bluetooth data packet to be transmitted in the next time step.
[0020] Get the Bluetooth data packets to be transmitted in the next time step.
[0021] In one possible implementation, determining the newly generated Bluetooth data packet in the next time step, based on the encoding format, includes:
[0022] If the encoding format is fixed bit rate encoding, then obtain the fixed bit rate data corresponding to the fixed bit rate encoding;
[0023] The fixed bit rate data is multiplied by the next time step, and the result of the multiplication is determined as the first total number of bytes newly generated in the next time step.
[0024] If the encoding format is dynamic bit rate encoding, then obtain the total amount of data actually transmitted within the current time step;
[0025] Determine the average bit rate based on the total data volume and the current time step;
[0026] The average bit rate data is multiplied by the next time step, and the result of the multiplication is determined as the second total number of bytes newly generated in the next time step.
[0027] Based on the preset data packet length strategy for Bluetooth transmission, the newly generated Bluetooth data packets in the next time step are determined according to the first total number of bytes or the second total number of bytes.
[0028] In one possible implementation, the transmission rate, reception rate, retransmission rate, and the Bluetooth data packet to be transmitted are input into a preset prediction model to predict the target radio frequency duration occupied by transmitting the Bluetooth data packet to be transmitted, including:
[0029] The transmission rate and the reception rate are standardized to obtain the standardized transmission rate and reception rate.
[0030] The retransmission rate is weighted to obtain the weighted retransmission rate.
[0031] The standardized transmission rate and reception rate, the weighted retransmission rate, and the Bluetooth data packets to be transmitted are input into a preset prediction model to obtain the basic radio frequency duration occupied by transmitting the Bluetooth data packets to be transmitted.
[0032] Based on the base radio frequency duration, predict the target radio frequency duration to be used for transmitting the Bluetooth data packets to be transmitted.
[0033] In one possible implementation, predicting the target radio frequency duration for transmitting the Bluetooth data packet to be transmitted, based on the base radio frequency duration, includes:
[0034] If the base radio frequency duration is greater than the time step, then the time step is determined as the target radio frequency duration to be used to transmit the Bluetooth data packets to be transmitted.
[0035] If the base radio frequency duration is less than the preset radio frequency duration, the preset radio frequency duration is determined as the target radio frequency duration to be used for the predicted transmission of the Bluetooth data packet to be transmitted. The preset radio frequency duration is less than the time step.
[0036] If the base radio frequency duration is greater than or equal to the preset radio frequency duration, and less than or equal to the time step, then the base radio frequency duration is determined as the predicted radio frequency duration occupied by the Bluetooth data packets to be transmitted.
[0037] Secondly, embodiments of this application provide a data transmission apparatus, comprising:
[0038] The acquisition module is used to collect the Bluetooth data packet transmission rate, reception rate, and retransmission rate within the current time step.
[0039] The acquisition module is used to acquire the Bluetooth data packets to be transmitted in the next time step;
[0040] The prediction module is used to input the transmission rate, reception rate, retransmission rate and the Bluetooth data packet to be transmitted into a preset prediction model to predict the target radio frequency duration occupied by the Bluetooth data packet to be transmitted.
[0041] The transmitting module is used to send the target radio frequency duration to the Wi-Fi connected device via the Clear Transmit (CTS) frame of Wi-Fi. The radio frequency duration is used to keep the Wi-Fi connected device silent during the radio frequency duration so that the Bluetooth data packets to be transmitted can be transmitted.
[0042] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0043] The memory stores instructions that the computer executes;
[0044] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0045] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0046] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0047] The data transmission method, apparatus, electronic device, storage medium, and program product provided in this application's embodiments collect the transmission rate, reception rate, and retransmission rate of Bluetooth data packets within the current time step, and obtain the Bluetooth data packets to be transmitted in the next time step. The transmission rate, reception rate, retransmission rate, and the Bluetooth data packets to be transmitted are input into a preset prediction model to predict the target radio frequency duration occupied by the Bluetooth data packets to be transmitted. Then, the target radio frequency duration is sent to the Wi-Fi connected device via a Clear Transmission (CTS) frame in Wi-Fi, so that the Wi-Fi connected device remains silent during the target radio frequency duration, allowing the Bluetooth data packets to be transmitted to complete. The method of this application accurately predicts the target radio frequency duration required by Bluetooth based on a prediction model, thereby solving the problem of uncertain duration. Based on the target radio frequency duration, the Wi-Fi CTS frame informs the Wi-Fi connected device to remain silent during the corresponding time period, replacing the PS frame in related technologies, thereby reducing bandwidth waste. Attached Figure Description
[0048] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0049] Figure 1 This application provides a schematic diagram illustrating the principle of PS frame usage.
[0050] Figure 2 A schematic diagram illustrating how a PS frame informs a WIFI connection device in a related technology provided in this application;
[0051] Figure 3 This is a schematic diagram illustrating one application scenario shown in this application;
[0052] Figure 4 A flowchart illustrating a data transmission method provided in an embodiment of this application;
[0053] Figure 5 This application provides a schematic diagram illustrating the principle of using a CTS frame.
[0054] Figure 6 A schematic diagram illustrating how a CTS frame informs a WIFI connection device in a related technology provided in this application;
[0055] Figure 7 A schematic diagram illustrating how a WIFI connection device is notified via a CTS frame, as provided in this application embodiment;
[0056] Figure 8 A flowchart illustrating a method for obtaining Bluetooth data packets to be transmitted in the next time step, provided in an embodiment of this application;
[0057] Figure 9 A flowchart illustrating a method for predicting the target radio frequency duration occupied by a Bluetooth data packet to be transmitted, provided in an embodiment of this application;
[0058] Figure 10 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of this application;
[0059] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0060] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0061] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0062] First, let me explain the terms used in this application:
[0063] Clear to Send Frame (CTS) is a control frame used in wireless communication for channel occupancy coordination. Its main function is to inform relevant devices in advance of their channel usage plans for a specific time period. In scenarios where Wi-Fi and Bluetooth share the same radio frequency module and antenna, Wi-Fi can send a CTS frame to explicitly inform connected Wi-Fi devices that they do not need to contend for the channel during a specified quiet period, allowing the radio frequency module and antenna to switch to Bluetooth.
[0064] PS frame: In the WIFI protocol, it is a control frame used for power management and device state coordination. Its core function is to coordinate connected devices to enter or exit low-power sleep state.
[0065] In Bluetooth transceiver services, those with high requirements for radio frequency timing mainly include Bluetooth audio based on the Advanced Audio Distribution Profile (A2DP) for transmitting high-quality stereo music between Bluetooth devices, and hearing aids based on the Audio Streaming for Hearing Aids (ASHA) specification for directly receiving audio signals. Bluetooth audio encoding methods are varied, including but not limited to Subband Coding (SBC), Advanced Audio Coding (AAC), Lossless Digital Audio Coding (LDAC), and Low Latency High-Definition Audio Coding (LHDC), each with a different bit rate.
[0066] Bluetooth audio transmission requires strict latency control; for example, each data packet must be sent within 100ms to avoid perceptible stuttering for the user. Furthermore, its encoding formats, such as SBC, AAC, and LDAC, have dynamic bitrate characteristics, leading to fluctuations in data transmission rates. Wi-Fi data transmission needs to maximize radio frequency (RF) occupancy time to improve network speed, but the real-time requirements of Bluetooth audio conflict with the throughput requirements of Wi-Fi. Hearing aids, as a Bluetooth Low Energy (BLE) service, require the transmission of a fixed amount of data at fixed intervals; improper RF allocation can result in intermittent sound or delays.
[0067] Therefore, in electronic devices where Bluetooth and Wi-Fi share the same radio frequency module and antenna, how to balance the radio frequency time allocation of Bluetooth and Wi-Fi is an urgent problem to be solved.
[0068] In related technologies, when Bluetooth data transmission and WIFI data transmission coexist, the radio frequency module and antenna are usually switched to WIFI after the Bluetooth data transmission is completed. The WIFI sends a PS frame to inform the WIFI connected device to enter the transceiver state in order to transmit WIFI data.
[0069] However, Bluetooth uses a mode where it completes the current data transmission first and then switches back to the RF module and antenna for Wi-Fi. Because Bluetooth is a wireless transmission, it is susceptible to environmental interference and time-sharing at the data receiving end, which can lead to data transmission failures and trigger retransmissions. This retransmission makes the actual time Bluetooth occupies the RF uncertain, preventing Wi-Fi from obtaining the accurate silence duration in advance. Consequently, it cannot use the CTS frame strategy, which requires high timing accuracy, to inform the Wi-Fi connection device of the required silence duration.
[0070] When the radio frequency time (i.e., bandwidth usage time) occupied by Bluetooth data transmission is uncertain, Wi-Fi needs to inform the connected Wi-Fi device via PS frames. Please refer to [link to relevant documentation]. Figure 1 , Figure 1 This is a schematic diagram illustrating the principle of PS frame usage provided in this application. The Wi-Fi network sends a PS frame to inform the connected Wi-Fi device to enter sleep mode. The connected Wi-Fi device needs to reply with an acknowledgment (ACK) frame to confirm and complete state synchronization. After confirmation, the RF module and antenna switch to Bluetooth for data transmission. Once the Bluetooth data transmission is complete, the RF module and antenna switch back to Wi-Fi, and Wi-Fi sends another PS frame to inform the connected Wi-Fi device to exit sleep mode and enter transceiver mode, thereby transmitting Wi-Fi data.
[0071] For example, please see Figure 2 , Figure 2 This is a schematic diagram illustrating how a PS frame informs a connected Wi-Fi device in a related technology provided in this application. The Wi-Fi uses the PS frame to inform the connected Wi-Fi device to enter sleep mode, and the RF module and antenna are switched to Bluetooth. Bluetooth has already buffered one data packet before time T0, and another data packet is generated during transmission. In addition, three packets are retransmitted, resulting in the Bluetooth data not being completely transmitted until time T2. Then, the RF module and antenna are switched back to Wi-Fi, and Wi-Fi sends a PS frame to inform the connected Wi-Fi device to enter transceiver mode, and Wi-Fi transmits data.
[0072] In the above method, since the radio frequency (RF) duration required for Bluetooth data transmission cannot be determined, a PS frame is needed to inform the Wi-Fi connected device of the required silence duration. However, the PS frame requires ACK confirmation from the device, resulting in a significantly longer switching time between Wi-Fi and Bluetooth for the RF module and antenna compared to a CTS frame, directly consuming additional bandwidth resources. Furthermore, the PS frame confirmation process and long switching time generate more ineffective bandwidth usage, especially in scenarios where Bluetooth retransmission extends the RF occupancy time, causing the Wi-Fi connected device to wait even longer, further exacerbating the bandwidth waste.
[0073] Therefore, addressing the aforementioned problems in related technologies, this application utilizes a pre-defined prediction model. By combining the transmission rate, reception rate, and retransmission rate of Bluetooth data packets within the current time step, as well as the Bluetooth data packets to be transmitted in the next time step, it accurately predicts the target radio frequency duration required for Bluetooth transmission. This fundamentally solves the pain point of uncertain radio frequency occupancy time caused by environmental interference and retransmissions in related technologies. Furthermore, because a definite target radio frequency duration is available, there is no need to rely on PS frames that require ACK confirmation. The duration is proactively communicated to the connected Wi-Fi device via the CTS frame, ensuring precise silence during the corresponding time period. This reduces bandwidth waste caused by using PS frames.
[0074] To facilitate a better understanding of the method in this application, the following examples illustrate its application scenarios, such as... Figure 3 As shown, Figure 3 This is a schematic diagram of an application scenario shown in this application. The application scenario may include a Bluetooth module 01, an RF switching module 02, and a wireless fidelity module 03.
[0075] The system collects the transmission rate, reception rate, and retransmission rate of Bluetooth module 01 within the current time step, and obtains the Bluetooth data packet to be transmitted in the next time step. This data is then input into a preset prediction model to predict the target radio frequency duration required to transmit the Bluetooth data packet. Subsequently, the target radio frequency duration is sent to the Wi-Fi connected device via a CTS frame through the radio frequency switching module 02 of the wireless fidelity module 03, ensuring the device remains silent during this duration to guarantee the completion of Bluetooth data packet transmission.
[0076] It is understood that this application does not limit the type and quantity of Bluetooth module 01, radio frequency switching module 02 and wireless fidelity module 03. The above scenarios are only used for illustrative purposes and do not limit this application.
[0077] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0078] Figure 4 This is a flowchart illustrating a data transmission method provided in an embodiment of this application. The execution subject of this method can be a data transmission device. This data transmission device can be implemented through a computer program, or through a medium storing the relevant computer program, such as a USB flash drive and / or optical disc, or through a physical device integrating or installing the relevant computer program, such as a chip or electronic device. The electronic device can be a server, server cluster, smart terminal, etc. The method may include the following steps:
[0079] S401. Collect the Bluetooth data packet transmission rate, reception rate, and retransmission rate within the current time step.
[0080] The encoding format of the currently transmitted Bluetooth data is read through the Bluetooth protocol stack. The encoding format includes fixed bit rate encoding or dynamic bit rate encoding.
[0081] Fixed bit rate coding is an encoding method in which the amount of data transmitted per unit time (bit rate) remains constant during the data encoding process. Dynamic bit rate coding is an encoding method in which the bit rate transmitted per unit time is adjusted in real time according to the complexity of the data content.
[0082] If the encoding format is fixed bit rate encoding, the first preset duration is determined as the time step; if the encoding format is dynamic bit rate encoding, the second preset duration is determined as the time step. The second preset duration is longer than the first preset duration.
[0083] The specific values of the first and second preset durations can be determined based on actual application conditions. The second preset duration is longer than the first preset duration because it is determined by the transmission characteristics of dynamic bit rate encoding. Dynamic bit rate encoding adjusts the bit rate per unit time in real time according to the complexity of the data content, resulting in significant fluctuations in the number and size of data packets per unit time. If the same short time step as fixed bit rate encoding, i.e., the first preset duration, is used, the statistical window is too short to smooth out instantaneous fluctuations, causing statistical distortion of parameters such as transmission rate, reception rate, and retransmission rate. Setting a longer second preset duration can cover the fluctuation period of the dynamic bit rate, making the collected parameters closer to the average level of actual transmission, thereby reducing the impact of instantaneous fluctuations on data accuracy and providing reliable input for subsequent prediction models.
[0084] Using a determined time step as the period, the system collects the Bluetooth data packet transmission rate, reception rate, and retransmission rate within the current time step through the preset interface of the radio frequency module or the logs of the Bluetooth protocol layer.
[0085] The transmission rate refers to the actual rate at which Bluetooth transmits data within that time step. The reception rate refers to the actual rate at which Bluetooth receives data within that time step. The retransmission rate refers to the proportion of retransmitted data packets to the total number of transmitted data packets within that time step.
[0086] S402, Obtain the Bluetooth data packets to be transmitted in the next time step.
[0087] In this embodiment, the Bluetooth data packets to be transmitted in the next time step consist of two parts: one part is the remaining Bluetooth data packets to be transmitted at the end of the current time step, and the other part is the newly generated Bluetooth data packets in the next time step.
[0088] In actual Bluetooth operations, data generation is real-time and dynamic; it's not a one-time generation and transmission of all data. For example, when playing Bluetooth music, the audio source continuously generates new audio data packets at fixed intervals. Similarly, when a hearing aid transmits sound data, it also collects and generates new audio frames in real time.
[0089] The remaining data packets to be transmitted at the end of the current time step are simply historical data that was not fully transmitted in the previous stage. During the transmission of the next time step, new data packets will inevitably be continuously generated and added to the transmission queue. If only the remaining data is used to calculate the amount of data to be transmitted, it is equivalent to assuming that no new data will be generated in the next time step. This is inconsistent with the actual data generation logic of Bluetooth services and will lead to the predicted amount of data to be transmitted being far less than the actual demand.
[0090] S403. Input the transmission rate, reception rate, retransmission rate and the Bluetooth data packet to be transmitted into the preset prediction model to predict the target radio frequency duration occupied by transmitting the Bluetooth data packet to be transmitted.
[0091] In this embodiment, the prediction model is pre-trained, wherein the prediction model can be trained from an initial neural network model.
[0092] The specific training process can be as follows: First, construct a dataset covering different Bluetooth encoding formats, service types, and interference environments. Collect data from this dataset, including transmission rate, reception rate, retransmission rate, total number of data packets to be transmitted, and corresponding actual radio frequency (RF) duration for each scenario. Use the transmission rate, reception rate, retransmission rate, and total number of data packets to be transmitted as input feature data, and the actual RF duration as a label. After cleaning and normalization, divide the dataset into training and validation sets. Then, based on the initial neural network, use mean squared error as the loss function and iteratively train multiple times until a preset iteration stopping condition is met, allowing the model to learn the mapping relationship between the input feature data and the RF duration. Finally, evaluate the model's generalization ability using a test set. After achieving the target, perform lightweight processing to obtain the trained prediction model.
[0093] Therefore, by inputting the transmission rate, reception rate, retransmission rate of Bluetooth data within the current time step, as well as the Bluetooth data packets to be transmitted, into a pre-trained prediction model, the target radio frequency duration occupied by transmitting the Bluetooth data packets to be transmitted can be predicted.
[0094] S404. The target radio frequency duration is sent to the Wi-Fi connected device via the Clear Sending CTS frame of Wi-Fi. The target radio frequency duration is used to keep the Wi-Fi connected device silent within the target radio frequency duration so that the Bluetooth data packets to be transmitted can be transmitted.
[0095] In this embodiment, the WIFI transmits the target radio frequency duration to the WIFI-connected device via a CTS frame. Please refer to [link to relevant documentation]. Figure 5 , Figure 5 This application provides a schematic diagram illustrating the principle of CTS frame usage. Before the RF module and antenna switch to Bluetooth, the Wi-Fi uses a CTS frame to inform the Wi-Fi connected device of the silence duration. During this time, the RF module and antenna switch to Bluetooth for data transmission. The CTS frame does not require a response from the Wi-Fi connected device, thus allowing for a faster switch from Wi-Fi to Bluetooth. After Bluetooth transmission and reception are complete or a predetermined time has elapsed, the RF module and antenna switch back to Wi-Fi for data transmission. In related technologies, the RF module and antenna can also be allocated to Bluetooth and Wi-Fi according to a preset fixed duration ratio. In this method, Wi-Fi can inform the Wi-Fi connected device of the specific silence duration via a CTS frame, and after the silence duration is reached, the connection is unconditionally switched to Wi-Fi for data transmission. However, in this method, Bluetooth data may not be fully transmitted due to accumulated retransmissions, leading to Bluetooth service abnormalities.
[0096] For example, please see Figure 6 , Figure 6This is a schematic diagram illustrating how a CTS frame informs a Wi-Fi connected device in a related technology provided in this application. The Wi-Fi sends a CTS frame to inform the connected device to remain silent from time T0 to time T1. Between T0 and T1, Bluetooth fails to send any data packets due to retransmissions, while a new Bluetooth data packet is generated, causing a backlog of Bluetooth data packets. Upon reaching time T1, the RF module and antenna are unconditionally switched to Wi-Fi, preventing the timely delivery of Bluetooth data packets.
[0097] In this embodiment, the target radio frequency duration is accurately calculated using a predictive model based on current transmission parameters such as transmission rate and retransmission rate, and the data packets to be transmitted in the next time step. This pre-calculates the additional transmission needs that Bluetooth may incur due to retransmissions and newly generated data, rather than being a rigid configuration with a fixed duration ratio as in related technologies. Furthermore, CTS frames do not require a response from the Wi-Fi device, the RF module and antenna switch from Wi-Fi to Bluetooth quickly, and the Wi-Fi connected device remains silent within the accurately predicted target radio frequency duration. This prevents an unconditional switchback to Wi-Fi before Bluetooth transmission is complete, thereby reducing the problem of Bluetooth data accumulation due to retransmissions and forced transmission interruptions at the designated time. This ensures that Bluetooth data packets are transmitted completely within the target radio frequency duration, thus guaranteeing normal Bluetooth service operation.
[0098] For example, please see Figure 7 , Figure 7 This is a schematic diagram illustrating how a CTS frame informs a connected Wi-Fi device. Before sending the CTS frame, it is assumed that the Bluetooth retransmission rate for the current time period is 60%, and one data packet has been buffered. Based on the Bluetooth data encoding format, it is determined that Bluetooth will generate another data packet within the time period. The required radio frequency time for Bluetooth in the next time period is calculated to be T0-T2. The Wi-Fi sends this time duration to the connected Wi-Fi device via a CTS frame, informing it that Wi-Fi transmission will resume at T2. The radio frequency module and antenna are switched to Bluetooth at T0, and Bluetooth transmits data packets from T0 to T2. At T2, the radio frequency module and antenna are unconditionally switched to Wi-Fi to transmit Wi-Fi data packets, thereby reducing the bandwidth waste caused by Wi-Fi using PS frames and improving the timeliness of Bluetooth data transmission.
[0099] In the above embodiments of this application, the transmission rate, reception rate, and retransmission rate of Bluetooth data packets within the current time step are collected, and the Bluetooth data packets to be transmitted in the next time step are obtained. The transmission rate, reception rate, retransmission rate, and the Bluetooth data packets to be transmitted are input into a preset prediction model to predict the target radio frequency duration required to transmit the Bluetooth data packets. This target radio frequency duration is then sent to the Wi-Fi connected device via a Clear Transmit (CTS) frame in Wi-Fi, ensuring that the Wi-Fi connected device remains silent during the target radio frequency duration, allowing the Bluetooth data packets to be transmitted to complete. This method, based on a prediction model, accurately predicts the target radio frequency duration required for Bluetooth, thus solving the problem of uncertain duration. Based on the target radio frequency duration, the Wi-Fi CTS frame informs the Wi-Fi connected device to remain silent during the corresponding time period, replacing the PS frame in related technologies, thereby reducing bandwidth waste.
[0100] Furthermore, based on the above embodiments, the following embodiments illustrate the process of obtaining Bluetooth data packets to be transmitted in the next time step.
[0101] Please see Figure 8 , Figure 8 This application provides a flowchart illustrating a method for obtaining Bluetooth data packets to be transmitted in the next time step, which may include the following steps:
[0102] S801. Obtain the remaining Bluetooth data packets to be transmitted when the current time step ends.
[0103] At the end of the current time step, the total number of data packets that have not yet been transmitted is read from the transmission queue interface of the Bluetooth protocol stack. This total number can be determined by the number of remaining data packets or the total number of bytes in the acquisition queue, and it directly reflects the transmission tasks that were not completed in the previous time step.
[0104] S802. Determine the newly generated Bluetooth data packets in the next time step based on the encoding format.
[0105] If the encoding format is fixed bit rate encoding, then obtain the fixed bit rate data corresponding to the fixed bit rate encoding, multiply the fixed bit rate data with the next time step, and determine the data after multiplication as the first total number of newly generated bytes in the next time step.
[0106] If the encoding format is dynamic bit rate encoding, the total amount of data actually transmitted within the current time step is obtained. Based on the total amount of data and the current time step, the total amount of data is divided by the current time step, and the result of the division is determined as the average bit rate data. Then, the average bit rate data is multiplied by the next time step, and the result of the multiplication is determined as the second total number of bytes newly generated within the next time step.
[0107] Based on the preset data packet length strategy for Bluetooth transmission, the newly generated Bluetooth data packets in the next time step are determined according to the first total number of bytes or the second total number of bytes.
[0108] For example, the first or second total number of bytes obtained can be divided by the preset fixed number of bytes per packet, and the result can be rounded up to the nearest integer to obtain the number of newly generated Bluetooth data packets in the next time step.
[0109] S803: Add the remaining Bluetooth data packets to be transmitted to the newly generated Bluetooth data packets, and determine the data packets after addition as the Bluetooth data packets to be transmitted in the next time step.
[0110] By adding the values together, the remaining Bluetooth data packets to be transmitted are combined with the number of newly generated Bluetooth data packets. The sum is then used to determine the total number of Bluetooth data packets to be transmitted in the next time step, thus fully covering the transmission needs of both the remaining historical data and the newly generated data.
[0111] S804: Obtain the Bluetooth data packets to be transmitted in the next time step.
[0112] The Bluetooth data packets to be transmitted within the next time step determined by the above steps are obtained through the preset data call interface.
[0113] In the above embodiments of this application, by specifically calculating the total number of bytes of newly generated data in the next time step based on the differences in Bluetooth encoding formats, and then combining this with a preset data packet length strategy to determine the number of newly generated data packets, accurate adaptation calculation of the newly generated data volume can be achieved. For fixed bit rate encoding, the fixed bit rate is directly multiplied by the next time step to ensure that the data volume calculation conforms to its stable rate characteristics. For dynamic bit rate encoding, the average bit rate is calculated based on the actual total data volume in the current time step and then multiplied by the next time step to adapt to its rate fluctuation characteristics. Combining this with a preset data packet length strategy to convert it into the number of data packets reduces the adaptation deviation of the fixed calculation method for different encoding formats and ensures that the calculation of the newly generated data volume can cover the needs of real transmission scenarios. This provides a reliable new data foundation for accurately calculating the total amount of data to be transmitted in the next time step and accurately predicting the target radio frequency duration, thereby ensuring the effectiveness of Bluetooth and WIFI radio frequency coordination and reducing bandwidth waste.
[0114] Furthermore, based on any of the above embodiments, the following embodiments illustrate the process of inputting the transmission rate, reception rate, retransmission rate, and the Bluetooth data packet to be transmitted into a preset prediction model to predict the target radio frequency duration occupied by transmitting the Bluetooth data packet to be transmitted.
[0115] Please see Figure 9 , Figure 9 A flowchart illustrating a method for predicting the target radio frequency duration occupied by a Bluetooth data packet to be transmitted, provided in an embodiment of this application, is included. The method may include the following steps:
[0116] S901. Standardize the transmission rate and reception rate to obtain the standardized transmission rate and reception rate.
[0117] Based on a preset standardization algorithm, the transmission rate and reception rate are standardized so that the standardized transmission rate and reception rate are mapped to the range of 0-1, thus obtaining the standardized transmission rate and reception rate.
[0118] S902. The retransmission rate is weighted to obtain the weighted retransmission rate.
[0119] Read the preset retransmission rate weighting coefficient, multiply the original retransmission rate collected within the current time step by the preset retransmission rate weighting coefficient, and obtain the weighted retransmission rate.
[0120] By increasing the weight of retransmission rate in the model input, the model pays more attention to the impact of retransmission, a key interference factor, on radio frequency duration, thus adapting to the actual scenario where retransmissions cause extended duration in Bluetooth transmission.
[0121] S903: Input the standardized transmission rate and reception rate, the weighted retransmission rate, and the Bluetooth data packet to be transmitted into the preset prediction model to obtain the basic radio frequency duration occupied by transmitting the Bluetooth data packet to be transmitted.
[0122] The standardized transmit rate, standardized receive rate, weighted transmit rate, and number of Bluetooth data packets to be transmitted are combined into an input vector according to the order agreed upon during model training. A pre-trained prediction model is then invoked, with the input vector passed to the model through the prediction model inference interface. The model performs forward computation using the pre-trained weight parameters and outputs a numerical result, which represents the basic radio frequency duration required to transmit the data packets.
[0123] S904. Based on the basic radio frequency duration, predict the target radio frequency duration to be used for transmitting the Bluetooth data packets to be transmitted.
[0124] If the base radio frequency duration is greater than the time step, then the time step is determined as the target radio frequency duration to be used to transmit the Bluetooth data packets to be transmitted.
[0125] If the base radio frequency duration exceeds the time step, it means Bluetooth will need to occupy more time for transmission, which will crowd out Wi-Fi transmission resources in the next time step and disrupt the overall scheduling rhythm. Setting the time step to an upper limit ensures that Bluetooth transmission is completed strictly within the current scheduling cycle, without affecting the normal use of subsequent Wi-Fi, thereby maintaining the stability of both transmissions.
[0126] If the base radio frequency duration is less than the preset radio frequency duration, the preset radio frequency duration is determined as the target radio frequency duration to be used for transmitting the Bluetooth data packets to be transmitted. The preset radio frequency duration is less than the time step.
[0127] The preset radio frequency duration is the minimum effective transmission time set based on hardware characteristics. If the basic radio frequency duration is too short, Bluetooth will end its transmission as soon as it begins occupying the radio frequency, causing the radio frequency module and antenna to frequently switch between Wi-Fi and Bluetooth. Since each switch has a slight delay, frequent switching will accumulate and waste bandwidth resources, and may also cause data transmission interruptions. Setting the preset radio frequency duration to a lower limit ensures that Bluetooth occupies the radio frequency for a sufficient amount of time to complete effective data transmission, reducing unnecessary switching losses.
[0128] If the base radio frequency duration is greater than or equal to the preset radio frequency duration, and less than or equal to the time step, then the base radio frequency duration is determined as the predicted radio frequency duration occupied by the Bluetooth data packets to be transmitted.
[0129] When the basic radio frequency duration is within this range, it means that it meets the actual needs of Bluetooth data transmission without exceeding the current scheduling cycle, i.e., the time step, thus maximizing the utilization efficiency of radio frequency resources and ensuring that Bluetooth and WIFI services do not experience any abnormalities.
[0130] In the above embodiments of this application, by standardizing the transmission and reception rates, model input bias caused by differences in units or magnitudes is eliminated. The retransmission rate is weighted to strengthen its influence on radio frequency (RF) duration. The processed features and the data packets to be transmitted are input into the model to obtain the basic RF duration. The target RF duration is determined by constraints of an upper limit for the time step and a preset lower limit for the duration. This process ensures the effectiveness of the model input features and the prominence of key factors, improves the accuracy of basic duration prediction, effectively reduces transmission conflicts between Bluetooth and Wi-Fi, and reduces bandwidth waste while improving the stability of Bluetooth services.
[0131] Figure 10 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of this application, as shown below. Figure 10 As shown, it includes:
[0132] The acquisition module 1001 is used to acquire the transmission rate, reception rate and retransmission rate of Bluetooth data packets within the current time step.
[0133] The acquisition module 1002 is used to acquire the Bluetooth data packets to be transmitted in the next time step.
[0134] The prediction module 1003 is used to input the transmission rate, reception rate, retransmission rate and the Bluetooth data packet to be transmitted into a preset prediction model to predict the target radio frequency duration occupied by transmitting the Bluetooth data packet to be transmitted.
[0135] The transmitting module 1004 is used to send the target radio frequency duration to the Wi-Fi connected device via the Clear Transmission CTS frame of Wi-Fi. The radio frequency duration is used to keep the Wi-Fi connected device silent during the radio frequency duration so that the Bluetooth data packets to be transmitted can be transmitted.
[0136] One possible implementation is that the acquisition module 1001 is specifically used for:
[0137] The encoding format for acquiring Bluetooth data includes fixed bit rate encoding or dynamic bit rate encoding.
[0138] If the encoding format is fixed bit rate encoding, then the first preset duration is determined as the time step.
[0139] If the encoding format is dynamic bit rate encoding, then the second preset duration is determined as the time step, and the second preset duration is longer than the first preset duration.
[0140] Collect the Bluetooth data packet transmission rate, reception rate, and retransmission rate within the current time step.
[0141] One possible implementation is to obtain module 1002, specifically used for:
[0142] Get the remaining Bluetooth data packets to be transmitted when the current time step ends.
[0143] Based on the encoding format, determine the newly generated Bluetooth data packets in the next time step.
[0144] The remaining Bluetooth data packets to be transmitted are added to the newly generated Bluetooth data packets, and the resulting data packet is determined as the Bluetooth data packet to be transmitted in the next time step.
[0145] Get the Bluetooth data packets to be transmitted in the next time step.
[0146] One possible implementation is to obtain module 1002, specifically used for:
[0147] If the encoding format is fixed bit rate encoding, then obtain the fixed bit rate data corresponding to the fixed bit rate encoding.
[0148] The fixed bit rate data is multiplied by the next time step, and the result of the multiplication is determined as the first total number of bytes newly generated in the next time step.
[0149] If the encoding format is dynamic bit rate encoding, then obtain the total amount of data actually transmitted within the current time step.
[0150] Determine the average bit rate based on the total data volume and the current time step.
[0151] The average bit rate data is multiplied by the next time step, and the result of the multiplication is determined as the second total number of bytes newly generated in the next time step.
[0152] Based on the preset data packet length strategy for Bluetooth transmission, the newly generated Bluetooth data packets in the next time step are determined according to the first total number of bytes or the second total number of bytes.
[0153] One possible implementation is that the prediction module 1003 is specifically used for:
[0154] The transmission rate and reception rate are standardized to obtain the standardized transmission rate and reception rate.
[0155] The retransmission rate is weighted to obtain the weighted retransmission rate.
[0156] The standardized transmission rate and reception rate, the weighted retransmission rate, and the Bluetooth data packets to be transmitted are input into a preset prediction model to obtain the basic radio frequency duration occupied by transmitting the Bluetooth data packets to be transmitted.
[0157] Based on the base radio frequency duration, predict the target radio frequency duration to be used for transmitting the Bluetooth data packets to be transmitted.
[0158] One possible implementation is that the prediction module 1003 is specifically used for:
[0159] If the base radio frequency duration is greater than the time step, then the time step is determined as the target radio frequency duration to be used to transmit the Bluetooth data packets to be transmitted.
[0160] If the base radio frequency duration is less than the preset radio frequency duration, the preset radio frequency duration is determined as the target radio frequency duration to be used for transmitting the Bluetooth data packets to be transmitted. The preset radio frequency duration is less than the time step.
[0161] If the base radio frequency duration is greater than or equal to the preset radio frequency duration, and less than or equal to the time step, then the base radio frequency duration is determined as the predicted radio frequency duration occupied by the Bluetooth data packets to be transmitted.
[0162] The data transmission device provided in this embodiment can execute the data transmission method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0163] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 11 As shown, the electronic device provided in this embodiment includes at least one processor 1101 and a memory 1102. Optionally, the device further includes a communication component 1103. The processor 1101, memory 1102, and communication component 1103 are connected via a bus 1104.
[0164] In a specific implementation, at least one processor 1101 executes computer execution instructions stored in memory 1102, causing at least one processor 1101 to perform the above-described method.
[0165] The specific implementation process of processor 1101 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0166] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0167] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0168] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0169] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0170] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0171] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory, electrically erasable programmable read-only memory, erasable programmable read-only memory, programmable read-only memory, read-only memory, magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0172] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0173] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0174] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0175] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0176] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0177] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0178] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A data transmission method, characterized in that, include: Collect the Bluetooth data packet transmission rate, reception rate, and retransmission rate within the current time step; Obtain the Bluetooth data packets to be transmitted in the next time step; The transmission rate, the reception rate, the retransmission rate, and the Bluetooth data packet to be transmitted are input into a preset prediction model to predict the target radio frequency duration occupied by transmitting the Bluetooth data packet to be transmitted. The target radio frequency duration is sent to the Wi-Fi connected device via a Clear Transmit (CTS) frame in Wi-Fi. The target radio frequency duration is used to keep the Wi-Fi connected device silent during the target radio frequency duration so that the Bluetooth data packet to be transmitted can be transmitted.
2. The method according to claim 1, characterized in that, The collection of Bluetooth data packet transmission rate, reception rate, and retransmission rate within the current time step includes: The encoding format for acquiring Bluetooth data includes fixed bit rate encoding or dynamic bit rate encoding. If the encoding format is the fixed bit rate encoding, then the first preset duration is determined as the time step. If the encoding format is the dynamic bit rate encoding, then the second preset duration is determined as the time step, and the second preset duration is longer than the first preset duration; Collect the Bluetooth data packet transmission rate, reception rate, and retransmission rate within the current time step.
3. The method according to claim 2, characterized in that, The acquisition of the Bluetooth data packets to be transmitted in the next time step includes: Get the remaining Bluetooth data packets to be transmitted when the current time step ends; Based on the encoding format, determine the newly generated Bluetooth data packets in the next time step; The remaining Bluetooth data packets to be transmitted are added to the newly generated Bluetooth data packets, and the data packets resulting from the addition are determined as the Bluetooth data packets to be transmitted in the next time step. Obtain the Bluetooth data packets to be transmitted in the next time step.
4. The method according to claim 3, characterized in that, The step of determining the newly generated Bluetooth data packet in the next time step according to the encoding format includes: If the encoding format is the fixed bit rate encoding, then obtain the fixed bit rate data corresponding to the fixed bit rate encoding; The fixed bit rate data is multiplied by the next time step, and the multiplied data is determined as the first total number of bytes newly generated in the next time step. If the encoding format is the dynamic bit rate encoding, then obtain the total amount of data actually transmitted within the current time step; The average bit rate data is determined based on the total data volume and the current time step. The average bit rate data is multiplied by the next time step, and the multiplied data is determined as the second total number of bytes newly generated in the next time step. Based on the preset data packet length strategy for Bluetooth transmission, the newly generated Bluetooth data packets in the next time step are determined according to the first total number of bytes or the second total number of bytes.
5. The method according to claim 1, characterized in that, The step of inputting the transmission rate, the reception rate, the retransmission rate, and the Bluetooth data packet to be transmitted into a preset prediction model to predict the target radio frequency duration occupied by transmitting the Bluetooth data packet to be transmitted includes: The transmission rate and the reception rate are standardized to obtain the standardized transmission rate and reception rate. The retransmission rate is weighted to obtain the weighted retransmission rate. The standardized transmission rate and reception rate, the weighted retransmission rate, and the Bluetooth data packet to be transmitted are input into a preset prediction model to obtain the basic radio frequency duration occupied by transmitting the Bluetooth data packet to be transmitted. Based on the basic radio frequency duration, predict the target radio frequency duration to be used for transmitting the Bluetooth data packet to be transmitted.
6. The method according to claim 5, characterized in that, The step of predicting the target radio frequency duration for transmitting the Bluetooth data packet to be transmitted based on the basic radio frequency duration includes: If the base radio frequency duration is greater than the time step, then the time step is determined as the predicted target radio frequency duration for transmitting the Bluetooth data packet to be transmitted. If the base radio frequency duration is less than the preset radio frequency duration, then the preset radio frequency duration is determined as the predicted target radio frequency duration occupied by transmitting the Bluetooth data packet to be transmitted, and the preset radio frequency duration is less than the time step. If the basic radio frequency duration is greater than or equal to the preset radio frequency duration and less than or equal to the time step, then the basic radio frequency duration is determined as the predicted radio frequency duration occupied by transmitting the Bluetooth data packet to be transmitted.
7. A data transmission device, characterized in that, include: The acquisition module is used to collect the Bluetooth data packet transmission rate, reception rate, and retransmission rate within the current time step. The acquisition module is used to acquire the Bluetooth data packets to be transmitted in the next time step; The prediction module is used to input the transmission rate, the reception rate, the retransmission rate and the Bluetooth data packet to be transmitted into a preset prediction model to predict the target radio frequency duration occupied by transmitting the Bluetooth data packet to be transmitted. The transmitting module is used to send the target radio frequency duration to the Wi-Fi connected device via a Clear Transmit (CTS) frame of Wi-Fi. The radio frequency duration is used to keep the Wi-Fi connected device silent during the radio frequency duration so that the Bluetooth data packet to be transmitted can be transmitted.
8. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-6.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-6.