Data packet processing method and device, electronic equipment and storage medium

By acquiring the tunnel feature information and sequence number of the video network data packets, caching them, and sorting them by sequence number, the problem of out-of-order data packets in the video network is solved, and the order of data packets is restored and consistent.

CN118972340APending Publication Date: 2024-11-15VISIONVERA INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411034181.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

In video networks, because network devices cannot extract specific fields from video network data packets, multiple video network data packets from the same data stream are split and processed by different processors, resulting in inconsistent latency and out-of-order data packets. This fails to meet users' requirements for consistent network data packet order.

Method used

By acquiring the tunnel feature information of the data packets, the tunnel is determined and the data packets are cached in the sorting queue. The sequence number of the data packets in the data packet header is extracted and sent to the data packet output queue in ascending order of sequence number to restore the original order of the data packets.

Benefits of technology

It realizes the correction of out-of-order data packets in the visual network, ensures the consistency of data packet order, and meets the user's requirement for the consistency of network data packet order.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118972340A_ABST
    Figure CN118972340A_ABST
Patent Text Reader

Abstract

The invention provides a data packet processing method and device, electronic equipment and a storage medium. The method comprises the following steps: for a data packet output by a multiprocessor, obtaining tunnel feature information corresponding to the data packet, and determining a tunnel corresponding to the data packet; caching the data packet in a sorting queue corresponding to the tunnel; extracting data packet serial numbers in data packet headers of the data packets in the sorting queue; and sequentially sending the data packets in the sorting queue to a data packet output queue according to the sequence of the data packet serial numbers from small to large so as to output the data packets. According to the embodiment of the invention, the purpose of correcting the disorder of the data packets can be achieved, the consistency of the sequence of the data packets is guaranteed, and the demand of a user for the consistency of the sequence of the network data packets is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of out-of-order correction, and in particular to a data packet processing method, device, electronic device and storage medium. Background Art

[0002] In order to give full play to the advantages of multiple processors, multi-processor network devices hash and divert specific fields of standard network packets (such as source IP address, destination IP address, port number, etc.). Network data packets with the same characteristics are processed on the same processor to ensure the order of network data packets with the same characteristics, thereby ensuring the sequential consistency of data packets with the same characteristics while utilizing the performance of multiple processors.

[0003] In the visual network, however, the visual network data packet has a proprietary structure, and network devices cannot extract specific fields (such as source IP address, destination IP address, port number, etc.) that identify a specific data stream from the visual network data packet. In order to fully utilize the performance of multiple processors, multiple visual network data packets of the same data stream are diverted to different processors for processing. The processing delays of different processors cause the order of the visual network data packets of the same characteristic data stream after processing to be inconsistent with the order of the original visual network data packets, resulting in data packet disorder, which cannot meet the user's sequential consistency requirements for network data packets. Summary of the invention

[0004] In view of the above problems, embodiments of the present application are proposed to provide a data packet processing method, device, electronic device and storage medium that overcome the above problems or at least partially solve the above problems.

[0005] In a first aspect, an embodiment of the present application provides a method for processing a data packet, the method comprising:

[0006] For data packets output by the multiprocessor, obtaining tunnel characteristic information corresponding to the data packets, and determining the tunnel corresponding to the data packets;

[0007] Buffering the data packet in a sorting queue corresponding to the tunnel;

[0008] Extracting the data packet sequence number in the data packet header of the data packet in the sorting queue;

[0009] The data packets in the sorting queue are sent to the data packet output queue in sequence from small to large according to the data packet sequence numbers, so as to output the data packets.

[0010] Optionally, the acquiring tunnel characteristic information corresponding to the data packet includes:

[0011] The tunnel characteristic information is extracted from a data packet header of the data packet.

[0012] Optionally, sending the data packets in the sorting queue to the data packet output queue in sequence according to the order of the data packet sequence numbers from small to large, so as to output the data packets, comprises:

[0013] Determine whether there is a first data packet in the sorting queue whose data packet sequence number is smaller than the reference packet sequence number;

[0014] If the first data packet exists in the sorting queue, sending the first data packet to the data packet output queue, and adding 1 to the reference packet sequence number to obtain a new reference packet sequence number;

[0015] Iterate the above steps until there is no cached data packet in the sorting queue;

[0016] The initial value of the reference package number is 1.

