Data transmission method, apparatus, device, storage medium, and computer program product

By dynamically adjusting the data packet type to short packets during data transmission, and combining this with the terminal's data transmission status and environmental conditions, the problem of poor anti-interference performance caused by long packet encapsulation is solved, thereby improving data transmission stability and user experience.

CN119544144BActive Publication Date: 2026-02-10GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311122422.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-31
Publication Date
2026-02-10
Estimated Expiration
2043-08-31

AI Technical Summary

Technical Problem

During data transmission, when data packets are encapsulated using long packet types, the terminal's anti-interference performance is poor. Especially in complex usage environments, it is easily affected by sudden interference, leading to data packet retransmission, which affects the stability of data transmission and user experience.

Method used

By acquiring the terminal's data transmission status and transmission environment status, the data packet type is dynamically adjusted to a short packet type for encapsulation. Short packets occupy fewer time slots when sent, reducing the probability of interference and making retransmission more likely to succeed.

Benefits of technology

It improves the terminal's anti-interference performance, enhances data transmission stability and user experience, and reduces the waste of data packet retransmission and lag.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544144B_ABST
    Figure CN119544144B_ABST
Patent Text Reader

Abstract

The application relates to a data transmission method, device, equipment, storage medium and computer program product. The method comprises the following steps: in the process of data packet encapsulation of to-be-transmitted data, obtaining a current transmission data state and a transmission environment state of a terminal; according to the transmission data state and the transmission environment state, determining a data packet type corresponding to the to-be-transmitted data, and performing data packet encapsulation on the to-be-transmitted data according to the data packet type to obtain a plurality of target data packets; wherein the number of time slots occupied by a single data packet corresponding to different data packet types is different when the single data packet is sent. The method can improve the anti-interference performance of the terminal in the data transmission process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data transmission technology, and in particular to a data transmission method, apparatus, device, storage medium, and computer program product. Background Technology

[0002] During data transmission, the data to be transmitted needs to be encapsulated into data packets before transmission. Generally speaking, data packets are divided into long packets and short packets. Long packets are those with a larger data size after encapsulation and occupy more time slots during transmission. Short packets are those with a smaller data size after encapsulation and occupy fewer time slots during transmission.

[0003] In traditional technologies, long data packets are typically used to encapsulate the data to be transmitted in order to maximize data transmission rates. However, this approach often results in poor anti-interference performance for the terminal during data transmission. Summary of the Invention

[0004] This application provides a data transmission method, apparatus, device, storage medium, and computer program product that can improve the anti-interference performance of a terminal during data transmission.

[0005] Firstly, this application provides a data transmission method. The method includes:

[0006] During the process of encapsulating data packets for transmission, the current transmission data status and transmission environment status of the terminal are obtained.

[0007] Based on the transmission data status and the transmission environment status, the data packet type corresponding to the data to be transmitted is determined, and the data packet to be transmitted is encapsulated according to the data packet type to obtain multiple target data packets;

[0008] Among them, the number of time slots occupied by a single data packet varies depending on the data packet type.

[0009] Secondly, this application also provides a data transmission apparatus. The apparatus includes:

[0010] The acquisition module is used to acquire the current data transmission status and transmission environment status of the terminal during the process of data packet encapsulation of the data to be transmitted.

[0011] The encapsulation module is used to determine the data packet type corresponding to the data to be transmitted based on the transmission data status and the transmission environment status, and to encapsulate the data to be transmitted according to the data packet type to obtain multiple target data packets;

[0012] Among them, the number of time slots occupied by a single data packet varies depending on the data packet type.

[0013] Thirdly, this application also provides an electronic device. The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described in the first aspect above.

[0014] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the method described in the first aspect above.

[0015] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the method described in the first aspect above.

[0016] The aforementioned data transmission method, apparatus, device, storage medium, and computer program product acquire the current transmission data state and transmission environment state of the terminal during the data packet encapsulation process for the data to be transmitted. Then, based on the transmission data state and transmission environment state, they determine the data packet type corresponding to the data to be transmitted, and encapsulate the data to be transmitted according to the data packet type to obtain multiple target data packets. Different data packet types correspond to different numbers of time slots occupied by a single data packet during transmission. The embodiments of this application can dynamically adjust the number of time slots used by the terminal during data packet encapsulation based on the terminal's transmission data state and transmission environment state. Depending on the packet type, for example, when the data transmission rate requirement of the terminal is relatively low and the environmental interference of the transmission environment is relatively high, the short packet data type can be selected for data packet encapsulation. In this way, because the short packet has a small data volume and occupies fewer time slots when a single data packet is sent, the probability of the short packet "colliding" with environmental interference is lower. Furthermore, even if the short packet is retransmitted due to environmental interference, it can be retransmitted in a shorter time compared to the long packet data type used in traditional technology, making it easier to successfully transmit, thereby improving the anti-interference performance of the terminal. Attached Figure Description

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

[0018] Figure 1 This is an exemplary diagram illustrating the data interaction behavior between a terminal and a TWS earphone under three data packet types: 2DH1, 2DH3, and 2DH5.

[0019] Figure 2 This is an exemplary diagram illustrating a sudden interference during data interaction between a terminal and a TWS earphone.

[0020] Figure 3 This is a diagram illustrating the implementation environment of a data transmission method in one embodiment.

