CN114793146A - Data receiving method, data sending method and related equipment - Google Patents

Data receiving method, data sending method and related equipment Download PDF

Info

Publication number
CN114793146A
CN114793146A CN202110105149.6A CN202110105149A CN114793146A CN 114793146 A CN114793146 A CN 114793146A CN 202110105149 A CN202110105149 A CN 202110105149A CN 114793146 A CN114793146 A CN 114793146A
Authority
CN
China
Prior art keywords
data
error correction
forward error
sending
receiving
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110105149.6A
Other languages
Chinese (zh)
Inventor
郁新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TP Link Technologies Co Ltd
Original Assignee
TP Link Technologies 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 TP Link Technologies Co Ltd filed Critical TP Link Technologies Co Ltd
Priority to CN202110105149.6A priority Critical patent/CN114793146A/en
Publication of CN114793146A publication Critical patent/CN114793146A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0045Arrangements at 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/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0041Arrangements at the transmitter end

Abstract

The application is applicable to the technical field of data transmission, and provides a data receiving method, a data sending method and related equipment. The data receiving method comprises the steps of judging whether a forward error correction condition is met or not when the received data are detected to have data abnormality, carrying out forward error correction coding on a data stream to be sent by a sending end and packaging the data to obtain the data, and recovering the abnormal data by adopting a forward error correction mode if the forward error correction condition is met; if the condition of forward error correction is not met, a negative response data packet is sent to the sending end according to the abnormal data, and the sending end is used for retransmitting the abnormal data according to the negative response data packet, so that the data retransmission times can be reduced, the data transmission time delay is reduced, and the data transmission real-time performance is improved.

Description