[0017] Optionally, after determining whether there is a first data packet with a data packet sequence number smaller than a reference packet sequence number in the sorting queue, the method further includes:

[0018] When it is determined that there is no data packet with a data packet sequence number smaller than the reference packet sequence number in the sorting queue, obtaining a second data packet with the smallest data packet sequence number in the sorting queue;

[0019] Obtaining a cache duration of the second data packet, where the cache duration refers to a duration during which the second data packet is cached in the sorting queue;

[0020] Determine whether the cache duration exceeds a preset duration threshold;

[0021] When it is determined that the buffering time exceeds the time threshold, the second data packet is sent to the data packet output queue.

[0022] Optionally, sending the data packets in the sorting queue to the data packet output queue in sequence according to the order of the data packet sequence numbers from small to large, so as to output the data packets, comprises:

[0023] Determining, according to the tunnel corresponding to the data packet, a data packet output queue corresponding to the data packet;

[0024] The data packets are sent in sequence to the data packet output queues corresponding to the data packets in the sorting queue in ascending order of the data packet sequence numbers, so as to output the data packets.

[0025] In a second aspect, an embodiment of the present application provides a data packet processing device, the device comprising:

[0026] A tunnel determination module, for obtaining tunnel characteristic information corresponding to a data packet output by a multiprocessor, and determining a tunnel corresponding to the data packet;

[0027] A data packet caching module, used for caching the data packet in a sorting queue corresponding to the tunnel;

[0028] A data packet sequence number extraction module, used to extract the data packet sequence number in the data packet header of the data packet in the sorting queue;

[0029] The data packet sending module is used to send the data packets in the sorting queue to the data packet output queue in sequence according to the data packet sequence numbers from small to large, so as to output the data packets.

[0030] Optionally, the tunnel determination module includes:

[0031] The tunnel feature extraction unit is used to extract the tunnel feature information from the data packet header of the data packet.

[0032] Optionally, the data packet sending module includes:

[0033] A first data packet determining unit, configured to determine whether there is a first data packet in the sorting queue whose data packet sequence number is smaller than the reference packet sequence number;

[0034] A first data packet sending unit, configured to send the first data packet to the data packet output queue if the first data packet exists in the sorting queue, and increase the reference packet sequence number by 1 to obtain a new reference packet sequence number;

[0035] an iterative execution unit, configured to iteratively execute the first data packet determining unit and the first data packet sending unit until no cached data packets exist in the sorting queue;

[0036] The initial value of the reference package number is 1.

[0037] Optionally, the device further comprises:

[0038] A second data packet acquisition module, configured to acquire a second data packet with the smallest data packet sequence number in the sorting queue when it is determined that there is no data packet with a data packet sequence number smaller than the reference packet sequence number in the sorting queue;

[0039] A cache duration acquisition module, used to acquire a cache duration of the second data packet, where the cache duration refers to a duration during which the second data packet is cached in the sorting queue;

[0040] A cache duration determination module, used to determine whether the cache duration exceeds a preset duration threshold;

[0041] The second data packet sending module is used to send the second data packet to the data packet output queue when it is determined that the cache time exceeds the time threshold.

[0042] Optionally, the data packet sending module includes:

[0043] an output queue determining unit, configured to determine a data packet output queue corresponding to the data packet according to a tunnel corresponding to the data packet;

[0044] The data packet sending unit is used to send the data packets in sequence to the data packet output queues corresponding to the data packets in the sorting queue in ascending order of the data packet sequence numbers, so as to output the data packets.

[0045] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0046] one or more processors; and

[0047] One or more machine-readable media having instructions stored thereon, when executed by the one or more processors, enable the apparatus to perform any of the above-described data packet processing methods.

[0048] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program that enables a processor to execute any of the above-mentioned data packet processing methods.

[0049] The embodiments of the present application include the following advantages:

[0050] The solution provided in the embodiment of the present application obtains tunnel characteristic information corresponding to the data packet for the data packet output by the multiprocessor, and determines the tunnel corresponding to the data packet. The data packet is cached in the sorting queue corresponding to the tunnel. The data packet sequence number in the data packet header of the data packet is extracted. The data packets are sent to the data packet output queue in order from small to large in order to output the data packets. In the embodiment of the present application, when the forwarded data packets are out of order, the unique field (i.e., the data packet sequence number) in the proprietary structure encapsulated in the visual network is used as the basis for restoring the order of the original data stream, and the order of the data packets is restored to the order when the visual network was encapsulated, so as to achieve the purpose of correcting the disorder of the data packets, ensure the consistency of the order of the data packets, and meet the user's demand for the consistency of the order of the network data packets. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 A flowchart of a method for processing a data packet provided in an embodiment of the present application;

