CN115276920A - Audio data processing method and device, electronic equipment and storage medium - Google Patents

Audio data processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115276920A
CN115276920A CN202210892851.6A CN202210892851A CN115276920A CN 115276920 A CN115276920 A CN 115276920A CN 202210892851 A CN202210892851 A CN 202210892851A CN 115276920 A CN115276920 A CN 115276920A
Authority
CN
China
Prior art keywords
audio data
data packet
bluetooth
preset threshold
data packets
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210892851.6A
Other languages
Chinese (zh)
Inventor
韦韧
吴限
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Wuqi Microelectronics Co Ltd
Original Assignee
Shanghai Wuqi Microelectronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Wuqi Microelectronics Co Ltd filed Critical Shanghai Wuqi Microelectronics Co Ltd
Priority to CN202210892851.6A priority Critical patent/CN115276920A/en
Publication of CN115276920A publication Critical patent/CN115276920A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1867Arrangements specially adapted for the transmitter end
    • H04L1/188Time-out mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1829Arrangements specially adapted for the receiver end
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1867Arrangements specially adapted for the transmitter end
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application provides an audio data processing method, an audio data processing device, an electronic device and a storage medium, wherein the method is applied to a Bluetooth sending end, and the Bluetooth sending end applies a flush mechanism when audio data transmission is carried out, and the method comprises the following steps: acquiring the number of audio data packets in a self-sending queue; adjusting the flush timeout time according to the number of the audio data packets; and transmitting the audio data packets in the sending queue based on the adjusted flush timeout time so as to meet the requirement of low delay on the premise of ensuring the communication quality as much as possible when transmitting the audio data.

Description

