A network packet loss detection method, electronic device and computer readable storage medium

By allocating the unique serial number for the data packet in the PTN network and conducting segmented statistical analysis, the problem of difficulty positioning the network packet loss in the existing technology has been solved, and the rapid and accurate fault positioning and investigation have been achieved, which improves the stability and network stability and network stability and improvement User experience.

CN114598628BActive Publication Date: 2025-01-28ZTE CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011409323.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-04
Publication Date
2025-01-28
Estimated Expiration
2040-12-04

AI Technical Summary

Technical Problem

The prior art is difficult to quickly and accurately locate packet loss failures in end-to-end tunnels in PTN networks, making it difficult to accurately and quickly troubleshoot network failures, affecting the normal operation of services and user experience.

Method used

By allocating the unique serial number for each packet packet, and conducting segmented statistics and analysis on the receiving end, the packet loss point and time period are determined, and the faulty device is determined by using the serial number jump analysis.

Benefits of technology

A fast positioning of network failure points, accurate identification of packet loss time and equipment, improving the efficiency and accuracy of network failure investigation, and ensuring normal business operation and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114598628B_ABST
    Figure CN114598628B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a method for detecting network packet loss, including: assigning a unique sequence number to each packet data packet and then sending it; receiving the packet data packet and parsing its corresponding sequence number and packet information; analyzing the packet data packet according to the parsed sequence number; and displaying the analysis result. The embodiment of the present invention also provides an electronic device, which can quickly know the fault point by performing segmented statistical analysis on the sequence number of the packet data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communications, and in particular to a network packet loss detection method, an electronic device and a computer-readable storage medium. Background Art

[0002] In a PTN (Packet Transport Network), if packet loss occurs during the transmission of data in an end-to-end tunnel, the services carried on the tunnel will be affected. Once packet loss occurs, it is difficult to determine whether the problem lies with the "sending device", "receiving device" or "intermediate routing device" in a short period of time.

[0003] The popular solutions on the market can determine whether packet loss occurs in the tunnel by counting the packets sent and received at both ends of the communication tunnel. However, the existing solutions cannot locate the network element that causes the fault or the time period of packet loss, making it difficult to accurately and quickly troubleshoot and solve network faults, affecting the normal operation of the business and the good user experience. Summary of the invention

[0004] In order to solve the defects of the prior art, the purpose of the present invention is to provide a network packet loss detection method, an electronic device and a computer-readable storage medium, which can quickly find the fault point.

[0005] To achieve the above object, the network packet loss detection method provided by the embodiment of the present invention includes:

[0006] Assign a unique sequence number to each packet before sending it;

[0007] Receive packet data and parse out its corresponding sequence number and packet information;

[0008] Analyze the packet data according to the parsed sequence number;

[0009] The analysis results will be displayed.

[0010] To achieve the above-mentioned purpose, an embodiment of the present invention further provides a network packet loss detection system, comprising: a sequence number generator, a transmitter, a receiver, a statistician, an analyzer and a display device thereof;

[0011] The sequence number generator assigns a unique sequence number to each packet sent;

[0012] The sender obtains a new sequence number from the sequence number generator and writes the sequence number into the current data packet, which is then sent out along with the data packet.

[0013] The receiver receives the data packet and parses the sequence number in the data packet;

[0014] A counter divides the sequence numbers maintained by the sequence number generator into sequence number segments of equal length and counts the information of the received data packets in segments;

[0015] The analyzer detects and analyzes whether there are any data packet anomalies in each sequence number segment and time period, and caches the analysis results in the segment analysis table for display by the display device;

[0016] The display device displays the data collected by the counter and the data analyzed by the analyzer.

[0017] To achieve the above object, an embodiment of the present invention further provides an electronic device, including a processor; and

[0018] A memory arranged to store computer executable instructions, which, when executed, cause a processor to perform the steps of the above-mentioned network packet loss detection method.

[0019] To achieve the above-mentioned purpose, an embodiment of the present invention also provides a computer-readable storage medium, which stores one or more programs. When the one or more programs are executed by an electronic device including multiple application programs, the electronic device executes the steps of the above-mentioned network packet loss detection method.