Data receiving method, data sending method and related equipment
Technical Field
The present application belongs to the technical field of data transmission, and in particular, to a data receiving method, a data sending method, and a related device.
Background
In the Transmission process of data stream, common Transmission protocols are generally Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). As a reliable protocol, TCP can take into account integrity and real-time of transmitted data when transmitting data streams under the condition of smooth network, but once the network has jitter or low bandwidth, a TCP link is easily congested, and the data transmission rate is rapidly reduced. Meanwhile, as TCP has larger cache at the sending end and the receiving end, the time delay of data transmission is greatly increased, and the real-time property of data transmission is reduced. UDP is an unreliable protocol, and when data stream transmission is performed using UDP, an upper layer must ensure accuracy of data, and the upper layer ensures accuracy of data by retransmitting abnormal data, but directly retransmitting data reduces real-time performance of data transmission.
Disclosure of Invention
In view of this, embodiments of the present application provide a data receiving method, a data sending method, and a related device, which can improve real-time performance of data transmission.
A first aspect of the embodiments of the present application provides a data receiving method, which is applied to a receiving end, where the data receiving method includes:
when detecting that data abnormality exists in received data, judging whether the data meets a forward error correction condition, wherein the data is obtained by performing forward error correction coding on a data stream to be sent by a sending end and packaging;
if the data meets the forward error correction condition, recovering abnormal data in a forward error correction mode;
and if the data does not meet the forward error correction condition, sending a negative response data packet to the sending end according to the abnormal data, wherein the sending end is used for retransmitting the abnormal data according to the negative response data packet.
In a possible implementation manner, after the sending, to the sending end, a negative acknowledgement data packet according to the abnormal data, the data receiving method further includes:
and if the abnormal data retransmitted by the sending end is not received within the preset time, sending retransmission failure information to the sending end, wherein the sending end is used for stopping retransmitting the abnormal data according to the retransmission failure information.
In a possible implementation manner, the data receiving method further includes:
and periodically sending data receiving information to the sending end according to a preset period, wherein the data receiving information comprises any one or more of data abnormal information, error correction information of a forward error correction mode and the sending times of the negative acknowledgement data packet, and the sending end is used for adjusting the code rate of the data stream to be sent and/or adjusting the redundancy ratio of the forward error correction code according to the data receiving information.
In a possible implementation manner, before the determining whether the received data has the data anomaly and the forward error correction condition is met, the data receiving method further includes:
and receiving the data sent by the sending end through UDP.
A second aspect of the embodiments of the present application provides a data transmission method, applied to a transmitting end, where the data transmission method includes:
carrying out forward error correction coding and packaging on a data stream to be sent to obtain corresponding data, and sending the data to a receiving end;
if a negative response data packet sent by the receiving end is received, retransmitting abnormal data according to the negative response data packet, wherein the negative response data packet is sent when the receiving end detects that the received data has data abnormality and the data does not meet the forward error correction condition.
In a possible implementation manner, after retransmitting the abnormal data according to the negative acknowledgement data packet, the data transmission method further includes:
and if receiving retransmission failure information or reaching a preset retransmission frequency, stopping retransmitting the abnormal data, wherein the retransmission failure information is sent when the receiving end does not receive the abnormal data within a preset time.
In a possible implementation manner, after the sending the encapsulated data to a receiving end, the data sending method further includes:
and acquiring data receiving information sent by the receiving end, wherein the data receiving information comprises any one or more of data abnormal information, error correction information of a forward error correction mode and the sending times of the negative response data packet, and adjusting the code rate of the data stream to be sent according to the data receiving information.
In a possible implementation manner, the adjusting a code rate of the data stream to be transmitted according to the data reception information includes:
if the sending times of the negative response data packet are larger than 0, reducing the code rate of the data stream to be sent;
if the sending times of the negative response data packet is equal to 0 and the error correction information of the forward error correction mode is error correction failure, the code rate of the data stream to be sent is not changed;
and if the sending times of the negative response data packet is equal to 0 and the error correction information of the forward error correction mode is successful, improving the code rate of the data stream to be sent.
In a possible implementation manner, after the obtaining of the data receiving information sent by the receiving end, the data sending method further includes:
and adjusting the redundancy ratio of the forward error correction coding according to the data receiving information.
A third aspect of an embodiment of the present application provides a data receiving apparatus, including:
the judging module is used for judging whether the data meet forward error correction conditions or not when the received data are detected to have data abnormality, and the data are obtained by carrying out forward error correction coding and packaging on a data stream to be sent by a sending end;
the first processing module is used for recovering abnormal data by adopting a forward error correction mode if the data meets the forward error correction condition;
and a second processing module, configured to send a negative acknowledgement data packet to the sending end according to the abnormal data if the data does not satisfy the forward error correction condition, where the sending end is configured to retransmit the abnormal data according to the negative acknowledgement data packet.
In a possible implementation manner, the second processing module is further configured to, where the data receiving method further includes:
and if the abnormal data retransmitted by the sending end is not received within the preset time, sending retransmission failure information to the sending end, wherein the sending end is used for stopping retransmitting the abnormal data according to the retransmission failure information.
In one possible implementation manner, the data receiving apparatus further includes:
the feedback module is configured to periodically send data receiving information to the sending end according to a preset period, where the data receiving information includes any one or more of data exception information, error correction information of a forward error correction mode, and the sending frequency of the negative acknowledgement data packet, and the sending end is configured to adjust a code rate of the data stream to be sent and/or adjust a redundancy ratio of the forward error correction code according to the data receiving information.
In one possible implementation manner, the data receiving apparatus further includes:
and the receiving module is used for receiving the data sent by the sending end through UDP.
A fourth aspect of the embodiments of the present application provides a data transmission apparatus, including:
the transmitting module is used for carrying out forward error correction coding and packaging on a data stream to be transmitted to obtain corresponding data and transmitting the data to a receiving end;
and a retransmission module, configured to retransmit abnormal data according to a negative acknowledgement data packet sent by the receiving end if the negative acknowledgement data packet is received, where the negative acknowledgement data packet is sent by the receiving end when the receiving end detects that the received data has data abnormality and the data does not satisfy a forward error correction condition.
In one possible implementation, the retransmission module is further configured to:
and if receiving retransmission failure information or reaching a preset retransmission frequency, stopping retransmitting the abnormal data, wherein the retransmission failure information is sent when the receiving end does not receive the abnormal data within a preset time.
In one possible implementation manner, the data sending apparatus further includes:
and the adjusting module is configured to acquire data receiving information sent by the receiving end, where the data receiving information includes any one or more of data exception information, error correction information of the forward error correction mode, and the sending times of the negative acknowledgement data packet, and adjust the code rate of the data stream to be sent according to the data receiving information.
In a possible implementation manner, the adjusting module is specifically configured to:
if the sending times of the negative response data packet are larger than 0, reducing the code rate of the data stream to be sent;
if the sending times of the negative response data packet is equal to 0 and the error correction information of the forward error correction mode is error correction failure, the code rate of the data stream to be sent is not changed; and if the sending times of the negative response data packet are equal to 0 and the error correction information of the forward error correction mode is successful, improving the code rate of the data stream to be sent.
In one possible implementation, the adjusting module is further configured to:
and adjusting the redundancy ratio of the forward error correction coding according to the data receiving information.
A fifth aspect of embodiments of the present application provides a communication device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the data receiving method according to the first aspect or the data transmitting method according to the second aspect is implemented.
A sixth aspect of embodiments of the present application provides a computer-readable storage medium, which stores a computer program that, when executed by a processor, implements the data receiving method according to the first aspect or the data transmitting method according to the second aspect.
A seventh aspect of embodiments of the present application provides a computer program product, which, when run on a communication device, causes the communication device to execute the data receiving method according to the first aspect or the data sending method according to the second aspect.
Compared with the prior art, the embodiment of the application has the beneficial effects that: when detecting that the received data has data abnormality, the receiving end judges whether the condition of forward error correction is met. If the condition of forward error correction is met, indicating that the abnormal data are less, recovering the abnormal data by adopting a forward error correction mode; if the condition of forward error correction is not met, the abnormal data are more, and the abnormal data cannot be recovered by adopting a forward error correction mode, a negative response data packet is sent to the sending end according to the abnormal data, and the sending end is used for retransmitting the abnormal data according to the negative response data packet. The data received by the receiving end is obtained by the transmitting end after the data stream to be transmitted is subjected to forward error correction coding and packaging, so that when the receiving end detects that the received data has data abnormality, the receiving end can judge whether the received data meets forward error correction conditions, and further, the receiving end adopts a forward error correction mode to recover the data under the condition that the data can be recovered through the forward error correction mode, and sends a negative response data packet under the condition that the data cannot be recovered through the forward error correction mode. Compared with the method for directly sending the negative response data packet when the data abnormity exists, the method can reduce the data retransmission times, reduce the data transmission time delay caused by data retransmission and improve the real-time property of data transmission.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the embodiments or the description of the prior art will be briefly described below.
Fig. 1 is a schematic diagram illustrating an implementation flow of a data receiving method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of data transmission according to an embodiment of the present application;
fig. 3 is a schematic view of an implementation flow of a data transmission method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of data transmission according to another embodiment of the present application;
fig. 5 is a schematic diagram of a data receiving apparatus according to an embodiment of the present application;
fig. 6 is a schematic diagram of a data transmission apparatus according to an embodiment of the present application;
fig. 7 is a schematic diagram of a communication device provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
TCP and UDP are common data transmission protocols, but data transmission is performed according to TCP and UDP, and under the condition that a network is constantly changed, situations of low transmission rate and high delay are likely to occur, and the real-time performance of data transmission is reduced.
Therefore, the data receiving method and the data sending method are provided, and the real-time performance of data transmission can be improved.
The following describes an exemplary data receiving method and data transmitting method provided in the present application.
The data receiving method provided by the embodiment of the application is applied to a data receiving end, and the receiving end can be a mobile phone, a palm computer, a desktop computer, a notebook computer, a server and other communication equipment. The data sending method provided by the embodiment of the application is applied to a sending end of data, and the sending end can be communication equipment such as a mobile phone, a palm computer, a desktop computer, a notebook computer, a server and the like. The following describes a data receiving method and a data transmitting method provided by the present application, taking an example in which a receiving end is a mobile phone and a transmitting end is a server.
Referring to fig. 1, a data receiving method according to an embodiment of the present application includes:
s101: when the received data is detected to have data abnormality, whether the data meets a forward error correction condition or not is judged, and the data is obtained by carrying out forward error correction coding and packaging on a data stream to be sent by a sending end.
Specifically, taking audio/video data as an example, as shown in fig. 2, an audio/video signal to be transmitted is input to an audio/video encoder at a transmitting end, and a data stream to be transmitted is obtained after encoding and data compression. The data stream to be transmitted is input into a Forward Error Correction (FEC) encoder, the FEC encoder performs FEC encoding on the data stream to be transmitted, and an original data packet and a redundant data packet corresponding to the data stream to be transmitted are obtained according to a preset encoding rule. The redundant data packet is generated according to the original data packet and the coding rule, and the abnormal original data packet can be recovered according to the redundant data packet and the decoding rule corresponding to the coding rule. After the original data packet and the redundant data packet are obtained, Real-time Transport Protocol (RTP) encapsulation is performed on the original data packet and the redundant data packet to obtain a corresponding RTP data packet, and the RTP data packet is sent to a receiving end. The RTP data packets are also data corresponding to a data stream to be transmitted, and each RTP data packet carries timestamp information and sequence number information.
In a possible implementation manner, the sending end and the receiving end transmit data through UDP, that is, send RTP data packets through UDP, and compared to TCP, a congestion algorithm of UDP may be dynamically adjusted, so that a transmission policy may be adjusted according to a network state in a data transmission process, and a problem of delay caused by caching more data by the sending end and the receiving end may be reduced, so as to improve real-time performance of data transmission.
Referring to fig. 2, after receiving the RTP packets, the receiving end first determines whether there is abnormal data according to the timestamp information and the sequence number information carried in each RTP packet, where the abnormal data may be lost data or error data. For example, whether or not there is abnormal data may be determined based on whether or not there is a missing sequence number, or whether or not there is abnormal data may be determined based on whether or not there is abnormality in the time stamp information. If no abnormal data exists, the receiving end unpacks the RTP data packet and then directly inputs the RTP data packet into an audio/video decoder, and the audio/video decoder decompresses and decodes the unpacked RTP data packet to obtain audio/video signals. If abnormal data exists, the receiving end unpacks the RTP data packet, judges whether the RTP data packet meets the forward error correction condition, obtains the abnormal data again in different modes according to whether the RTP data packet meets the forward error correction condition so as to complete the receiving of the complete data, and inputs the received complete data into an audio and video decoder for decompression and decoding to obtain audio and video signals.
In a possible implementation manner, the RTP data packets sent by the sending end include a first RTP data packet corresponding to the original data packet and a second RTP data packet corresponding to the redundant data packet. If the number of the RTP data packets received by the receiving end is smaller than that of the first RTP data packets, the abnormal data is more, and the forward error correction condition is not met, otherwise, the abnormal data is less, and the forward error correction condition is met.
S102: and if the data meets the forward error correction condition, recovering abnormal data by adopting a forward error correction mode.
Specifically, when the forward error correction condition is satisfied, the receiving end recovers abnormal data according to a redundant data packet in a received RTP data packet and a decoding rule.
S103: and if the data does not meet the forward error correction condition, sending a negative response data packet to the sending end according to the abnormal data, wherein the sending end is used for retransmitting the abnormal data according to the negative response data packet.
Specifically, if the forward error correction condition is not satisfied, the receiving end determines the sequence number of the abnormal data packet, generates a Negative-acknowledgement (NACK) data packet according to the sequence number of the abnormal data packet, and transmits the NACK data packet to the transmitting end. After receiving the NACK data packet, the sending end determines the serial number of the abnormal data packet according to the NACK data packet, and retransmits the abnormal data packet, namely the abnormal data, so that the receiving end obtains complete data, and the phenomenon of screen splash during audio and video transmission is reduced.
In a possible implementation manner, if it is detected that the received data has data abnormality, the abnormal data may be recovered by using a forward error correction manner, if the forward error correction manner is wrong, the abnormal data cannot be recovered, or the ratio of the recovered data to the abnormal data is smaller than a preset value, then a NACK data packet is generated according to the abnormal data, and the NACK data packet is sent to a sending end to request for retransmitting the abnormal data, so that the number of times of retransmitting the data can be reduced, and the time delay of data transmission is reduced.
In the above embodiment, the receiving end may recover the data in the forward error correction manner when the data can be recovered in the forward error correction manner, and send the NACK packet to request the transmitting end to retransmit the data when the data cannot be recovered in the forward error correction manner. Because the forward error correction mode can complete the data recovery at the receiving end, the data recovery has no influence on the transmitting end, and the mode of requesting the transmitting end for retransmitting data by sending the NACK data packet can occupy the network bandwidth and influence the data transmission rate. If the data is abnormal, the NACK data packet is directly sent to request for retransmitting the data, so that network congestion is easily caused, and the time delay of data transmission is increased. Therefore, compared with a method for directly sending the NACK data packet when data abnormity exists, the method and the device can reduce the data retransmission times, thereby effectively utilizing the network bandwidth, reducing the time delay of data transmission and improving the real-time property of data transmission.
In a possible implementation manner, after the receiving end sends the NACK data packet, if the abnormal data corresponding to the NACK data packet is not received within a set period, the NACK data packet is sent again until a preset time is reached, where the preset time may be set to 200 ms. And if the receiving end does not receive the abnormal data retransmitted by the transmitting end within the preset time, transmitting retransmission failure information to the transmitting end. And after receiving the retransmission failure information, the sending end stops retransmitting the abnormal data and discards the abnormal data, and continues to send the next RTP data packet. Therefore, network congestion caused by repeated abnormal data transmission by the transmitting end can be prevented. The receiving end is ensured to acquire complete data in a data retransmission mode, meanwhile, the time for receiving the retransmitted data is set, a small amount of abnormal data is allowed to be stored to prevent jamming, and the problem of high time delay during audio and video signal transmission is prevented in a mode of allowing a picture to be partially displayed.
In a possible implementation manner, the receiving end sends data receiving information to the sending end periodically in a Real-time Transport Control Protocol (RTCP) message manner according to a preset period, where the data receiving information includes any one or more of data exception information, error correction information in a forward error correction manner, and the number of times of sending negative acknowledgement packets. The data exception information may be the frequency of data exception, the number of data exception, etc., and the error correction information includes the number of times of error correction, the result of error correction, etc. After receiving the data receiving information, the sending end adjusts the code rate of the data stream to be sent and/or adjusts the redundancy ratio of the forward error correction coding according to the data receiving information.
For example, if the data receiving information includes data anomaly information, when there is more anomalous data, the code rate of the data stream to be transmitted is increased, the influence of the data anomaly on the quality of the received audio/video information is reduced, and the redundancy ratio of the forward error correction coding is increased, so that the probability of recovering data through the forward error correction coding is increased, the data is recovered through a forward error correction mode as much as possible, the data retransmission is reduced, the time delay of data transmission is reduced, and the real-time performance of data transmission is improved. If the data receiving information comprises error correction information in a forward error correction mode, when the error correction information in the forward error correction mode is error correction failure, the code rate of the data stream to be sent is improved, the influence of abnormal data which are not successfully recovered on the quality of the received audio and video information is reduced, meanwhile, the redundancy ratio of forward error correction coding is improved, the probability of successful error correction in the forward error correction mode is improved, and the data retransmission times are further reduced. If the data receiving information comprises the sending times of the NACK data packet, when the sending times of the NACK data packet exceeds the preset times, the code rate of the data stream to be sent is reduced so as to improve the success rate of retransmitting data, and simultaneously, the redundancy ratio of forward error correction codes is improved so as to improve the probability of successful error correction in a forward error correction mode and further reduce the sending times of the NACK data packet.
Referring to fig. 3, a data transmission method according to an embodiment of the present application includes:
s201: and after carrying out forward error correction coding and packaging on the data stream to be sent, obtaining corresponding data and sending the data to a receiving end.
Specifically, taking audio/video data as an example, the sending end performs coding and data compression on an audio/video signal to be sent to obtain a data stream to be sent. FEC coding is carried out on the data stream to be sent to obtain an original data packet and a redundant data packet corresponding to the data stream to be sent, RTP encapsulation is carried out on the original data packet and the redundant data packet to obtain a corresponding RTP data packet, and the RTP data packet is sent to a receiving end.
S202: and if a negative response data packet sent by the receiving end is received, retransmitting abnormal data according to the negative response data packet, wherein the negative response data packet is sent when the receiving end detects that the received data has data abnormality and the data does not meet the forward error correction condition.
Specifically, after receiving an RTP data packet, the receiving end determines whether there is abnormal data, and if there is abnormal data and the data cannot be recovered by a forward error correction method, generates a NACK data packet according to the abnormal data, and sends the NACK data packet to the sending end. After receiving the NACK data packet, the sending end determines the serial number of the abnormal data packet according to the NACK data packet, and retransmits the abnormal data packet, so that the receiving end obtains complete data, and the screen splash phenomenon during audio and video transmission is reduced.
In the above embodiment, FEC encoding and encapsulation are performed on a data stream to be sent to obtain corresponding data, and the data is sent to a receiving end, so that the receiving end can recover the data according to a forward error correction manner when detecting that there is abnormal data. When the receiving end can not recover the abnormal data in the forward error correction mode, the sending end retransmits the abnormal data, thereby reducing the times of retransmitting the data, reducing the time delay of data transmission and improving the real-time property of data transmission.
In a possible implementation manner, after retransmitting the abnormal data, if the retransmission failure information sent by the receiving end is received within the preset time, the sending end stops retransmitting the abnormal data and discards the abnormal data, and continues to send the next data packet, so that the problem of high time delay caused by repeated data retransmission can be prevented.
In another possible implementation manner, the receiving end sends NACK data packets corresponding to the abnormal data according to a set period, retransmits the abnormal data corresponding to the NACK data packets after receiving the NACK data packets, and for the same abnormal data packet, the number of NACK data packets received by the receiving end is the same as the retransmission times. The receiving end counts the retransmission times of the same abnormal data packet, if the retransmission times reach the preset retransmission times, the abnormal data is stopped being retransmitted and discarded, and the next data packet is continuously sent, so that the problem of high time delay caused by repeated data retransmission can be prevented.
In a possible implementation manner, the sending end buffers RTP packets within a set time (e.g., 200ms) after the sending is completed for retransmission, and the receiving end can receive complete data by retransmitting data. Meanwhile, the RTP data packets exceeding the set time are discarded in a mode of only caching the RTP data packets within the set time, so that the cached data of a sending end can be reduced, the same data packet is prevented from being repeatedly retransmitted for many times, network congestion is prevented from being caused, and the real-time performance of data transmission is improved.
In a possible implementation manner, the sending end receives data receiving information sent by the receiving end, where the data receiving information includes any one or more of data exception information, error correction information of a forward error correction manner, and the number of times of sending NACK data packets. And adjusting the code rate of the data stream to be transmitted according to the data receiving information, and realizing the Quality of Service (QoS) feedback function. For example, if the data receiving information includes data anomaly information, when there is more anomalous data, the code rate of the data stream to be transmitted is increased, and the influence of the data anomaly on the quality of the received audio/video information is reduced. If the data receiving information comprises error correction information of a forward error correction mode, when the error correction information of the forward error correction mode is error correction failure, the code rate of the data stream to be transmitted is improved, and the influence of abnormal data which is not successfully recovered on the quality of the received audio and video information is reduced. If the data receiving information comprises the sending times of the NACK data packet, when the sending times of the NACK data packet exceed the preset times, the code rate of the data stream to be sent is reduced so as to improve the success rate of retransmitting data.
In one possible implementation, the data reception information includes error correction information of a forward error correction scheme and the number of times of transmission of the NACK packet. If the sending times of the NACK data packet is more than 0, the data can not be recovered through a forward error correction mode, and the data needs to be retransmitted, so that the code rate of the data stream to be sent is reduced, and the success rate of retransmitting the data is improved; if the sending times of the NACK data packet is equal to 0, but the error correction information of the forward error correction mode is error correction failure, the code rate of the data stream to be sent is unchanged, and the influence of the data which is not successfully recovered on the audio and video signals is reduced. If the sending times of the NACK data packet is equal to 0 and the error correction information of the forward error correction mode is successful, the code rate of the data stream to be sent is improved, so that the bandwidth is fully utilized, and the quality of the data received by the receiving end is improved.
In a possible implementation manner, the sending end further adjusts the redundancy ratio of the forward error correction coding according to the received data information. For example, if the data receiving information includes data abnormal information, when the abnormal data is less, the redundancy ratio of the forward error correction coding is reduced, the bandwidth occupied by the redundant data packet is reduced, and the utilization rate of the bandwidth is improved. If abnormal data are more, the redundancy proportion of the forward error correction coding is improved, so that the probability of recovering the data through the forward error correction coding is improved, the data are recovered through a forward error correction mode as much as possible, the data retransmission is reduced, the time delay of data transmission is reduced, and the real-time performance of data transmission is improved. If the data receiving information comprises error correction information of a forward error correction mode, when the error correction information of the forward error correction mode is error correction failure, the redundancy ratio of forward error correction coding is improved so as to improve the probability of successful error correction of the forward error correction mode and further reduce the data retransmission times. If the data receiving information comprises the sending times of the NACK data packet, when the sending times of the NACK data packet exceed the preset times, the redundancy proportion of the forward error correction codes is improved so as to improve the probability of successful error correction in a forward error correction mode and further reduce the sending times of the NACK data packet.
Fig. 4 is a diagram of a data transmission method according to an embodiment of the present application, where a sending end inputs an audio/video signal to be sent to an encoder to obtain a corresponding data stream to be sent. FEC encoding is carried out on data flow to be sent to obtain an original data packet and a redundant data packet corresponding to the data flow to be sent, RTP encapsulation is carried out on the original data packet and the redundant data packet to obtain a corresponding RTP data packet, and the RTP data packet is sent to a receiving end through UDP. When detecting that the received data has data abnormality, the receiving end unpacks the received RTP data packet, judges whether a forward error correction condition is met, and if the forward error correction condition is met, recovers the abnormal data through a redundant data packet by adopting a forward error correction mode. If the condition of forward error correction is not met, the receiving end generates a NACK data packet according to the abnormal data and sends the NACK data packet to the sending end, and the sending end retransmits the abnormal data according to the NACK data packet. And if the receiving end does not receive the abnormal data within the preset time, discarding the abnormal data. And after the receiving end finishes receiving the data, inputting the received data into an audio and video decoder for decompression and decoding to obtain audio and video signals.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by functions and internal logic of the process, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 5 shows a block diagram of a data receiving apparatus provided in the embodiment of the present application, and only shows portions related to the embodiment of the present application for convenience of description, corresponding to the data receiving method described in the above embodiment.
As shown in fig. 5, the data receiving apparatus includes,
a judging module 10, configured to, when detecting that there is data anomaly in received data, judge whether the data meets a forward error correction condition, where the data is obtained by performing forward error correction coding on a data stream to be sent by a sending end and packaging the data;
a first processing module 20, configured to recover abnormal data in a forward error correction manner if the data meets the forward error correction condition;
a second processing module 30, configured to send a negative acknowledgement data packet to the sending end according to the abnormal data if the data does not meet the forward error correction condition, where the sending end is configured to retransmit the abnormal data according to the negative acknowledgement data packet.
In a possible implementation manner, the second processing module 20 is further configured to, where the data receiving method further includes:
and if the abnormal data retransmitted by the sending end is not received within the preset time, sending retransmission failure information to the sending end, wherein the sending end is used for stopping retransmitting the abnormal data according to the retransmission failure information.
In one possible implementation manner, the data receiving apparatus further includes:
the feedback module is configured to periodically send data receiving information to the sending end according to a preset period, where the data receiving information includes any one or more of data exception information, error correction information of a forward error correction mode, and the sending frequency of the negative acknowledgement data packet, and the sending end is configured to adjust a code rate of the data stream to be sent and/or adjust a redundancy ratio of the forward error correction code according to the data receiving information.
In one possible implementation manner, the data receiving apparatus further includes:
and the receiving module is used for receiving the data sent by the sending end through the UDP.
Fig. 6 shows a block diagram of a data transmission device according to an embodiment of the present application, which corresponds to the data transmission method according to the foregoing embodiment, and only the portions related to the embodiment of the present application are shown for convenience of description.
As shown in fig. 6, the data transmission apparatus includes,
a sending module 40, configured to perform forward error correction coding and encapsulation on a data stream to be sent, obtain corresponding data, and send the data to a receiving end;
a retransmission module 50, configured to retransmit abnormal data according to a negative acknowledgement data packet sent by the receiving end if the negative acknowledgement data packet is received, where the negative acknowledgement data packet is sent by the receiving end when the receiving end detects that the received data has data abnormality and the data does not meet a forward error correction condition.
In a possible implementation manner, the retransmission module 50 is further configured to:
and if receiving retransmission failure information or reaching a preset retransmission frequency, stopping retransmitting the abnormal data, wherein the retransmission failure information is sent when the receiving end does not receive the abnormal data within a preset time.
In one possible implementation manner, the data sending apparatus further includes:
and the adjusting module is configured to acquire data receiving information sent by the receiving end, where the data receiving information includes any one or more of data exception information, error correction information of the forward error correction mode, and sending information of the negative acknowledgement data packet, and adjust the code rate of the data stream to be sent according to the data receiving information.
In a possible implementation manner, the adjusting module is specifically configured to:
if the sending times of the negative response data packet is more than 0, reducing the code rate of the data stream to be sent;
if the sending times of the negative response data packet is equal to 0 and the error correction information of the forward error correction mode is error correction failure, the code rate of the data stream to be sent is not changed; and if the sending times of the negative response data packet is equal to 0 and the error correction information of the forward error correction mode is successful, improving the code rate of the data stream to be sent.
In one possible implementation, the adjusting module is further configured to:
and adjusting the redundancy ratio of the forward error correction coding according to the data receiving information.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
Fig. 7 is a schematic diagram of a communication device provided in an embodiment of the present application. As shown in fig. 7, the communication device of this embodiment includes: a processor 11, a memory 12 and a computer program 13 stored in said memory 12 and executable on said processor 11. The processor 11 implements the steps in the above-described data receiving method embodiment or implements the steps in the above-described data transmitting method embodiment when executing the computer program 13. Alternatively, the processor 11 implements the functions of the modules/units in the above-described device embodiments when executing the computer program 13.
Illustratively, the computer program 13 may be partitioned into one or more modules/units, which are stored in the memory 12 and executed by the processor 11 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 13 in the communication device.
Those skilled in the art will appreciate that fig. 7 is merely an example of a communication device and does not constitute a limitation of communication devices and may include more or fewer components than shown, or some of the components may be combined, or different components, e.g., the communication device may also include input output devices, network access devices, buses, etc.
The Processor 11 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 12 may be an internal storage unit of the communication device, such as a hard disk or a memory of the communication device. The memory 12 may also be an external storage device of the communication device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the communication device. Further, the memory 12 may also include both an internal storage unit and an external storage device of the communication device. The memory 12 is used for storing the computer program and other programs and data required by the communication device. The memory 12 may also be used to temporarily store data that has been output or is to be output.
It should be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional units and modules is only used for illustration, and in practical applications, the above function distribution may be performed by different functional units and modules as needed, that is, the internal structure of the apparatus may be divided into different functional units or modules to perform all or part of the above described functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only used for distinguishing one functional unit from another, and are not used for limiting the protection scope of the present application. For the specific working processes of the units and modules in the system, reference may be made to the corresponding processes in the foregoing method embodiments, which are not described herein again.
In the above embodiments, the description of each embodiment has its own emphasis, and reference may be made to the related description of other embodiments for parts that are not described or recited in any embodiment.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/communication device and method may be implemented in other ways. For example, the above-described apparatus/communication device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U.S. disk, removable hard disk, magnetic diskette, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunications signal, and software distribution medium, etc.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (12)