Audio data processing method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of audio processing, and in particular, to an audio data processing method and apparatus, an electronic device, and a storage medium.
Background
The Advanced Audio Distribution Profile (A2 DP) is a bluetooth transmission protocol in which Audio data is transmitted over an Asynchronous Connection-oriented Link (ACL) Connection between devices. In the ACL, if an audio data packet is not successfully transmitted, retransmission is performed all the time, and the time consumed for retransmitting the audio data packet is not considered. However, the audio data packet has strong timeliness, and if the audio data packet is retransmitted all the time, even if the final retransmission is successful, the requirement of low delay cannot be realized because the time of the audio data packet arriving at the receiving end is very late.
Disclosure of Invention
An object of the embodiments of the present application is to provide an audio data processing method, an audio data processing apparatus, an electronic device, and a storage medium, which are used to meet a low latency requirement on the premise of ensuring communication quality as much as possible when transmitting audio data.
In a first aspect, the present application provides an audio data processing method, which is applied to a bluetooth sending end, where the bluetooth sending end applies a flush mechanism when performing audio data transmission, and the method includes: acquiring the number of audio data packets in a self-sending queue; adjusting the flush timeout time according to the number of the audio data packets; and transmitting the audio data packets in the sending queue based on the adjusted flush timeout time.
In the foregoing implementation process, compared with the prior art, in which a fixed flush timeout period is set when a flush mechanism is adopted, in the audio data processing method provided in this application, in the transmission process of an audio data packet, for different transmission scenarios (i.e., the cumulative number of audio data packets in a transmission queue at a transmitting end), the flush timeout period in the flush mechanism is adjusted in real time according to the number of audio data packets in the transmission queue, and the audio data packets in the transmission queue are transmitted based on the flush timeout period adjusted in real time, so that the requirement of low latency is met on the premise of ensuring the communication quality as much as possible.
In an optional implementation manner, the adjusting the flush timeout time according to the number of the audio data packets includes: when the number of the audio data packets is larger than a first preset threshold value, reducing the flush timeout time by a first preset value; when the number of the audio data packets is smaller than the first preset threshold and larger than a second preset threshold, maintaining the flush timeout time unchanged; wherein the first preset threshold is greater than the second preset threshold; and when the number of the audio data packets is smaller than the second preset threshold value, increasing the flush timeout time by a second preset value.
In the implementation process, the first preset threshold and the second preset threshold are set, the number of the audio data packets is compared with the first preset threshold and the second preset threshold, and the flush timeout time is adjusted according to the comparison result, so that the flush timeout time in a flush mechanism can be flexibly adjusted according to the number of the audio data packets in the sending queue, and the method has the advantages of simple implementation logic and low processing delay.
In an optional embodiment, the first preset threshold and the second preset threshold are determined according to a delay requirement, a time for the bluetooth receiving end to receive an audio data packet, and a time for the bluetooth sending end to generate an audio data packet.
In the implementation process, a first preset threshold and a second preset threshold are determined according to the delay requirement, the time of receiving an audio data packet by the bluetooth receiving end and the time of generating an audio data packet by the bluetooth sending end, and then the flush timeout time is adjusted according to the first preset threshold and the second preset threshold, so that the flush timeout time in the flush mechanism can be flexibly adjusted according to the current transmission environment of the bluetooth device, and the requirement of low delay is further implemented on the premise of ensuring the communication quality as much as possible.
In an alternative embodiment, the first preset threshold is determined by the following formula: n is a radical of hydrogen1=(ReqDelay-A)/n1f; where ReqDelay is the delay requirement, A is the time for receiving an audio data packet by the Bluetooth receiving end, n1And f is the time for generating an audio data packet by the Bluetooth sending end when the value is more than 0.
In an alternative embodiment, the second preset threshold is determined by the following formula: n is a radical of2=(ReqDelay-A)/n2f; where ReqDelay is the delay requirement, A is the time for receiving an audio data packet by the Bluetooth receiving end, n2And f is the time for generating an audio data packet by the Bluetooth sending end when the value is more than 0.
In an optional implementation manner, each audio data packet includes identification information, the identification information of the same audio data packet is the same, and the transmitting the audio data packet in the transmission queue based on the adjusted flush timeout time includes: and transmitting the audio data packet and the corresponding identification information based on the adjusted flush timeout time so that the Bluetooth receiving end determines whether the received audio data packet is the same as the received audio data packet or not according to the identification information.
In the implementation process, each audio data packet comprises identification information, the identification information of the same audio data packet is the same, and the Bluetooth receiving end can perform repeated packet detection according to the identification information in the audio data packet, so that the communication quality is improved.
In a second aspect, the present application provides an audio data processing apparatus configured at a bluetooth sending end, the bluetooth sending end applies a flush mechanism when transmitting audio data, and the apparatus includes: the acquisition module is used for acquiring the number of the audio data packets in the self-sending queue; the adjusting module is used for adjusting the flush timeout time according to the number of the audio data packets; and the transmission module is used for transmitting the audio data packets in the sending queue based on the adjusted flush timeout time.
In an optional embodiment, the adjusting module is specifically configured to decrease the flush timeout time by a first preset value when the number of the audio data packets is greater than a first preset threshold; when the number of the audio data packets is smaller than the first preset threshold and larger than a second preset threshold, maintaining the flush timeout time unchanged; wherein the first preset threshold is greater than the second preset threshold; and when the number of the audio data packets is smaller than the second preset threshold value, increasing the flush timeout time by a second preset value.
In an optional embodiment, the first preset threshold and the second preset threshold are determined according to a delay requirement, a time when the bluetooth receiving end receives an audio data packet, and a time when the bluetooth sending end generates an audio data packet.
In an alternative embodiment, the first predetermined thresholdThe value is determined by the following formula: n is a radical of1=(ReqDelay-A)/n1f; where ReqDelay is the delay requirement, A is the time for receiving an audio data packet by the Bluetooth receiving end, n1And f is the time for generating an audio data packet by the Bluetooth sending end when the value is more than 0.
In an alternative embodiment, the second preset threshold is determined by the following formula: n is a radical of2=(ReqDelay-A)/n2f; where ReqDelay is the delay requirement, A is the time for receiving an audio data packet by the Bluetooth receiving end, n2And f is the time for generating an audio data packet by the Bluetooth sending end when the value is more than 0.
In an optional implementation manner, each audio data packet includes identification information, the identification information of the same audio data packet is the same, and the transmission module is specifically configured to transmit the audio data packet and the identification information corresponding to the audio data packet based on the adjusted flush timeout time, so that the bluetooth receiving end determines whether the received audio data packet is the same as the received audio data packet according to the identification information.
In a third aspect, the present application provides an electronic device, comprising: a processor, a memory, and a bus; the processor and the memory are communicated with each other through the bus; the memory stores program instructions executable by the processor, the processor being capable of executing the method of any one of the preceding embodiments when invoked by the processor.
In a fourth aspect, the present application provides a computer readable storage medium, on which computer program instructions are stored, which when read and executed by a computer, perform the method according to any one of the preceding embodiments.
Drawings
In order to more clearly explain the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may also be obtained from these drawings.
Fig. 1 is a flowchart of an audio data processing method according to an embodiment of the present application;
fig. 2 is a flowchart of performing duplicate packet detection at a bluetooth receiving end according to the embodiment of the present application;
fig. 3 is a block diagram of an audio data processing apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
The embodiment of the application provides an audio data processing method and device, electronic equipment and a storage medium, which are used for meeting the requirement of low delay on the premise of ensuring the communication quality as much as possible when audio data are transmitted.
The technology can be realized by adopting corresponding software, hardware and a combination of software and hardware. The following describes embodiments of the present application in detail.
The following description will be made with respect to an audio data processing method provided by the present application.
Referring to fig. 1, fig. 1 is a flowchart of an audio data processing method provided in an embodiment of the present application, where the audio data processing method is applied to a bluetooth sending end, and the bluetooth sending end applies a flush mechanism when performing audio data transmission, and the audio data processing method may include the following contents:
step S101: and acquiring the number of the audio data packets in the self sending queue.
Step S102: and adjusting the flush timeout time according to the number of the audio data packets.
Step S103: and transmitting the audio data packets in the sending queue based on the adjusted flush timeout time.
In order to solve the problem of continuous retransmission in the ACL, a flush mechanism is introduced.
The bluetooth protocol consists of a host layer and a controller layer. In an existing Flush mechanism, a fixed Flush Timeout (FT) is set in a controller layer of a sending end, and after an audio data packet to be sent reaches the controller layer from a host layer, the sending end sends the audio data packet to be sent to a receiving end within the Flush Timeout. If the receiving end successfully receives the audio data packet to be sent, replying an ACK; and if the receiving end does not receive the audio data packet to be sent or receives the audio data packet with errors, replying NACK. And after the receiving end receives the NACK, if the NACK still exists in the flush timeout time, retransmitting the audio data packet to be sent. When the accumulated time of the audio data packet to be sent on the controller layer of the sending end exceeds flush timeout time, in order to ensure that the subsequent audio data packet can be sent as soon as possible and the timeliness of the subsequent audio data packet is ensured, the sending end discards the audio data packet and repeats the process for the subsequent audio data packet.
Therefore, if the set value of the flush timeout time is large, the sending end can continuously retransmit the audio data packet when the audio data packet is not successfully sent, so that the delay of audio data transmission is large; if the flush timeout time setting value is small, when the audio data packet is not successfully transmitted, the transmitting end can relatively quickly discard the audio data packet which is not successfully transmitted, and the receiving end cannot receive the audio data packet, so that the communication quality is influenced.
Therefore, compared with the prior art, in which a fixed flush timeout time is set when a flush mechanism is adopted, in the audio data processing method provided in the embodiment of the present application, in the transmission process of an audio data packet, for different transmission scenarios (i.e., the cumulative number of audio data packets in a transmission queue of a transmitting end), the flush timeout time in the flush mechanism is adjusted in real time according to the number of audio data packets in the transmission queue, and the audio data packets in the transmission queue are transmitted based on the flush timeout time adjusted in real time, so that the requirement of low latency is met on the premise of ensuring the communication quality as much as possible.
It should be noted that the Audio data processing method provided in the embodiment of the present application may be applied to any Audio data transmission Protocol that employs a flush mechanism, is not limited to an A2DP transmission Protocol, and may also be applied to an L2CAP (Logical Link Control and adaptation Protocol) Protocol, a Low Energy Audio (LE Audio) Protocol, and other Audio data transmission protocols.
For convenience of understanding of the present solution, the above steps are explained below by taking an application to an A2DP transmission protocol as an example.
Step S101: and acquiring the number of the audio data packets in the self sending queue.
In the embodiment of the application, a sending queue is maintained in a controller layer of a bluetooth sending end, an audio data packet is sent to the controller layer by a host layer, the audio data packet received by the controller layer is stored in the sending queue, and the audio data packet is sent to a bluetooth receiving end in sequence according to the sending queue.
In consideration of the consumption of system resources and the limitation of a Bluetooth device hardware system, the waiting time of each audio data packet in the controller layer directly occupies a large amount of system resources.
Step S102: and adjusting the flush timeout time according to the number of the audio data packets.
In the embodiment of the application, after the number of the audio data packets in the transmission queue is acquired, the flush timeout time in the flush mechanism is adjusted according to the number of the audio data packets.
In an optional implementation manner, a preset number may be set, and if the number of audio data packets in the current transmission queue is greater than the preset number, the flush timeout time is reduced by a first preset value; and if the number of the audio data packets in the current sending queue is less than the preset number, increasing the flush timeout time by a second preset value.
If the number of the audio data packets in the current sending queue is greater than the preset number, it indicates that more audio data packets exist in the sending queue of the controller layer at the sending end and are not sent. In order to meet the requirement of low delay of audio data, flush timeout time is reduced, and the retransmission times of audio data packets which are not successfully transmitted are reduced, so that the audio data packets accumulated in a transmission queue are transmitted to a receiving end as soon as possible.
If the number of the audio data packets in the current sending queue is smaller than the preset number, it indicates that fewer audio data packets are not sent in the sending queue of the controller layer at the sending end. In order to improve the communication quality of the Bluetooth equipment, the flush timeout time is increased, the retransmission times of unsuccessfully transmitted audio data packets are increased, and each audio data packet in a transmission queue can be guaranteed to be successfully transmitted to a receiving end as far as possible.
In another alternative embodiment, step S102 may include the following:
when the number of the audio data packets is larger than a first preset threshold value, reducing the flush timeout time by a first preset value;
when the number of the audio data packets is smaller than a first preset threshold and larger than a second preset threshold, keeping the flush timeout time unchanged; the first preset threshold is larger than the second preset threshold;
and when the number of the audio data packets is smaller than a second preset threshold value, increasing the flush timeout time by a second preset value.
In the embodiment of the application, the first preset threshold and the second preset threshold are determined according to the delay requirement, the time for receiving an audio data packet by the bluetooth receiving end and the time for generating an audio data packet by the bluetooth sending end.
The first preset threshold may be determined by the following formula: n is a radical of1=(ReqDelay-A)/n1f, where ReqDelay is the delay requirement, A is the time for receiving an audio data packet by the Bluetooth receiving end, n1And f is the time for generating an audio data packet by the Bluetooth sending end.
The second preset threshold may be determined by the following formula: n is a radical of2=(ReqDelay-A)/n2f; where ReqDelay is the delay requirement, A is the time for receiving an audio data packet by the Bluetooth receiving end, n2And f is the time for generating an audio data packet by the Bluetooth sending end.
The following describes the logic for determining the first preset threshold and the second preset threshold.
And sending an audio data packet to a controller layer at a fixed interval of time f by a host layer of the Bluetooth sending end, wherein the interval of time f is the time for generating the audio data packet by the Bluetooth sending end.
Recording the transmission delay of an audio data packet as D, wherein the transmission delay D is defined as the time when a host layer of a Bluetooth sending end sends the audio data packet to a controller layer of the Bluetooth sending end as the starting time, and the time when the host layer of a Bluetooth receiving end receives the audio data packet as the ending time.
The transmission delay D consists of two parts:
(1) The moment when the controller layer of the bluetooth receiving end successfully receives the audio data packet from the air is used as the starting time, and the moment when the host layer of the bluetooth receiving end receives the audio data packet is used as the ending time, which is recorded as time A, namely the time when the bluetooth receiving end receives one audio data packet.
(2) The time when the host layer of the bluetooth sending end sends the audio data packet is used as the starting time, and the controller layer of the bluetooth sending end successfully takes the time when the audio data packet is sent to the air as the ending time, which is recorded as the time B.
Transmission delay D = time a + time B. It can be understood that the time a is determined by the performance of the hardware device at the receiving end of bluetooth, and therefore, the length of the time a is relatively fixed. Because the bluetooth sending end has a retransmission mechanism, in order to ensure the requirement of low transmission delay, the transmission delay D should be less than the delay requirement ReqDelay, i.e. B is less than or equal to ReqDelay-a.
When the number of audio data packets in the transmission queue in the controller layer of the bluetooth transmitting end is N, the time (i.e., time B) for the last audio data packet in the transmission queue to be successfully transmitted is at least f × N. According to the fact that B is less than or equal to ReqDelay-A, in order to guarantee the requirement of low transmission delay, the time for successfully sending the last audio data packet in the sending queue meets the condition f x N is less than or equal to ReqDelay-A.
The strain can be obtained by transposition, and N is less than or equal to (ReqDelay-A)/f. That is, when the number of audio packets in the transmission queue satisfies N ≦ (ReqDelay-A)/f, the transmission queueThe number of audio packets of (a) will gradually decrease. In order to meet the requirement of low delay on the premise of ensuring the communication quality as much as possible, a first preset threshold value N is set1Is set to N1=(ReqDelay-A)/n1f, setting a second preset threshold value N2Setting N2=(ReqDelay-A)/n2f,n2>n1
If N is present1>(ReqDelay-A)/n1And f, the number of the audio data packets in the current sending queue is larger, and more audio data packets are not sent. In order to meet the requirement of low delay of audio data, the flush timeout time is reduced by a first preset value, and the retransmission times of the audio data packets which are not successfully transmitted are reduced, so that the audio data packets accumulated in the transmission queue are transmitted to the receiving end as soon as possible.
If (ReqDelay-A)/n2f<N<(ReqDelay-A)/n1And f, the number of the audio data packets in the current sending queue is moderate, the flush timeout time does not need to be adjusted, and the current flush timeout time is kept.
If N is present1<(ReqDelay-A)/n2And f, the number of the audio data packets in the current sending queue is less, and only a small number of audio data packets wait for sending. In order to improve the communication quality of the Bluetooth equipment, the flush timeout time is increased by a first preset value, the retransmission times of unsuccessfully transmitted audio data packets are increased, and each audio data packet in a transmission queue can be guaranteed to be successfully transmitted to a receiving end as far as possible.
It should be noted that, in some embodiments, the first predetermined threshold N is set1Can be set to N1= (ReqDelay-A)/2 f, second preset threshold N2May be set to N2= ReqDelay-A)/4 f. In other embodiments, the first predetermined threshold N1Can also be set to N1= (ReqDelay-A)/3 f, second preset threshold N2To set up N2= (ReqDelay-a)/6 f; or a first predetermined threshold value N1Can also be set to N1= (ReqDelay-A)/2 f, second preset threshold N2To set up N2= (ReqDelay-a)/6 f, and the like, which are not specifically limited in the examples of the present application.
It can be understood that, in the two embodiments, the first preset value may be a minimum time interval in an A2DP transmission protocol, that is, 1slot (0.625 s), or may be 2 slots, 3 slots, and the like, which is not limited in this application. The second preset value may also be a minimum time interval in the A2DP transmission protocol, that is, 1slot (0.625 s), or 2 slots, 3 slots, and the like, which is not limited in this application. The first preset value and the second preset value may be the same or different. This is not a particular limitation of the present application.
In the implementation process, a first preset threshold and a second preset threshold are determined according to the delay requirement, the time of receiving an audio data packet by the bluetooth receiving end and the time of generating an audio data packet by the bluetooth sending end, and then the flush timeout time is adjusted according to the first preset threshold and the second preset threshold, so that the flush timeout time in the flush mechanism can be flexibly adjusted according to the current transmission environment of the bluetooth device, and the requirement of low delay is further implemented on the premise of ensuring the communication quality as much as possible.
Step S103: and transmitting the audio data packets in the sending queue based on the adjusted flush timeout time.
In the embodiment of the application, after the flush timeout time is adjusted, the audio data packets in the sending queue are transmitted based on the adjusted flush timeout time.
Further, when the transmission distance is long or interference exists in the transmission environment, the bluetooth sending end retransmits the audio data packet which is failed to be sent. The existing bluetooth sending end and bluetooth receiving end have the following mechanisms:
the audio data packet sent by the bluetooth sending end includes a seq bit field (the value of the seq bit field is 0 or 1). After the bluetooth sending end successfully receives the ACK replied by the receiving end each time, the value of the seq bit field is inverted (if the original is 0, the inversion is 1, and if the original is 1, the inversion is 0). If the bluetooth receiver does not receive the audio packet or the received audio packet is erroneous, NACK is replied. If the Bluetooth sending end receives NACK or does not receive any reply, the seq bit field in the audio data packet cannot be reversed, and the audio data packet is continuously sent to realize the retransmission of the audio data packet.
When the value of the seq bit field in a new audio data packet received by the Bluetooth receiving end is different from the value of the seq bit field in the previous audio data packet, the Bluetooth receiving end considers that the newly received audio data packet is a new audio data packet and does not retransmit the previous audio data packet. On the contrary, when the value of the seq bit field in the new audio data packet received by the bluetooth receiving end is the same as the value of the seq bit field in the previous audio data packet, the newly received audio data packet is considered to be the retransmission of the previous audio data packet, and the newly received audio data packet is discarded. By the above mode, the Bluetooth receiving end can realize repeated packet detection.
However, when the bluetooth sending end applies the flush mechanism during audio data transmission, the bluetooth sending end discards an audio data packet that is to be sent originally. When a bluetooth sending end sends a new audio data packet, the value of the seq bit field of the audio data packet may be the same as the value of the seq bit field of the previous audio data packet. If the bluetooth receiving end still performs repeated packet detection according to the original processing logic, the new audio data packet sent by the bluetooth sending end is discarded, thereby causing the communication quality to be reduced.
Therefore, as an optional implementation manner, in the audio data processing method provided in this embodiment of the present application, each audio data packet includes identification information, and the identification information of the same audio data packet is the same, where the step S103 includes the following steps:
and transmitting the audio data packet and the corresponding identification information based on the adjusted flush timeout time so that the Bluetooth receiving end determines whether the received audio data packet is the same as the received audio data packet or not according to the identification information.
In the embodiment of the application, the Bluetooth sending end generates identification information for each audio data packet, the audio data packet and the corresponding identification information are transmitted based on the adjusted flush timeout time, and after the Bluetooth receiving end receives the audio data packet, repeated packet detection is performed according to the identification information in the audio data packet.
The following describes, with reference to a specific scenario, the bluetooth receiving end performing duplicate packet detection according to the identification information. Referring to fig. 2, fig. 2 is a flowchart illustrating a bluetooth receiving end performing duplicate packet detection according to an embodiment of the present disclosure. Each audio packet includes a seq num, and the seq num of the same audio packet is the same. And the Bluetooth sending end sends the audio data packet and the corresponding identification information to the Bluetooth receiving end based on the adjusted flush timeout time, and after the Bluetooth receiving end successfully receives the audio data packet, the Bluetooth receiving end does not perform repeated packet detection according to the seq bit field specified in the original Bluetooth protocol. Performing CRC, if the CRC passes, sending an ACK (acknowledgement) to the Bluetooth sending segment no matter how many the value of the seq bit field of the audio data packet is, and indicating that the audio data packet is successfully received; and if the CRC does not pass, replying NACK to the Bluetooth sending segment, which indicates that the audio data packet is not successfully received and needs to be retransmitted by the Bluetooth sending end. And then, the Bluetooth receiving end sends the received audio data packet to a host layer or an APP layer above the host layer, and the host layer or the APP layer determines whether the audio data packet is a repeat packet according to the seq num of the audio data packet.
It can be understood that, since the same identification information of the audio data packets is the same, if the bluetooth receiving end determines that the identification information of the newly received audio data packet is the same as the identification information of the previously received audio data packet, it determines that the newly received audio data packet is a duplicate packet, and discards the newly received audio data packet.
In the implementation process, each audio data packet comprises identification information, the identification information of the same audio data packet is the same, and the Bluetooth receiving end can perform repeated packet detection according to the identification information in the audio data packet, so that the communication quality is improved.
Based on the same inventive concept, the embodiment of the application also provides an audio data processing device. Referring to fig. 3, fig. 3 is a block diagram of an audio data processing apparatus according to an embodiment of the present disclosure, where the audio data processing apparatus is configured at a bluetooth sending end, and the bluetooth sending end applies a flush mechanism when performing audio data transmission, and the audio data processing apparatus 200 may include:
an obtaining module 201, configured to obtain the number of audio data packets in a self-sending queue;
an adjusting module 202, configured to adjust the flush timeout time according to the number of the audio data packets;
a transmission module 203, configured to transmit the audio data packet in the sending queue based on the adjusted flush timeout time.
In an optional embodiment, the adjusting module 202 is specifically configured to decrease the flush timeout time by a first preset value when the number of the audio data packets is greater than a first preset threshold; when the number of the audio data packets is smaller than the first preset threshold and larger than a second preset threshold, maintaining the flush timeout time unchanged; wherein the first preset threshold is greater than the second preset threshold; and when the number of the audio data packets is smaller than the second preset threshold value, increasing the flush timeout time by a second preset value.
In an optional embodiment, the first preset threshold and the second preset threshold are determined according to a delay requirement, a time for the bluetooth receiving end to receive an audio data packet, and a time for the bluetooth sending end to generate an audio data packet.
In an alternative embodiment, the first preset threshold is determined by the following formula: n is a radical of hydrogen1= (ReqDelay-a)/2 f; the time delay requirement is ReqDelay, A is the time for receiving an audio data packet by the Bluetooth receiving end, and f is the time for generating an audio data packet by the Bluetooth sending end.
In an alternative embodiment, the second preset threshold is determined by the following formula: n is a radical of2= (ReqDelay-a)/4 f; the time delay requirement is ReqDelay, A is the time for receiving an audio data packet by the Bluetooth receiving end, and f is the time for generating an audio data packet by the Bluetooth sending end.
In an optional implementation manner, each audio data packet includes identification information, the identification information of the same audio data packet is the same, and the transmission module 203 is specifically configured to transmit the audio data packet and the identification information corresponding to the audio data packet based on the adjusted flush timeout time, so that the bluetooth receiving end determines whether the received audio data packet is the same as the received audio data packet according to the identification information.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an electronic device 300 according to an embodiment of the present application, where the electronic device 300 is configured with a bluetooth function, and a bluetooth sending end applies a flush mechanism when performing audio data transmission, and the electronic device 300 includes: at least one processor 301, at least one communication interface 302, at least one memory 303, and at least one bus 304. Wherein the bus 304 is used for realizing direct connection communication of these components, the communication interface 302 is used for communicating signaling or data with other node devices, and the memory 303 stores machine readable instructions executable by the processor 301. When the electronic device 300 is in operation, the processor 301 communicates with the memory 303 via the bus 304, and the machine readable instructions, when called by the processor 301, perform the audio data processing method as described above.
The processor 301 may be an integrated circuit chip having signal processing capabilities. The Processor 301 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field-Programmable Gate arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. Which may implement or perform the various methods, steps, and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The Memory 303 may include, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Read Only Memory (EPROM), an electrically Erasable Read Only Memory (EEPROM), and the like.
It will be appreciated that the configuration shown in FIG. 4 is merely illustrative and that electronic device 300 may include more or fewer components than shown in FIG. 4 or have a different configuration than shown in FIG. 4. The components shown in fig. 4 may be implemented in hardware, software, or a combination thereof. In the embodiment of the present application, the electronic device 300 may be, but is not limited to, an entity device such as a desktop, a notebook computer, a smart phone, an intelligent wearable device, and a vehicle-mounted device, and may also be a virtual device such as a virtual machine. In addition, the electronic device 300 is not necessarily a single device, but may also be a combination of multiple devices, such as a server cluster, and the like.
In addition, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a computer, the computer program performs the steps of the audio data processing method in the foregoing embodiment.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be through some communication interfaces, indirect coupling or communication connection between devices or units, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
It should be noted that the functions, if implemented in the form of software functional modules and sold or used as independent products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A method for processing audio data is applied to a Bluetooth sending end, wherein the Bluetooth sending end applies a flush mechanism when transmitting audio data, and the method comprises the following steps:
acquiring the number of audio data packets in a self-sending queue;
adjusting the flush timeout time according to the number of the audio data packets;
and transmitting the audio data packets in the sending queue based on the adjusted flush timeout time.
2. The method of claim 1, wherein the adjusting the flush timeout time according to the number of audio packets comprises:
when the number of the audio data packets is larger than a first preset threshold value, reducing the flush timeout time by a first preset value;
when the number of the audio data packets is smaller than the first preset threshold and larger than a second preset threshold, maintaining the flush timeout time unchanged; wherein the first preset threshold is greater than the second preset threshold;
and when the number of the audio data packets is smaller than the second preset threshold value, increasing the flush timeout time by a second preset value.
3. The method of claim 2, wherein the first predetermined threshold and the second predetermined threshold are determined according to a delay requirement, a time when a bluetooth receiver receives an audio data packet, and a time when the bluetooth transmitter generates an audio data packet.
4. The method of claim 3, wherein the first predetermined threshold is determined by the following formula: n is a radical of1=(ReqDelay-A)/n1f;
Where ReqDelay is the delay requirement, A is the time for receiving an audio data packet by the Bluetooth receiving end, n1And f is the time for generating an audio data packet by the Bluetooth sending end when the value is more than 0.
5. The method of claim 3, wherein the second predetermined threshold is determined by the following formula: n is a radical of hydrogen2=(ReqDelay-A)/n2f;
Wherein ReqDelay is the delay requirement, A is the receiving of the Bluetooth receiving endTime of one audio data packet, n2And f is the time for generating an audio data packet by the Bluetooth sending end when the value is more than 0.
6. The method according to any one of claims 1 to 5, wherein each audio data packet comprises identification information, the identification information of the same audio data packet is the same, and the transmitting the audio data packets in the transmission queue based on the adjusted flush timeout time comprises:
and transmitting the audio data packet and the corresponding identification information based on the adjusted flush timeout time so that the Bluetooth receiving end determines whether the received audio data packet is the same as the received audio data packet or not according to the identification information.
7. The utility model provides an audio data processing apparatus, characterized in that disposes in the bluetooth sending end, the bluetooth sending end uses the flush mechanism when carrying out audio data transmission, the device includes:
the acquisition module is used for acquiring the number of the audio data packets in the self-sending queue;
the adjusting module is used for adjusting the flush timeout time according to the number of the audio data packets;
and the transmission module is used for transmitting the audio data packets in the sending queue based on the adjusted flush timeout time.
8. The apparatus according to claim 7, wherein the adjusting module is specifically configured to decrease the flush timeout time by a first preset value when the number of audio data packets is greater than a first preset threshold; when the number of the audio data packets is smaller than the first preset threshold and larger than a second preset threshold, maintaining the flush timeout time unchanged; wherein the first preset threshold is greater than the second preset threshold; and when the number of the audio data packets is smaller than the second preset threshold value, increasing the flush timeout time by a second preset value.
9. An electronic device, comprising: a processor, a memory, and a bus; the processor and the memory are communicated with each other through the bus; the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the method of any of claims 1-6.
10. A computer-readable storage medium having computer program instructions stored thereon which, when read and executed by a computer, perform the method of any one of claims 1-6.
CN202210892851.6A 2022-07-27 2022-07-27 Audio data processing method and device, electronic equipment and storage medium Pending CN115276920A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210892851.6A CN115276920A (en) 2022-07-27 2022-07-27 Audio data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210892851.6A CN115276920A (en) 2022-07-27 2022-07-27 Audio data processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115276920A true CN115276920A (en) 2022-11-01

