Packet loss detection method and device, electronic equipment and storage medium

By analyzing the bitmap in the NACK message returned by the receiving end, packet loss is detected, which solves the problem of packet loss detection delay in weak network scenarios and improves the real-time performance and throughput of network transmission.

CN119341947APending Publication Date: 2025-01-21BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411502254.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The prior art cannot detect packet loss in time in weak network scenarios, affecting the real-time and throughput of network transmission.

Method used

By receiving and parsing the NACK packet returned by the receiving end, the minimum logo and bit diagram that has not received the minimum group is extracted, and each identifier interval in the special graph is traversed, and the group loss detection is performed according to the bit value.

Benefits of technology

It achieves fast and accurate detection of the loss of multiple packets, improves the timeliness of packet retransmission, and avoids the impact on the real-time performance and throughput of network transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119341947A_ABST
    Figure CN119341947A_ABST
Patent Text Reader

Abstract

The invention relates to a packet loss detection method and device, electronic equipment and a storage medium, and the method comprises the steps: receiving an NACK message returned by a receiving end, and analyzing a minimum identifier and a bit map, which are carried in the NACK message and are not received by the receiving end at present, of a minimum packet; the bit map is composed of bit values corresponding to all first identifiers in a first identifier interval formed from the minimum identifier to the sum of the minimum identifier and N, the bit values represent receiving states of groups corresponding to the first identifiers, and N is a positive integer; and traversing a first identifier of the first identifier interval, searching a bit value corresponding to the first identifier from the bit map, and performing loss detection on a packet corresponding to the first identifier according to the bit value. Therefore, the loss of a plurality of packets can be quickly and accurately detected at the same time, so that the packet retransmission is more timely, and the real-time performance and throughput of network transmission are prevented from being influenced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a packet loss detection method, device, electronic device and storage medium. Background Art

[0002] Currently, the User Datagram Protocol (UDP) is an unreliable, connectionless transport layer protocol. Unlike the reliable Transmission Control Protocol (TCP), UDP itself does not guarantee the delivery, order, or data integrity of messages. To achieve reliable packet transmission over UDP, packet loss detection is inevitably involved.

[0003] In the related art, there are usually several methods for detecting packet loss: The first is the retransmission timeout (RTO), which detects packet loss based on the timer timeout mechanism. When the sender sends a packet, a timer is started at the same time. If the confirmation (ACK) signal returned by the receiver is not received within the preset RTO time period, it is considered that the packet may have been lost, triggering retransmission. RTO will be adjusted as the network conditions change. When a packet is retransmitted multiple times, the RTO value of each retransmission will increase exponentially. This detection algorithm is slow in most cases, affecting the real-time performance of the transmission and the overall throughput of the network.

[0004] The second is Fast Retransmit, which is a mechanism used in the Transmission Control Protocol to detect and quickly respond to packet loss. When the sender receives three consecutive duplicate acknowledgments (DupACKs) for the same packet, it will determine that the packet has been lost and retransmit it immediately without waiting for the retransmission timeout timer to be triggered. This method is better than the RTO algorithm to a certain extent. Fast retransmit can only handle the loss of the packet with the current smallest unconfirmed sequence number, and cannot predict the reception status of subsequent packets. When the link environment is poor and the packet loss rate is high, the efficiency of fast retransmit will drop significantly.

[0005] Therefore, the above methods for detecting packet loss in network communication have obvious limitations, especially in weak network scenarios, because the link is unstable and packet loss cannot be detected in time, which directly affects the real-time performance and throughput of network transmission. Summary of the invention

[0006] In order to solve the obvious limitations of the above-mentioned methods for detecting packet loss in network communication, especially in weak network scenarios, because the link is unstable, packet loss cannot be detected in time, which directly affects the real-time performance and throughput of network transmission, the present application provides a packet loss detection method, device, electronic device and storage medium. The specific technical solution is as follows:

[0007] In a first aspect, the present application provides a packet loss detection method, which is applied to a sending end, and the method includes:

[0008] Receive a NACK message returned by the receiving end, and parse the minimum identifier and bit map of the minimum packet not currently received by the receiving end carried in the NACK message;

[0009] The bitmap is composed of bit values ​​corresponding to each first identifier in a first identifier interval from the minimum identifier to the sum of the minimum identifier and N, the bit values ​​represent the reception status of the packet corresponding to the first identifier, and N is a positive integer;

[0010] The first identifiers in the first identifier interval are traversed, a bit value corresponding to the first identifier is searched from the bit map, and a loss detection is performed on the packet corresponding to the first identifier according to the bit value.

[0011] In an optional implementation, performing loss detection on a packet corresponding to the first identifier according to the bit value includes:

[0012] When the bit value is the first bit value, determining that a packet corresponding to the first identifier is lost;

[0013] When the bit value is the second bit value, it is determined that the packet corresponding to the first identifier is not lost.

[0014] In an optional embodiment, the method further comprises:

[0015] Parsing the first maximum identifier of the maximum packet that the receiving end has not currently received and the second maximum identifier of the maximum packet that the receiving end has received carried in the NACK message;

[0016] It is determined that packets corresponding to each second identifier in a second identifier interval formed by the first maximum identifier and the second maximum identifier are not lost.

[0017] In an optional implementation manner, the receiving end generates the bit map specifically in the following manner:

[0018] Determine a reception status of a packet corresponding to each first identifier in the first identifier interval;

[0019] Traversing the first identifiers in the first identifier interval, and searching for a receiving status of a packet corresponding to the first identifier;

[0020] According to the reception status of the group corresponding to the first identifier, the bit value corresponding to the first identifier in the bit map is set.

[0021] In an optional implementation, the determining the reception status of the packets corresponding to the first identifiers in the first identifier interval includes:

[0022] Determine an identifier difference between the second maximum identifier and the first maximum identifier, and determine whether the identifier difference is greater than or equal to a preset difference threshold;

[0023] When the identification difference is greater than or equal to the preset difference threshold, the following processing is performed:

[0024] Setting the receiving state of the unreceived packet corresponding to the first identifier of the first identifier interval to unreceived;

[0025] The receiving state of the received packet corresponding to the first identifier in the first identifier interval is set to received.

[0026] In an optional implementation, setting the bit value corresponding to the first identifier in the bitmap according to the reception state of the packet corresponding to the first identifier includes:

[0027] When the receiving state is not received, setting the bit value corresponding to the first identifier in the bit map to a first bit value;

[0028] When the receiving state is received, the bit value corresponding to the first identifier in the bit map is set to a second bit value.

[0029] In an optional embodiment, the method further comprises:

[0030] When the identifier difference is less than the preset difference threshold, the first identifiers in the first identifier interval are traversed in reverse order to determine the reception status of the packet corresponding to the first identifier.

[0031] In an optional implementation, determining the reception status of the packet corresponding to the first identifier includes:

[0032] In the case where the first identifier is a first maximum identifier, setting the loss factor to the identifier difference, and determining whether the loss factor is greater than or equal to a preset threshold;

[0033] When the loss factor is greater than or equal to a preset threshold, setting the receiving state of the packet corresponding to the first identifier to not received;

[0034] In a case where the packet corresponding to the first identifier is a received packet, setting the receiving state of the received packet corresponding to the first identifier to received, and setting the loss factor to be automatically incremented by one;

[0035] In a case where the packet corresponding to the first identifier is a non-received packet, determining whether the loss factor is greater than or equal to a preset threshold;

[0036] When the loss factor is greater than or equal to a preset threshold, the receiving state of the packet corresponding to the first identifier is set to not received.

[0037] In a second aspect, the present application provides a packet loss detection device, applied to a sending end, the device comprising:

[0038] A message receiving module, used for receiving a NACK message returned by a receiving end;

[0039] A message parsing module, used for parsing the minimum identifier and bit map of the minimum packet not currently received by the receiving end carried in the NACK message;

[0040] The bitmap is composed of bit values ​​corresponding to each first identifier in a first identifier interval from the minimum identifier to the sum of the minimum identifier and N, the bit values ​​represent the reception status of the packet corresponding to the first identifier, and N is a positive integer;

[0041] A value search module, used for traversing the first identifier of the first identifier interval, and searching the bit value corresponding to the first identifier from the bit map;

[0042] A loss detection module is used to perform loss detection on the packet corresponding to the first identifier according to the bit value.

[0043] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0044] Memory, used to store computer programs;

[0045] The processor is used to implement any packet loss detection method described in the first aspect when executing the program stored in the memory.

[0046] In a fourth aspect, a storage medium is also provided, wherein instructions are stored in the storage medium, and when the storage medium is run on a computer, the computer executes any packet loss detection method described in the first aspect.

[0047] In a fifth aspect, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute any of the above-mentioned packet loss detection methods.

[0048] The above-mentioned technical scheme provided by the embodiment of the present application has the following advantages compared with the prior art: the method provided by the embodiment of the present application receives the NACK message returned by the receiving end, and parses the minimum identifier and the bit map carried in the NACK message indicating that the receiving end has not currently received the minimum packet, the bit map is composed of the bit values ​​corresponding to each first identifier in the first identifier interval formed by the minimum identifier to the sum of the minimum identifier and N, the bit value represents the receiving status of the packet corresponding to the first identifier, N is a positive integer, the first identifier in the first identifier interval is traversed, the bit value corresponding to the first identifier is found from the bit map, and the packet corresponding to the first identifier is detected for loss according to the bit value.

[0049] By parsing the minimum identifier and bit map carried in the NACK message indicating that the receiving end has not currently received the minimum packet, traversing the minimum identifier to the first identifier of the first identifier interval formed by the sum of the minimum identifier and N, finding the bit value corresponding to the first identifier from the bit map, and performing loss detection on the packet corresponding to the first identifier according to the bit value, the minimum identifier and bit map indicating that the receiving end has not currently received the minimum packet are carried in the NACK message, and according to the bit map composed of the bit values ​​corresponding to the various first identifiers in the first identifier interval formed by the sum of the minimum identifier to the minimum identifier and N, the loss of multiple packets can be detected quickly and accurately at the same time, thereby making packet retransmission more timely and avoiding affecting the real-time performance and throughput of network transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0052] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0053] Figure 1 A schematic diagram of an implementation flow of a packet loss detection method provided in an embodiment of the present application;

[0054] Figure 2 A schematic diagram of an implementation flow of another packet loss detection method provided in an embodiment of the present application;

[0055] Figure 3 A schematic diagram of interaction between a transmitting end and a receiving end provided in an embodiment of the present application;

[0056] Figure 4 A schematic diagram of an implementation flow of a method for generating a bitmap provided in an embodiment of the present application;

[0057] Figure 5 A schematic diagram of the structure of a packet loss detection device provided in an embodiment of the present application;

[0058] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0060] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0061] like Figure 1 As shown, it is a schematic diagram of an implementation flow of a packet loss detection method provided in an embodiment of the present application. The method is applied to a sending end and may specifically include the following steps:

[0062] S101, receiving a NACK message returned by a receiving end, and parsing the minimum identifier and bit map of the minimum packet not currently received by the receiving end carried in the NACK message.

[0063] In the embodiment of the present application, the receiving end may return a NACK message to the sending end, and the NACK message carries the following information: the minimum identifier and bitmap of the minimum packet that the receiving end has not currently received. For example, the minimum sequence number of the minimum packet that the receiving end has not currently received is set to r_con_min_nack_seq.

[0064] Therefore, the sending end can receive the NACK message returned by the receiving end, and parse the minimum identifier and bitmap of the receiving end that are not currently receiving the minimum packet carried in the NACK message. The bitmap is composed of the bit values ​​corresponding to each first identifier in the first identifier interval from the minimum identifier of the minimum packet not received to the sum of the minimum identifier and N, and the bit value represents the reception status of the packet corresponding to the first identifier.

[0065] For example, the minimum sequence number r_con_min_nack_seq of the minimum packet that has not been received is 1, N is 4, r_con_min_nack_seq to r_con_min_nack_seq+N, that is, the first sequence number interval consisting of 1 to 5, then the bit map is composed of the bit values ​​corresponding to each first sequence number in the first sequence number interval consisting of 1 to 5, and the bit value represents the reception status of the packet corresponding to the first sequence number.

[0066] S102, traverse the first identifier in the first identifier interval formed by the sum of the minimum identifier and N, search for the bit value corresponding to the first identifier from the bit map, and perform loss detection on the packet corresponding to the first identifier according to the bit value.

[0067] In an embodiment of the present application, for the first identifier interval consisting of the minimum identifier of the minimum packet that has not been received to the sum of the minimum identifier and N, the first identifier of the first identifier interval can be traversed, and the bit value corresponding to the first identifier can be found from the bit map, and the packet corresponding to the first identifier can be detected for loss based on the bit value.

[0068] For example, the minimum sequence number of the minimum packet that has not been received is r_con_min_nack_seq, and the first identifier of the first identifier interval composed of r_con_min_nack_seq to r_max_nack_seq+N is traversed, and the bit value corresponding to the first identifier is found from the bit map. According to the bit value, loss detection is performed on the packet corresponding to the first identifier.

[0069] Through the above description of the technical solution provided in the embodiment of the present application, a NACK message returned by the receiving end is received, and the minimum identifier and the bit map carried in the NACK message indicating that the receiving end has not currently received the minimum packet are parsed. The bit map is composed of the bit values ​​corresponding to each first identifier in the first identifier interval formed by the minimum identifier to the sum of the minimum identifier and N. The bit value represents the reception status of the packet corresponding to the first identifier. The first identifier in the first identifier interval is traversed, and the bit value corresponding to the first identifier is found from the bit map. According to the bit value, loss detection is performed on the packet corresponding to the first identifier.

[0070] By parsing the minimum identifier and bit map carried in the NACK message indicating that the receiving end has not currently received the minimum packet, traversing the minimum identifier to the first identifier of the first identifier interval formed by the sum of the minimum identifier and N, finding the bit value corresponding to the first identifier from the bit map, and performing loss detection on the packet corresponding to the first identifier according to the bit value, the minimum identifier and bit map indicating that the receiving end has not currently received the minimum packet are carried in the NACK message, and according to the bit map composed of the bit values ​​corresponding to the various first identifiers in the first identifier interval formed by the sum of the minimum identifier to the minimum identifier and N, the loss of multiple packets can be detected quickly and accurately at the same time, thereby making packet retransmission more timely and avoiding affecting the real-time performance and throughput of network transmission.

[0071] like Figure 2 As shown, it is a schematic diagram of an implementation flow of another packet loss detection method provided in an embodiment of the present application. The method is applied to a sending end and may specifically include the following steps:

[0072] S201, receiving a NACK message returned by a receiving end, and parsing the first maximum identifier of the receiving end not currently receiving the maximum packet, the minimum identifier of the receiving end not currently receiving the minimum packet, the second maximum identifier of the receiving end receiving the maximum packet, and a bit map carried in the NACK message.

[0073] In the embodiment of the present application, the receiving end may return a NACK message to the sending end, and the NACK message carries the following information: the first maximum identifier of the maximum packet that the receiving end has not received, the minimum identifier of the minimum packet that the receiving end has not received, the second maximum identifier of the maximum packet that the receiving end has received, and a bitmap. For example, the first maximum sequence number of the maximum packet that has not been received is set to r_max_nack_seq, the minimum sequence number of the minimum packet that has not been received is set to r_con_min_nack_seq, and the second maximum sequence number of the maximum packet that has been received is set to r_max_ack_seq.

[0074] Therefore, for the sending end, the NACK message returned by the receiving end is received, and the first maximum identifier of the receiving end not currently receiving the maximum packet, the minimum identifier of the minimum packet not received, the second maximum identifier of the maximum packet received, and the bit map carried in the NACK message are parsed. Among them, the bit map is composed of the bit values ​​corresponding to each first identifier in the first identifier interval composed of the minimum identifier of the minimum packet not received to the sum of the minimum identifier and N, and the bit value represents the reception status of the packet corresponding to the first identifier.

[0075] For example, Figure 3 As shown in the figure, the sender sends packets with sequence numbers 0, 1, 2, 3, 4, 5, 6, and 7, while the receiver only receives packets with sequence numbers 0, 4, 6, and 7. At this time, the r_max_nack_seq carried in the NACK message is sequence number 5, r_con_min_nack_seq is sequence number 1, r_max_nack_seq is sequence number 7, N is 4, and r_con_min_nack_seq is r_con_min_nack_seq+N, that is, The first sequence number interval consists of sequence number 1 and sequence number 5, then the bit map is composed of the bit values ​​corresponding to sequence number 1, sequence number 2, sequence number 3, sequence number 4, sequence number 5, etc. in the first sequence number interval consisting of sequence number 1 and sequence number 5, wherein the bit values ​​corresponding to sequence number 1, sequence number 2, sequence number 3, sequence number 5 are all 1, and the bit value corresponding to sequence number 4 is 0, that is, the bit map is "11101", and the bit value represents the receiving status of the packet corresponding to the corresponding sequence number, 1 represents the receiving status is not received, and 0 represents the receiving status is received.

[0076] S202, traverse the first identifier in the first identifier interval formed by the sum of the minimum identifier and N, and search for a bit value corresponding to the first identifier in a bit map.

[0077] S203: When the bit value is the first bit value, determine that a packet corresponding to the first identifier is lost.

[0078] S204: When the bit value is the second bit value, determine that the packet corresponding to the first identifier is not lost.

[0079] In an embodiment of the present application, for the first identifier interval consisting of the minimum identifier of the minimum packet that has not been received to the sum of the minimum identifier and N, the first identifier of the first identifier interval can be traversed, and the bit value corresponding to the first identifier can be found from the bit map. When the bit value is the first bit value, it is determined that the packet corresponding to the first identifier is lost and needs to be quickly retransmitted. When the bit value is the second bit value, it is determined that the packet corresponding to the first identifier is not lost, indicating that the packet has been received by the receiving end.

[0080] For example, r_con_min_nack_seq is sequence number 1, N is 4, r_con_min_nack_seq to r_con_min_nack_seq+N, that is, the first sequence number interval composed of sequence number 1 and sequence number 5, traverse sequence number 1 of the first sequence number interval, find the bit value 1 corresponding to sequence number 1 from the bit map, the bit value is 1, then it is determined that the packet corresponding to sequence number 1 is lost, similarly, it is determined that the packets corresponding to sequence number 2, sequence number 3, and sequence number 5 are lost, and the bit value corresponding to sequence number 4 is 0, then it is determined that the packet corresponding to sequence number 4 is not lost, and the packets with sequence numbers 1, 2, 3, and 5 are retransmitted, such as Figure 3 shown.

[0081] S205: Determine that packets corresponding to the second identifiers in the second identifier interval formed by the first maximum identifier and the second maximum identifier are not lost.

[0082] In an embodiment of the present application, for the first maximum identifier of the maximum packet that has not been received and the second maximum identifier of the maximum packet that has been received, it can be determined that the packets corresponding to the respective second identifiers in the second identifier interval formed by the first maximum identifier and the second maximum identifier have not been lost, which means that the packets corresponding to the respective second identifiers in the second identifier interval formed by the first maximum identifier and the second maximum identifier have been received by the receiving end.

[0083] For example, the first maximum identifier r_max_nack_seq of the maximum packet that has not been received is sequence number 5, and the second maximum identifier r_max_nack_seq of the maximum packet that has been received is sequence number 7. At this time, it can be determined that the packets corresponding to r_max_nack_seq and sequence numbers 6 and 7 in the second sequence number interval formed by r_max_nack_seq are not lost, and the packets corresponding to sequence numbers 6 and 7 have been received by the receiving end.

[0084] In addition, in the embodiments of the present application, Figure 4 As shown, it is a schematic diagram of an implementation process of a bitmap generation method provided in an embodiment of the present application. The method is applied to a receiving end and may specifically include the following steps:

[0085] S401: Determine a receiving state of a packet corresponding to each first identifier in a first identifier interval.

[0086] In the embodiment of the present application, for a first identification interval consisting of the minimum identification of the minimum packet that has not been received to the sum of the minimum identification and N, the reception status of the packets corresponding to each first identification in the first identification interval can be determined.

[0087] For example, the minimum sequence number r_con_min_nack_seq of the minimum packet that has not been received is sequence number 1, N is 4, r_con_min_nack_seq to r_con_min_nack_seq+N, that is, the first sequence number interval composed of sequence number 1 and sequence number 5. Then for the first sequence number interval composed of sequence number 1 and sequence number 5, it is necessary to determine the reception status of the packets corresponding to sequence number 1, sequence number 2, sequence number 3, sequence number 4, sequence number 5, etc.

[0088] Among them, for the second maximum identifier of the received maximum packet and the first maximum identifier of the not received maximum packet, the identifier difference between the second maximum identifier and the first maximum identifier can be determined. When the identifier difference is greater than or equal to the preset difference threshold, the following processing is performed: the receiving state of the not received packet corresponding to the first identifier of the first identifier interval is set to not received; the receiving state of the received packet corresponding to the first identifier of the first identifier interval is set to received.

[0089] For example, for the receiving end, packets with sequence numbers 1, 2, 6, 7, and 8 are received, then the second maximum sequence number r_max_ack_seq of the received maximum packet is sequence number 8, and the first maximum sequence number r_max_nack_seq of the unreceived maximum packet is sequence number 5. The sequence number difference between r_max_ack_seq and r_max_nack_seq is determined, that is, max_con_ack_diff = r_max_ack_seq–r_max_nack_seq, max_con_ack_diff, the sequence number difference is 3. When max_con_ack_diff is equal to 3, the following processing is performed: for the respective unreceived packets with sequence numbers 3, 4, 5, etc. in the first sequence number interval (3 to 5), the receiving status is set to not received.

[0090] It should be noted that for the packets that were not received, it is possible that the receiving end really did not receive them, or it is possible that the packets arrived at the receiving end late due to network delays and other reasons, resulting in them not being received. Therefore, it is judged here whether the identifier difference between the second maximum identifier and the first maximum identifier is greater than or equal to the preset difference threshold. According to the judgment result, the reception status of the packets corresponding to each first identifier in the first identifier interval from the minimum identifier of the minimum packet that was not received to the sum of the minimum identifier and N is quickly determined, so as to avoid affecting subsequent packet transmissions.

[0091] In addition, for the identifier difference between the second maximum identifier of the received maximum packet and the first maximum identifier of the not received maximum packet, when the identifier difference is less than the preset difference threshold, the first identifier of the first identifier interval formed by the sum of the minimum identifier and N is traversed in reverse order to determine the reception status of the packet corresponding to the first identifier.

[0092] Specifically, the first identifier of the first identifier interval formed by the sum of the minimum identifier and N is traversed in reverse order, and when the first identifier is the first maximum identifier, the loss factor is set to the identifier difference, and it is determined whether the loss factor is greater than or equal to a preset threshold; when the loss factor is greater than or equal to the preset threshold, the receiving state of the packet corresponding to the first identifier is set to not received; when the packet corresponding to the first identifier is a received packet, the receiving state of the received packet corresponding to the first identifier is set to received, and the loss factor is set to be incremented by one; when the packet corresponding to the first identifier is a non-received packet, it is determined whether the loss factor is greater than or equal to the preset threshold; when the loss factor is greater than or equal to the preset threshold, the receiving state of the packet corresponding to the first identifier is set to not received.

[0093] For example, the minimum sequence number r_con_min_nack_seq of the minimum packet not received is sequence number 1, the first maximum sequence number r_max_nack_seq of the maximum packet not received is sequence number 5, N is 4, r_con_min_nack_seq to r_con_min_nack_seq+N, that is, the first sequence number interval composed of sequence number 1 and sequence number 5, traverse the first sequence number 5 of the first sequence number interval composed of sequence number 1 and sequence number 5 in reverse order, the first sequence number 5 is r_max_nack_seq, at this time faskack_count=max_con_ack_diff, faskack is set to faskack_count, that is, the loss factor faskack is set to the sequence number difference max_con_ack_diff, at this time, judge whether the loss factor is greater than or equal to 2; when the loss factor is greater than or equal to 2, the receiving status of the packet corresponding to the first sequence number 5 is set to not received.

[0094] Then traverse the first sequence number 4 in the first sequence number interval formed by sequence number 1 and sequence number 5. The packet corresponding to the first sequence number 4 is the received packet. At this time, the receiving state of the packet corresponding to the first sequence number 4 is set to received, faskack_count=faskack_count+1, and faskack is set to faskack_count, that is, the loss factor faskack is set to self-increment.

[0095] Then, the first sequence number 3 in the first sequence number interval formed by sequence number 1 and sequence number 5 is traversed. The packet corresponding to the first sequence number 3 is a packet that has not been received. At this time, it is determined whether the loss factor is greater than or equal to 2. When the loss factor is greater than or equal to 2, the receiving status of the packet corresponding to the first sequence number 3 is set to not received.

[0096] S402, traverse the first identifier in the first identifier interval to find the receiving status of the packet corresponding to the first identifier.

[0097] S403: Set a bit value corresponding to the first identifier in the bitmap according to a reception state of the packet corresponding to the first identifier.

[0098] In an embodiment of the present application, for a first identifier interval consisting of the minimum identifier of a minimum packet that has not been received to the sum of the minimum identifier and N, the first identifier of the first identifier interval is traversed, the reception status of the packet corresponding to the first identifier is found, and according to the reception status of the packet corresponding to the first identifier, the bit value corresponding to the first identifier in the bit map is set.

[0099] Among them, when the receiving state of the packet corresponding to the first identifier is not received, the bit value corresponding to the first identifier in the bit map is set to the first bit value; when the receiving state of the packet corresponding to the first identifier is received, the bit value corresponding to the first identifier in the bit map is set to the second bit value, so that the following can be obtained: Figure 3 The bit diagram shown is "11101".

[0100] In this way, the receiving end can generate a bit map, and then carry the first maximum identifier of the maximum packet that the receiving end has not currently received, the minimum identifier of the minimum packet that has not been received, the second maximum identifier of the maximum packet that has been received, and the bit map in the NACK message. Subsequently, the sending end receives the NACK message returned by the receiving end, and parses the first maximum identifier of the maximum packet that the receiving end has not currently received, the minimum identifier of the minimum packet that has not been received, the second maximum identifier of the maximum packet that has been received, and the bit map carried in the NACK message. According to the bit map composed of the bit values ​​corresponding to each first identifier in the first identifier interval composed of the minimum identifier to the sum of the minimum identifier and N, the loss of multiple packets can be detected quickly and accurately at the same time, thereby making packet retransmission more timely and avoiding affecting the real-time performance and throughput of network transmission. It can be determined that the packets corresponding to each second identifier in the second identifier interval composed of the first maximum identifier and the second maximum identifier are not lost.

[0101] Corresponding to the above method embodiment, the present application embodiment also provides a packet loss detection device, such as Figure 5 As shown, applied to the sending end, the device may include: a message receiving module 510, a message parsing module 520, a value search module 530, and a loss detection module 540.

[0102] The message receiving module 510 is used to receive the NACK message returned by the receiving end;

[0103] The message parsing module 520 is used to parse the minimum identifier and bit map of the minimum packet that the receiving end has not currently received carried in the NACK message;

[0104] The bitmap is composed of bit values ​​corresponding to each first identifier in a first identifier interval from the minimum identifier to the sum of the minimum identifier and N, the bit values ​​represent the reception status of the packet corresponding to the first identifier, and N is a positive integer;

[0105] A value search module 530, configured to traverse the first identifiers in the first identifier interval and search for a bit value corresponding to the first identifier from the bit map;

[0106] The loss detection module 540 is used to perform loss detection on the packet corresponding to the first identifier according to the bit value.

[0107] The present application also provides an electronic device, such as Figure 6 As shown, it includes a processor 61, a communication interface 62, a memory 63 and a communication bus 64, wherein the processor 61, the communication interface 62, and the memory 63 communicate with each other through the communication bus 64.

[0108] Memory 63, used for storing computer programs;

[0109] The processor 61 is used to execute the program stored in the memory 63 to implement the following steps:

[0110] Receive a NACK message returned by the receiving end, and parse the first maximum identifier of the receiving end that has not currently received the maximum packet, the minimum identifier of the receiving end that has not received the minimum packet, and a bit map carried in the NACK message; the bit map is composed of bit values ​​corresponding to each first identifier in a first identifier interval formed by the minimum identifier to the sum of the minimum identifier and N, the bit value represents the receiving status of the packet corresponding to the first identifier, and N is a positive integer; traverse the first identifier in the first identifier interval, search for the bit value corresponding to the first identifier from the bit map, and perform loss detection on the packet corresponding to the first identifier according to the bit value.

[0111] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0112] The communication interface is used for communication between the above electronic device and other devices.

[0113] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0114] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0115] In another embodiment provided in the present application, a storage medium is further provided. The storage medium stores instructions. When the storage medium is executed on a computer, the computer executes the packet loss detection method described in any one of the above embodiments.

[0116] In another embodiment provided by the present application, a computer program product including instructions is also provided. When the computer program product is executed on a computer, the computer executes the packet loss detection method described in any one of the above embodiments.

