Network packet loss recovery method and device, equipment, storage medium and program product

By combining automatic retransmission requests and out-of-band forward error correction algorithms in audio and video communication scenarios, the anti-packet loss strategy is dynamically deployed, which solves the user experience problem when HARQ and FEC algorithms are executed independently, and achieves better packet loss recovery. performance and user experience.

CN118784167APending Publication Date: 2024-10-15BIGO TECH PTE LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411137808.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

In the existing technology, when the HARQ algorithm and the FEC algorithm are executed independently, the packet loss problem in audio and video communication scenarios cannot be effectively solved, resulting in poor user experience, link congestion, and playback delays.

Method used

By combining the automatic retransmission request algorithm and the out-of-band forward error correction algorithm in low code rate scenarios, the anti-packet loss algorithm is dynamically deployed, and the number of tolerated retransmissions and redundancy are calculated based on the real-time packet loss rate and round-trip delay to generate redundant data. Remaining packets to optimize packet loss recovery effect.

Benefits of technology

In low bitrate scenarios, the automatic retransmission request algorithm is preferred to reduce bandwidth usage, and the out-of-band forward error correction algorithm is added in a timely manner to improve packet loss recovery, enhance user experience, and reduce the adverse effects of different algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784167A_ABST
    Figure CN118784167A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a network packet loss recovery method and device, equipment, a storage medium and a program product, and the method comprises the steps: receiving a first real-time round-trip delay and a first real-time packet loss rate which are transmitted by a data receiving end under the condition that a currently set coding bit rate gear is a low bit rate gear, calculating first tolerant round-trip retransmission times according to the first real-time round-trip delay and the tolerant delay, sending a first retransmission packet to a data receiving end, and receiving first data packet recovery information fed back by the data receiving end based on the first retransmission packet; calculating a first recovery packet loss rate according to the first real-time packet loss rate and the first data packet recovery information; and under the condition that the sending frequency of the first retransmission packet reaches the first tolerated round-trip retransmission frequency and the first recovery packet loss rate is greater than the tolerated packet loss rate, calculating a first redundancy according to the first recovery packet loss rate and the tolerated packet loss rate, and sending a first redundancy packet generated corresponding to the first redundancy to a data receiving end. According to the scheme, a relatively good packet loss recovery effect is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of communication technology, and in particular, to a network packet loss recovery method, apparatus, device, storage medium, and program product. Background Art

[0002] With the rapid development of network technology and the popularization of smart terminal devices, various real-time audio and video communication scenarios are gradually becoming an important way of communication between users. However, due to the influence of network conditions and related adverse factors, packet loss is prone to occur during audio and video data transmission. Therefore, the industry has successively proposed various audio and video anti-packet loss technologies, such as ARQ (Automatic Repeat-reQuest) algorithm and FEC (Forward Error Correction) algorithm, aiming to ensure the real-time experience of users in audio and video communication scenarios.

[0003] In order to combine the advantages of different audio and video anti-packet loss technologies, the relevant technology uses the HARQ (Hybrid Automatic Repeat reQuest) algorithm for packet loss recovery. The HARQ algorithm includes the ARQ algorithm and the FEC algorithm. However, the HARQ algorithm simply controls the independent execution of the ARQ algorithm and the FEC algorithm, which will lead to the unavoidable large playback delay caused by the use of the ARQ algorithm, and the use of the FEC algorithm will occupy more transmission resources, aggravating the link congestion problem, and unable to achieve a good packet loss recovery effect. The user experience is poor and needs to be improved. Summary of the invention

[0004] The embodiments of the present application provide a network packet loss recovery method, apparatus, device, storage medium and program product, which solve the problem that the independent execution of the ARQ algorithm and the FEC algorithm is simply controlled in the related art, which cannot achieve a good packet loss recovery effect and has a poor user experience. It realizes the selection of anti-packet loss algorithms by effectively combining the transmission scenario characteristics corresponding to different coding bit rate gears, reduces the adverse effects of different anti-packet loss algorithms, and achieves a good packet loss recovery effect by combining the effects of the automatic retransmission request algorithm and the out-of-band forward error correction algorithm in low bit rate scenarios, thereby improving the user experience.

[0005] In a first aspect, an embodiment of the present application provides a network packet loss recovery method, the method comprising:

[0006] In the case where the currently set encoding bit rate gear is a low bit rate gear, receiving a first real-time round-trip delay and a first real-time packet loss rate sent by a data receiving end, calculating a first tolerable round-trip retransmission number according to the first real-time round-trip delay and the set tolerance delay, sending a first retransmission packet to the data receiving end, and receiving first data packet recovery information fed back by the data receiving end based on the first retransmission packet;

[0007] Calculating a first recovery packet loss rate according to the first real-time packet loss rate and the first data packet recovery information;

[0008] When the number of times the first retransmission packet is sent reaches the first tolerable round-trip retransmission number, and the first recovery packet loss rate is greater than the set tolerable packet loss rate, a first redundancy is calculated based on the first recovery packet loss rate and the tolerable packet loss rate, and a first redundant packet generated corresponding to the first redundancy is sent to the data receiving end.

[0009] In a second aspect, an embodiment of the present application further provides a network packet loss recovery device, the device comprising:

[0010] A retransmission packet sending module is configured to receive a first real-time round-trip delay and a first real-time packet loss rate sent by a data receiving end when the currently set encoding code rate gear is a low code rate gear, calculate a first tolerable round-trip retransmission number according to the first real-time round-trip delay and the set tolerance delay, and send a first retransmission packet to the data receiving end;

[0011] A recovery information receiving module, configured to receive first data packet recovery information fed back by the data receiving end based on the first retransmission packet;

[0012] a packet loss rate calculation module, configured to calculate a first recovery packet loss rate according to the first real-time packet loss rate and the first data packet recovery information;

[0013] The redundant packet sending module is configured to calculate a first redundancy based on the first recovery packet loss rate and the tolerable packet loss rate when the number of times the first retransmission packet is sent reaches the first tolerable round-trip retransmission number and the first recovery packet loss rate is greater than the set tolerable packet loss rate, and send a first redundant packet generated corresponding to the first redundancy to the data receiving end.

[0014] In a third aspect, an embodiment of the present application further provides a network packet loss recovery device, the device comprising:

[0015] one or more processors;

[0016] a storage device configured to store one or more programs,

[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the network packet loss recovery method described in the embodiment of the present application.

[0018] In a fourth aspect, an embodiment of the present application further provides a non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are configured to execute the network packet loss recovery method described in the embodiment of the present application.

[0019] In a fifth aspect, an embodiment of the present application further provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor of the device reads and executes the computer program from the computer-readable storage medium, so that the device executes the network packet loss recovery method described in the embodiment of the present application.

[0020] In an embodiment of the present application, when the currently set encoding code rate gear is a low code rate gear, a first real-time round-trip delay and a first real-time packet loss rate sent by a data receiving end are received, a first tolerable number of round-trip retransmissions is calculated according to the first real-time round-trip delay and the set tolerance delay, a first retransmission packet is sent to the data receiving end, and first data packet recovery information based on the first retransmission packet feedback by the data receiving end is received; a first recovery packet loss rate is calculated according to the first real-time packet loss rate and the first data packet recovery information; when the number of times the first retransmission packet is sent reaches the first tolerable number of round-trip retransmissions, and the first recovery packet loss rate is greater than the set tolerance packet loss rate, a first redundancy is calculated according to the first recovery packet loss rate and the tolerance packet loss rate, and a first redundant packet generated corresponding to the first redundancy is sent to the data receiving end. In the above scheme, by obtaining the currently set encoding bit rate gear to judge different bit rate scenarios, the anti-packet loss algorithm can be effectively selected in combination with the transmission scenario characteristics corresponding to different encoding bit rate gears, which is beneficial to reducing the adverse effects of different anti-packet loss algorithms; when the encoding bit rate gear is a low bit rate gear, it can be determined that the current bit rate scenario is a low bit rate scenario, and the automatic retransmission request algorithm is preferentially used for packet loss recovery, and the out-of-band forward error correction algorithm is not enabled temporarily to reduce the impact on the sending bandwidth; by judging the packet loss recovery effect of the automatic retransmission request algorithm based on the tolerated round-trip retransmission number and the tolerated packet loss rate, the role of the out-of-band forward error correction algorithm can be added in time when the expected packet loss recovery effect is not achieved, which is beneficial to achieve a better packet loss recovery effect by combining the effects of the automatic retransmission request algorithm and the out-of-band forward error correction algorithm, thereby improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A flowchart of a network packet loss recovery method provided in an embodiment of the present application;

[0022] Figure 2A flowchart of a network packet loss recovery method including a process of performing packet loss recovery in a medium bit rate scenario provided in an embodiment of the present application;

[0023] Figure 3 A flowchart of a network packet loss recovery method including a process of controlling whether to perform redundant encoding in a medium bit rate scenario provided by an embodiment of the present application;

[0024] Figure 4 A flowchart of a network packet loss recovery method including a process of sending redundant packets in a medium bit rate scenario provided by an embodiment of the present application;

[0025] Figure 5 A flowchart of a network packet loss recovery method including a process of performing packet loss recovery in a high bit rate scenario provided in an embodiment of the present application;

[0026] Figure 6 A flowchart of a network packet loss recovery method including a process of sending redundant packets in a high bit rate scenario provided by an embodiment of the present application;

[0027] Figure 7 A flowchart of a network packet loss recovery method including a process of controlling whether to send a retransmission packet in a high bit rate scenario provided in an embodiment of the present application;

[0028] Figure 8 A structural block diagram of a network packet loss recovery device provided in an embodiment of the present application;

[0029] Fig. 9 A schematic diagram of the structure of a network packet loss recovery device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than to limit the embodiments of the present application. It should also be noted that, for ease of description, only parts related to the embodiments of the present application are shown in the accompanying drawings, rather than all structures.

[0031] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0032] The network packet loss recovery method provided in the embodiment of the present application can be used to determine the current bit rate scenario according to the currently set encoding bit rate gear, and dynamically schedule different anti-packet loss algorithms to cooperate according to network protocol information such as real-time packet loss rate and real-time round-trip delay, so as to reduce the transmission traffic while improving the anti-packet loss effect. This method can be applied to audio and video scenarios with high real-time requirements. Related application scenarios include video calls, online meetings, video live broadcasts, etc. The several application scenarios listed above are only exemplary and explanatory. In actual applications, the network packet loss recovery method can also be used in real-time communications in other scenarios, and the embodiment of the present application does not limit this.