Family

ID=83772277

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210892851.6A Pending CN115276920A (en) 2022-07-27 2022-07-27 Audio data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115276920A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116634492A (en) * 2023-01-29 2023-08-22 上海物骐微电子有限公司 Data scheduling method, device and storage medium based on Bluetooth LE audio
CN117061070A (en) * 2023-09-15 2023-11-14 深圳旷世科技有限公司 Wireless audio transmission method, audio device and storage medium
CN117707462A (en) * 2023-05-16 2024-03-15 荣耀终端有限公司 Audio data processing method, electronic equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101697631A (en) * 2009-10-28 2010-04-21 中兴通讯股份有限公司 Method and device for reordering out-of-order orderable data packets
CN109213578A (en) * 2017-07-05 2019-01-15 武汉安天信息技术有限责任公司 A kind of dispatching method of task and scheduling system
WO2020124611A1 (en) * 2018-12-22 2020-06-25 华为技术有限公司 Rate control method and device
CN113259710A (en) * 2021-06-22 2021-08-13 北京百瑞互联技术有限公司 Method, system, and medium for improving audio transmission stuck
CN113365129A (en) * 2021-08-09 2021-09-07 北京百瑞互联技术有限公司 Bluetooth audio data processing method, transmitter, receiver and transceiving equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101697631A (en) * 2009-10-28 2010-04-21 中兴通讯股份有限公司 Method and device for reordering out-of-order orderable data packets
CN109213578A (en) * 2017-07-05 2019-01-15 武汉安天信息技术有限责任公司 A kind of dispatching method of task and scheduling system
WO2020124611A1 (en) * 2018-12-22 2020-06-25 华为技术有限公司 Rate control method and device
CN113259710A (en) * 2021-06-22 2021-08-13 北京百瑞互联技术有限公司 Method, system, and medium for improving audio transmission stuck
CN113365129A (en) * 2021-08-09 2021-09-07 北京百瑞互联技术有限公司 Bluetooth audio data processing method, transmitter, receiver and transceiving equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116634492A (en) * 2023-01-29 2023-08-22 上海物骐微电子有限公司 Data scheduling method, device and storage medium based on Bluetooth LE audio
CN116634492B (en) * 2023-01-29 2024-04-12 上海物骐微电子有限公司 Data scheduling method, device and storage medium based on Bluetooth LE audio
CN117707462A (en) * 2023-05-16 2024-03-15 荣耀终端有限公司 Audio data processing method, electronic equipment and medium
CN117061070A (en) * 2023-09-15 2023-11-14 深圳旷世科技有限公司 Wireless audio transmission method, audio device and storage medium
CN117061070B (en) * 2023-09-15 2024-03-29 深圳旷世科技有限公司 Wireless audio transmission method, audio device and storage medium