1. A data receiving method applied to a receiving end, the data receiving method comprising:
when the received data is detected to have data abnormality, judging whether the data meets a forward error correction condition or not, wherein the data is obtained by performing forward error correction coding on a data stream to be sent by a sending end and packaging;
if the data meets the forward error correction condition, recovering abnormal data by adopting a forward error correction mode;
and if the data does not meet the forward error correction condition, sending a negative response data packet to the sending end according to the abnormal data, wherein the sending end is used for retransmitting the abnormal data according to the negative response data packet.
2. The data receiving method according to claim 1, wherein after the sending of the negative acknowledgement packet to the sending end according to the abnormal data, the data receiving method further comprises:
and if the abnormal data retransmitted by the sending end is not received within the preset time, sending retransmission failure information to the sending end, wherein the sending end is used for stopping retransmitting the abnormal data according to the retransmission failure information.
3. The data receiving method according to claim 1, characterized in that the data receiving method further comprises:
and periodically sending data receiving information to the sending end according to a preset period, wherein the data receiving information comprises any one or more of data abnormal information, error correction information of a forward error correction mode and sending times of the negative response data packet, and the sending end is used for adjusting the code rate of the data stream to be sent and/or adjusting the redundancy ratio of forward error correction coding according to the data receiving information.
4. A data sending method applied to a sending end, wherein the data sending method comprises:
carrying out forward error correction coding and packaging on a data stream to be sent to obtain corresponding data, and sending the data to a receiving end;
if a negative response data packet sent by the receiving end is received, retransmitting abnormal data according to the negative response data packet, wherein the negative response data packet is sent when the receiving end detects that the received data has data abnormality and the data does not meet the forward error correction condition.
5. The data transmission method according to claim 4, wherein after the retransmission of the abnormal data according to the negative acknowledgement data packet, the data transmission method further comprises:
and if receiving retransmission failure information or reaching a preset retransmission frequency, stopping retransmitting the abnormal data, wherein the retransmission failure information is sent when the receiving end does not receive the abnormal data within a preset time.
6. The data transmission method according to claim 4, wherein after the transmitting the encapsulated data to a receiving end, the data transmission method further comprises:
and acquiring data receiving information sent by the receiving end, wherein the data receiving information comprises any one or more of data abnormal information, error correction information of a forward error correction mode and the sending times of the negative response data packet, and adjusting the code rate of the data stream to be sent according to the data receiving information.
7. The data transmission method according to claim 6, wherein the adjusting the code rate of the data stream to be transmitted according to the data reception information comprises:
if the sending times of the negative response data packet is more than 0, reducing the code rate of the data stream to be sent;
if the sending times of the negative response data packet is equal to 0 and the error correction information of the forward error correction mode is error correction failure, the code rate of the data stream to be sent is not changed;
and if the sending times of the negative response data packet are equal to 0 and the error correction information of the forward error correction mode is successful, improving the code rate of the data stream to be sent.
8. The data transmission method according to claim 6, wherein after the obtaining of the data reception information transmitted by the receiving end, the data transmission method further comprises:
and adjusting the redundancy ratio of the forward error correction coding according to the data receiving information.
9. A data receiving device, comprising:
the judging module is used for judging whether the data meet forward error correction conditions or not when the received data are detected to have data abnormality, and the data are obtained by carrying out forward error correction coding and packaging on a data stream to be sent by a sending end;
the first processing module is used for recovering abnormal data by adopting a forward error correction mode if the data meets the forward error correction condition;
and a second processing module, configured to send a negative acknowledgement data packet to the sending end according to the abnormal data if the data does not satisfy the forward error correction condition, where the sending end is configured to retransmit the abnormal data according to the negative acknowledgement data packet.
10. A data transmission apparatus, comprising:
the transmitting module is used for carrying out forward error correction coding and packaging on a data stream to be transmitted to obtain corresponding data and transmitting the data to a receiving end;
and the retransmission module is used for retransmitting abnormal data according to the negative response data packet if the negative response data packet sent by the receiving end is received, wherein the negative response data packet is sent when the receiving end detects that the received data has data abnormality and the data does not meet the forward error correction condition.
11. A communication device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the data receiving method according to any one of claims 1 to 4 or the data transmitting method according to any one of claims 5 to 8 when executing the computer program.
12. A computer-readable storage medium, in which a computer program is stored, which computer program, when being executed by a processor, is adapted to carry out the data receiving method according to any one of claims 1 to 4 or the data transmitting method according to any one of claims 5 to 8.
CN202110105149.6A 2021-01-26 2021-01-26 Data receiving method, data sending method and related equipment Pending CN114793146A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110105149.6A CN114793146A (en) 2021-01-26 2021-01-26 Data receiving method, data sending method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110105149.6A CN114793146A (en) 2021-01-26 2021-01-26 Data receiving method, data sending method and related equipment