[0033] In the network packet loss recovery method provided in the embodiment of the present application, the executor of each step can be a computer device, which refers to any electronic device with data calculation, processing and storage capabilities, such as mobile phones, PCs (Personal Computers), tablet computers and other terminal devices, and can also be servers and other devices, which are not limited in the embodiment of the present application.

[0034] In the related technology, commonly used anti-packet loss technologies include ARQ algorithm, out-of-band FEC algorithm and OPUS in-band FEC algorithm. Among them, the main implementation process of the ARQ algorithm is: when packet loss occurs in a series of continuous media packets sent by the data sender, the data receiver can notify the data sender of the lost data packet based on the previous and subsequent sending and receiving packet information. After the data sender receives the feedback from the data receiver, it immediately sends a retransmission packet. This process can be repeated many times. The ARQ algorithm is more efficient because it only retransmits the lost packets. However, since a complete round-trip delay cycle is required to resend the lost data packets to the data receiver, the playback delay may be greatly increased, and the retransmitted data packets may still be lost, resulting in additional sending traffic, squeezing bandwidth, and failing to achieve the effect of recovering lost packets, causing a higher packet loss rate in high-latency scenarios. The main implementation process of the out-of-band FEC algorithm is as follows: when the data transmitter predicts packet loss, each time it sends N data packets, it will send K additional redundant packets through a separate channel or an additional transmission path. As long as the data receiver receives at least N of the N+K packets, it can recover all N data packets. The out-of-band FEC algorithm can introduce less recovery delay by sending redundant packets in advance, and the data receiver can actively recover when packet loss is found. It can be applied to scenarios with high latency and high packet loss, but it consumes high transmission traffic, which will occupy the transmission bandwidth space of the original data packet, thereby aggravating uplink bandwidth congestion and causing additional packet loss. The main implementation process of the OPUS in-band FEC algorithm is as follows: the OPUS in-band FEC algorithm can be selectively enabled during encoding. After it is enabled, the encoder will allocate a portion of the bandwidth for the compilation of redundant information based on the ratio of the set bit rate. For example, when encoding the nth frame, the information of the nkth frame will be carried, where k is an adjustable item, usually set between 3-6, which is equivalent to carrying any frame of information from the 3rd frame to the 6th frame before the nth frame. When the data receiving end receives the nth original audio packet, it can reply with the nkth original audio packet through the nth original audio packet. Compared with the out-of-band FEC algorithm, the OPUS in-band FEC algorithm embeds redundant information in the audio data stream. The redundant information is encoded and transmitted together with the audio data and sent through the same transmission path without the need for additional channels or transmission paths. However, the OPUS in-band FEC algorithm is only suitable for short-term data loss compensation. For long-term data loss, its error correction capability is limited and the bandwidth overhead of the audio data is increased. Under the same bit rate, it affects the bandwidth allocation of audio encoding, which will cause the sound quality of the original audio packet to be reduced in low encoding bit rate scenarios.

[0035] From the above, it can be seen that since the in-band FEC algorithm will occupy additional coding bit rate, it will affect the sound quality of the original packet in low bit rate scenarios. Therefore, it is suitable for activation in scenarios with medium and high bit rates, burst packet loss, and low packet loss rate. In addition, it is suitable for cooperating with the ARQ algorithm in scenarios with low packet loss rate and low round-trip delay, so that the retransmitted data packet also contains redundant information. Therefore, when the data receiving end receives the original audio packet N+K containing redundant information, it can not only obtain the N+Kth original audio packet, but also recover the Nth original audio packet. The out-of-band FEC algorithm is suitable for activation in scenarios with large delays and high packet loss rates. Since the ARQ algorithm is highly efficient, it can be used as the main anti-packet loss algorithm. For scenarios with high round-trip delay, it is necessary to control the number of retransmissions, and actively retransmit the retransmission packet containing redundant information or passively wait for the receiver's protocol packet to reply before sending the retransmission packet.

[0036] Based on this, the present application provides a network packet loss recovery method, apparatus, device, storage medium and program product, which aims to solve the problem that the independent execution of the ARQ algorithm and the FEC algorithm in the related technology is simply controlled, which cannot achieve a good packet loss recovery effect and has a poor user experience, and realizes dynamic allocation of the ARQ algorithm, out-of-band FEC algorithm and in-band FEC algorithm for packet loss recovery in different network scenarios, reduces the sending traffic, reduces the bandwidth, and improves the transmission reliability.

[0037] Figure 1 A flowchart of a network packet loss recovery method provided in an embodiment of the present application. The network packet loss recovery method is applied to a data sending end, such as Figure 1 As shown, the following steps are included:

[0038] Step S101, when the currently set encoding bit rate gear is a low bit rate gear, receive the first real-time round-trip delay and the first real-time packet loss rate sent by the data receiving end, calculate the first tolerable round-trip retransmission number according to the first real-time round-trip delay and the set tolerance delay, send a first retransmission packet to the data receiving end, and receive the first data packet recovery information fed back by the data receiving end based on the first retransmission packet.

[0039] Among them, the encoding bit rate set by the audio encoder of the data sending end is different according to different application scenarios. In the embodiment of the present application, the encoding bit rate of the data sending end is divided into three gears. Taking the data sending end as an example, the data sending end can set three encoding bit rates of 16k, 20k and 24k. 16k, 20k and 24k can be regarded as low bit rate gear, medium bit rate gear and high bit rate gear respectively. Of course, the specific bit rate classification can be adaptively adjusted by the developer according to the bit rate setting of the actual application scenario, and this application does not limit it. The data sending end can periodically receive the protocol information sent by the data sending end according to the transmission protocol. The protocol information may include key network information such as real-time packet loss rate, real-time round-trip delay, and confirmation message of the data packet, data packet recovery information, etc. Among them, the first tolerated round-trip retransmission number is the maximum number of times a data packet is allowed to be repeatedly sent after it is lost. Before sending the first retransmission packet to the data receiving end, the first tolerated round-trip retransmission number can be calculated based on the first real-time round-trip delay and the set tolerance delay. The tolerance delay is the maximum playback delay that the data receiving end can accept. Developers can make adaptive settings based on the delay perception of different users in actual application scenarios and device hardware information, which is not limited in this application. In one embodiment, the calculation formula for the first tolerated round-trip retransmission number is as follows:

[0040] MaxToleranceRetransTimes=ToleranceDelay / (RTT+K),

[0041] Among them, MaxToleranceRetransTimes is the first tolerated round-trip retransmission number, ToleranceDelay is the tolerated delay, RTT is the current real-time round-trip delay, and K is the compensation value. Developers can set it adaptively according to the system processing time, which is generally 100ms-200ms. In addition, in order to limit the repetition rate and playback delay, the upper limit of MaxToleranceRetransTimes can be set, for example, it can be set to 3.

[0042] Among them, since the ARQ algorithm is more efficient, the in-band FEC algorithm needs to encode redundant information together with the audio data, which is easy to affect the encoded sound quality of the original audio packet, while the out-of-band FEC algorithm needs to use an additional channel or transmission path. The ARQ algorithm can be enabled first to send the first retransmission packet to the data receiving end. In one embodiment, the data transmitting end can determine the first retransmission packet that needs to be retransmitted based on the confirmation message fed back by the data receiving end. In one embodiment, the data transmitting end can determine the first retransmission packet that needs to be retransmitted based on the set timeout mechanism. The first data packet recovery information can be a record of the recovery of the data packet after the data receiving end receives the first retransmission packet. For example, the first data packet recovery information can include the number of retransmission packets actually received by the data receiving end, and for another example, the first data packet recovery information can include the difference between the number of retransmission packets sent by the data transmitting end and the number of retransmission packets actually received by the data receiving end. Of course, different application scenarios and transmission protocols can also be provided with other specific contents of data packet recovery information, which are not limited in this application.

[0043] Step S102: Calculate a first recovery packet loss rate according to the first real-time packet loss rate and the first data packet recovery information.

[0044] Among them, the first recovered packet loss rate is the packet loss rate calculated after applying the ARQ algorithm for packet loss recovery. After sending the first retransmission packet to the data receiving end, the first recovered packet loss rate can be calculated based on the first real-time packet loss rate before each sending of the first retransmission packet and the first data packet recovery information obtained after sending the first retransmission packet. In one embodiment, the first data packet recovery information may include the number of retransmission packets actually received by the data receiving end. For example, the number of original data packets sent by the data sending end is m1, the number of first retransmission packets is n1, and the first real-time packet loss rate is l1. The number of retransmission packets actually received by the data receiving end is n2, then the calculation formula of the first recovered packet loss rate r1 is as follows:

[0045] r1=(m1×(1-l1)+n2) / (m1+n1).

[0046] In one embodiment, the first data packet recovery information may include the difference between the number of retransmitted packets sent by the data sending end and the number of retransmitted packets actually received by the data receiving end. For example, the number of original data packets sent by the data sending end is m2, the number of first retransmitted packets is n3, and the first real-time packet loss rate is l2. The difference in the number of retransmitted packets is k1. Then, the calculation formula of the first recovery packet loss rate r2 is as follows:

[0047] r2=(m2×(1-l2)+n3-k1) / (m2+n3).

[0048] Of course, the aforementioned calculation method of the first recovery packet loss rate can also be adaptively adjusted according to the specific content of the data packet recovery information set in different application scenarios and transmission protocols, and this application does not limit it here.

[0049] Step S103: When the number of times the first retransmission packet is sent reaches the first tolerable round-trip retransmission number and the first recovery packet loss rate is greater than the set tolerable packet loss rate, a first redundancy is calculated according to the first recovery packet loss rate and the tolerable packet loss rate, and a first redundant packet generated corresponding to the first redundancy is sent to the data receiving end.

[0050] Among them, the tolerated packet loss rate is the maximum packet loss rate that the data receiving end can accept. The developer can make adaptive settings based on the frame drop perception of different users in the actual application scenario and the regional network conditions, and this application does not limit it here. If the first recovery packet loss rate is less than the tolerated packet loss rate, it can be regarded that the current use of the ARQ algorithm can effectively recover from packet loss, and there is no need to use the FEC algorithm. If the number of times the first retransmission packet is sent reaches the first tolerated round-trip retransmission number, and the first recovery packet loss rate is always greater than the tolerated packet loss rate, it can be regarded that the use of the ARQ algorithm cannot effectively recover from packet loss, and the FEC algorithm needs to be added to enhance packet loss recovery. Since the use of the in-band FEC algorithm in a low bit rate scenario will greatly affect the encoding sound quality of the original audio packet, an out-of-band FEC algorithm can be selected to send redundant packets. In one embodiment, the product of the ratio of the first recovery packet loss rate and the tolerated packet loss rate and a preset calculation factor can be determined as the first redundancy. In one embodiment, the first redundancy is calculated as follows:

[0051]

[0052] Among them, N and K indicate that sending N data packets requires generating K redundant packets, p is the first recovery packet loss rate, and ToleranceLossRatio is the tolerated packet loss rate. According to the above inequality, the minimum value K of K that satisfies the polynomial on the left is less than the tolerated packet loss rate ToleranceLossRatio on the right is calculated. min , the corresponding redundancy can be obtained as K min / N. Of course, developers can also make adaptive adjustments to the calculation method of the first redundancy according to the packet loss recovery effect of the actual application scenario, which is not limited in this application. Thus, the data sending end simultaneously sends the retransmission packet and the redundant packet, which can achieve the effect of fast packet loss recovery.

[0053] In one embodiment, after the out-of-band FEC algorithm is enabled to send the first redundant packet, the recovery packet loss rate can be continuously calculated based on a set period, and the set period can be a period of receiving the protocol information sent by the data receiving end. By determining the relationship between the recovery packet loss rate and the tolerance packet loss rate within a preset number of consecutive set periods, the out-of-band FEC algorithm is dynamically adjusted to enable.

[0054] In the above, when the currently set encoding code rate gear is a low code rate gear, the first real-time round-trip delay and the first real-time packet loss rate sent by the data receiving end are received, the first tolerable round-trip retransmission number is calculated according to the first real-time round-trip delay and the set tolerance delay, a first retransmission packet is sent to the data receiving end, and the first data packet recovery information based on the first retransmission packet feedback by the data receiving end is received; the first recovery packet loss rate is calculated according to the first real-time packet loss rate and the first data packet recovery information; when the number of times the first retransmission packet is sent reaches the first tolerable round-trip retransmission number, and the first recovery packet loss rate is greater than the set tolerance packet loss rate, the first redundancy is calculated according to the first recovery packet loss rate and the tolerance packet loss rate, and the first redundant packet generated corresponding to the first redundancy is sent to the data receiving end. In the above scheme, by obtaining the currently set encoding bit rate gear to judge different bit rate scenarios, the anti-packet loss algorithm can be effectively selected in combination with the transmission scenario characteristics corresponding to different encoding bit rate gears, which is beneficial to reducing the adverse effects of different anti-packet loss algorithms; when the encoding bit rate gear is a low bit rate gear, it can be determined that the current bit rate scenario is a low bit rate scenario, and the automatic retransmission request algorithm is preferentially used for packet loss recovery, and the out-of-band forward error correction algorithm is not enabled temporarily to reduce the impact on the sending bandwidth; by judging the packet loss recovery effect of the automatic retransmission request algorithm based on the tolerated round-trip retransmission number and the tolerated packet loss rate, the role of the forward error correction algorithm can be added in time when the expected packet loss recovery effect is not achieved, which is beneficial to achieve a better packet loss recovery effect by combining the effects of the automatic retransmission request algorithm and the forward error correction algorithm, thereby improving user experience.

[0055] Figure 2 A flowchart of a network packet loss recovery method including a process of performing packet loss recovery in a medium bit rate scenario provided by an embodiment of the present application. Figure 2 As shown, the following steps are included:

[0056] Step S201: Obtain the currently set encoding bit rate gear.

[0057] Step S202: When the currently set encoding bit rate gear is a low bit rate gear, receive the first real-time round-trip delay and the first real-time packet loss rate sent by the data receiving end, calculate the first tolerable round-trip retransmission number according to the first real-time round-trip delay and the set tolerance delay, send a first retransmission packet to the data receiving end, and receive the first data packet recovery information fed back by the data receiving end based on the first retransmission packet.

[0058] Step S203: Calculate a first recovery packet loss rate according to the first real-time packet loss rate and the first data packet recovery information.

[0059] Step S204: When the number of times the first retransmission packet is sent reaches the first tolerable round-trip retransmission number and the first recovery packet loss rate is greater than the set tolerable packet loss rate, a first redundancy is calculated according to the first recovery packet loss rate and the tolerable packet loss rate, and a first redundant packet generated corresponding to the first redundancy is sent to the data receiving end.

[0060] Step S205: When the currently set encoding bit rate gear is the medium bit rate gear, receive the second real-time round-trip delay and the second real-time packet loss rate sent by the data receiving end, calculate the second tolerable round-trip retransmission number according to the second real-time round-trip delay and the tolerant delay, send a second retransmission packet to the data receiving end, and receive the second data packet recovery information fed back by the data receiving end based on the second retransmission packet.

[0061] Among them, the specific calculation of the second tolerated round-trip retransmission number can refer to the calculation method of the first tolerated round-trip retransmission number in the aforementioned embodiment, which will not be repeated here. Since the ARQ algorithm is highly efficient, in the medium bit rate scenario, the in-band FEC algorithm needs to encode redundant information together with the audio data, which will have a certain impact on the encoded sound quality of the original audio packet, while the out-of-band FEC algorithm needs to use an additional channel or transmission path. The ARQ algorithm can be enabled first to send the second retransmission packet to the data receiving end.

[0062] Step S206: When the second real-time packet loss rate is greater than the preset packet loss rate threshold or the second real-time round-trip delay is greater than the preset delay threshold for a consecutive preset number of set periods, calculate the second recovery packet loss rate according to the second real-time packet loss rate and the second data packet recovery information.

[0063] Among them, the set period can be the period for receiving the protocol information sent by the data receiving end, and the preset number can be set to 3-5 periods, which is not limited in this application. The preset packet loss rate threshold is a reference value for determining that the network packet loss rate of the current application scenario is relatively low. Taking into account the fluctuation of the packet loss rate, if the second real-time packet loss rate is greater than the preset packet loss rate threshold within a preset number of set periods, it can be regarded as the real-time packet loss rate of the current application scenario is at a medium-high level. The preset delay threshold is a reference value for determining that the network round-trip delay of the current application scenario is relatively low. If the second real-time round-trip delay is greater than the preset delay threshold, it can be regarded as the real-time round-trip delay of the current application scenario is at a medium-high level. Therefore, the packet loss recovery effect using the ARQ algorithm can be determined by calculating the second recovery packet loss rate. The specific calculation of the second recovery packet loss rate can refer to the calculation method of the first recovery packet loss rate in the aforementioned embodiment, which will not be repeated here.

[0064] Step S207: When the number of times the second retransmission packet is sent reaches the second tolerated round-trip retransmission number and the second recovery packet loss rate is greater than the tolerated packet loss rate, calculate the second redundancy according to the second recovery packet loss rate and the tolerated packet loss rate, and send the second redundant packet generated corresponding to the second redundancy to the data receiving end.

[0065] Among them, if the number of times the second retransmission packet is sent reaches the second tolerated round-trip retransmission number, and the second recovery packet loss rate is always greater than the tolerated packet loss rate, it can be considered that the ARQ algorithm cannot be used to effectively recover packet loss, and the FEC algorithm needs to be added to enhance packet loss recovery. Since the current scenario is a medium bit rate scenario, and the second real-time packet loss rate and the second real-time round-trip delay are both at a medium-high level, the use of an in-band FEC algorithm will have a certain impact on the encoded sound quality of the original audio packet, so an out-of-band FEC algorithm can be selected to send redundant packets. The specific calculation of the second redundancy can refer to the calculation method of the first redundancy in the aforementioned embodiment, which will not be repeated here.

[0066] In one embodiment, after the out-of-band FEC algorithm is enabled to send the second redundant packet, the recovery packet loss rate can be continuously calculated based on the set period. By determining the relationship between the recovery packet loss rate and the tolerance packet loss rate within a preset number of consecutive set periods, the out-of-band FEC algorithm is dynamically adjusted.

[0067] As described above, when the encoding bit rate gear is a medium bit rate gear, it can be determined that the current bit rate scenario is a medium bit rate scenario, and the automatic retransmission request algorithm is preferentially used for packet loss recovery. When it is determined that the real-time packet loss rate or the real-time round-trip delay is at a medium-high level, the packet loss recovery effect of the automatic retransmission request algorithm is preferentially judged based on the tolerated round-trip retransmission times and the tolerated packet loss rate. When the expected packet loss recovery effect is not achieved, the out-of-band forward error correction algorithm is added in time to effectively improve the effect of packet loss recovery.

[0068] Figure 3 A flowchart of a network packet loss recovery method including a process of controlling whether to perform redundant encoding in a medium bit rate scenario provided by an embodiment of the present application. Figure 3 As shown, the following steps are included:

[0069] Step S301: Obtain the currently set encoding bit rate gear.

[0070] Step S302: When the currently set encoding bit rate gear is a low bit rate gear, receive the first real-time round-trip delay and the first real-time packet loss rate sent by the data receiving end, calculate the first tolerable round-trip retransmission number according to the first real-time round-trip delay and the set tolerance delay, send a first retransmission packet to the data receiving end, and receive the first data packet recovery information fed back by the data receiving end based on the first retransmission packet.

[0071] Step S303: Calculate a first recovery packet loss rate according to the first real-time packet loss rate and the first data packet recovery information.

[0072] Step S304: When the number of times the first retransmission packet is sent reaches the first tolerable round-trip retransmission number and the first recovery packet loss rate is greater than the set tolerable packet loss rate, calculate the first redundancy according to the first recovery packet loss rate and the tolerable packet loss rate, and send the first redundant packet generated corresponding to the first redundancy to the data receiving end.

[0073] Step S305: When the currently set encoding bit rate gear is the medium bit rate gear, receive the second real-time round-trip delay and the second real-time packet loss rate sent by the data receiving end, calculate the second tolerable round-trip retransmission number according to the second real-time round-trip delay and the tolerant delay, send a second retransmission packet to the data receiving end, and receive the second data packet recovery information fed back by the data receiving end based on the second retransmission packet.

[0074] Step S306: When the second real-time packet loss rate is greater than the preset packet loss rate threshold or the second real-time round-trip delay is greater than the preset delay threshold for a consecutive preset number of set periods, calculate the second recovery packet loss rate according to the second real-time packet loss rate and the second data packet recovery information.

[0075] Step S307: When the number of times the second retransmission packet is sent reaches the second tolerated round-trip retransmission number and the second recovery packet loss rate is greater than the tolerated packet loss rate, calculate the second redundancy according to the second recovery packet loss rate and the tolerated packet loss rate, and send the second redundant packet generated corresponding to the second redundancy to the data receiving end.

[0076] Step S308: When the second real-time packet loss rate is less than or equal to the preset packet loss rate threshold for a consecutive preset number of set periods, and the second real-time round-trip delay is less than or equal to the preset delay threshold, perform redundant coding, send a data packet carrying redundant information to the data receiving end, and receive third data packet recovery information fed back by the data receiving end based on the data packet carrying redundant information.

[0077] Among them, taking into account the fluctuation of the packet loss rate, if the second real-time packet loss rate is less than or equal to the preset packet loss rate threshold within a preset number of consecutive set periods, it can be regarded that the real-time packet loss rate of the current application scenario is at a low level, and if the second real-time round-trip delay is less than or equal to the preset delay threshold, it can be regarded that the real-time round-trip delay of the current application scenario is at a low level. Therefore, it is possible to choose to enable the in-band FEC algorithm to perform redundant encoding at the same time, and send a data packet carrying redundant information to the data receiving end. The data receiving end can autonomously perform packet loss recovery based on the redundant information to achieve a better anti-packet loss effect. Optionally, it is possible to choose to give priority to retransmitting retransmission packets carrying redundant information. Therefore, the packet loss recovery effect of using the ARQ algorithm and the in-band FEC algorithm at the same time can be determined by calculating the third recovery packet loss rate.

[0078] Step S309: Calculate a third restored packet loss rate according to the second real-time packet loss rate and the third data packet recovery information.

[0079] The packet loss recovery effect of using both the ARQ algorithm and the in-band FEC algorithm can be determined by calculating the third recovery packet loss rate. The specific calculation of the third recovery packet loss rate can refer to the calculation method of the first recovery packet loss rate in the above embodiment, which will not be described in detail here.

[0080] Step S310: Stop executing redundant coding when the number of times the second retransmission packet is sent does not reach the second tolerated round-trip retransmission number and the third recovery packet loss rate calculated within a preset number of consecutive set periods is less than or equal to the tolerated packet loss rate.

[0081] Among them, if the number of times the second retransmission packet is sent does not reach the second tolerable round-trip retransmission number, and, taking into account the fluctuation of the packet loss rate, the third recovery packet loss rate calculated within a preset number of set periods is less than or equal to the tolerable packet loss rate, it can be regarded as the current packet loss recovery effect is good, there is no need to continue using the in-band FEC algorithm, and redundant encoding can be stopped to further ensure the audio quality.

[0082] In one embodiment, after redundant coding is stopped, the recovery packet loss rate can be calculated based on a set period. By determining the relationship between the recovery packet loss rate and the tolerance packet loss rate within a preset number of consecutive set periods, it is dynamically selected whether to enable the in-band FEC algorithm for redundant coding.

[0083] As described above, when the encoding bit rate gear is a medium bit rate gear, by determining that the real-time packet loss rate or the real-time round-trip delay is at a low level, while the ARQ algorithm is already used, the in-band FEC algorithm is enabled, so that the retransmission packet can also carry redundant information, which can better achieve the packet loss recovery effect. In addition, when it is judged based on the tolerated round-trip retransmission times and the tolerated packet loss rate that the combined use of the ARQ algorithm and the in-band FEC algorithm has achieved a good packet loss recovery effect, the in-band forward error correction algorithm is stopped in time to further ensure the audio quality.

[0084] Figure 4 A flowchart of a network packet loss recovery method including a process of sending redundant packets in a medium bit rate scenario provided by an embodiment of the present application. Figure 4 As shown, the following steps are included:

[0085] Step S401: Obtain the currently set encoding bit rate gear.

[0086] Step S402: When the currently set encoding bit rate gear is a low bit rate gear, receive the first real-time round-trip delay and the first real-time packet loss rate sent by the data receiving end, calculate the first tolerable round-trip retransmission number according to the first real-time round-trip delay and the set tolerance delay, send a first retransmission packet to the data receiving end, and receive the first data packet recovery information fed back by the data receiving end based on the first retransmission packet.

[0087] Step S403: Calculate a first recovery packet loss rate according to the first real-time packet loss rate and the first data packet recovery information.

[0088] Step S404: When the number of times the first retransmission packet is sent reaches the first tolerable round-trip retransmission number and the first recovery packet loss rate is greater than the set tolerable packet loss rate, a first redundancy is calculated according to the first recovery packet loss rate and the tolerable packet loss rate, and a first redundant packet generated corresponding to the first redundancy is sent to the data receiving end.

[0089] Step S405: When the currently set encoding bit rate gear is the medium bit rate gear, receive the second real-time round-trip delay and the second real-time packet loss rate sent by the data receiving end, calculate the second tolerable round-trip retransmission number according to the second real-time round-trip delay and the tolerant delay, send a second retransmission packet to the data receiving end, and receive the second data packet recovery information fed back by the data receiving end based on the second retransmission packet.

[0090] Step S406: When the second real-time packet loss rate is greater than the preset packet loss rate threshold or the second real-time round-trip delay is greater than the preset delay threshold for a consecutive preset number of set periods, calculate the second recovery packet loss rate according to the second real-time packet loss rate and the second data packet recovery information.

[0091] Step S407: When the number of times the second retransmission packet is sent reaches the second tolerated round-trip retransmission number and the second recovery packet loss rate is greater than the tolerated packet loss rate, calculate the second redundancy according to the second recovery packet loss rate and the tolerated packet loss rate, and send the second redundant packet generated corresponding to the second redundancy to the data receiving end.

[0092] Step S408: When the second real-time packet loss rate is less than or equal to the preset packet loss rate threshold for a consecutive preset number of set periods, and the second real-time round-trip delay is less than or equal to the preset delay threshold, perform redundant coding, send a data packet carrying redundant information to the data receiving end, and receive third data packet recovery information fed back by the data receiving end based on the data packet carrying redundant information.

[0093] Step S409: Calculate a third restored packet loss rate according to the second real-time packet loss rate and the third data packet recovery information.

[0094] Step S410: Stop executing redundant coding when the number of times the second retransmission packet is sent does not reach the second tolerated round-trip retransmission number and the third recovery packet loss rate calculated within a preset number of consecutive set periods is less than or equal to the tolerated packet loss rate.

[0095] Step S411: When the number of times the second retransmission packet is sent reaches the second tolerated round-trip retransmission number and the third recovery packet loss rate is greater than the tolerated packet loss rate, calculate the third redundancy according to the third recovery packet loss rate and the tolerated packet loss rate, and send the third redundant packet generated corresponding to the third redundancy to the data receiving end.

[0096] Among them, if the number of times the second retransmission packet is sent reaches the second tolerated round-trip retransmission number, and the third recovery packet loss rate is always greater than the tolerated packet loss rate, it can be considered that the simultaneous use of the ARQ algorithm and the in-band FEC algorithm cannot achieve a good packet loss recovery effect, and the out-of-band FEC algorithm needs to be enabled. The specific calculation of the third redundancy can refer to the calculation method of the first redundancy in the aforementioned embodiment, which is not repeated here.

[0097] In one embodiment, after the out-of-band FEC algorithm is enabled to send the third redundant packet, the recovery packet loss rate can be continuously calculated based on the set period. By determining the relationship between the recovery packet loss rate and the tolerance packet loss rate within a preset number of consecutive set periods, the out-of-band FEC algorithm is dynamically adjusted.

[0098] As mentioned above, when the encoding bit rate gear is the medium bit rate gear and the ARQ algorithm and the in-band FEC algorithm are used at the same time, based on the tolerance of round-trip retransmission times and the tolerance of packet loss rate, it is judged that the combined use of the ARQ algorithm and the in-band FEC algorithm cannot achieve a good packet loss recovery effect. The role of the out-of-band forward error correction algorithm is added in time, which is beneficial to improve the effect of packet loss recovery and ensure the user experience.

[0099] Figure 5 A flowchart of a network packet loss recovery method including a packet loss recovery process in a high bit rate scenario provided by an embodiment of the present application. Figure 5 As shown, the following steps are included:

[0100] Step S501: Obtain the currently set encoding bit rate gear.

[0101] Step S502: When the currently set encoding bit rate gear is a low bit rate gear, receive the first real-time round-trip delay and the first real-time packet loss rate sent by the data receiving end, calculate the first tolerable round-trip retransmission number according to the first real-time round-trip delay and the set tolerance delay, send a first retransmission packet to the data receiving end, and receive the first data packet recovery information fed back by the data receiving end based on the first retransmission packet.

[0102] Step S503: Calculate a first recovery packet loss rate according to the first real-time packet loss rate and the first data packet recovery information.

[0103] Step S504: When the number of times the first retransmission packet is sent reaches the first tolerable round-trip retransmission number and the first recovery packet loss rate is greater than the set tolerable packet loss rate, a first redundancy is calculated according to the first recovery packet loss rate and the tolerable packet loss rate, and a first redundant packet generated corresponding to the first redundancy is sent to the data receiving end.

[0104] Step S505: When the currently set encoding bit rate gear is the medium bit rate gear, receive the second real-time round-trip delay and the second real-time packet loss rate sent by the data receiving end, calculate the second tolerable round-trip retransmission number according to the second real-time round-trip delay and the tolerant delay, send a second retransmission packet to the data receiving end, and receive the second data packet recovery information fed back by the data receiving end based on the second retransmission packet.

[0105] Step S506: When the second real-time packet loss rate is greater than the preset packet loss rate threshold or the second real-time round-trip delay is greater than the preset delay threshold for a consecutive preset number of set periods, calculate the second recovery packet loss rate according to the second real-time packet loss rate and the second data packet recovery information.

[0106] Step S507: When the number of times the second retransmission packet is sent reaches the second tolerated round-trip retransmission number and the second recovery packet loss rate is greater than the tolerated packet loss rate, calculate the second redundancy according to the second recovery packet loss rate and the tolerated packet loss rate, and send the second redundant packet generated corresponding to the second redundancy to the data receiving end.

[0107] Step S508, when the currently set encoding bit rate gear is a high bit rate gear, receive the third real-time packet loss rate and the third real-time round-trip delay sent by the data receiving end, perform redundant coding, send a data packet carrying redundant information to the data receiving end, and receive the fourth data packet recovery information fed back by the data receiving end based on the data packet carrying redundant information.

[0108] Among them, since the current scenario is high bit rate, the use of the in-band FEC algorithm has little impact on the encoding sound quality of the original audio packet, and the traffic consumption is lower than that of the out-band FEC algorithm, and the playback delay is lower than that of the ARQ algorithm. The in-band FEC algorithm can be enabled for redundant encoding first.

[0109] Step S509: When the third real-time round-trip delay is greater than the preset delay threshold, a fourth recovery packet loss rate is calculated according to the third real-time packet loss rate and the fourth data packet recovery information.

[0110] Among them, if the third real-time round-trip delay is greater than the preset delay threshold, the ARQ algorithm may not be enabled first to avoid increasing the playback delay, and the packet loss recovery effect of the in-band FEC algorithm is determined by calculating the fourth recovery packet loss rate. The specific calculation of the fourth recovery packet loss rate can refer to the calculation method of the first recovery packet loss rate in the aforementioned embodiment, which will not be repeated here.

[0111] Step S510: When the third real-time round-trip delay is less than or equal to the preset delay threshold, or the fourth recovery packet loss rate is greater than the tolerant packet loss rate, a third tolerated round-trip retransmission number is calculated according to the third real-time round-trip delay and the tolerant delay, and a third retransmission packet is sent to the data receiving end.

[0112] Among them, if the third real-time round-trip delay is less than or equal to the preset delay threshold, it can be regarded that the real-time round-trip delay of the current application scenario is at a low level, and the ARQ algorithm can be enabled at the same time to achieve better packet loss recovery effect. If the fourth recovery packet loss rate is greater than the tolerant packet loss rate, it can be regarded that the use of the in-band FEC algorithm cannot achieve a good packet loss recovery effect, and the role of the ARQ algorithm needs to be added for packet loss recovery. The specific calculation of the third tolerated round-trip retransmission number can refer to the calculation method of the first tolerated round-trip retransmission number in the aforementioned embodiment, which will not be repeated here.

[0113] As mentioned above, when the encoding bit rate gear is a high bit rate gear, the in-band FEC algorithm is used first, which can achieve packet loss recovery while avoiding excessive increase in transmission traffic and playback delay. In addition, based on the preset delay threshold, it is judged whether the real-time round-trip delay is at a low level, or based on the tolerable packet loss rate, it is judged whether the use of the in-band FEC algorithm achieves a good packet loss recovery effect, and the ARQ algorithm can be enabled at a reasonable time to achieve a better anti-packet loss effect.

[0114] Figure 6 A flowchart of a network packet loss recovery method including a process of sending redundant packets in a high bit rate scenario provided by an embodiment of the present application. Figure 6 As shown, the following steps are included:

[0115] Step S601: Obtain the currently set encoding bit rate level.

[0116] Step S602: When the currently set encoding bit rate gear is a low bit rate gear, receive the first real-time round-trip delay and the first real-time packet loss rate sent by the data receiving end, calculate the first tolerable round-trip retransmission number according to the first real-time round-trip delay and the set tolerance delay, send a first retransmission packet to the data receiving end, and receive the first data packet recovery information fed back by the data receiving end based on the first retransmission packet.

[0117] Step S603: Calculate a first recovery packet loss rate according to the first real-time packet loss rate and the first data packet recovery information.

[0118] Step S604: When the number of times the first retransmission packet is sent reaches the first tolerable round-trip retransmission number and the first recovery packet loss rate is greater than the set tolerable packet loss rate, a first redundancy is calculated according to the first recovery packet loss rate and the tolerable packet loss rate, and a first redundant packet generated corresponding to the first redundancy is sent to the data receiving end.

[0119] Step S605: When the currently set encoding bit rate gear is the medium bit rate gear, receive the second real-time round-trip delay and the second real-time packet loss rate sent by the data receiving end, calculate the second tolerable round-trip retransmission number according to the second real-time round-trip delay and the tolerant delay, send a second retransmission packet to the data receiving end, and receive the second data packet recovery information fed back by the data receiving end based on the second retransmission packet.

[0120] Step S606: When the second real-time packet loss rate is greater than the preset packet loss rate threshold or the second real-time round-trip delay is greater than the preset delay threshold for a consecutive preset number of set periods, calculate the second recovery packet loss rate according to the second real-time packet loss rate and the second data packet recovery information.

[0121] Step S607: When the number of times the second retransmission packet is sent reaches the second tolerated round-trip retransmission number and the second recovery packet loss rate is greater than the tolerated packet loss rate, calculate the second redundancy according to the second recovery packet loss rate and the tolerated packet loss rate, and send the second redundant packet generated corresponding to the second redundancy to the data receiving end.

[0122] Step S608, when the currently set encoding bit rate gear is a high bit rate gear, receive the third real-time packet loss rate and the third real-time round-trip delay sent by the data receiving end, perform redundant coding, send a data packet carrying redundant information to the data receiving end, and receive the fourth data packet recovery information fed back by the data receiving end based on the data packet carrying redundant information.

[0123] Step S609: When the third real-time round-trip delay is greater than the preset delay threshold, a fourth recovery packet loss rate is calculated according to the third real-time packet loss rate and the fourth data packet recovery information.

[0124] Step S610: When the third real-time round-trip delay is less than or equal to the preset delay threshold, or the fourth recovery packet loss rate is greater than the tolerant packet loss rate, a third tolerated round-trip retransmission number is calculated according to the third real-time round-trip delay and the tolerant delay, and a third retransmission packet is sent to the data receiving end.

[0125] Step S611: The data receiving end receives fifth data packet recovery information based on the third retransmission packet feedback.

[0126] Step S612: Calculate a fifth restored packet loss rate according to the third real-time packet loss rate and the fifth data packet recovery information.

[0127] The packet loss recovery effect of using both the ARQ algorithm and the in-band FEC algorithm can be determined by calculating the fifth recovery packet loss rate. The specific calculation of the fifth recovery packet loss rate can refer to the calculation method of the first recovery packet loss rate in the above embodiment, which will not be repeated here.

[0128] Step S613: When the number of times the third retransmission packet is sent reaches the third tolerated round-trip retransmission number and the fifth recovery packet loss rate is greater than the tolerated packet loss rate, calculate the fourth redundancy according to the fifth recovery packet loss rate and the tolerated packet loss rate, and send the fourth redundant packet generated corresponding to the fourth redundancy to the data receiving end.

[0129] In one embodiment, after stopping sending the third retransmission packet, the recovery packet loss rate can be continuously calculated based on the set period. By determining the relationship between the recovery packet loss rate and the tolerance packet loss rate within a preset number of consecutive set periods, the activation of the ARQ algorithm is dynamically adjusted.

[0130] Among them, if the number of times the third retransmission packet is sent reaches the third tolerated round-trip retransmission number, and the fifth recovery packet loss rate is always greater than the tolerated packet loss rate, it can be considered that the simultaneous use of the ARQ algorithm and the in-band FEC algorithm cannot effectively recover packet loss, and it is necessary to add the out-of-band FEC algorithm to send redundant packets to achieve the purpose of enhanced packet loss recovery. The specific calculation of the fourth redundancy can refer to the calculation method of the first redundancy in the aforementioned embodiment, which will not be repeated here.

[0131] As mentioned above, when the encoding bit rate gear is a high bit rate gear and the ARQ algorithm and the in-band FEC algorithm are used at the same time, based on the tolerated number of round-trip retransmissions and the tolerated packet loss rate, it is judged that the combined use of the ARQ algorithm and the in-band FEC algorithm cannot achieve a good packet loss recovery effect, and the out-of-band forward error correction algorithm is added in time to enhance the packet loss recovery effect and optimize the user experience.

[0132] Figure 7 A flowchart of a network packet loss recovery method including a process of controlling whether to send a retransmission packet in a high bit rate scenario provided by an embodiment of the present application. Figure 7 As shown, the following steps are included:

[0133] Step S701: Obtain the currently set encoding bit rate gear.

[0134] Step S702: When the currently set encoding bit rate gear is a low bit rate gear, receive the first real-time round-trip delay and the first real-time packet loss rate sent by the data receiving end, calculate the first tolerable round-trip retransmission number according to the first real-time round-trip delay and the set tolerance delay, send a first retransmission packet to the data receiving end, and receive the first data packet recovery information fed back by the data receiving end based on the first retransmission packet.

[0135] Step S703: Calculate a first recovery packet loss rate according to the first real-time packet loss rate and the first data packet recovery information.

[0136] Step S704: When the number of times the first retransmission packet is sent reaches the first tolerable round-trip retransmission number and the first recovery packet loss rate is greater than the set tolerable packet loss rate, calculate the first redundancy according to the first recovery packet loss rate and the tolerable packet loss rate, and send the first redundant packet generated corresponding to the first redundancy to the data receiving end.

[0137] Step S705: When the currently set encoding bit rate gear is the medium bit rate gear, receive the second real-time round-trip delay and the second real-time packet loss rate sent by the data receiving end, calculate the second tolerable round-trip retransmission number according to the second real-time round-trip delay and the tolerant delay, send a second retransmission packet to the data receiving end, and receive the second data packet recovery information fed back by the data receiving end based on the second retransmission packet.

[0138] Step S706: When the second real-time packet loss rate is greater than the preset packet loss rate threshold or the second real-time round-trip delay is greater than the preset delay threshold for a consecutive preset number of set periods, calculate the second recovery packet loss rate according to the second real-time packet loss rate and the second data packet recovery information.

[0139] Step S707: When the number of times the second retransmission packet is sent reaches the second tolerated round-trip retransmission number and the second recovery packet loss rate is greater than the tolerated packet loss rate, calculate the second redundancy according to the second recovery packet loss rate and the tolerated packet loss rate, and send the second redundant packet generated corresponding to the second redundancy to the data receiving end.

[0140] Step S708, when the currently set encoding bit rate gear is a high bit rate gear, receive the third real-time packet loss rate and the third real-time round-trip delay sent by the data receiving end, perform redundant coding, send a data packet carrying redundant information to the data receiving end, and receive the fourth data packet recovery information fed back by the data receiving end based on the data packet carrying redundant information.

[0141] Step S709: When the third real-time round-trip delay is greater than the preset delay threshold, calculate a fourth recovery packet loss rate according to the third real-time packet loss rate and the fourth data packet recovery information.

[0142] Step S710: When the third real-time round-trip delay is less than or equal to the preset delay threshold, or the fourth recovery packet loss rate is greater than the tolerant packet loss rate, calculate the third tolerated round-trip retransmission number according to the third real-time round-trip delay and the tolerant delay, and send a third retransmission packet to the data receiving end.

[0143] Step S711: The data receiving end receives fifth data packet recovery information based on the third retransmission packet feedback.

[0144] Step S712: Calculate a fifth restored packet loss rate according to the third real-time packet loss rate and the fifth data packet recovery information.

[0145] The packet loss recovery effect of using both the ARQ algorithm and the in-band FEC algorithm can be determined by calculating the fifth recovery packet loss rate. The specific calculation of the fifth recovery packet loss rate can refer to the calculation method of the first recovery packet loss rate in the above embodiment, which will not be repeated here.

[0146] Step S713: When the number of times the third retransmission packet is sent reaches the third tolerated round-trip retransmission number and the fifth recovery packet loss rate is greater than the tolerated packet loss rate, calculate the fourth redundancy according to the fifth recovery packet loss rate and the tolerated packet loss rate, and send the fourth redundant packet generated corresponding to the fourth redundancy to the data receiving end.

[0147] Step S714: When the number of times the third retransmission packet is sent does not reach the third tolerated round-trip retransmission number and the fifth recovery packet loss rate calculated within a preset number of consecutive set periods is less than or equal to the tolerated packet loss rate, stop sending the third retransmission packet.

[0148] Among them, if the number of times the third retransmission packet is sent does not reach the third tolerable round-trip retransmission number, and taking into account the fluctuation of the packet loss rate, the fifth recovery packet loss rate calculated within a preset number of set periods is less than or equal to the tolerable packet loss rate, it can be regarded as the current packet loss recovery effect is good, there is no need to continue using the ARQ algorithm, and the sending of retransmission packets can be stopped to reduce the impact of playback delay.

[0149] In one embodiment, after stopping sending the third retransmission packet, the recovery packet loss rate can be continuously calculated based on the set period. By determining the relationship between the recovery packet loss rate and the tolerance packet loss rate within a preset number of consecutive set periods, the activation of the ARQ algorithm is dynamically adjusted.

[0150] As described above, when the encoding bit rate gear is the medium bit rate gear and the ARQ algorithm and the in-band FEC algorithm are used at the same time, based on the tolerated round-trip retransmission times and the tolerated packet loss rate, it is judged that the combined use of the ARQ algorithm and the in-band FEC algorithm has achieved a good packet loss recovery effect, and the ARQ algorithm is stopped in time to further ensure the timeliness of audio playback.

[0151] Figure 8 This is a structural block diagram of a network packet loss recovery device provided in an embodiment of the present application. The device is configured to execute the network packet loss recovery method provided in the above embodiment and has the corresponding functional modules and beneficial effects of the execution method. Figure 8 As shown, the device comprises:

[0152] The retransmission packet sending module 101 is configured to receive a first real-time round-trip delay and a first real-time packet loss rate sent by a data receiving end when the currently set encoding code rate gear is a low code rate gear, calculate a first tolerable round-trip retransmission number according to the first real-time round-trip delay and the set tolerance delay, and send a first retransmission packet to the data receiving end;

[0153] The recovery information receiving module 102 is configured to receive the first data packet recovery information fed back by the data receiving end based on the first retransmission packet;

[0154] The packet loss rate calculation module 103 is configured to calculate a first recovery packet loss rate according to the first real-time packet loss rate and the first data packet recovery information;

[0155] The redundant packet sending module 104 is configured to calculate the first redundancy according to the first recovery packet loss rate and the tolerance packet loss rate when the number of times the first retransmission packet is sent reaches the first tolerated round-trip retransmission number and the first recovery packet loss rate is greater than the set tolerance packet loss rate, and send the first redundant packet generated corresponding to the first redundancy to the data receiving end.

[0156] In the above, when the currently set encoding code rate gear is a low code rate gear, the first real-time round-trip delay and the first real-time packet loss rate sent by the data receiving end are received, the first tolerable round-trip retransmission number is calculated according to the first real-time round-trip delay and the set tolerance delay, a first retransmission packet is sent to the data receiving end, and the first data packet recovery information based on the first retransmission packet feedback by the data receiving end is received; the first recovery packet loss rate is calculated according to the first real-time packet loss rate and the first data packet recovery information; when the number of times the first retransmission packet is sent reaches the first tolerable round-trip retransmission number, and the first recovery packet loss rate is greater than the set tolerance packet loss rate, the first redundancy is calculated according to the first recovery packet loss rate and the tolerance packet loss rate, and the first redundant packet generated corresponding to the first redundancy is sent to the data receiving end. In the above scheme, by obtaining the currently set encoding bit rate gear to judge different bit rate scenarios, the anti-packet loss algorithm can be effectively selected in combination with the transmission scenario characteristics corresponding to different encoding bit rate gears, which is beneficial to reducing the adverse effects of different anti-packet loss algorithms; when the encoding bit rate gear is a low bit rate gear, it can be determined that the current bit rate scenario is a low bit rate scenario, and the automatic retransmission request algorithm is preferentially used for packet loss recovery, and the out-of-band forward error correction algorithm is not enabled temporarily to reduce the impact on the sending bandwidth; by judging the packet loss recovery effect of the automatic retransmission request algorithm based on the tolerated round-trip retransmission number and the tolerated packet loss rate, the role of the forward error correction algorithm can be added in time when the expected packet loss recovery effect is not achieved, which is beneficial to achieve a better packet loss recovery effect by combining the effects of the automatic retransmission request algorithm and the forward error correction algorithm, thereby improving user experience.

[0157] In a possible embodiment, it further includes a medium bit rate packet loss recovery module configured as follows:

[0158] When the currently set encoding bit rate gear is the medium bit rate gear, receiving the second real-time round-trip delay and the second real-time packet loss rate sent by the data receiving end, calculating the second tolerated round-trip retransmission number according to the second real-time round-trip delay and the tolerated delay, sending a second retransmission packet to the data receiving end, and receiving the second data packet recovery information fed back by the data receiving end based on the second retransmission packet;

[0159] When the second real-time packet loss rate is greater than a preset packet loss rate threshold or the second real-time round-trip delay is greater than a preset delay threshold within a preset number of consecutive set periods, calculating a second recovery packet loss rate according to the second real-time packet loss rate and the second data packet recovery information;

[0160] When the number of times the second retransmission packet is sent reaches the second tolerated round-trip retransmission number and the second recovery packet loss rate is greater than the tolerated packet loss rate, the second redundancy is calculated according to the second recovery packet loss rate and the tolerated packet loss rate, and the second redundant packet generated corresponding to the second redundancy is sent to the data receiving end.

[0161] In a possible embodiment, it further includes a medium code rate redundant coding module configured as follows:

[0162] When the second real-time packet loss rate is less than or equal to the preset packet loss rate threshold value within a preset number of consecutive set periods, and the second real-time round-trip delay is less than or equal to the preset delay threshold value, perform redundant coding, send a data packet carrying redundant information to the data receiving end, and receive third data packet recovery information fed back by the data receiving end based on the data packet carrying redundant information;

[0163] Calculating a third recovery packet loss rate according to the second real-time packet loss rate and the third data packet recovery information;

[0164] When the number of times the second retransmission packet is sent does not reach the second tolerated round-trip retransmission number, and the third recovery packet loss rate calculated within a preset number of consecutive set periods is less than or equal to the tolerated packet loss rate, redundant coding is stopped.

[0165] In a possible embodiment, it further includes a medium code rate redundant sending module configured as follows:

[0166] When the number of times the second retransmission packet is sent reaches the second tolerated round-trip retransmission number and the third recovery packet loss rate is greater than the tolerated packet loss rate, the third redundancy is calculated based on the third recovery packet loss rate and the tolerated packet loss rate, and the third redundant packet generated corresponding to the third redundancy is sent to the data receiving end.

[0167] In a possible embodiment, a high bit rate packet loss recovery module is further included, configured as follows:

[0168] When the currently set encoding bit rate gear is a high bit rate gear, receiving a third real-time packet loss rate and a third real-time round-trip delay sent by the data receiving end, performing redundant encoding, sending a data packet carrying redundant information to the data receiving end, and receiving fourth data packet recovery information fed back by the data receiving end based on the data packet carrying redundant information;

[0169] When the third real-time round-trip delay is greater than a preset delay threshold, calculating a fourth recovery packet loss rate according to the third real-time packet loss rate and the fourth data packet recovery information;

[0170] When the third real-time round-trip delay is less than or equal to the preset delay threshold, or the fourth recovery packet loss rate is greater than the tolerant packet loss rate, the third tolerant round-trip retransmission number is calculated according to the third real-time round-trip delay and the tolerant delay, and a third retransmission packet is sent to the data receiving end.

[0171] In a possible embodiment, it further includes a high code rate redundant sending module configured as follows:

[0172] The data receiving end receives the fifth data packet recovery information based on the third retransmitted packet feedback;

[0173] Calculating a fifth recovery packet loss rate according to the third real-time packet loss rate and the fifth data packet recovery information;

[0174] When the number of times the third retransmission packet is sent reaches the third tolerated round-trip retransmission number and the fifth recovery packet loss rate is greater than the tolerated packet loss rate, the fourth redundancy is calculated according to the fifth recovery packet loss rate and the tolerated packet loss rate, and the fourth redundant packet generated corresponding to the fourth redundancy is sent to the data receiving end.

[0175] In a possible embodiment, a high code rate retransmission control module is further included, configured as follows:

[0176] When the number of times the third retransmission packet is sent does not reach the third tolerated round-trip retransmission number and the fifth recovery packet loss rate calculated within a preset number of consecutive set periods is less than or equal to the tolerated packet loss rate, the sending of the third retransmission packet is stopped.

[0177] Fig. 9 A schematic diagram of the structure of a network packet loss recovery device provided in an embodiment of the present application is shown in FIG. Fig. 9 As shown, the device includes a processor 201, a memory 202, an input device 203 and an output device 204; the number of processors 201 in the device can be one or more. Fig. 9 A processor 201 is taken as an example; the processor 201, memory 202, input device 203 and output device 204 in the device can be connected by a bus or other means. Fig. 9The example of connection via a bus is taken. The memory 202, as a computer-readable storage medium, can be configured to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the network packet loss recovery method in the embodiment of the present application. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 202, that is, implements the above-mentioned network packet loss recovery method. The input device 203 can be configured to receive input digital or character information, and generate key signal input related to user settings and function control of the device. The output device 204 may include a display device such as a display screen.

[0178] The embodiment of the present application further provides a non-volatile storage medium containing computer executable instructions, which are configured to execute a network packet loss recovery method described in the above embodiment when executed by a computer processor, including:

[0179] When the currently set encoding code rate gear is a low code rate gear, a first real-time round-trip delay and a first real-time packet loss rate sent by a data receiving end are received, a first tolerable round-trip retransmission number is calculated according to the first real-time round-trip delay and the set tolerance delay, a first retransmission packet is sent to the data receiving end, and first data packet recovery information based on the first retransmission packet feedback by the data receiving end is received; a first recovery packet loss rate is calculated according to the first real-time packet loss rate and the first data packet recovery information; when the number of times the first retransmission packet is sent reaches the first tolerable round-trip retransmission number, and the first recovery packet loss rate is greater than the set tolerance packet loss rate, a first redundancy is calculated according to the first recovery packet loss rate and the tolerance packet loss rate, and a first redundant packet generated corresponding to the first redundancy is sent to the data receiving end.

[0180] It is worth noting that in the embodiment of the above-mentioned network packet loss recovery device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not configured to limit the protection scope of the embodiments of the present application.

[0181] In some possible implementations, various aspects of the method provided in the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is configured to enable the computer device to execute the steps of the method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device may execute the network packet loss recovery method recorded in the embodiment of the present application. The program product may be implemented in any combination of one or more readable media.

Claims

1. A network packet loss recovery method, characterized in that: include: In the case where the currently set encoding bit rate gear is a low bit rate gear, receiving a first real-time round-trip delay and a first real-time packet loss rate sent by a data receiving end, calculating a first tolerable round-trip retransmission number according to the first real-time round-trip delay and the set tolerance delay, sending a first retransmission packet to the data receiving end, and receiving first data packet recovery information fed back by the data receiving end based on the first retransmission packet; Calculating a first recovery packet loss rate according to the first real-time packet loss rate and the first data packet recovery information; When the number of times the first retransmission packet is sent reaches the first tolerable round-trip retransmission number, and the first recovery packet loss rate is greater than the set tolerable packet loss rate, a first redundancy is calculated based on the first recovery packet loss rate and the tolerable packet loss rate, and a first redundant packet generated corresponding to the first redundancy is sent to the data receiving end.

2. The network packet loss recovery method according to claim 1, characterized in that: Also includes: In the case where the currently set encoding code rate gear is a medium code rate gear, receiving a second real-time round-trip delay and a second real-time packet loss rate sent by the data receiving end, calculating a second tolerable round-trip retransmission number according to the second real-time round-trip delay and the tolerable delay, sending a second retransmission packet to the data receiving end, and receiving second data packet recovery information fed back by the data receiving end based on the second retransmission packet; When the second real-time packet loss rate is greater than a preset packet loss rate threshold value or the second real-time round-trip delay is greater than a preset delay threshold value within a preset number of consecutive set periods, calculating a second recovery packet loss rate according to the second real-time packet loss rate and the second data packet recovery information; When the number of times the second retransmission packet is sent reaches the second tolerated round-trip retransmission number, and the second recovery packet loss rate is greater than the tolerated packet loss rate, a second redundancy is calculated based on the second recovery packet loss rate and the tolerated packet loss rate, and a second redundant packet generated corresponding to the second redundancy is sent to the data receiving end.

3. The network packet loss recovery method according to claim 2, characterized in that: After receiving the second data packet recovery information fed back by the data receiving end based on the second retransmitted packet, the method further includes: When the second real-time packet loss rate is less than or equal to the preset packet loss rate threshold value within a preset number of consecutive set periods, and the second real-time round-trip delay is less than or equal to the preset delay threshold value, perform redundant coding, send a data packet carrying redundant information to the data receiving end, and receive third data packet recovery information fed back by the data receiving end based on the data packet carrying redundant information; Calculating a third recovered packet loss rate according to the second real-time packet loss rate and the third data packet recovery information; When the number of times the second retransmission packet is sent does not reach the second tolerated round-trip retransmission number, and the third recovery packet loss rate calculated within a preset number of consecutive set periods is less than or equal to the tolerated packet loss rate, redundant coding is stopped.

4. The network packet loss recovery method according to claim 3, characterized in that: After calculating the third restored packet loss rate according to the second real-time packet loss rate and the third data packet recovery information, the method further includes: When the number of times the second retransmission packet is sent reaches the second tolerable round-trip retransmission number, and the third recovery packet loss rate is greater than the tolerable packet loss rate, a third redundancy is calculated based on the third recovery packet loss rate and the tolerable packet loss rate, and a third redundant packet generated corresponding to the third redundancy is sent to the data receiving end.

5. The network packet loss recovery method according to claim 1, characterized in that: Also includes: When the currently set encoding bit rate gear is a high bit rate gear, receiving a third real-time packet loss rate and a third real-time round-trip delay sent by the data receiving end, performing redundant coding, sending a data packet carrying redundant information to the data receiving end, and receiving fourth data packet recovery information fed back by the data receiving end based on the data packet carrying redundant information; When the third real-time round-trip delay is greater than a preset delay threshold, calculating a fourth recovery packet loss rate according to the third real-time packet loss rate and the fourth data packet recovery information; When the third real-time round-trip delay is less than or equal to the preset delay threshold, or the fourth recovery packet loss rate is greater than the tolerant packet loss rate, a third tolerant round-trip retransmission number is calculated according to the third real-time round-trip delay and the tolerant delay, and a third retransmission packet is sent to the data receiving end.

6. The network packet loss recovery method according to claim 5, characterized in that: After sending the third retransmission packet to the data receiving end, the method further includes: Receiving fifth data packet recovery information fed back by the data receiving end based on the third retransmitted packet; Calculating a fifth recovery packet loss rate according to the third real-time packet loss rate and the fifth data packet recovery information; When the number of times the third retransmission packet is sent reaches the third tolerated round-trip retransmission number, and the fifth recovery packet loss rate is greater than the tolerated packet loss rate, a fourth redundancy is calculated based on the fifth recovery packet loss rate and the tolerated packet loss rate, and a fourth redundant packet generated corresponding to the fourth redundancy is sent to the data receiving end.

7. The network packet loss recovery method according to claim 6, characterized in that: After calculating the fifth restored packet loss rate according to the third real-time packet loss rate and the fifth data packet recovery information, the method further includes: When the number of times the third retransmission packet is sent does not reach the third tolerated round-trip retransmission number, and the fifth recovery packet loss rate calculated within a preset number of consecutive set periods is less than or equal to the tolerated packet loss rate, stop sending the third retransmission packet.

8. A network packet loss recovery device, characterized in that: include: A retransmission packet sending module is configured to receive a first real-time round-trip delay and a first real-time packet loss rate sent by a data receiving end when the currently set encoding code rate gear is a low code rate gear, calculate a first tolerable round-trip retransmission number according to the first real-time round-trip delay and the set tolerance delay, and send a first retransmission packet to the data receiving end; A recovery information receiving module, configured to receive first data packet recovery information fed back by the data receiving end based on the first retransmission packet; a packet loss rate calculation module, configured to calculate a first recovery packet loss rate according to the first real-time packet loss rate and the first data packet recovery information; The redundant packet sending module is configured to calculate a first redundancy based on the first recovery packet loss rate and the tolerable packet loss rate when the number of times the first retransmission packet is sent reaches the first tolerable round-trip retransmission number and the first recovery packet loss rate is greater than the set tolerable packet loss rate, and send a first redundant packet generated corresponding to the first redundancy to the data receiving end.

9. A network packet loss recovery device, the device comprising: one or more processors; A storage device configured to store one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the network packet loss recovery method described in any one of claims 1-7.

10. A non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the network packet loss recovery method according to any one of claims 1 to 7 when executed by a computer processor.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the network packet loss recovery method described in any one of claims 1 to 7 is implemented.