Similar Documents

Publication Publication Date Title
CN115276920A (en) Audio data processing method and device, electronic equipment and storage medium
CN111786748B (en) Data retransmission method and system, network card, device, server and storage medium
US11792114B2 (en) System and method for facilitating efficient management of non-idempotent operations in a network interface controller (NIC)
CN111512603B (en) Data transmission method and first equipment
US11695669B2 (en) Network interface device
US9529746B2 (en) Method for operating a communication system
CN110506403B (en) Method and apparatus for flow control of wireless devices
TW202205890A (en) Method for resource selection and first user equipment
TW200537877A (en) Retransmission system and method for a transport offload engine
CN113852563B (en) Message data transmission method and device, terminal equipment and readable storage medium
CN114786214A (en) Data packet retransmission method and device for wireless peer and readable storage medium
USRE43151E1 (en) Acknowledging data transmissions in the presence of multiple shared-communications channels
WO2019192354A1 (en) Scheduling request transmission method, terminal, and network side device
WO2020221206A1 (en) Harq feedback method, first terminal and computer-readable storage medium
US7626927B2 (en) System and method of data transmission in wireless communication networks
CN110913431A (en) Data wireless transmission method and device, computer equipment and storage medium
CN116868553A (en) Dynamic network receiver driven data scheduling on a data center network for managing endpoint resources and congestion relief
JPH0955718A (en) Data communication device
US20090252162A1 (en) Transmission apparatus, transmission method, and program
US8522104B2 (en) Smart aging retry buffer
CN113300967B (en) RDMA network transmission method, RDMA network transmission device and RDMA network communication system
WO2010136865A1 (en) Packet retransmission optimization in wireless network
CA2784985C (en) Apparatus and method of communicating automatic repeat request (arq) feedback in a wireless communication network
WO2023231910A1 (en) Feedback information sending method, feedback information receiving method, terminal, and storage medium
CN113556650B (en) TWS earphone wireless communication method, system, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination