WO2022247550A1 - 数据重传处理方法、装置、计算机设备和存储介质 - Google Patents

数据重传处理方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2022247550A1
WO2022247550A1 PCT/CN2022/088788 CN2022088788W WO2022247550A1 WO 2022247550 A1 WO2022247550 A1 WO 2022247550A1 CN 2022088788 W CN2022088788 W CN 2022088788W WO 2022247550 A1 WO2022247550 A1 WO 2022247550A1
Authority
WO
WIPO (PCT)
Prior art keywords
data packet
sequence number
retransmission
data
key
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.)
Ceased
Application number
PCT/CN2022/088788
Other languages
English (en)
French (fr)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to EP22810283.6A priority Critical patent/EP4224758A4/en
Priority to JP2023548347A priority patent/JP7664407B2/ja
Publication of WO2022247550A1 publication Critical patent/WO2022247550A1/zh
Priority to US18/077,733 priority patent/US12574152B1/en
Anticipated expiration legal-status Critical
Ceased 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/08Arrangements for detecting or preventing errors in the information received by repeating transmission, e.g. Verdan system
    • 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/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/1607Details of the supervisory signal
    • H04L1/1642Formats specially adapted for sequence numbers
    • 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/1825Adaptation of specific ARQ protocol parameters according to transmission conditions
    • 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
    • H04L1/1848Time-out mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • H04L43/0829Packet loss
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/20Arrangements for detecting or preventing errors in the information received using signal quality detector
    • H04L1/205Arrangements for detecting or preventing errors in the information received using signal quality detector jitter monitoring