[0020] The network packet loss detection method of the embodiment of the present invention can know the total number of data packets sent by the sending end through the data packet sequence number variable; through segmented statistical analysis, the packet loss point and the specific packet loss time period can be quickly known; through segmented statistical analysis, the number of data packets received in a certain sequence number segment, the number of data packets lost, the packet loss ratio and the packet loss frequency can be known; through segmented statistical analysis, the number of data packets received in a certain time period, the number of data packets lost, the packet loss ratio and the packet loss frequency can be known; through segmented statistical analysis, the overall packet sending rate of the system and the packet sending rate in a certain time period can be known; through segmented statistical analysis, it can be known whether there is a packet retransmission phenomenon in a certain sequence number segment and a certain time period; through segmented statistical analysis, it can be known whether there is a packet disorder phenomenon in a certain sequence number segment and a certain time period; through analysis of sequence number jumps, it can be known whether a major fault such as restart has occurred in the sending end device, the receiving end device or the intermediate routing device. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 This is a flowchart of a method for detecting packet loss in a network according to an embodiment of the present invention;

[0022] Figure 2 is a sequence number segment table according to an embodiment of the present invention;

[0023] Figure 3 A sequence number segment statistics table according to an embodiment of the present invention;

[0024] Figure 4 A schematic diagram of data packet retransmission detection according to an embodiment of the present invention;

[0025] Figure 5 A schematic diagram of out-of-order detection of data packets according to an embodiment of the present invention;

[0026] Figure 6 A schematic diagram of packet loss detection analysis according to an embodiment of the present invention;

[0027] Figure 7 A schematic diagram of the structure of a network packet loss detection system according to an embodiment of the present invention;

[0028] Figure 8 FIG. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0030] In the embodiment of the present invention, the network packet loss detection method refers to determining whether a certain sequence number segment or time period has experienced packet loss, retransmission, disorder, system restart and other failures by means of sequence number segment statistics, and quickly knowing the fault point.

[0031] Example 1

[0032] Figure 1 The following is a flowchart of the network packet loss detection method according to an embodiment of the present invention. Figure 1 , a network packet loss detection method according to an embodiment of the present invention is described in detail.

[0033] First, in step 101, each packet data packet is assigned a unique sequence number and then sent.

[0034] In the embodiment of the present invention, a unique and sequentially increasing sequence number variable is allocated to each packet data packet sent out; each generated sequence number is 1 plus the previous sequence number to ensure that the sequence numbers are sequentially increasing.

[0035] In the embodiment of the present invention, the value range of the sequence number variable is assignable. For the convenience of description, the following description is made by taking 100 million consecutive sequence numbers from 0 to 99999999 as an example.

[0036] In the embodiment of the present invention, the sequence number is written into the current data packet and sent together with the data packet to the data packet receiving end.

[0037] In the embodiment of the present invention, the sending end initializes the sequence number variable to 0, and before sending each packet data packet, obtains a continuous and sequentially increasing sequence number, fills it into the "packet sequence number" field reserved for the data packet, and then sends the packet data packet.

[0038] In step 102, a packet data packet is received and its corresponding sequence number and packet information are parsed.

[0039] In the embodiment of the present invention, after each data packet is received, packet information such as the sequence number in the data packet and the arrival time of the data packet is parsed.

[0040] In the embodiment of the present invention, when the receiving end device is started, the data of the "sequence number segment statistics table" is initialized, and the "analyzer" initializes the data of the "sequence number segment analysis table".

[0041] In step 103, the packet data is analyzed according to the parsed sequence number.

[0042] In the embodiment of the present invention, the data packet is analyzed according to the parsed sequence number and the arrival time of the data packet.

[0043] In the embodiment of the present invention, the sequence number is cut into small segments of equal length according to a granularity of 1 million, and statistics are performed in segments (the granularity can be allocated, and the size of each granularity is called the segment length). The sequence number distribution is shown in Figure 2 , serial number segment table.

[0044] In the embodiment of the present invention, a segmented statistical method is adopted to analyze whether there is an abnormality in the data packet and what kind of abnormality it is.

[0045] In the embodiment of the present invention, the sequence number segment that the packet falls into is calculated according to the current sequence number, and then the "sequence number buffer table" in the local cache is searched to analyze whether the data packet is retransmitted, and whether the data packet is out of order according to the sequence number size and the existing statistical data in the current segment, and finally the following statistical information in the "sequence number segment statistical table" is updated: the minimum sequence number, maximum sequence number, total sequence number, minimum sequence number arrival time, maximum sequence number arrival time, retransmission mark, out of order mark, etc. received in the current segment. According to the "total sequence number" of the current segment in the statistical information, it is judged whether the current sequence number is the first sequence number received in the segment. If not, the subsequent operations of this step are ignored; if so, further analysis of the statistical data of the previous Nth segment (such as N=2) is triggered, and finally the analysis results are saved in the "sequence number segment analysis table" for display.

[0046] In step 104, the analysis results are displayed.

[0047] In the embodiment of the present invention, the analysis result of the analyzer is presented to the user through the presenter.

[0048] In the embodiment of the present invention, relevant information is obtained from the "serial number segment statistics table" and the "serial number segment analysis table", and the system "current serial number" is obtained at the same time, and then the relevant information is displayed to the user according to the user's needs.

[0049] Example 2

[0050] Figure 2 For a sequence number segment table according to an embodiment of the present invention, reference will be made to Figure 2 , the sequence number segment table of an embodiment of the present invention is described in detail.

[0051] In the embodiment of the present invention, the sequence number is cut into small segments of equal length according to a granularity of 1 million, and statistics are performed in segments (the granularity can be allocated, and the size of each granularity is called a segment length).

[0052] In the embodiment of the present invention, when the sequence number of the parsed data packet falls into a certain segment, the total sequence number counter of the segment is increased by 1, and the minimum sequence number, maximum sequence number, minimum sequence number arrival time, and maximum sequence number arrival time currently received in the segment are corrected.

[0053] Example 3

[0054] Figure 3 The following is a sequence number segment statistics table according to an embodiment of the present invention. Figure 3 , the sequence number segment statistics table of an embodiment of the present invention is described in detail.

[0055] In the embodiment of the present invention, the sequence number is cut into small segments of equal length according to a granularity of 1 million, the initial sequence number segment is segment 0, and the smallest sequence number is 0; that is, segment 0 is 0-999999, and so on, segment 1 is 1000000-1999999.

[0056] In the embodiment of the present invention, the minimum sequence number arrival time and the maximum sequence number arrival time of each number segment are marked as actual values; the retransmission occurring in the segment where the retransmission is located is marked as the actual value; the disorder occurring in the segment where the disorder is located is marked as the actual value.

[0057] In the embodiment of the present invention, for the segments that have not been counted, all data are set to initial values, that is, 0.

[0058] Example 4

[0059] Figure 4 Schematic diagram of packet retransmission detection according to an embodiment of the present invention. Figure 4 , the data packet retransmission detection of the embodiment of the present invention is described in detail.

[0060] First, in step 401, start.

[0061] In the embodiment of the present invention, retransmission detection of the data packet is started.

[0062] In step 402, the sequence number buffer table is searched.

[0063] In the embodiment of the present invention, the sequence number buffer table is queried.

[0064] In step 403, the current sequence number is in the buffer table.

[0065] In the embodiment of the present invention, it is determined whether the current sequence number is in the sequence number buffer table; if the determination result is yes, the process proceeds to step 404; if the determination result is no, the process proceeds to step 406.

[0066] In step 404, it is determined whether the data packet is to be retransmitted.

[0067] In the embodiment of the present invention, when the current sequence number has appeared in the buffer table, it is determined that the current data packet is a retransmission data packet.

[0068] In step 405, the retransmission flag of the current segment in the segment statistics table is updated to true.

[0069] In the embodiment of the present invention, when a data packet is retransmitted, the retransmission flag of the current segment in the sequence number segment statistics table is updated to true.

[0070] In step 406, it is determined that the data packet is not a retransmission.

[0071] In the embodiment of the present invention, when the current sequence number does not appear in the buffer table, that is, the current sequence number appears for the first time, it is determined that the data packet to which the current sequence number belongs is a non-retransmission data packet.

[0072] In step 407, the current sequence number is updated into the sequence number buffer table.

[0073] In the embodiment of the present invention, when the data packet to which the current sequence number belongs is a non-retransmission data packet, the sequence number is updated into the sequence number buffer table.