Publications (1)

Publication Number Publication Date
CN114793146A true CN114793146A (en) 2022-07-26

Family

ID=82459978

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110105149.6A Pending CN114793146A (en) 2021-01-26 2021-01-26 Data receiving method, data sending method and related equipment

Country Status (1)

Country Link
CN (1) CN114793146A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115205952A (en) * 2022-09-16 2022-10-18 深圳市企鹅网络科技有限公司 Online learning image acquisition method and system based on deep learning

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101505202A (en) * 2009-03-16 2009-08-12 华中科技大学 Adaptive error correction method for stream media transmission
CN109412753A (en) * 2018-10-25 2019-03-01 网易(杭州)网络有限公司 Data transmission method and device, electronic equipment and storage medium
CN111082896A (en) * 2019-12-11 2020-04-28 深圳市优必选科技股份有限公司 Data transmission method and transmitting and receiving device
CN111629280A (en) * 2020-04-13 2020-09-04 视联动力信息技术股份有限公司 Packet loss processing method and device and readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101505202A (en) * 2009-03-16 2009-08-12 华中科技大学 Adaptive error correction method for stream media transmission
CN109412753A (en) * 2018-10-25 2019-03-01 网易(杭州)网络有限公司 Data transmission method and device, electronic equipment and storage medium
CN111082896A (en) * 2019-12-11 2020-04-28 深圳市优必选科技股份有限公司 Data transmission method and transmitting and receiving device
CN111629280A (en) * 2020-04-13 2020-09-04 视联动力信息技术股份有限公司 Packet loss processing method and device and readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115205952A (en) * 2022-09-16 2022-10-18 深圳市企鹅网络科技有限公司 Online learning image acquisition method and system based on deep learning

