Data transmission method, device, equipment and readable storage medium

Through rate adaptation processing, including unpacking and recoding, the playback lag caused by the reduction in Bluetooth transmission rate is solved, ensuring that the packet can be sent smoothly after the speed is slowed down, and the packet transmission reliability is improved.

CN114666776BActive Publication Date: 2025-09-02伟光有限公司(CN)
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210332316.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-31
Publication Date
2025-09-02
Estimated Expiration
2042-03-31

AI Technical Summary

Technical Problem

When the Bluetooth transmission rate decreases, the cached data packets in the terminal device cannot be sent out within the preset transmission time slot, resulting in the playback of Bluetooth headsets.

Method used

Through rate adaptation processing, the size of the packet to be sent in a single transmission slot is reduced, including unpacking and/or recoding processing, ensuring that the packet can be sent smoothly after slowing down.

Benefits of technology

When Bluetooth data transmission suddenly slows down, ensure that Bluetooth headsets can successfully receive audio packets, avoid playback lag, and improve the packet transmission reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114666776B_ABST
    Figure CN114666776B_ABST
Patent Text Reader

Abstract

The present application relates to a data transmission method, apparatus, device, and readable storage medium, wherein a first device determines whether the data transmission between the first device and the second device meets a speed reduction trigger condition; if so, the first device performs rate adaptation processing on the cached first data packet to obtain a second data packet; then, the second data packet is sent to the second device; wherein the rate adaptation processing is used to reduce the size of the data packet to be sent within a single transmission time slot; the first data packet is data encoded by the first device based on the current transmission rate. The above method can improve the transmission reliability of the data packet cached by the first device; for a second device such as a Bluetooth headset, when the Bluetooth data transmission suddenly slows down, the audio data packet sent by the first device can be successfully received based on the current timing parameter configuration, thereby avoiding playback freezes in the second device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a data sending method, apparatus, device and readable storage medium. Background Art

[0002] With the development of Bluetooth technology, devices such as Bluetooth headsets have become widely used. For example, the Bluetooth transmission between mobile phones and Bluetooth headsets can be improved by increasing bandwidth and improving modulation and coding capabilities, allowing the terminal device to transmit high-quality audio files to the Bluetooth headset.

[0003] When Bluetooth transmission is interfered with, the terminal device needs to reduce the Bluetooth rate to send data packets to the blue ear headphones. After the rate is reduced, the data packets buffered in the terminal device cannot be sent out within the preset transmission time slot, causing the Bluetooth headphones to play lag. Summary of the Invention

[0004] The embodiments of the present application provide a data sending method, apparatus, device and readable storage medium, which can smoothly send cached data packets when Bluetooth speed is reduced, thereby avoiding Bluetooth headset playback jams.

[0005] In a first aspect, a data transmission method includes:

[0006] Determining whether data transmission between the first device and the second device meets a speed reduction trigger condition;

[0007] If so, the first device performs rate adaptation processing on the cached first data packet to obtain a second data packet; wherein the rate adaptation processing is used to reduce the size of the data packet to be sent in a single transmission time slot; the first data packet is data encoded by the first device based on the current transmission rate;

[0008] The second data packet is sent to the second device.

[0009] In a second aspect, a data sending device includes:

[0010] a determination module, configured to determine whether the data transmission between the first device and the second device satisfies a speed reduction trigger condition;

[0011] a processing module configured to perform rate adaptation processing on a cached first data packet to obtain a second data packet when the data transmission satisfies a rate reduction trigger condition; wherein the rate adaptation processing is configured to reduce a size of a data packet to be transmitted within a single transmission time slot; and wherein the first data packet is data encoded by the first device based on a current transmission rate;

[0012] A sending module is used to send the second data packet to the second device.

[0013] In a third aspect, an electronic device includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the method of the first aspect.

[0014] In a fourth aspect, a computer-readable storage medium stores a computer program, which implements the steps of the method of the first aspect when executed by a processor.

[0015] In the above-mentioned data transmission method, apparatus, device, and readable storage medium, a first device determines whether the data transmission between the first device and the second device meets a rate reduction trigger condition; if so, the first device performs rate adaptation processing on the cached first data packet to obtain a second data packet; and then transmits the second data packet to the second device; wherein the rate adaptation processing is used to reduce the size of the data packet to be transmitted in a single transmission time slot; the first data packet is data encoded by the first device based on the current transmission rate. Because the first device monitors the data transmission to determine whether the rate reduction trigger condition is met, it can trigger a rate reduction in a timely manner when the data transmission quality is poor. Furthermore, for the first data packet that has been encoded based on the current transmission rate and is cached in the first device, the first device performs rate adaptation processing on the first data packet to reduce the size of the data packet to be transmitted in a single transmission time slot, so that the second data packet obtained after the processing can be transmitted within the single transmission time slot, allowing the second device to successfully receive each data packet sent by the first device, thereby improving the transmission reliability of the data packets in the cache area. For a second device such as a Bluetooth headset, when the Bluetooth data transmission suddenly slows down, the audio data packet sent by the first device can be successfully received based on the current timing parameter configuration, avoiding playback lag in the second device. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0017] Figure 1 This is an application environment diagram of the data transmission method in one embodiment of the present application;