[0074] At step 408, end.

[0075] In the embodiment of the present invention, when a data packet retransmission occurs, the retransmission flag of the current segment in the segment statistics table is updated to true, and the step ends.

[0076] In the embodiment of the present invention, when the data packet is not a retransmission, the steps are terminated after the current sequence number is updated into the sequence number buffer table.

[0077] Example 5

[0078] Figure 5 Schematic diagram of packet disorder detection according to an embodiment of the present invention. Figure 5 , the data packet disorder detection algorithm of the embodiment of the present invention is described in detail.

[0079] First, in step 501, start.

[0080] In the embodiment of the present invention, it is first detected whether the data packets are out of order.

[0081] In step 502, the segment number where the current sequence number is located is calculated.

[0082] In the embodiment of the present invention, the segment number where the current sequence number is located is calculated.

[0083] In step 503, the maximum sequence number of the data packets received in the current segment in the segment statistics table is obtained.

[0084] In the embodiment of the present invention, the maximum sequence number parsed from the data packets received in the current sequence number segment in the segment statistics table is obtained.

[0085] In step 504, the current sequence number is smaller than the maximum sequence number in the segment.

[0086] In the embodiment of the present invention, it is determined whether the current sequence number is less than the largest sequence number in the sequence number segment in which the current sequence number is located; if the determination result is yes, the process proceeds to step 505; if the determination result is no, the process proceeds to step 507.

[0087] In step 505, it is determined that the data packets are out of order.

[0088] In the embodiment of the present invention, the sequence number assigned to the data packet is increasing, so when the sequence number parsed is smaller than the largest sequence number in the sequence number segment where the current sequence number is located, it indicates that the data packet is an out-of-order data packet.

[0089] In step 506, the out-of-order flag of the current segment in the segment statistics table is updated to true.

[0090] In the embodiment of the present invention, when data packets are out of order, the out of order flag of the current segment in the segment statistics table is updated to true, and the process goes to step 508 and ends.

[0091] In step 507, it is determined that the data packets are not out of order.

[0092] In the embodiment of the present invention, the sequence number assigned to the data packet is increasing, so when the sequence number parsed is greater than the largest sequence number in the sequence number segment where the current sequence number is located, it indicates that the data packet is a non-disordered data packet, and the process proceeds to step 508 and ends.

[0093] At step 508, end.

[0094] In the embodiment of the present invention, the detection of data packet disorder is terminated.

[0095] Example 6

[0096] Figure 6 The following is a schematic diagram of packet loss detection analysis according to an embodiment of the present invention. Figure 6 , the packet loss detection analysis of the embodiment of the present invention is described in detail.

[0097] First, in step 601, start.

[0098] In the embodiment of the present invention, packet loss detection and analysis of data packets is started.

[0099] In step 602, the sequence number jumps.

[0100] In the embodiment of the present invention, it is determined whether the sequence number jumps; if the determination result is no, the process proceeds to step 603; if the determination result is yes, the process proceeds to step 607.

[0101] In step 603, the number of packets received in the current analysis segment is equal to the segment length.

[0102] In the embodiment of the present invention, it is determined whether the number of data packets received by the sequence number segment currently being analyzed is equal to the length of the sequence number segment; that is, it is determined whether a data packet loss phenomenon occurs.

[0103] In the embodiment of the present invention, if the determination result is yes, the process proceeds to step 604 ; if the determination result is no, the process proceeds to step 605 .

[0104] In step 604, it is determined that no packet is lost in the current segment.

[0105] In the embodiment of the present invention, if it is determined that no packet loss occurs in the current analysis segment, the process proceeds to step 612 and ends.

[0106] In step 605, it is determined that the current segment has been lost.

[0107] In the embodiment of the present invention, if it is determined that data packet loss occurs in the current sequence number segment, the process proceeds to step 606 .

[0108] In step 606, it is determined that the intermediate device is abnormal.

[0109] In the embodiment of the present invention, if it is determined that the current data packet is lost, it is determined that the data packet is lost due to an abnormality in an intermediate device. At this time, the process goes to step 612 and ends.

[0110] In step 607, the current packet falls into segment 0.

[0111] In an embodiment of the present invention, if a sequence number jump occurs, step 607 is entered to determine whether the sequence number parsed from the current data packet falls into segment 0, that is, whether it falls into the initial segment; if the determination result is yes, step 608 is entered; if the determination result is no, step 609 is entered.

[0112] In step 608, it is determined whether the sending end is restarted.

[0113] In the embodiment of the present invention, if the sequence number parsed from the current data packet falls into segment 0, it is determined that a reboot occurs at the transmitting end; at this time, the process proceeds to step 612 and ends.

[0114] In step 609, the sequence number segment statistics are initial values.

[0115] In the embodiment of the present invention, if the sequence number parsed from the current data packet does not fall into segment 0, it is further determined whether the data counted in the sequence number segment is an initial value; if the determination result is yes, it proceeds to step 610; if the determination result is no, it proceeds to step 611.

[0116] In step 610, it is determined whether the receiving end is restarted.

[0117] In the embodiment of the present invention, if it is determined that the sequence number segment statistical data is an initial value, it is determined that a restart phenomenon occurs at the data packet receiving end, and the process goes to step 612 and ends.

[0118] In step 611, it is determined that the intermediate device is abnormal.

[0119] In the embodiment of the present invention, if it is determined that the sequence number segment statistical data is a non-initial value, then it is determined that the exception is caused by an intermediate device, and the process goes to step 612.

[0120] At step 612, end.

[0121] In the embodiment of the present invention, the detection and analysis of the packet loss phenomenon is ended.

[0122] Example 7

[0123] Figure 7 The following is a schematic diagram of the network packet loss detection system according to an embodiment of the present invention. Figure 7 , a schematic diagram of the structure of the network packet loss detection system according to an embodiment of the present invention is described in detail.

[0124] The sequence number generator 701 assigns a unique sequence number to each packet data sent out.

[0125] In an embodiment of the present invention, a sequence number generator is placed in a sending device of a data packet, and is mainly used to maintain a unique, continuous, and sequentially increasing sequence number variable in a communication tunnel of the device, and to assign a unique sequence number to each packet data packet sent by the sender; each sequence number generated by the sequence number generator is 1 plus the previous sequence number to ensure that the sequence numbers are sequentially increasing.

[0126] In the embodiment of the present invention, the value range of the sequence number variable is assignable. For the convenience of description, the following description is made by taking 100 million consecutive sequence numbers from 0 to 99999999 as an example.

[0127] In the embodiment of the present invention, when the sending end device starts, the sequence number generator initializes the sequence number variable to 0.

[0128] The transmitter 702 obtains a new sequence number from the sequence number generator, writes the sequence number into the current data packet, and sends the sequence number out together with the data packet.

[0129] In the embodiment of the present invention, before sending each data packet, the transmitter obtains a new sequence number from the sequence number generator, writes the sequence number into the current data packet, and sends it together with the data packet to the data packet receiving end.

[0130] The intermediate device 703 is a relay between the sending end and the receiving end.

[0131] In the embodiment of the present invention, the intermediate device is a routing device, which is used to relay the data packet sent by the sending end to the receiving end.

[0132] The receiver 704 receives the data packet and parses the sequence number in the data packet.

[0133] In the embodiment of the present invention, after receiving each data packet, the receiver is responsible for parsing out the sequence number in the data packet.

[0134] In the embodiment of the present invention, after receiving each packet data, the receiver parses the data packet to obtain the sequence number corresponding to the data packet, obtains the arrival time and other information of the data packet, and transmits the packet information to the statistics device.

[0135] The counter 705 divides the sequence number maintained by the sequence number generator into sequence number segments of equal length, and counts the information of the received data packets in segments.

[0136] In the embodiment of the present invention, the counter is mainly used to count the relevant information of each received data packet in segments, and is also responsible for checking the retransmission and disorder of the data packet. The specific statistical information is as shown in the attached Figure 3 The serial number segment statistics are shown in the table.

[0137] In the embodiment of the present invention, the counting device cuts the sequence numbers maintained by the sequence number generator into small segments of equal length according to a granularity of 1 million, and counts the segments as units (the granularity can be allocated, and the size of each granularity is called the segment length). The sequence number distribution is shown in the attached figure. Figure 2 Sequence number segment table.

[0138] In an embodiment of the present invention, when the receiver receives the sequence number of a data packet, it calculates the sequence number segment into which the data packet falls, then searches the locally cached sequence number buffer table to analyze whether the data packet has been retransmitted, and analyzes whether the data packet has been disordered based on the sequence number size and the existing statistical data in the current segment. The total sequence number counter of the segment is incremented by 1, and the minimum sequence number, maximum sequence number, total sequence number, minimum sequence number arrival time, maximum sequence number arrival time, retransmission mark, disorder mark, etc. currently received in the segment are corrected.

[0139] In the embodiment of the present invention, when the receiving end device is started, the counting device initializes the data of the sequence number segment counting table.

[0140] The analyzer 706 detects and analyzes whether there is any abnormality in the data packet in each sequence number segment and time period, and caches the analysis result in the segment analysis table for display by the display device.

[0141] In the embodiment of the present invention, the analyzer is mainly responsible for detecting and analyzing whether abnormal packet loss occurs in the intermediate device in each sequence number segment or time period, whether the sending end and the receiving end device have experienced major failures such as restart, and caching the analysis results of each segment in the segment analysis table for display to the user.

[0142] In the embodiment of the present invention, during the communication process, data packets may be out of order within a certain range. In order to avoid misjudgment, the present invention considers performing data detection and analysis on the Nth sequence number segment before the current sequence number segment (for example, N is allocated to 2) when the first data packet of a sequence number segment arrives, as shown in "Attachment Figure 3 As shown in the "Sequence Number Segment Statistics Table", if the sequence number of the currently received data packet is 2000002, it can be calculated that it belongs to the second segment. If the packet is the first data packet that actually arrives in segment 2 (out of order), then the statistical data of the second segment (i.e. segment 0) will be triggered to perform packet loss analysis.

[0143] In the embodiment of the present invention, when the receiving end device is started, the analyzer initializes the sequence number segment analysis table data.

[0144] The display device 707 displays the data collected by the counting device and the data analyzed by the analyzer.

[0145] In the embodiment of the present invention, the presenter obtains relevant information from the sequence number segment statistics table and the sequence number segment analysis table, and can also obtain the current sequence number of the system from the sequence number generator, and then displays the relevant information to the user according to the user's sequence number.

[0146] In the embodiment of the present invention, the main function of the display device is to display the data counted by the counter and the data analyzed by the analyzer according to the user's requirements, so as to intuitively reflect whether packet loss occurs during the communication process, the sequence number segment of packet loss, the time period of packet loss, the number of packet loss, the ratio and frequency of packet loss; the number of packets sent during the communication process, the overall packet sending rate, and the packet sending rate in each time period; whether data packet retransmission occurs during the communication process, and in which number segments or time periods the retransmission occurs; whether data packet disorder occurs during the communication process, and in which number segments or time periods the disorder occurs; which device restarts or anomalies occur during the communication process, etc.

[0147] Example 8

[0148] Figure 8 FIG. 1 is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Figure 8 As shown, at the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage, etc. Of course, the electronic device may also include hardware required for other services.

[0149] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0150] The memory is used to store the program. Specifically, the program may include program code, and the program code includes computer operation instructions.

[0151] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a shared resource access control device at the logical level. The processor executes the program stored in the memory and is specifically used to execute the steps of the above-mentioned network packet loss detection method.

[0152] Example 9

[0153] An embodiment of the present invention also proposes a computer-readable storage medium, which stores one or more programs, and the one or more programs include instructions. When the instructions are executed by a portable electronic device including multiple application programs, the portable electronic device can execute the method of the embodiment shown in the accompanying drawings, and is specifically used to execute the steps of the above-mentioned network packet loss detection method.

[0154] Although the embodiments disclosed in the present invention are as above, the contents described are only embodiments adopted to facilitate understanding of the present invention and are not intended to limit the present invention. Any technician in the field to which the present invention belongs can make any modifications and changes in the form and details of implementation without departing from the spirit and scope disclosed in the present invention, but the patent protection scope of the present invention shall still be subject to the scope defined in the attached claims.

Claims

1. A method for detecting network packet loss, characterized in that: The following steps are involved: Assigning a unique, continuous, and sequentially increasing sequence number to each packet, and filling the sequence number into the packet before sending; Receive the packet data and parse out its corresponding sequence number and packet information, wherein the packet information includes the arrival time of the packet; Analyzing the packet data according to the parsed sequence number; Display the analysis results; The step of analyzing the packet data according to the parsed sequence number further includes: Divide the sequence number into sequence number segments of equal length, and count the information of the received data packets in segments; Detect and analyze whether data packet anomalies occur within each sequence number segment and time period, wherein the sequence number segment detected and analyzed is different from the sequence number segment counted.

2. The method according to claim 1, characterized in that The step of analyzing the packet data according to the parsed sequence number also includes: Verify the retransmission and disorder of data packets; segment the sequence number according to the granularity and perform statistics in segments; When the sequence number of the received data packet falls into a certain segment, the segment is corrected.

3. The method according to claim 2, characterized in that The step of verifying the retransmission of the data packet further includes: If the current sequence number already exists in the locally cached sequence number buffer table, the packet is considered a retransmission packet and the retransmission flag of the segment is set to true; If the current sequence number is not in the locally cached sequence number buffer table, the packet is considered to be a new packet, and the current sequence number is updated in the sequence number buffer table.

4. The method according to claim 2, characterized in that The step of checking the disorder of the data packets also includes: If the current sequence number is less than the maximum sequence number in the segment, the data packet is considered out of order, and the out of order flag is set to true; If the current sequence number is greater than the maximum sequence number in the segment, the data packet sequence is considered normal.

5. The method according to claim 2, characterized in that The step of performing statistics in segments also includes determining that the total number of sequence numbers counted on the sequence number segment is equal to the segment length of the sequence number segment, and determining that the sequence number segment has no packet loss; The total number of sequence numbers counted in the sequence number segment is less than the segment length of the sequence number segment, and it is determined that the sequence number segment is lost.

6. The method according to claim 5, characterized in that The method also includes determining that a sequence number jump occurs when a span of segment numbers of two consecutively received data packets is greater than or equal to N; The N is a positive integer greater than or equal to 2.

7. The method according to claim 6, characterized in that The method also includes: after the sequence number jumps, the sequence number of the newly received data packet falls into the initial number segment again, and it is determined that the sending end device is restarted; After the sequence number jumps, the sequence number of the newly received data packet falls into a non-initial number segment, and the statistical data of the sequence number segment to be analyzed is an initial value, and it is determined that the receiving end device is restarted; If the total number of sequence numbers counted on the sequence number segment is greater than 0 and less than the segment length of the sequence number segment, it is determined that the intermediate device is faulty.

8. The method according to claim 2, characterized in that The step of correcting a certain segment when the sequence number of the received data packet falls into the certain segment also includes: The packet information is the arrival time of the data packet; Correct the minimum sequence number, correct the maximum sequence number, correct the arrival time of the minimum sequence number, and correct the arrival time of the maximum sequence number.

9. A system for detecting network packet loss, characterized in that: include: Serial number generator, transmitter, receiver, counter, analyzer and displayer; The sequence number generator assigns a unique, continuous, and sequentially increasing sequence number to each packet data packet sent out, and fills the sequence number into the data packet; The transmitter obtains a new sequence number from the sequence number generator, writes the sequence number into the current data packet, and sends the sequence number out together with the data packet; The receiver receives a data packet and parses a sequence number in the data packet; The counting device divides the sequence number maintained by the sequence number generator into sequence number segments of equal length, and counts the information of the received data packets in segments, wherein the packet information includes the arrival time of the data packets; The analyzer detects and analyzes whether a data packet anomaly occurs in each sequence number segment and time period, and caches the analysis result in a segment analysis table for display by the display device, wherein the sequence number segment detected and analyzed is different from the sequence number segment counted; The display device displays the data counted by the counting device and the data analyzed by the analyzer.

10. An electronic device comprising: processor; as well as A memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor performs the steps of the method for detecting network packet loss according to any one of claims 1 to 8.

11. A computer-readable storage medium storing one or more programs, which, when executed by an electronic device including a plurality of application programs, enable the electronic device to perform the steps of the method for detecting network packet loss according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Data transmission method and device

    CN110138632A