Similar Documents

Publication Publication Date Title
US11641387B2 (en) Timely delivery of real-time media problem when TCP must be used
CN107342848B (en) Self-adaptive code stream transmission method, device and equipment
EP1346578B1 (en) Method for multimedia communication over packet channels
US7584404B2 (en) Method and apparatus for multimedia communication over packet channels
US20160323062A1 (en) Packet recovery in interactive real-time media protocol
JP4592935B2 (en) Header restoration apparatus and header restoration method
US20120170445A1 (en) Efficient application-layer automatic repeat request retransmission method for reliable real-time data streaming in networks
US20060168504A1 (en) Method and devices for error tolerant data transmission, wherein retransmission of erroneous data is performed up to the point where the remaining number of errors is acceptable
KR20070033292A (en) Method and apparatus for transmitting signaling data messages in a wireless communication system
US20150103885A1 (en) Real time ip video transmission with high resilience to network errors
CN102664718A (en) Wireless side TCP (Transmission Control Protocol) data retransmission method and equipment
CN111082896A (en) Data transmission method and transmitting and receiving device
CN105681342A (en) Anti-error code method and system of multi-channel video conference system based on H264
US20050117515A1 (en) Transmitter device for controlling data transmission
CN111629210A (en) Data processing method and device and electronic equipment
CN102694631B (en) Method and device for controlling data transmission
US9312990B2 (en) Packet loss recovery on a wireless link in a transmission layer protocol session
CN107209713B (en) Method and system for on-demand file repair
CN114793146A (en) Data receiving method, data sending method and related equipment
EP3939191B1 (en) Device and method for delivering acknowledgment in network transport protocols
WO2010022665A1 (en) Method, device and system for implementing retransmission in physical layer
JP2003037624A (en) Selective packet retransmission for timing control in transmitter terminal
CN104410927A (en) Low-redundancy compensation method of video transmission packet loss in erasure channel
JP2003163683A (en) System for transmitting packet sequence between server and mobile terminal
CN113242318B (en) Data transmission method and electronic equipment

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