Definitions

  • the present application relates to the technical field of network communication, and in particular to a data retransmission processing method, device, computer equipment, computer-readable storage medium and computer program product.
  • UDP User Datagram Protocol
  • User Datagram Protocol User Datagram Protocol
  • Various embodiments of the present application provide a data retransmission processing method, device, computer equipment, computer-readable storage medium, and computer program product capable of improving data transmission effects.
  • a data retransmission processing method executed by a computer device, the method comprising:
  • a data retransmission processing device comprising:
  • a threshold determination module configured to determine the threshold of the number of retransmissions of data packets in the retransmission period based on the data packet loss rate in the retransmission period, and obtain the respective sequence numbers of the data packets to be retransmitted in the retransmission period.
  • a key sequence number determination module configured to determine the respective key sequence numbers of each key data packet matching the set of sequence numbers
  • the serial number deletion module is used to filter out the target serial number from the key serial number, and delete the serial numbers less than or equal to the target serial number from the serial number set, so that the serial numbers remaining in the serial number set The number of is maximized, and the number of retained sequence numbers is less than or equal to the data packet retransmission number threshold;
  • a retransmission request module configured to request retransmission of data packets to be retransmitted corresponding to the sequence numbers retained in the sequence number set.
  • a computer device comprising a memory and one or more processors, the memory storing computer readable instructions which, when executed by the one or more processors, cause the one or more The following steps are implemented when the processor executes the computer-readable instructions:
  • One or more non-transitory computer-readable storage media having stored thereon computer-readable instructions that, when executed by one or more processors, cause the one or more or multiple processors execute the following steps:
  • a computer program product or computer program comprising computer readable instructions stored in a computer readable storage medium from which a processor of a computer device retrieves The medium reads the computer-readable instructions, and the processor executes the computer-readable instructions, so that the computer device implements the following steps when executed:
  • Fig. 1 is an application environment diagram of a data retransmission processing method in an embodiment
  • FIG. 2 is a schematic flowchart of a data retransmission processing method in an embodiment
  • FIG. 3 is a schematic diagram of packet loss during data transmission in an embodiment
  • FIG. 4 is a schematic diagram of interaction between a data retransmission processing receiving end and a sending end in an embodiment
  • FIG. 5 is a schematic diagram of a retransmission queue and a key sequence number queue in data retransmission processing in an embodiment
  • FIG. 6 is a schematic flowchart of a data retransmission processing method in another embodiment
  • FIG. 7 is a schematic diagram of a processing flow of a data retransmission processing method in an embodiment
  • FIG. 8 is a schematic diagram of a first frame delay comparison before and after optimization of the data retransmission processing method in an embodiment
  • Fig. 9 is a structural block diagram of a data retransmission processing device in an embodiment
  • Figure 10 is a diagram of the internal structure of a computer device in one embodiment.
  • the data retransmission processing method provided by this application can be implemented based on cloud technology (Cloud technology).
  • the data retransmission processing method provided in this application can be applied to the application environment shown in FIG. 1 .
  • the sending end 102 communicates with the receiving end 104 through the network.
  • the sending end 102 sends the data to the receiving end 104, and the receiving end 104 determines the threshold value of the number of retransmission data packets in the retransmission period based on the data packet loss rate in the retransmission period, and obtains the data packets to be retransmitted in the retransmission period.
  • the set of sequence numbers formed by the sequence numbers determine the respective key sequence numbers of each key data packet matched with the set of sequence numbers, the receiving end 104 screens out the target sequence number from the key sequence numbers, and deletes the sequence numbers less than or equal to The sequence number of the target sequence number, so that the number of sequence numbers retained in the sequence number set is maximized, and the number of retained sequence numbers is less than or equal to the threshold of the number of data packet retransmissions, and the receiving end 104 requests the sending end 102 to retransmit the sequence number The data packets to be retransmitted corresponding to the sequence numbers retained in the set.
  • the receiving end 104 can be but not limited to various desktop computers, notebook computers, smart phones, tablet computers and portable wearable devices
  • the sending end 102 can be a server
  • the server can be an independent physical server or multiple physical servers.
  • a server cluster or distributed system composed of servers can also provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data Cloud servers for basic cloud computing services such as artificial intelligence platforms.
  • the terminal may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto.
  • the terminal and the server may be connected directly or indirectly through wired or wireless communication, which is not limited in this application.
  • a data retransmission processing method is provided, and the method is applied to the receiving end in FIG. 1 as an example for illustration, including the following steps:
  • Step 202 based on the data packet loss rate in the retransmission period, determine the threshold of the number of retransmission data packets in the retransmission period, and obtain a sequence number set composed of the respective sequence numbers of the data packets to be retransmitted in the retransmission period.
  • the retransmission period refers to the duration represented by multiple time periods divided by time.
  • the receiving end detects whether there is packet loss in the data received in each time period, and when the packet loss meets the retransmission condition, send The sender sends a retransmission request.
  • the sending end and the receiving end are the data transmission objects. It can be understood that the sending end and the receiving end are a set of relative concepts. In different application scenarios, the sending end can also be used as the receiving end to receive data, and the receiving end can also be used as The sending end is used to send data, and whether the computer device is the sending end or the receiving end can be determined according to the transmission direction of the data.
  • Packet loss refers to the phenomenon that the data of one or more (referring to two or more) data packets cannot be transmitted from the sender to the receiver through the network. As shown in Figure 3, the sender sent a sequence number of 1 ⁇ n n data packets, however, no data packet with sequence number 2 was detected among the data packets received by the receiving end. Packets with sequence number 2 are lost. However, in scenarios such as streaming media technology, VoIP (Voice over Internet Protocol, IP-based voice transmission), online games, and video conferencing, packet loss may cause network jitter. Special attention should be paid to the fact that packet loss does not necessarily mean that there is a problem with data interaction. To some extent, packet loss may be accepted by both parties.
  • the retransmission condition is when the packet loss cannot be accepted by both parties. conditions of. Specifically, the retransmission condition may be one of conditions such as the number of retransmitted data packets reaching the quantity threshold, the packet loss rate within a certain period reaching the packet loss rate threshold, or a combination of multiple conditions.
  • the packet loss rate (Loss Tolerance or Packet Loss Rate) refers to the ratio of the number of lost data packets to the sent data group.
  • the data packet loss rate may be a ratio of the number of actually received data packets to the number of data packets that should be received within a period of time.
  • the packet loss rate is related to the packet length and the packet sending frequency. Generally, when the traffic of a Gigabit network card is greater than 200Mbps, the packet loss rate is less than 5/10,000; when the traffic of a 100M network card is greater than 60Mbps, the packet loss rate is less than 1/10,000.
  • the packet loss rate can be obtained by calculating the ratio of the difference between the number of output packets at the sending end and the number of input packets at the receiving end to the number of input packets, that is, [(input packets - output packets) /input message]*100%".
  • the data packet retransmission quantity threshold refers to the quantity threshold of data packets requested to be retransmitted within the retransmission period. Specifically, based on the data packet loss rate in the retransmission period and the transmission bandwidth of the receiver, the receiving end calculates the threshold of the number of retransmissions of data packets in the retransmission period. Transmission bandwidth is used to identify the amount of data passing through a link per unit time. Since the data packet loss rate in the retransmission period changes in real time, the threshold of the number of retransmissions of data packets can be determined dynamically based on the data packet loss rate in the retransmission period, and the threshold of the number of retransmissions in the retransmission period can be dynamically adjusted.
  • Adjustment compared to setting a fixed threshold for the number of retransmissions of data packets, dynamic adjustment can effectively avoid the time caused by the receiving end having to process too many retransmission requests at the same time in the case of severe network jitter and packet loss The occurrence of intermittent network storms.
  • the data packet to be retransmitted refers to the data packet that needs to be requested from the sender to resend when packet loss is detected.
  • the data message received by the receiving end carries a data packet, and the sequence number of the data packet is carried in a header of the message.
  • the sequence number is used to identify the sending sequence of multiple data packets corresponding to the sending segment.
  • the receiving end can infer the sequence number of the lost data packet based on the sequence number of the received data packet, so as to request the sending end to resend the data packet based on the sequence number.
  • the sequence number set is a set composed of respective sequence numbers of the data packets to be retransmitted. It should be noted that the sequence number set is updated in real time. When there is a new data packet to be retransmitted, the sequence number of the data packet to be retransmitted can be added to the sequence number set. When the data packet to be retransmitted is received , delete the sequence number of the data packet to be retransmitted from the sequence number set.
  • the set of sequence numbers may be a retransmission queue formed by sorting according to the size of the sequence numbers.
  • Step 204 determining the key sequence number of each key data packet matching the set of sequence numbers.
  • the key data packet is a data packet with specific meaning among the data packets received by the receiving end, specifically, the key data packet is a data packet used to combine with other data packets to obtain display data during the data rendering process. For example, a data packet corresponding to a key frame in a video data packet.
  • the receiving end can determine whether the data packet is a critical data packet according to the data packet type identifier of the data packet.
  • the key sequence number refers to the sequence number of the key data packet.
  • the sequence number set includes the sequence number of the lost packet data of the received data in a certain transmission task. Therefore, the sequence number set corresponds to the transmission task to which the received data belongs, and different transmission tasks correspond to different sequence number sets.
  • Each key data packet matching the set of sequence numbers is the same key data packet as the transmission task to which the data packet to be retransmitted belongs.
  • the key data packets received in the transmission task can also be screened to obtain the key data packets whose serial numbers are within the range of the serial number represented by the serial number set, and determine the filtered key data The key sequence number for the package.
  • the receiving end can first determine the received data packet that matches the data packet to be retransmitted, and then pass the data packet Class identification, determining the key data packets whose sequence numbers are in the sequence number range from the matched received data packets, and using the sequence numbers of the key data packets as the key sequence numbers.
  • Step 206 filter out the target serial number from the key serial number, and delete the serial number less than or equal to the target serial number from the serial number set, so that the number of serial numbers retained in the serial number set is maximized, and the number of retained serial numbers Less than or equal to the packet retransmission threshold.
  • the target serial number is the key serial number obtained by screening the key serial numbers and meeting the screening conditions.
  • the number of target serial numbers is 1, and the filter condition can be that after deleting serial numbers less than or equal to the target serial number from the serial number set, the number of serial numbers retained in the serial number set is maximized, and the number of retained serial numbers Less than or equal to the packet retransmission threshold.
  • the serial numbers less than or equal to the target serial number include serial numbers less than the target serial number and serial numbers equal to the target serial number.
  • Quantity maximization refers to a choice made within the range allowed by constraints to maximize the number of serial numbers retained in the serial number set.
  • the receiving end can use each key serial number as a candidate serial number, delete serial numbers less than or equal to the candidate serial number from the serial number set, and respectively record the number of serial numbers retained in the serial number set, From the candidate sequence numbers, select the qualified sequence numbers whose remaining sequence numbers are less than or equal to the data packet retransmission threshold, and then select the target sequence number with the largest number of retained sequence numbers from each qualified sequence number.
  • the key serial numbers can also be sorted according to the size of the serial number, starting from the key serial number with the smallest serial number, each key serial number is used as the target serial number in turn, and the sequence that is less than or equal to the target serial number is deleted from the serial number set number, until the number of sequence numbers retained in the sequence number set is less than or equal to the standard sequence number of the data packet retransmission threshold.
  • Step 208 requesting retransmission of the data packets to be retransmitted indicated by the sequence numbers retained in the sequence number set.
  • requesting retransmission means that the receiving end sends a retransmission request to the sending end, so that the sending end resends the requested data packet.
  • the specific content of the data packets cannot be obtained because the lost data packets have not been received yet, but since the sequence numbers of the data packets sent by the sending end are continuous, the receiving end can based on The sequence numbers that have been successfully received determine the sequence numbers of the lost packets, so the receiver can request the sender to retransmit the lost packets based on the sequence numbers.
  • NACK Negative Acknowledgment, which is a kind of negative feedback at the receiving end, and the receiving party notifies the sender only when the data is not received
  • NACK Negative Acknowledgment, which is a kind of negative feedback at the receiving end, and the receiving party notifies the sender only when the data is not received
  • the receiving end Based on the serial numbers retained in the serial number set, the receiving end generates a retransmission request corresponding to the retained serial numbers one by one and sends it to the sending end, requesting retransmission of the pending Retransmit the packet.
  • the above data retransmission processing method determines the threshold of the number of data packet retransmissions based on the data packet loss rate, so that the threshold of the number of data packet retransmissions can be dynamically adjusted based on the data packet loss rate of the retransmission cycle, based on the number of retransmissions to be retransmitted within the retransmission cycle.
  • the data packet and each key data packet matched by the data packet to be retransmitted, the target sequence number is filtered out from the key sequence number, and the sequence number less than or equal to the target sequence number is deleted from the sequence number set based on the respective sequence numbers of the data packets to be retransmitted.
  • the number of serial numbers so that the number of serial numbers retained in the serial number set is maximized, and the number of retained serial numbers is less than or equal to the threshold of the number of data packet retransmissions.
  • request retransmission Maximization of data packets to be retransmitted by processing retransmission requests based on the retransmission cycle, the deleted sequence number can be retransmitted for the data packets to be retransmitted in the previous retransmission cycle, which avoids missing data to be retransmitted
  • the packet retransmission request can effectively control the number of data packets to be retransmitted within each retransmission cycle, avoiding network jitter or delay, and improving the data transmission effect.
  • all or part of the transmission bandwidth may be used for retransmission of data packets.
  • part of the bandwidth may be selected from the transmission bandwidth as the retransmission bandwidth.
  • the receiving end calculates the threshold of the number of data packet retransmissions in the retransmission period based on the data packet loss rate in the retransmission period and the retransmission bandwidth in the transmission bandwidth of the receiving end.
  • determining the threshold of the number of retransmissions of data packets in the retransmission period includes: The received data volume threshold when the data packet loss rate is reached within the period; based on the data volume of each data packet, determine the data packet retransmission quantity threshold corresponding to the received data volume threshold.
  • the receivable data volume refers to the maximum data volume that can be transmitted on the line per unit time, and the commonly used unit is bps.
  • the transmission bandwidth at the receiving end is a fixed value, and the retransmission bandwidth in the transmission bandwidth can be determined by a set weight parameter, for example, the weight parameter that the retransmission bandwidth accounts for 20% of the transmission bandwidth.
  • the weight parameter can be obtained by fitting based on the ratio of historical retransmission data to all transmission data (including normal transmission data and retransmission data).
  • the received data volume threshold when the data packet loss rate is reached refers to the amount of data that can be received normally considering the existence of data packet loss.
  • the retransmission bandwidth in the transmission bandwidth can receive 0.4 Mbps of data.
  • the threshold for the number of retransmissions is 26 per second. Combined with the time indicated by the retransmission period, the threshold for the number of retransmissions of data packets corresponding to the threshold of the amount of data received in the retransmission period is obtained.
  • the packet loss rate weight parameter By setting the packet loss rate weight parameter, a more accurate calculation result of the data transmission success rate of the retransmitted data can be obtained, thereby obtaining an accurate data packet retransmission quantity threshold.
  • the receiving end obtains the retransmission code rate corresponding to the retransmission bandwidth based on the transmission code rate corresponding to the transmission bandwidth and the ratio of the retransmission bandwidth to the transmission bandwidth, based on the corresponding data packet loss rate in the retransmission period
  • the retransmission success rate of the retransmitted data determines the optimized retransmission code rate within the retransmission period; based on the data volume of each data packet, determines the data packet retransmission quantity threshold corresponding to the optimized retransmission code rate.
  • an accurate and reliable data packet retransmission threshold can be obtained.
  • dynamic adjustment can effectively avoid In the case of severe network jitter and packet loss, the receiving end needs to process too many retransmission requests at the same time, resulting in intermittent network storms.
  • determining the respective key sequence numbers of each key data packet matching the set of sequence numbers includes:
  • the maximum sequence number and the minimum sequence number can be obtained by sorting the respective sequence numbers of the data packets to be retransmitted.
  • the sequence number set can be a retransmission queue sorted according to the size of the sequence numbers. The head and tail of the retransmission queue are the largest sequence number and the smallest sequence number.
  • the first sequence number of the retransmission queue is the largest sequence number, and the last sequence number is the smallest sequence number; when the sequence numbers are arranged in ascending order, the first sequence number of the retransmission queue is The smallest serial number, the last serial number is the largest serial number.
  • the set of key sequence numbers includes the respective sequence numbers of key data packets.
  • the sequence numbers of key data packets are defined as key sequence numbers.
  • the critical data packet is a part of the data packet that the receiving end has received, and the data packet to be resent is the data packet that the receiving end has not received.
  • the data packet to be resent is determined based on the received data packet, and the received data packet corresponds to the transmission task.
  • the key sequence number set based on the key data packet in the received data packet also corresponds to the transmission task.
  • each key sequence number in the key sequence number set is compared with the maximum sequence number and the minimum sequence number, if the key sequence number is greater than the minimum sequence number and less than the maximum sequence number , it is determined that the key sequence number is the key sequence number that matches the sequence number set. If the key sequence number is smaller than the minimum sequence number or greater than the maximum sequence number, skip the key sequence number and compare the next key sequence number until the key The serial number collection is traversed to the end, so as to filter out the matching key serial numbers. By traversing the set of key serial numbers, the accuracy of the filtered matching key serial numbers can be ensured.
  • the sequence number set may be a retransmission queue sorted according to the sequence numbers of data packets to be retransmitted
  • the key sequence number set may be a key sequence number queue sorted according to the size of the key sequence numbers.
  • the sequence numbers of received data packets include 1, 3, 5, 7, 10, 15, ..., n
  • the sequence numbers in the retransmission queue include 2, 4, 6, 8, 9, 11 , ..., m
  • the serial numbers in the key serial number queue include 5, 10, 15, 19, ..., k.
  • the retransmission queue and the key sequence number queue carry task identifiers corresponding to the transmitted data, and based on the task identifier, the matching retransmission queue and key sequence number queue can be determined.
  • the key data packets can be further screened, so that the number of key data packets can be minimized, which is convenient for reducing the key sequence number of subsequent key data packets.
  • the data processing volume of the target serial number is filtered out from the serial number to improve the data processing efficiency.
  • the data retransmission processing party further includes: extracting the data packet category identifier carried in the header corresponding to the received data packet; when the data packet category identifier indicates that the data packet is a critical data packet, number is added to the key sequence number collection.
  • the header refers to the data used to record the data transmission message in the message
  • the message is a data unit exchanged and transmitted in the network, that is, a data block to be sent by the station at one time.
  • the message includes complete data information to be sent, specifically including the data packet to be transmitted and the corresponding data transmission message, wherein the data transmission message includes the data packet type identifier of the data packet and the corresponding serial number of the data packet.
  • the receiving end when it receives the message, it extracts the data packet type identifier from the header, and if the data packet type identifier represents a key data packet, then extracts the sequence number from the header, and adds the sequence number to the packet to which the message belongs.
  • the set of key sequence numbers corresponding to the transfer task when the receiving end receives the message, it extracts the data packet type identifier from the header, and if the data packet type identifier represents a key data packet, then extracts the sequence number from the header, and adds the sequence number to the packet to which the message belongs.
  • the set of key sequence numbers corresponding to the transfer task when the receiving end receives the message, it extracts the data packet type identifier from the header, and if the data packet type identifier represents a key data packet, then extracts the sequence number from the header, and adds the sequence number to the packet to which the message belongs.
  • the type identifier of the data packet includes I frame, P frame and B frame.
  • I frame represents a key frame, including a complete picture, which can be understood as a complete reservation of this frame of picture, and only the data of this frame is needed for decoding;
  • P frame represents a key frame (or P frame) between this frame and the previous one
  • the P frame can also be understood as a difference frame, there is no complete picture data, only the data different from the picture of the previous frame.
  • the B frame is a two-way difference frame, which records the difference between the current frame and the previous and subsequent frames.
  • the receiving end receives the message and analyzes the header in the message to determine that the video frame package contained in the message is a key frame, the sequence number in the message is added to the transmission task to which the message belongs. Keyframe sequence.
  • the target serial number is screened out from the key serial number, and the serial numbers less than or equal to the target serial number are deleted from the serial number set, so that the number of serial numbers retained in the serial number set is maximized, and the remaining serial numbers
  • the number of numbers is less than or equal to the threshold for the number of packet retransmissions, including:
  • the key sequence number is used as the target sequence number, and from the sequence number set based on the respective sequence numbers of the data packets to be retransmitted, delete the sequence numbers that are less than or equal to the target sequence number until the sequence number set
  • the number of sequence numbers retained in is less than or equal to the threshold of the number of data packet retransmissions.
  • the sequence number set does not include the sequence number equal to the target sequence number. If the critical data packets received by the receiving end arrive out of sequence, before the critical data packet arrives, there may be The key data packet is used as the data packet to be retransmitted, and the key sequence number of the key data packet is added to the sequence number set. Therefore, there may be a key sequence number in the sequence number set, but because the receiving end has actually received the key sequence number The key data packet referred to by the key sequence number, so the sequence number equal to the key sequence number can be directly deleted from the sequence number set to avoid repeated transmission of the data packet.
  • the receiving end selects a key sequence number in order from the key sequence number that is greater than the smallest sequence number in the sequence number set.
  • Target serial number delete the serial number less than or equal to the target serial number in the serial number set, determine whether the number of serial numbers retained in the serial number set is greater than the threshold of the number of data packet retransmissions, if so, set the next key serial number as the target Serial number, perform the same processing, if not, end the screening process of the target serial number.
  • the data processing speed can be improved, and the rapid screening of the target serial numbers can be realized.
  • the data retransmission processor further includes: the current sequence number of the currently received data packet is greater than the historical sequence number of the last received data packet, and there is an intermediate sequence number between the current sequence number and the historical sequence number , add the intermediate sequence number to the sequence number set; when the current sequence number of the currently received data packet is less than the historical sequence number of the last received data packet, delete the current sequence number from the sequence number set.
  • the currently received data packet refers to the data packet that was received last time and has not yet been processed accordingly.
  • the last received data packet refers to a data packet received once before the currently received data packet and for which corresponding processing has been completed.
  • the current sequence number of the currently received data packet should be greater than the historical sequence number of the last received data packet, and the current sequence number and the historical sequence number are two adjacent sequence numbers, that is, the current There are no intermediate serial numbers between serial numbers and historical serial numbers.
  • the current sequence number of the currently received data packet is greater than the historical sequence number of the last received data packet, and there is no intermediate sequence number between the current sequence number and the historical sequence number, it means that each data packet arrives sequentially and there is no packet loss Phenomenon.
  • the current serial number is greater than the historical serial number and there is an intermediate serial number between the two, it means that there is packet loss between the current serial number and the historical serial number, and the intermediate serial number is the data packet with packet loss, which needs to be requested to send end resends the lost packet.
  • the intermediate serial number is the data packet with packet loss, which needs to be requested to send end resends the lost packet.
  • the current sequence number of the currently received data packet is less than the historical sequence number of the last received data packet, it means that the currently received data packet is obtained from the receiving end out of order, and the receiving end has received the data packet sent after it, so , the data number of the currently received data packet has been added to the sequence number set, therefore, the current sequence number needs to be deleted from the sequence number set, and there is no need to request the sender to resend the data packet.
  • the sequence number of the data packet to be retransmitted is added to the sequence number set, and when the current sequence number is smaller than the history
  • delete the serial numbers of data packets received out of order from the serial number set to ensure that the serial numbers in the serial number set are all the serial numbers of data packets not received by the receiving end to avoid duplication of data packets transmission, thereby improving the accuracy of data retransmission.
  • the intermediate sequence number is added to To the sequence number set includes: when the current sequence number of the currently received data packet is greater than the historical sequence number of the last received data packet, and there is an intermediate sequence number between the current sequence number and the historical sequence number, calculate the current sequence number and the historical sequence number The serial number difference between serial numbers; when the serial number difference is less than or equal to the difference threshold, the intermediate serial number is added to the serial number collection.
  • the serial number difference refers to the result obtained by calculating the difference of the serial numbers.
  • the sequence can be further controlled
  • the number of serial numbers in the serial number set is reduced, thereby reducing the amount of data processing corresponding to the serial number deletion process for the serial number set and improving data processing efficiency.
  • the data retransmission processor further includes: when the current sequence number of the currently received data packet is greater than the historical sequence number of the last received data packet, and the current sequence number and the historical sequence number are continuous sequence numbers, Render based on packets with current sequence number.
  • the continuous sequence number refers to two sequence numbers adjacent to the sequence number, for example, the current sequence number is 10, and the historical sequence number of the last received data packet is 9.
  • Rendering based on the data packet may specifically be performed by judging whether the data packet is a key data packet, if so, rendering is performed directly through data packet parsing, otherwise, the data packet is parsed and merged with the key data packet and then rendered.
  • video frame rendering can be performed at real-time intervals through packet frame merging.
  • the current sequence number of the currently received data packet is greater than the historical sequence number of the last received data packet, and the current
  • the data packet category identification of the data packet referred to by the current serial number is obtained, and if the data packet category identification represents a key frame data packet, then the key frame data packet based on the current serial number is performed Image rendering, if the data packet type identifier indicates a difference frame or a two-way difference frame, data superimposition is performed on the difference frame or two-way difference frame and the key frame data packet, and image rendering is performed on the superimposed data.
  • the live broadcast scene can be used for low-latency interactive live broadcast, live broadcast viewing, real-time recording, screen sharing, beauty effects, stereo and other functions.
  • the audio and video data includes video data, or a combined result of video data and audio data.
  • the data packet category identification includes I frame, P frame and B frame.
  • I frame represents a key frame, including a complete picture, which can be understood as a complete reservation of this frame of picture, and only the data of this frame is needed for decoding;
  • P frame represents a key frame (or P frame) between this frame and the previous one When decoding, it is necessary to superimpose the difference defined in this frame with the previously cached picture to generate the final picture.
  • the P frame can also be understood as a difference frame, there is no complete picture data, only the data different from the picture of the previous frame.
  • the B frame is a two-way difference frame, which records the difference between the current frame and the previous and subsequent frames. To decode the B frame, not only the previous cached picture must be obtained, but also the decoded picture. The screen data for rendering.
  • the data retransmission processor also includes: when the sequence number difference is greater than the difference threshold, clear the sequence numbers in the sequence number set, and based on the current sequence number, request to transmit the key data packet matching the current sequence number.
  • the key data packet matching the current sequence number is the first key data packet that the sender can find sequentially according to the sequence number based on the current sequence number.
  • each data packet received by the receiving end can be parsed through the message to obtain the serial number of the data packet, and the current serial number of the currently received data packet and the last received data packet can be obtained by calculating the difference between the serial numbers.
  • the sequence number difference between the historical sequence numbers of the data packets by comparing the sequence number difference with the difference threshold, when the sequence number difference is greater than the difference threshold, the receiving end clears the sequence numbers in the sequence number set.
  • the receiving end sends a key data packet request to the sending end based on the current sequence number
  • the sending end can extract the current sequence number in the key data packet request, starting from the current sequence number, from the cached data cached in order of sequence number Find the first key sequence number after the current sequence number, and send the key data packet indicated by the key sequence number to the receiving end.
  • the sending end can also generate new key data packets in real time based on the current sequence number and send them to the receiving end.
  • the receiver marks the sequence number of the data packet received this time as seq1, and the sequence number of the last arrived data packet is marked as seq2 , seq1>seq2, seq1-seq2 is the size of the hole, and seq grows continuously.
  • the normal network packet loss seq (serial number) hole size is within a certain range.
  • the network is basically abnormal during the time of the elevator. Yes, the packets sent by the sender are basically discarded, and the latest seq1 will be restored after exiting the elevator.
  • the value of the difference threshold max_void can be set according to needs, for example, 600, 800, 1000, etc., and the difference threshold can be converted into a network abnormality duration.
  • the difference threshold as 800 as an example, the average bit rate of the video is 2Mbps.
  • the sequence between the current sequence number and the historical sequence number when the number difference is greater than the difference threshold, the serial numbers in the serial number set are cleared, which avoids adding a large number of serial numbers to the serial number set when the network is abnormal, causing a large number of data packet retransmission requests to the sender, which is very It solves the problem of severe network jitter and packet loss, processing a large number of retransmission requests at the same time, which leads to intermittent network storms, and ensures the stability of the data transmission process.
  • the data retransmission processor further includes: smoothing the historical delay data corresponding to the historical transmission data to obtain reference delay data; determining the retransmission period based on the reference delay data, and determining the retransmission period corresponding to the The duration is greater than or equal to the duration corresponding to the reference delay data.
  • the historical transmission data refers to the data that has been successfully transmitted
  • the historical delay data may be the round-trip time delay (Round-Trip Time, RTT for short) corresponding to the historically transmitted data packets respectively.
  • Round-trip latency is the time it takes for data to travel from one end of the network to the other.
  • delay consists of four parts: sending delay, propagation delay, queuing delay, and processing delay.
  • SRTT smoothed
  • SRTT smoothed
  • SRTT smoothed
  • a retransmission cycle whose time length is greater than or equal to the time length corresponding to the reference time delay data is obtained. Since the reference delay data is dynamically changing, the retransmission period is dynamically updated based on the reference delay data. Specifically, the SRTT transmission protocol stack will calculate the SRTT in real time, and dynamically adjust the retransmission period according to the real-time calculation result of the SRTT, for example, adjust the size once every 30 seconds.
  • the retransmission period can be dynamically updated, so that the retransmission period matches the real-time network status, thereby realizing the adjustment of the data processing amount of each retransmission period, Achieve balanced data processing.
  • the data retransmission processing party further includes: recording the number of retransmission requests corresponding to each data packet to be retransmitted; The sequence number of the packet to be retransmitted is deleted from the set.
  • the request times threshold is a preset maximum number of requests for the same data packet to be retransmitted.
  • the sender will initiate a retransmission request to the sender based on the data packet to be retransmitted indicated by each remaining sequence number in the sequence number set. Specifically, in each retransmission cycle, a retransmission request is initiated for the seq packet retained in the sequence number set, and the number of retransmissions retries+1 of the seq request is marked and recorded. When retries>MaxRetries, the seq will be removed from the sequence
  • the request number threshold MaxRetries can be set according to the transmission scenario.
  • MaxRetries MaxRTCDelay/SRTT+1, You can set it yourself according to the scenario.
  • the larger the MaxRetries the larger the number of serial numbers in the serial number set, and the more serial numbers that need to be deleted for the serial number set, resulting in a larger amount of data processing. If it is not correct
  • the sequence number set controls the number of sequence numbers, and the end-to-end delay will increase.
  • the threshold of the number of retransmissions of data packets in the retransmission period is determined, including:
  • the packet loss rate threshold refers to the maximum allowed packet loss rate.
  • the packet loss rate threshold can be a preset fixed value, or can be adjusted according to actual application scenarios, such as real-time adjustment or periodic adjustment. In a specific application, the packet loss rate threshold may be set to 10%.
  • the receiving end detects that the data packet loss rate in the retransmission period reaches more than 10%, based on the data packet loss rate in the retransmission period, determine the threshold of the number of retransmissions of data packets in the retransmission period, and obtain the A sequence number set composed of the sequence numbers of the data packets to be retransmitted, determine the key sequence numbers of each key data packet that matches the sequence number set, filter out the target sequence number from the key sequence number, and delete it from the sequence number set
  • the sequence number is less than or equal to the target sequence number, so that the number of sequence numbers retained in the sequence number set is maximized, and the number of retained sequence numbers is less than or equal to the threshold of the number of data packet retransmissions, requesting retransmission of the remaining sequence numbers in the sequence number set
  • the retransmission of the data packet is requested, and the data packet requested for retransmission is stored in the sequence number set. Refers to the data packets to be retransmitted, using the method of limiting the packet loss rate threshold to determine whether to trigger a retransmission request, limiting the specific triggering scenarios, and avoiding the retransmission processing of data packets as long as there are data packets to be retransmitted, to achieve Precise scene definition is achieved, and waste of data processing resources is avoided.
  • the data retransmission processor further includes: when the data packet loss rate in the retransmission period is less than or equal to the packet loss rate threshold, requesting retransmission of the data packets to be retransmitted in the retransmission period.
  • determining the key sequence numbers of each key data packet matching the sequence number set includes: when the number of data packets to be retransmitted in the retransmission period is greater than the retransmission quantity threshold of data packets in the retransmission period When , determine the respective key sequence numbers of each key data packet matching the set of sequence numbers.
  • the threshold of the number of retransmission data packets in the retransmission period is determined, and the sequence number set composed of the sequence numbers of the data packets to be retransmitted in the retransmission period is obtained.
  • the retransmission of the data packet is requested, and the data packet requested for retransmission is For the data packets to be retransmitted referred to by the serial numbers retained in the serial number set, the method of judging whether to trigger a retransmission request is based on the number of data packets to be retransmitted, and the specific triggering condition scenarios for triggering a retransmission request are limited.
  • the data packet is retransmitted, which realizes precise scene limitation and avoids the waste of data processing resources.
  • the data retransmission processor further includes: when the number of data packets to be retransmitted in the retransmission period is less than or equal to the threshold of the number of retransmission data packets in the retransmission period, requesting retransmission within the retransmission period packets to be retransmitted.
  • the number of data packets to be retransmitted in the retransmission period is less than or equal to the threshold of the number of data packets to be retransmitted in the retransmission period, directly request retransmission of the data packets to be retransmitted in the retransmission period
  • the data packet transmission avoids the complicated processing process, which is beneficial to improve the data processing efficiency when the number of data packets to be retransmitted in the retransmission period is small.
  • the data packet loss rate within the retransmission period is less than or equal to the packet loss rate threshold
  • retransmission of the data packets to be retransmitted within the retransmission period is requested.
  • the data packet loss rate in the retransmission period is greater than the packet loss rate threshold
  • determine the threshold for the number of retransmissions in the retransmission period and obtain the retransmissions to be retransmitted in the retransmission period
  • the set of sequence numbers composed of the respective sequence numbers of the data packets when the number of data packets to be retransmitted in the retransmission period is less than or equal to the threshold of the number of retransmissions of data packets in the retransmission period, request retransmission of the data packets in the retransmission period Packets to be retransmitted.
  • the number of data packets to be retransmitted in the retransmission period is greater than the threshold of the number of retransmission data packets in the retransmission period, determine the key sequence numbers of each key data packet that matches the sequence number set, and filter out the key sequence numbers from the key sequence numbers Target sequence number, delete the sequence number that is less than or equal to the target sequence number from the sequence number set, so that the number of sequence numbers retained in the sequence number set is maximized, and the number of retained sequence numbers is less than or equal to the threshold of the number of data packet retransmissions , to request retransmission of the data packets to be retransmitted indicated by the sequence numbers retained in the sequence number set.
  • the retransmission of the data packet is requested.
  • the data packet requested for retransmission is the data packet to be retransmitted referred to by the serial number retained in the sequence number set.
  • the specific trigger conditions of the retransmission request are limited to two threshold conditions Satisfied at the same time, the threshold for triggering retransmission requests for the above-mentioned data packets to be retransmitted is further increased, and unnecessary waste of data processing resources caused by frequent triggering of retransmission requests is avoided.
  • a data retransmission processing method including the following steps:
  • Step 602 smoothing the historical time delay data corresponding to the historical transmission data to obtain reference time delay data, based on the reference time delay data, determine a retransmission cycle, the duration of the retransmission cycle is greater than or equal to the time length corresponding to the reference time delay data.
  • Step 604 when the current sequence number of the currently received data packet is greater than the historical sequence number of the last received data packet, and the current sequence number and the historical sequence number are continuous sequence numbers, perform the process based on the data packet indicated by the current sequence number rendering.
  • Step 606 when the current sequence number of the currently received data packet is greater than the historical sequence number of the last received data packet, and there is an intermediate sequence number between the current sequence number and the historical sequence number, calculate the difference between the current sequence number and the historical sequence number The serial number difference between.
  • Step 608 when the difference of the sequence numbers is greater than the difference threshold, clear the sequence numbers in the sequence number set, and based on the current sequence number, request to transmit the key data packet matching the current sequence number.
  • Step 610 when the serial number difference is less than or equal to the difference threshold, add the intermediate serial number to the serial number set.
  • Step 612 when the current sequence number of the currently received data packet is smaller than the historical sequence number of the last received data packet, delete the current sequence number from the sequence number set.
  • Step 614 extracting the data packet type identification carried in the header corresponding to the received data packet, and adding the sequence number carried in the header to the key sequence number set when the data packet type identification indicates that the data packet is a key data packet.
  • Step 616 when the data packet loss rate within the retransmission period is less than or equal to the packet loss rate threshold, request retransmission of the data packets to be retransmitted within the retransmission period.
  • Step 618 when the data packet loss rate in the retransmission period is greater than the packet loss rate threshold, based on the receivable data volume of the retransmission bandwidth in the transmission bandwidth, determine the received data volume threshold when the data packet loss rate is reached in the retransmission period .
  • Step 620 based on the data volume of each data packet, determine the data packet retransmission quantity threshold corresponding to the received data volume threshold, and obtain a sequence number set composed of the respective sequence numbers of the data packets to be retransmitted within the retransmission period.
  • Step 622 when the number of data packets to be retransmitted in the retransmission period is less than or equal to the threshold of the number of retransmission data packets in the retransmission period, request retransmission of the data packets to be retransmitted in the retransmission period.
  • Step 624 When the number of data packets to be retransmitted in the retransmission period is greater than the threshold of the number of retransmission data packets in the retransmission period, filter out the largest sequence number and the smallest sequence number from the sequence number set.
  • Step 626 determining a key sequence number set formed based on respective sequence numbers of the key data packets and matching with the sequence number set.
  • Step 628 Screen out key serial numbers that are greater than the smallest serial number and smaller than the largest serial number from the set of key serial numbers.
  • Step 630 in order from small to large, take the key sequence number as the current sequence number, delete the sequence numbers that are less than or equal to the current sequence number from the set of sequence numbers formed based on the respective sequence numbers of the data packets to be retransmitted, until The number of sequence numbers retained in the sequence number set is less than or equal to the threshold of the number of data packet retransmissions.
  • Step 632 request retransmission of the data packets to be retransmitted indicated by the sequence numbers retained in the sequence number set, and record the number of retransmission requests for each data packet to be retransmitted.
  • Step 634 when the number of retransmission requests for the data packet to be retransmitted is greater than the request number threshold, delete the sequence number of the data packet to be retransmitted from the sequence number set.
  • the present application also provides an application scenario, where the above-mentioned data retransmission processing method is applied.
  • the application of the data retransmission processing method in this application scenario is as follows:
  • the buffer size can only be fixed as much as possible If the setting is larger, when the network jitter is large, the packet loss rate is high, and when the jitter is small, the delay is large.
  • the data retransmission processing method proposed in this solution can be realized by a packet loss rate controller based on NACK retransmission code rate.
  • the specific application scenario can be a low-latency live broadcast application solution.
  • This solution briefly describes the transmission based on RTP/RTCP
  • the /WebRTC transmission protocol format is a benchmark description, and the actual solution application is not limited to whether the solution is based on the RTP/RTCP/WebRTC transmission protocol or a custom transmission protocol format.
  • the RTP protocol corresponding to RTP (Real-time Transport Protocol, Real-time Transport Protocol) specifies the standard data packet format for transmitting audio and video on the Internet. It was originally designed as a multicast protocol, but has since been used in many unicast applications.
  • the RTP protocol is often used in streaming media systems (with RTSP protocol), video conferencing and push to talk (Push to Talk) systems (with H.323 or SIP), making it the technical basis of the IP telephony industry.
  • the RTP protocol is used with the RTP control protocol RTCP, and it is built on the UDP protocol.
  • RTCP Real-time Transport Control Protocol or RTP Control Protocol or RTCP for short
  • RTP Real-time Transport Control Protocol
  • RTCP is defined by RFC 3550 (replacing obsolete RFC 1889).
  • RTP uses an even UDP port; while RTCP uses the next port of RTP, which is an odd port.
  • RTCP works in tandem with RTP, with RTP doing the actual data transfer and RTCP delivering the control packets to everyone on the phone. Its main function is to give feedback on the quality of service that RTP is providing.
  • WebRTC Web Real-Time Communication, whose name comes from web instant messaging
  • API Application Programming Interface
  • WebRTC provides the core technology of video conferencing, including audio and video collection, codec, network transmission, display and other functions, and also supports cross-platform: windows, linux, mac, android.
  • FEC forward error correction
  • NACK lost packet retransmission
  • FEC adds redundant error correction codes to the data packets at the sending end, and the error correction codes are sent to the receiving end together with the data packets; the receiving end checks and corrects the data according to the error correction codes.
  • NACK sends a NACK message to the sender after the receiver detects data packet loss; the sender finds the data packet to be resent in the send buffer according to the sequence number in the NACK message, and resends it to the receiver.
  • NACK needs the support of the sending buffer of the sending end, and RFC5104 defines the format of the NACK data packet.
  • This solution deeply analyzes the serial number characteristics (seq characteristics) of RTP data packets in RTC and low-latency live broadcast scenarios in network abnormal scenarios, combined with REMB (Receiver Estimated Maximum Bitrate, the maximum receiving evaluation bandwidth at the receiving end), Loss Rate (packet loss rate) ), SRTT (smoothed round-trip time delay) and NACK packet loss retransmission list.
  • REMB Receiveiver Estimated Maximum Bitrate, the maximum receiving evaluation bandwidth at the receiving end
  • Loss Rate packet loss rate
  • SRTT smoothed round-trip time delay
  • NACK packet loss retransmission list When the network is abnormal, a NACK retransmission code rate packet loss rate controller is designed to optimize the fast recovery optimization solution when the low-latency live broadcast network is abnormal.
  • This solution has a good application in Tencent Cloud Video Cloud Express live broadcast, cloud games and other business products, and has a good application in Kuaishou, Douyin, YY, Douyu, Station B, Caiji and un
  • Live Event Broadcasting (LEB for short, ultra-low-latency live broadcast) is an extension of standard live broadcast in the ultra-low-latency playback scenario, which has lower delay than traditional live broadcast protocols, providing viewers with the ultimate live broadcast viewing experience in milliseconds. It can meet the needs of some specific scenarios that require higher latency performance, such as online education, live sports events, and online question answering.
  • the transmission layer basically uses UDP.
  • Solve network anomalies network BDP, that is, the product of bandwidth and delay
  • jitter network connection recovery
  • network switching such as 4G/5G switching WIFI, WIFI switching 4G/5G, etc.
  • FEC forward error correction
  • NACK packet loss retransmission
  • jitterbuffer audio and video jitter buffer
  • jitterbuffer is a RTP data storage
  • the packet cache can sort the RTP packets. When the RTP packets in the jitterbuffer are discontinuous, NACK will be used to request the sender to resend.
  • the message container format management module performs transmission format analysis, audio and video container format analysis and legality detection.
  • the sequence numbers for lost RTP packets are stored in the set NACK List.
  • the sequence number of the data packet is obtained from the header in the message, and its sequence number is marked as seq1, while the sequence number of the last arrived data packet is seq2.
  • the seq number of the RTP header is only 2 bytes, the maximum value is 65535, and wrapping will occur. In this solution, it is assumed that the seq wrapping has been processed, and all seq numbers are considered to be continuously increasing.
  • seq1>seq2 it means that seq1 arrives in order, and the data packets in the (seq2, seq1) interval are marked as lost, and stored in the NACK List set.
  • the key frame is judged by the RTP FU header and the video frame packet corresponding to the video nalu typeseq1. If the received video frame packet corresponding to seq1 is a key frame, the current seq1 number is stored in the NACK KeyFrame List.
  • the lost state here is temporary. If seq3 ⁇ seq1 is present when the next data packet arrives, it means that the data packet arrives out of order, and the sequence number of seq3 in the NACK List will be deleted.
  • the REMB and packet loss rate (Loss rate, lr for short) within a NACK policy retransmission period are combined for comprehensive consideration:
  • the JitterBuffer if the JitterBuffer is continuous, it will merge the packet frames and render at intervals in real time. If there is a discontinuity in the middle of the RTP packet seq, it will wait for a certain period of time for the sender to retransmit and recover the lost seq packets.
  • Normal network packet loss The size of the seq hole is seq1-seq2, which is within a certain range. For some abnormal network scenarios, such as the user walks from the normal network to the elevator and then comes out of the elevator, the network is restored. Basically, the network is abnormal during the time of the elevator. The packets sent by the end are basically discarded, and the latest seq1 is restored after exiting the elevator.
  • the retransmission period can be dynamically set to the latest SRTT based on the retransmission period to regularly detect the NACK List. After more than one SRTT, check the NACK List and initiate a retransmission request for the seq packet lost in the NACK List, and mark and record the retransmission times of the seq request retries+1, when retries>MaxRetries, delete the seq from the NACK List.
  • the NACK retransmission code rate packet loss rate controller using the above data retransmission processing method has an 80%+ reduction in the average comprehensive first frame delay compared to before optimization, as shown in Figure 8, the abscissa is the number of test times, and the ordinate For low-latency live broadcasting, the delay of the first frame under a weak network solves the problem of intermittent network storms caused by receiving many NACK retransmission requests at the same time when the network jitter and packet loss are severe.
  • a data retransmission processing device 900 is provided.
  • the device may use a software module or a hardware module, or a combination of the two to become part of a computer device.
  • the device specifically includes: Threshold determination module 902, key serial number determination module 904, serial number deletion module 906 and request retransmission module 908, wherein:
  • the threshold determination module 902 is configured to determine the threshold of the number of retransmission data packets in the retransmission period based on the data packet loss rate in the retransmission period, and obtain a sequence composed of the respective sequence numbers of the data packets to be retransmitted in the retransmission period number collection.
  • a key sequence number determining module 904 configured to determine the respective key sequence numbers of each key data package matching the set of sequence numbers.
  • the serial number deletion module 906 is used to filter out the target serial number from the key serial number, and delete the serial number less than or equal to the target serial number from the serial number set, so as to maximize the number of serial numbers retained in the serial number set, and retain The number of sequence numbers is less than or equal to the packet retransmission threshold.
  • the request retransmission module 908 is configured to request retransmission of the data packets to be retransmitted indicated by the sequence numbers retained in the sequence number set.
  • the threshold determination module includes a received data volume threshold determination module and a data packet retransmission quantity threshold module, wherein:
  • the received data volume threshold determination module is used to determine the corresponding received data volume threshold when the data packet loss rate is reached within the retransmission period based on the receivable data volume of the retransmission bandwidth in the transmission bandwidth;
  • the data packet retransmission quantity threshold module is configured to determine the data packet retransmission quantity threshold corresponding to the received data volume threshold based on the data volume of each data packet.
  • the key serial number determination module includes a serial number screening module, a key serial number set determination module, and a key serial number screening module, wherein:
  • a serial number screening module configured to filter out the largest serial number and the smallest serial number from the serial number set, and obtain a key serial number set based on the respective serial numbers of the key data packets and matched with the serial number set;
  • the key serial number screening module is used to filter out the key serial numbers greater than the minimum serial number and smaller than the maximum serial number from the key serial number set.
  • the data retransmission processing device further includes a key sequence number set management module, configured to: extract the data packet category identifier carried in the header corresponding to the received data packet; the data packet category identifier indicates that the data packet is key data When packet, the sequence number carried in the header is added to the set of key sequence numbers.
  • a key sequence number set management module configured to: extract the data packet category identifier carried in the header corresponding to the received data packet; the data packet category identifier indicates that the data packet is key data When packet, the sequence number carried in the header is added to the set of key sequence numbers.
  • the serial number deletion module is further configured to use the key serial number as the current serial number in ascending order, and delete the key serial number from the serial number set based on the respective serial numbers of the data packets to be retransmitted. Sequence numbers that are less than or equal to the current sequence number until the number of sequence numbers remaining in the sequence number set is less than or equal to the threshold of the number of data packet retransmissions.
  • the data retransmission processing device further includes an intermediate serial number adding module and a current serial number deleting module, wherein:
  • the intermediate serial number adding module is used to add the intermediate serial number when the current serial number of the currently received data packet is greater than the historical serial number of the last received data packet, and there is an intermediate serial number between the current serial number and the historical serial number. Add to serial number collection;
  • the current sequence number deletion module is configured to delete the current sequence number from the sequence number set when the current sequence number of the currently received data packet is smaller than the historical sequence number of the last received data packet.
  • the data retransmission processing device further includes a sequence number difference calculation module, a first sequence number difference comparison module, and a second sequence number difference comparison module, wherein:
  • the sequence number difference calculation module is used to calculate the current sequence when the current sequence number of the currently received data packet is greater than the historical sequence number of the last received data packet, and there is an intermediate sequence number between the current sequence number and the historical sequence number serial number difference between serial number and historical serial number;
  • the first sequence number difference comparison module is used to clear the sequence number in the sequence number set when the sequence number difference is greater than the difference threshold, and based on the current sequence number, request to transmit the key data packet matching the current sequence number;
  • the second serial number difference comparison module is configured to add the intermediate serial number to the serial number set when the serial number difference is less than or equal to the difference threshold.
  • the key data packet is a key frame data packet in the audio and video data transmitted in the live broadcast scene
  • the data retransmission processing device further includes a rendering module, which is used to make the current sequence number of the currently received data packet greater than that of the last time
  • the historical serial number of the received data packet and when the current serial number and the historical serial number are consecutive serial numbers, obtain the data packet category identifier of the data packet referred to by the current serial number; if the data packet category identifier represents a key frame data packet, then Screen rendering is performed based on the key frame data packet referred to by the current serial number; if the data packet category identifier indicates a difference frame or a two-way difference frame, the difference frame or two-way difference frame is superimposed on the key frame data packet, and the superimposed data is processed Screen rendering.
  • the data retransmission processing device further includes a retransmission period determination module, which is used to smooth the historical delay data corresponding to the historical transmission data to obtain reference delay data; based on the reference delay data, determine the retransmission Period, the period corresponding to the retransmission period is greater than or equal to the period corresponding to the reference delay data.
  • a retransmission period determination module which is used to smooth the historical delay data corresponding to the historical transmission data to obtain reference delay data; based on the reference delay data, determine the retransmission Period, the period corresponding to the retransmission period is greater than or equal to the period corresponding to the reference delay data.
  • the serial number deletion module is also used to record the number of times of request retransmission for each data packet to be retransmitted; The sequence number of the packet to be retransmitted is deleted from the set.
  • the threshold determination module is further configured to determine the retransmission period of the data packet based on the data packet loss rate in the retransmission period when the data packet loss rate in the retransmission period is greater than the packet loss rate threshold.
  • the number of transmission thresholds; the request retransmission module is also used to request retransmission of the data packets to be retransmitted within the retransmission period when the data packet loss rate in the retransmission period is less than or equal to the packet loss rate threshold.
  • the key sequence number determination module is further configured to determine the key sequence number matching the sequence number set when the number of data packets to be retransmitted in the retransmission period is greater than the threshold of the number of retransmissions of data packets in the retransmission period.
  • the respective key sequence numbers of key data packets; the request retransmission module is also used to request retransmission when the number of data packets to be retransmitted in the retransmission period is less than or equal to the threshold of the number of retransmissions in the retransmission period. Data packets to be retransmitted within the transmission cycle.
  • Each module in the above-mentioned data retransmission processing device may be fully or partially realized by software, hardware or a combination thereof.
  • the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.
  • a computer device is provided.
  • the computer device may be a terminal, and its internal structure may be as shown in FIG. 10 .
  • the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus.
  • the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer equipment includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system and computer readable instructions.
  • the internal memory provides an environment for the execution of the operating system and computer readable instructions in the non-volatile storage medium.
  • the communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, an operator network, NFC (Near Field Communication) or other technologies.
  • a data retransmission processing method is implemented.
  • the display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen
  • the input device of the computer device may be a touch layer covered on the display screen, or a button, a trackball or a touch pad provided on the casing of the computer device , and can also be an external keyboard, touchpad, or mouse.
  • FIG. 10 is only a block diagram of a part of the structure related to the solution of this application, and does not constitute a limitation to the computer equipment on which the solution of this application is applied.
  • the specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.
  • a computer device including a memory and a processor, where computer-readable instructions are stored in the memory, and the processor implements the steps in the foregoing method embodiments when executing the computer-readable instructions.
  • a computer-readable storage medium which stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps in the foregoing method embodiments are implemented.
  • a computer program product or computer program comprising computer readable instructions stored on a computer readable storage medium.
  • the processor of the computer device reads the computer-readable instructions from the computer-readable storage medium, and the processor executes the computer-readable instructions, so that the computer device executes the steps in the foregoing method embodiments.
  • Non-volatile memory may include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory or optical memory, etc.
  • Volatile memory can include Random Access Memory (RAM) or external cache memory.
  • RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)
  • Communication Control (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请提供了一种数据重传处理方法、装置、计算机设备和存储介质。方法包括:基于重传周期内的数据丢包率,确定重传周期内的数据包重传数量阈值,并获取重传周期内待重传数据包各自的序列号所构成的序列号集合(202);确定与序列号集合相匹配的各关键数据包各自的关键序列号(204);从关键序列号筛选出目标序列号,从序列号集合中删除小于或等于目标序列号的序列号,使得序列号集合中留存的序列号的数量最大化,且留存的序列号的数量小于或等于数据包重传数量阈值(206);请求重传序列号集合中留存的序列号所指代的待重传数据包(208)。

Description

数据重传处理方法、装置、计算机设备和存储介质
相关申请的交叉引用
本申请要求于2021年05月25日提交中国专利局,申请号为2021105691773,申请名称为“数据重传处理方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及网络通信技术领域,特别是涉及一种数据重传处理方法、装置、计算机设备、计算机可读存储介质及计算机程序产品。
背景技术
随着通信技术的发展,在生活中网络通信的应用越来越广泛,对于通信质量的要求也越来越高。由于考虑到数据传输的时效性和资源利用,在通讯过程中,使用UDP(User Datagram Protocol,用户数据报协议)报文进行数据传输。
由于数据在网络中传输,可能会产生丢包的情况,因此接收端需要根据丢包情况向发送端发起重传请求,若发送端同一时刻收到的重传请求过多,很容易造成网络抖动或延迟,影响数据传输效果。
发明内容
本申请的各种实施例,提供了一种能够提高数据传输效果的数据重传处理方法、装置、计算机设备、计算机可读存储介质及计算机程序产品。
一种数据重传处理方法,由计算机设备执行,所述方法包括:
基于重传周期内的数据丢包率,确定所述重传周期内的数据包重传数量阈值,并获取所述重传周期内待重传数据包各自的序列号所构成的序列号集合;
确定与所述序列号集合相匹配的各关键数据包各自的关键序列号;
从所述关键序列号筛选出目标序列号,从所述序列号集合中删除小于或等于所述目标序列号的序列号,使得所述序列号集合中留存的序列号的数量最大化,且留存的序列号的数量小于或等于所述数据包重传数量阈值;及
请求重传所述序列号集合中留存的序列号所对应的待重传数据包。
一种数据重传处理装置,所述装置包括:
阈值确定模块,用于基于重传周期内的数据丢包率,确定所述重传周期内的数据包重传数量阈值,并获取所述重传周期内待重传数据包各自的序列号所构成的序列号集合;
关键序列号确定模块,用于确定与所述序列号集合相匹配的各关键数据包各自的关键序列号;
序列号删除模块,用于从所述关键序列号筛选出目标序列号,从所述序列号集合中删除小于或等于所述目标序列号的序列号,使得所述序列号集合中留存的序列号的数量最大化,且留存的序列号的数量小于或等于所述数据包重传数量阈值;及
请求重传模块,用于请求重传所述序列号集合中留存的序列号所对应的待重传数据包。
一种计算机设备,包括存储器和一个或多个处理器,所述存储器存储有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行所述计算机可读指令时实现以下步骤:
基于重传周期内的数据丢包率,确定所述重传周期内的数据包重传数量阈值,并获取所述重传周期内待重传数据包各自的序列号所构成的序列号集合;
确定与所述序列号集合相匹配的各关键数据包各自的关键序列号;
从所述关键序列号筛选出目标序列号,从所述序列号集合中删除小于或等于所述目标序列号的序列号,使得所述序列号集合中留存的序列号的数量最大化,且留存的序列号的数量小于或等于所述数据包重传数量阈值;及
请求重传所述序列号集合中留存的序列号所对应的待重传数据包。
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行时实现以下步骤:
基于重传周期内的数据丢包率,确定所述重传周期内的数据包重传数量阈值,并获取所述重传周期内待重传数据包各自的序列号所构成的序列号集合;
确定与所述序列号集合相匹配的各关键数据包各自的关键序列号;
从所述关键序列号筛选出目标序列号,从所述序列号集合中删除小于或等于所述目标序列号的序列号,使得所述序列号集合中留存的序列号的数量最大化,且留存的序列号的数量小于或等于所述数据包重传数量阈值;及
请求重传所述序列号集合中留存的序列号所对应的待重传数据包。
一种计算机程序产品或计算机程序,所述计算机程序产品或计算机程序包括计算机可读指令,所述计算机可读指令存储在计算机可读存储介质中,计算机设备的处理器从所述计算机可读存储介质读取所述计算机可读指令,所述处理器执行所述计算机可读指令,使得所述计算机设备执行时实现以下步骤:
基于重传周期内的数据丢包率,确定所述重传周期内的数据包重传数量阈值,并获取所述重传周期内待重传数据包各自的序列号所构成的序列号集合;
确定与所述序列号集合相匹配的各关键数据包各自的关键序列号;
从所述关键序列号筛选出目标序列号,从所述序列号集合中删除小于或等于所述目标序列号的序列号,使得所述序列号集合中留存的序列号的数量最大化,且留存的序列号的数量小于或等于所述数据包重传数量阈值;及
请求重传所述序列号集合中留存的序列号所对应的待重传数据包
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。小于或等于小于或等于附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为一个实施例中数据重传处理方法的应用环境图;
图2为一个实施例中数据重传处理方法的流程示意图;
图3为一个实施例中数据传输过程中存在丢包现象的示意图;
图4为一个实施例中数据重传处理接收端与发送端的交互示意图;
图5为一个实施例中数据重传处理中重传队列与关键序列号队列的示意图;
图6为另一个实施例中数据重传处理方法的流程示意图;
图7为一个实施例中数据重传处理方法的处理流程示意图;
图8为一个实施例中数据重传处理方法优化前后首帧延时对比示意图;
图9为一个实施例中数据重传处理装置的结构框图;
图10为一个实施例中计算机设备的内部结构图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供的数据重传处理方法能够基于云技术(Cloud technology)来实现。
本申请提供的数据重传处理方法,可以应用于如图1所示的应用环境中。其中,发送端102通过网络与接收端104进行通信。发送端102将数据发送至接收端104,接收端104基于重传周期内的数据丢包率,确定重传周期内的数据包重传数量阈值,并获取重传周期内待重传数据包各自的序列号所构成的序列号集合;确定与序列号集合相匹配的各关键数据包各自的关键序列号,接收端104从关键序列号筛选出目标序列号,从序列号集合中删除小于或等于目标序列号的序列号,使得序列号集合中留存的序列号的数量最大化,且留存的序列号的数量小于或等于数据包重传数量阈值,接收端104向发送端102请求重传序列号集合中留存的序列号所对应的待重传数据包。
其中,接收端104可以但不限于是各种台式计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备,发送端102可以是服务器,服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN、以及大数据和人工智能平台等基础云计算服务的云服务器。终端可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能手表等,但并不局限于此。终端以及服务器可以通过有线或无线通信方式进行直接或间接地连接,本申请在此不做限制。
在一个实施例中,如图2所示,提供了一种数据重传处理方法,以该方法应用于图1 中的接收端为例进行说明,包括以下步骤:
步骤202,基于重传周期内的数据丢包率,确定重传周期内的数据包重传数量阈值,并获取重传周期内待重传数据包各自的序列号所构成的序列号集合。
其中,重传周期是指按照时间划分的多个时间段所表示的时长,接收端检测每个时间段内接收到的数据是否存在丢包情况,并在丢包情况达到重传条件时,向发送端发送重传请求。发送端和接收端是数据的传输对象,可以理解,发送端和接收端是一组相对概念,在不同的应用场景中,发送端也可以作为接收端用于接收数据,接收端也可以用作发送端用于发送数据,计算机设备具体为发送端还是接收端,可以根据数据的传输方向来进行确定。
丢包是指一个或多个(指两个或两个以上)数据包的数据无法通过网络传输从发送端到达接收端的现象,如图3所示,发送端发送了序列号为1~n的n个数据包,然而,接收端接收的数据包中未检测到序列号为2的数据包。序列号为2的数据包存在丢包现象。然而,在流媒体技术、VoIP(Voice over Internet Protocol,基于IP的语音传输)、在线游戏和视频会议等场景下,丢包可能造成网络的抖动。要特别注意的是,丢包不一定表示数据交互存在问题,在某种程度上出现丢包是有可能被传输双方所接受的,重传条件即为丢包情况无法被传输双方所接受时达到的条件。具体地,重传条件可以是重传的数据包的数量达到数量阈值、一定周期内的丢包率达到丢包率阈值等条件中的一种条件或是多种条件的组合。
丢包率(Loss Tolerance或Packet Loss Rate)是指所丢失数据包数量占所发送数据组的比率。数据包在具体来说,数据丢包率可以是一段时间内实际接收到的数据包的数量与应当接收到的数据包的数量的比值。丢包率与数据包长度以及包发送频率相关。通常,千兆网卡在流量大于200Mbps时,丢包率小于万分之五;百兆网卡在流量大于60Mbps时,丢包率小于万分之一。在一个具体应用中,丢包率可以通过计算发送端的输出报文数量与接收端的输入报文数量之间的差值占输入报文数量的比重得到,即[(输入报文-输出报文)/输入报文]*100%”。
数据包重传数量阈值是指在重传周期内请求重传的数据包的数量阈值。具体地,接收端基于重传周期内的数据丢包率和接收端的传输带宽,计算出重传周期内的数据包重传数量阈值。传输带宽是用来标识单位时间内通过链路的数据量。由于重传周期内的数据丢包率是实时变化的,基于重传周期内的数据丢包率来确定数据包重传数量阈值,能够动态地对重传周期内的数据包重传数量阈值进行调整,相较于设定固定的数据包重传数量阈值的方式,通过动态调整能够有效避免网络抖动和丢包很厉害的情况下造成接收端同一时刻需要处理过多的重传请求导致的时间歇性网络风暴的情况的出现。
待重传数据包是指检测到存在丢包现象时,需要请求发送端重新发送的数据包。其中,接收端接收的数据报文中携带有数据包,且报文的报头中携带有与数据包的序列号。序列号用于标识发送段对应多个数据包的发送顺序。接收端可以基于已经接收到的数据包的序 列号,推测出丢包的数据包的序列号,以便基于该序列号请求发送端重新发送数据包。
序列号集合是由待重传数据包各自的序列号构成的集合。需要说明的是,序列号集合是实时更新的,当有新的待重传数据包时,可将待重传数据包的序列号添加至序列号集合中,当接收到待重传数据包时,将待重传数据包的序列号从序列号集合中删除。在一个具体的应用中,序列号集合可以是按照序列号大小进行排序后构成的重传队列。
步骤204,确定与序列号集合相匹配的各关键数据包的关键序列号。
其中,关键数据包是接收端接收到的数据包中具有特定意义的数据包,具体地,关键数据包是在数据渲染过程中用于与其他数据包结合得到展示数据的数据包。例如,视频数据包中的关键帧对应的数据包。接收端在接收到一项传输任务对应的数据包时,可以根据数据包的数据包类别标识,判定该数据包是否为关键数据包。关键序列号是指关键数据包的序列号。
序列号集合包括某项传输任务中已接收数据的丢包数据的序列号,因此,序列号集合与已接收数据所属的传输任务对应,不同的传输任务对应不同的序列号集合。与序列号集合相匹配的各关键数据包是与待重传数据包所属的传输任务相同的关键数据包。进一步地,基于序列号集合,还可以对传输任务中已接收的关键数据包进行筛选处理,得到序列号处于序列号集合所表征的序列号区间范围内的关键数据包,确定筛选出的关键数据包的关键序列号。
在一个具体的应用中,接收端可以先确定与待重传数据包匹配的已接收数据包,然后基于待重传数据包各自的序列号所构成的序列号集合的序列号范围,通过数据包类别识别,从匹配的已接收数据包中确定出序列号处于该序列号范围的关键数据包,并将关键数据包的序列号作为关键序列号。
步骤206,从关键序列号筛选出目标序列号,从序列号集合中删除小于或等于目标序列号的序列号,使得序列号集合中留存的序列号的数量最大化,且留存的序列号的数量小于或等于数据包重传数量阈值。
其中,目标序列号是对关键序列号进行筛选,得到的符合筛选条件的关键序列号。目标序列号的数量为1个,筛选条件可以是从序列号集合中删除小于或等于目标序列号的序列号后,序列号集合中留存的序列号的数量最大化,且留存的序列号的数量小于或等于数据包重传数量阈值。小于或等于目标序列号的序列号包括小于目标序列号的序列号以及等于目标序列号的序列号。数量最大化是指在约束所允许的范围内做出的一个使得序列号集合中留存的序列号的数量最多的选择。
具体地,接收端可以通过将每一个关键序列号分别作为候选序列号,并分别从序列号集合中删除小于或等于候选序列号的序列号,分别记录序列号集合中留存的序列号的数量,从候选序列号中筛选出留存序列号的数量小于和等于数据包重传数量阈值的达标序列号,然后从各达标序列号中筛选出留存序列号的数量最多的目标序列号。
具体地,还可以将关键序列号按照序列号大小排序,从序列号最小的关键序列号开始, 依次将各个关键序列号作为目标序列号,从序列号集合中删除小于或等于目标序列号的序列号,直至序列号集合中留存的序列号的数量小于或等于数据包重传数量阈值的达标序列号。
通过从基于待重传数据包各自序列号构成的序列号集合中,删除小于和等于目标序列号的序列号,能够精确地对以每一个关键序列号为目标序列号的情况,进行序列号删除处理,提高数据处理的精确度。
步骤208,请求重传序列号集合中留存的序列号所指代的待重传数据包。
其中,请求重传是指接收端向发送端发送重传请求,以使发送端重新发送请求的数据包。在接收端丢失的数据包中,由于暂未接收到丢失的数据包,因此无法获取到数据包的具体内容,但由于发送端发送的数据包的序列号是连续的,因此,接收端可以基于已成功接收的序列号确定丢失的数据包的序列号,因此,可以接收端可以基于序列号请求发送端重传丢失的数据包。如图4所示,在一个具体的应用中,接收端的NACK(Negative Acknowledgement,则是一种负向反馈,接收方只有在没有收到数据的时候才通知发送方)则在接收端检测到数据丢包后,发送NACK报文到发送端,发送端根据NACK报文中的序列号,在发送缓冲区找到需要重发的数据包,重新发送到接收端。
具体地,接收端基于序列号集合中留存的序列号,生成与留存的序列号一一对应的重传请求并发送至发送端,请求重传序列号集合中留存的序列号所指代的待重传数据包。
上述数据重传处理方法,基于数据丢包率来确定数据包重传数量阈值,使得数据包重传数量阈值的可基于重传周期的数据丢包率动态调整,基于重传周期内待重传数据包以及待重传数据包匹配的各关键数据包,从关键序列号筛选出目标序列号,从基于待重传数据包各自的序列号构成的序列号集合中,删除小于或等于目标序列号的序列号,使得序列号集合中留存的序列号的数量最大化,且留存的序列号的数量小于或等于数据包重传数量阈值,在减少了待重传数据包的前提下,请求重传的待重传数据包的最大化,通过基于重传周期进行重传请求处理,能够使得删除的序列号在前一重传周期进行待重传数据包重传请求,既避免了遗漏待重传数据包的重传请求,又能够有效控制每一个重传周期内的请求重传的待重传数据包的数量,避免了造成网络抖动或延迟,提高了数据传输效果。
进一步地,传输带宽可以全部或部分用于进行重传数据包的传输,为了不影响其他数据包的正常传输,可以从传输带宽中选取部分带宽作为重传带宽。在一个具体的应用中,接收端基于重传周期内的数据丢包率和接收端的传输带宽中的重传带宽,计算出重传周期内的数据包重传数量阈值。
在一个实施例中,基于重传周期内的数据丢包率,确定重传周期内的数据包重传数量阈值,包括:基于传输带宽中重传带宽的可接收数据量,确定在重传周期内达到数据丢包率时的接收数据量阈值;基于每个数据包的数据量,确定接收数据量阈值对应的数据包重传数量阈值。
其中,可接收数据量即单位时间内能够在线路上传送的最大数据量,常用的单位是 bps。接收端的传输带宽是固定值,传输带宽中的重传带宽可以通过设定的权重参数来确定,例如,重传带宽占传输带宽的权重参数为20%。其中,权重参数可以基于历史的重传数据占全部传输数据(包括正常传输数据和重传数据)的比值拟合得到。达到数据丢包率时的接收数据量阈值是指在考虑存在数据丢包情况下,能正常接收到的数据量,例如,当接收端的传输带宽的可接收数据量为2Mbps,权值参数为0.2时,传输带宽中的重传带宽的可接收数据量为0.4Mbps,若重传周期内的数据丢包率为20%,则在单位时间内达到数据丢包率时的接收数据量阈值为0.4Mbps*(1-20%)=0.32Mbps,即40000byte/s,再基于每个数据包的数据量,例如单个数据包按1500个byte来计算,则单位时间内接收数据量阈值对应的数据包重传数量阈值为26个/s,结合重传周期所表示的时长,得到重传周期内接收数据量阈值对应的数据包重传数量阈值。
进一步地,由于重传数据只占传输数据中的一部分,则重传数据的重传成功率也可以通过基于历史数据得到的丢包率权重参数进行调整更新,例如重传周期内的数据丢包率为40%,基于历史数据得到的丢包率权重参数为0.9,则重传数据的数据传输成功率为1-0.9*(1-40%)=72%。通过设定丢包率权重参数,能够得到更为精准的重传数据的数据传输成功率计算结果,从而得到准确的数据包重传数量阈值。
具体地,接收端基于与传输带宽对应的传输码率,以及重传带宽占传输带宽的比例,得到重传带宽所对应的重传码率,基于在重传周期内与数据丢包率对应的重传数据的重传成功率,确定在重传周期内的优化重传码率;基于每个数据包的数据量,确定优化重传码率对应的数据包重传数量阈值。
在本实施例中,基于重传带宽和数据丢包率,能够得到准确可靠的数据包重传数量阈值,相较于设定固定的数据包重传数量阈值的方式,通过动态调整能够有效避免网络抖动和丢包很厉害的情况下造成接收端同一时刻需要处理过多的重传请求导致的时间歇性网络风暴的情况的出现。
在一个实施例中,确定与序列号集合相匹配的各关键数据包各自的关键序列号,包括:
从所述序列号集合中筛选出最大序列号和最小序列号,并获取基于关键数据包各自的序列号构成、且与所述序列号集合匹配的关键序列号集合;从关键序列号集合中筛选出大于最小序列号且小于最大序列号的关键序列号。
其中,最大序列号和最小序列号可以通过将待重传数据包各自的序列号进行排序得到。在一个具体的应用中,序列号集合可以是按照序列号大小进行排序的重传队列,重传队列的首尾即为最大序列号和最小序列号,例如,当按照序列号从大到小的顺序进行排列时,重传队列的第一个序列号为最大序列号,最后一个序列号为最小序列号;当按照序列号从小到大的顺序进行排列时,重传队列的第一个序列号为最小序列号,最后一个序列号为最大序列号。关键序列号集合中包括关键数据包各自的序列号,为便于区分关键数据包和待重发数据包的序列号,将关键数据包的序列号定义为关键序列号。需要说明的是,关键数据包是接收端已经接收到的数据包中的一部分,而待重发数据包是接收端未接收到的 数据包。待重发数据包是基于已接收数据包确定的,已接收数据包与传输任务对应,同样,基于已接收数据包中的关键数据包构成的关键序列号集合也与传输任务对应,基于该传输任务,可以确定与序列号集合匹配的关键序列号集合。
在一个具体应用中,通过遍历关键序列号集合,将关键序列号集合中的每一个关键序列号分别与最大序列号以及最小序列号进行比较,若关键序列号大于最小序列号且小于最大序列号,则确定该关键序列号是与序列号集合匹配的关键序列号,若关键序列号小于最小序列号或大于最大序列号,则跳过该关键序列号对下一个关键序列号进行比较,直至关键序列号集合遍历结束,从而筛选出匹配的关键序列号。通过遍历关键序列号集合,能够确保筛选出的匹配的关键序列号的准确性。
在另一个具体应用中,序列号集合可以是按照待重传数据包的序列号大小进行排序的重传队列,关键序列号集合可以是按照关键序列号大小进行排序的关键序列号队列。如图5所示,已接收数据包的序列号包括1、3、5、7、10、15、……、n;重传队列中的序列号包括2、4、6、8、9、11、……、m;关键序列号队列中的序列号包括5、10、15、19、……、k。重传队列和关键序列号队列携带有与传输数据对应的任务标识,基于任务标识,可以确定匹配的重传队列和关键序列号队列。基于重传队列中的最小序列号,确定关键序列号队列中大于该最小序列号且与该最小序列号之间的差值最小的标志关键序列号,从关键序列号队列中筛选出大于或等于该标志关键序列号的关键序列号。通过按照关键序列号大小进行排序的方式,能够在确保筛选出的匹配的关键序列号的准确性的同时,实现匹配的关键序列号的快速筛选。
在本实施例中,通过基于序列号集合中的最大序列号和最小序列号,能够进一步地对关键数据包进行筛选,使得关键数据包数量最小化,便于减小后续从关键数据包的关键序列号中筛选出目标序列号的数据处理量,提高数据处理效率。
在一个实施例中,数据重传处理方还包括:提取接收的数据包所对应报头中携带的数据包类别标识;在数据包类别标识表示数据包为关键数据包时,将报头中携带的序列号添加至关键序列号集合。
其中,报头是指报文中用于记录数据传输消息的数据,报文是网络中交换与传输的数据单元,即站点一次性要发送的数据块。报文包含了将要发送的完整的数据信息,具体包括需要传输的数据包以及对应的数据传输消息,其中,数据传输消息包括数据包的数据包类别标识以及数据包对应的序列号。
具体地,接收端在接收到报文时,从报头提取出数据包类别标识,若数据包类别标识表示关键数据包,则从报头提取出序列号,并将序列号添加至该报文所属的传输任务对应的关键序列号集合。
在一个具体应用中,以接收的数据包为视频帧包为例,数据包类别标识包括I帧、P帧和B帧。I帧表示关键帧,包含完整画面,可以理解为这一帧画面的完整保留,解码时只需要本帧数据就可以完成;P帧表示的是本帧跟之前的一个关键帧(或P帧)的差别, 解码时需要用之前缓存的画面叠加上本帧定义的差别,生成最终画面。P帧也可以理解为差别帧,没有完整画面数据,只有与前一帧的画面差别的数据。B帧是双向差别帧,记录的是本帧与前后帧的差别,要解码B帧,不仅要取得之前的缓存画面,还要解码之后的画面,通过前后画面的与本帧数据的叠加取得最终的画面。当接收端接收到报文通过对报文中的报头进行解析,确定该报文所包含的视频帧包为关键帧时,将该报文中的序列号添加至该报文所属的传输任务的关键帧序列。
在本实施例中,通过从报文中提取数据包类别标识,能够准确地识别接收的数据包中的关键数据包,相较于对数据包渲染时的解析结果来确定该数据包是否为关键数据包的方式,能够有效提高数据处理效率。
在一个实施例中,从关键序列号筛选出目标序列号,从序列号集合中删除小于或等于目标序列号的序列号,使得序列号集合中留存的序列号的数量最大化,且留存的序列号的数量小于或等于数据包重传数量阈值,包括:
按照从小到大的顺序,依次将关键序列号作为目标序列号,从基于待重传数据包各自的序列号构成的序列号集合中,删除小于和等于目标序列号的序列号,直至序列号集合中留存的序列号的数量小于或等于数据包重传数量阈值。
如果接收端接收的数据包均为顺序达到,则序列号集合中不包括等于目标序列号的序列号,如果接收端接收的关键数据包乱序达到,则在该关键数据包达到之前,可能已经将该关键数据包作为待重传数据包,将该关键数据包的关键序列号添加至序列号集合,因此,序列号集合中可能存在有关键序列号,但由于接收端实际上已经接收到该关键序列号所指代的关键数据包,故可以直接从序列号集合删除等于该关键序列号的序列号,避免数据包的重复传输。通过从基于待重传数据包各自的序列号构成的序列号集合中,删除小于和等于目标序列号的序列号,能够精确地对以每一个关键序列号为目标序列号的情况,进行序列号删除处理,提高数据处理的精确度。
具体地,接收端基于按照从小到大的顺序的关键序列号构成的关键序列号队列,从关键序列号队列中大于序列号集合中最小序列号的关键序列号开始,依次选取一个关键序列号最为目标序列号,删除序列号集合中小于和等于目标序列号的序列号,确定序列号集合中留存的序列号的数量是否大于数据包重传数量阈值,若是,则将下一个关键序列号最为目标序列号,执行相同的处理,若否,则结束目标序列号的筛选流程。
在本实施例中,通过按照序列号大小进行排序的方式,能够在确保筛选出的目标序列号的准确性的同时,提高数据处理速度,实现目标序列号的快速筛选。
在一个实施例中,数据重传处理方还包括:在当前接收的数据包的当前序列号大于上一次接收的数据包的历史序列号,且当前序列号与历史序列号之间存在中间序列号时,将中间序列号添加至序列号集合;在当前接收的数据包的当前序列号小于上一次接收的数据包的历史序列号时,从序列号集合中删除当前序列号。
其中,当前接收的数据包是指最近一次接收到且还未开始对其进行相应处理的数据 包。上一次接收的数据包是指在当前接收的数据包之前一次接收的且已经完成相应的处理的数据包。
在数据传输正常的情况下,当前接收的数据包的当前序列号应当是大于上一次接收的数据包的历史序列号,且当前序列号与历史序列号为相邻的两个序列号,即当前序列号与历史序列号之间不存在中间序列号。在当前接收的数据包的当前序列号大于上一次接收的数据包的历史序列号,且当前序列号与历史序列号之间不存在中间序列号时,表示各个数据包顺序到达,不存在丢包现象。
若当前序列号大于历史序列号且两者之间存在中间序列号,则表示当前序列号与历史序列号之间存在丢包现象,中间序列号即为发生丢包现象的数据包,需要请求发送端重新发送该丢失的数据包。通过将中间序列号添加至序列号集合,便于基于序列号集合进一步判断是否为需要请求重传的待重传数据包。
若当前接收的数据包的当前序列号小于上一次接收的数据包的历史序列号,则表示当前接收的数据包是乱序得到接收端的,接收端已经接收到了在其之后发送的数据包,因此,当前接收的数据包的数据号已经添加到了序列号集合中,因此,需要从序列号集合中删除当前序列号,不需要请求发送端重新发送该数据包。
在本实施例中,通过在当前序列号大于历史序列号且两者之间存在中间序列号的情况下,向序列号集合中添加待重传数据包的序列号,并在当前序列号小于历史序列号的情况下,从序列号集合中删除乱序接收的数据包的序列号,确保序列号集合中的序列号的都是接收端未接收到的数据包的序列号,避免数据包的重复传输,从而提高数据重传的准确性。
在一个实施例中,在当前接收的数据包的当前序列号大于上一次接收的数据包对应的历史序列号,且当前序列号与历史序列号之间存在中间序列号时,将中间序列号添加至序列号集合包括:在当前接收的数据包的当前序列号大于上一次接收的数据包的历史序列号,且当前序列号与历史序列号之间存在中间序列号时,计算当前序列号与历史序列号之间的序列号差值;在序列号差值小于或等于差值阈值时,将中间序列号添加至序列号集合。
其中,序列号差值是指将序列号作差计算得到的结果。序列号差值用于表示当前序列号与历史序列号之间的中间序列号的数量。例如,序列号差值为20,则当前序列号与历史序列号之间的中间序列号为20-1=19个。
在本实施例中,通过限定当前序列号与历史序列号之间的序列号差值,使得只在序列号差值小于或等于差值阈值将中间序列号添加至序列号集合,可以进一步控制序列号集合中的序列号的数量,从而便于减少针对序列号集合进行序列号删除过程中所对应的数据处理量,提高数据处理效率。
在一个实施例中,数据重传处理方还包括:在当前接收的数据包的当前序列号大于上一次接收的数据包的历史序列号,且当前序列号与历史序列号为连续序列号时,基于当前序列号的数据包进行渲染。
其中,连续序列号是指序列号相邻的两个序列号,例如当前序列号为10,上一次接 收的数据包的历史序列号为9。基于数据包进行渲染,具体可以是通过判断数据包是否为关键数据包,若是,则直接通过数据包解析进行渲染,所否,则将该数据包与的关键数据包进行解析合并之后进行渲染。以视频帧数据包为例,可以通过包帧合并按照实时间隔进行视频帧渲染。
具体地,在关键数据包为直播场景下传输的音视频数据中的关键帧数据包的情况下,在当前接收的数据包的当前序列号大于上一次接收的数据包的历史序列号,且当前序列号与历史序列号为连续序列号时获取当前序列号所指代数据包的数据包类别标识,若所述数据包类别标识表示关键帧数据包,则基于当前序列号的关键帧数据包进行画面渲染,若数据包类别标识表示差别帧或双向差别帧,则将差别帧或双向差别帧与关键帧数据包进行数据叠加,对叠加数据进行画面渲染。
其中,直播场景具体可以用于低延时互动直播、直播观看、实时录制、屏幕分享、美颜特效、立体声等功能,适用于互动连麦、跨房PK、语音电台、K歌、小班课、大班课、语音聊天、视频聊天、在线会议等业务场景。音视频数据包括视频数据,或是视频数据与音频数据的组合结果。数据包类别标识包括I帧、P帧和B帧。I帧表示关键帧,包含完整画面,可以理解为这一帧画面的完整保留,解码时只需要本帧数据就可以完成;P帧表示的是本帧跟之前的一个关键帧(或P帧)的差别,解码时需要用之前缓存的画面叠加上本帧定义的差别,生成最终画面。P帧也可以理解为差别帧,没有完整画面数据,只有与前一帧的画面差别的数据。B帧是双向差别帧,记录的是本帧与前后帧的差别,要解码B帧,不仅要取得之前的缓存画面,还要解码之后的画面,通过前后画面的与本帧数据的叠加得到最终的画面数据进行渲染。
在本实施例中,通过按照连续序列号对数据包进行渲染,能够确保数据的低延时展示,提高接收端的响应速度。
进一步地,数据重传处理方还包括:当序列号差值大于差值阈值时,清空序列号集合中的序列号,并基于当前序列号,请求传送与当前序列号匹配的关键数据包。
其中,与当前序列号匹配的关键数据包是发送端基于当前序列号可以按序列号顺延查找到的第一个关键数据包。
具体地,接收端每一次接收到的数据包都能够通过报文解析,得到该数据包的序列号,通过序列号差值计算,即可获得当前接收的数据包的当前序列号与上一次接收的数据包的历史序列号之间的序列号差值,通过将序列号差值与差值阈值进行比较,当序列号差值大于差值阈值时,接收端清空序列号集合中的序列号。
与此同时,接收端基于当前序列号向发送端发送关键数据包请求,发送端可以提取关键数据包请求中的当前序列号,从当前序列号开始,从按序列号大小顺序缓存的缓存数据中查找序列号在当前序列号之后的第一个关键序列号,并将该关键序列号所指代的关键数据包发送至接收端。发送端也可以基于当前序列号,实时生成新的关键数据包并发送至接收端。
在一个具体的应用中,以视频包从发送端发送至接收端为例,接收端对于本次从接收的数据包,标记其序列号为seq1,而上次到达数据包的序列号标记为seq2,seq1>seq2,seq1-seq2为空洞大小,seq是连续增长的。正常网络丢包seq(序列号)空洞大小是在一定范围内的,对于一些异常网络场景如用户从正常网络走到电梯再从电椄出来网络恢复,在电梯这块时间基本上网络都是异常的,发送端发送的包基本都丢弃了,出电梯恢复以最新的seq1,相对上一次seq2会有比较大跳跃,对于(seq1-seq2)>max_void,可以认为从seq2到seq1这段时间网络已经异常,此时可以清除序列号集合NACK List,seq2-seq1之间的空洞也不用插入到NACK List,接收端直接发送PYI(Picture Loss Indication视频帧丢失关键帧重传)请求,以前的数据全部丢弃,直接让发送端从最新的关键帧(发送端可以根据请求实时生成关键帧)开始发送。具体地,差值阈值max_void的取值可以为根据需要进行设定,例如设为600、800、1000等,差值阈值可以换算为网络异常时长。以差值阈值为800为例,视频平均码率为2Mbps,1)NACK List里单个seq按1500个byte计算(城域网路由器MTU最大一般是1500),相当1秒钟大概有250KB/1500=170个数据包,因此差值阈值为800换算为网络异常时长为持续5秒。
在本实施例中,通过设定当前接收的数据包的当前序列号与上一次接收的数据包的历史序列号之间的序列号差值阈值,在当前序列号与历史序列号之间的序列号差值大于差值阈值时,清空序列号集合中的序列号,避免了在网络异常时,在序列号集合中添加大量的序列号,造成向发送端发送大量的数据包重传请求,很好解决了网络抖动和丢包很厉害的情况下,同一时刻处理大量的重传请求,进而导致的时间歇性网络风暴,确保了数据传输过程中的稳定性。
在一个实施例中,数据重传处理方还包括:对历史传输数据对应的历史时延数据进行平滑处理,得到参考时延数据;基于参考时延数据,确定重传周期,重传周期对应的时长大于或等于参考时延数据对应的时长。
其中,历史传输数据是指已经传输成功的数据,历史时延数据可以是历史传输的数据包分别对应的往返时延(Round-Trip Time,简称RTT)。往返时延是指数据从网络一端传到另一端所需的时间。通常,时延由发送时延、传播时延、排队时延、处理时延四个部分组成。对RTT进行平滑化处理可以得到SRTT(“平滑化”的RTT),SRTT即在保持计算简单的情况尽量考虑历史RTT。具体来说:SRTT=α*SRTT+(1-α)*RTT,其中α为权重系数,可以取0.6-0.7之间。计算中使用的SRTT是指上一次计算得到的结果。
基于参考时延数据对应的时长,得到时长大于或等于参考时延数据对应的时长的重传周期。由于参考时延数据为动态变化的,基于参考时延数据,动态更新重传周期。具体地,SRTT传输协议栈会实时计算SRTT,根据SRTT的实时计算结果动态调整重传周期,比如30秒调整一次大小。
在本实施例中,基于实时的数据传输时延数据,能够动态对重传周期进行更新,使得重传周期与实时的网络状态匹配,从而实现对每个重传周期的数据处理量进行调整,实现 均衡的数据处理。
在一个实施例中,数据重传处理方还包括:记录每一待重传数据包对应的请求重传次数;当待重传数据包对应的请求重传次数大于请求次数阈值时,从序列号集合中删除待重传数据包的序列号。
其中,请求次数阈值是针对同一个待重传数据包预先设定的最大请求次数。在每一个重传周期,发送端都会基于序列号集合中的每一个留存的序列号所指代的待重传数据包向发送端发起一次重传请求。具体来说,在每一个重传周期,针对序列号集合里留存的seq包发起重传请求,并标记记录该seq请求重传次数retries+1,当retries>MaxRetries后,会把该seq从序列号集合中删除,其中,请求次数阈值MaxRetries的取值,可以根据传输场景设置,比如应用场景希望最大RTC(Real-time communication,即时通讯)延时是MaxRTCDelay,那MaxRetries=MaxRTCDelay/SRTT+1,可以根据场景自行设定,MaxRetries越大,序列号集合中的序列号的数量就会越大,针对序列号集合需要进行删除的序列号的数量就会变多,导致数据处理量变大,如果不对序列号集合进行序列号数量控制,端到端延时就会增加。
在本实施例中,通过控制每一个待重传数据包的请求重传次数,能够有效避免对同一个待重传数据包发送过多的重传请求,实现对序列号集合中序列号的数量的有效控制,提高数据处理效率。
在一个实施例中,基于重传周期内的数据丢包率,确定重传周期内的数据包重传数量阈值,包括:
在重传周期内的数据丢包率大于丢包率阈值时,基于重传周期内的数据丢包率,确定重传周期内的数据包重传数量阈值。
其中,丢包率阈值是指允许的最大丢包率。丢包率阈值可以是预先设定的固定值,也可以根据实际应用场景进行调整,如实时调整或周期性调整等。在一个具体的应用中,丢包率阈值可以设为10%。当接收端检测到重传周期内的数据丢包率达到10%以上时,基于重传周期内的数据丢包率,确定重传周期内的数据包重传数量阈值,并获取重传周期内待重传数据包各自的序列号所构成的序列号集合,确定与序列号集合相匹配的各关键数据包各自的关键序列号,从关键序列号筛选出目标序列号,从序列号集合中删除小于或等于目标序列号的序列号,使得序列号集合中留存的序列号的数量最大化,且留存的序列号的数量小于或等于数据包重传数量阈值,请求重传序列号集合中留存的序列号所指代的待重传数据包。
在本实施例中,只有在重传周期内的数据丢包率大于丢包率阈值的情况下,请求进行数据包的重传,请求重传的数据包为序列号集合中留存的序列号所指代的待重传数据包,采用限定丢包率阈值判断是否触发重传请求的方式,限定了具体的触发场景,避免只要出现待重传数据包时就进行数据包的重传处理,实现了精确的场景限定,避免了数据处理资源的浪费。
进一步地,数据重传处理方还包括:在重传周期内的数据丢包率小于或等于丢包率阈值时,请求重传在重传周期内的待重传数据包。
在本实施例中,通过限定在重传周期内的数据丢包率小于或等于丢包率阈值的情况下,直接请求重传在重传周期内的待重传数据包,避免了复杂的处理过程,有利于在数据丢包率较小的情况下,提高数据处理效率。
在一个实施例中,确定与序列号集合相匹配的各关键数据包各自的关键序列号,包括:当重传周期内待重传数据包的数量大于重传周期内的数据包重传数量阈值时,确定与序列号集合相匹配的各关键数据包各自的关键序列号。
具体地,基于重传周期内的数据丢包率,确定重传周期内的数据包重传数量阈值,并获取重传周期内待重传数据包各自的序列号所构成的序列号集合,在重传周期内待重传数据包的数量大于重传周期内的数据包重传数量阈值时,确定与序列号集合相匹配的各关键数据包各自的关键序列号,从关键序列号筛选出目标序列号,从序列号集合中删除小于或等于目标序列号的序列号,使得序列号集合中留存的序列号的数量最大化,且留存的序列号的数量小于或等于数据包重传数量阈值,请求重传序列号集合中留存的序列号所指代的待重传数据包。
在本实施例中,只有在重传周期内待重传数据包的数量大于重传周期内的数据包重传数量阈值的情况下,请求进行数据包的重传,请求重传的数据包为序列号集合中留存的序列号所指代的待重传数据包,采用按照待重传数据包的数量判断是否触发重传请求的方式,限定了触发重传请求的具体触发条件场景,避免只要出现有待重传数据包时就进行数据包的重传处理,实现了精确的场景限定,避免了数据处理资源的浪费。
在一个实施例中,数据重传处理方还包括:在重传周期内待重传数据包的数量小于或等于重传周期内的数据包重传数量阈值时,请求重传在重传周期内的待重传数据包。
在本实施例中,通过限定在重传周期内待重传数据包的数量小于或等于重传周期内的数据包重传数量阈值的情况下,直接请求重传在重传周期内的待重传数据包,避免了复杂的处理过程,有利于在重传周期内待重传数据包的数量较少的情况下,提高数据处理效率。
在一个实施例中,在重传周期内的数据丢包率小于或等于丢包率阈值时,请求重传在重传周期内的待重传数据包。在重传周期内的数据丢包率大于丢包率阈值时,基于重传周期内的数据丢包率,确定重传周期内的数据包重传数量阈值,并获取重传周期内待重传数据包各自的序列号所构成的序列号集合,在重传周期内待重传数据包的数量小于或等于重传周期内的数据包重传数量阈值时,请求重传在重传周期内的待重传数据包。在重传周期内待重传数据包的数量大于重传周期内的数据包重传数量阈值时,确定与序列号集合相匹配的各关键数据包各自的关键序列号,从关键序列号筛选出目标序列号,从序列号集合中删除小于或等于目标序列号的序列号,使得序列号集合中留存的序列号的数量最大化,且留存的序列号的数量小于或等于数据包重传数量阈值,请求重传序列号集合中留存的序列号所指代的待重传数据包。
在本实施例中,通过限定在重传周期内的数据丢包率大于丢包率阈值、且重传周期内待重传数据包的数量大于重传周期内的数据包重传数量阈值的情况下,请求进行数据包的重传,请求重传的数据包,为序列号集合中留存的序列号所指代的待重传数据包,通过限定重传请求的具体触发条件为两个阈值条件同时满足,进一步提高了针对上述待重传数据包的重传请求触发门槛,避免频繁的触发重传请求而造成不必要的数据处理资源浪费。
在一个实施例中,如图6所示,提供了一种数据重传处理方法,包括以下步骤:
步骤602,对历史传输数据对应的历史时延数据进行平滑处理,得到参考时延数据,基于参考时延数据,确定重传周期,重传周期的时长大于或等于参考时延数据对应的时长。
步骤604,在当前接收的数据包的当前序列号大于上一次接收的数据包的历史序列号,且当前序列号与历史序列号为连续序列号时,基于当前序列号所指代的数据包进行渲染。
步骤606,在当前接收的数据包的当前序列号大于上一次接收的数据包的历史序列号,且当前序列号与历史序列号之间存在中间序列号时,计算当前序列号与历史序列号之间的序列号差值。
步骤608,当序列号差值大于差值阈值时,清空序列号集合中的序列号,并基于当前序列号,请求传送与当前序列号匹配的关键数据包。
步骤610,当序列号差值小于或等于差值阈值时,将中间序列号添加至序列号集合。
步骤612,在当前接收的数据包的当前序列号小于上一次接收的数据包的历史序列号时,从序列号集合中删除当前序列号。
步骤614,提取接收的数据包所对应报头中携带的数据包类别标识,在数据包类别标识表示数据包为关键数据包时,将报头中携带的序列号添加至关键序列号集合。
步骤616,在重传周期内的数据丢包率小于或等于丢包率阈值时,请求重传在重传周期内的待重传数据包。
步骤618,在重传周期内的数据丢包率大于丢包率阈值时,基于传输带宽中重传带宽的可接收数据量,确定在重传周期内达到数据丢包率时的接收数据量阈值。
步骤620,基于每个数据包的数据量,确定接收数据量阈值对应的数据包重传数量阈值,并获取重传周期内待重传数据包各自的序列号所构成的序列号集合。
步骤622,在重传周期内待重传数据包的数量小于或等于重传周期内的数据包重传数量阈值时,请求重传在重传周期内的待重传数据包。
步骤624,在重传周期内待重传数据包的数量大于重传周期内的数据包重传数量阈值时,从序列号集合中,筛选出最大序列号和最小序列号。
步骤626,确定基于关键数据包各自的序列号构成、且与序列号集合匹配的关键序列号集合。
步骤628,从关键序列号集合中筛选出大于最小序列号且小于最大序列号的关键序列号。
步骤630,按照从小到大的顺序,依次将关键序列号作为当前序列号,从基于待重传 数据包各自的序列号构成的序列号集合中,删除小于和等于当前序列号的序列号,直至序列号集合中留存的序列号的数量小于或等于数据包重传数量阈值。
步骤632,请求重传序列号集合中留存的序列号所指代的待重传数据包,记录针对每一待重传数据包的请求重传次数。
步骤634,当针对待重传数据包的请求重传次数大于请求次数阈值时,从序列号集合中删除待重传数据包的序列号。
本申请还提供一种应用场景,该应用场景应用上述的数据重传处理方法。具体地,该数据重传处理方法在该应用场景的应用如下:
现有NACK方案有一个最大问题是在网络抖动和丢包很厉害的情况下有可能造成同一时刻收到很多NACK的重传请求,发送端瞬间把这些重传请求放入pacer中进行重发,pacer queue瞬间变大很容易造成间歇性网络风暴,造成严重网络拥塞,网络抖动加剧,缺乏相应的拥塞控制策略。即使用户端网络好没有出现网络风暴,发送端瞬间把这些重传请求放入pacer中进行重发,pacer的延迟会增大,如果接收端jitterbuffer是静态控制算法,只能将缓冲区大小固定尽量设置大一些,网络抖动大时,丢包率高,抖动小时,延迟大。
本方案提出的数据重传处理方法可以通过基于NACK重传码率丢包率控制器来实现,具体的应用场景可以是在低延时直播应用解决方案,本方案简述传输以基于RTP/RTCP/WebRTC传输协议格式为基准说明,实际方案应用不具限于方案是基于RTP/RTCP/WebRTC传输协议还是自定义传输协议格式。
其中,RTP(Real-time Transport Protocol,实时传输协议)对应的RTP协议详细说明了在互联网上传递音频和视频的标准数据包格式。它一开始被设计为一个多播协议,但后来被用在很多单播应用中。RTP协议常用于流媒体系统(配合RTSP协议),视频会议和一键通(Push to Talk)系统(配合H.323或SIP),使它成为IP电话产业的技术基础。RTP协议和RTP控制协议RTCP一起使用,而且它是创建在UDP协议上的。
RTCP(Real-time Transport Control Protocol或RTP Control Protocol或简写RTCP)是实时传输协议RTP的一个姐妹协议。RTCP由RFC 3550定义(取代作废的RFC 1889)。RTP使用一个偶数UDP port;而RTCP则使用RTP的下一个port,也就是一个奇数port。RTCP与RTP联合工作,RTP实施实际数据的传输,RTCP则负责将控制包送至电话中的每个人。其主要功能是就RTP正在提供的服务质量做出反馈。
WebRTC(Web Real-Time Communication,名称源自网页即时通信),是一个支持网页浏览器进行实时语音对话或视频对话的API(Application Programming Interface,应用程序接口)。在Google、Mozilla、Opera支持下被纳入万维网联盟的W3C推荐标准。WebRTC提供了视频会议的核心技术,包括音视频的采集、编解码、网络传输、显示等功能,并且还支持跨平台:windows,linux,mac,android。
在RTC及低延时直播产品中,前向纠错(FEC)和丢包重传(NACK)是抵抗网络错误的重要手段。FEC在发送端将数据包添加冗余纠错码,纠错码连同数据包一起发送到接收端; 接收端根据纠错码对数据进行检查和纠正。NACK则在接收端检测到数据丢包后,发送NACK报文到发送端;发送端根据NACK报文中的序列号,在发送缓冲区找到待重发的数据包,重新发送到接收端。NACK需要发送端发送缓冲区的支持,RFC5104定义NACK数据包的格式。本方案深入分析RTC及低延时直播场景中网络异常场景下RTP数据包的序列号特点(seq特点),结合REMB(Receiver Estimated Maximum Bitrate,接收端最大接收评估带宽)、Loss Rate(丢包率)、SRTT(平滑处理的往返时延)以及NACK丢包重传List优化网络异常时设计了一个NACK重传码率丢包率控制器,优化低延时直播网络异常时快速恢复优化解决方案。本方案在腾讯云视频云快直播、云游戏等业务产品中有很好应用,并在快手、抖音、YY、斗鱼、B站、菜鸡以及unreal engine引擎应用等APP中有很好应用。
其中,快直播(Live Event Broadcasting,简称LEB,超低延迟直播)是标准直播在超低延迟播放场景下的延伸,比传统直播协议延迟更低,为观众提供毫秒级的极致直播观看体验。能够满足一些对延迟性能要求更高的特定场景需求,例如在线教育、体育赛事直播、在线答题等。
低延时直播传输主流方案不管是基于RTP/RTCP/WebRTC传输协议格式还是自定义传输协议格式,传输层基本都是走的UDP。解决网络异常(网络BDP,即带宽与时延的乘积)抖动、网络连接恢复、网络切换(如4G/5G切WIFI、WIFI切4G/5G等)会造成数据包延时或提前到达、数据包乱序,丢包等,前向纠错(FEC)和丢包重传(NACK)是抵抗网络错误的重要手段,解决抖动问题会使用jitterbuffer(音视频抖动缓冲器),jitterbuffer是一个存RTP数据包的缓存,可以对RTP数据包进行排序,当jitterbuffer里RTP包有不连续时,会使用NACK请求发送端重发。
如图7所示,首先,消息容器格式管理模块收到RTP/RTCP包以后进行传输格式解析、音视频容器格式解析和合法性检测。
当格式解析无误且合法时,执行消息包逻辑策略。对于丢失RTP数据包的序列号存储在集合NACK List中。对于本次从RTP模块到来的数据包,从报文中的报头中获取数据包的序列号,标记其序列号为seq1,而上次到达数据包的序列号为seq2。需要说明的是,RTP header的seq号只有2个字节,最大值是65535,会出现回绕,本方案中都假设seq回绕处理好了,认为所有的seq号都是连续增长的。
如果seq1>seq2,则表示seq1顺序到达,标记(seq2,seq1)区间内的数据包为丢失状态,将其存储到NACK List集合中。通过RTP FU头和视频nalu typeseq1对应的视频帧包进行关键帧判断,若接收到的seq1对应的视频帧包是关键帧,则把当前seq1号存储到NACK KeyFrame List。
注意这里的丢失状态是暂时的,如果下个数据包到达时有seq3<seq1,则表示数据包乱序到达,则把NACK List中seq3的序列号删除掉。在更新NACK List集合时,集合一个NACK策略重传周期内的REMB和丢包率(Loss rate,简称lr)来综合考虑:
若lr≤10%,则正常发送NACK List请求;
若lr>10%,则获取NACK策略重传周期NACK List长度,即为NL;确定NACK策略重传周期的重传数据包数量阈值为max_send_retries_nack=(0.2*REMB(byte))*(1-0.8*lr)/1500,其中,NACK List里单个seq按1500个byte计算(城域网路由器MTU最大一般是1500);
若NL<max_send_retries_nack,则正常发送NACK List全部请求;
否则,从NACK List里按seq大小找到各个关键帧位置,并循环删掉这些关键帧位置及其之前的各个seq,然后重新计算删除处理后的NL,直到NL<max_send_retries_nack。
JitterBuffer根据收到的RTP包如果是连续的就做包帧合并并实时间隔渲染,对于RTP包seq中间有不连续的就等待一定时间发送端重传及恢复空洞丢失的seq包,正常网络丢包seq空洞大小为seq1-seq2,是在一定范围内的,对于一些异常网络场景如用户从正常网络走到电梯再从电椄出来网络恢复,在电梯这块时间基本上网络都是异常的,发送端发送的包基本都丢弃了,出电梯恢复以最新的seq1,相对上一次seq2会有比较大跳跃,对于(seq1-seq2)>max_void,可以认为从seq2到seq1这段时间网络已经异常,此时可以清除NACK List,seq2-seq1这之间的空洞也不用插入到NACK List,客户端直接发送PYI请求,以前老的数据全部丢弃,直接让发送端从最新的关键帧开始发送。
基于重传周期定时检测NACK List,重传周期可以动态设置成最新SRTT,超过一个SRTT以后检查NACK List并把NACK List里丢包的seq包发起重传请求,并标记记录该seq请求重传次数retries+1,当retries>MaxRetries后,将该seq从NACK List里删除。
采用上述数据重传处理方法的NACK重传码率丢包率控制器,相比优化前平均综合首帧延时有80%+降低,如图8所示,横坐标为测试次数序号,纵坐标为低延时直播在弱网下首帧延时,很好解决了网络抖动和丢包很厉害的情况下有可能造成同一时刻收到很多NACK的重传请求导致的时间歇性网络风暴。
应该理解的是,虽然图2、图6的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图图2、图6中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。
在一个实施例中,如图9所示,提供了一种数据重传处理装置900,该装置可以采用软件模块或硬件模块,或者是二者的结合成为计算机设备的一部分,该装置具体包括:阈值确定模块902、关键序列号确定模块904、序列号删除模块906和请求重传模块908,其中:
阈值确定模块902,用于基于重传周期内的数据丢包率,确定重传周期内的数据包重 传数量阈值,并获取重传周期内待重传数据包各自的序列号所构成的序列号集合。
关键序列号确定模块904,用于确定与序列号集合相匹配的各关键数据包各自的关键序列号。
序列号删除模块906,用于从关键序列号筛选出目标序列号,从序列号集合中删除小于或等于目标序列号的序列号,使得序列号集合中留存的序列号的数量最大化,且留存的序列号的数量小于或等于数据包重传数量阈值。
请求重传模块908,用于请求重传序列号集合中留存的序列号所指代的待重传数据包。
在一个实施例中,阈值确定模块包括接收数据量阈值确定模块和数据包重传数量阈值模块,其中:
接收数据量阈值确定模块,用于基于传输带宽中重传带宽的可接收数据量,确定在重传周期内达到数据丢包率时对应的接收数据量阈值;
数据包重传数量阈值模块,用于基于每个数据包的数据量,确定接收数据量阈值对应的数据包重传数量阈值。
在一个实施例中,关键序列号确定模块包括序列号筛选模块、关键序列号集合确定模块以及关键序列号筛选模块,其中:
序列号筛选模块,用于从序列号集合中筛选出最大序列号和最小序列号,并获取基于关键数据包各自的序列号构成且与序列号集合匹配的关键序列号集合;
关键序列号筛选模块,用于从关键序列号集合中筛选出大于最小序列号且小于最大序列号的关键序列号。
在一个实施例中,数据重传处理装置还包括关键序列号集合管控模块,用于:提取接收的数据包所对应报头中携带的数据包类别标识;在数据包类别标识表示数据包为关键数据包时,将报头中携带的序列号添加至关键序列号集合。
在一个实施例中,序列号删除模块,还用于按照从小到大的顺序,依次将关键序列号作为当前序列号,从基于待重传数据包各自的序列号构成的序列号集合中,删除小于和等于当前序列号的序列号,直至序列号集合中留存的序列号的数量小于或等于数据包重传数量阈值。
在一个实施例中,数据重传处理装置还包括中间序列号添加模块和当前序列号删除模块,其中:
中间序列号添加模块,用于在当前接收的数据包的当前序列号大于上一次接收的数据包的历史序列号,且当前序列号与历史序列号之间存在中间序列号时,将中间序列号添加至序列号集合;
当前序列号删除模块,用于在当前接收的数据包的当前序列号小于上一次接收的数据包的历史序列号时,从序列号集合中删除当前序列号。
在一个实施例中,数据重传处理装置还包括序列号差值计算模块,第一序列号差值比较模块,第二序列号差值比较模块,其中:
序列号差值计算模块,用于在当前接收的数据包的当前序列号大于上一次接收的数据包的历史序列号,且当前序列号与历史序列号之间存在中间序列号时,计算当前序列号与历史序列号之间的序列号差值;
第一序列号差值比较模块,用于在序列号差值大于差值阈值时,清空序列号集合中的序列号,并基于当前序列号,请求传送与当前序列号匹配的关键数据包;
第二序列号差值比较模块,用于在序列号差值小于或等于差值阈值时,将中间序列号添加至序列号集合。
在一个实施例中,关键数据包为直播场景下传输的音视频数据中的关键帧数据包,数据重传处理装置还包括渲染模块,用于在当前接收的数据包的当前序列号大于上一次接收的数据包的历史序列号,且当前序列号与历史序列号为连续序列号时,获取当前序列号所指代数据包的数据包类别标识;若数据包类别标识表示关键帧数据包,则基于当前序列号所指代的关键帧数据包进行画面渲染;若数据包类别标识表示差别帧或双向差别帧,则将差别帧或双向差别帧与关键帧数据包进行数据叠加,对叠加数据进行画面渲染。
在一个实施例中,数据重传处理装置还包括重传周期确定模块,用于对历史传输数据对应的历史时延数据进行平滑处理,得到参考时延数据;基于参考时延数据,确定重传周期,重传周期对应的时长大于或等于参考时延数据对应的时长。
在一个实施例中,序列号删除模块,还用于记录针对每一待重传数据包的请求重传次数;当针对待重传数据包的请求重传次数大于请求次数阈值时,从序列号集合中删除待重传数据包的序列号。
在一个实施例中,阈值确定模块,还用于在重传周期内的数据丢包率大于丢包率阈值时,基于重传周期内的数据丢包率,确定重传周期内的数据包重传数量阈值;请求重传模块,还用于在重传周期内的数据丢包率小于或等于丢包率阈值时,请求重传在重传周期内的待重传数据包。
在一个实施例中,关键序列号确定模块,还用于在重传周期内待重传数据包的数量大于重传周期内的数据包重传数量阈值时,确定与序列号集合相匹配的各关键数据包各自的关键序列号;请求重传模块,还用于在重传周期内待重传数据包的数量小于或等于重传周期内的数据包重传数量阈值时,请求重传在重传周期内的待重传数据包。
关于数据重传处理装置的具体实施例可以参见上文中对于数据重传处理方法的实施例,在此不再赘述。上述数据重传处理装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图10所示。该计算机设备包括通过系统总线连接的处理器、存储器、通信接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设 备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机可读指令。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的通信接口用于与外部的终端进行有线或无线方式的通信,无线方式可通过WIFI、运营商网络、NFC(近场通信)或其他技术实现。该计算机可读指令被处理器执行时以实现一种数据重传处理方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。
本领域技术人员可以理解,图10中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,还提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机可读指令,该处理器执行计算机可读指令时实现上述各方法实施例中的步骤。
在一个实施例中,提供了一种计算机可读存储介质,存储有计算机可读指令,该计算机可读指令被处理器执行时实现上述各方法实施例中的步骤。
在一个实施例中,提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机可读指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机可读指令,处理器执行该计算机可读指令,使得该计算机设备执行上述各方法实施例中的步骤。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存或光存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准

Claims (20)

  1. 一种数据重传处理方法,其特征在于,由计算机设备执行,所述方法包括:
    基于重传周期内的数据丢包率,确定所述重传周期内的数据包重传数量阈值,并获取所述重传周期内待重传数据包各自的序列号所构成的序列号集合;
    确定与所述序列号集合相匹配的各关键数据包各自的关键序列号;
    从所述关键序列号筛选出目标序列号,从所述序列号集合中删除小于或等于所述目标序列号的序列号,使得所述序列号集合中留存的序列号的数量最大化,且留存的序列号的数量小于或等于所述数据包重传数量阈值;及
    请求重传所述序列号集合中留存的序列号所指代的待重传数据包。
  2. 根据权利要求1所述的方法,其特征在于,所述基于重传周期内的数据丢包率,确定所述重传周期内的数据包重传数量阈值,包括:
    基于传输带宽中重传带宽的可接收数据量,确定在所述重传周期内达到所述数据丢包率时的接收数据量阈值;及
    基于每个数据包的数据量,确定所述接收数据量阈值对应的数据包重传数量阈值。
  3. 根据权利要求1所述的方法,其特征在于,所述确定与所述序列号集合相匹配的各关键数据包各自的关键序列号,包括:
    从所述序列号集合中筛选出最大序列号和最小序列号,并获取基于关键数据包各自的序列号构成、且与所述序列号集合匹配的关键序列号集合;及
    从所述关键序列号集合中筛选出大于所述最小序列号且小于所述最大序列号的关键序列号。
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:
    提取接收的数据包所对应报头中携带的数据包类别标识;及
    在所述数据包类别标识表示所述数据包为关键数据包时,将所述报头中携带的序列号添加至所述关键序列号集合。
  5. 根据权利要求1所述的方法,其特征在于,所述从所述关键序列号筛选出目标序列号,从所述序列号集合中删除小于或等于所述目标序列号的序列号,使得所述序列号集合中留存的序列号的数量最大化,且留存的序列号的数量小于或等于所述数据包重传数量阈值,包括:
    按照从小到大的顺序,依次将所述关键序列号作为当前序列号,从基于所述待重传数据包各自的序列号构成的序列号集合中,删除小于和等于所述当前序列号的序列号,直至所述序列号集合中留存的序列号的数量小于或等于所述数据包重传数量阈值。
  6. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在当前接收的数据包的当前序列号大于上一次接收的数据包的历史序列号,且所述当前序列号与所述历史序列号之间存在中间序列号时,将所述中间序列号添加至序列号集合。
  7. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在当前接收的数据包的当前序列号小于上一次接收的数据包的历史序列号时,从所述序列号集合中删除所述当前序列号。
  8. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在当前接收的数据包的当前序列号大于上一次接收的数据包的历史序列号,且所述当前序列号与所述历史序列号之间存在中间序列号时,计算所述当前序列号与所述历史序列号之间的序列号差值;
    在所述序列号差值大于差值阈值时,清空所述序列号集合中的序列号,并基于所述当前序列号,请求传送与所述当前序列号匹配的关键数据包;及
    在所述序列号差值小于或等于差值阈值时,将所述中间序列号添加至序列号集合。
  9. 根据权利要求1所述的方法,其特征在于,所述关键数据包为直播场景下传输的音视频数据中的关键帧数据包;所述方法还包括:
    在当前接收数据包的当前序列号大于上一次所接收数据包的历史序列号,且所述当前序列号与所述历史序列号为连续序列号时,获取所述当前序列号所指代数据包的数据包类别标识;及
    若所述数据包类别标识表示关键帧数据包,则基于所述当前序列号所指代的关键帧数据包进行画面渲染。
  10. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在当前接收数据包的当前序列号大于上一次所接收数据包的历史序列号,且所述当前序列号与所述历史序列号为连续序列号时,获取所述当前序列号所指代数据包的数据包类别标识;及
    若所述数据包类别标识表示差别帧或双向差别帧,则将所述差别帧或所述双向差别帧与关键帧数据包进行数据叠加,基于叠加数据进行画面渲染。
  11. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    对历史传输数据对应的历史时延数据进行平滑处理,得到参考时延数据;及
    基于所述参考时延数据,确定重传周期,所述重传周期的时长大于或等于所述参考时延数据对应的时长。
  12. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    记录针对每一待重传数据包的请求重传次数;及
    在针对所述待重传数据包的请求重传次数大于请求次数阈值时,从所述序列号集合中删除所述待重传数据包的序列号。
  13. 根据权利要求1至12中任一项所述的方法,其特征在于,所述基于重传周期内的数据丢包率,确定所述重传周期内的数据包重传数量阈值,包括:
    在重传周期内的数据丢包率大于丢包率阈值时,基于所述重传周期内的数据丢包率,确定所述重传周期内的数据包重传数量阈值。
  14. 根据权利要求13所述的方法,其特征在于,所述方法还包括:
    在重传周期内的数据丢包率小于或等于丢包率阈值时,请求重传所述重传周期内的待重传数据包。
  15. 根据权利要求1至13中任一项所述的方法,其特征在于,所述确定与所述序列号集合相匹配的各关键数据包各自的关键序列号,包括:
    在所述重传周期内待重传数据包的数量大于所述重传周期内的数据包重传数量阈值时,确定与所述序列号集合相匹配的各关键数据包各自的关键序列号。
  16. 根据权利要求15所述的方法,其特征在于,所述方法还包括:
    在所述重传周期内待重传数据包的数量小于或等于所述重传周期内的数据包重传数量阈值时,请求重传所述重传周期内的待重传数据包。
  17. 一种数据重传处理装置,其特征在于,所述装置包括:
    阈值确定模块,用于基于重传周期内的数据丢包率,确定所述重传周期内的数据包重传数量阈值,并获取所述重传周期内待重传数据包各自的序列号所构成的序列号集合;
    关键序列号确定模块,用于确定与所述序列号集合相匹配的各关键数据包各自的关键序列号;
    序列号删除模块,用于从所述关键序列号筛选出目标序列号,从所述序列号集合中删除小于或等于所述目标序列号的序列号,使得所述序列号集合中留存的序列号的数量最大化,且留存的序列号的数量小于或等于所述数据包重传数量阈值;及
    请求重传模块,用于请求重传所述序列号集合中留存的序列号所指代的待重传数据包。
  18. 一种计算机设备,包括存储器和一个或多个处理器,所述存储器存储有计算机可读指令,其特征在于,所述一个或多个处理器执行所述计算机可读指令时实现权利要求1至16中任一项所述的方法的步骤。
  19. 一个或多个非易失性计算机可读存储介质,存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现权利要求1至16中任一项所述的方法的步骤。
  20. 一种计算机程序产品,包括计算机可读指令,其特征在于,所述计算机可读指令被一个或多个处理器执行时实现权利要求1至16中任一项所述的方法的步骤。
PCT/CN2022/088788 2021-05-25 2022-04-24 数据重传处理方法、装置、计算机设备和存储介质 Ceased WO2022247550A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP22810283.6A EP4224758A4 (en) 2021-05-25 2022-04-24 Data retransmission processing method and apparatus, computer device, and storage medium
JP2023548347A JP7664407B2 (ja) 2021-05-25 2022-04-24 データ再送処理方法、装置、コンピュータ機器及びコンピュータプログラム
US18/077,733 US12574152B1 (en) 2021-05-25 2022-12-08 Data retransmission processing method and apparatus, computer device, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110569177.3 2021-05-25
CN202110569177.3A CN113037440B (zh) 2021-05-25 2021-05-25 数据重传处理方法、装置、计算机设备和存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/077,733 Continuation US12574152B1 (en) 2021-05-25 2022-12-08 Data retransmission processing method and apparatus, computer device, and storage medium

Publications (1)

Publication Number Publication Date
WO2022247550A1 true WO2022247550A1 (zh) 2022-12-01

Family

ID=76455840

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/088788 Ceased WO2022247550A1 (zh) 2021-05-25 2022-04-24 数据重传处理方法、装置、计算机设备和存储介质

Country Status (5)

Country Link
US (1) US12574152B1 (zh)
EP (1) EP4224758A4 (zh)
JP (1) JP7664407B2 (zh)
CN (1) CN113037440B (zh)
WO (1) WO2022247550A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116451139A (zh) * 2023-06-16 2023-07-18 杭州新航互动科技有限公司 一种基于人工智能的直播数据快速分析方法
CN119052137A (zh) * 2024-08-02 2024-11-29 中国移动通信有限公司研究院 一种数据包传输方法、相关设备、存储介质及计算机程序产品

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4167542B1 (en) * 2020-06-29 2025-08-06 Huawei Technologies Co., Ltd. Data retransmission method and apparatus
CN113037440B (zh) * 2021-05-25 2021-08-06 腾讯科技(深圳)有限公司 数据重传处理方法、装置、计算机设备和存储介质
CN113872733B (zh) * 2021-09-29 2024-01-05 天翼物联科技有限公司 报文重发方法、装置、计算机设备及计算机可读存储介质
CN114257836B (zh) * 2021-12-17 2024-05-28 青岛海信宽带多媒体技术有限公司 一种机顶盒及丢包处理方法
CN115209231B (zh) * 2022-09-07 2024-03-22 腾讯科技(深圳)有限公司 数据传输方法、装置、设备和计算机可读存储介质
CN115543979B (zh) * 2022-09-29 2023-08-08 广州鼎甲计算机科技有限公司 重复数据的删除方法、装置、设备、存储介质和程序产品
CN115866095B (zh) * 2022-11-25 2025-11-25 抖音视界有限公司 数据传输方法、装置、电子设备及存储介质
CN116016370B (zh) * 2022-12-27 2024-01-30 北京铭海博纳科技发展有限公司 一种丢包率优化方法、系统、电子设备及可读存储介质
CN115952025B (zh) * 2023-01-09 2024-03-05 深圳市赛柏特通信技术有限公司 一种数据管控方法、系统、终端设备及存储介质
CN116886249A (zh) * 2023-07-07 2023-10-13 福建天泉教育科技有限公司 一种数据重传的优化方法与终端
CN117176809B (zh) * 2023-09-01 2024-08-02 中科驭数(北京)科技有限公司 一种数据交互方法及系统
CN117061070B (zh) * 2023-09-15 2024-03-29 深圳旷世科技有限公司 无线音频传输方法、音频设备及存储介质
DE102024205718A1 (de) * 2024-06-20 2025-12-24 Siemens Mobility GmbH Passives Überwachen von Paketverzögerung und -verlust in einem Netzwerk-System
CN118860686B (zh) * 2024-07-04 2025-11-28 福建天晴在线互动科技有限公司 一种消息聚合消费的方法及系统
CN119341704A (zh) * 2024-10-25 2025-01-21 中国电信股份有限公司技术创新中心 丢包重传方法、装置、计算机设备、可读存储介质和程序产品
CN119814233B (zh) * 2024-12-16 2025-09-30 西安交通大学 一种面向弱网环境的主动丢包恢复方法
CN119996782B (zh) * 2025-04-11 2025-06-13 通号通信信息集团有限公司 一种视频数据传输中的丢包处理方法、装置、设备及介质
CN120614277B (zh) * 2025-07-01 2025-12-09 广州万虹信息科技有限公司 一种数据传输系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101069221A (zh) * 2003-12-19 2007-11-07 诺基亚公司 无线voip的编码解码器辅助的容量增强
CN104486051A (zh) * 2014-12-09 2015-04-01 京信通信系统(中国)有限公司 一种数据重传方法及装置
CN106067847A (zh) * 2016-05-25 2016-11-02 腾讯科技(深圳)有限公司 一种语音数据传输方法及装置
CN107864084A (zh) * 2016-09-22 2018-03-30 腾讯科技(深圳)有限公司 数据包的传输方法和装置
CN108781139A (zh) * 2016-02-26 2018-11-09 网络洞察力知识产权公司 分组网络中的数据重传
CN113037440A (zh) * 2021-05-25 2021-06-25 腾讯科技(深圳)有限公司 数据重传处理方法、装置、计算机设备和存储介质

Family Cites Families (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5222061A (en) * 1991-10-31 1993-06-22 At&T Bell Laboratories Data services retransmission procedure
JP3866196B2 (ja) * 2000-06-23 2007-01-10 三菱電機株式会社 パケット再送システムおよびパケット再送方法
JP2002204279A (ja) * 2001-11-16 2002-07-19 Matsushita Electric Ind Co Ltd データ送信装置及びデータ送信方法
JP4116470B2 (ja) * 2002-03-06 2008-07-09 ヒューレット・パッカード・カンパニー メディア・ストリーミング配信システム
JP4452983B2 (ja) * 2004-01-08 2010-04-21 ソニー株式会社 受信装置および方法、プログラム、並びに記録媒体
CN100579128C (zh) * 2004-01-09 2010-01-06 日本电气株式会社 通信方法、节点以及节点的控制装置
WO2007061087A1 (ja) * 2005-11-28 2007-05-31 Nec Corporation 通信装置、通信システム、通信方法、および、通信プログラム
JP4699187B2 (ja) * 2005-11-29 2011-06-08 シャープ株式会社 受信装置、通信システム、および受信装置の制御プログラム
WO2008120275A1 (ja) * 2007-03-29 2008-10-09 Fujitsu Limited 移動通信装置
US8191133B2 (en) * 2007-12-17 2012-05-29 Avaya Inc. Anti-replay protection with quality of services (QoS) queues
CN101697504B (zh) * 2009-09-08 2013-04-17 杭州华三通信技术有限公司 一种提高数据传输质量的方法及装置
JP6014411B2 (ja) * 2012-08-15 2016-10-25 日本放送協会 無線通信を行う受信装置、受信方法及びプログラム
US10356652B2 (en) * 2014-10-06 2019-07-16 Vid Scale, Inc. Adapting communication parameters to link conditions, traffic types, and/or priorities
JPWO2016067561A1 (ja) * 2014-10-31 2017-08-17 日本電気株式会社 通信端末、通信システムおよび通信方法、並びにコンピュータ・プログラム
CN105991476B (zh) * 2015-01-29 2020-08-04 沪江教育科技(上海)股份有限公司 一种语音数据延时处理方法及装置
CN108282273B (zh) * 2017-01-05 2024-03-08 华为技术有限公司 分段重传的方法和装置
CN107204834B (zh) * 2017-05-25 2020-07-07 复旦大学 一种基于udt协议的高速网络可靠传输的控制方法
CN108564596B (zh) * 2018-03-01 2022-01-25 南京邮电大学 一种高尔夫挥杆视频的智能比对分析系统及方法
CN109862038A (zh) * 2019-03-22 2019-06-07 江苏睿鸿网络技术有限公司 一种流媒体协议中数据延时及丢包的处理方法
US11632444B2 (en) * 2020-09-15 2023-04-18 Intelligent Fusion Technology, Inc. Method, device, and system for TCP packet transmission over satellite communication network
CN112165355B (zh) * 2020-10-23 2022-03-22 中国电子科技集团公司第三十研究所 一种面向卫星网络的基于udp的可靠数据传输方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101069221A (zh) * 2003-12-19 2007-11-07 诺基亚公司 无线voip的编码解码器辅助的容量增强
CN104486051A (zh) * 2014-12-09 2015-04-01 京信通信系统(中国)有限公司 一种数据重传方法及装置
CN108781139A (zh) * 2016-02-26 2018-11-09 网络洞察力知识产权公司 分组网络中的数据重传
CN106067847A (zh) * 2016-05-25 2016-11-02 腾讯科技(深圳)有限公司 一种语音数据传输方法及装置
CN107864084A (zh) * 2016-09-22 2018-03-30 腾讯科技(深圳)有限公司 数据包的传输方法和装置
CN113037440A (zh) * 2021-05-25 2021-06-25 腾讯科技(深圳)有限公司 数据重传处理方法、装置、计算机设备和存储介质

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
See also references of EP4224758A4 *
ZHANG, MINMIN: "Application Research on Network Adaptability Technology in Multimedia Conference", PROCEEDINGS OF THE 6TH ANNUAL ACADEMIC CONFERENCE OF CHINA COMMUNICATIONS SOCIETY (PART 2), CN, 31 January 2010 (2010-01-31), CN, pages 244 - 248, XP009541914 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116451139A (zh) * 2023-06-16 2023-07-18 杭州新航互动科技有限公司 一种基于人工智能的直播数据快速分析方法
CN116451139B (zh) * 2023-06-16 2023-09-01 杭州新航互动科技有限公司 一种基于人工智能的直播数据快速分析方法
CN119052137A (zh) * 2024-08-02 2024-11-29 中国移动通信有限公司研究院 一种数据包传输方法、相关设备、存储介质及计算机程序产品

Also Published As

Publication number Publication date
CN113037440A (zh) 2021-06-25
EP4224758A1 (en) 2023-08-09
JP7664407B2 (ja) 2025-04-17
EP4224758A4 (en) 2024-05-29
US12574152B1 (en) 2026-03-10
JP2024509728A (ja) 2024-03-05
CN113037440B (zh) 2021-08-06

Similar Documents

Publication Publication Date Title
WO2022247550A1 (zh) 数据重传处理方法、装置、计算机设备和存储介质
US10542064B2 (en) Method, server side and system for computing bandwidth of network transmission of streaming media
US12363584B2 (en) Conserving network resources during transmission of packets of interactive services
KR101046105B1 (ko) 컴퓨터 프로그램 제조품, 리소스 요구 조정 방법 및 엔드 시스템
US9191297B2 (en) Providing feedback to media senders over real time transport protocol (RTP)
US20230083441A1 (en) Managing subpacket transmission and reception for advanced interactive services
CN106792262A (zh) 视频数据传输方法及装置
WO2020207406A1 (zh) 一种数据流的传输方法和设备
JP2017508372A (ja) 輻輳制御ビットレート・アルゴリズム
CN110113662A (zh) 一种适应多种网络状况的视频监控客户端系统
US20250310393A1 (en) Method and apparatus for transmitting streammethod for transmitting stream data
CN116980635A (zh) 直播数据处理方法、装置、计算机设备和存储介质
CN115767143A (zh) 播放卡顿的判断方法、装置、电子设备和可读存储介质
CN110602568A (zh) 一种基于rtp的视频流传输丢包重传方法、设备及存储设备
WO2024001451A9 (zh) 业务数据包的处理方法、装置、介质及电子设备
CN120017880A (zh) 视频数据的处理方法和装置、存储介质及电子设备
US20250301197A1 (en) Method and apparatus for media data transmission
CN110233856B (zh) 报文处理方法、装置及计算机可读存储介质
CN110012363A (zh) 一种基于sip协议的视频聊天系统
WO2025139499A1 (zh) 基于非3GPP接入的QoS处理方法、装置、可读介质及设备
CN117220838A (zh) 数据包的传输方法、装置、设备及存储介质
CN115765954A (zh) 一种弱网环境超高码率流媒体传输优化方法
HK40046442B (zh) 数据重传处理方法、装置、计算机设备和存储介质
HK40046442A (zh) 数据重传处理方法、装置、计算机设备和存储介质
CN116318545B (zh) 视频数据传输方法、装置、设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22810283

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022810283

Country of ref document: EP

Effective date: 20230502

WWE Wipo information: entry into national phase

Ref document number: 202337033607

Country of ref document: IN

WWE Wipo information: entry into national phase

Ref document number: 2023548347

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE

WWG Wipo information: grant in national office

Ref document number: 11202303064T

Country of ref document: SG