[0018] Figure 2 This is a flowchart of a data transmission method in one embodiment of the present application;

[0019] Figure 3 This is a schematic diagram of the connection between the first device and the second device in one embodiment of the present application;

[0020] Figure 4 This is a schematic diagram of a sending time slot in one embodiment of the present application;

[0021] Figure 5 This is a schematic diagram of data packet transmission in one embodiment of the present application;

[0022] Figure 6 This is a flowchart of a data transmission method in one embodiment of the present application;

[0023] Figure 7 This is a schematic diagram of data packet transmission in one embodiment of the present application;

[0024] Figure 8 This is a flowchart of a data transmission method in one embodiment of the present application;

[0025] Figure 9 This is a schematic diagram of data packet transmission in one embodiment of the present application;

[0026] Figure 10 This is a flowchart of a data transmission method in one embodiment of the present application;

[0027] Figure 11 This is a flowchart of a data transmission method in one embodiment of the present application;

[0028] Figure 12 This is a flowchart of a data transmission method in one embodiment of the present application;

[0029] Figure 13 This is a structural block diagram of a data transmission device in one embodiment of the present application;

[0030] Figure 14 This is a structural block diagram of a data transmission device in one embodiment of the present application;

[0031] Figure 15 This is a structural block diagram of a data transmission device in one embodiment of the present application;

[0032] Figure 16 This is a structural block diagram of a data transmission device in one embodiment of the present application;

[0033] Figure 17 This is a schematic diagram of the structure of an electronic device in one embodiment of the present application. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solutions and advantages of this application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0035] It is understood that the terms "first," "second," etc., used herein may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, a first device may be referred to as a second device, and similarly, a second device may be referred to as a first device, without departing from the scope of this application. Both the first device and the second device are electronic devices, but they are not the same electronic device.

[0036] Figure 1 FIG. 1 is a schematic diagram of an application environment of a data sending method in an embodiment. Figure 1 As shown, the application environment includes a first device 100 and a second device 200. Among them, communication and transmission can be carried out between the first device 100 and the second device 200, and the first device 100 can send data to the second device 200. The data transmission between the first device 100 and the second device 200 can be Bluetooth transmission or WiFi transmission, and the type of data transmission is not limited here. The first device 100 and the second device 200 can be personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. For example, the first device 100 can be a smart phone, and the second device 200 can be a Bluetooth headset.

[0037] Figure 2 FIG. 1 is a flow chart of a data transmission method in an embodiment. The data transmission method in this embodiment is to run on Figure 1 The first device in the example is used for description. Figure 2 As shown, the above method includes:

[0038] S102: Determine whether the data transmission between the first device and the second device meets a speed reduction trigger condition.

[0039] The data transmission between the first device and the second device may be via Bluetooth or WiFi, and the type of data transmission is not limited herein. The first device may send data to the second device via data transmission. The data may be audio data, video data, or control signaling data, and the type of data transmitted is not limited herein.

[0040] For example, the first device is a mobile phone, and the second device is a Bluetooth playback device. The first device can send audio data to the second device via Bluetooth. This audio data can be data output by a music player on the first device, audio data output by a video player, or voice call data. The type of audio data is not limited here.

[0041] The first device may determine whether the data transmission meets the speed reduction trigger condition by monitoring the status of the data transmission. In one implementation, the first device may determine whether the data transmission meets the speed reduction trigger condition based on the number of retransmissions of the data packet sent to the second device. The above-mentioned speed reduction trigger condition may be a retransmission number threshold. When the number of retransmissions of the data packet sent by the first device to the second device is greater than the retransmission number threshold, the first device may deem that the current data transmission meets the speed reduction trigger condition. In another implementation, the first device may determine the signal strength of the response information returned by the second device after receiving the data packet through signal strength detection, and determine whether the data transmission meets the speed reduction trigger condition based on the signal strength. The above-mentioned speed reduction trigger condition may be a signal strength threshold. If the signal strength detected by the first device is less than the preset signal strength threshold, it may be determined that the above-mentioned data transmission meets the speed reduction trigger condition. The method for determining whether the speed reduction trigger condition is met is not limited here.

[0042] S104. If yes, the first device performs rate adaptation processing on the cached first data packet to obtain a second data packet; wherein the rate adaptation processing is used to reduce the size of the data packet to be sent in a single sending time slot; the first data packet is the data encoded by the first device based on the current transmission rate.

[0043] When the first device sends a data packet to the second device, it can first cache the data packet to be sent. The number of first data packets cached in the first device can be one or more, which is not limited here.

[0044] The first data packet is data encoded by the first device based on the current transmission rate. That is, the size of the first data packet matches the current transmission rate. When the first device and the second device reduce the transmission speed, the reduced transmission rate cannot meet the data transmission requirements of the first data packet.

[0045] Continuing with the example of the first device being a mobile phone and the second device being a Bluetooth playback device, both the first device and the second device may include an audio module and a Bluetooth module, and the Bluetooth module may include a buffer, such as Figure 3As shown. The audio module in the first device can parse the audio file to be played and obtain Pulse Code Modulation (PCM) data; the above PCM data is an uncompressed audio sampling data stream, which can be played through the audio module. When the first device sends audio data to the second device, the PCM data can be encoded by the audio module in the first device to achieve compression processing of the PCM data and obtain a first data packet; the audio module in the first device sends the above first data packet to the Bluetooth module in the first device for caching, so that the Bluetooth module in the first device can send the cached first data packet to the Bluetooth module in the second device, and then the Bluetooth module in the second device sends the data packet to the audio module in the second device.

[0046] When the Bluetooth module of the first device sends a data packet to the Bluetooth module of the second device, it needs to complete the transmission in a fixed transmission time slot to avoid data interference caused by too long transmission time. Figure 4 As shown, each data stream sent by the first device to the second device corresponds to a transmission duration ISO_interval. The ISO_interval can include multiple transmission time slots Sub_interval. The first device can transmit data packets to the second device via the Sub_interval. The Bluetooth module in the first device can buffer multiple data packets (for example, data packets P0-P2). The first device can send data packet P0 in one of the transmission time slots Sub_interval. If P0 is sent successfully, the next data packet P1 is sent in the next Sub_interval and the audio module is requested to send data packet P3. If P0 fails to send, data packet P0 is retransmitted in the next Sub_interval.

[0047] With the development of Bluetooth communication, the transmission rate between the first device and the second device can include multiple levels, for example, the rate can be 12M, 8M, 4M, etc.; in high-speed Bluetooth transmission, the size of the first data packet encoded by the audio module in the first device can be larger, so as to achieve high-quality audio file transmission. When the distance between the first device and the second device becomes larger or the data transmission is interfered with, the transmission rate between the first device and the second device decreases, so that the first data packet cached in the first device requires a longer transmission time and cannot be completed within one transmission time slot. The second device receives the data packets sent by the first device in sequence according to the order of the data packets. If the first device cannot send the first data packet in the cache to the second device, there will be no data packet to be played in the cache of the second device, resulting in playback jams.

[0048] Based on this, after detecting that the data transmission meets the rate reduction trigger condition, the first device can perform rate adaptation processing on the cached first data packet. The rate adaptation processing can be used to reduce the size of the data packet to be sent in a single transmission time slot, so that the processed second data packet can be sent within a single transmission time slot.

[0049] When the first device performs rate adaptation processing on the first data packet, it can delete redundant data in the first data packet according to the data format of the first data packet to obtain a second data packet, so that the size of the second data packet is smaller than the size of the corresponding first data packet; or, the first device can downsample the first data packet to obtain the second data packet; the method of rate adaptation processing is not limited here.

[0050] Optionally, the rate adaptation process may include depacketization and / or re-encoding. The depacketization process may split a first data packet into multiple second data packets, such that the size of each second data packet is smaller than the size of the original first data packet. That is, after the depacketization process, one first data packet may correspond to multiple second data packets.

[0051] The transmission rate corresponding to the re-encoding process is lower than the current transmission rate. After determining that the data transmission meets the speed reduction trigger condition, the first device can determine the transmission rate after the speed reduction, and then re-encode the first data packet using the speed reduction transmission rate to obtain a second data packet. In other words, after the re-encoding process, each first data packet corresponds to a second data packet. Because the speed reduction transmission rate is lower than the current transmission rate, the size of the second data packet is smaller than the size of the first data packet.

[0052] S106: Send the second data packet to the second device.

[0053] After obtaining the second data packet, the first device may send the second data packet to the second device.

[0054] If each first data packet corresponds to multiple second data packets, the multiple second data packets can be arranged in a split order, and the first device can send one second data packet in each sending time slot, and send each second data packet to the second device in turn.

[0055] If the first device caches multiple first data packets, the first device can obtain multiple second data packets after performing rate adaptation on each of the multiple first data packets. The multiple second data packets can be arranged in the same order as the first data packets, and the first device can transmit one second data packet in each transmit time slot, sending each second data packet to the second device in sequence.

[0056] It should be noted that, if the data transmission meets the speed reduction trigger condition, the first device can encode and cache the cached data packet at the reduced transmission rate. After the first device transmits the currently cached first data packet, the newly generated first data packet can be sized to match the reduced transmission rate and transmitted using a single transmission time slot, further improving data packet transmission reliability.

[0057] In the above-mentioned data transmission method, a first device determines whether data transmission between the first device and a second device meets a rate reduction trigger condition. If so, the first device performs rate adaptation processing on a cached first data packet to obtain a second data packet. The second data packet is then transmitted to the second device. The rate adaptation processing is used to reduce the size of the data packet to be transmitted within a single transmission time slot. The first data packet is data encoded by the first device based on the current transmission rate. Because the first device monitors data transmission to determine whether the rate reduction trigger condition is met, the rate reduction can be triggered promptly in the event of poor data transmission quality. Furthermore, for the first data packet cached in the first device and encoded based on the current transmission rate, the first device performs rate adaptation processing on the first data packet to reduce the size of the data packet to be transmitted within the single transmission time slot, so that the second data packet obtained after the processing can be transmitted within the single transmission time slot. This allows the second device to successfully receive each data packet sent by the first device, thereby improving the transmission reliability of the data packets in the cached area. For a second device such as a Bluetooth headset, the audio data packet sent by the first device can be successfully received based on the current timing parameter configuration in the event of a sudden Bluetooth data transmission rate reduction, thereby avoiding playback lag on the second device.

[0058] In one embodiment, based on the above embodiment, the rate adaptation process may include unpacking. During unpacking, the first device may split the first data packet into multiple second data packets according to a preset number of unpacked packets. Alternatively, the first device may determine the number of unpacked packets based on the data transmission status and then split the first data packet according to the determined number of unpacked packets to obtain multiple second data packets. The unpacking method is not limited herein.

[0059] Optionally, the first device may split the first data packet into multiple second data packets based on the reduced transmission rate. In one implementation, the first device may determine a data packet size threshold that matches the reduced transmission rate based on a preset correspondence between the transmission rate and the data packet size threshold; then, based on a ratio between the size of the first data packet and the matched data packet size threshold, split the first data packet such that the size of the split second data packets is less than the data packet size threshold.

[0060] In another implementation, the first device can determine the number of packets to be unpacked based on the ratio of the current transmission rate to the reduced transmission rate. The first data packet can then be split according to the number of unpacked packets to obtain multiple second data packets. The number of unpacked packets can be equal to or greater than the ratio, without limitation. For example, if the current transmission rate is 8 Mbps and the reduced transmission rate is 4 Mbps, the number of unpacked packets can be 2, and the first device can split the first data packet into two data packets.

[0061] After the first device unpacks the first data packet, the sizes of the obtained second data packets can be the same or different. The first device can split the first data packet into multiple second data packets of equal size based on the number of unpacked packets; or the first device can determine a data packet size threshold that matches the reduced transmission rate, and then split the first data packet based on the data packet size threshold, such that each split second data packet is smaller than the data packet size threshold.

[0062] Continuing to take the first device as a mobile phone and the second device as a Bluetooth playback device as an example, the above unpacking process is described. Figure 5 As shown, the Bluetooth module in the first device can cache three first data packets, including P0-P2. When the first device sends the first data packet P2 to the second device, the number of retransmissions is greater than the preset number threshold, and it is determined that the data transmission meets the speed reduction trigger condition. At this time, the first data packet cached by the Bluetooth module in the first device can be P2-P4. The Bluetooth module in the first device can unpack the first data packet P2, split it into two second data packets P2-1 and P2-2, and send them to the second device in sequence through two sending time slots. After sending P2-2, the Bluetooth module in the first device can request the first data packet P5 from the audio module, and split the cached first data packet P3 into P3-1 and P3-2 and send them to the second device in sequence.

[0063] In the above-mentioned data sending method, the first device directly unpacks the cached first data packet, which not only allows the second data packet after unpacking to adapt to the transmission rate after the speed reduction for transmission, but also allows the second device to receive complete data, thereby ensuring the quality of the information carried in the data packet; in audio data transmission, the second device can receive high-quality audio data after the speed reduction.

[0064] Figure 6 is a flow chart of a data transmission method in another embodiment. This embodiment relates to another way in which the first device performs rate adaptation processing. Based on the above embodiment, the above rate adaptation processing may include re-encoding processing, such as Figure 6 As shown, the above S104 includes:

[0065] S202. Acquire a third data packet; the third data packet is an uncoded data packet corresponding to the first data packet.

[0066] The third data packet is an uncoded data packet corresponding to the first data packet; that is, the first data packet is obtained by encoding the third data packet using the current transmission rate.

[0067] The first device may cache each uncoded data packet before encoding at the transmission rate. When the uncoded data packet corresponding to the first data packet needs to be obtained, the uncoded data packet corresponding to the data packet identifier corresponding to the first data packet may be queried to obtain the third data packet.

[0068] When the first device includes an audio module and a Bluetooth module, the cache for the uncoded data packet and the cache for the first data packet are not in the same module. The uncoded data packet can be cached in a cache area in the audio module, and the first data packet can be cached in a cache area in the Bluetooth module.

[0069] In one implementation, when acquiring the third data packet, the audio module may determine whether to acquire the third data packet corresponding to the first data packet based on the transmission duration of the first data packet previously sent to the Bluetooth module. For example, if the Bluetooth module sends a first data packet P2 to the audio module, and the duration between the transmission time of P2 and the current time exceeds a preset duration threshold, the audio module may deem that P2 failed to be sent and automatically acquire the third data packet corresponding to the first data packet.

[0070] In another implementation, the first device may send a re-encoding instruction to the audio module via the Bluetooth module; the audio module then queries the unencoded data packet corresponding to the identifier to obtain the third data packet. The re-encoding instruction includes the identifier of the first data packet to be encoded and the reduced transmission rate.

[0071] S204: Encode the third data packet using the reduced transmission rate to obtain a second data packet.

[0072] After obtaining the third data packet, the first device may encode the third data packet using the reduced transmission rate to obtain the third data packet. The first device may encode the third data packet using the reduced transmission rate to obtain the third data packet.

[0073] When encoding data packets at different transmission rates, the corresponding compression ratios vary. The compression ratio can be 0.8 or 0.5, and is not limited here. The higher the transmission rate, the larger the compressed data packet. In other words, the first data packet is obtained by encoding the third data packet at the current transmission rate, and the second data packet is obtained by re-encoding the third data packet at the reduced transmission rate. The size of the second data packet is smaller than the size of the first data packet.

[0074] When the first device includes an audio module and a Bluetooth module, the first device may encode the third data packet using the reduced transmission rate through the audio module to obtain the second data packet, and send the second data packet to the Bluetooth module for buffering.

[0075] Continuing to take the first device as a mobile phone and the second device as a Bluetooth playback device as an example, the above re-encoding process is described. Figure 7 As shown, the Bluetooth module in the first device can cache three first data packets, including P0-P2. When the first device sends the first data packet P2 to the second device, the number of retransmissions is greater than the preset number threshold, and it is determined that the data transmission meets the speed reduction trigger condition. At this time, the first data packet cached by the Bluetooth module in the first device can be P2-P4. The Bluetooth module in the first device can send a recoding instruction to the audio module, and the above recoding instruction carries the data packet identifier of the first data packet P2-P4. The audio module in the first device can query the third data packet corresponding to P2-P4, and then encode each third data packet respectively to obtain the second data packets P2', P3' and P4'. Furthermore, the audio module in the first device can send each second data packet to the Bluetooth module in the first device for caching, and send the above second data packet to the second device through the Bluetooth module.

[0076] In the above-mentioned data sending method, the first device re-encodes the first data packet in the cache so that each first data packet corresponds to a second data packet after re-encoding, so that the data corresponding to the first data packet can be sent to the second device through a sending time slot, thereby improving the sending efficiency of the cached data packets and reducing the data transmission delay between the first device and the second device.

[0077] Figure 8 is a flow chart of a data transmission method in another embodiment. This embodiment relates to another way in which the first device performs rate adaptation processing. Based on the above embodiment, the first device can cache multiple first data packets. The rate adaptation processing may include unpacking processing and re-encoding processing, such as Figure 8 As shown, the above S104 includes:

[0078] S302: Among multiple first data packets, unpack at least one target data packet with a higher transmission order to obtain a second data packet corresponding to the target data packet.

[0079] When a plurality of first data packets are cached in the first device, a combination of splitting processing and re-encoding processing may be used to process the cached first data packets.

[0080] The first device may unpack at least one target data packet that is sent earlier in the order of transmission. The number of the target data packets may be 1, 2, or other numbers, which are not limited here.

[0081] Optionally, the first device may determine the sending order of the first data packets according to the data packet identifiers of the first data packets, and then determine the first data packet with the highest sending order as the target data packet.

[0082] The specific manner in which the first device unpacks the target data packet can be found in the above-mentioned embodiment corresponding to the unpacking process, which will not be described in detail here. After unpacking the target data packet, the first device can sequentially send the split second data packets to the second device.

[0083] S304: Re-encode the remaining data packets in the plurality of first data packets except the target data packet to obtain second data packets corresponding to the remaining data packets.

[0084] For the remaining cached data packets, the first device can re-encode them to obtain the second data packets corresponding to the remaining data packets, and then send each second data packet to the second device in sequence. The specific method for the first device to re-encode the remaining data packets can be found in the above Figure 6 The corresponding embodiments are not described in detail here.

[0085] Continuing to take the first device as a mobile phone and the second device as a Bluetooth playback device as an example, the above re-encoding process is described. Figure 9As shown, the Bluetooth module in the first device can cache three first data packets, including P0-P2. When the first device sends first data packet P2 to the second device, the number of retransmissions exceeds a preset threshold, indicating that the data transmission meets the speed reduction trigger condition. In this case, the first data packets cached by the Bluetooth module in the first device may be P2-P4. The Bluetooth module in the first device can determine that first data packet P2 is the target data packet, unpack it, and split it into two second data packets, P2-1 and P2-2, which are then transmitted to the second device via two transmission time slots. Simultaneously, the Bluetooth module in the first device can send a re-encoding instruction to the audio module, which carries the data packet identifiers of first data packets P3-P4. The audio module in the first device can query the third data packets corresponding to P3-P4 and then encode each third data packet to obtain second data packets P3' and P4'. Furthermore, the audio module in the first device can send each second data packet to the Bluetooth module in the first device for buffering, and then transmit the second data packet to the second device via the Bluetooth module.

[0086] In the above-mentioned data processing method, the first device adopts a combined processing method of unpacking and re-encoding, and can improve the data transmission efficiency by re-encoding the remaining data packets; further, by unpacking the target data packet, data can be continuously sent during the re-encoding of the remaining data packets, thereby further reducing the data transmission delay.

[0087] It should be noted that the number of first data packets cached in the first device may be related to the data transmission mode. If the first device sends to the second device data packets with low transmission latency requirements, such as music playback data, the first device may cache multiple first data packets. If the first device sends to the second device data packets with high transmission latency requirements, such as voice call data, the number of first data packets cached in the first device may be smaller.

[0088] The first device can determine the number of cached data packets based on the data transmission mode. Further, when a data transmission speed reduction is detected, the corresponding rate adaptation processing method can be determined based on the number of cached first data packets. For example, if the number of first data packets cached in the first device is less than the first threshold, the first device can use an unpacking processing method to process the first data packets, and send the obtained second data packets to the second device. If the number of first data packets cached in the first device is greater than or equal to the first threshold and less than the first threshold, the first device can use a re-encoding processing method to process the first data packets, and send the obtained second data packets to the second device. If the number of first data packets cached in the first device is greater than or equal to the second threshold, the first device can use the above-mentioned combined unpacking processing and re-encoding processing method to process each first data packet, and send the obtained second data packet to the second device.

[0089] In one embodiment, a data transmission method is provided, such as Figure 10 As shown, the above method includes:

[0090] S401: Determine whether the data transmission between the first device and the second device meets a speed reduction trigger condition; if so, execute S402.

[0091] S402: Determine the number of packets to be unpacked based on the ratio of the current transmission rate to the reduced transmission rate.

[0092] S403: Split the first data packet according to the number of depacketizations to obtain multiple second data packets.

[0093] S404: Send a second data packet in each sending time slot, and send each second data packet to the second device in sequence.

[0094] The implementation principle and technical effects of the above data sending method can be found in the above embodiments and will not be described in detail here.

[0095] In one embodiment, a data transmission method is provided, such as Figure 11 As shown, the above method includes:

[0096] S501: Determine whether the data transmission between the first device and the second device meets a speed reduction trigger condition; if so, execute S502.

[0097] S502: Send a re-encoding instruction to the audio module via the Bluetooth module.

[0098] S503: Query the uncoded data packet corresponding to the identifier through the audio module to obtain a third data packet.

[0099] S504 : Encode the third data packet using the reduced transmission rate through the audio module to obtain a second data packet.

[0100] S505: Send the second data packet to the Bluetooth module for buffering.

[0101] S506: Send a second data packet in each sending time slot, and send each second data packet to the second device in sequence.

[0102] The implementation principle and technical effects of the above data sending method are shown in the above embodiments and will not be described in detail here.

[0103] In one embodiment, a data transmission method is provided, such as Figure 12 As shown, the above method includes:

[0104] S601: Determine whether the data transmission between the first device and the second device meets a speed reduction trigger condition; if so, execute S602.

[0105] S602: Determine at least one target data packet with a higher sending order among multiple first data packets.

[0106] S603: Unpack the target data packet to obtain a second data packet corresponding to the target data packet.

[0107] S604: Send a re-encoding instruction to the audio module via the Bluetooth module; the re-encoding instruction includes identifiers of the remaining data packets except the target data packet.

[0108] S605: Query the uncoded data packet corresponding to the identifier through the audio module to obtain a third data packet.

[0109] S606: Encode the third data packet using the reduced transmission rate through the audio module to obtain a second data packet.

[0110] S607: Send the second data packet to the Bluetooth module for buffering.

[0111] S608: Send a second data packet in each sending time slot, and send each second data packet to the second device in sequence.

[0112] The implementation principle and technical effects of the above data sending method are shown in the above embodiments and will not be described in detail here.

[0113] It should be understood that although Figure 2-12 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 2-12At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0114] Figure 13 FIG. 1 is a structural block diagram of a data sending device according to an embodiment of the present invention. Figure 13 As shown, the above device includes:

[0115] A determination module 10 is configured to determine whether the data transmission between the first device and the second device satisfies a speed reduction trigger condition;

[0116] a processing module 20 configured to, when the data transmission satisfies a rate reduction trigger condition, perform rate adaptation processing on the cached first data packet to obtain a second data packet; wherein the rate adaptation processing is configured to reduce the size of the data packet to be transmitted within a single transmission timeslot; and wherein the first data packet is data encoded by the first device based on the current transmission rate;

[0117] The sending module 30 is configured to send the second data packet to the second device.

[0118] In one embodiment, based on the above embodiment, the rate adaptation process includes unpacking process and / or re-encoding process; the transmission rate corresponding to the re-encoding process is less than the current transmission rate.

[0119] In one embodiment, based on the above embodiment, the rate adaptation process includes a depacketization process, and the processing module 20 is specifically configured to: split the first data packet into multiple second data packets according to the reduced transmission rate.

[0120] In one embodiment, based on the above embodiment, the above processing module 20 is specifically used to: determine the number of unpacking according to the ratio of the current transmission rate to the transmission rate after the speed reduction; split the first data packet according to the number of unpacking to obtain multiple second data packets.

[0121] In one embodiment, based on the above embodiment, Figure 14 As shown, the rate adaptation process includes re-encoding processing, and the processing module 20 includes:

[0122] An acquiring unit 201 is configured to acquire a third data packet; the third data packet is an uncoded data packet corresponding to the first data packet;

[0123] The first encoding unit 202 is configured to encode the third data packet using the reduced transmission rate to obtain the second data packet.

[0124] In one embodiment, based on the above embodiment, the first device includes an audio module and a Bluetooth module; the acquisition unit 201 is specifically used to: send a re-encoding instruction to the audio module through the Bluetooth module; the re-encoding instruction includes the identifier of the first data packet to be encoded, and the transmission rate after the speed reduction; query the unencoded data packet corresponding to the identifier through the audio module to obtain the third data packet.

[0125] In one embodiment, based on the above embodiment, the encoding unit 202 is specifically used to: encode the third data packet through the audio module using the reduced transmission rate to obtain the second data packet, and send the second data packet to the Bluetooth module for caching.

[0126] In one embodiment, based on the above embodiment, Figure 15 As shown, the first device caches multiple first data packets; the processing module 20 includes:

[0127] The splitting unit 203 is configured to perform the unpacking process on at least one target data packet that is earlier in the sending order among the multiple first data packets to obtain a second data packet corresponding to the target data packet;

[0128] The second encoding unit 204 is configured to perform the re-encoding process on the remaining data packets in the plurality of first data packets except the target data packet to obtain second data packets corresponding to the remaining data packets.

[0129] In one embodiment, based on the above embodiment, the sending module 30 is specifically configured to: send one second data packet in each sending time slot, and send each second data packet to the second device in sequence.

[0130] In one embodiment, based on the above embodiment, Figure 16 As shown, the above-mentioned device further includes a speed reduction module 40, which is used to encode and cache the data packets to be cached using the reduced transmission rate when the data transmission meets the speed reduction trigger condition.

[0131] The implementation principle and technical effects of the above-mentioned data sending device can be found in the above-mentioned method embodiment, and will not be described in detail here.

[0132] The division of the modules in the above data sending device is only for illustration. In other embodiments, the data sending device may be divided into different modules as needed to complete all or part of the functions of the above data sending device.

[0133] For the specific definition of the data transmission device, please refer to the definition of the data transmission method above and will not be repeated here. Each module in the above-mentioned data transmission device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software so that the processor can call and execute the corresponding operations of each of the above modules.

[0134] Figure 17 Schematic diagram of the internal structure of an electronic device in one embodiment. The electronic device can be any terminal device such as a mobile phone, tablet computer, laptop computer, desktop computer, PDA (Personal Digital Assistant), POS (Point of Sales), vehicle-mounted computer, wearable device, etc. The electronic device includes a processor and a memory connected via a system bus. The processor may include one or more processing units. The processor may be a CPU (Central Processing Unit) or a DSP (Digital Signal Processing), etc. The memory may include a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by the processor to implement a data sending method provided in each of the following embodiments. The internal memory provides a cached operating environment for the operating system computer program in the non-volatile storage medium.

[0135] The various modules in the data transmission device provided in the embodiments of the present application may be implemented in the form of a computer program. The computer program may be executed on a terminal or server. The program modules comprising the computer program may be stored in a memory of an electronic device. When the computer program is executed by a processor, the steps of the method described in the embodiments of the present application are implemented.

[0136] The present 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 the data transmission method.

[0137] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the data sending method.

[0138] As used herein, any reference to memory, storage, database, or other medium may include non-volatile and / or volatile memory. Non-volatile memory may include ROM (Read-Only Memory), PROM (Programmable Read-only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-only Memory), or flash memory. Volatile memory may include RAM (Random Access Memory), which serves as an external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as SRAM (Static Random Access Memory), DRAM (Dynamic Random Access Memory), SDRAM (Synchronous Dynamic Random Access Memory), Double Data Rate DDRSDRAM (Double Data Rate Synchronous Dynamic Random Access memory), ESDRAM (Enhanced Synchronous Dynamic Random Access memory), SLDRAM (Sync Link Dynamic Random Access Memory), RDRAM (Rambus Dynamic Random Access Memory), and DRDRAM (Direct Rambus Dynamic Random Access Memory).

[0139] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.

Claims

1. A data transmission method, characterized in that: include: Determining whether data transmission between the first device and the second device meets a speed reduction trigger condition; If so, the first device performs rate adaptation processing on the cached first data packet to obtain a second data packet; wherein the rate adaptation processing is used to reduce the size of the data packet to be sent in a single transmission time slot; the first data packet is data encoded by the first device based on the current transmission rate; sending the second data packet to the second device; The rate adaptation processing includes unpacking processing, wherein the first device caches a plurality of first data packets; if the number of the cached first data packets is less than a first threshold, performing rate adaptation processing on the cached first data packets to obtain a second data packet includes: Determining the number of unpacked packets according to a ratio of the current transmission rate to the reduced transmission rate; Splitting the first data packet according to the number of unpacked packets to obtain a plurality of second data packets; The rate adaptation process further includes re-encoding; the transmission rate corresponding to the re-encoding process is less than the current transmission rate; if the number of cached first data packets is greater than or equal to the first threshold and less than a second threshold, performing rate adaptation on the cached first data packets to obtain a second data packet includes: performing the re-encoding process on the first data packet to obtain a plurality of the second data packets; If the number of cached first data packets is greater than or equal to the second threshold, performing rate adaptation on the cached first data packets to obtain second data packets includes: Among the multiple first data packets, perform the unpacking process on at least one target data packet that is sent earlier in the order of transmission to obtain a second data packet corresponding to the target data packet; The re-encoding process is performed on the remaining data packets in the plurality of first data packets except the target data packet to obtain second data packets corresponding to the remaining data packets.

2. The method according to claim 1, characterized in that The rate adaptation process includes unpacking and / or re-encoding; the transmission rate corresponding to the re-encoding process is lower than the current transmission rate.

3. The method according to claim 2, characterized in that The rate adaptation process includes re-encoding process, and performing rate adaptation process on the cached first data packet to obtain the second data packet includes: Obtain a third data packet; the third data packet is an uncoded data packet corresponding to the first data packet; The third data packet is encoded using the reduced transmission rate to obtain the second data packet.

4. The method according to claim 3, characterized in that The first device includes an audio module and a Bluetooth module; and obtaining the third data packet includes: Sending a re-encoding instruction to the audio module via the Bluetooth module; the re-encoding instruction includes an identifier of the first data packet to be encoded and a reduced transmission rate; The audio module queries an uncoded data packet corresponding to the identifier to obtain the third data packet.

5. The method according to claim 4, characterized in that The step of encoding the third data packet at the reduced transmission rate to obtain the second data packet includes: The third data packet is encoded by the audio module at a reduced transmission rate to obtain the second data packet, and the second data packet is sent to the Bluetooth module for buffering.

6. The method according to any one of claims 2 to 5, characterized in that: The sending the second data packet to the second device includes: One second data packet is sent in each sending time slot, and each second data packet is sent to the second device in sequence.

7. The method according to any one of claims 1 to 5, characterized in that The method further comprises: When the data transmission satisfies the speed reduction triggering condition, the data packets to be cached are encoded and cached using the reduced transmission rate.

8. A data sending device, characterized in that: include: a determination module, configured to determine whether the data transmission between the first device and the second device satisfies a speed reduction trigger condition; a processing module, configured to, when the data transmission satisfies a rate reduction trigger condition, perform rate adaptation processing on the cached first data packet to obtain a second data packet; wherein the rate adaptation processing is configured to reduce a size of a data packet to be transmitted within a single transmission time slot; and the first data packet is data encoded by the first device based on a current transmission rate; a sending module, configured to send the second data packet to the second device; The rate adaptation process includes a depacketization process, wherein the first device caches a plurality of first data packets; if the number of cached first data packets is less than a first threshold, the processing module is specifically configured to determine a number of depacketizations based on a ratio of the current transmission rate to the reduced transmission rate; and depacketize the first data packet according to the number of depacketizations to obtain a plurality of second data packets; The rate adaptation process further includes a re-encoding process; the transmission rate corresponding to the re-encoding process is less than the current transmission rate; if the number of cached first data packets is greater than or equal to the first threshold and less than a second threshold, the processing module is specifically configured to perform the re-encoding process on the first data packet to obtain a plurality of second data packets; If the number of cached first data packets is greater than or equal to the second threshold, the processing module is specifically used to perform the unpacking process on at least one target data packet with a higher sending order among the multiple first data packets to obtain a second data packet corresponding to the target data packet; and perform the re-encoding process on the remaining data packets among the multiple first data packets except the target data packet to obtain second data packets corresponding to the remaining data packets.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the computer program is executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Optimization method facing data protocol of non-connected user

    CN101110818A

  • Bluetooth data packet processing method and device

    CN110446193A

  • Rate control method and device

    WO2020124611A1