[0021] Figure 4 Here is a flowchart of a data transmission method in one embodiment;

[0022] Figure 5 This is an exemplary diagram illustrating how a terminal and a Bluetooth audio device periodically perform noise scanning in another embodiment.

[0023] Figure 6 This is a flowchart illustrating step 402 in another embodiment;

[0024] Figure 7 This is a flowchart illustrating step 402 in another embodiment;

[0025] Figure 8 This is a schematic diagram illustrating an exemplary packet type adjustment in another embodiment;

[0026] Figure 9 This is a structural block diagram of a data transmission device in one embodiment;

[0027] Figure 10 This is a diagram of the internal structure of an electronic device in one embodiment. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0029] During data transmission, the data to be transmitted needs to be encapsulated into data packets before transmission. Generally speaking, data packets are divided into long packets and short packets. Long packets are those with a larger data size after encapsulation and occupy more time slots during transmission. Short packets are those with a smaller data size after encapsulation and occupy fewer time slots during transmission.

[0030] In traditional technologies, long data packets are typically used to encapsulate the data to be transmitted in order to maximize data transmission rates. However, this approach results in poor interference resistance for the terminal during data transmission.

[0031] For example, the data interaction between TWS (True Wireless Stereo) earbuds and the terminal in a Bluetooth data transmission scenario will be used as an example. With the maturity of TWS technology, TWS earbuds have become extremely popular due to their portability, and the environments in which users use TWS earbuds are becoming increasingly complex, including outdoor environments, offices, airports, and train stations. Taking the commonly used 2Mbps transmission rate as an example, the audio data packet types transmitted between the terminal and the TWS earbuds include three types: 2DH1, 2DH3, and 2DH5. The data interaction behavior between the terminal and the TWS earbuds under these three data packet types is as follows: Figure 1 As shown.

[0032] Please refer to Figure 1 In a scenario where a terminal connects to TWS earbuds to play music, the terminal transmits data packets (i.e., data packets encapsulated according to the corresponding data packet format) to the TWS earbuds. The TWS earbuds then return an acknowledgment packet (ACK indicates that the TWS earbuds have successfully received the data packet sent by the terminal, and NAK indicates that the TWS earbuds have not successfully received the data packet sent by the terminal). Figure 1 In the interaction behavior corresponding to the three data packet types 2DH1, 2DH3, and 2DH5, "T" represents the data packet sent by the terminal (TX) to the TWS earphone, and "A" represents the confirmation packet replied by the TWS earphone.

[0033] like Figure 1 As shown, in the 2DH1 interaction, the data packets (P0, P1, P2, ..., P5) sent by the terminal to the TWS earphone each occupy one slot, and the acknowledgment packets (P0-ACK, P1-ACK, ..., P5-ACK) sent by the TWS earphone each occupy one slot; in the 2DH3 interaction, the data packets (P0, P1, P2) sent by the terminal to the TWS earphone each occupy three slots, and the acknowledgment packets (P0-ACK, P1-ACK, P2-ACK) sent by the TWS earphone each occupy one slot; in the 2DH5 interaction, the data packets (P0, P1) sent by the terminal to the TWS earphone each occupy five slots, and the acknowledgment packets (P0-ACK, P1-ACK) sent by the TWS earphone each occupy one slot.

[0034] Because the air efficiency (equivalent to the number of time slots occupied when a single data packet of each data packet type is sent) and the size of the effective data volume (payload) in the encapsulated data packet are different for each data packet type, the maximum throughput for each data packet type is different, as shown in Table 1:

[0035] Data packet type Payload header (bytes) User payload (bytes) Max RATE (kbps) 2DH1 2 0-54 345.6 2DH2 2 0-367 1117.4 2DH3 2 0679 1448.5

[0036] Table 1

[0037] In this table, the payload header represents the size of the header data, the user payload represents the size of a single data packet corresponding to the 2DH1, 2DH2, and 2DH3 data packet types, and the maximum rate represents the maximum transmission rate for the three data packet types. As shown in Table 1, data packet types with larger single-packet data sizes have higher maximum transmission rates. Therefore, in traditional technologies, during data transmission between the terminal and TWS earphones, the 2DH5 type is preferentially used to encapsulate the Bluetooth data to be transmitted, thereby maximizing the Bluetooth data transmission rate and ensuring users enjoy higher sound quality. In other words, traditional technologies achieve better sound quality through higher transmission rates and gain more idle time and retransmission opportunities.

[0038] However, compared to wired headphones, TWS headphones use short-range wireless communication technology (specifically Bluetooth communication technology). Their data transmission process is more susceptible to interference from other surrounding electromagnetic signals. In particular, Bluetooth uses the unlicensed ISM 2.4G band, which is also used by many devices, such as microwave ovens, cordless phones, infrared devices, and wireless cameras. Therefore, the Bluetooth signal of TWS headphones is easily interfered with by surrounding signals. Traditional technologies that prioritize using 2DH5 data packets to encapsulate the Bluetooth data to be transmitted cannot achieve good performance in heavily interfered scenarios.