[0052] Figure 2 A flowchart of a method for sending a data packet provided in an embodiment of the present application;

[0053] Figure 3 A flowchart of another method for sending a data packet provided in an embodiment of the present application;

[0054] Figure 4 A flowchart of another method for sending a data packet provided in an embodiment of the present application;

[0055] Figure 5 A schematic diagram of a data packet out-of-order correction architecture provided in an embodiment of the present application;

[0056] Figure 6 A schematic diagram of a data packet out-of-order correction process provided in an embodiment of the present application;

[0057] Figure 7 A schematic diagram of the structure of a data packet processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0059] Reference Figure 1 , shows a flow chart of the steps of a data packet processing method provided by an embodiment of the present application. Figure 1 As shown, the data packet processing method may include: step 101, step 102 and step 103.

[0060] Step 101: For a data packet output by a multiprocessor, obtain tunnel feature information corresponding to the data packet, and determine the tunnel corresponding to the data packet.

[0061] The embodiments of the present application can be applied to a scenario where out-of-order data packets output by multiple processors are corrected in order.

[0062] The embodiment of the present application can be applied to a network device on the output port side, that is, the execution subject is a network device. In this example, the network device can be, but is not limited to, a router, a switch, and other devices. An output port refers to a network output port when a network device such as a router forwards a network data packet.

[0063] For data packets output by multiple processors, the network device can receive the data packets output by the multiple processors and obtain the tunnel characteristic information corresponding to the data packets. And determine the tunnel corresponding to the data packet based on the tunnel characteristic information. Specifically, after obtaining the data packets output by the multiple processors, the tunnel characteristic information can be extracted from the data packet header of the data packet. In this embodiment, the tunnel characteristic information can be a local tunnel number and a remote tunnel number. Among them, the local tunnel number refers to a unique identifier configured on the local network device (such as a router, switch, etc.) for identifying the tunnel connection initiated from the local end (i.e., the input end). The remote tunnel number refers to a unique identifier configured on the remote network device (i.e., the other end of the tunnel connection, i.e., the network device that performs out-of-order correction in this embodiment) for identifying the tunnel connection received from the remote end.

[0064] After extracting the tunnel characteristic information in the data packet header of the data packet, the tunnel corresponding to the data packet can be determined according to the tunnel characteristic information in the data packet header extracted from the data packet. In this embodiment, the tunnel can be a visual network tunnel, which is a secure communication channel established in a network. It realizes intercommunication and secure data transmission between different networks by encapsulating and transmitting communication data.

[0065] Step 102: Cache the data packet in a sorting queue corresponding to the tunnel.

[0066] In the network device, a corresponding sorting queue can be established for different tunnels. The sorting queue is a buffer area with limited depth. Before the data packet is sent to the output port, it is briefly cached in the sorting queue. The purpose is to readjust the order of the previous and next packets and effectively correct the disorder. After the tunnel corresponding to the data packet is determined based on the tunnel feature information in the data packet header of the extracted data packet, the data packet can be cached in the sorting queue corresponding to the tunnel. For example, the visual network tunnels established in the visual network include: tunnel 1, tunnel 2 and tunnel 3. In the network device at the output end, a sorting queue 1 corresponding to tunnel 1 can be established, a sorting queue 2 corresponding to tunnel 2 can be established, and a sorting queue 3 corresponding to tunnel 3 can be established. When the tunnel corresponding to data packet 1 is tunnel 2, data packet 1 is cached in sorting queue 2. When the tunnel corresponding to data packet 2 is tunnel 3, data packet 2 is cached in sorting queue 3, etc.

[0067] It can be understood that the above examples are merely examples listed for a better understanding of the technical solutions of the embodiments of the present application, and are not intended to be the sole limitation to the embodiments.

[0068] The embodiment of the present application adds data packets from different tunnels to corresponding sorting queues for disorder correction, thereby avoiding the problem of data packets from different tunnels being output through the same output port, resulting in data packet distribution errors.

[0069] After the data packet is buffered in the sorting queue corresponding to the tunnel, step 103 is executed.

[0070] Step 103: Extract the data packet sequence number in the data packet header of the data packet in the sorting queue.

[0071] After the acquired data packets output by the multiprocessor are cached in the sorting queue, the data packet sequence numbers in the data packet headers of the data packets in the sorting queue may be extracted.

[0072] In the visual network, the data packet number is packet_NO, which is also the encapsulation sequence number of the data packet. When encapsulating the data packet at the input end, this characteristic field can be added: packet_NO, which records the number of data packets encapsulating the visual network proprietary structure in a cumulative manner.

[0073] In a specific implementation, the data packet sequence number can be an encapsulation order number pre-added to the data packet header of the data packet. In this example, the data packet sequence number can be added to a specified position in the data packet header (such as the head row position in the packet header, the last position of all the information in the packet header, or a certain position in the middle of all the information in the packet header, etc.).

[0074] Of course, this is not limited to this. In actual applications, the data packet sequence number can be bound to the data packet for sending, such as reserving space at the end or head of the data packet as a location to add the data packet sequence number, thereby binding the data packet sequence number to the data packet for sending.

[0075] After extracting the data packet sequence number in the data packet header of the data packet in the sorting queue, step 104 is executed.

[0076] Step 104: Send the data packets in the sorting queue to the data packet output queue in sequence according to the data packet sequence numbers from small to large, so as to output the data packets.

[0077] After extracting the data packet sequence number in the data packet header of the data packet in the sorting queue, the data packets in the sorting queue can be sent to the data packet output queue in order from small to large data packet sequence numbers to output the data packets.

[0078] In the case that the forwarded data packets are out of order, the embodiment of the present application utilizes the unique field (i.e., the data packet sequence number) in the proprietary structure encapsulated in the visual network as the basis for restoring the order of the original data stream, thereby restoring the order of the data packets to the order when they were encapsulated in the visual network, thereby achieving the purpose of correcting the out-of-order data packets, ensuring the consistency of the data packet sequence, and meeting the user's demand for consistency in the order of network data packets.

[0079] In this embodiment, a constantly adjusted reference packet sequence number can be preset, and the data packets in the sorting queue are continuously sent to the output queue by comparing the data packet sequence number with the reference packet sequence number. Figure 2 This is described in detail as follows.

[0080] Reference Figure 2 , shows a flowchart of a method for sending a data packet provided by an embodiment of the present application. Figure 2 As shown, the data packet sending method may include: step 201, step 202 and step 203.

[0081] Step 201: Determine whether there is a first data packet in the sorting queue whose data packet sequence number is smaller than the reference packet sequence number.

[0082] In this embodiment, the reference packet sequence number refers to the reference sequence number used to output the data packets one by one from the sorting queue in the order of the data packet sequence numbers from small to large. In this example, the initial value of the reference packet sequence number is 1, and after each data packet is output from the sorting queue, the reference packet sequence number is increased by 1.

[0083] After extracting the data packet sequence number in the data packet header of the data packet in the sorting queue, it can be determined whether there is a first data packet in the sorting queue whose data packet sequence number is smaller than the reference packet sequence number.

[0084] Step 202: When the first data packet exists in the sorting queue, the first data packet is sent to the data packet output queue, and the reference packet sequence number is increased by 1 to obtain a new reference packet sequence number.

[0085] In the case that the first data packet exists in the sorting queue, the first data packet is sent to the data packet output queue, and the reference packet sequence number is increased by 1 to obtain a new reference packet sequence number.

[0086] Step 203: iteratively execute the above steps until there are no buffered data packets in the sorting queue.

[0087] Furthermore, the above steps 201 and 202 may be iteratively executed until no cached data packets exist in the sorting queue. For example, if the reference packet sequence number is 1, then it is possible to traverse all the data packets in the sorting queue to see if there is a data packet with a sequence number of 0 (i.e., less than 1). If so, the data packet with the sequence number of 0 is sent to the output queue, and the reference packet sequence number is increased by 1 to obtain the reference packet sequence number 2 of the signal. Then, it is possible to traverse all the data packets in the sorting queue to see if there is a data packet with a sequence number of 1 (i.e., less than 2). If so, the data packet with the sequence number of 1 is sent to the output queue, and the reference packet sequence number is increased by 1 to obtain the reference packet sequence number 3 of the signal, and so on. And so on, until no cached data packets exist in the sorting queue.

[0088] By setting a reference packet sequence number, the embodiment of the present application can extract data packets from the sorting queue in ascending order of the data packet sequence number and send them to the output queue, thereby avoiding the occurrence of errors in data packet sequence number recording caused by manual recording and reducing the investment in labor costs.

[0089] When it is determined that there is no data packet with a sequence number smaller than the reference packet in the sorting queue, the data packet with the smallest sequence number in the sorting queue can be obtained, and it can be determined whether the cache time of the data packet in the sorting queue exceeds the threshold. If so, the data packet is output. Figure 3 This is described in detail as follows.

[0090] Reference Figure 3 , shows a flowchart of another method for sending a data packet provided by an embodiment of the present application. Figure 3 As shown, the data packet sending method may include: step 301, step 302, step 303 and step 304.

[0091] Step 301: when it is determined that there is no data packet in the sorting queue whose data packet sequence number is smaller than the reference packet sequence number, obtain a second data packet with the smallest data packet sequence number in the sorting queue.

[0092] In this embodiment, when it is determined that there is no data packet with a data packet sequence number less than the reference packet sequence number in the sorting queue, the second data packet with the smallest data packet sequence number in the sorting queue can be obtained. For example, the data packets in the sorting queue have data packet sequence numbers of 20, 18, 17, and 11, respectively. In this case, the data packet corresponding to data packet sequence number 11 can be used as the second data packet, etc.

[0093] It can be understood that the above examples are merely examples listed for a better understanding of the technical solutions of the embodiments of the present application, and are not intended to be the sole limitation to the embodiments.

[0094] After the second data packet with the smallest data packet sequence number in the sorting queue is obtained, step 302 is executed.

[0095] Step 302: Obtain the cache duration of the second data packet, where the cache duration refers to the duration during which the second data packet is cached in the sorting queue.

[0096] After obtaining the second data packet with the smallest data packet sequence number in the sorting queue, the cache duration of the second data packet can be obtained, wherein the cache duration refers to the duration of the second data packet being cached in the sorting queue.

[0097] In a specific implementation, when the second data packet is cached in the sorting queue, the cache time of the second data packet can be recorded. When calculating the cache time of the second data packet, the cache time of the second data packet can be subtracted from the current time to obtain the cache time of the second data packet.

[0098] After the cache duration of the second data packet is obtained, step 303 is executed.

[0099] Step 303: Determine whether the cache duration exceeds a preset duration threshold.

[0100] The duration threshold refers to the threshold of the duration of the pre-set sorting queue for caching data packets. In this example, the duration threshold may be 1 minute or 2 minutes, etc. This embodiment does not limit the specific value of the duration threshold.

[0101] After the cache duration of the second data packet is acquired, the cache duration may be compared with a preset duration threshold.

[0102] If the cache duration of the second data packet does not exceed the duration threshold, that is, the cache duration is less than the duration threshold, the second data packet may continue to be cached in the sorting queue and wait.

[0103] If the cache duration of the second data packet exceeds the duration threshold, step 304 is executed.

[0104] Step 304: When it is determined that the cache duration exceeds the duration threshold, the second data packet is sent to the data packet output queue.

[0105] When it is determined that the buffering time of the second data packet exceeds the time threshold, the second data packet may be sent to the data packet output queue.

[0106] The embodiment of the present application sends a data packet to an output queue when the cache duration of the data packet exceeds a duration threshold, thereby avoiding the problem of subsequent data packets waiting for a long time in the sorting queue due to the loss of a data packet with the same sequence number as the current reference packet.

[0107] In this embodiment, when sending a data packet to the data packet output queue, the data packet can be sent according to the tunnel. Figure 4 This is described in detail as follows.

[0108] Reference Figure 4 , shows a flowchart of the steps of another method for sending a data packet provided by an embodiment of the present application. Figure 4 As shown, the data packet sending method may include: step 401 and step 402.

[0109] Step 401: Determine a data packet output queue corresponding to the data packet according to the tunnel corresponding to the data packet.

[0110] In this embodiment, in the visual network, data packets of different tunnels need to be output through different data packet output queues. When data packets need to be output, the data packet output queue corresponding to the data packet can be determined according to the tunnel corresponding to the data packet.

[0111] Step 402: sending the data packets in sequence to the data packet output queues corresponding to the data packets in the sorting queue in ascending order of the data packet sequence numbers, so as to output the data packets.

[0112] Then, the data packets may be sent in sequence to the data packet output queues corresponding to the data packets in the sorting queue in ascending order of the data packet sequence numbers, so as to output the data packets.

[0113] The embodiment of the present application implements sending data packets to a specified data packet output queue according to the tunnel, so that data packets from the same tunnel can be output through the same data packet output queue, thereby avoiding the occurrence of data packet sending errors.

[0114] Next, combine Figure 5 The architecture provided describes the packet out-of-order correction process in detail.

[0115] Reference Figure 5 , shows a schematic diagram of a data packet out-of-order correction architecture provided by an embodiment of the present application. Figure 5 As shown in FIG. 1 , the visual network encapsulated data packets that enter the multi-processor network device from the input port in sequence are: data packet 1, data packet 2, ..., data packet 6. After being diverted by the input module, they are evenly sent to the input queue corresponding to a processor. Since the network data packets are encapsulated by the visual network, the input diversion module cannot extract the characteristic fields of a specific network data flow, so the input data packets are evenly diverted to the input queue of each processor.

[0116] The processor reads the data packet from its input queue, decapsulates and forwards it through the visual network, and sends the data packet and the packet_NO value extracted from the visual network's proprietary structure to the sorting queue corresponding to the output port. At this time, the data packets arriving at the sorting queue may be inconsistent with the order at the time of input, and appear out of order. Figure 5 The order of the output data packets is shown as: data packet 5, data packet 3, data packet 6, data packet 4, data packet 2, data packet 1.

[0117] Then, the disorder correction module in the network device can read the data packet from the sorting queue, and decide whether to send the data packet to the output queue immediately or continue to wait in the sorting queue according to the value of the unique field packet_NO bound to the data packet. If the value of the unique field packet_NO corresponding to the data packet is the packet_NO value of the data packet that should be sent out at present or the waiting time of the data packet has timed out, the data packet is sent to the output queue, otherwise it is reordered in the sorting queue according to the packet_NO value of the data packet and sent to the output queue when the conditions are met.

[0118] The embodiment of the present application corrects the disorder problem by adjusting the order of data packets before the data packets arrive at the output port by utilizing the packet_NO field unique to the proprietary structure of the visual networking data packet.

[0119] Next, combine Figure 6 The data packet out-of-order correction process is described in detail.

[0120] Reference Figure 6 , shows a schematic diagram of a data packet disorder correction process provided by an embodiment of the present application. Figure 6 As shown, the data packet disorder correction process may include the following steps:

[0121] 1. The processor binds the processed network data packet and the unique field packet_NO value in the visual network proprietary structure and sends it to the out-of-order correction module of the output port.

[0122] 2. According to the size of packet_NO bound to the data packet, insert the data packet into the sorting queue and wait, and record the time of entering the queue. That is, the data packet with large packet_NO is inserted into the back position of the sorting queue, and the data packet with small packet_NO is inserted into the front position of the sorting queue.

[0123] 3. Query the data packets in the sorting queue in ascending order of packet_NO values.

[0124] 4. Determine whether the packet_NO bound to the data packet is less than or equal to the current output value. As long as the output queue of the output port is not full, the out-of-order correction module will query the sorting queue according to the packet_NO value from small to large. If the packet_NO value is equal to or less than the current reference packet_NO value, the data packet will be taken out of the sorting queue and sent to the output queue of the output port for output. At the same time, the current reference packet_NO value is accumulated as the packet_NO value of the next network data packet sent to the output queue to be predicted.

[0125] 5. If the waiting time of the packet with the smallest packet_NO value in the sorting queue exceeds the threshold, the packet is sent to the output queue to avoid the subsequent packets waiting forever in the sorting queue due to the loss of packets with the same value as the current reference packet_NO. If the waiting time of the packet with the smallest packet_NO value does not exceed the threshold, the packet continues to wait in the sorting queue.

[0126] The packet processing method provided in the embodiment of the present application obtains tunnel characteristic information corresponding to the packet for the packet output by the multiprocessor, and determines the tunnel corresponding to the packet. The packet is cached in the sorting queue corresponding to the tunnel. The packet sequence number in the packet header of the packet is extracted. The packets are sent to the packet output queue in order from small to large according to the packet sequence number to output the packet. In the case that the forwarded packets are out of order, the embodiment of the present application uses the unique field (i.e., the packet sequence number) in the proprietary structure encapsulated in the visual network as the basis for restoring the order of the original data stream, and restores the order of the packets to the order when the visual network was encapsulated, thereby achieving the purpose of correcting the disorder of the packets, ensuring the consistency of the packet sequence, and meeting the user's demand for the consistency of the network packet sequence.

[0127] It should be noted that, for the method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described action sequence, because according to the embodiments of the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.

[0128] Reference Figure 7 , shows a schematic diagram of the structure of a data packet processing device provided by an embodiment of the present application. Figure 7 As shown, the data packet processing device 700 may include the following modules:

[0129] The tunnel determination module 710 is used to obtain tunnel characteristic information corresponding to the data packet output by the multiprocessor and determine the tunnel corresponding to the data packet;

[0130] A data packet buffering module 720, configured to buffer the data packet in a sorting queue corresponding to the tunnel;

[0131] A data packet sequence number extraction module 730, used to extract the data packet sequence number in the data packet header of the data packet in the sorting queue;

[0132] The data packet sending module 740 is used to send the data packets in the sorting queue to the data packet output queue in sequence according to the order of the data packet sequence numbers from small to large, so as to output the data packets.

[0133] Optionally, the tunnel determination module includes:

[0134] The tunnel feature extraction unit is used to extract the tunnel feature information from the data packet header of the data packet.

[0135] Optionally, the data packet sending module includes:

[0136] A first data packet determining unit, configured to determine whether there is a first data packet in the sorting queue whose data packet sequence number is smaller than the reference packet sequence number;

[0137] A first data packet sending unit, configured to send the first data packet to the data packet output queue if the first data packet exists in the sorting queue, and increase the reference packet sequence number by 1 to obtain a new reference packet sequence number;

[0138] an iterative execution unit, configured to iteratively execute the first data packet determining unit and the first data packet sending unit until no cached data packets exist in the sorting queue;

[0139] The initial value of the reference package number is 1.

[0140] Optionally, the device further comprises:

[0141] A second data packet acquisition module, configured to acquire a second data packet with the smallest data packet sequence number in the sorting queue when it is determined that there is no data packet with a data packet sequence number smaller than the reference packet sequence number in the sorting queue;

[0142] A cache duration acquisition module, used to acquire a cache duration of the second data packet, where the cache duration refers to a duration during which the second data packet is cached in the sorting queue;

[0143] A cache duration determination module, used to determine whether the cache duration exceeds a preset duration threshold;

[0144] The second data packet sending module is used to send the second data packet to the data packet output queue when it is determined that the cache time exceeds the time threshold.

[0145] Optionally, the data packet sending module includes:

[0146] an output queue determining unit, configured to determine a data packet output queue corresponding to the data packet according to a tunnel corresponding to the data packet;

[0147] The data packet sending unit is used to send the data packets in sequence to the data packet output queues corresponding to the data packets in the sorting queue in ascending order of the data packet sequence numbers, so as to output the data packets.

[0148] The data packet processing device provided in the embodiment of the present application obtains tunnel characteristic information corresponding to the data packet for the data packet output by the multiprocessor, and determines the tunnel corresponding to the data packet. The data packet is cached in the sorting queue corresponding to the tunnel. The data packet sequence number in the data packet header of the data packet is extracted. The data packets are sent to the data packet output queue in order from small to large in order to output the data packets. In the embodiment of the present application, when the forwarded data packets are out of order, the unique field (i.e., the data packet sequence number) in the proprietary structure encapsulated in the visual network is used as the basis for restoring the order of the original data stream, and the order of the data packets is restored to the order when the visual network was encapsulated, so as to achieve the purpose of correcting the disorder of the data packets, ensure the consistency of the order of the data packets, and meet the user's demand for the consistency of the order of the network data packets.

[0149] As for the device 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.

[0150] In an embodiment of the present application, an electronic device is also provided. The electronic device may include one or more processors, and one or more machine-readable media storing instructions thereon, the instructions being, for example, application programs. When the instructions are executed by the one or more processors, the processors execute any of the above-mentioned data packet processing methods.

[0151] In an embodiment of the present application, a non-temporary computer-readable storage medium is also provided, on which a computer program is stored, and the program can be executed by a processor of an electronic device to implement any of the above-mentioned data packet processing methods. For example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0152] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0153] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0154] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0155] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0156] These computer program instructions can also be loaded into a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0157] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0158] Finally, 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 terminal 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 terminal 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 terminal device including the elements.

[0159] The above is a detailed introduction to a data packet processing method, device, electronic device and storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A data packet processing method, characterized in that: The method comprises: For data packets output by the multiprocessor, obtaining tunnel characteristic information corresponding to the data packets, and determining the tunnel corresponding to the data packets; Buffering the data packet in a sorting queue corresponding to the tunnel; Extracting the data packet sequence number in the data packet header of the data packet in the sorting queue; The data packets in the sorting queue are sent to the data packet output queue in sequence from small to large according to the data packet sequence numbers, so as to output the data packets.

2. The method according to claim 1, characterized in that: The obtaining tunnel characteristic information corresponding to the data packet includes: The tunnel characteristic information is extracted from a data packet header of the data packet.

3. The method according to claim 1 or 2, characterized in that: The step of sending the data packets in the sorting queue to the data packet output queue in sequence according to the data packet sequence numbers from small to large, so as to output the data packets, comprises: Determine whether there is a first data packet in the sorting queue whose data packet sequence number is smaller than the reference packet sequence number; If the first data packet exists in the sorting queue, sending the first data packet to the data packet output queue, and adding 1 to the reference packet sequence number to obtain a new reference packet sequence number; Iterate the above steps until there is no cached data packet in the sorting queue; The initial value of the reference package number is 1.

4. The method according to claim 3, characterized in that After determining whether there is a first data packet with a data packet sequence number smaller than the reference packet sequence number in the sorting queue, the method further includes: When it is determined that there is no data packet with a data packet sequence number smaller than the reference packet sequence number in the sorting queue, obtaining a second data packet with the smallest data packet sequence number in the sorting queue; Obtaining a cache duration of the second data packet, where the cache duration refers to a duration during which the second data packet is cached in the sorting queue; Determine whether the cache duration exceeds a preset duration threshold; When it is determined that the buffering time exceeds the time threshold, the second data packet is sent to the data packet output queue.

5. The method according to claim 2, characterized in that: The step of sending the data packets in the sorting queue to the data packet output queue in sequence according to the data packet sequence numbers from small to large, so as to output the data packets, comprises: Determining, according to the tunnel corresponding to the data packet, a data packet output queue corresponding to the data packet; The data packets are sent in sequence to the data packet output queues corresponding to the data packets in the sorting queue in ascending order of the data packet sequence numbers, so as to output the data packets.

6. A data packet processing device, characterized in that: The device comprises: A tunnel determination module, for obtaining tunnel characteristic information corresponding to a data packet output by a multiprocessor, and determining a tunnel corresponding to the data packet; A data packet caching module, used for caching the data packet in a sorting queue corresponding to the tunnel; A data packet sequence number extraction module, used to extract the data packet sequence number in the data packet header of the data packet in the sorting queue; The data packet sending module is used to send the data packets in the sorting queue to the data packet output queue in sequence according to the data packet sequence numbers from small to large, so as to output the data packets.

7. The device according to claim 6, characterized in that The tunnel determination module includes: The tunnel feature extraction unit is used to extract the tunnel feature information from the data packet header of the data packet.

8. The device according to claim 6 or 7, characterized in that The data packet sending module comprises: an output queue determining unit, configured to determine a data packet output queue corresponding to the data packet according to a tunnel corresponding to the data packet; The data packet sending unit is used to send the data packets in sequence to the data packet output queues corresponding to the data packets in the sorting queue in ascending order of the data packet sequence numbers, so as to output the data packets.

9. An electronic device, characterized in that: include: one or more processors; and One or more machine-readable media having instructions stored thereon, when executed by the one or more processors, cause the apparatus to perform the data packet processing method according to any one of claims 1 to 5.

10. A computer-readable storage medium, characterized in that: The computer program stored therein enables the processor to execute the data packet processing method as described in any one of claims 1 to 5.