Data forward error correction processing method, device, electronic device and storage medium
By obtaining network delay and packet loss information, the number of redundant packets is dynamically determined, and redundant data packets are sent when appropriate. This solves the problems of low resource utilization and untimely updates of network changes in the existing technology, and improves audio and video streaming. Data transmission quality.
Patent Information
- Application Number
- CN202210638549.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-07
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2042-06-07
AI Technical Summary
Existing forward error correction technology has low resource utilization when the network environment is good, and cannot accurately update network changes, affecting the quality of data transmission.
By obtaining network delay and packet loss information, the number of redundant packets is dynamically determined, and redundant data packets are sent when the network transmission status permits to achieve data packet recovery.
It realizes real-time adaptation to network status, improves the transmission quality of audio and video stream data under various network status, and effectively utilizes network resources.
Smart Images

Figure CN115037416B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of real-time audio and video processing, and in particular to a data forward error correction processing method, device, electronic device and computer-readable storage medium. Background Art
[0002] Forward Error Correction (FEC) adds redundant data packets for error correction to the original data packets at the sending end, and recovers the lost packets based on the original data packets and the redundant data packets at the receiving end to cope with network environments with packet loss and ensure the transmission delay of data such as audio and video streaming media.
[0003] In the current technology, the original data packets and redundant data packets in the forward error correction processing are fixed. The technical problem is that the utilization rate of network transmission resources is not high when the network environment is good. When the network environment changes, the relevant parameters of the forward error correction processing cannot accurately update the network changes, affecting the data transmission quality. Summary of the invention
[0004] Based on this, it is necessary to provide a data forward error correction processing method, device, electronic device and computer-readable storage medium to address the above technical problems.
[0005] In a first aspect, the present application provides a data forward error correction processing method. The method comprises:
[0006] Obtain the original data packet storage status of the forward error correction queue;
[0007] If the storage state of the original data packet meets the forward error correction operation condition represented by the network delay, the number of redundant packets is determined according to the network delay and the network packet loss information;
[0008] Generate redundant data packets corresponding to the original data packets in the forward error correction queue according to the number of redundant packets;
[0009] If the network transmission status meets the redundant packet sending condition, the redundant data packet is sent to the receiving end, so that the receiving end can use the redundant data packet to restore the original data packet when the received original data packet is lost.
[0010] In one embodiment, the original data packet storage state includes the length of time the data packet has been stored; if the original data packet storage state satisfies the forward error correction operation condition represented by the network delay, before determining the number of redundant packets according to the network delay and the network packet loss information, the method further includes:
[0011] A storage duration threshold is determined according to the network delay smoothing value; if the storage duration of the data packet is greater than the storage duration threshold, it is determined that the storage state of the original data packet meets the forward error correction operation condition.
[0012] In one embodiment, the original data packet storage state includes the number of stored data packets; if the original data packet storage state satisfies the forward error correction operation condition characterized by the network delay, before determining the number of redundant packets according to the network delay and the network packet loss information, the method further includes:
[0013] A stored packet number threshold is obtained according to the ratio of the network delay smoothing value to the unit time length of the data packet; if the number of stored data packets is greater than the stored packet number threshold, it is determined that the original data packet storage state meets the forward error correction operation condition.
[0014] In one embodiment, determining the number of redundant packets according to the network delay and network packet loss information includes:
[0015] Obtain network delay statistical information and network packet loss statistical information; if the network delay statistical information indicates that the network delay satisfies the delay threshold condition, then when the network packet loss statistical information indicates that the network packet loss satisfies the network packet loss threshold condition, the number of redundant packets is set to a first preset value, and when the network packet loss statistical information indicates that the network packet loss does not satisfy the network packet loss threshold condition, the number of redundant packets is determined according to the network packet loss statistical information and the second preset value; if the network delay statistical information indicates that the network delay does not satisfy the delay threshold condition, then when the network packet loss statistical information indicates that the network packet loss satisfies the network packet loss threshold condition, the number of redundant packets is set to a third preset value, and when the network packet loss statistical information indicates that the network packet loss does not satisfy the network packet loss threshold condition, the number of redundant packets is determined according to the network packet loss statistical information and the second preset value.
[0016] In one embodiment, determining the number of redundant packets according to the network packet loss statistics and a second preset value includes:
[0017] The maximum number of consecutive packet losses is obtained according to the network packet loss statistics information; and the number of redundant packets is obtained according to the smaller value between the maximum number of consecutive packet losses and a second preset value.
[0018] In one embodiment, if the network transmission state satisfies the redundant packet sending condition, before sending the redundant data packet to the receiving end, the method further includes:
[0019] Obtaining the detected network bandwidth and data transmission flow statistics information; judging whether the network transmission status satisfies the redundant packet sending condition according to the network bandwidth and data transmission flow statistics information.
[0020] In one embodiment, judging whether the network transmission status satisfies the redundant packet sending condition according to the network bandwidth and the data transmission flow statistics information includes:
[0021] If the network bandwidth is greater than or equal to the mean data transmission flow in the data transmission flow statistical information, it is determined that the network transmission status meets the redundant packet sending condition; if the network bandwidth is less than the mean data transmission flow, then when the mean data transmission flow is less than or equal to the data transmission flow threshold, or when the mean data retransmission flow in the data transmission flow statistical information is less than or equal to the data retransmission flow threshold, it is determined that the network transmission status meets the redundant packet sending condition.
[0022] In a second aspect, the present application also provides a data forward error correction processing device. The device comprises:
[0023] An acquisition module, used for acquiring the storage status of the original data packet of the forward error correction queue;
[0024] A determination module, configured to determine the number of redundant packets according to the network delay and network packet loss information if the storage state of the original data packet meets the forward error correction operation condition characterized by the network delay;
[0025] A generating module, used for generating redundant data packets corresponding to the original data packets in the forward error correction queue according to the number of redundant packets;
[0026] The sending module is used to send the redundant data packet to the receiving end if the network transmission status meets the redundant packet sending condition, so that the receiving end can use the redundant data packet to restore the original data packet when the received original data packet is lost.
[0027] In a third aspect, the present application further provides an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0028] Obtain the storage status of the original data packet of the forward error correction queue; if the storage status of the original data packet meets the forward error correction operation condition represented by the network delay, determine the number of redundant packets according to the network delay and network packet loss information; generate redundant data packets corresponding to the original data packets in the forward error correction queue according to the number of redundant packets; if the network transmission status meets the redundant packet sending condition, send the redundant data packet to the receiving end, so that the receiving end can use the redundant data packet to recover the original data packet when the received original data packet is lost.
[0029] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0030] Obtain the storage status of the original data packet of the forward error correction queue; if the storage status of the original data packet meets the forward error correction operation condition represented by the network delay, determine the number of redundant packets according to the network delay and network packet loss information; generate redundant data packets corresponding to the original data packets in the forward error correction queue according to the number of redundant packets; if the network transmission status meets the redundant packet sending condition, send the redundant data packet to the receiving end, so that the receiving end can use the redundant data packet to recover the original data packet when the received original data packet is lost.
[0031] The above-mentioned data forward error correction processing method, device, electronic device and storage medium obtain the storage status of the original data packet of the forward error correction queue. If the storage status of the original data packet meets the forward error correction operation condition represented by the network delay, the number of redundant packets is determined according to the network delay and the network packet loss information, and the redundant data packet corresponding to the original data packet in the forward error correction queue is generated according to the redundant packet number. When the network transmission status meets the redundant packet sending condition, the redundant data packet is sent to the receiving end, so that the receiving end can use the redundant data packet to recover the original data packet when the received original data packet is lost. This scheme can determine the timing of forward error correction operation according to the storage status of the original data packet and the network delay, determine the number of redundant packets according to the network delay and the network packet loss information, and generate the redundant data packet corresponding to the original data packet in the forward error correction queue accordingly, and send the redundant data packet to the receiving end for packet loss recovery when the network transmission status meets the redundant packet sending condition, thereby being able to adapt to changes in network status in real time, effectively utilize network transmission resources, and improve the transmission quality of real-time audio and video streams and other data in various network states. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 This is an application scenario diagram of a data forward error correction processing method in an embodiment;
[0033] Figure 2 Schematic diagram of a process flow of a data forward error correction processing method in one embodiment;
[0034] Figure 3 A schematic diagram of a process for determining the number of redundant packets in an embodiment;
[0035] Figure 4 It is an application scenario diagram of a data forward error correction processing method in an application example;
[0036] Figure 5 It is a structural block diagram of a data forward error correction processing device in one embodiment;
[0037] Figure 6 is an internal structure diagram of an electronic device in one embodiment;
[0038] Figure 7 FIG. 4 is a diagram showing the internal structure of an electronic device in another embodiment. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0040] The data forward error correction processing method provided in this application can be applied to Figure 1 The application scenario shown may include a data transmitter 110 and a data receiver 120, and the transmitter 110 communicates with the receiver 120 through a network. The transmitter 110 and the receiver 120 may be terminals or servers. Taking the transmitter 110 as an example, the transmitter 110 may be, but is not limited to, terminals such as personal computers, smart phones, IoT devices, and portable wearable devices, wherein the IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc., and the portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The transmitter 110 may also be an independent server or a server cluster consisting of multiple servers.
[0041] The data forward error correction processing method provided by the present application can achieve real-time adaptation to changes in network status, effectively utilize network transmission resources to transmit data, and improve the transmission quality of data under various network conditions. Specifically for the processing of audio and video streaming media data, with the continuous development of multimedia technology, various real-time audio streaming media applications are gradually increasing. In network change scenarios such as complex wireless environments and bandwidth-limited scenarios, packet loss occurs in audio and video streaming media data transmission, resulting in problems such as intermittent, stuck, and poor real-time performance of audio and video streaming media, affecting the actual business experience. The data forward error correction processing method provided by the present application can timely track changes in the network environment, adjust the forward error correction parameters of audio and video streaming media data, effectively utilize network transmission resources, and improve the transmission quality of real-time audio and video streaming media data under various network conditions, thereby improving the actual business experience.
[0042] The data forward error correction processing method of the present application is further described below in conjunction with the embodiments of the present application and the corresponding drawings.
[0043] In one embodiment, Figure 2 As shown, a data forward error correction processing method is provided, which can be performed as follows Figure 1The sending end 110 shown in the figure performs the method, which includes the following steps:
[0044] Step S201, obtaining the storage status of the original data packet of the forward error correction queue.
[0045] In this step, the transmitting end 110 obtains the current storage state of the original data packet stored in the forward error correction queue, which is called the original data packet storage state of the forward error correction queue.
[0046] Specifically, the transmitting end 110 obtains the original data packets to be sent continuously provided by the data source. The data source may be an audio source or a video source, and the original data packets to be sent refer to the original data packets to be sent from the transmitting end 110 to the receiving end 120, that is, the transmitting end 110 can obtain the original data packets continuously provided by the audio source. A forward error correction queue (also referred to as an FEC queue) is provided in the transmitting end 110 to store the original data packets continuously provided by the data source.
[0047] Then, the sending end 110 can add these original data packets into the FEC queue, so that a series of original data packets to be sent continuously provided by the data source can be added to the FEC queue one by one for storage. The sending end 110 can record the number of original data packets entering the FEC queue, the time of the first data packet entering the FEC queue, etc. to form queue entry record information. The aforementioned current storage state refers to the storage state of the original data packets currently stored in the FEC queue. The storage state, that is, the storage state of the original data packet, can include the storage time of the data packet, the number of data packets stored, etc. The storage state can be obtained by the sending end 110 according to the aforementioned queue entry record information. Moreover, the storage state can be continuously updated by the sending end 110. If the sending end 110 confirms that one or some original data packets in the FEC queue have been received by the receiving end 120, then the one or some original data packets will be deleted from the FEC queue by the sending end 110. At this time, the sending end 110 can update the storage state of the original data packet such as the storage time of the data packet and the number of data packets stored.
[0048] Step S202: If the storage state of the original data packet meets the forward error correction operation condition represented by the network delay, the number of redundant packets is determined according to the network delay and the network packet loss information.
[0049] This step is mainly to determine the timing of forward error correction operation and determine the number of redundant packets. Among them, the forward error correction operation is not performed regularly, and the number of redundant packets is not a fixed value. Specifically, when the forward error correction operation conditions are met, the forward error correction operation is performed to determine the number of redundant packets and generate corresponding redundant data packets. Among them, the forward error correction operation conditions are characterized by network delay, which can be specifically represented based on the round-trip time (RTT). When the storage state of the original data packet obtained in step S201 meets the forward error correction operation conditions characterized by the round-trip time, the sending end 110 determines the number of redundant packets, that is, the sending end 110 needs to combine the current storage state of the original data packet and the current network delay to determine whether the FEC operation can be performed. After the sending end 110 determines that the FEC operation can be performed, the sending end 110 determines the number of redundant packets based on the current network delay and the current network packet loss information, and the number of source packets for the FEC operation (i.e., the number of original data packets) is the number of original data packets currently stored in the FEC queue, so that the sending end 110 can adapt to changes in the network environment in real time in determining the timing of the forward error correction operation and determining the number of source packets and the number of redundant packets.
[0050] Step S203: Generate redundant data packets corresponding to the original data packets in the forward error correction queue according to the number of redundant packets.
[0051] Among them, the sending end 110 can determine the number of source packets and the number of redundant packets in step S202, and the number of source packets is the number of original data packets currently stored in the FEC queue. In this step, the sending end 110 can perform FEC operation according to the number of redundant packets and the number of source packets determined in step S202. Specifically, it is assumed that the sending end 110 obtains the number of source packets M_block and the number of redundant packets N_redundancy, and uses the Cauchy matrix to encode the original data packets in the forward error correction queue to obtain the encoded data [d1,...,dm,r1,...,rn], wherein m represents the number of source packets M_block, n represents the number of redundant packets N_redundancy, [d1,...,dm] represents the original data packets in the forward error correction queue, and [r1,...,rn] represents the redundant data packets obtained by the FEC operation.
[0052] Step S204: if the network transmission status satisfies the redundant packet sending condition, the redundant data packet is sent to the receiving end, so that the receiving end can use the redundant data packet to recover the original data packet when the received original data packet is lost.
[0053] This step is the redundant packet sending stage. The sending end 110 can obtain a redundant data packet in step S203. At this time, the sending end 110 does not directly send the redundant data packet to the receiving end 120, but needs to first determine whether the current network transmission state meets the redundant packet sending condition. The redundant data packet is sent to the receiving end 120 when the network transmission state meets the redundant packet sending condition. For example, when the sending end 110 detects that the current network bandwidth meets the preset condition, the sending end 110 can determine that the network transmission state meets the redundant packet sending condition and send the redundant data packet to the receiving end, so that the sending end 110 adapts to the changes in the network environment in real time during the redundant packet sending stage to reasonably and fully utilize network transmission resources. In a specific application, the sending end 110 may send the original data packet in a conventional manner, and the receiving end 120 receives the original data packet and generates corresponding confirmation (ACK) information based on the receiving status of the original data packet and feeds it back to the sending end 110. In this step, after the sending end 110 sends the redundant data packet to the receiving end 120, the receiving end 120 may determine whether there is packet loss based on the received original data packet. If packet loss is found, the redundant data packet may be used to recover the original data packet, and the source packet may be recovered using the corresponding FEC decoding algorithm.
[0054] In the data forward error correction processing method of the present embodiment, the sending end 110 can determine the timing of performing forward error correction operations according to the storage status of the original data packet and the network delay, and determine the number of redundant packets according to the network delay and network packet loss information and generate redundant data packets corresponding to the original data packets in the forward error correction queue accordingly, and send the redundant data packets to the receiving end 120 for packet loss recovery when the network transmission status meets the redundant packet sending conditions, thereby being able to adapt to changes in network status in real time, effectively utilize network transmission resources, and improve the transmission quality of real-time audio and video streams and other data under various network conditions.
[0055] In some embodiments, the determination of the timing of the forward error correction operation may be performed before step S202 by the following steps, including:
[0056] A storage duration threshold is determined based on the network delay smoothing value; if the storage duration of the data packet is greater than the storage duration threshold, it is determined that the storage state of the original data packet meets the forward error correction operation conditions.
[0057] In this embodiment, the storage status of the original data packet includes the storage time of the data packet. The storage time of the data packet refers to the storage time of the original data packet currently stored in the FEC queue. The storage time of the data packet can be calculated based on the difference (T1_now-T_firstFecQueue) between the current time T1_now and the time T_firstFecQueue of the first data packet entering the FEC queue.
[0058] In this embodiment, the forward error correction operation condition is that it is greater than the storage time threshold TH_timeout. The storage time threshold TH_timeout is determined according to the network delay smoothing value RTT_smooth. Specifically, the network delay smoothing value RTT_smooth can be set to the storage time threshold TH_timeout. In practical applications, the upper limit value TimeOut_max and the lower limit value TimeOut_min can be set for the storage time threshold TH_timeout, that is, TH_timeout∈[TimeOut_min, TimeOut_max]. Among them, the network delay smoothing value RTT_smooth, the sending end 110 can calculate an RTT sample RTT_cur=T2_now-T_stamp according to the time T2_now when the ACK is received and the time T_stamp of the ACK confirmation packet, and then use the first-order exponential smoothing method to calculate the network delay smoothing value RTT_smooth, that is, RTT_smooth(t)=α·RTT_cur+(1-α)·RTT_smooth(t-1), RTT_smooth(t) and RTT_smooth(t-1) are the RTT smoothing values at time t and t-1 respectively, the smoothing index α can select different parameters according to the mode of the application scenario, such as selecting a larger smoothing index such as 0.2 for the low-delay scenario mode, and the initial value of RTT_smooth can select the first received RTT value.
[0059] In this embodiment, the sending end 110 can obtain the storage time of the data packet and the storage time threshold, and then compare the storage time of the data packet with the storage time threshold. If the storage time of the data packet is greater than the storage time threshold (i.e., T1_now-T_firstFecQueue>TH_timeout), the sending end 110 determines that the storage status of the original data packet meets the forward error correction operation conditions, that is, it determines that the FEC operation can be performed, so as to adapt to changes in the network environment in real time during the judgment stage of the FEC operation timing.
[0060] In some other embodiments, the determination of the timing of the forward error correction operation may be performed before step S202 by the following steps, including:
[0061] According to the ratio of the network delay smoothing value to the unit time length of the data packet, the stored packet number threshold is obtained; if the number of stored data packets is greater than the stored packet number threshold, it is determined that the storage state of the original data packet meets the forward error correction operation conditions.
[0062] In this embodiment, the original data packet storage state includes the number of stored data packets L_fecQueue, where the number of stored data packets L_fecQueue refers to the number of original data packets currently stored in the FEC queue.
[0063] In this embodiment, the forward error correction operation condition is that it is greater than the stored packet number threshold T_bolckSize. The stored packet number threshold TH_bolckSize is determined according to the ratio of the network delay smoothing value RTT_smooth to the unit duration of the data packet Duration_pkt. Specifically, the ratio of the network delay smoothing value RTT_smooth to the unit duration of the data packet Duration_pkt [RTT_smooth / Duration_pkt] can be set as the stored packet number threshold TH_bolckSize, that is, TH_bolckSize = [RTT_smooth / Duration_pkt]. In actual applications, the upper limit BolckSize_max and the lower limit BolckSize_min can be set for the stored packet number threshold TH_bolckSize, that is, TH_bolckSize∈[BolckSize_min, BolckSize_max]. The network delay smoothing value RTT_smooth may be calculated in accordance with the above-mentioned embodiment, and the data packet unit duration Duration_pkt refers to the duration of each original data packet to be sent.
[0064] In this embodiment, the sending end 110 can obtain the number of stored data packets and the stored packet number threshold, and then compare the number of stored data packets with the stored packet number threshold. If the number of stored data packets is greater than the stored packet number threshold (i.e., L_fecQueue>TH_bolckSize), the sending end 110 determines that the storage status of the original data packet meets the forward error correction operation conditions, that is, it determines that the FEC operation can be performed, so as to adapt to changes in the network environment in real time during the judgment stage of the FEC operation timing.
[0065] Furthermore, in one embodiment, the timing of the forward error correction operation may be determined before step S202 by the following steps, specifically including:
[0066] If the data packet has been stored for a time period greater than the storage time threshold, or the number of stored data packets is greater than the stored packet number threshold, it is determined that the storage state of the original data packet meets the forward error correction operation condition.
[0067] In this embodiment, the sending end 110 determines that one of the following conditions is satisfied: the storage time of the data packet is greater than the storage time threshold (T1_now-T_firstFecQueue>TH_timeout) and the number of stored data packets is greater than the storage number threshold (L_fecQueue>TH_bolckSize). Then, the sending end 110 determines that the storage status of the original data packet meets the forward error correction operation condition and performs a forward error correction operation. The forward error correction operation timing is accurately determined by combining the storage time, the storage number and the network delay information to better adapt to the changing network environment.
[0068] In some embodiments, Figure 3 As shown, determining the number of redundant packets according to the network delay and network packet loss information in the above step S202 may include the following steps:
[0069] Step S301, obtaining network delay statistics information and network packet loss statistics information.
[0070] Among them, network delay statistics refer to the statistics of network delay within a certain period of time, such as the maximum and minimum values of network delay, the average value of network delay, etc. Network packet loss statistics refer to the statistics of the number of network packet losses within a certain period of time, such as the maximum and minimum values of network packet losses, the average value of network packet losses, etc. This step obtains network delay statistics and network packet loss statistics, so that the subsequent steps can determine the number of redundant packets N_redundancy for FEC operation according to the network delay statistics and network packet loss statistics, and the number of source packets M_block for FEC operation is the number of data packets stored in the FEC queue L_fecQueue.
[0071] Step S302: determine whether the network delay represented by the network delay statistical information satisfies a delay threshold condition.
[0072] This step can determine whether the network delay meets the delay threshold condition based on the network delay statistical information. Specifically, the network delay statistical information may include the maximum network delay RTT_max within a certain period of time, and the sending end 110 determines whether the maximum network delay RTT_max is less than the preset network delay threshold TH_rtt. If the maximum network delay RTT_max is less than the network delay threshold TH_rtt (i.e., RTT_max<TH_rtt), the sending end 110 determines that the network delay statistical information represents that the network delay meets the delay threshold condition. If the maximum network delay RTT_max is greater than or equal to the network delay threshold TH_rtt (i.e., RTT_max≥TH_rtt), the sending end 110 determines that the network delay statistical information represents that the network delay does not meet the delay threshold condition. Among them, the network delay threshold TH_rtt can adopt an empirical setting value; for the maximum network delay RTT_max, the sender 110 can obtain an RTT sample RTT_cur according to the time T2_now when the ACK is received and the time T_stamp when the ACK confirmation packet is received, RTT_cur = T2_now-T_stamp, and use it as one of the RTT samples in the sliding time window T_win, and take the maximum value in the sliding time window T_win as the maximum network delay RTT_max.
[0073] Step S3031, if the network delay statistical information indicates that the network delay satisfies the delay threshold condition, then when the network packet loss statistical information indicates that the network packet loss satisfies the network packet loss threshold condition, the number of redundant packets is set to a first preset value; when the network packet loss statistical information indicates that the network packet loss does not satisfy the network packet loss threshold condition, the number of redundant packets is determined based on the network packet loss statistical information and the second preset value.
[0074] In this step, under the condition that the maximum network delay RTT_max is less than the network delay threshold TH_rtt, it can be further determined whether the network packet loss represented by the network packet loss statistics can meet the network packet loss threshold condition.
[0075] Specifically, the network packet loss statistics may include the maximum continuous packet loss number ContLoss_max within a certain period of time. The sending end 110 further determines whether the maximum continuous packet loss number ContLoss_max is less than or equal to the maximum continuous packet loss threshold. The maximum continuous packet loss threshold can be 1, that is, if the maximum continuous packet loss number ContLoss_max is less than or equal to 1, the sending end 110 determines that the network packet loss statistics represent that the network packet loss meets the network packet loss threshold condition; if the maximum continuous packet loss number ContLoss_max is greater than 1, the sending end 110 determines that the network packet loss statistics represent that the network packet loss does not meet the network packet loss threshold condition.
[0076] Furthermore, when the network packet loss statistical information indicates that the network packet loss satisfies the network packet loss threshold condition, the sending end 110 sets the number of redundant packets to a first preset value, which may be 0, that is, when the maximum number of consecutive packet losses ContLoss_max is less than or equal to 1, the sending end 110 may set the number of redundant packets to 0; when the network packet loss statistical information indicates that the network packet loss does not satisfy the network packet loss threshold condition, that is, when the maximum number of consecutive packet losses ContLoss_max is greater than 1, the sending end 110 may further determine the number of redundant packets based on the network packet loss statistical information and the second preset value.
[0077] Among them, for the maximum continuous packet loss number ContLoss_max, when the sending end 110 receives the ACK information, the sending end 110 can count the number of packet losses stored in the packet number threshold TH_blockSize interval according to the maximum packet sequence number Seq_max of the ACK, and obtain a maximum packet loss number Loss_sample, and use it as one of the maximum packet loss number samples in the sliding time window T_win, and take the maximum value in the sliding time window T_win as the maximum continuous packet loss number ContLoss_max.
[0078] Step S3032: If the network delay statistical information indicates that the network delay does not meet the delay threshold condition, then when the network packet loss statistical information indicates that the network packet loss meets the network packet loss threshold condition, the number of redundant packets is set to a third preset value; when the network packet loss statistical information indicates that the network packet loss does not meet the network packet loss threshold condition, the number of redundant packets is determined based on the network packet loss statistical information and the second preset value.
[0079] This step can be performed under the condition that the maximum network delay RTT_max is greater than or equal to the network delay threshold TH_rtt, and then it is determined whether the network packet loss statistical information indicating the network packet loss can meet the network packet loss threshold condition, and the judgment process can be performed in the manner described in the above steps. Therefore, when the network packet loss statistical information indicates that the network packet loss meets the network packet loss threshold condition, that is, the sending end 110 sets the number of redundant packets to the third preset value, and the third preset value can be 1, that is, when the maximum continuous packet loss number ContLoss_max is less than or equal to 1, the sending end 110 can set the number of redundant packets to 1; when the network packet loss statistical information indicates that the network packet loss does not meet the network packet loss threshold condition, that is, when the maximum continuous packet loss number ContLoss_max is greater than 1, the sending end 110 can further determine the number of redundant packets based on the network packet loss statistical information and the second preset value.
[0080] Further, in one embodiment, the determining of the number of redundant packets according to the network packet loss statistics and the second preset value in the above step S3031 and step S3032 specifically includes:
[0081] According to the network packet loss statistics, the maximum number of consecutive packet losses is obtained; according to the smaller value between the maximum number of consecutive packet losses and a second preset value, the number of redundant packets is obtained.
[0082] In this embodiment, when the network packet loss statistics indicate that the network packet loss does not meet the network packet loss threshold condition, the transmitting end 110 may obtain the maximum number of consecutive packet losses ContLoss_max in the network packet loss statistics, and obtain the number of redundant packets according to the smaller value of the maximum number of consecutive packet losses ContLoss_max and the second preset value. Specifically, the second preset value may be the minimum number of redundant packets N_min set based on experience. When the maximum number of consecutive packet losses ContLoss_max is greater than 1, the transmitting end 110 sets the number of redundant packets N_redundancy to the smaller value of the maximum number of consecutive packet losses ContLoss_max and the second preset value N_min, that is, the number of redundant packets N_redundancy = min (ContLoss_max, N_min).
[0083] The above-mentioned embodiment can determine the number of redundant packets and the number of source packets according to the RTT status and packet loss status of the network during the FEC operation phase, thereby adapting to changes in the network environment in real time and adjusting FEC parameters.
[0084] In some embodiments, the timing of sending the redundant data packet may be determined before step S204 by the following steps, including:
[0085] Obtain the detected network bandwidth and data transmission flow statistics information; and determine whether the network transmission status meets the redundant packet sending condition based on the network bandwidth and data transmission flow statistics information.
[0086] In this embodiment, after obtaining the redundant data packet, the transmitting end 110 first determines whether the current network transmission state meets the redundant packet sending condition, and does not send the redundant data packet if the current network transmission state does not meet the redundant packet sending condition. Specifically, the transmitting end 110 obtains the detected network bandwidth and data transmission flow statistics information, wherein the transmitting end 110 can detect the network bandwidth through conventional network bandwidth detection algorithms such as bottleneck bandwidth and round-trip propagation time (BBR), Google Congestion Control (GCC), etc., and can also count the data transmission flow statistics information within the time period T_duration, such as the data transmission flow mean, the data retransmission flow mean, etc. In actual applications, the transmitting end 110 can obtain the data uplink network bandwidth, the data uplink flow mean, and the uplink retransmission flow mean, and judge whether the network transmission state meets the redundant packet sending condition according to the data uplink network bandwidth, the data uplink flow mean, and the uplink retransmission flow mean, so as to reasonably and fully utilize the network transmission resources.
[0087] In one embodiment, further, judging whether the network transmission status meets the redundant packet sending condition according to the network bandwidth and the data transmission flow statistics information in the above embodiment may specifically include:
[0088] If the network bandwidth is greater than or equal to the mean data transmission flow in the data transmission flow statistics information, it is determined that the network transmission status meets the redundant packet sending conditions; if the network bandwidth is less than the mean data transmission flow, then when the mean data transmission flow is less than or equal to the data transmission flow threshold, or when the mean data retransmission flow in the data transmission flow statistics information is less than or equal to the data retransmission flow threshold, it is determined that the network transmission status meets the redundant packet sending conditions.
[0089] In this embodiment, the sending end 110 may first determine whether the network bandwidth for uplink data is sufficient. If the network bandwidth is sufficient, redundant data packets may be sent. If the network bandwidth is not sufficient, it is necessary to further determine whether the uplink traffic and uplink retransmission of the data are both limited. If both the uplink traffic and uplink retransmission are limited, redundant data packets will not be sent. Otherwise, redundant data packets may be sent.
[0090] Specifically, if the network bandwidth BW_probe for uplink data detected by the sending end 110 is greater than or equal to the data transmission flow average Flow_avg in the data transmission flow statistical information, that is, BW_probe≥Flow_avg, then the sending end 110 determines that the network bandwidth for uplink data is sufficient, that is, the network transmission status meets the redundant packet sending conditions; if BW_probe<Flow_avg, then the sending end 110 determines that the network bandwidth for uplink data is not sufficient. At this time, the sending end 110 further determines whether the uplink flow and uplink retransmission of the data are limited at the same time.
[0091] Among them, if the sending end 110 determines that the data transmission flow average Flow_avg is greater than the data transmission flow threshold Upload_limit, that is, Flow_avg>Upload_limit, then the sending end 110 determines that the uplink flow is limited, wherein the data transmission flow threshold Upload_limit=data encoding code rate EncodeRate×preset multiple Multiple, and the empirical value of the preset multiple Multiple can be 2; if the sending end 110 determines that the data retransmission flow average ResendFlow_avg in the data transmission flow statistical information is greater than the data retransmission flow threshold Resend_limit, that is, ResendFlow_avg>Resend_limit, then the sending end 110 determines that the uplink retransmission is limited, wherein the data retransmission flow threshold Resend_limit=Flow_avg×Resend_multiple, Resend_multiple is the preset retransmission limit multiple, and the data retransmission flow threshold Resend_limit∈[retransmission flow threshold lower limit Resend_min, retransmission flow threshold upper limit Resend_max].
[0092] Therefore, if the sending end 110 determines that the data transmission flow average Flow_avg is less than or equal to the data transmission flow threshold Upload_limit, or the data retransmission flow average ResendFlow_avg is less than or equal to the data retransmission flow threshold Resend_limit, then the sending end 110 can determine that the uplink flow and uplink retransmission of the data are not restricted at the same time, and determine that the network transmission status meets the redundant packet sending conditions.
[0093] In practical applications, the data forward error correction processing method provided by this application can be applied to the processing of real-time audio and video data of live broadcasts on the Internet. Figure 1 The sending end 110 shown may be a server for live broadcasting on the Internet, and the receiving end 120 may be a terminal used by viewers in the live broadcasting on the Internet. The sending end 110 is used to send the real-time audio and video data of the host in the live broadcasting on the Internet to the receiving end 120 . By applying the data forward error correction processing method provided by the present application, in live broadcasting, the sending end 110 can determine the timing of FEC operation according to the network status and the status of the source packets of the real-time audio and video data, determine the number of source packets and redundant packets of FEC encoding according to the network packet loss status and the round-trip delay, and generate corresponding redundant packets, and decide whether to send FEC redundant packets to the receiving end 120 according to the network bandwidth information. After receiving the packet, the receiving end 120 can record the network packet loss status information, perform forward error correction decoding when there is a packet loss event, and feed back the receiving status information to the sending end 110. The sending end 110 can adjust the network status in time and update the FEC queue information, thereby achieving real-time adaptation to changes in network status during live broadcasting, timely tracking changes in the network environment, adjusting forward error correction parameters of real-time audio and video data, effectively utilizing network transmission resources to transmit real-time audio and video data of live broadcasting, improving the transmission quality of real-time audio and video data of live broadcasting under various network conditions, avoiding problems such as intermittent, stuck, and poor real-time performance of live broadcasting audio and video caused by complex wireless environment and limited bandwidth, and improving the service experience of live broadcasting.
[0094] The data forward error correction processing method provided by this application is described below with reference to application examples. Figure 4 The example application scenario diagram is shown, which includes an audio stream sending end 410 and an audio stream receiving end 420. The audio stream sending end 410 may include an audio source, a network status tracking unit, an FEC calculation unit, and a sending unit.
[0095] Among them, the FEC operation unit in the audio stream sending end 410 stores the original data packets (or source packets, audio packets) output by the audio source and determines the timing of the FEC operation, and determines the number of source packets and redundant packets of the FEC operation, and finally performs FEC operation to generate redundant data packets (or redundant packets). Specifically, the FEC operation unit provides an FEC queue, stores the source packets output by the audio source, adds the source packets output by the audio source into the FEC queue, records the number of original data packets entering the FEC queue L_fecQueue and the time T_firstFecQueue of the first audio packet entering the FEC queue. The FEC operation unit determines whether the FEC operation can be performed based on the storage status of the original data packets in the FEC queue and the round-trip delay RTT. When one of the following conditions (1) and (2) is met, the FEC operation is performed. Condition (1) The duration of data packets stored is greater than the storage duration threshold, that is, the difference between the current time T1_now and the time T_firstFecQueue of the first audio packet in the queue is greater than the storage duration threshold TH_timeout, that is, T1_now-T_firstFecQueue>TH_timeout, where the storage duration threshold TH_timeout=network delay smoothing value RTT_smooth, and the network delay smoothing value RTT_smooth can be calculated by the network status tracking unit. Condition (2) The number of stored data packets L_fecQueue is greater than the storage packet number threshold TH_bolckSize, that is, L_fecQueue>TH_bolckSize, where the storage packet number threshold TH_bolckSize=[network delay smoothing value RTT_smooth / duration of an audio packet Duration_pkt].
[0096] After determining that the FEC operation can be performed, the FEC operation unit determines the number of source packets M_block and the number of redundant packets N_redundancy for the FEC operation according to the RTT status and packet loss status of the network. Among them, the number of source packets M_block is the number of original data packets in the FEC queue L_fecQueue, that is, M_block = L_fecQueue. The method for determining the number of redundant packets N_redundancy is:
[0097] When the maximum round-trip delay RTT_max is less than the set round-trip delay threshold TH_rtt, that is, RTT_max<TH_rtt, if the maximum continuous packet loss number ContLoss_max≤1, the redundant packet number N_redundancy=0; if the maximum continuous packet loss number ContLoss_max>1, the redundant packet number N_redundancy=min(ContLoss_max, N_min).
[0098] When the maximum round-trip delay RTT_max is greater than or equal to the set round-trip delay threshold TH_rtt, that is, RTT_max≥TH_rtt, if the maximum continuous packet loss number ContLoss_max≤1, the redundant packet number N_redundancy=1; if the maximum continuous packet loss number ContLoss_max>1, the redundant packet number N_redundancy=min(ContLoss_max, N_min).
[0099] Among them, the maximum round-trip delay RTT_max and the maximum continuous packet loss number ContLoss_max can be obtained from the network status tracking unit, and the round-trip delay threshold TH_rtt and the minimum redundant packet number N_min can be empirically set values.
[0100] After the FEC operation unit in the audio stream transmitter 410 determines and obtains the number of source packets M_block and the number of redundant packets N_redundancy, the original data packet can be encoded using the Cauchy matrix to obtain the encoded data [d1, ..., dm, r1, ..., rn], where m represents the number of source packets M_block, n represents the number of redundant packets N_redundancy, [d1, ..., dm] represents the original data packet, and [r1, ..., rn] represents the redundant data packet obtained by the FEC operation.
[0101] The sending unit in the audio stream sending end 410 can provide sending traffic statistics and network bandwidth detection functions, and decide whether to send redundant packets generated by FEC according to the network status. The sending unit can add attribute information to the source packet and the redundant packet and send them to the audio stream receiving end 420 through the User Datagram Protocol (UDP).
[0102] Specifically, the sending unit supports traffic statistics and network bandwidth detection functions. It can count the average uplink audio traffic Flow_avg and the average uplink retransmission traffic ResendFlow_avg within the statistical time period T_duration, and can also use network bandwidth detection algorithms such as Bottleneck Bandwidth and Round-trip propagation time (BBR) and Google Congestion Control (GCC) to detect and obtain the network bandwidth BW_probe.
[0103] Among them, the sending unit decides whether to send redundant packets according to the network status. The sending unit first determines whether the audio uplink network bandwidth is sufficient. If the bandwidth is sufficient, the redundant packets are sent; if the bandwidth is not sufficient, it is necessary to further determine whether the uplink audio traffic is limited and whether the uplink retransmission is limited. If the uplink audio traffic and the uplink retransmission are both limited, the redundant packets are not sent. If they are not limited at the same time, the redundant packets can be sent. Specifically, if the network bandwidth BW_probe is less than the uplink audio traffic average value Flow_avg, it means that the uplink bandwidth is insufficient, otherwise it means that the uplink bandwidth is sufficient. If the uplink audio traffic average value Flow_avg is greater than the set uplink audio traffic threshold Upload_limit, it means that the uplink audio traffic is limited, wherein the uplink audio traffic threshold Upload_limit = audio encoding bit rate EncodeRate × preset multiple Multiple, and the preset multiple Multiple can be an empirical value of 2. If the uplink audio traffic average value Flow_avg is greater than the set uplink retransmission traffic threshold Resend_limit, it means that uplink retransmission is limited, wherein the uplink retransmission traffic threshold Resend_limit = uplink audio traffic average value Flow_avg × Resend_multiple, and Resend_multiple is a preset uplink retransmission limit multiple.
[0104] The sending unit in the audio stream sending end 410 can use the UDP protocol to transmit source packets and redundant packets. The sent packets are marked as source packets or redundant packets. The source packets can be added with attribute information such as the packet sequence number and the sending time. The redundant packets can be added with attribute information such as the number of source packets M_block, the number of redundant packets N_redundancy, the starting source packet sequence number Seq_start participating in the FEC operation, and the group sequence number Group_id of the FEC operation, so that the audio stream receiving end 420 can count the packet receiving status and perform FEC recovery after receiving the packet.
[0105] The audio stream receiving end 420 can generate an acknowledgment (ACK) information based on the packet receiving status and feed it back to the audio stream transmitting end 410, and check whether FEC decoding can be performed to recover the source packet based on the packet loss status. Specifically, after the audio stream receiving end 420 successfully receives the packet, it counts the packet receiving status within a packet sequence number interval based on the sent packet sequence number, and marks each sequence number bit by bit whether the packet is successfully received, generates the packet receiving status RecvStatus, and feeds back the ACK information to the audio stream transmitting end 410. Among them, the audio stream receiving end 420 can add the received source packet and redundant packet to the receiving queue. If packet loss is found, combined with the source packet number M_block, the redundant packet number N_redundancy, the starting source packet sequence number Seq_start participating in the FEC operation, the group sequence number Group_id of the FEC operation and other attribute information in the redundant packet, if the lost packet meets a set of FEC decoding recovery conditions, the FEC corresponding decoding algorithm can be used to recover the source packet.
[0106] The function of the network status tracking unit in the audio stream sending end 410 is to track the packet loss and round-trip time (RTT) status of the network, and to update the FEC queue status in the FEC operation unit in a timely manner according to the ACK information.
[0107] Specifically, the network status tracking unit tracks the packet loss status and round-trip delay RTT status of the network according to the received ACK information. The network status tracking unit calculates the maximum continuous packet loss number ContLoss_max as follows: when the ACK information is received, the number of packet losses in the TH_blockSize interval is counted forward according to the maximum packet sequence number Seq_max of the ACK, and a maximum packet loss number Loss_sample is obtained, and it is used as a sample in the sliding time window T_win, and the maximum value in the sliding time window T_win is taken as the maximum continuous packet loss number ContLoss_max. The network status tracking unit calculates the maximum round-trip delay RTT_max as follows: the network status tracking unit can obtain an RTT sample RTT_cur according to the time T2_now when the ACK information is received and the time T_stamp of the ACK confirmation packet, RTT_cur=T2_now-T_stamp, and use it as a sample in the sliding time window T_win, and take the maximum value in the sliding time window T_win as the maximum round-trip delay RTT_max. The network status tracking unit can also calculate the network delay smoothing value RTT_smooth: the network status tracking unit uses a first-order exponential smoothing method to calculate the network delay smoothing value RTT_smooth, that is, RTT_smooth(t) = α·RTT_cur+(1-α)·RTT_smooth(t-1), RTT_smooth(t) and RTT_smooth(t-1) are the RTT smoothing values at time t and t-1 respectively. The smoothing index α can select different parameters according to the mode of the application scenario. For example, a larger smoothing index such as 0.2 is selected for the low-delay scenario mode. The initial value of RTT_smooth can select the first received RTT value.
[0108] The network status tracking unit in the audio stream transmitter 410 updates the source packet status in the FEC queue according to the ACK information. Specifically, when the source packet has been successfully received by the audio stream receiver 420, the source packet is deleted from the FEC queue, and the time T_firstFecQueue of the first audio packet in the FEC queue is updated. Each time a source packet is successfully received, T_firstFecQueue is moved back by the duration of a source packet, that is, T_firstFecQueue=T_firstFecQueue+Duration_pkt.
[0109] In this application example, the audio stream transmitter 410 can determine the timing of FEC operation according to the network status and the status of the audio source packet, determine the number of source packets and redundant packets for FEC encoding and generate redundant packets according to the network packet loss status and the round-trip delay, and decide whether to send FEC redundant packets according to the network bandwidth information. After receiving the packet, the audio stream receiver 420 can record the network packet loss status information, perform forward error correction decoding when there is a packet loss event, and feed back the receiving status information to the audio stream transmitter 410. The audio stream transmitter 410 adjusts the network status in time and updates the FEC queue information, so as to adapt to the changes in network status in real time, effectively utilize network transmission resources, improve the transmission quality of real-time audio streams in various network scenarios, and improve the actual business experience.
[0110] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0111] Based on the same inventive concept, the embodiment of the present application also provides a data forward error correction processing device for implementing the data forward error correction processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations of one or more data forward error correction processing device embodiments provided below can refer to the limitations of the data forward error correction processing method above, and will not be repeated here.
[0112] In one embodiment, Figure 5 As shown, a data forward error correction processing device is provided, and the device 500 may include:
[0113] An acquisition module 501 is used to acquire the storage status of the original data packet of the forward error correction queue;
[0114] A determination module 502 is configured to determine the number of redundant packets according to the network delay and the network packet loss information if the storage state of the original data packet meets the forward error correction operation condition characterized by the network delay;
[0115] A generating module 503, configured to generate redundant data packets corresponding to the original data packets in the forward error correction queue according to the number of redundant packets;
[0116] The sending module 504 is used to send the redundant data packet to the receiving end if the network transmission status meets the redundant packet sending condition, so that the receiving end can use the redundant data packet to restore the original data packet when the received original data packet is lost.
[0117] In one embodiment, the storage status of the original data packet includes the storage time length of the data packet; the determination module 502 is also used to determine the storage time length threshold based on the network delay smoothing value; if the storage time length of the data packet is greater than the storage time length threshold, it is determined that the storage status of the original data packet meets the forward error correction operation condition.
[0118] In one embodiment, the original data packet storage status includes the number of stored data packets; the determination module 502 is also used to obtain a stored packet number threshold based on the ratio of the network delay smoothing value to the unit time length of the data packet; if the number of stored data packets is greater than the stored packet number threshold, it is determined that the original data packet storage status meets the forward error correction operation condition.
[0119] In one embodiment, the determination module 502 is further used to obtain network delay statistical information and network packet loss statistical information; if the network delay statistical information indicates that the network delay satisfies the delay threshold condition, then when the network packet loss statistical information indicates that the network packet loss satisfies the network packet loss threshold condition, the number of redundant packets is set to a first preset value, and when the network packet loss statistical information indicates that the network packet loss does not satisfy the network packet loss threshold condition, the number of redundant packets is determined according to the network packet loss statistical information and the second preset value; if the network delay statistical information indicates that the network delay does not satisfy the delay threshold condition, then when the network packet loss statistical information indicates that the network packet loss satisfies the network packet loss threshold condition, the number of redundant packets is set to a third preset value, and when the network packet loss statistical information indicates that the network packet loss does not satisfy the network packet loss threshold condition, the number of redundant packets is determined according to the network packet loss statistical information and the second preset value.
[0120] In one embodiment, the determination module 502 is further configured to obtain a maximum number of consecutive packet losses according to the network packet loss statistics information; and obtain the number of redundant packets according to a smaller value between the maximum number of consecutive packet losses and a second preset value.
[0121] In one embodiment, the sending module 504 is further used to obtain the detected network bandwidth and data transmission flow statistics information; and determine whether the network transmission status meets the redundant packet sending condition based on the network bandwidth and data transmission flow statistics information.
[0122] In one embodiment, the sending module 504 is further used to determine that the network transmission status meets the redundant packet sending condition if the network bandwidth is greater than or equal to the data transmission flow mean in the data transmission flow statistical information; if the network bandwidth is less than the data transmission flow mean, then when the data transmission flow mean is less than or equal to the data transmission flow threshold, or when the data retransmission flow mean in the data transmission flow statistical information is less than or equal to the data retransmission flow threshold, determine that the network transmission status meets the redundant packet sending condition.
[0123] Each module in the above-mentioned data forward error correction processing device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory in the electronic device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0124] In one embodiment, an electronic device is provided. The electronic device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The electronic device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device can be used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data forward error correction processing method is implemented.
[0125] In one embodiment, an electronic device is provided. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 7As shown. The electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a data forward error correction processing method is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covered on the display screen, or a button, a trackball or a touch pad set on the housing of the electronic device, or an external keyboard, touch pad or mouse, etc.
[0126] Those skilled in the art will understand that Figure 6 and Figure 7 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0127] In one embodiment, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0128] Obtain the storage status of the original data packet of the forward error correction queue; if the storage status of the original data packet meets the forward error correction operation condition represented by the network delay, determine the number of redundant packets according to the network delay and network packet loss information; generate redundant data packets corresponding to the original data packets in the forward error correction queue according to the number of redundant packets; if the network transmission status meets the redundant packet sending condition, send the redundant data packet to the receiving end, so that the receiving end can use the redundant data packet to recover the original data packet when the received original data packet is lost.
[0129] In one embodiment, the original data packet storage state includes the length of time the data packet has been stored; when the processor executes the computer program, the following steps are also implemented:
[0130] A storage duration threshold is determined according to the network delay smoothing value; if the storage duration of the data packet is greater than the storage duration threshold, it is determined that the storage state of the original data packet meets the forward error correction operation condition.
[0131] In one embodiment, the original data packet storage state includes the number of stored data packets; when the processor executes the computer program, the following steps are also implemented:
[0132] A stored packet number threshold is obtained according to the ratio of the network delay smoothing value to the unit time length of the data packet; if the number of stored data packets is greater than the stored packet number threshold, it is determined that the original data packet storage state meets the forward error correction operation condition.
[0133] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0134] Obtain network delay statistical information and network packet loss statistical information; if the network delay statistical information indicates that the network delay satisfies the delay threshold condition, then when the network packet loss statistical information indicates that the network packet loss satisfies the network packet loss threshold condition, the number of redundant packets is set to a first preset value, and when the network packet loss statistical information indicates that the network packet loss does not satisfy the network packet loss threshold condition, the number of redundant packets is determined according to the network packet loss statistical information and the second preset value; if the network delay statistical information indicates that the network delay does not satisfy the delay threshold condition, then when the network packet loss statistical information indicates that the network packet loss satisfies the network packet loss threshold condition, the number of redundant packets is set to a third preset value, and when the network packet loss statistical information indicates that the network packet loss does not satisfy the network packet loss threshold condition, the number of redundant packets is determined according to the network packet loss statistical information and the second preset value.
[0135] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0136] The maximum number of consecutive packet losses is obtained according to the network packet loss statistics information; and the number of redundant packets is obtained according to the smaller value between the maximum number of consecutive packet losses and a second preset value.
[0137] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0138] Obtaining the detected network bandwidth and data transmission flow statistics information; judging whether the network transmission status satisfies the redundant packet sending condition according to the network bandwidth and data transmission flow statistics information.
[0139] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0140] If the network bandwidth is greater than or equal to the mean data transmission flow in the data transmission flow statistical information, it is determined that the network transmission status meets the redundant packet sending condition; if the network bandwidth is less than the mean data transmission flow, then when the mean data transmission flow is less than or equal to the data transmission flow threshold, or when the mean data retransmission flow in the data transmission flow statistical information is less than or equal to the data retransmission flow threshold, it is determined that the network transmission status meets the redundant packet sending condition.
[0141] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0142] Obtain the storage status of the original data packet of the forward error correction queue; if the storage status of the original data packet meets the forward error correction operation condition represented by the network delay, determine the number of redundant packets according to the network delay and network packet loss information; generate redundant data packets corresponding to the original data packets in the forward error correction queue according to the number of redundant packets; if the network transmission status meets the redundant packet sending condition, send the redundant data packet to the receiving end, so that the receiving end can use the redundant data packet to recover the original data packet when the received original data packet is lost.
[0143] In one embodiment, the original data packet storage state includes the length of time the data packet has been stored; when the computer program is executed by the processor, the following steps are also implemented:
[0144] A storage duration threshold is determined according to the network delay smoothing value; if the storage duration of the data packet is greater than the storage duration threshold, it is determined that the storage state of the original data packet meets the forward error correction operation condition.
[0145] In one embodiment, the original data packet storage state includes the number of stored data packets; when the computer program is executed by the processor, the following steps are also implemented:
[0146] A stored packet number threshold is obtained according to the ratio of the network delay smoothing value to the unit time length of the data packet; if the number of stored data packets is greater than the stored packet number threshold, it is determined that the original data packet storage state meets the forward error correction operation condition.
[0147] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0148] Obtain network delay statistical information and network packet loss statistical information; if the network delay statistical information indicates that the network delay satisfies the delay threshold condition, then when the network packet loss statistical information indicates that the network packet loss satisfies the network packet loss threshold condition, the number of redundant packets is set to a first preset value, and when the network packet loss statistical information indicates that the network packet loss does not satisfy the network packet loss threshold condition, the number of redundant packets is determined according to the network packet loss statistical information and the second preset value; if the network delay statistical information indicates that the network delay does not satisfy the delay threshold condition, then when the network packet loss statistical information indicates that the network packet loss satisfies the network packet loss threshold condition, the number of redundant packets is set to a third preset value, and when the network packet loss statistical information indicates that the network packet loss does not satisfy the network packet loss threshold condition, the number of redundant packets is determined according to the network packet loss statistical information and the second preset value.
[0149] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0150] The maximum number of consecutive packet losses is obtained according to the network packet loss statistics information; and the number of redundant packets is obtained according to the smaller value between the maximum number of consecutive packet losses and a second preset value.
[0151] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0152] Obtaining the detected network bandwidth and data transmission flow statistics information; judging whether the network transmission status satisfies the redundant packet sending condition according to the network bandwidth and data transmission flow statistics information.
[0153] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0154] If the network bandwidth is greater than or equal to the mean data transmission flow in the data transmission flow statistical information, it is determined that the network transmission status meets the redundant packet sending condition; if the network bandwidth is less than the mean data transmission flow, then when the mean data transmission flow is less than or equal to the data transmission flow threshold, or when the mean data retransmission flow in the data transmission flow statistical information is less than or equal to the data retransmission flow threshold, it is determined that the network transmission status meets the redundant packet sending condition.
[0155] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory or other media used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The processor involved in each embodiment provided in this application can be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, etc., but is not limited thereto.
[0156] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0157] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A data forward error correction processing method, characterized in that: The method comprises: Obtain the original data packet storage status of the forward error correction queue; If the storage state of the original data packet meets the forward error correction operation condition represented by the network delay, the number of redundant packets is determined according to the network delay and the network packet loss information; wherein, when the network delay represents that the network delay meets the delay threshold condition, then when the network packet loss represents that the network packet loss meets the network packet loss threshold condition, the number of redundant packets is set to 0, otherwise the number of redundant packets is determined according to the network packet loss statistical information and the second preset value; when the network delay represents that the network delay does not meet the delay threshold condition, then when the network packet loss represents that the network packet loss meets the network packet loss threshold condition, the number of redundant packets is set to 1, otherwise the number of redundant packets is determined according to the network packet loss statistical information and the second preset value; the second preset value is the set minimum number of redundant packets; Generate redundant data packets corresponding to the original data packets in the forward error correction queue according to the number of redundant packets; Acquire the detected network bandwidth and data transmission flow statistics information; if the network bandwidth is greater than or equal to the data transmission flow mean in the data transmission flow statistics information, determine that the network transmission state meets the redundant packet sending condition; if the network bandwidth is less than the data transmission flow mean, then when the data transmission flow mean is less than or equal to the data transmission flow threshold, or when the data retransmission flow mean in the data transmission flow statistics information is less than or equal to the data retransmission flow threshold, determine that the network transmission state meets the redundant packet sending condition; if the network transmission state meets the redundant packet sending condition, send the redundant data packet to the receiving end, so that the receiving end can use the redundant data packet to recover the original data packet when the received original data packet is lost.
2. The method according to claim 1, characterized in that The original data packet storage state includes the length of time the data packet has been stored; if the original data packet storage state satisfies the forward error correction operation condition characterized by the network delay, before determining the number of redundant packets according to the network delay and the network packet loss information, the method further includes: Determine the storage duration threshold based on the network delay smoothing value; If the storage time length of the data packet is greater than the storage time length threshold, it is determined that the storage state of the original data packet meets the forward error correction operation condition.
3. The method according to claim 1, characterized in that The original data packet storage state includes the number of stored data packets; if the original data packet storage state satisfies the forward error correction operation condition characterized by the network delay, before determining the number of redundant packets according to the network delay and the network packet loss information, the method further includes: According to the ratio of the network delay smoothing value to the unit time length of the data packet, the threshold value of the number of stored packets is obtained; If the number of stored data packets is greater than the stored packet number threshold, it is determined that the storage state of the original data packet meets the forward error correction operation condition.
4. The method according to claim 1, characterized in that: The determining the number of redundant packets according to the network delay and network packet loss information includes: Obtain network delay statistics and network packet loss statistics; If the network delay statistical information indicates that the network delay satisfies the delay threshold condition, then when the network packet loss statistical information indicates that the network packet loss satisfies the network packet loss threshold condition, the number of redundant packets is set to a first preset value; when the network packet loss statistical information indicates that the network packet loss does not satisfy the network packet loss threshold condition, the number of redundant packets is determined according to the network packet loss statistical information and a second preset value; If the network delay statistical information indicates that the network delay does not meet the delay threshold condition, then when the network packet loss statistical information indicates that the network packet loss meets the network packet loss threshold condition, the number of redundant packets is set to a third preset value, and when the network packet loss statistical information indicates that the network packet loss does not meet the network packet loss threshold condition, the number of redundant packets is determined based on the network packet loss statistical information and the second preset value.
5. The method according to claim 4, characterized in that The determining the number of redundant packets according to the network packet loss statistical information and a second preset value includes: According to the network packet loss statistics information, a maximum number of consecutive packet losses is obtained; The number of redundant packets is obtained according to the smaller value between the maximum number of consecutive packet losses and a second preset value.
6. A data forward error correction processing device, characterized in that: The device comprises: An acquisition module, used for acquiring the storage status of the original data packet of the forward error correction queue; A determination module, for determining the number of redundant packets according to the network delay and the network packet loss information if the storage state of the original data packet satisfies the forward error correction operation condition represented by the network delay; wherein, when the network delay represents that the network delay satisfies the delay threshold condition, then when the network packet loss represents that the network packet loss satisfies the network packet loss threshold condition, the number of redundant packets is set to 0, otherwise the number of redundant packets is determined according to the network packet loss statistical information and a second preset value; when the network delay represents that the network delay does not meet the delay threshold condition, then when the network packet loss represents that the network packet loss satisfies the network packet loss threshold condition, the number of redundant packets is set to 1, otherwise the number of redundant packets is determined according to the network packet loss statistical information and a second preset value; the second preset value is the set minimum number of redundant packets; A generating module, used for generating redundant data packets corresponding to the original data packets in the forward error correction queue according to the number of redundant packets; A sending module, used to obtain the detected network bandwidth and data transmission flow statistics information; if the network bandwidth is greater than or equal to the data transmission flow mean in the data transmission flow statistics information, it is determined that the network transmission state meets the redundant packet sending condition; if the network bandwidth is less than the data transmission flow mean, then when the data transmission flow mean is less than or equal to the data transmission flow threshold, or when the data retransmission flow mean in the data transmission flow statistics information is less than or equal to the data retransmission flow threshold, it is determined that the network transmission state meets the redundant packet sending condition; if the network transmission state meets the redundant packet sending condition, the redundant data packet is sent to the receiving end, so that the receiving end can use the redundant data packet to recover the original data packet when the received original data packet is lost.
7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Adaptive error correction method for stream media transmission
CN101505202A
Video service quality-based hybrid selective repeat method
CN102075312A
Forward error correction method and system for streaming media transmission
CN108183774A
Forward error correction data generation method and device and electronic device
CN109889309A
Data transmission method and device
CN110247736A