[0117] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a storage medium, or transmitted from one storage medium to another storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0118] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0119] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0120] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. A packet loss detection method, characterized in that: Applied to the sending end, the method includes: Receive a NACK message returned by the receiving end, and parse the minimum identifier and bit map of the minimum packet not currently received by the receiving end carried in the NACK message; The bitmap is composed of bit values ​​corresponding to each first identifier in a first identifier interval from the minimum identifier to the sum of the minimum identifier and N, the bit values ​​represent the reception status of the packet corresponding to the first identifier, and N is a positive integer; The first identifiers in the first identifier interval are traversed, a bit value corresponding to the first identifier is searched from the bit map, and a loss detection is performed on the packet corresponding to the first identifier according to the bit value.

2. The method according to claim 1, characterized in that The performing loss detection on the packet corresponding to the first identifier according to the bit value includes: When the bit value is the first bit value, determining that a packet corresponding to the first identifier is lost; When the bit value is the second bit value, it is determined that the packet corresponding to the first identifier is not lost.

3. The method according to claim 1, characterized in that The method further comprises: Parsing the first maximum identifier of the maximum packet that the receiving end has not currently received and the second maximum identifier of the maximum packet that the receiving end has received carried in the NACK message; It is determined that packets corresponding to each second identifier in a second identifier interval formed by the first maximum identifier and the second maximum identifier are not lost.

4. The method according to claim 3, characterized in that: The receiving end generates the bitmap specifically in the following manner: Determine a reception status of a packet corresponding to each first identifier in the first identifier interval; Traversing the first identifiers in the first identifier interval, and searching for a receiving status of a packet corresponding to the first identifier; According to the reception status of the group corresponding to the first identifier, the bit value corresponding to the first identifier in the bit map is set.

5. The method according to claim 4, characterized in that The determining the reception status of the packets corresponding to the first identifiers in the first identifier interval includes: Determine an identifier difference between the second maximum identifier and the first maximum identifier, and determine whether the identifier difference is greater than or equal to a preset difference threshold; When the identification difference is greater than or equal to the preset difference threshold, the following processing is performed: Setting the receiving state of the unreceived packet corresponding to the first identifier of the first identifier interval to unreceived; The receiving state of the received packet corresponding to the first identifier in the first identifier interval is set to received.

6. The method according to claim 4, characterized in that The step of setting the bit value corresponding to the first identifier in the bitmap according to the reception state of the packet corresponding to the first identifier includes: When the receiving state is not received, setting the bit value corresponding to the first identifier in the bit map to a first bit value; When the receiving state is received, the bit value corresponding to the first identifier in the bit map is set to a second bit value.

7. The method according to claim 5, characterized in that The method further comprises: When the identifier difference is less than the preset difference threshold, the first identifiers in the first identifier interval are traversed in reverse order to determine the reception status of the packet corresponding to the first identifier.

8. The method according to claim 7, characterized in that The determining a reception status of a packet corresponding to the first identifier includes: In the case where the first identifier is a first maximum identifier, setting the loss factor to the identifier difference, and determining whether the loss factor is greater than or equal to a preset threshold; When the loss factor is greater than or equal to a preset threshold, setting the receiving state of the packet corresponding to the first identifier to not received; In a case where the packet corresponding to the first identifier is a received packet, setting the receiving state of the received packet corresponding to the first identifier to received, and setting the loss factor to be automatically incremented by one; In a case where the packet corresponding to the first identifier is a non-received packet, determining whether the loss factor is greater than or equal to a preset threshold; When the loss factor is greater than or equal to a preset threshold, the receiving state of the packet corresponding to the first identifier is set to not received.

9. A packet loss detection device, characterized in that: Applied to a transmitting end, the device comprises: A message receiving module, used for receiving a NACK message returned by a receiving end; A message parsing module, used for parsing the minimum identifier and bit map of the minimum packet not currently received by the receiving end carried in the NACK message; The bitmap is composed of bit values ​​corresponding to each first identifier in a first identifier interval from the minimum identifier to the sum of the minimum identifier and N, the bit values ​​represent the reception status of the packet corresponding to the first identifier, and N is a positive integer; A value search module, used for traversing the first identifier of the first identifier interval, and searching the bit value corresponding to the first identifier from the bit map; A loss detection module is used to perform loss detection on the packet corresponding to the first identifier according to the bit value.

10. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-8 when executing a program stored in a memory.

11. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.