[0039] For example, please combine Figure 2 , Figure 2This diagram illustrates a sudden interference event during data interaction between a terminal and TWS earphones. In real-world environments, interference is typically sudden. Traditional technologies preferentially use 2DH5 data packets. Since a single 2DH5 packet occupies 5 slots, meaning it takes a relatively long time to reach the air interface (compared to 3 slots for a 2DH3 packet and 1 slot for a 2DH1 packet), 2DH5 packets are more likely to encounter sudden interference. Furthermore, when a 2DH5 packet is interfered with and needs to be retransmitted, it must be retransmitted again, wasting air interface resources. If continuous transmission / retransmission of 2DH5 packets encounters a sudden retransmission, the user will experience stuttering or buffering while listening to music.

[0040] In view of this, embodiments of this application propose a data transmission method that can improve the anti-interference performance of a terminal. The data transmission method of this application embodiments will be described below in conjunction with the implementation environment in which it can be applied.

[0041] The data transmission method provided in this application embodiment can be applied to, for example... Figure 3 In the implementation environment shown, terminal 102 communicates with peer 104 via a network. During the data packet encapsulation process, terminal 102 obtains its current data transmission status and transmission environment status. Based on these statuses, terminal 102 determines the data packet type corresponding to the data to be transmitted and encapsulates the data according to the data packet type to obtain multiple target data packets. Terminal 102 then sends these multiple target data packets to peer 104. The number of time slots occupied by a single data packet varies depending on the data packet type.

[0042] Both terminal 102 and peer 104 can be, but are not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, portable wearable devices, etc.; among them, IoT devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, smart cars, etc., and portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, headphones, etc.

[0043] In one embodiment, such as Figure 4 As shown, a data transmission method is provided, which is applied to... Figure 3 Taking terminal 102 as an example, the explanation includes the following steps:

[0044] Step 401: During the process of encapsulating data packets for transmission, the terminal obtains the current transmission data status and transmission environment status.

[0045] The data transmission status can characterize the data transmission rate requirement of the terminal in the current data transmission process. The data transmission status can be in the form of the status value corresponding to the data transmission status.

[0046] For example, taking the data transmission process as the terminal sending data packets to TWS earphones, the larger the state value of the data transmission status, the higher the current data transmission rate requirement (i.e., the sound quality requirement for the TWS earphones to play audio), and conversely, the smaller the state value of the data transmission status, the lower the current data transmission rate requirement.

[0047] In this embodiment of the application, the data transmission status may include the current encoding bitrate of the terminal, which may be the audio bitrate or the video bitrate.

[0048] Continuing with the example of the terminal sending data packets to TWS earphones, the higher the current encoding bitrate of the terminal, the higher the sound quality of the current audio. Correspondingly, a higher Bluetooth data transmission rate is needed to support audio at this encoding bitrate without stuttering. When the encoding bitrate is lower, the sound quality of the current audio is lower. Correspondingly, the required Bluetooth data transmission rate can also be lower, and it is not easy to stutter.

[0049] Generally, a terminal can adaptively adjust its current encoding bitrate. For example, when the data transmission rate requirement is high, the terminal can increase the encoding bitrate to send more data in the same amount of time, thereby improving the data transmission rate. Conversely, when the data transmission rate requirement is low, the terminal can correspondingly decrease the encoding bitrate. The data transmission rate requirement can be user input obtained by the terminal, or it can be determined by the terminal itself based on relevant reference information (such as the current transmission environment).

[0050] In this embodiment, the terminal can periodically count and store the terminal's encoding rate. In this way, during the process of encapsulating data packets of the data to be transmitted, the terminal can directly read the encoding rate of the most recent periodic count. In other possible implementations, the terminal can also actively count the terminal's encoding rate when data to be transmitted is generated and data packets need to be encapsulated, and so on.

[0051] The terminal can calculate the current encoding bitrate by calculating the rate at which the codec in the terminal sends the encoded data to the other side (e.g., the Bluetooth side, such as TWS earphones) within a preset time period (i.e., the amount of data per unit time). The rate of this data is used as the terminal's current encoding bitrate, and the unit of encoding bitrate is kbps.

[0052] Thus, through the above implementation method, during the process of encapsulating the data packets to be transmitted, the terminal obtains the current transmission data status of the terminal, i.e., the encoding code rate.

[0053] The following is an exemplary description of the process by which a terminal obtains its current transmission environment status.

[0054] Similar to the data transmission status, the transmission environment status can characterize the transmission environment conditions during the current data transmission process of the terminal, such as interference in the transmission environment. The transmission environment status can be in the form of the status value corresponding to the transmission environment status.

[0055] For example, the state value of the transmission environment state can be negatively correlated with the environmental quality of the terminal's current transmission environment. For instance, a larger state value indicates a worse environmental quality, while a smaller state value indicates a better environmental quality. As one implementation, the transmission environment state includes at least one of the terminal's current transmission bit error rate and environmental noise energy value.

[0056] Similar to the coding rate, the terminal can periodically calculate and store the terminal's transmission error rate and ambient noise energy value. In this way, during the process of encapsulating data packets for transmission, the terminal can directly read the transmission error rate and ambient noise energy value calculated most recently. In other possible implementations, the terminal can also actively calculate the terminal's transmission error rate and ambient noise energy value when data to be transmitted is generated and data packets need to be encapsulated, and so on.

[0057] First, we introduce how the terminal calculates the transmission error rate. For example, the terminal transmits data packets (i.e., data packets encapsulated according to a certain data packet type) to the other end. The other end will return an acknowledgment packet or may not respond. There are two forms of acknowledgment packets: ACK and NAK. ACK indicates that the other end has successfully received the data packet sent by the terminal, while NAK indicates that the other end has not successfully received the data packet sent by the terminal. Thus, the terminal can count the total number of data packets sent to the other end within a preset time period, the number of ACKs returned by the other end, and the number of NAKs returned by the other end. By subtracting the number of ACKs and NAKs from the total number of data packets, the number of "No Response" messages from the other end can be obtained.

[0058] Thus, the terminal can calculate the packet error rate (PER) using the following formula:

[0059] PER = (Number of NAKs + Number of No Responses) / Total Number of Packets

[0060] Next, we will introduce how the terminal obtains the environmental noise energy value.

[0061] In one implementation, the terminal can scan the electromagnetic wave energy of the communication channels within a preset distance range around the terminal, i.e., the noise energy of the communication channels, to obtain the noise energy value of each communication channel. The terminal can use the noise energy value of each communication channel as the current environmental noise energy value of the terminal, or the terminal can perform statistical processing on the noise energy values ​​of each communication channel to obtain the current environmental noise energy value of the terminal, and so on.

[0062] In other possible implementations, the peer end can scan the electromagnetic wave energy of the communication channels within a preset distance range around the peer end to obtain the noise energy value of each communication channel. Then, the peer end sends the noise energy value of each communication channel to the terminal as the current environmental noise energy value of the terminal. Alternatively, the peer end can send the result of statistical processing of the noise energy value of each communication channel to the terminal as the current environmental noise energy value of the terminal.

[0063] For example, taking the data interaction between the terminal and the Bluetooth audio device as an example, see [link to relevant documentation]. Figure 5 , Figure 5 This is an exemplary diagram illustrating how a terminal and a Bluetooth audio device periodically perform a noise scan. After the terminal connects to the Bluetooth audio device, the terminal or the Bluetooth audio device periodically opens the Bluetooth scanning path to scan the electromagnetic energy of surrounding Bluetooth channels, obtaining the noise energy value of each Bluetooth channel. The higher the noise energy value, the stronger the interference of the Bluetooth channel, and the higher the probability of Bluetooth data transmission failure.

[0064] Thus, through the above implementation method, during the process of encapsulating the data packets to be transmitted, the terminal obtains the current transmission environment status of the terminal, including, for example, the transmission error rate and the environmental noise energy value.

[0065] Step 402: The terminal determines the data packet type corresponding to the data to be transmitted based on the data transmission status and the transmission environment status, and encapsulates the data packet to be transmitted according to the data packet type to obtain multiple target data packets.

[0066] The terminal obtains the current transmission data status and transmission environment status through the above implementation method. Then, it can select the data packet type by combining the data transmission rate requirement represented by the transmission data status and the interference situation in the transmission environment represented by the transmission environment status. Different data packet types correspond to different numbers of time slots occupied by a single data packet when it is sent. Moreover, the number of time slots occupied by a single data packet corresponding to each data packet type when it is sent is positively correlated with the data volume of the single data packet. That is, the more time slots a single data packet occupies when it is sent, the larger the data volume of the single data packet.

[0067] In this embodiment of the application, the current data transmission corresponding to the data to be transmitted is cellular data transmission or short-range wireless communication data transmission.

[0068] During voice calls between a terminal and a peer, data packets are categorized into long packets and short packets. Similarly, during short-range wireless communication data transmission, data packets are also categorized into long packets and short packets. For example, in the Bluetooth data transmission scenario described above, there are three data packet types: 2DH1, 2DH3, and 2DH5. 2DH5 can be understood as a long packet, 2DH3 as a short packet, and so on.

[0069] When a terminal determines the data packet type corresponding to the data to be transmitted based on the data transmission status and the transmission environment status, for example, when the data transmission status indicates that the terminal's current data transmission rate requirement is relatively low and the transmission environment status indicates that the environmental interference in the current transmission environment of the terminal is relatively high, a short packet data packet type can be selected for data packet encapsulation. Because of its small data volume and the small number of time slots occupied by a single data packet during transmission, the probability of a short packet "colliding" with environmental interference is lower. Furthermore, even if a short packet encounters environmental interference and is retransmitted, the short packet can be retransmitted in a shorter time, making it easier to successfully transmit, thereby improving the terminal's anti-interference performance.

[0070] In addition, as mentioned above, the data transmission status may include the terminal's current encoding bit rate, and the transmission environment status may include at least one of the terminal's current transmission error rate and the environmental noise energy value. The process by which the terminal determines the data packet type corresponding to the data to be transmitted based on the encoding bit rate, transmission error rate, and environmental noise energy value will be described in the following embodiments.

[0071] After determining the data packet type in the above manner, the terminal can encapsulate the data to be transmitted into multiple target data packets according to the data size of a single data packet indicated by the data packet type. Then, the terminal sequentially sends each target data packet to the other end according to the number of time slots occupied by a single data packet when it is sent, as indicated by the data packet type.

[0072] The above embodiments obtain the current transmission data status and transmission environment status of the terminal during the data packet encapsulation process. Then, based on the transmission data status and transmission environment status, the data packet type corresponding to the data to be transmitted is determined. Multiple target data packets are then encapsulated according to the data packet type. Different data packet types occupy different numbers of time slots when sending a single data packet. This embodiment can dynamically adjust the data packet type when encapsulating data packets based on the terminal's transmission data status and transmission environment status. For example, when the transmission data status indicates a low data transmission rate requirement and the transmission environment status indicates significant environmental interference in the current transmission environment, a short packet data packet type can be selected for data packet encapsulation. Because short packets have small data volumes and occupy fewer time slots when sent, they are less likely to encounter environmental interference. Furthermore, even if a short packet encounters environmental interference and is retransmitted, compared to the traditional method of encapsulating data packets using long packets, the short packet can be retransmitted in a shorter time, making successful transmission easier and improving the terminal's anti-interference performance.

[0073] In one embodiment, based on Figure 4 The illustrated embodiment can be found in [reference]. Figure 6 This embodiment relates to a process by which a terminal determines the data packet type corresponding to the data to be transmitted based on the data transmission status and the transmission environment status, when the data transmission status includes the terminal's current encoding bit rate and the transmission environment status includes at least one of the terminal's current transmission error rate and environmental noise energy value. For example... Figure 6 As shown, step 402 includes Figure 6 Steps 601 and 602 are shown below:

[0074] Step 601: If the encoding rate is within the encoding rate threshold range, the terminal determines the data packet type based on the transmission error rate.

[0075] The encoding bitrate threshold range can be set manually or in conjunction with the current data transmission scenario of the terminal. For example, the terminal can pre-set the identifiers of various data transmission scenarios and the corresponding relationships of various encoding bitrate threshold ranges. In this way, the terminal can obtain the identifier of the current data transmission scenario and find the corresponding encoding bitrate threshold range in the above-mentioned relationship. Data transmission scenarios include Bluetooth data transmission scenario, WIFI (Wireless Fidelity) transmission scenario, voice call transmission scenario, and so on.

[0076] Taking a custom setting as an example, a first coding bitrate threshold and a second coding bitrate threshold can be set, with the first coding bitrate threshold being greater than the second coding bitrate threshold. The first coding bitrate threshold and the second coding bitrate threshold are used as the two endpoints of the interval to obtain the coding bitrate threshold interval.

[0077] After determining the encoding bitrate threshold range, the terminal first checks whether the current encoding bitrate is within that threshold range.

[0078] The encoding rate threshold range can represent a range of values ​​where the encoding rate is moderate. If the current encoding rate of the terminal is within this encoding rate threshold range, it indicates that the current data transmission rate requirement is moderate or low. That is, the data transmission rate requirement is neither very high nor very low. The terminal can dynamically adjust the data packet type based on the transmission environment.

[0079] Therefore, if the current encoding rate of the terminal is within the encoding rate threshold range, the terminal determines the data packet type based on the transmission error rate.

[0080] like Figure 7 As shown, step 601 may include Figure 7 Steps 701 and 702 are shown below:

[0081] Step 701: If the encoding code rate is within the encoding code rate threshold range and the transmission error rate is less than or equal to the transmission error rate threshold, the terminal determines the data packet type as the first data packet type.

[0082] The first data packet type could be, for example, a long packet type.

[0083] When the encoding bit rate is within the encoding bit rate threshold range, the terminal compares the current transmission bit error rate with the preset transmission bit error rate threshold. The method for setting the transmission bit error rate threshold can be similar to the method for setting the encoding bit rate threshold range mentioned above, and will not be repeated here.

[0084] The transmission error rate (BER) is equivalent to the packet retransmission rate. A higher BER results in a higher packet retransmission rate, and vice versa. If the terminal's current BER is less than or equal to the threshold, the packet retransmission rate is relatively low, indicating a good transmission environment. Therefore, long packet types can be used. In this case, using long packet types ensures that each encapsulated target data packet occupies less air interface time, thus increasing the remaining air interface time and allowing for more retransmission opportunities.

[0085] In summary, when the encoding bit rate is within the encoding bit rate threshold range and the transmission error rate is less than or equal to the transmission error rate threshold, it is mainly for scenarios with moderate encoding bit rates and relatively clean environments. Using the first data packet type will not cause poor transmission success rate due to the low transmission error rate. It can also ensure that the encapsulated target data packets occupy less air interface time as a whole, so as to obtain more retransmission opportunities.

[0086] Step 702: If the encoding rate is within the encoding rate threshold range and the transmission error rate is greater than the transmission error rate threshold, the terminal determines the data packet type based on the magnitude of the environmental noise energy value.

[0087] If the encoding rate is within the threshold range, but the transmission error rate (BER) exceeds the threshold (i.e., the packet retransmission rate is high), this could be due to environmental interference or other reasons, such as the long distance between the terminal and the peer in short-range wireless communication. Therefore, it is necessary to distinguish the magnitude of environmental noise energy to determine the packet type.

[0088] For example, in the process of a terminal determining the data packet type based on the magnitude of the ambient noise energy value, in one possible implementation, if the ambient noise energy value is less than or equal to a noise energy threshold, the terminal determines the data packet type to be a first data packet type. This noise energy threshold can be set empirically, or it can be set similarly to the encoding bitrate threshold range, by searching through the identifier of the current data transmission scenario, and so on.

[0089] In this implementation, when the coding rate is within the coding rate threshold range, if the transmission error rate is greater than the transmission error rate threshold and the ambient noise energy value is less than or equal to the noise energy threshold, it indicates that although the data packet retransmission rate is relatively high, the reason for the high transmission error rate / high data packet retransmission rate is not caused by interference in the transmission environment (because the ambient noise energy value is relatively low). It may be due to other reasons that cause the high data packet retransmission rate. For example, in short-range wireless communication data transmission, the distance between the terminal and the peer is relatively far, resulting in weak signal strength and retransmission. Therefore, the first data packet type (i.e., long packet type) transmission can obtain better bandwidth and more retransmission opportunities, which is more conducive to improving the success rate of data transmission and improving the user experience.

[0090] In another possible implementation, if the ambient noise energy value is greater than the noise energy threshold, the terminal determines the data packet type to be the second data packet type.

[0091] In this implementation, when the coding rate is within the coding rate threshold range, the transmission error rate is greater than the transmission error rate threshold, and the environmental noise energy value is greater than the noise energy threshold. This indicates that interference in the transmission environment is the main reason for the high transmission error rate / high data packet retransmission rate. When the interference is severe, the terminal can adjust the data packet type to the second data packet type. The number of time slots occupied by a single data packet corresponding to the first data packet type is different from the number of time slots occupied by a single data packet corresponding to the second data packet type. In addition, the data volume of a single data packet corresponding to the first data packet type is also greater than the data volume of a single data packet corresponding to the second data packet type. The second data packet type can be understood as a "short packet" type to improve the anti-interference characteristics of the terminal.

[0092] Please combine Figure 8 , Figure 8 This is an exemplary diagram illustrating packet type adjustment. For example, in a short-range wireless communication data transmission scenario, specifically Bluetooth data transmission, the data interaction between TWS earphones and a terminal is used as an example. Figure 8 As shown, traditional technology uses the 2DH5 type by default. Figure 8 The data packet "0" in the text is a data packet encapsulated using the 2DH5 type. Because the data packet "0" is long (large data volume and many time slots occupied), it is easy to encounter interference and retransmission. At the same time, the retransmitted data packet (i.e. the complete data packet "0") is too long and will have a very high probability of encountering interference again, resulting in poor anti-interference performance of the terminal.

[0093] In this embodiment of the application, when the encoding code rate is within the encoding code rate threshold range, the transmission error rate is greater than the transmission error rate threshold, and the environmental noise energy value is greater than the noise energy threshold, the data packet is adjusted to be encapsulated using the 2DH3 type. Figure 8 As shown, the data packet "0" obtained by encapsulation of type 2DH5 is adjusted to be encapsulated as data packet "01" by type 2DH3 in this embodiment of the application. Since data packet "01" has not transmitted all the data of data packet "0", one (or more) data packets "02" encapsulated by type 2DH3 or type 2DH1 are transmitted according to the size of the remaining data. The type 2DH3 or type 2DH1 is determined by the size of the remaining data. If the remaining data is greater than a preset threshold, type 2DH3 is selected, otherwise type 2DH1 is selected.

[0094] When using 2DH3 encapsulation for data packet transmission, although the data size of a single data packet is reduced, the 2DH3 data packet can be retransmitted within a shorter time after encountering interference. Figure 8The first 2DH3 type data packet in the "Packet Type Adjustment" row shown is more likely to be successfully transmitted because it needs to be retransmitted after receiving a "NAK" acknowledgment packet. The probability of the retransmitted 2DH3 type data packet encountering interference again is also very low.

[0095] Furthermore, although the data size of a packet encapsulated using the 2DH3 type is smaller than that of a packet encapsulated using the 2DH5 type, a single 2DH3 packet cannot completely transmit the data of a single 2DH5 packet, requiring the transmission of one or more 2DH1 / 2DH3 packets. Even so, the additional packets (2DH3 or 2DH1 type) have a lower probability of encountering interference due to their shorter duration, resulting in higher overall transmission efficiency. Figure 8 As shown, there will be savings in air interface resources.

[0096] exist Figures 6-8 In any of the embodiments shown, when the current data transmission is Bluetooth data transmission in short-range wireless communication data transmission, the first data packet type is 2DH5 type and the second data packet type is 2DH3 type. For related descriptions of the first data packet type and the second data packet type, please refer to the relevant descriptions in the above embodiments, which will not be repeated here.

[0097] Step 602: The terminal encapsulates the data to be transmitted into multiple target data packets according to the data packet type.

[0098] In this way, after the terminal determines the data packet type corresponding to the data to be transmitted by combining the terminal's current coding rate, transmission error rate and environmental noise energy value, it can encapsulate the data to be transmitted into multiple target data packets according to the data size of a single data packet indicated by the data packet type. Then, the terminal sends each target data packet to the other end in sequence according to the number of time slots occupied by a single data packet when it is sent, as indicated by the data packet type.

[0099] This application embodiment dynamically adjusts the data packet type by combining the terminal's current encoding bit rate, transmission error rate, and environmental noise energy value, taking into account both data transmission rate and the terminal's anti-interference characteristics.

[0100] In one embodiment, based on Figure 4 The embodiment shown further includes the following steps A1 and A2 in its data transmission method:

[0101] Step A1: If the encoding bitrate is greater than the maximum encoding bitrate threshold in the encoding bitrate threshold range, the terminal determines the data packet type as the first data packet type.

[0102] When the current encoding bitrate of the terminal is greater than the maximum encoding bitrate threshold, it indicates that the data transmission rate requirement is high. Therefore, the first data packet type (i.e., long packet type) should be selected first to ensure sufficient bandwidth.

[0103] In step A2, if the encoding rate is less than or equal to the minimum encoding rate threshold in the encoding rate threshold range, the terminal determines the data packet type as the second data packet type.

[0104] Taking the data interaction between TWS earphones and terminals in Bluetooth data transmission scenarios as an example, when the current encoding bitrate of the terminal is less than or equal to the minimum encoding bitrate threshold, it means that the data transmission rate requirement is low. Therefore, regardless of whether the environmental quality is good or bad, using the second data packet type (i.e., 2DH3 type) can support audio data without stuttering and the air interface does not occupy high resources. It can also cope with low-probability sudden interference scenarios in the environment, ensuring that TWS earphones have a lower probability of stuttering.

[0105] The following example illustrates the implementation of the data transmission method of this application, taking the current data transmission corresponding to the data to be transmitted as a short-range wireless communication data transmission example, specifically the Bluetooth data transmission between a mobile phone and a TWS earphone (which can be a 2Mbps transmission scenario or a 3Mbps transmission scenario).

[0106] The data transmission method includes the following steps:

[0107] Step a: During the process of encapsulating data packets for transmission, the mobile phone obtains the current encoding bit rate, transmission error rate, and environmental noise energy value.

[0108] In step b, if the encoding rate is within the encoding rate threshold range, the mobile phone detects the relationship between the transmission error rate and the transmission error rate threshold.

[0109] As mentioned above, a first coding rate threshold and a second coding rate threshold can be set, with the first coding rate threshold being greater than the second coding rate threshold. By taking the first coding rate threshold and the second coding rate threshold as the two endpoints of the interval, the coding rate threshold interval can be obtained.

[0110] In step c, if the transmission error rate is greater than the transmission error rate threshold and the environmental noise energy value is less than or equal to the noise energy threshold, the mobile phone determines that the data packet type is 2DH5.

[0111] In step d, if the transmission error rate is greater than the transmission error rate threshold and the environmental noise energy value is greater than the noise energy threshold, the mobile phone determines that the data packet type is 2DH3.

[0112] It should be noted that, as mentioned above, the terminal can scan the electromagnetic wave energy of the communication channels within a preset distance range around the terminal, that is, the noise energy of the communication channels, to obtain the noise energy value of each communication channel. The terminal can use the noise energy value of each communication channel as the current ambient noise energy value of the terminal.

[0113] Thus, in the process of comparing the environmental noise energy value with the noise energy threshold, the terminal needs to compare the noise energy value of each communication channel with the noise energy threshold separately.

[0114] If at least some of the communication channels have noise energy values ​​greater than the noise energy threshold, then the environmental noise energy value of the terminal is determined to be greater than the noise energy threshold; otherwise, the environmental noise energy value of the terminal is determined to be less than or equal to the noise energy threshold. The number of “some communication channels” can be set by the user during implementation.

[0115] In step e, if the transmission error rate is less than or equal to the transmission error rate threshold, the mobile phone determines that the data packet type is 2DH5.

[0116] In step f, if the encoding rate is greater than the maximum encoding rate threshold (i.e., the first encoding rate threshold) in the encoding rate threshold range, the mobile phone determines that the data packet type is 2DH5.

[0117] In step g, if the encoding rate is less than or equal to the minimum encoding rate threshold (i.e., the second encoding rate threshold) in the encoding rate threshold range, the mobile phone determines that the data packet type is 2DH3.

[0118] In step h, the mobile phone encapsulates the data to be transmitted into multiple target data packets according to the data packet types determined in steps b to g, and then sends the multiple target data packets to the TWS earphones in sequence.

[0119] Referring to Table 2, the process of determining the data packet type in the above data transmission methods can be summarized as shown in Table 2:

[0120]

[0121] Table 2

[0122] The encoding bitrate in the above embodiments can be the audio bitrate. In this way, by combining the current audio bitrate, transmission error rate and environmental noise energy value of the terminal, the data packet type is dynamically adjusted to take into account both the data transmission rate and the anti-interference characteristics of the terminal. This ensures that the user can enjoy Bluetooth high-definition audio quality and listen to music without lag in harsh environments or sudden interference, thus optimizing the user's Bluetooth audio quality and Bluetooth lag experience.

[0123] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0124] Based on the same inventive concept, this application also provides a data transmission apparatus for implementing the data transmission method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, specific limitations in one or more data transmission apparatus embodiments provided below can be found in the limitations of the data transmission method described above, and will not be repeated here.

[0125] In one embodiment, such as Figure 9 As shown, a data transmission device is provided, comprising:

[0126] The acquisition module 901 is used to acquire the current data transmission status and transmission environment status of the terminal during the process of data packet encapsulation of the data to be transmitted.

[0127] The encapsulation module 902 is used to determine the data packet type corresponding to the data to be transmitted based on the transmission data status and the transmission environment status, and to encapsulate the data to be transmitted according to the data packet type to obtain multiple target data packets;

[0128] Among them, the number of time slots occupied by a single data packet varies depending on the data packet type.

[0129] In one embodiment, the transmission data state includes the current coding bit rate of the terminal, and the transmission environment state includes at least one of the current transmission bit error rate of the terminal and the environmental noise energy value.

[0130] In one embodiment, the encapsulation module 902 is specifically used to determine the data packet type based on the magnitude of the transmission error rate if the encoding code rate is within the encoding code rate threshold range.

[0131] In one embodiment, the encapsulation module 902 is specifically used to determine the data packet type based on the magnitude of the environmental noise energy value if the transmission error rate is greater than the transmission error rate threshold.

[0132] In one embodiment, the encapsulation module 902 is specifically used to determine the data packet type as a first data packet type if the ambient noise energy value is less than or equal to a noise energy threshold; and to determine the data packet type as a second data packet type if the ambient noise energy value is greater than the noise energy threshold. The number of time slots occupied by a single data packet corresponding to the first data packet type during transmission is different from the number of time slots occupied by a single data packet corresponding to the second data packet type during transmission.

[0133] In one embodiment, the encapsulation module 902 is specifically used to determine the data packet type as a first data packet type if the transmission error rate is less than or equal to the transmission error rate threshold.

[0134] In one embodiment, the encapsulation module 902 is further configured to determine the data packet type as a first data packet type if the encoding code rate is greater than the maximum encoding code rate threshold in the encoding code rate threshold range.

[0135] In one embodiment, the encapsulation module 902 is further configured to determine the data packet type as a second data packet type if the encoding code rate is less than or equal to the minimum encoding code rate threshold in the encoding code rate threshold range.

[0136] In one embodiment, the current data transmission corresponding to the data to be transmitted is cellular data transmission or short-range wireless communication data transmission;

[0137] In the case where the current data transmission is Bluetooth data transmission in the short-range wireless communication data transmission, the first data packet type is 2DH5 type and the second data packet type is 2DH3 type.

[0138] Each module in the aforementioned data transmission device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the electronic device in hardware form or independent of it, or stored in the memory of the electronic device in software form, so that the processor can call and execute the operations corresponding to each module.

[0139] In one embodiment, an electronic device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 10As shown, this electronic device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a data transmission method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the electronic device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the electronic device, or external keyboards, touchpads, or mice, etc.

[0140] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0141] This application also provides a computer-readable storage medium. One or more non-volatile computer-readable storage media containing computer-executable instructions, which, when executed by one or more processors, cause the processors to perform the steps of a data transfer method.

[0142] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform a data transmission method.

[0143] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0144] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0145] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0146] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A data transmission method, characterized in that, include: During the process of encapsulating data packets for transmission, the terminal's current coding rate, transmission error rate, and environmental noise energy value are obtained. If the coding rate is within the coding rate threshold range and the transmission error rate is greater than the transmission error rate threshold, then the data packet type is determined according to the magnitude of the environmental noise energy value, and the data to be transmitted is encapsulated according to the data packet type to obtain multiple target data packets; Among them, the number of time slots occupied by a single data packet varies depending on the data packet type.

2. The method according to claim 1, characterized in that, The step of determining the data packet type based on the magnitude of the environmental noise energy value includes: If the environmental noise energy value is less than or equal to the noise energy threshold, then the data packet type is determined to be the first data packet type; If the environmental noise energy value is greater than the noise energy threshold, then the data packet type is determined to be the second data packet type, and the number of time slots occupied by a single data packet corresponding to the first data packet type when it is sent is greater than the number of time slots occupied by a single data packet corresponding to the second data packet type when it is sent.

3. The method according to claim 1, characterized in that, The method further includes: If the encoding code rate is within the encoding code rate threshold range, and the transmission error rate is less than or equal to the transmission error rate threshold, then the data packet type is determined to be the first data packet type.

4. The method according to claim 1, characterized in that, The method further includes: If the encoding bitrate is greater than the maximum encoding bitrate threshold in the encoding bitrate threshold range, then the data packet type is determined to be the first data packet type.

5. The method according to claim 1, characterized in that, The method further includes: If the encoding code rate is less than or equal to the minimum encoding code rate threshold in the encoding code rate threshold range, then the data packet type is determined to be the second data packet type.

6. The method according to claim 2, characterized in that, The current data transmission corresponding to the data to be transmitted is either cellular data transmission or short-range wireless communication data transmission. In the case where the current data transmission is Bluetooth data transmission in the short-range wireless communication data transmission, the first data packet type is 2DH5 type and the second data packet type is 2DH3 type.

7. A data transmission device, characterized in that, include: The acquisition module is used to acquire the terminal's current encoding bit rate, transmission bit error rate, and environmental noise energy value during the process of encapsulating data packets for transmission. An encapsulation module is used to determine the data packet type based on the magnitude of the environmental noise energy value if the encoding code rate is within the encoding code rate threshold range and the transmission error rate is greater than the transmission error rate threshold, and to encapsulate the data to be transmitted according to the data packet type to obtain multiple target data packets. Among them, the number of time slots occupied by a single data packet varies depending on the data packet type.

8. An electronic device, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the computer program is executed by the processor, it causes the processor to perform the steps of the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data transmission method and device, storage medium and terminal equipment

    CN116437329A