Lost packet retransmission method and device
By detecting packet loss in network transmission and determining the retransmission strategy based on packet loss parameters, the problem of poor packet loss resistance in the prior art is solved, and more efficient data retransmission and more stable service transmission are achieved.
Patent Information
- Application Number
- CN202411933884.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-15
AI Technical Summary
The prior art has poor packet loss ability when packet loss is lost during network transmission, especially in scenarios where the network environment is unstable and the packet loss rate is high, the retransmission efficiency is low, resulting in a decrease in data transmission delay and service stability.
By detecting packet loss, the data to be retransmitted and the number of retransmissions are determined, and the replica level and number of retransmissions are determined based on the packet loss parameters. The retransmission replica is sent to the receiving end using an ordered replica scheduling strategy to improve the reliability and efficiency of data transmission.
It effectively increases the probability of data being accepted successfully, reduces the average maximum number of retransmissions, improves service stability, reduces CPU glitches caused by retransmissions, and reduces playback lag rate in audio and video services, improving user experience.
Smart Images

Figure CN119834937A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of Internet technology, and specifically to a method and device for retransmitting lost packets. Background Art
[0002] During network transmission, the data sent by the sender fails to reach the receiver due to network failure, transmission error or network congestion. This phenomenon is called packet loss. The existing technology usually uses two anti-packet loss technical means: FEC and ARQ. Among them, FEC, also known as forward error correction, uses a certain algorithm to add redundant bits to the information sent. If some data is lost during the transmission process, the other end can use the redundant information in the received packet to restore the lost content, thereby realizing forward error correction. The advantage is good real-time performance, and the disadvantage is that there is a lot of redundant data and poor anti-packet loss capability when the packet loss rate fluctuates greatly.
[0003] ARQ is also called packet loss retransmission. The receiving end determines whether a packet is lost based on the continuity of the packet sequence number and sends a retransmission of the specified data packet to the sending end. Packet loss retransmission usually retransmits only one packet at a time. If the retransmitted packet is lost, it will trigger retransmission again until the confirmation packet is received from the other end. Compared with FEC, the disadvantage of ARQ is that it will introduce delays. In scenarios where the network environment is unstable and the packet loss rate is high, the maximum number of retransmissions is high, and the retransmission efficiency is low. Therefore, a solution that can improve the retransmission efficiency is urgently needed. Summary of the invention
[0004] In view of the above problems, the present application is proposed to provide a packet loss retransmission method, apparatus, computing device, computer storage medium and computer program product that overcome the above problems or at least partially solve the above problems.
[0005] According to one aspect of an embodiment of the present application, a packet loss retransmission method is provided. The method is applicable to a scenario where multiple retransmissions are performed after a packet loss is detected. The method is applied to a first device, and the method includes:
[0006] If a data packet loss is detected, determining the data to be retransmitted and the number of retransmissions corresponding to the data to be retransmitted;
[0007] Obtaining a packet loss parameter, and determining a replica level according to the packet loss parameter, wherein the replica level is used to control the number of replicas;
[0008] Determine the number of retransmission copies corresponding to the data to be retransmitted according to the number of retransmissions and the copy level;
[0009] The retransmission copies are sent to the second device according to the number of retransmission copies.
[0010] Further, according to the number of retransmission copies, sending the retransmission copy to the second device further includes:
[0011] Determine the expected sending time of the replica corresponding to each retransmitted replica;
[0012] In each round, retransmitted copies corresponding to the number of retransmitted copies are sent to the second device according to a preset copy scheduling order and based on the expected sending time of each copy.
[0013] Furthermore, if the number of retransmission copies is greater than or equal to 2, the preset copy scheduling order is: the first retransmission copy, other retransmission copies whose expected transmission time of the copy is less than or equal to the current time, and the new data packet;
[0014] If the number of retransmission copies is 1, the preset scheduling order is: the first retransmission copy, the new data packet.
[0015] Furthermore, determining the expected sending time of the copy corresponding to each retransmission copy further includes:
[0016] Set the expected sending time of the first retransmitted copy to send immediately;
[0017] For any other retransmitted copies, determine the sending delay time, and determine the expected sending time of the copies corresponding to the other retransmitted copies based on the sending delay time and the current time, where the sending delay time is a random value between [0, 1 / 2 minimum round-trip time].
[0018] Furthermore, determining the number of retransmission copies corresponding to the data to be retransmitted according to the number of retransmissions and the copy level further includes:
[0019] If the number of retransmissions is less than the replica level, the number of retransmissions is determined as the number of retransmission replicas;
[0020] If the replica level is less than the number of retransmissions, the replica level is determined as the number of retransmission copies.
[0021] Furthermore, obtaining a packet loss parameter and determining the replica level according to the packet loss parameter further includes:
[0022] Obtain the maximum number of consecutive packet losses that occurred in the most recent round-trip time. If the maximum number of consecutive packet losses is greater than the preset maximum burst packet loss threshold, the replica level is determined to be the preset value.
[0023] If the maximum number of continuous packet losses is less than or equal to the preset maximum burst packet loss threshold, the data packet confirmation ratio within the preset data packet column length is counted, the confirmation rate interval corresponding to the data packet confirmation ratio is queried, and the value that is mapped to the confirmation rate interval is determined as the replica level.
[0024] Further, the method further comprises: if a data packet loss is detected, determining a data offset interval and a number of retransmissions corresponding to the lost data packet;
[0025] Determine whether the data offset interval corresponding to the lost data packet overlaps with the data offset interval recorded in the retransmitted data interval set;
[0026] If yes, the data offset interval corresponding to the lost data packet is combined with the data offset interval recorded in the retransmission data interval set, and the maximum value of the number of retransmissions corresponding to the lost data packet and the number of retransmissions corresponding to the recorded data offset interval is determined as the number of retransmissions of the combined data offset interval;
[0027] If not, the data offset interval and the number of retransmissions corresponding to the lost data packet are inserted into the retransmission data interval set.
[0028] Further, the method further includes: if data packet confirmation information returned by the second device is received, determining whether the data offset interval corresponding to the confirmed data packet overlaps with the data offset interval recorded in the retransmission data interval set;
[0029] If not, the data offset interval and the number of retransmissions corresponding to the confirmed data packet are deleted from the retransmission data interval set;
[0030] If so, the recorded data offset interval in the retransmission data interval set is split according to the data offset interval corresponding to the confirmed data packet, and the number of retransmissions of the data offset interval after the split is determined according to the number of retransmissions corresponding to the data offset interval before the split.
[0031] Further, the method further comprises: after retransmitting the copy, determining whether the data offset interval corresponding to the retransmitted copy overlaps with the data offset interval recorded in the retransmitted data interval set;
[0032] If not, the data offset interval and the number of retransmissions corresponding to the retransmission copy are deleted from the retransmission data interval set;
[0033] If so, the recorded data offset interval in the retransmission data interval set is split according to the data offset interval corresponding to the retransmission copy, and the number of retransmissions of the data offset interval after the split is determined according to the number of retransmissions corresponding to the data offset interval before the split.
[0034] According to another aspect of an embodiment of the present application, a packet loss retransmission device is provided, the device is applicable to a scenario where a packet loss is detected and multiple retransmissions are performed, the device is applied to a first device, and the device includes:
[0035] A retransmission number determination module, adapted to determine the data to be retransmitted and the number of retransmissions corresponding to the data to be retransmitted if a data packet loss is detected;
[0036] A replica level determination module, adapted to obtain a packet loss parameter and determine a replica level according to the packet loss parameter, wherein the replica level is used to control the number of replicas;
[0037] A replica number determination module, adapted to determine the number of retransmission replicas corresponding to the data to be retransmitted according to the number of retransmissions and the replica level;
[0038] The sending module is adapted to send the retransmission copies to the second device according to the number of retransmission copies.
[0039] According to another aspect of the embodiment of the present application, there is provided a computing device, including: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;
[0040] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned packet loss retransmission method.
[0041] According to another aspect of the embodiments of the present application, a computer storage medium is provided, in which at least one executable instruction is stored, and the executable instruction enables a processor to perform operations corresponding to the above-mentioned packet loss retransmission method.
[0042] According to another aspect of the embodiments of the present application, a computer program product is provided, comprising at least one executable instruction, wherein the executable instruction enables a processor to perform operations corresponding to the above-mentioned packet loss retransmission method.
[0043] According to the packet loss retransmission method and device provided in the embodiments of the present application, the number of retransmission copies can be accurately determined based on the number of retransmissions and the copy level, thereby effectively improving the probability of successful data acceptance and reducing the average maximum number of retransmissions. At the same time, through orderly copy scheduling, it is possible to prevent sudden network packet loss from causing the loss of all copies sent in a centralized manner, and it is also possible to prevent the centralized sending of a large number of copy data from blocking the sending of new data, thereby improving service stability and reducing CPU glitches caused by retransmission. In addition, if applied to audio and video services, it can ensure that audio and video data can reach the client quickly and reliably, thereby reducing the audio and video playback freeze rate, improving the audio and video service quality, and improving user experience.
[0044] The above description is only an overview of the technical solution of the embodiment of the present application. In order to more clearly understand the technical means of the embodiment of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present application more obvious and easy to understand, the specific implementation method of the embodiment of the present application is listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only used for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the embodiments of the present application. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0046] Figure 1 A schematic diagram showing a process flow of a packet loss retransmission method according to an embodiment of the present application is shown;
[0047] Figure 2A A schematic diagram showing a flow chart of a packet loss retransmission method according to another embodiment of the present application is shown;
[0048] Figure 2B A schematic diagram of inserting a data packet into a retransmission data interval set when a data packet is lost and there is no overlap;
[0049] Figure 2C A schematic diagram of inserting data into a retransmission data interval set when data packets are lost and overlapped;
[0050] Figure 2D is a schematic diagram of confirming a data packet from a set of retransmitted data intervals when there is no overlap;
[0051] Figure 2E is a schematic diagram of confirming a data packet from a set of retransmitted data intervals when there is overlap;
[0052] Figure 2F Schematic diagram for scheduling retransmission copies;
[0053] Figure 2G is a schematic diagram of the number of retransmissions;
[0054] Figure 2H This is a schematic diagram of CPU usage;
[0055] Fig.2I A schematic diagram of the number of connections;
[0056] Figure 2J This is a schematic diagram of the jam rate;
[0057] Figure 3 A structural block diagram of a packet loss retransmission device according to an embodiment of the present application is shown;
[0058] Figure 4 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0059] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0060] First, the terms involved in one or more embodiments of the present application are explained.
[0061] Congestion control: Congestion control refers to a method in a computer network that monitors the degree of network congestion and takes appropriate measures to maintain the stable operation of the network. Its main goal is to ensure the rational use of network resources and avoid performance degradation and service quality degradation caused by network congestion.
[0062] QUIC: (Quick UDP Internet Connection) is a UDP-based transmission protocol proposed by Google. Due to its high transmission efficiency and multi-channel concurrency, it has become the underlying transmission protocol of the next-generation Internet protocol HTTP / 3. In addition to being used in the Web field, its advantages are also applicable to some general transmission scenarios that require low latency and high throughput characteristics.
[0063] Based on the above-mentioned deficiencies of the packet loss retransmission solution, the inventor of the present application has proposed an improved solution that is more suitable for a production environment, which is described below in conjunction with a specific embodiment.
[0064] Figure 1 A schematic diagram of a packet loss retransmission method according to an embodiment of the present application is shown. The method is applicable to a scenario where multiple retransmissions are performed after a packet loss is detected. The method is applied to a first device, such as Figure 1 As shown, the method comprises the following steps:
[0065] Step S101: if data packet loss is detected, then determine the data to be retransmitted and the number of retransmissions corresponding to the data to be retransmitted.
[0066] The first device may be any device that sends data, for example, an audio or video server or other data server.
[0067] If the first device detects that there is a data packet loss, it needs to perform packet retransmission processing. When retransmitting, it is necessary to first determine the data to be retransmitted. The data to be retransmitted can be determined by combining the lost data, confirmed data and retransmitted data, and the corresponding number of retransmissions can be determined. The number of retransmissions reflects the number of times the data to be retransmitted has been retransmitted.
[0068] Step S102, obtaining a packet loss parameter, and determining a replica level according to the packet loss parameter, wherein the replica level is used to control the number of replicas.
[0069] The packet loss parameters reflect the packet loss situation from the network level. The packet loss parameters may include the maximum number of consecutive packet losses, the data packet confirmation rate, etc. The replica level is determined by the packet loss parameters. The replica level is used to dynamically adjust the number of replicas based on the recent network conditions.
[0070] Step S103, determining the number of retransmission copies corresponding to the data to be retransmitted according to the number of retransmissions and the copy level.
[0071] After determining the number of retransmissions and the copy level corresponding to the data to be retransmitted, the first device can determine the number of retransmission copies corresponding to the data to be retransmitted based on the number of retransmissions and the copy level, where the number of retransmission copies defines the number of retransmission copies corresponding to the data to be retransmitted, wherein the retransmission copies include the primary retransmission copy (also called the first retransmission copy) and the remaining retransmission copies.
[0072] Specifically, the first device can compare the number of retransmissions and the size of the copy level, and determine the number of retransmission copies based on the comparison result. Alternatively, the mapping relationship between the number of retransmissions, the copy level and the number of retransmission copies can be pre-set and recorded in a mapping table, so that the corresponding number of retransmission copies can be obtained according to the number of retransmissions and the copy level. In addition, other methods can be used to determine the number of retransmission copies, which will not be repeated here.
[0073] Step S104: Send the retransmission copies to the second device according to the number of retransmission copies.
[0074] After determining the number of retransmission copies according to step S103, the first device may send corresponding retransmission copies to the second device according to the number of retransmission copies, wherein the second device refers to a receiving end of the data, for example, a client. Assuming that the number of retransmission copies determined by the first device is 3, the first device needs to send 3 retransmission copies to the second device.
[0075] According to the packet loss retransmission method provided in the embodiment of the present application, the number of retransmission copies can be accurately determined based on the number of retransmissions and the copy level, so that the first device can use the most appropriate number of copies when retransmitting, thereby effectively improving the probability of successful data acceptance and reducing the average maximum number of retransmissions. In addition, the service stability is improved and the CPU glitches caused by retransmission are reduced. In addition, if applied to audio and video services, it can ensure that audio and video data can reach the client quickly and reliably, thereby reducing the audio and video playback freeze rate, improving the audio and video service quality, and improving the user experience.
[0076] Figure 2AA schematic diagram of a packet loss retransmission method according to another embodiment of the present application is shown. The method is applicable to a scenario where multiple retransmissions are performed after a packet loss is detected. The method is applied to a first device, such as Figure 2A As shown, the method comprises the following steps:
[0077] Step S201: if data packet loss is detected, determine the data to be retransmitted and the number of retransmissions corresponding to the data to be retransmitted.
[0078] In this embodiment, the first device is used to transmit data, and the second device is used to receive data. After the second device receives the data packet sent by the first device, if the second device successfully receives the data packet sent by the first device, it will return confirmation information (ACK information) that the data packet has been successfully received to the first device. Thus, the first device can determine whether there is a data packet loss based on the ACK information.
[0079] In order to accurately determine the number of retransmissions corresponding to the data that needs to be retransmitted, this embodiment designs and maintains a retransmission data interval set based on the data offset interval and the number of retransmissions. <retransdatainterval>, which stores the start and end offsets of the data offset interval of the lost data packet and the corresponding retransmission count. <retransdatainterval>Insertion, retransmission events and confirmation events correspond to set <retransdatainterval>Delete.
[0080] Therefore, the amount of data to be retransmitted each time can be predefined, and then the retransmission data interval set can be queried to determine the data to be retransmitted each time and the number of retransmissions corresponding to the data to be retransmitted. Each time, which data needs to be retransmitted is determined from the retransmission data interval set. The retransmission data interval set records the number of retransmissions corresponding to each data offset interval. After the data to be retransmitted is determined, its corresponding number of retransmissions can be determined in combination with the data offset interval to which it belongs.
[0081] In an optional implementation, if data packet loss is detected, in order to facilitate subsequent retransmission, the data offset interval and the number of retransmissions corresponding to the lost data packet need to be inserted into a retransmission data interval set, wherein the retransmission data interval set is used to record all data that need to be retransmitted. However, each packet loss situation is different, and the number of retransmissions of each lost data packet may also be different. All data that need to be retransmitted recorded in the retransmission data interval set may or may not overlap with the data of the newly lost data packet. In view of the above situation, in order to accurately determine the number of retransmission copies, thereby improving the success rate of the second device receiving data, it is necessary to accurately determine the number of retransmissions of the retransmitted data recorded in the retransmission data interval set. Specifically, the data offset interval and the number of retransmissions corresponding to the lost data packet can be determined first; then, the data offset interval and the number of retransmissions corresponding to the lost data packet are determined. Whether there is overlap in the data offset intervals recorded in the retransmission data interval set, where data offset interval overlap means that there is part of the same data in the two data offset intervals or the end offset of one data offset interval is the starting offset of another data offset interval. Here, judging whether there is overlap between the two data offset intervals is to determine whether the data offset interval and the number of retransmissions corresponding to the lost data packet are directly inserted into the retransmission data interval set or need further processing; if there is overlap, the data offset interval corresponding to the lost data packet and the data offset interval recorded in the retransmission data interval set are merged and processed, and the maximum value of the number of retransmissions corresponding to the lost data packet and the number of retransmissions corresponding to the recorded data offset interval is determined as the number of retransmissions of the merged data offset interval; if there is no overlap, the data offset interval and the number of retransmissions corresponding to the lost data packet are inserted into the retransmission data interval set.
[0082] Figure 2B Schematic diagram of inserting into the retransmission data interval set when data packets are lost and there is no overlap. Figure 2B In the example, the data offset interval [a2, b2) and the retransmission number 1 corresponding to the lost data packet to be inserted are determined. The data offset interval recorded in the retransmission data interval set is [a1, b1). It is determined that there is no overlap between the two data offset intervals. The data offset interval [a2, b2) and the retransmission number 1 corresponding to the lost data packet can be directly inserted into the retransmission data interval set. The retransmission data interval set after insertion is as follows: Figure 2B shown.
[0083] Figure 2C Schematic diagram of inserting into the retransmission data interval set when data packets are lost and overlapped. Figure 2C In the example, the data offset interval [a3, b3) and the retransmission number 2 corresponding to the lost data packet to be inserted are determined. The data offset intervals recorded in the retransmission data interval set are [a1, b1) and [a2, b2). It is determined that the data offset interval [a3, b3) overlaps with the data offset interval [a1, b1). Therefore, the data offset interval [a3, b3) corresponding to the lost data packet can be inserted into the retransmission data interval set and overlapped with the data offset interval [a1, b1), the merged data offset interval is [a1,b3), and the number of retransmissions of the merged data offset interval [a1,b3) is the maximum of the number of retransmissions of the data offset interval [a3,b3) and the number of retransmissions of the data offset interval [a1,b1), where the number of retransmissions of the data offset interval [a3,b3) is 2, and the number of retransmissions of the data offset interval [a1,b1) is 1. Therefore, the number of retransmissions of the merged data offset interval [a1,b3) is 2. Figure 2C shown.
[0084] For example, a segment of 2000 bytes of data is transmitted using three QUIC packets, PN100 stores data [0,500), PN101 stores data [500,1500), and PN102 stores data [1500,2000).
[0085] Assume that PN100 and PN102 have each been retransmitted twice, and the data offset interval of PN 100 has been recorded in the retransmission data interval set, and the newly lost data packet is PN 102, before inserting the data offset interval of PN 102 into the retransmission data interval set, it is determined that there is no overlap between the data offset interval of PN 100 and the data offset interval of PN 102, then the data offset interval of PN 102 [1500, 2000) and the corresponding number of retransmissions 2 will be directly inserted.
[0086] Assume that PN100 and PN101 have each been retransmitted twice, and the data offset interval of PN 100 has been recorded in the retransmission data interval set, and the newly lost data packet is PN 101. Before inserting the data offset interval of PN 101 into the retransmission data interval set, it is found through judgment that the data offset interval of PN 100 overlaps with the data offset interval of PN 101, and they will be merged into the data offset interval [0,1500). The number of retransmissions of the merged data offset interval [0,1500) is 2, and the contents of PN100 and PN101 can be reorganized to generate two retransmission packets PN103 and PN104.
[0087] Suppose PN100 is retransmitted twice, but PN 101 is retransmitted once, the data offset interval of PN100 has been recorded in the retransmitted data interval set, and the newly lost data packet is PN 101. Before inserting the data offset interval of PN 101 into the retransmitted data interval set, it is found through judgment that the data offset interval of PN 100 and the data offset interval of PN 101 overlap, and they will be merged into a data offset interval [0,1500). Although PN 101 is retransmitted once, the number of retransmissions of the merged data offset interval [0,1500) is determined to be 2. The contents of PN100 and PN101 can be reorganized to generate two retransmitted packets PN103 and PN104.
[0088] In an optional implementation, there may also be a situation where the data packet confirmation information is delayed in reaching the first device due to network reasons, and the first device determines that the data packet has been lost but has not yet been retransmitted. In this case, if the data packet confirmation information returned by the second device is received, it is determined whether the data offset interval corresponding to the confirmed data packet overlaps with the data offset interval recorded in the retransmission data interval set; if there is no overlap, a deletion operation can be directly performed, that is, the data offset interval and the number of retransmissions corresponding to the confirmed data packet are directly deleted from the retransmission data interval set;
[0089] If there is overlap, the deletion operation cannot be performed directly. The recorded data offset interval in the retransmission data interval set needs to be split according to the data offset interval corresponding to the confirmed data packet, and the number of retransmissions of the data offset interval after the split is determined according to the number of retransmissions corresponding to the data offset interval before the split.
[0090] Figure 2D Schematic diagram of confirming a data packet from a set of retransmitted data intervals when there is no overlap, such as Figure 2D As shown, the data offset interval [a1, b3) and its corresponding retransmission number 2 and the data offset interval [a2, b2) and its corresponding retransmission number 1 have been recorded in the retransmission data interval set. The second device determines that it has received a data packet with a data offset interval of [a2, b2) and returns a data packet confirmation message to the first device. The data packet confirmation message may carry the data offset interval or the data packet sequence number. The first device may determine that the data offset interval corresponding to the confirmed data packet is [a2, b2) based on the data packet sequence number, and then determine whether the data offset interval [a2, b2) corresponding to the confirmed data packet overlaps with the data offset interval recorded in the retransmission data interval set. By determining that there is no overlap, the data offset interval [a2, b2) and its corresponding retransmission number may be directly deleted from the retransmission data interval set.
[0091] Figure 2E Schematic diagram of confirming a data packet from a set of retransmitted data intervals when there is overlap, such as Figure 2E As shown, the data offset interval [a1, b3) and its corresponding retransmission number 2 have been recorded in the retransmission data interval set. The second device determines that a data packet with a data offset interval of [c1, c2) has been received, and returns data packet confirmation information to the first device. The data packet confirmation information may carry the data offset interval or the data packet sequence number. The first device may determine that the data offset interval corresponding to the confirmed data packet is [c1, c2) according to the data packet sequence number, and then determine whether the data offset interval [c1, c2) corresponding to the confirmed data packet overlaps with the data offset interval recorded in the retransmission data interval set. If it is determined that the data offset interval [c1, c2) overlaps with the data offset interval [a1, b3), it is necessary to split the data offset interval [a1, b3) according to the data offset interval [c1, c2) corresponding to the confirmed data packet. Through the splitting process, two data offset intervals are generated, namely [a1, c1) and [c2, b3). Then, the number of retransmissions of the split data offset intervals [a1, c1) and [c2, b3) is determined according to the number of retransmissions corresponding to the data offset interval [a1, b3) before the split. The number of retransmissions of the data offset intervals [a1, c1) and [c2, b3) are both 2.
[0092] In an optional implementation, when it is determined that retransmission is required, after retransmitting the copy, it is determined whether the data offset interval corresponding to the retransmitted copy overlaps with the data offset interval recorded in the retransmitted data interval set; if there is no overlap, the deletion operation can be performed directly, that is, the data offset interval and the number of retransmissions corresponding to the retransmitted copy are deleted from the retransmitted data interval set; if there is an overlap, the deletion operation cannot be performed directly, and the recorded data offset interval in the retransmitted data interval set needs to be split according to the data offset interval corresponding to the retransmitted copy, and the number of retransmissions of the data offset interval after the split is determined according to the number of retransmissions corresponding to the recorded data offset interval before the split. The retransmission processing method is similar to the confirmation processing method and will not be repeated here.
[0093] The retransmission data interval set is triggered by each packet loss, confirmation, and retransmission event <retransdatainterval>Modifications are made to transfer and update the retransmission count between the stream buffer and the quic packet.
[0094] Step S202, obtaining the maximum number of consecutive packet losses occurring in the most recent round trip time, and if the maximum number of consecutive packet losses is greater than a preset maximum burst packet loss threshold, determining the replica level as a preset value.
[0095] Round-trip time, also known as RTT, refers to the total time it takes for a data packet to be sent from the first device, transmitted over the network to the second device, for the second device to process the data packet and send confirmation information (such as ACK), and for the confirmation information to be transmitted back to the first device over the network. The most recent round-trip time refers to the most recently measured round-trip time.
[0096] Packet loss may occur during the most recent round trip time. In order to accurately determine the replica level, it is necessary to obtain the maximum number of consecutive packet losses (burst_lost_size) during the most recent round trip time. The maximum number of consecutive packet losses refers to the maximum number of consecutively lost data packets during network transmission. The maximum number of consecutive packet losses reflects the severity of network packet loss. A higher maximum number of consecutive packet losses indicates a serious degree of network packet loss.
[0097] A technician in this field can set a maximum burst packet loss number threshold (kMaxBurstLost) according to the network conditions. The preset maximum burst packet loss number threshold reflects the dividing point of the network packet loss degree. The maximum continuous packet loss number is compared with the preset maximum burst packet loss number threshold. If the maximum continuous packet loss number is greater than the preset maximum burst packet loss number threshold, it means that the network packet loss degree is serious. In order to avoid network congestion, the copy level can be determined as a preset value, for example, set to 1, thereby disabling the remaining retransmission copies, that is, only the first retransmission copy, that is, the primary retransmission copy, exists.
[0098] Step S203, if the maximum continuous packet loss number is less than or equal to the preset maximum burst packet loss number threshold, then count the data packet confirmation ratio within the preset data packet sequence length, query the confirmation rate interval corresponding to the data packet confirmation ratio, and determine the value that has a mapping relationship with the confirmation rate interval as the replica level.
[0099] If the maximum number of continuous packet losses is less than or equal to the preset maximum burst packet loss threshold, it means that the network condition is okay. In order to more accurately determine the copy level and then accurately determine the number of retransmitted copies, it is necessary to count the packet confirmation ratio within the preset packet train length (packet_train_length), where the packet confirmation ratio is denoted as Pa. The packet confirmation ratio refers to the ratio of packets that receive confirmation information to the preset packet train length. The packet confirmation ratio Pa = the number of packets that receive confirmation information / the preset packet train length. Technical personnel in this field can set the preset packet train length according to actual needs.
[0100] The mapping relationship between the confirmation rate interval and the replica level is pre-set. The endpoints of each confirmation rate interval can be represented by ACKRATE, and its value is a decimal in the interval [0,1]. After the data packet confirmation ratio is calculated, the data packet confirmation ratio is compared with the endpoints of each confirmation rate interval to determine the confirmation rate interval to which the data packet confirmation ratio belongs. Then, the value that has a mapping relationship with the confirmation rate interval is determined as the replica level. Optionally, the value range [1, MAX_LEVEL] can be set for the replica level, and the mapping relationship between the confirmation rate interval and the replica level can be set in combination with the value range.
[0101] In an optional implementation, the replica level is defined as replica_level, whose value is an integer in the interval [1, MAX_LEVEL], and is used to dynamically adjust the number of replicas based on the latest network conditions. The following is a code to describe an implementation process of determining replica_level:
[0102]
[0103]
[0104] Step S204, compare the number of retransmissions and the copy level. If the number of retransmissions is less than the copy level, the number of retransmissions is determined as the number of retransmission copies; if the copy level is less than the number of retransmissions, the copy level is determined as the number of retransmission copies.
[0105] After determining the number of retransmissions and the copy level corresponding to the data to be retransmitted, the first device can determine the number of retransmission copies corresponding to the data to be retransmitted based on the number of retransmissions and the copy level, where the number of retransmission copies defines the number of retransmission copies corresponding to the data to be retransmitted, wherein the retransmission copies include the primary retransmission copy (also called the first retransmission copy) and the remaining retransmission copies.
[0106] Specifically, the first device may compare the number of retransmissions Rn and the replica level replica_level, and determine the number of retransmission copies according to the comparison result. If the number of retransmissions is less than the replica level, the number of retransmissions is determined as the number of retransmission copies; if the replica level is less than the number of retransmissions, the replica level is determined as the number of retransmission copies. That is, let the number of retransmission copies N = min (Rn, replica_level).
[0107] In order to prevent sudden network packet loss from causing all the copies sent in a centralized manner to be lost, and to prevent the centralized sending of a large number of copies from blocking the sending of new data, it is necessary to schedule the sending of retransmitted copies. Specifically, this can be achieved through steps S205-S206:
[0108] Step S205, determining the expected sending time of the copies corresponding to each retransmission copy.
[0109] In order to perform effective scheduling, it is necessary to determine the expected sending time of each retransmission copy. The expected sending time (expected_send_time) of the copy defines the expected time of sending the retransmission copy. Here, the expected sending time of the first retransmission copy is set to send immediately, that is, the first retransmission copy is sent according to the original packet sending rhythm. For example, let expected_send_time of the first retransmission copy = Time::Zero();
[0110] If there are other retransmitted copies, that is, the remaining retransmitted copies except the first retransmitted copy, the minimum round-trip time (min rtt) can be determined first, and then, for any other retransmitted copy, the send delay time (send_delay) corresponding to the other retransmitted copy can be determined, where the send delay time is a random value between [0, 1 / 2 minimum round-trip time]. Finally, the expected send time of the copy corresponding to the other retransmitted copies is determined according to the send delay time and the current time, and the expected_send_time of the remaining retransmitted copies is set to Time::Now() + send_delay, where send_delay = a random value between 0 and 1 / 2 min rtt.
[0111] Selecting 1 / 2minRTT as the maximum delay can avoid excessive delays: if the delay is too large, it may cause the data packet to be transmitted too long, affecting real-time performance. Therefore, limiting the maximum delay to 1 / 2minRTT can ensure that the retransmitted copies are not excessively delayed. In addition, it can also balance reliability and real-time performance: 1 / 2minRTT is a reasonable compromise point that can effectively disperse the transmission time of the copies and ensure that the data packet arrives at the second device within a reasonable time.
[0112] By introducing send_delay, retransmitted copies can be sent at different time points in a dispersed manner, thereby reducing the occurrence of the following problems: a large number of data packets enter the network at the same time point, causing the buffer of routers and switches to overflow, which in turn causes packet loss. When multiple retransmitted copies are lost, more copies may need to be resent, further increasing the network burden and forming a vicious circle. A large number of retransmitted copies are concentrated in a short period of time and take up too much bandwidth, resulting in the inability to send new data packets in time, affecting the overall transmission efficiency. The reliability and efficiency of transmission are improved.
[0113] Step S206: In each round, according to a preset replica scheduling order and based on the expected sending time of each replica, retransmission replicas corresponding to the number of retransmission replicas are sent to the second device.
[0114] After determining the expected sending time of the replica corresponding to each retransmission replica, in each round, the retransmission replicas corresponding to the number of retransmission replicas are sent to the second device based on the expected sending time of each replica in accordance with the preset replica scheduling order, wherein if the number of retransmission replicas is greater than or equal to 2, the preset replica scheduling order is: the first retransmission replica, other retransmission replicas whose expected sending time of the replica is less than or equal to the current time, and new data packet, that is, the first retransmission replica is sent first, then, other retransmission replicas whose expected sending time of the replica is less than or equal to the current time, and finally, the new data packet is sent; if the number of retransmission copies is 1, the preset scheduling order is: the first retransmission replica, the new data packet, that is, the first retransmission copy is sent first, and then, the new data packet is sent.
[0115] In order to facilitate replica scheduling, a minimum heap can be created to store all retransmission replicas to be sent and their corresponding expected replica sending times. The minimum heap is sorted according to the expected replica sending times of the retransmission replicas, thereby facilitating subsequent scheduling of the retransmission replicas.
[0116] Figure 2F A schematic diagram of scheduling retransmission copies, such as Figure 2F As shown, when there are no remaining retransmission copies, that is, only one main retransmission copy is generated for the lost data, and each round of packet sending is performed in the following scheduling order: the first retransmission copy, the new data packet, for example, the first round of packet sending: first send the retransmission copy 1, and then send the new data packet 4; the second round of packet sending: first send the retransmission copy 2, and then send the new data packet 5.
[0117] If there are remaining retransmission copies, if copy scheduling is not performed, all the copies that need to be retransmitted may be sent together. This may easily cause sudden network packet loss, resulting in the loss of all the copies sent together. Figure 2F As shown in , retransmission copies 2-1 to 2-3, and retransmission copies 3-1 to 3-2 are lost, resulting in the need to trigger retransmission again.
[0118] Therefore, in the case of remaining retransmission copies, copy scheduling is also required. At this time, each round of packet transmission is carried out in the following scheduling order: the first retransmission copy, other retransmission copies whose expected transmission time is less than or equal to the current time, and new data packets. For example, in the first round of packet transmission: first send retransmission copy 1-1 and retransmission copy 2-1, then send retransmission copy 1-2 and retransmission copy 2-2, and finally send new data packet 4. Here, the retransmission copies are marked in the form of sequence numbers NM, where N is used to mark retransmission copies of different data, is the copy sequence number, and the copy sequence number of retransmission copies of different data is 1, and M is used to mark retransmission copies of the same data. For example, retransmission copy 1-2 refers to the second retransmission copy of copy sequence number 1, and retransmission copy 2-2 refers to the second retransmission copy of copy sequence number 2.
[0119] In an optional implementation, relevant retransmission parameters need to be maintained for the retransmission copies, such as confirmed retransmission copies, lost retransmission copies, and the number of retransmission copies. Each time a confirmation message or loss message is received, the corresponding retransmission parameter is increased by 1. When it is confirmed that all retransmission copies are lost, the data packet is confirmed to be lost and the next retransmission needs to be triggered.
[0120] The packet loss retransmission method proposed in this application is implemented based on the QUIC protocol stack of Chromium Quiche, and it can be applied to various fields.
[0121] In recent years, with the development of Internet technology and the popularity of various entertainment apps, audio and video streaming has become an indispensable part of people's daily lives. Especially for audio and video service providers, improving the user experience quality (QoE) of audio and video services is a The user experience quality of audio and video services specifically refers to the quality of the user experience when using audio and video services, which is mainly reflected in video clarity, video fluency, video delay, etc. In particular, for live broadcast scenarios that are increasingly widely used, the real-time performance of audio and video services is crucial, which is mainly reflected in the smoothness of the picture from the user experience perspective.
[0122] From the perspective of network transmission, when packet loss occurs in the network, the server needs to retransmit. If the retransmission efficiency is not high, multiple retransmissions will be triggered before the client can receive the data frame. Obviously, the more retransmissions, the longer it takes for the client to recover the data, which will seriously affect the real-time performance of the live broadcast, resulting in a sense of lag.
[0123] The packet loss retransmission method proposed in the present application can be applied to audio and video services. That is to say, the data packets in the above embodiments can be audio and video data packets, thereby improving the quality of audio and video services and improving user experience.
[0124] Through the above method, the number of retransmissions can be effectively reduced. Figure 2G is a schematic diagram of the number of retransmissions, such as Figure 2G As shown, it schematically shows the number of retransmissions and their proportions in three different scenarios when retransmission is performed using the packet loss retransmission method of the present application and retransmission provided by the prior art. Among them, the experimental group is the proportion of each retransmission number when retransmission is performed using the packet loss retransmission method proposed in the present application, and the control group is the proportion of each retransmission number when retransmission is performed using the retransmission provided by the prior art. It can be seen that the average maximum number of retransmissions is effectively reduced.
[0125] Figure 2H A schematic diagram of CPU usage is shown in Figure 2. Figure 2H As shown, the left side of the vertical line 1 is the CPU usage rate when retransmission is performed using the retransmission provided by the prior art, wherein it can be seen that the part pointed by the arrow has CPU glitches, and the right side of the vertical line 1 is the CPU usage rate when retransmission is performed using the packet loss retransmission method proposed in the present application. By comparison, it can be seen that retransmission using the packet loss retransmission method proposed in the present application reduces the CPU glitches caused by retransmission, thereby improving service stability.
[0126] Fig.2I is a schematic diagram of the number of connections, such as Fig.2I As shown, the Fig.2I It is to supplement the explanation that when the CPU glitches are reduced, the number of connections remains stable. The left side of the vertical line 2 is the number of connections when retransmission is performed using the retransmission provided by the prior art, and the right side of the vertical line 2 is the number of connections when retransmission is performed using the packet loss retransmission method proposed in the present application. By comparison, it can be seen that retransmission using the packet loss retransmission method proposed in the present application reduces the CPU glitches caused by retransmission, but the number of connections remains stable, thereby improving service stability.
[0127] Figure 2J is a schematic diagram of the jam rate, such as Figure 2J As shown, with the arrow after retransmission optimization as the dividing point, the left side of the arrow schematically shows the jamming curve when using the packet loss retransmission method of the prior art under two different protocols (H2 protocol and QUIC protocol). It can be seen that the jamming situation does not change significantly under the two different protocols. The right side of the arrow schematically shows the jamming curve when using the packet loss retransmission method of the present application under two different protocols. It can be seen that the jamming situations are obviously distinguished under the two different protocols. The present application is implemented based on the QUIC protocol. It can be seen that under the QUIC protocol, the number of jams is significantly reduced when using the packet loss retransmission method of the present application, thereby reducing the jamming rate.
[0128] According to the method provided in the embodiment of the present application, the number of retransmission copies can be accurately determined based on the number of retransmissions and the copy level, thereby effectively improving the probability of successful data acceptance and reducing the average maximum number of retransmissions. At the same time, through orderly copy scheduling, it is possible to prevent sudden network packet loss from causing the loss of all copies sent in a centralized manner, and it is also possible to prevent the centralized sending of a large number of copy data from blocking the sending of new data, thereby improving service stability and reducing CPU glitches caused by retransmissions. In addition, if applied to audio and video services, it can ensure that audio and video data can reach the client quickly and reliably, thereby reducing the audio and video playback freeze rate, improving the audio and video service quality, and improving user experience.
[0129] Figure 3 The structure block diagram of the packet loss retransmission device according to an embodiment of the present application is shown. The device is suitable for a scenario where multiple retransmissions are performed when a packet loss is detected. The device is applied to a first device, such as Figure 3 As shown, the device comprises:
[0130] A retransmission number determination module 301, adapted to determine the data to be retransmitted and the number of retransmissions corresponding to the data to be retransmitted if a data packet loss is detected;
[0131] A replica level determination module 302, adapted to obtain a packet loss parameter and determine a replica level according to the packet loss parameter, wherein the replica level is used to control the number of replicas;
[0132] A copy number determination module 303, adapted to determine the number of retransmission copies corresponding to the data to be retransmitted according to the number of retransmissions and the copy level;
[0133] The sending module 304 is adapted to send the retransmission copies to the second device according to the number of retransmission copies.
[0134] Optionally, the sending module is further adapted to: determine an expected sending time of a copy corresponding to each retransmitted copy;
[0135] In each round, retransmitted copies corresponding to the number of retransmitted copies are sent to the second device according to a preset copy scheduling order and based on the expected sending time of each copy.
[0136] Optionally, if the number of retransmission copies is greater than or equal to 2, the preset copy scheduling order is: the first retransmission copy, other retransmission copies whose expected copy sending time is less than or equal to the current time, and the new data packet;
[0137] If the number of retransmission copies is 1, the preset scheduling order is: the first retransmission copy, the new data packet.
[0138] Optionally, the sending module is further adapted to: set the expected sending time of the copy of the first retransmitted copy to be sent immediately;
[0139] For any other retransmitted copies, determine the sending delay time, and determine the expected sending time of the copies corresponding to the other retransmitted copies based on the sending delay time and the current time, where the sending delay time is a random value between [0, 1 / 2 minimum round-trip time].
[0140] Optionally, the replica number determination module is further adapted to: if the number of retransmissions is less than the replica level, determine the number of retransmissions as the number of retransmission replicas;
[0141] If the replica level is less than the number of retransmissions, the replica level is determined as the number of retransmission copies.
[0142] Optionally, the replica level determination module is further adapted to: obtain a maximum number of consecutive packet losses occurring in a recent round trip time, and if the maximum number of consecutive packet losses is greater than a preset maximum burst packet loss number threshold, determine the replica level as a preset value;
[0143] If the maximum number of continuous packet losses is less than or equal to the preset maximum burst packet loss threshold, the data packet confirmation ratio within the preset data packet column length is counted, the confirmation rate interval corresponding to the data packet confirmation ratio is queried, and the value that is mapped to the confirmation rate interval is determined as the replica level.
[0144] Optionally, the apparatus further comprises: an insertion module adapted to determine a data offset interval and a number of retransmissions corresponding to the lost data packet if a data packet loss is detected;
[0145] Determine whether the data offset interval corresponding to the lost data packet overlaps with the data offset interval recorded in the retransmitted data interval set;
[0146] If yes, the data offset interval corresponding to the lost data packet is combined with the data offset interval recorded in the retransmission data interval set, and the maximum value of the number of retransmissions corresponding to the lost data packet and the number of retransmissions corresponding to the recorded data offset interval is determined as the number of retransmissions of the combined data offset interval;
[0147] If not, the data offset interval and the number of retransmissions corresponding to the lost data packet are inserted into the retransmission data interval set.
[0148] Optionally, the apparatus further comprises: a first deletion module adapted to determine whether a data offset interval corresponding to a confirmed data packet overlaps with a data offset interval recorded in a retransmission data interval set if data packet confirmation information returned by the second device is received;
[0149] If not, the data offset interval and the number of retransmissions corresponding to the confirmed data packet are deleted from the retransmission data interval set;
[0150] If so, the recorded data offset interval in the retransmission data interval set is split according to the data offset interval corresponding to the confirmed data packet, and the number of retransmissions of the data offset interval after the split is determined according to the number of retransmissions corresponding to the data offset interval before the split.
[0151] Optionally, the device further comprises: a second deletion module adapted to determine, after retransmitting the copy, whether the data offset interval corresponding to the retransmitted copy overlaps with the data offset interval recorded in the retransmitted data interval set;
[0152] If not, the data offset interval and the number of retransmissions corresponding to the retransmission copy are deleted from the retransmission data interval set;
[0153] If so, the recorded data offset interval in the retransmission data interval set is split according to the data offset interval corresponding to the retransmission copy, and the number of retransmissions of the data offset interval after the split is determined according to the number of retransmissions corresponding to the data offset interval before the split.
[0154] The description of each module above refers to the corresponding description in the method embodiment and will not be repeated here.
[0155] According to the device provided in the embodiment of the present application, the number of retransmission copies can be accurately determined based on the number of retransmissions and the copy level, thereby effectively improving the probability of successful data acceptance and reducing the average maximum number of retransmissions. At the same time, through orderly copy scheduling, it is possible to prevent sudden network packet loss from causing the loss of all copies sent in a centralized manner, and it is also possible to prevent the centralized sending of a large number of copy data from blocking the sending of new data, thereby improving service stability and reducing CPU glitches caused by retransmissions. In addition, if applied to audio and video services, it can ensure that audio and video data can reach the client quickly and reliably, thereby reducing the audio and video playback freeze rate, improving the audio and video service quality, and improving user experience.
[0156] An embodiment of the present application provides a non-volatile computer storage medium, which stores at least one executable instruction or computer program, and the executable instruction or computer program can enable a processor to perform operations corresponding to the packet loss retransmission method in any of the above method embodiments.
[0157] An embodiment of the present application provides a computer program product, which includes at least one executable instruction or computer program, and the executable instruction or computer program can enable a processor to perform operations corresponding to the packet loss retransmission method in any of the above method embodiments.
[0158] Figure 4 A schematic diagram of the structure of an embodiment of a computing device of the present application is shown. The specific embodiment of the present application does not limit the specific implementation of the computing device.
[0159] like Figure 4 As shown, the computing device may include: a processor (processor) 402 , a communications interface (Communications Interface) 404 , a memory (memory) 406 , and a communication bus 408 .
[0160] The processor 402, the communication interface 404, and the memory 406 communicate with each other via the communication bus 408. The communication interface 404 is used to communicate with other devices such as a client or other server network elements. The processor 402 is used to execute the program 410, which can specifically execute the relevant steps in the above-mentioned embodiment of the packet loss retransmission method for a computing device.
[0161] Specifically, the program 410 may include program codes, which include computer operation instructions.
[0162] The processor 402 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the computing device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0163] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0164] The program 410 can be specifically used to enable the processor 402 to execute the packet loss retransmission method in any of the above method embodiments. The specific implementation of each step in the program 410 can refer to the corresponding descriptions in the corresponding steps and units in the above packet loss retransmission embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above method embodiments, which will not be repeated here.
[0165] The algorithm and display provided herein are not inherently related to any specific computer, virtual system or other equipment. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the present application embodiment is not directed to any specific programming language yet. It should be understood that various programming languages can be utilized to realize the content of the present application embodiment described herein, and the above description of specific languages is to disclose the best mode of implementation of the present application embodiment.
[0166] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0167] Similarly, it should be understood that in order to streamline the present disclosure and help understand one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the embodiments of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following intention: the claimed embodiments of the present application require more features than the features clearly stated in each claim. More specifically, as reflected in the claims below, the inventive aspects are less than all the features of the single embodiment disclosed above. Therefore, the claims following the specific embodiment are hereby explicitly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the embodiment of the present application.
[0168] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0169] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the embodiments of the present application and to form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0170] The various component embodiments of the embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components according to the embodiments of the present application. The embodiments of the present application can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing part or all of the methods described herein. Such a program implementing the embodiments of the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0171] It should be noted that the above-mentioned embodiments illustrate rather than limit the embodiments of the present application, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be constructed as a limitation to the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The embodiments of the present application may be implemented by means of hardware including a number of different elements and by means of a suitably programmed computer. In a unit claim that lists a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names.< / retransdatainterval> < / retransdatainterval> < / retransdatainterval> < / retransdatainterval>
Claims
1. A packet loss retransmission method, the method is applicable to a scenario where multiple retransmissions are performed after a packet loss is detected, the method is applied to a first device, and the method comprises: If a data packet loss is detected, determining the data to be retransmitted and the number of retransmissions corresponding to the data to be retransmitted; Obtaining a packet loss parameter, and determining a replica level according to the packet loss parameter, wherein the replica level is used to control the number of replicas; Determine the number of retransmission copies corresponding to the data to be retransmitted according to the number of retransmissions and the copy level; The retransmission copies are sent to the second device according to the number of retransmission copies.
2. The method according to claim 1, wherein: The sending the retransmission copy to the second device according to the number of retransmission copies further comprises: Determine the expected sending time of the replica corresponding to each retransmitted replica; In each round, the retransmitted copies corresponding to the number of retransmitted copies are sent to the second device according to the preset copy scheduling order and based on the expected sending time of each copy.
3. The method according to claim 2, wherein: If the number of retransmission copies is greater than or equal to 2, the preset copy scheduling order is: the first retransmission copy, other retransmission copies whose expected copy sending time is less than or equal to the current time, and the new data packet; If the number of retransmission copies is 1, the preset scheduling order is: the first retransmission copy, the new data packet.
4. The method according to claim 2 or 3, wherein: Determining the expected transmission time of each retransmission copy further includes: Set the expected sending time of the first retransmitted copy to send immediately; For any other retransmitted copy, determine the sending delay time, and determine the expected sending time of the copy corresponding to the other retransmitted copy based on the sending delay time and the current time, wherein the sending delay time is a random value between [0, 1 / 2 minimum round-trip time].
5. The method according to any one of claims 1 to 4, wherein: Determining the number of retransmission copies corresponding to the to-be-retransmitted data according to the number of retransmissions and the copy level further includes: If the number of retransmissions is less than the copy level, determining the number of retransmissions as the number of retransmission copies; If the replica level is less than the number of retransmissions, the replica level is determined as the number of retransmission copies.
6. The method according to any one of claims 1 to 5, wherein: The obtaining of the packet loss parameter and determining the replica level according to the packet loss parameter further comprises: Obtaining the maximum number of consecutive packet losses that occurred in the most recent round-trip time, and if the maximum number of consecutive packet losses is greater than a preset maximum burst packet loss threshold, determining the replica level to be a preset value; If the maximum number of continuous packet losses is less than or equal to the preset maximum burst packet loss threshold, the data packet confirmation ratio within the preset data packet column length is counted, the confirmation rate interval corresponding to the data packet confirmation ratio is queried, and the value that is mapped to the confirmation rate interval is determined as the replica level.
7. The method according to any one of claims 1 to 6, wherein: The method further comprises: If data packet loss is detected, determine the data offset interval and retransmission times corresponding to the lost data packet; Determine whether the data offset interval corresponding to the lost data packet overlaps with the data offset interval recorded in the retransmission data interval set; If yes, the data offset interval corresponding to the lost data packet is combined with the data offset interval recorded in the retransmission data interval set, and the maximum value of the number of retransmissions corresponding to the lost data packet and the number of retransmissions corresponding to the recorded data offset interval is determined as the number of retransmissions of the combined data offset interval; If not, the data offset interval and the number of retransmissions corresponding to the lost data packet are inserted into the retransmission data interval set.
8. The method according to any one of claims 1 to 7, wherein: The method further includes: if data packet confirmation information returned by the second device is received, determining whether a data offset interval corresponding to the confirmed data packet overlaps with a data offset interval recorded in the retransmission data interval set; If not, deleting the data offset interval and the number of retransmissions corresponding to the confirmed data packet from the retransmission data interval set; If so, the recorded data offset interval in the retransmission data interval set is split according to the data offset interval corresponding to the confirmed data packet, and the number of retransmissions of the data offset interval after the split is determined according to the number of retransmissions corresponding to the data offset interval before the split.
9. The method according to any one of claims 1 to 8, wherein: The method further comprises: after retransmitting the copy, determining whether the data offset interval corresponding to the retransmitted copy overlaps with the data offset interval recorded in the retransmitted data interval set; If not, deleting the data offset interval and the number of retransmissions corresponding to the retransmission copy from the retransmission data interval set; If so, the recorded data offset interval in the retransmission data interval set is split according to the data offset interval corresponding to the retransmission copy, and the number of retransmissions of the data offset interval after the split is determined according to the number of retransmissions corresponding to the data offset interval before the split.
10. A packet loss retransmission device, the device is applicable to a scenario where a packet loss is detected and multiple retransmissions are performed, the device is applied to a first device, and the device comprises: A retransmission number determination module, adapted to determine the data to be retransmitted and the number of retransmissions corresponding to the data to be retransmitted if a data packet loss is detected; a replica level determination module, adapted to obtain a packet loss parameter and determine a replica level according to the packet loss parameter, wherein the replica level is used to control the number of replicas; A copy number determination module, adapted to determine the number of retransmission copies corresponding to the to-be-retransmitted data according to the number of retransmissions and the copy level; The sending module is adapted to send the retransmission copies to the second device according to the number of retransmission copies.
11. A computing device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the packet loss retransmission method according to any one of claims 1-9.
12. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to perform operations corresponding to the packet loss retransmission method according to any one of claims 1 to 9.
13. A computer program product, comprising at least one executable instruction, wherein the executable instruction enables a processor to perform operations corresponding to the packet loss retransmission method according to any one of claims 1 to 9.