CN112804028A - Data packet transmission method, equipment and storage medium - Google Patents

Data packet transmission method, equipment and storage medium Download PDF

Info

Publication number
CN112804028A
CN112804028A CN202011137904.0A CN202011137904A CN112804028A CN 112804028 A CN112804028 A CN 112804028A CN 202011137904 A CN202011137904 A CN 202011137904A CN 112804028 A CN112804028 A CN 112804028A
Authority
CN
China
Prior art keywords
data packet
original data
original
subset
redundant
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.)
Granted
Application number
CN202011137904.0A
Other languages
Chinese (zh)
Other versions
CN112804028B (en
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.)
Beijing Jiaxun Feihong Electrical Co Ltd
Original Assignee
Beijing Jiaxun Feihong Electrical 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 Beijing Jiaxun Feihong Electrical Co Ltd filed Critical Beijing Jiaxun Feihong Electrical Co Ltd
Priority to CN202011137904.0A priority Critical patent/CN112804028B/en
Publication of CN112804028A publication Critical patent/CN112804028A/en
Application granted granted Critical
Publication of CN112804028B publication Critical patent/CN112804028B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0033Systems modifying transmission characteristics according to link quality, e.g. power backoff arrangements specific to the transmitter
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0006Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format
    • H04L1/0007Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format by modifying the frame length
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0036Systems modifying transmission characteristics according to link quality, e.g. power backoff arrangements specific to the receiver
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1829Arrangements specially adapted for the receiver end
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1867Arrangements specially adapted for the transmitter end
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/65Network streaming protocols, e.g. real-time transport protocol [RTP] or real-time control protocol [RTCP]

Abstract

The embodiment of the invention discloses a data packet transmission method, a device and a storage medium. The method comprises the following steps: acquiring an original data packet set to be sent; carrying out data packet length normalization processing on each original data packet in the original data packet set to obtain a normalized data packet set; generating a redundant data packet set matched with the regular data packet set through RS erasure code coding; and sending the original data packet set and the redundant data packet set to a receiving end, and determining a new original data packet set to be sent. The method can improve the packet loss tolerance during the transmission of the data packet, reduce the retransmission times caused by the packet loss, improve the successful transmission speed of the data packet and further avoid the adverse effect caused by the packet loss.

Description

Data packet transmission method, equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, a device, and a storage medium for transmitting a data packet.
Background
In real-time video communication, IP networks are generally used. The IP network is a best effort network, and when the IP network is based on User Datagram Protocol (UDP) transmission, reliability of receiving and transmitting data packets cannot be guaranteed, and network packet loss and delay are inevitable. The IP network has high packet loss rate and delay and is a weak network.
In the prior art, to solve the problem of real-time video transmission in the weak network environment, Forward Error Correction (FEC) or packet loss retransmission (NACK) is adopted for data compensation.
The FEC is pre-compensation, and the sending end uses XOR (exclusive or) coding in advance to calculate a set (e.g., K) of original data to generate a redundant data. And the sending end sends the original data and the redundant data to the receiving end together. When any one original data is lost at the receiving end, the original data can be restored through XOR calculation by other original data (K-1) and redundant data. However, FEC tolerates 1 original data loss at most in network transmission, and when more than 1 original data loss occurs, the lost original data cannot be recovered through XOR, which is not suitable for network scenarios with high packet loss rate.
NACK is post-compensation, and when the receiving end detects that a packet is lost through an RTP sequence number of a packet in a Real-Time protocol (RTP), the receiving end requests the transmitting end to retransmit the packet. And the sending end retransmits the lost data packet after receiving the request so that the receiving end recovers the lost data packet. However, the retransmission of the transmitting end still suffers from the influence of network packet loss and delay factors. Multiple retransmissions are required to ensure that all packets are received by the receiving end. The NACK method occupies a large amount of bandwidth and requires a long wait time, which is difficult to meet the low-latency requirement of real-time video communication.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, and a storage medium for transmitting a data packet, which can improve packet loss tolerance during data packet transmission, reduce retransmission times caused by packet loss, and improve the speed of successful data packet transmission.
In a first aspect, an embodiment of the present invention provides a method for transmitting a data packet, where the method includes:
acquiring an original data packet set to be sent;
carrying out data packet length normalization processing on each original data packet in the original data packet set to obtain a normalized data packet set;
generating a redundant data packet set matched with the regular data packet set through RS erasure code coding;
and sending the original data packet set and the redundant data packet set to a receiving end, and determining a new original data packet set to be sent.
In a second aspect, an embodiment of the present invention provides a method for transmitting a data packet, where the method includes:
acquiring an original data packet subset and a redundant data packet subset received by an original data packet set and a redundant data packet set sent by a sending end;
and performing data restoration on the original data packet set according to the original data packet subset and the redundant data packet subset.
In a third aspect, an embodiment of the present invention further provides a device for transmitting a data packet, where the device includes:
the original data packet set acquisition module is used for acquiring an original data packet set to be sent;
the regular data packet set generation module is used for carrying out data packet length normalization processing on each original data packet in the original data packet set to obtain a regular data packet set;
the redundant data packet set generating module is used for generating a redundant data packet set matched with the regular data packet set through RS erasure code coding;
and the original data packet set determining module is used for sending the original data packet set and the redundant data packet set to a receiving end and determining a new original data packet set to be sent.
In a fourth aspect, an embodiment of the present invention further provides a device for transmitting a data packet, where the device includes:
a data packet subset obtaining module, configured to obtain an original data packet subset and a redundant data packet subset received for an original data packet set and a redundant data packet set sent by a sending end;
and the data reduction module is used for carrying out data reduction on the original data packet set according to the original data packet subset and the redundant data packet subset.
In a fifth aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement a method for transmitting a data packet according to any embodiment of the present invention.
In a sixth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for transmitting a data packet according to any embodiment of the present invention.
According to the technical scheme of the embodiment of the invention, an original data packet set to be sent is obtained; carrying out data packet length normalization processing on each original data packet in the original data packet set to obtain a normalized data packet set; generating a redundant data packet set matched with the regular data packet set through RS erasure code coding; the original data packet set and the redundant data packet set are sent to a receiving end, and a new original data packet set to be sent is determined, so that the problem of data packet transmission is solved, the packet loss tolerance during data packet transmission can be improved, the retransmission times caused by packet loss are reduced, the speed of successful data packet transmission is improved, and the adverse effect caused by packet loss can be avoided.
Drawings
Fig. 1 is a flowchart of a method for transmitting a data packet according to an embodiment of the present invention;
fig. 2a is a flowchart of a data packet transmission method according to a second embodiment of the present invention;
fig. 2b is a schematic diagram of a data format of a redundant data packet according to a second embodiment of the present invention;
fig. 3 is a flowchart of a data packet transmission method according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a data packet transmission apparatus according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a data packet transmission apparatus according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a method for transmitting a data packet according to an embodiment of the present invention, where the embodiment is applicable to a situation where RTP data packets are transmitted in a real-time video communication scenario, the method may be executed by a device for transmitting data packets, where the device may be implemented in a software and/or hardware manner, and the device may be integrated in a processor, as shown in fig. 1, and the method specifically includes:
and step 110, acquiring an original data packet set to be sent.
The original data packet may be a data packet formed before data transmission. In an optional implementation manner of this embodiment, the original data packet is a Real-time Applications (RTP) packet or a Real-time transport Control Protocol (RTCP) packet.
In real-time video communication, RTP/RTCP is often used to transmit data for video playback. The video encoder at the sending end can generate frame data of a video, pack the frame data of the video, generate one or more RTP packets with equal or unequal sizes, and send the RTP packets through an IP network. The receiving end can unpack the received RTP packet into frame data and send the frame data to a decoder of the receiving end for decoding so as to display a video image. In practice, due to the number of video scenes, the frame data size output by the video encoder usually has a floating size, and the number and size of the RTP packets formed also have a floating size, i.e. the number of RTP packets may not be fixed, and the sizes may not be equal.
The number of transmissions of the original data packet by the transmitting end may be fixed or not. For example, the sending end may determine RTP packets corresponding to the same frame data as a group as an original data packet set to send; or, the sending end may determine a set of RTP packets with a preset number or a preset size as an original data packet set to send; or, the sending end may add some additional packets to send on the basis of the above manner.
For example, when an RTP packet is sent based on an IP network, the packet loss rate is usually high, and a receiving end may not receive all RTP packets sent by a sending end, so that frame data obtained by unpacking is incomplete, and a video is displayed in a video manner. The sending end can send the lost data packet, or can send the lost data packet separately; alternatively, the missing data packets may be sent as additional packets based on the original set of data packets of the next group.
And 120, performing data packet length normalization processing on each original data packet in the original data packet set to obtain a normalized data packet set.
Wherein, as mentioned above, the sizes of the RTP packets may not be equal, i.e. the lengths of the RTP packets are different. In order to process the original data packet set and generate a redundant data packet set, so that the receiving end can restore the lost data packet. The normalization processing may be to generate a normalized packet set by equalizing the packet lengths of the original packets.
In an optional implementation manner of the embodiment of the present invention, performing packet length normalization processing on each original data packet in an original data packet set to obtain a normalized data packet set includes: determining the maximum data length of the original data packet set according to the data length of each original data packet in the original data packet set; determining the target data length according to the maximum data length and the preset data length; and respectively carrying out data filling on each original data packet to obtain a regular data packet set, wherein the data length of each regular data packet is the target data length.
The video encoder at the transmitting end may pack one or more frames of data into K RTP packets, where K is an integer greater than or equal to 1. The RTP packet includes header information and Payload information, where the header information includes a Payload Type (PT) for marking a Type of data, and an RTP sequence number for marking an order of the data. The payload information is used to carry the information actually transmitted. The RTCP may be used to describe the transmission condition of RTP, and the receiving end may use the RTCP to feed back the packet loss rate of itself and the RTP sequence number of the lost packet to the sending end. The length of the header information and the payload information is the data length of the RTP packet. The data length of each RTP packet may be the same or different.
For the load information V in the original data packetkK is more than or equal to 0 and less than or equal to K-1, and the data length is Flength(Vk). The maximum data length of the original data packet set is Lmax=max(Flength(Vk) Max (·) represents taking the maximum value. In this embodiment, the maximum data length or the sum of the maximum data length and a preset data length may be determined as the target data length. The maximum data length may be set to fill up the data length of the original data packet, and the preset data length may be set to record the data length of the original data packet itself. In this embodiment, data filling may be performed on the original data packet to obtain a regular data packet set, where a data length of a regular data packet in the regular data packet set is a target data length.
Illustratively, the preset data length is 2, and the target data length is LK=Lmax+2。
In this embodiment, in order to normalize a regular data packet in a regular data packet set, in an optional implementation manner, data padding is performed on each original data packet, so as to obtain a regular data packet set, where the method includes: respectively filling preset data in data positions corresponding to the data length of each original data packet from the data length to the maximum data length; and respectively filling the data length value of each original data packet from the maximum data length of each original data packet to the data position corresponding to the target data length to obtain a regular data packet set.
The preset data may be data in the original data packet having the same form, for example, the data in the original data packet is represented by binary digits, and the preset data may also be binary digits, for example, 0 or 1. For normalization of the regular data packets, the default data may be the same, e.g., all 0's.
The self data length value can be the concrete embodiment of the data length of the original data packet in the same form of the data in the original data packet. For example, the data in the original data packet is represented by binary digits, and the self data length value may be a value represented by the data length of the original data packet by binary digits.
The preset data and the data length value are added and filled after the data of the original data packet. The data (actually transmitted information) of the original data packet, the preset data and the data length value thereof can be used as new load information, that is, as the load information of the regular data packet. The header information of the regular data packet may be identical to the header information of the original data packet.
Generally, in real-time video transmission, RTP packets are transmitted by using User Datagram Protocol (UDP), and the data length does not exceed 65535. In order to cover all data lengths of the RTP packet, in this embodiment, the preset data length may be 2 bytes. The load information of the generated regular data packet can be recorded as Xk. According to XkMiddle header information, payload information, and XkThe self data length value recorded in (1) can be correspondingly reduced to Vk
And 130, generating a redundant data packet set matched with the regular data packet set through RS erasure code coding.
In this embodiment, the manner of generating the redundant data packet set may be to adopt a RS erasure code (Reed-solomon codes), which may replace an XOR manner in the prior art, and the tolerable number of packet losses is much greater than 1. The RS erasure code adopts K: m codes can generate M redundant data packets with equal length from K regular data packets with equal length. When Z data packets are arbitrarily selected from the regular data packet set and the redundant data packet set, as long as Z is more than or equal to K + M, the K regular data packets can be restored and generated, the tolerable packet loss number is K + M-Z, and when the packet loss number is less than or equal to K + M-Z, the lost data packets do not need to be retransmitted, so that the retransmission times can be reduced. The principle and calculation process of the RS erasure code are not specifically described in this embodiment.
In this embodiment, the redundant data packets may be obtained by performing RS erasure coding on the K original data packets. The data format of the redundant data packet may be similar to the original data packet. For example, the redundant data packet may include header information and payload information. The header information of the redundant data packet may be similar to the header information of the original data packet, and includes PT for marking the data type of the redundant data packet, and RTP sequence numbers for marking the sequence of the redundant data packet. The load information of the redundant data packet can have two parts, one part is the private head information of the set redundant data packet, and the other part is the information Y actually transmitted by the redundant data packetm. The private header information may record data related to the RS erasure code, such as a K value, an M value, and an RTP sequence number of an original data packet corresponding to the redundant data packet. The private header information of the redundant data packet is convenient for the receiving end to restore the original data packet.
And step 140, sending the original data packet set and the redundant data packet set to a receiving end, and determining a new original data packet set to be sent.
When sending the original data packet set and the redundant data packet set, different data types can be marked in the header information of the original data packet and the header information of the redundant data packet respectively through the PT, so that a receiving end can distinguish the original data packet set and the redundant data packet set. The data type of the original data packet may be referred to as Video RTP data, and the data type of the redundant data packet may be referred to as Video Network Optimization (VNO) data. For example, the video encoder at the transmitting end may distinguish RTP data and VNO data by different binary data in the header information, and the receiving end may determine the RTP data and the VNO data according to the corresponding binary data for the received data packet. The receiving end can directly process the received data packet, and the load of data forwarding and receiving processing can be reduced.
It should be noted that, when the original data packet set and the redundant data packet set are required to be restored by the RS erasure correction code, the receiving end may generate a regular data packet set according to the original data packet set, then restore the regular data packet corresponding to the lost original data packet according to the regular data packet set and the redundant data packet set by the RS erasure correction code, and then restore the lost original data packet (remove the data filled in the regular data packet) according to the regular data packet.
Due to the existence of network packet loss, the receiving end may only receive a part of the packets in the original data packet set and the redundant data packet set. The receiving end can determine whether all original data packets in the original data packet set can be obtained according to the receiving condition, and further determine a feedback result to indicate the sending end to send the next group of original data packet set.
For example, after the original data packet set of the current group is completely transmitted, the transmitting end may determine that the original data packet set of the next group is a new original data packet set to be transmitted, and continue to transmit the new original data packet set to the receiving end. For the original data packet set of the current group, when the receiving end cannot obtain all the original data packets, a retransmission request can be fed back to the sending end, and the sending end can determine the lost data packets as a new original data packet set to be sent according to the retransmission request; or, the sending end may determine that the lost data packet and the original data packet set to be sent next are new original data packet sets to be sent. For example, if the transmitting end has transmitted the original data packet set of the current group and the original data packet set of the first group (next group) of the current group to the receiving end, the original data packet set to be transmitted next may be the original data packet set of the second group (next group) after the current group. The transmission mode can reduce the transmission delay of the transmitting end.
According to the technical scheme of the embodiment, an original data packet set to be sent is obtained; carrying out data packet length normalization processing on each original data packet in the original data packet set to obtain a normalized data packet set; generating a redundant data packet set matched with the regular data packet set through RS erasure code coding; the original data packet set and the redundant data packet set are sent to a receiving end, and a new original data packet set to be sent is determined, so that the problem of data packet transmission is solved, the packet loss tolerance during data packet transmission can be improved, the retransmission times caused by packet loss are reduced, the successful transmission speed of the data packets is improved, and the adverse effect caused by packet loss can be avoided.
Example two
Fig. 2a is a flowchart of a data packet transmission method according to a second embodiment of the present invention, which is a further refinement of the foregoing technical solution, and the technical solution in this embodiment may be combined with various alternatives in one or more of the foregoing embodiments. As shown in fig. 2a, the method comprises:
step 210, obtaining an original data packet set to be sent.
In an optional implementation manner of the embodiment of the present invention, the original data packet is an RTP packet.
Step 220, performing data packet length normalization processing on each original data packet in the original data packet set to obtain a normalized data packet set.
In an optional implementation manner of the embodiment of the present invention, performing packet length normalization processing on each original data packet in an original data packet set to obtain a normalized data packet set includes: determining the maximum data length of the original data packet set according to the data length of each original data packet in the original data packet set; determining the target data length according to the maximum data length and the preset data length; and respectively carrying out data filling on each original data packet to obtain a regular data packet set, wherein the data length of each regular data packet is the target data length.
In an optional implementation manner of the embodiment of the present invention, the data padding is performed on each original data packet, so as to obtain a regular data packet set, where the method includes: respectively filling preset data in data positions corresponding to the data length of each original data packet from the data length to the maximum data length; and respectively filling the data length value of each original data packet from the maximum data length of each original data packet to the data position corresponding to the target data length to obtain a regular data packet set.
Step 230, determining a second quantity value of the redundant data packets in the redundant data packet set according to the packet loss rate of the network and the first quantity value of the original data packets in the original data packet set.
The packet loss rate of the network is set as p, and may be obtained in advance through a test, for example, the receiver feeds back through RTCP. The first quantity value of the original packets in the original packet set is set to K. The second quantity value of the redundant data packets in the redundant data packet set is related to the tolerable number of packet losses. In this embodiment, the tolerable number of dropped packets and the second number of redundant data packets in the redundant data packet set are both set to be M. At this time, the value of M can be obtained by a formula
Figure BDA0002737273060000081
And (4) determining. When the total amount of data packets in the original data packet set and the redundant data packet set received by the receiving end is not less than K, all original data packets in the original data packet set can be restored through the RS erasure codes. The packet loss tolerance of the network is improved, and according to the technical scheme of the embodiment, the packet loss tolerance is M and is far greater than 1, so that a better restoration effect is achieved, and video blockage or damage can be avoided.
Step 240, generating a redundant data packet with a second numerical value according to the regular data packet in the regular data packet set corresponding to the original data packet set.
In this embodiment, after determining the value of M, RS erasure correction may be adopted according to all the regular packets in the set of regular packetsThe code proceeds with codeword K: and M redundant data packets are generated by the coding calculation of M to form a redundant data packet set. The data length of the redundant data packet is LK. When RS erasure correction coding is performed, payload information in the regular data packet may be encoded to generate actually transmitted data in the payload information of the redundant data packet.
Fig. 2b is a schematic diagram of a data format of a redundant data packet according to a second embodiment of the present invention. As shown in fig. 2b, the redundant data packet includes RTP Header (Header information), FEC Header (private Header information), and replay "Payload" (information actually transmitted). Wherein, the FEC Header and the replar "Payload" together form an RTP Payload (Payload information). The RTP Header complies with the RFC3550 protocol, the FEC Header records data related to RS erasure codes, and the replay "Payload" is actually transmitted data in the load information of redundant data packets and is marked as YmWherein M is more than or equal to 0 and less than or equal to M-1.
Step 250, adding the first numerical value and the second numerical value into each redundant data packet, and generating a first packet sequence number of an original data packet in an original data packet set used by the redundant data packet, and a second packet sequence number of the redundant data packet.
Wherein the first number value K, the second number value M and the first packet number may be recorded in the FEC Header as shown in fig. 2 b. The second packet number may be recorded in the RTP Header, and the RTCP may be generated according to the RFC3550 protocol in data transmission. In addition, in order to facilitate the recovery of the lost data packet by the receiving end, the FEC Header may further record the start sequence numbers of all the redundant data packets in the redundant data packet set, that is, the minimum value among the second packet sequence numbers. Illustratively, the second packet sequence number of each redundant data packet is in turn: 1234, 1235, 1236, 1237, 1238; the starting sequence number of the redundant data packet may be 1234. Recording K, M, a first packet sequence number and a second packet sequence number in the redundant data packet can be convenient for a receiving end to judge whether the data packet is lost or not, whether the lost data packet can be restored or not, and calculating and restoring the lost data packet through the RS erasure codes.
In order to reduce the amount of information recorded in redundant data packets, valuable private header information in the redundant data packets is saved. In an optional implementation manner of the embodiment of the present invention, adding, to each redundant data packet, a first packet sequence number of an original data packet in an original data packet set used for generating the redundant data packet includes: determining the initial packet sequence number of an original data packet in an original data packet set; determining packet bitmap data according to the initial packet sequence number and the packet sequence number of the original data packet in the original data packet set; and adding the initial packet sequence number and the packet bitmap data into each redundant data packet as a first packet sequence number.
The packet bitmap data is used for indicating the transmission condition of the original data packet in the original data packet set. Illustratively, the packet bitmap data includes multiple bits of data values, and each bit of data value may represent the transmission of one data packet. The transmission of all the original data packets from the start packet sequence number can be indicated in the packet bitmap data in order. For example, the start packet with sequence number 2314 participates in the transmission of the current original packet set (the original packet set includes the original packet with RTP sequence number 2314), the original packets with RTP sequence numbers 2315 to 2317 do not participate in the transmission, and the original packets with RTP sequence numbers 2318 to 2321 participate in the transmission. In this case, a bitmap with 1, 0, 0, 0, 1, 1, 1, 1 may be generated to indicate the transmission of the original packet. A 1 represents transmission, may be represented by a high level, a 0 represents no transmission, and may be represented by a low level. The packet bitmap data may be a data value generated from a bitmap, and in the above example, the packet bitmap data may be 10001111.
The starting packet sequence number and the packet bitmap data are used as the first packet sequence number to be added into the redundant data packet, so that the receiving end can determine the RTP sequence numbers of all the original data packets in the original data packet set according to the first packet sequence number and the starting packet sequence number as the reference according to the packet bitmap data, and the receiving end can conveniently determine whether packet loss exists. In the embodiment, the starting packet sequence number and the packet bitmap data are used as the first packet sequence number to be added into the redundant data packet, the RTP sequence numbers of all original data packets do not need to be recorded in the redundant data packet, the use of the private header information of the redundant data packet can be reduced, and the occupied space is greatly saved. In addition, when the redundant data packets are generated through RS erasure code coding, the original data packets are arranged according to the corresponding RTP sequence number sequence, one or more original data packets can be sent discontinuously, and the original data packets can be sent more flexibly.
And step 260, sending the original data packet set and the redundant data packet set to a receiving end.
Step 270, if a retransmission request from the receiving end is received, the lost data packet included in the retransmission request is obtained.
When the receiving end cannot obtain all original data packets in the original data packet set according to the received data packets, the receiving end can feed back a retransmission request to the sending end. The retransmission request may include the RTP sequence number (which may be one or more) of the missing data packet determined by the receiving end according to the starting packet sequence number, the packet bitmap data, and the received RTP sequence number of the original data packet. The sending end may use the original data packet corresponding to the RTP sequence number as the lost data packet. If the retransmission request of the receiving end is not received, the transmitting end can continue to transmit the original data packet set of the next group of the current group after the original data packet set and the redundant data packet set are transmitted, and can generate the redundant data packet set of the next group of the original data packet set of the next group. The sending end can send the original data packet set of the next group and the redundant data packet set of the next group to the receiving end, and sending time delay can be reduced.
Step 280, according to the lost data packet, after determining a new original data packet set to be sent, returning to execute the operation of performing data packet length normalization processing on each original data packet in the original data packet set to obtain a normalized data packet set.
The sending end may determine the lost original data packet according to the RTP sequence number in the retransmission request, use all the lost original data packets as a new original packet set to be sent, and return to execute steps 220 to 260. If the feedback of the receiving end is still the retransmission request, continue to execute step 270 to step 280; if no retransmission request is received from the receiving end, the process returns to step 210 to step 260. At this time, the original data packet set to be sent obtained in step 210 may be the next original data packet set of the current group. After step 260 is executed, the step is continuously determined according to whether the retransmission request exists, until the original data packet sets of all the groups are completely sent.
In order to reduce the number of sending times of the sending end and improve the probability of successful restoration of the original data packet by the receiving end, in an optional implementation manner of the embodiment of the present invention, determining a new original data packet set to be sent according to a lost data packet includes: and determining the lost data packet and the original data packet set to be sent next as a new original data packet set to be sent.
In this embodiment, the missing data packet and the original data packet set to be sent next may be determined as a new original data packet set to be sent, so that the sending times of the sending end may be reduced. The next original data packet set to be sent may be an original data packet set after the current group, that is, an original data packet set after the current group, which is obtained by the sending end at the receiving end, for example, an original data packet set of a first group, a second group, or a third group after the current group, and is specifically determined according to a sending condition of the sending end.
By adopting the above sending method, the receiving end can restore all original data packets of the current group by at least two methods. One way is that the receiving end may restore the original data packet of the current group that is not received through RS erasure code calculation according to the received lost data packet in the new original data packet set to be sent, and the received original data packet and redundant data packet of the current group. In another way, the receiving end may perform RS erasure code calculation according to the received data packet of the new original data packet set to be sent to restore the original data packet of the current group that is not received. The probability of successful restoration of the receiving end is improved, the retransmission times can be reduced, and the time delay of real-time video communication is reduced.
According to the technical scheme of the embodiment of the invention, a second numerical value of redundant data packets in a redundant data packet set is determined according to the packet loss rate of a network and the first numerical value of original data packets in an original data packet set; generating a redundant data packet with a second numerical value according to the regular data packet in the regular data packet set corresponding to the original data packet set; adding a first numerical value and a second numerical value into each redundant data packet to generate a first packet sequence number of an original data packet in an original data packet set used by the redundant data packet and a second packet sequence number of the redundant data packet; sending the original data packet set and the redundant data packet set to a receiving end; if a retransmission request of a receiving end is received, acquiring a lost data packet included in the retransmission request; the method and the device determine a new original data packet set to be sent according to the lost data packet, solve the problem that packet loss is overcome when the data packet is sent in real-time video communication, reduce occupation of private header information of redundant data packets, improve tolerable packet loss data, improve the probability of successful restoration of the data packet by a receiving end, and reduce packet loss retransmission times so as to ensure the effect of smooth and stable real-time video.
EXAMPLE III
Fig. 3 is a flowchart of a data packet transmission method according to a third embodiment of the present invention, where this embodiment is applicable to a situation where RTP data packets are transmitted in a real-time video communication scenario, and the method may be executed by a data packet transmission apparatus, where the apparatus may be implemented in a software and/or hardware manner, and the apparatus may be integrated in a processor, as shown in fig. 3, where the method specifically includes:
step 310, obtaining a primary data packet subset and a redundant data packet subset received for a primary data packet set and a redundant data packet set sent by a sending end.
The IP network is a best effort network, and the reliability of transceiving cannot be guaranteed during UDP transmission, and network packet loss and delay conditions are unavoidable. Therefore, when the receiving end receives the original data packet set and the redundant data packet set sent by the sending end, packet loss inevitably exists. The original data packet subset is a subset of the original data packet set and may include all or part of original data packets in the original data packet set; or may not contain any original data packet, i.e. be an empty set. Similarly, the redundant data packet subset is a subset of the redundant data packet set, and may include all or part of the redundant data packets in the redundant data packet set; or may not contain any redundant data packet, i.e. be an empty set. The description of the original data packet and the redundant data packet is the same as the previous embodiment, and will not be described herein.
And 320, performing data restoration on the original data packet set according to the original data packet subset and the redundant data packet subset.
The receiving end can perform data restoration on the original data packet set according to the received original data packet subset and the redundant data packet subset, and if all the original data packets in the original data set can be obtained, the video can be decoded and played. If the receiving end performs data restoration on the original data packet set according to the received original data packet subset and redundant data packet subset, all original data packets in the original data set cannot be obtained, the video cannot be completely decoded, video playing is blocked or damaged, a restoration result can be a restoration failure, and the transmitting end can be instructed to retransmit.
In an optional implementation manner of this embodiment, performing data restoration on the original data packet set according to the original data packet subset and the redundant data packet subset may include the following multiple cases:
the first condition is as follows: and if the original data packet subset is the same as the original data packet set, taking the original data packet subset as a reduction result. The original data packet subset is the same as the original data packet set, which indicates that the original data packet subset contains all original data packets in the original data packet set, and the receiving end can obtain all original data packets in the original data packet set. The original data packet has no packet loss, and the receiving end can successfully restore.
Case two: and if the original data packet subset is different from the original data packet set and the redundant data packet subset is an empty set, taking the original data packet subset and the restoration failure indication as a restoration result. The original data packet subset is different from the original data packet set, which indicates that the original data packet has lost packet and needs to be subjected to RS erasure code recovery. However, the redundant data packet subset is an empty set, which indicates that the original data packet cannot be restored by the redundant data packet, i.e., the lost original data packet cannot be restored by the RS erasure code. Therefore, the receiving end can indicate the restoration failure, so that the transmitting end retransmits the lost original data packet.
Case three: and if the original data packet subset is different from the original data packet set, the redundant data packet subset is not an empty set, and the sum of the data packet quantity in the original data packet subset and the data packet quantity in the redundant data packet subset is less than the preset data packet quantity, taking the original data packet subset and the restoration failure indication as a restoration result. Wherein, in the foregoing embodiment, the second number M of redundant data packets may be represented by a formula
Figure BDA0002737273060000121
And (4) determining. At this time, the packet loss tolerance is M, and when the sum of the number of data packets in the original data packet subset and the redundant data packet subset is less than the preset number of data packets, the receiving end cannot restore the lost original data packets through RS erasure code calculation. The number of the predetermined packets may be K. The receiving end may indicate the restoration failure so that the transmitting end retransmits the lost original data packet.
Case four: and if the original data packet subset is different from the original data packet set, the redundant data packet subset is not an empty set, and the sum of the data packet quantity in the original data packet subset and the data packet quantity in the redundant data packet subset is not less than the preset data packet quantity, performing RS erasure code reduction according to the original data packet subset and the redundant data packet subset, and taking the reduced data packet set and the original data packet subset obtained by reduction as a reduction result. The sum of the number of the data packets in the original data packet subset and the number of the data packets in the redundant data packet subset is not less than the preset number of the data packets, and the receiving end can restore the lost original data packets as a restored data packet set through the RS erasure codes. And aiming at the reduced data packet set and the original data packet subset, the receiving end obtains all original data packets in the original data packet set.
When the receiving end restores the lost original data packet through the RS erasure code, the lost original data packet can be obtained firstAnd correspondingly regulating the data packets, and then obtaining the original data packets through the regulated data packets. The specific process of obtaining the original data packet by the regular data packet may be a reduction in a manner opposite to the regular data packet generation. For example, the self data length L of the regular data packet can be determined according to the self data length value of the last 2 bytes in the load information in the regular data packetk. According to LkThe front L in the load informationkThe data of the bytes is determined as the load information of the original data packet. And determining the header information in the regular data packet as the header information of the original data packet.
To specifically describe the RS erasure code recovery and normalization of the data packets, in an optional implementation manner of this embodiment, the performing RS erasure code recovery according to the original data packet subset and the redundant data packet subset includes: respectively determining the matrix positions of the data packets in the original data packet subset and the redundant data packet subset in the RS erasure codes according to the first packet sequence number and the second packet sequence number in the redundant data packets in the redundant data packet subset; and according to the determined matrix position, the original data packet subset and the redundant data packet subset, performing RS erasure code matrix calculation to obtain a recovery data packet set.
The sending end may generate the redundant data packet through matrix operation according to the sequence related to the RTP sequence numbers of the data packets, for example, determine the matrix position according to the sequence of the RTP sequence numbers. The receiving end can respectively determine the matrix positions of the data packets in the original data packet subset and the redundant data packet subset through the first packet sequence number and the second packet sequence number. For example, the receiving end determines the matrix position of each original data packet in the original data packet subset according to the front-back sequence of the RTP sequence number according to the initial packet sequence number and the packet bitmap data in the first packet sequence number. And the receiving end determines the matrix position of each redundant data packet in the redundant data packet subset according to the front-back sequence of the RTP serial number according to the recorded initial serial number of the redundant data packet and the second packet serial number of each redundant data packet in the redundant data packet subset.
Illustratively, the start packet sequence number is 2314 and the packet bitmap data is 10001111. The RTP sequence numbers of each original data packet in the original data packet subset are as follows in sequence: 2314, 2319, 2320 and 2321. According to the initial packet sequence number and the packet bitmap data, the RTP sequence numbers of all the original data packets in the original data packet set can be determined to be: 2314, 2318, 2319, 2320 and 2321. The matrix positions of each original data packet in the original data packet subset can be determined according to the front-back sequence of the RTP sequence numbers as follows: 2314 at column 1 (or row) of the matrix, 2319 at column 3 (or row) of the matrix, 2320 at column 4 (or row) of the matrix, 2321 at column 5 (or row) of the matrix. The original data packet with RTP sequence number 2318, i.e. the 2 nd column (or row) data of the matrix, is lost.
In this embodiment, the procedure of recovering the lost original data packet by the receiving end through the RS erasure code may be as follows: first, the receiving end may determine K and M according to any redundant data packet in the redundant data packet subset. Secondly, the receiving end subtracts the data length of the private header information according to the data length of the load information of any redundant data packet to obtain Lk。LkL is obtained by subtracting a predetermined data length (e.g., 2 bytes)max. Then, a corresponding regular data packet is generated according to the original data packet in the received original data packet subset (in the same way as the transmitting end generates the regular data packet from the original data packet). According to the determined load information X of each regular data packetkInformation Y actually transmitted in the payload information of each redundant data packet in the redundant data packet subsetmAnd determining the matrix position, K and M of each data packet, performing RS erasure code matrix calculation, and determining the lost regular data packet. And determining the matrix position of the original data packet, wherein the determined matrix position of the original data packet is the matrix position of the corresponding regular data packet. Finally, the receiving end restores the load information X of the regular data packet corresponding to the lost original data packetk、LkAnd LmaxThe load information V of the lost original data packet can be obtainedkAnd successfully receiving the video data, decoding the video and realizing smooth playing.
To specifically describe a specific process of determining a feedback result according to a received restoration result to enable a sending end to perform a next operation, in an optional implementation manner of this embodiment, after performing data restoration on an original data packet set according to an original data packet subset and a redundant data packet subset, the method further includes: if the reduction result contains a reduction failure indication, determining a lost data packet according to a first packet sequence number in the redundant data packet subset and a packet sequence number of an original data packet in the original data packet subset; and sending a retransmission request to the sending end according to the lost data packet so that the sending end transmits the lost data packet.
When the receiving end can restore all original data packets in the original data packet set, the receiving end can continue to process the subsequently received data packets. If the receiving end cannot recover all the original data packets in the original data packet set, that is, if the recovery result of the receiving end contains the recovery failure indication information, the receiving end may determine the RTP sequence number of the lost original data packet, for example, according to the first packet sequence number and the RTP sequence number of the received original data packet. The receiving end may define the original data packets corresponding to the RTP sequence numbers of all the lost original data packets in the transmission of the original data packet set of the current group as a lost data packet set. The retransmission request contains all RTP sequence numbers of the missing data packet set.
In an optional implementation manner of this embodiment, after sending a retransmission request to the sending end according to a lost packet, the method further includes: acquiring a new original data packet subset and a new redundant data packet subset which are received by a new original data packet set to be sent by a sending end and a new redundant data packet set corresponding to the new original data packet set; according to the lost data packet subset, the original data packet subset and the redundant data packet subset in the new original data packet subset, carrying out data restoration on the original data packet set; or, performing data restoration on the original data packet set according to the new original data packet subset and the new redundant data packet subset.
If the receiving end feeds back the retransmission request, the transmission of the original data packet set of the current group is not finished, and a part or all of the original data packets at the receiving end cannot be restored, the transmitting end needs to retransmit the lost data packet set.
The retransmission of a lost data packet set by a transmitting end is divided into at least two cases. One retransmission is that the sending end generates a new redundant data packet set corresponding to the new regular data packet set according to the lost data packet set. The other retransmission is that the sending end generates a new original data packet set to be sent according to the lost data packet set and the next original data packet set, and generates a new redundant data packet set corresponding to the new regular data packet set according to the new original data packet set. In order to avoid duplicate definition, for both retransmission cases, the data packets received by the receiving end are defined as a new original data packet subset and a new redundant data packet subset, which are respectively a new original data packet set and a subset of a new redundant data packet set.
In the first retransmission, the receiving end may restore the lost data packet set according to the new original data packet subset and the new redundant data packet subset, and the specific process is the same as that of restoring the original data packet according to the original data packet subset and the redundant data packet subset. Or, the receiving end may restore the lost data packet set according to the lost data packet subset, the original data packet subset, and the redundant data packet subset in the new original data packet subset, and during the restoration, may fill in the load information of the regular data packets corresponding to the original data packets in the lost data packet subset in the matrix to perform the RS erasure code matrix calculation. At this time, the load information of the regular data packet corresponding to the original data packet is determined according to the parameters when the original data packet set generates the corresponding regular data packet set, but not according to the parameters when the new original data packet set generates the new regular data packet set. The technical scheme of the embodiment provides a plurality of recovery modes of the lost data packet set, and the recovery success probability is improved.
During the second retransmission, the receiving end can also adopt a similar restoring mode to the first retransmission, and the second retransmission can reduce the sending times of the sending end, avoid the sending end from sending the lost data packet set at least once independently, and reduce the time delay during real-time video transmission.
In order to improve the success probability of restoring the lost data packet set in the embodiment, the retransmission times are reduced. When the sum of the number of the lost data packet subsets in the new original data packet subset, the number of the data packets in the original data packet subset and the number of the data packets in the redundant data packet subset is not less than the preset number of the data packets, the receiving end can restore the lost data packet set according to the lost data packet subset, the original data packet subset and the redundant data packet subset in the new original data packet subset. And when the sum of the number of the lost data packet subsets in the new original data packet subsets, the number of the data packets in the original data packet subsets and the number of the data packets in the redundant data packet subsets is less than the preset number of the data packets, the receiving end restores the lost data packet sets according to the new original data packet subsets and the new redundant data packet subsets.
According to the technical scheme of the embodiment, an original data packet subset and a redundant data packet subset received by an original data packet set and a redundant data packet set sent by a sending end are obtained; according to the original data packet subset and the redundant data packet subset, data restoration is carried out on the original data packet set, the problem of restoration of lost data packets in real-time video communication is solved, the successful probability of restoration is improved, time delay in real-time video transmission is reduced, and the retransmission times are reduced.
Example four
Fig. 4 is a schematic structural diagram of a data packet transmission apparatus according to a fourth embodiment of the present invention. With reference to fig. 4, the apparatus comprises: an original data packet set obtaining module 410, a regular data packet set generating module 420, a redundant data packet set generating module 430 and an original data packet set determining module 440.
The original data packet set obtaining module 410 is configured to obtain an original data packet set to be sent;
a regular data packet set generating module 420, configured to perform data packet length normalization processing on each original data packet in the original data packet set, so as to obtain a regular data packet set;
a redundant data packet set generating module 430, configured to generate a redundant data packet set matching the regular data packet set through RS erasure code coding;
the original data packet set determining module 440 is configured to send the original data packet set and the redundant data packet set to a receiving end, and determine a new original data packet set to be sent.
Optionally, the regular data packet set generating module 420 includes:
the maximum data length determining unit is used for determining the maximum data length of the original data packet set according to the data length of each original data packet in the original data packet set;
the target data length determining unit is used for determining the target data length according to the maximum data length and the preset data length;
and the regular data packet set acquisition unit is used for respectively filling data in each original data packet to obtain a regular data packet set, and the data length of each regular data packet is the target data length.
Optionally, the regular packet set obtaining unit is specifically configured to:
respectively filling preset data in data positions corresponding to the data length of each original data packet from the data length to the maximum data length;
and respectively filling the data length value of each original data packet from the maximum data length of each original data packet to the data position corresponding to the target data length to obtain a regular data packet set.
Optionally, the redundant data packet set generating module 430 includes:
a second quantity value determining unit, configured to determine a second quantity value of the redundant data packets in the redundant data packet set according to a packet loss rate of the network and the first quantity value of the original data packets in the original data packet set;
the redundant data packet generating unit is used for generating a redundant data packet with a second numerical value according to the regular data packet in the regular data packet set corresponding to the original data packet set;
and the content filling unit is used for adding the first numerical value and the second numerical value into each redundant data packet to generate a first packet sequence number of an original data packet in an original data packet set used by the redundant data packet and a second packet sequence number of the redundant data packet.
Optionally, the content filling unit is specifically configured to:
determining the initial packet sequence number of an original data packet in an original data packet set;
determining packet bitmap data according to the initial packet sequence number and the packet sequence number of the original data packet in the original data packet set;
the packet bitmap data is used for indicating the sending condition of an original data packet in an original data packet set;
and adding the initial packet sequence number and the packet bitmap data into each redundant data packet as a first packet sequence number.
Optionally, the original data packet set determining module 440 includes:
a lost data packet obtaining unit, configured to, if a retransmission request from a receiving end is received, obtain a lost data packet included in the retransmission request;
and the original data packet set determining unit is used for determining a new original data packet set to be sent according to the lost data packet, and then returning to execute the operation of carrying out data packet length normalization processing on each original data packet in the original data packet set to obtain a normalized data packet set.
Optionally, the original data packet set determining unit is specifically configured to:
and determining the lost data packet and the original data packet set to be sent next as a new original data packet set to be sent.
Optionally, the original data packet is an RTP packet.
The data packet transmission device provided by the embodiment of the invention can execute the data packet transmission method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
EXAMPLE five
Fig. 5 is a schematic structural diagram of a data packet transmission apparatus according to a fifth embodiment of the present invention. With reference to fig. 5, the apparatus comprises: a packet subset acquisition module 510 and a data restoration module 520.
A data packet subset obtaining module 510, configured to obtain a primary data packet subset and a redundant data packet subset received for a primary data packet set and a redundant data packet set sent by a sending end;
and a data restoring module 520, configured to restore data of the original data packet set according to the original data packet subset and the redundant data packet subset.
Optionally, the data restoring module 520 includes:
the first restoration unit is used for taking the original data packet subset as a restoration result if the original data packet subset is the same as the original data packet set;
the second restoration unit is used for taking the original data packet subset and restoration failure indication as restoration results if the original data packet subset is different from the original data packet set and the redundant data packet subset is an empty set;
a third restoring unit, configured to take the original data packet subset and a restoration failure indication as a restoration result if the original data packet subset is different from the original data packet set, the redundant data packet subset is not an empty set, and a sum of data packet numbers in the original data packet subset and the redundant data packet subset is less than a preset data packet number;
and the fourth restoring unit is used for performing RS erasure code restoration according to the original data packet subset and the redundant data packet subset if the original data packet subset is different from the original data packet subset, the redundant data packet subset is not an empty set, and the sum of the number of the data packets in the original data packet subset and the redundant data packet subset is not less than the preset number of the data packets, and using the restored data packet set and the original data packet subset obtained through restoration as restoration results.
Optionally, the fourth reduction unit is specifically configured to:
respectively determining the matrix positions of the data packets in the original data packet subset and the redundant data packet subset in the RS erasure codes according to the first packet sequence number and the second packet sequence number in the redundant data packets in the redundant data packet subset;
and according to the determined matrix position, the original data packet subset and the redundant data packet subset, performing RS erasure code matrix calculation to obtain a recovery data packet set.
Optionally, the apparatus further includes:
a lost data packet determining module, configured to determine a lost data packet according to a first packet sequence number in a redundant data packet in the redundant data packet subset and a packet sequence number of an original data packet in the original data packet subset if a reduction result includes a reduction failure indication after performing data reduction on the original data packet set according to the original data packet subset and the redundant data packet subset;
and the retransmission request sending module is used for sending a retransmission request to the sending end according to the lost data packet so that the sending end can transmit the lost data packet.
Optionally, the apparatus further includes:
a new data packet subset obtaining module, configured to obtain, after sending a retransmission request to a sending end according to a lost data packet, a new original data packet subset and a new redundant data packet subset received for a new original data packet set to be sent and a new redundant data packet set corresponding to the new original data packet set sent by the sending end;
the new first data restoration module is used for restoring the data of the original data packet set according to the lost data packet subset, the original data packet subset and the redundant data packet subset in the new original data packet subset; alternatively, the first and second electrodes may be,
and the new second data restoration module is used for restoring the data of the original data packet set according to the new original data packet subset and the new redundant data packet subset.
The data packet transmission device provided by the embodiment of the invention can execute the data packet transmission method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
EXAMPLE six
Fig. 6 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present invention, and as shown in fig. 6, the electronic device includes:
one or more processors 610, one processor 610 being exemplified in fig. 6;
a memory 620;
the apparatus may further include: an input device 630 and an output device 640.
The processor 610, the memory 620, the input device 630 and the output device 640 of the apparatus may be connected by a bus or other means, and fig. 6 illustrates the example of connection by a bus.
The memory 620, as a non-transitory computer-readable storage medium, may be used to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to a packet transmission method in the embodiment of the present invention (for example, the original packet set obtaining module 410, the regular packet set generating module 420, the redundant packet set generating module 430, and the original packet set determining module 440 shown in fig. 4; or the packet subset obtaining module 510 and the data restoring module 520 shown in fig. 5). The processor 610 executes various functional applications and data processing of the computer device by executing the software programs, instructions and modules stored in the memory 620, namely, implementing a transmission method of data packets of the above method embodiments, that is:
acquiring an original data packet set to be sent;
carrying out data packet length normalization processing on each original data packet in the original data packet set to obtain a normalized data packet set;
generating a redundant data packet set matched with the regular data packet set through RS erasure code coding;
and sending the original data packet set and the redundant data packet set to a receiving end, and determining a new original data packet set to be sent.
Alternatively, the first and second electrodes may be,
acquiring an original data packet subset and a redundant data packet subset received by an original data packet set and a redundant data packet set sent by a sending end;
and performing data restoration on the original data packet set according to the original data packet subset and the redundant data packet subset.
The memory 620 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the computer device, and the like. Further, the memory 620 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 620 optionally includes memory located remotely from processor 610, which may be connected to the terminal device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input means 630 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the computer apparatus. The output device 640 may include a display device such as a display screen.
EXAMPLE seven
The seventh embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a data packet transmission method according to the seventh embodiment of the present invention:
acquiring an original data packet set to be sent;
carrying out data packet length normalization processing on each original data packet in the original data packet set to obtain a normalized data packet set;
generating a redundant data packet set matched with the regular data packet set through RS erasure code coding;
and sending the original data packet set and the redundant data packet set to a receiving end, and determining a new original data packet set to be sent.
Alternatively, the first and second electrodes may be,
acquiring an original data packet subset and a redundant data packet subset received by an original data packet set and a redundant data packet set sent by a sending end;
and performing data restoration on the original data packet set according to the original data packet subset and the redundant data packet subset.
Any combination of one or more computer-readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (15)

1. A method for transmitting a data packet, comprising:
acquiring an original data packet set to be sent;
carrying out data packet length normalization processing on each original data packet in the original data packet set to obtain a normalized data packet set;
generating a redundant data packet set matched with the regular data packet set through RS erasure code coding;
and sending the original data packet set and the redundant data packet set to a receiving end, and determining a new original data packet set to be sent.
2. The method of claim 1, wherein performing a packet length normalization on each original packet in the original packet set to obtain a normalized packet set, comprises:
determining the maximum data length of the original data packet set according to the data length of each original data packet in the original data packet set;
determining a target data length according to the maximum data length and a preset data length;
and respectively carrying out data filling on each original data packet to obtain a regular data packet set, wherein the data length of each regular data packet is the target data length.
3. The method of claim 2, wherein separately data-stuffing each of the original data packets to obtain a regular data packet set comprises:
respectively filling preset data in the data position corresponding to the data length from the original data packet to the maximum data length;
and filling the self data length value of each original data packet into the data position corresponding to the maximum data length to the target data length of each original data packet to obtain the regular data packet set.
4. The method of claim 1, wherein generating a set of redundant data packets matching the set of regular data packets by RS erasure coding comprises:
determining a second numerical value of redundant data packets in the redundant data packet set according to the packet loss rate of the network and the first numerical value of the original data packets in the original data packet set;
generating the redundant data packets of the second numerical value according to regular data packets in the regular data packet set corresponding to the original data packet set;
and adding the first numerical value and the second numerical value into each redundant data packet to generate a first packet sequence number of an original data packet in the original data packet set used by the redundant data packet and a second packet sequence number of the redundant data packet.
5. The method of claim 4, wherein adding to each of the redundant data packets a first packet sequence number of an original data packet in the original data packet set used to generate the redundant data packet comprises:
determining the initial packet sequence number of the original data packet in the original data packet set;
determining packet bitmap data according to the initial packet sequence number and the packet sequence number of the original data packet in the original data packet set;
wherein the packet bitmap data is used for indicating the transmission condition of the original data packet in the original data packet set;
and adding the initial packet sequence number and the packet bitmap data as the first packet sequence number into each redundant data packet.
6. The method of claim 1, wherein determining a new set of original packets to be transmitted comprises:
if a retransmission request of the receiving end is received, acquiring a lost data packet included in the retransmission request;
and according to the lost data packet, after determining a new original data packet set to be sent, returning to execute the operation of carrying out data packet length normalization processing on each original data packet in the original data packet set to obtain a normalized data packet set.
7. The method of claim 6, wherein determining a new set of original packets to be sent based on the missing packets comprises:
and determining the lost data packet and the original data packet set to be sent next as a new original data packet set to be sent.
8. The method according to any of claims 1-7, wherein the original data packets are real-time transport protocol RTP packets.
9. A method for transmitting a data packet, comprising:
acquiring an original data packet subset and a redundant data packet subset received by an original data packet set and a redundant data packet set sent by a sending end;
and performing data restoration on the original data packet set according to the original data packet subset and the redundant data packet subset.
10. The method of claim 9, wherein performing data recovery on the set of original packets according to the subset of original packets and the subset of redundant packets comprises:
if the original data packet subset is the same as the original data packet set, taking the original data packet subset as a reduction result;
if the original data packet subset is different from the original data packet set and the redundant data packet subset is an empty set, taking the original data packet subset and a restoration failure indication as a restoration result;
if the original data packet subset is different from the original data packet set, the redundant data packet subset is not an empty set, and the sum of the number of data packets in the original data packet subset and the redundant data packet subset is less than the preset number of data packets, taking the original data packet subset and a restoration failure indication as a restoration result;
and if the original data packet subset is different from the original data packet set, the redundant data packet subset is not an empty set, and the sum of the data packet quantity in the original data packet subset and the data packet quantity in the redundant data packet subset is not less than the preset data packet quantity, performing RS erasure code reduction according to the original data packet subset and the redundant data packet subset, and taking the reduced data packet set obtained by reduction and the original data packet subset as a reduction result.
11. The method of claim 10, wherein performing RS erasure code recovery based on the subset of original data packets and the subset of redundant data packets comprises:
determining matrix positions of data packets in the original data packet subset and the redundant data packet subset in the RS erasure codes respectively according to a first packet sequence number and a second packet sequence number in the redundant data packets in the redundant data packet subset;
and according to the determined matrix position, the original data packet subset and the redundant data packet subset, performing RS erasure code matrix calculation to obtain a recovery data packet set.
12. The method of claim 10, further comprising, after performing data recovery on the original set of data packets according to the original subset of data packets and the redundant subset of data packets:
if the reduction result contains a reduction failure indication, determining a lost data packet according to a first packet sequence number in a redundant data packet in the redundant data packet subset and a packet sequence number of an original data packet in the original data packet subset;
and sending a retransmission request to the sending end according to the lost data packet so that the sending end transmits the lost data packet.
13. The method of claim 12, further comprising, after sending a retransmission request to the sender based on the missing data packet:
acquiring a new original data packet subset and a new redundant data packet subset received by a new original data packet set to be sent and a new redundant data packet set corresponding to the new original data packet set, wherein the new original data packet set is sent by the sending end;
performing data restoration on the original data packet set according to the lost data packet subset, the original data packet subset and the redundant data packet subset in the new original data packet subset; alternatively, the first and second electrodes may be,
and performing data restoration on the original data packet set according to the new original data packet subset and the new redundant data packet subset.
14. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8; alternatively, the method of any one of claims 9-13.
15. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method according to any one of claims 1 to 8; alternatively, the method of any one of claims 9-13.
CN202011137904.0A 2020-10-22 2020-10-22 Data packet transmission method, equipment and storage medium Active CN112804028B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011137904.0A CN112804028B (en) 2020-10-22 2020-10-22 Data packet transmission method, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011137904.0A CN112804028B (en) 2020-10-22 2020-10-22 Data packet transmission method, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112804028A true CN112804028A (en) 2021-05-14
CN112804028B CN112804028B (en) 2023-04-07

Family

ID=75806200

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011137904.0A Active CN112804028B (en) 2020-10-22 2020-10-22 Data packet transmission method, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112804028B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114039703A (en) * 2021-11-26 2022-02-11 北京字节跳动网络技术有限公司 Data transmission method, device, equipment and medium
CN114584847A (en) * 2022-02-22 2022-06-03 广州广哈通信股份有限公司 Data transmission method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020131443A1 (en) * 1998-01-14 2002-09-19 Robert Robinett Bandwidth optimization of video program bearing transport streams
CN102025717A (en) * 2010-09-10 2011-04-20 香港城市大学深圳研究院 Method for transmitting multimedia data
CN105245470A (en) * 2015-11-05 2016-01-13 深圳市网心科技有限公司 Data transmission method and device
CN106937134A (en) * 2015-12-31 2017-07-07 深圳市潮流网络技术有限公司 A kind of coding method of data transfer, coding dispensing device and system
CN109547467A (en) * 2018-12-19 2019-03-29 北京东土科技股份有限公司 Media data error correction transmission and error correction method, device, equipment and storage medium
CN110943800A (en) * 2019-11-06 2020-03-31 厦门亿联网络技术股份有限公司 Method, device and system for sending data packet, storage medium and electronic device
CN111629280A (en) * 2020-04-13 2020-09-04 视联动力信息技术股份有限公司 Packet loss processing method and device and readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020131443A1 (en) * 1998-01-14 2002-09-19 Robert Robinett Bandwidth optimization of video program bearing transport streams
CN102025717A (en) * 2010-09-10 2011-04-20 香港城市大学深圳研究院 Method for transmitting multimedia data
CN105245470A (en) * 2015-11-05 2016-01-13 深圳市网心科技有限公司 Data transmission method and device
CN106937134A (en) * 2015-12-31 2017-07-07 深圳市潮流网络技术有限公司 A kind of coding method of data transfer, coding dispensing device and system
CN109547467A (en) * 2018-12-19 2019-03-29 北京东土科技股份有限公司 Media data error correction transmission and error correction method, device, equipment and storage medium
CN110943800A (en) * 2019-11-06 2020-03-31 厦门亿联网络技术股份有限公司 Method, device and system for sending data packet, storage medium and electronic device
CN111629280A (en) * 2020-04-13 2020-09-04 视联动力信息技术股份有限公司 Packet loss processing method and device and readable storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114039703A (en) * 2021-11-26 2022-02-11 北京字节跳动网络技术有限公司 Data transmission method, device, equipment and medium
CN114039703B (en) * 2021-11-26 2023-10-20 北京字节跳动网络技术有限公司 Data transmission method, device, equipment and medium
CN114584847A (en) * 2022-02-22 2022-06-03 广州广哈通信股份有限公司 Data transmission method
CN114584847B (en) * 2022-02-22 2023-11-28 广州广哈通信股份有限公司 Data transmission method

Also Published As

Publication number Publication date
CN112804028B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
JP4002183B2 (en) Method for multimedia communication over a packet channel
CN110943800B (en) Data packet sending method, device and system, storage medium and electronic device
EP2437421B1 (en) Method, device and communication system for retransmitting based on forward error correction
US10348454B2 (en) Error resilience for interactive real-time multimedia application
US8397140B2 (en) Error correction coding for recovering multiple packets in a group view of limited bandwidth
CN112804028B (en) Data packet transmission method, equipment and storage medium
CN106105141A (en) Realize the delivery acceleration device of extension transmission control function
KR101118194B1 (en) Method for lost packet reconstruction and device for carrying out said method
CN110383728A (en) Use the system and method for outer code and non-isometric code block
CN112995685B (en) Data transmitting method and device, data receiving method and device, medium and equipment
CN111181700A (en) Data transmission method and device, electronic equipment and storage medium
CN112350803B (en) Data packet transmission method, device and system, electronic equipment and storage medium
JP2014528682A (en) Apparatus and method for transmitting / receiving forward error correction packet in mobile communication system
KR102002939B1 (en) On-demand file recovery methods and systems
CN110545161B (en) Multimedia data real-time transmission method with redundancy
US10116415B2 (en) Transmission device, receiving device, transmission method, and receiving method
CN116318545A (en) Video data transmission method, device, equipment and storage medium
JP2010034898A (en) Data transmission apparatus and data transmission method
KR102021872B1 (en) Raptor-q encoding apparatus with improved encoding delay time and method thereof
CN108769000B (en) High-efficiency streaming media transmission method for deep space environment
US9167279B2 (en) Method for payload formatting and deformatting for burst loss recovery
CN112954255B (en) Video conference code stream transmission method, device, computer equipment and storage medium
CN114567799B (en) Video stream data transmission method and device, storage medium and electronic equipment
CN112671784A (en) Data transmission method, device, equipment and storage medium
CN117675118A (en) Audio and video transmission packet loss recovery method, device, equipment and storage medium

Legal Events

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