Data message transmission method and device, proxy server, network equipment and storage medium

By introducing a combination of ordered and unordered queues, the problem of high complexity and insufficient flexibility caused by the inconsistency in processing capabilities between wired and wireless sides in TCP proxy transmission is solved, achieving efficient and ordered transmission of data packets and improving user experience.

CN121644654APending Publication Date: 2026-03-10DATANG MOBILE COMM EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411249890.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing TCP proxy transmission technology suffers from problems such as TCP packet loss and retransmission, congestion, and reduced service speed when the processing capabilities and quality are inconsistent between the wired and wireless sides. It lacks flexibility and is highly complex.

Method used

A combination of ordered and unordered queues is used to store and transmit data packets based on their sequence numbers. Ordered queues store consecutive data packets, while unordered queues store non-consecutive data packets. This reduces the need for parsing data content and improves the flexibility and efficiency of transmission.

Benefits of technology

It reduces the complexity of data transmission, improves system flexibility, ensures that data packets are transmitted in sequence according to their sequence numbers, reduces packet loss and congestion, and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121644654A_ABST
    Figure CN121644654A_ABST
Patent Text Reader

Abstract

The invention relates to a data message transmission method and device, a proxy server, network equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: acquiring a serial number of a data message to be sent; under the condition that the serial number of the data message to be sent is the same as the expected serial number of an ordered queue, the data message to be sent is stored in the ordered queue, and the ordered queue is used for storing the data message to be sent according to the sequence of the serial number; updating the expected serial number of the ordered queue; and carrying out data message transmission based on the ordered queue. By adopting the method, the complexity can be reduced, and the flexibility is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of communication, in particular to a data packet transmission method and device, a proxy server, network equipment and a processor readable storage medium. BACKGROUND

[0002] With the development of communication technology, network video service data streams account for a large proportion in daily life. Video services such as TikTok and iQIYI are transmitted through TCP (Transmission Control Protocol) network data. To handle large service traffic and reduce packet loss, a TCP proxy mode is used to stably send service data to the receiving end. Currently, transmission devices such as base stations, firewalls and VPN servers are all sent in TCP proxy mode. They have one thing in common, which is that they have different receiving and sending areas. For example, in the transmission architecture of a wireless base station, one is the wired side and the other is the wireless side. The transmission processing capacity of the wired side is much greater than that of the wireless side, and the communication quality of the wired side is also much better than that of the wireless side. Due to the inconsistency of the processing capacity or quality of the wired side and the wireless side, TCP may appear packet retransmission or congestion, resulting in problems such as service rate decline, traffic unsmoothness, time delay increase and the like, which affect the user's intuitive feeling.

[0003] The implementation logic of the traditional TCP proxy transmission technology is to record the array head address in the flow, judge the state of the state machine and the type of the data, parse the data that needs to be cached, compare the parsed TSN number (sequence number) with the TSN number of the cached data, use the form of hash record of the front node and the rear node to store in the array, and mark the related information of the current data in the data structure of the node. Traverse, send, insert and the like.

[0004] The above scheme has high complexity and lacks flexibility. SUMMARY

[0005] Therefore, it is necessary to provide a data packet transmission method, device, proxy server, network equipment, processor readable storage medium and computer program product with reduced complexity and improved flexibility to solve the above technical problems.

[0006] In a first aspect, the present application provides a data packet transmission method, which comprises:

[0007] obtaining the sequence number of the data packet to be sent;

[0008] store the to-be-sent data packet into the ordered queue when the sequence number of the to-be-sent data packet is the same as the expected sequence number of the ordered queue, the ordered queue being configured to store to-be-sent data packets in order of sequence numbers;

[0009] update the expected sequence number of the ordered queue;

[0010] perform data packet transmission based on the ordered queue.

[0011] In one of the embodiments, the method further comprises:

[0012] store the to-be-sent data packet into the unordered queue when the sequence number of the to-be-sent data packet is greater than the expected sequence number of the ordered queue, the unordered queue being configured to store to-be-sent data packets that are not continuous with the maximum sequence number of the ordered queue.

[0013] In one of the embodiments, the method further comprises:

[0014] find whether there is a to-be-sent data packet in the unordered queue that is the same as the expected sequence number of the ordered queue;

[0015] remove the to-be-sent data packet found from the unordered queue when there is a to-be-sent data packet in the unordered queue that is the same as the expected sequence number of the ordered queue;

[0016] store the to-be-sent data packet removed from the unordered queue into the ordered queue.

[0017] In one of the embodiments, the to-be-sent data packets in the unordered queue are stored in order of the sequence numbers from small to large; and the storing of the to-be-sent data packet into the unordered queue comprises:

[0018] sequentially compare the sequence number of the to-be-sent data packet with the sequence numbers of the to-be-sent data packets in the unordered queue in order of the sequence numbers from small to large;

[0019] determine an insertion position of the to-be-sent data packet based on the comparison result;

[0020] store the to-be-sent data packet into the unordered queue based on the insertion position.

[0021] In one of the embodiments, the method further comprises:

[0022] discard the to-be-sent data packet when the sequence number of the to-be-sent data packet is less than the expected sequence number of the ordered queue.

[0023] In one of the embodiments, the updating the expected sequence number of the ordered queue comprises:

[0024] determining a target sequence number based on the sequence number of the to-be-sent data packet and the length of the to-be-sent data packet;

[0025] updating the expected sequence number of the ordered queue as the target sequence number.

[0026] In one of the embodiments, the method further comprises:

[0027] storing the data packets for which the acknowledgement packets have not been received after being sent in the to-be-retransmitted queue in the order of the sequence number from small to large;

[0028] in the case of needing to resend the data packets, obtaining the first data packet from the to-be-retransmitted queue and sending the obtained first data packet.

[0029] In one of the embodiments, the method further comprises:

[0030] in the case of receiving the acknowledgement packet corresponding to the sent data packet, releasing the first data packet in the to-be-retransmitted queue.

[0031] In one of the embodiments, the sending the data packet based on the ordered queue comprises:

[0032] determining the number of data packets to be sent;

[0033] obtaining the continuous to-be-sent data packets corresponding to the number of data packets from the ordered queue and sending the continuous to-be-sent data packets.

[0034] In one of the embodiments, the method further comprises:

[0035] matching the to-be-sent data packet with the flow information of each service flow to obtain a matched service flow;

[0036] obtaining the ordered queue, the unordered queue and the to-be-retransmitted queue corresponding to the matched service flow.

[0037] In one of the embodiments, the method further comprises:

[0038] obtaining the number of nodes corresponding to the to-be-retransmitted queue;

[0039] in the case of the number of nodes corresponding to the to-be-retransmitted queue being equal to a preset value, continuing to perform the step of sending the data packet based on the ordered queue;

[0040] In a case where the number of nodes corresponding to the to-be-retransmitted queue is not equal to the preset value and there is data packet retransmission, the step of performing data packet transmission based on the ordered queue is stopped.

[0041] In one of the embodiments, the method further comprises:

[0042] In a case where the ordered queue is in an initialization state, the to-be-sent data packet is stored in the ordered queue.

[0043] In a second aspect, the application further provides a data packet transmission device, which comprises:

[0044] a sequence number obtaining module, configured to obtain a sequence number of a to-be-sent data packet;

[0045] a first storage module, configured to store the to-be-sent data packet in an ordered queue in a case where the sequence number of the to-be-sent data packet is the same as an expected sequence number of the ordered queue, the ordered queue being configured to store to-be-sent data packets in the order of sequence numbers;

[0046] a first updating module, configured to update the expected sequence number of the ordered queue;

[0047] a transmission module, configured to perform data packet transmission based on the ordered queue.

[0048] In one of the embodiments, the device further comprises:

[0049] a second updating module, configured to store the to-be-sent data packet in an unordered queue in a case where the sequence number of the to-be-sent data packet is greater than the expected sequence number of the ordered queue, the unordered queue being configured to store to-be-sent data packets that are not continuous with the maximum sequence number of the ordered queue.

[0050] In one of the embodiments, the device further comprises:

[0051] a third updating module, configured to find whether there is a to-be-sent data packet with the same expected sequence number as that of the ordered queue in the unordered queue, remove the to-be-sent data packet with the same expected sequence number as that of the ordered queue from the unordered queue in a case where there is a to-be-sent data packet with the same expected sequence number as that of the ordered queue in the unordered queue, and store the to-be-sent data packet removed from the unordered queue in the ordered queue.

[0052] In one of the embodiments, the out-of-order queue stores the to-be-sent data packets in the order of the sequence numbers from small to large; the second updating module is further configured to compare the sequence number of the to-be-sent data packet with the sequence numbers of the to-be-sent data packets in the out-of-order queue in the order of the sequence numbers from small to large; determine the insertion position of the to-be-sent data packet based on the comparison result; and store the to-be-sent data packet into the out-of-order queue based on the insertion position.

[0053] In one of the embodiments, the apparatus further comprises:

[0054] The discarding module is configured to discard the to-be-sent data packet in the case that the sequence number of the to-be-sent data packet is smaller than the expected sequence number of the in-order queue.

[0055] In one of the embodiments, the first updating module is specifically configured to determine a target sequence number based on the sequence number of the to-be-sent data packet and the length of the to-be-sent data packet; and update the expected sequence number of the in-order queue to the target sequence number.

[0056] In one of the embodiments, the apparatus further comprises:

[0057] The fourth updating module is configured to store the data packets that have been sent but for which no acknowledgement packet has been received into the retransmission queue in the order of the sequence numbers from small to large; and acquire the first data packet from the retransmission queue and send the acquired first data packet in the case that the data packet needs to be re-sent.

[0058] In one of the embodiments, the apparatus further comprises:

[0059] The releasing module is configured to release the first data packet in the retransmission queue in the case that an acknowledgement packet corresponding to the sent data packet is received.

[0060] In one of the embodiments, the transmission module is specifically configured to determine the number of packets of the to-be-sent data packet; acquire the continuous to-be-sent data packets corresponding to the number of packets from the in-order queue; and send the continuous to-be-sent data packets.

[0061] In one of the embodiments, the apparatus further comprises:

[0062] The service flow matching module is configured to match the to-be-sent data packet with the flow information of each service flow to obtain a matched service flow; and acquire the in-order queue, the out-of-order queue and the retransmission queue corresponding to the matched service flow.

[0063] In one of the embodiments, the apparatus further comprises:

[0064] The agent state acquisition module is configured to acquire the number of nodes corresponding to the retransmission queue; in a case where the number of nodes corresponding to the retransmission queue is equal to a preset value, continue to perform the step of transmitting data packets based on the ordered queue; and in a case where the number of nodes corresponding to the retransmission queue is not equal to the preset value and there is data packet retransmission, stop performing the step of transmitting data packets based on the ordered queue.

[0065] In one of the embodiments, the apparatus further comprises:

[0066] The initialization module is configured to, in a case where the ordered queue is in an initialization state, store the to-be-sent data packet into the ordered queue.

[0067] In a third aspect, the present application further provides an agent server, comprising a memory and a processor, the memory stores a computer program, and the processor implements the steps of the method in any one of the above embodiments when executing the computer program.

[0068] In a fourth aspect, the present application further provides a network device, comprising a memory, a processor and a transceiver, the memory stores a computer program, the transceiver is configured to transceive data under the control of the processor, and the processor implements the steps of the method in any one of the above embodiments when executing the computer program.

[0069] In a fifth aspect, the present application further provides a processor-readable storage medium, which stores a computer program, and the computer program implements the steps of the method in any one of the above embodiments when executed by a processor.

[0070] In a sixth aspect, the present application further provides a computer program product, comprising a computer program, and the computer program implements the steps of the method in any one of the above embodiments when executed by a processor.

[0071] The above data packet transmission method, apparatus, agent server, network device, processor-readable storage medium and computer program product, the ordered queue is configured to store to-be-sent data packets in order of sequence numbers, in a case where the sequence number of the to-be-sent data packet is the same as an expected sequence number of the ordered queue, store the to-be-sent data packet into the ordered queue and update the expected sequence number of the ordered queue, and subsequently transmit data packets based on the ordered queue, in the process of storage and transmission, the content of the data is not parsed, and the sequence number of the outer TCP protocol interaction is only concerned, and the data packet is stored in the ordered queue, so that the data can be directly obtained from the ordered queue in order when the data is transmitted, the complexity is reduced, and the flexibility is improved. BRIEF DESCRIPTION OF DRAWINGS

[0072] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application or the related art. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained from these drawings without creative labor.

[0073] Figure 1 An application environment diagram of a data packet transmission method in an embodiment;

[0074] Figure 2 A flowchart of a data packet transmission method in an embodiment;

[0075] Figure 3 A flowchart of a step of inserting an unordered queue for a to-be-sent data packet in an embodiment;

[0076] Figure 4 A flowchart of a step of searching an unordered queue in an embodiment;

[0077] Figure 5 A flowchart of a processing step of a to-be-retransmitted queue in an embodiment;

[0078] Figure 6 A diagram of multiple service flows and queues in an embodiment;

[0079] Figure 7 A flowchart of a data packet transmission method in another embodiment;

[0080] Figure 8 A structural block diagram of a data packet transmission device in an embodiment;

[0081] Figure 9 An internal structural diagram of a network device in an embodiment. DETAILED DESCRIPTION

[0082] In order to make the purposes, technical solutions and advantages of the present application more clear, the following will further describe the present application in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.

[0083] The data packet transmission method provided by the embodiments of the present application can be applied in an application environment as shown in the following figure. Figure 1 In the figure, a sending end 102 communicates with a receiving end 104 through a proxy server 106. The proxy server 106 includes a TCP proxy service, so as to realize the communication between the sending end 102 and the receiving end 104 through a separate proxy server.

[0084] In other optional embodiments, the TCP proxy service can also be integrated in a network device, so that the network device acts as a proxy server to implement the communication between the sending end 102 and the receiving end 104.

[0085] Optionally, the network device can be a base station, and in the case where the network device is a base station, the sending end 102 and the receiving end 104 can be a core network and a terminal device.

[0086] The TCP proxy service can proxy multiple service flows, and each service flow corresponds to three queues, namely an in-order queue, an out-of-order queue, and a retransmission queue. The in-order queue is used to store continuous data packets to be sent, the out-of-order queue is used to store data packets to be sent that are not continuous with the maximum sequence number of the in-order queue, and the retransmission queue is used to store data packets that have been sent but for which no acknowledgement packet has been received. The data packets stored in each of the in-order queue, the out-of-order queue, and the retransmission queue are arranged in order of sequence number, for example, in order of sequence number from small to large, or in order of sequence number from large to small, without specific limitation. Each of the in-order queue, the out-of-order queue, and the retransmission queue is a double-linked list, and the in-order queue includes at least an expected sequence number of the next data packet to be expected. Optionally, each of the three queues can also include a number of nodes, which can be used to obtain the usage of the queue. Optionally, each of the three queues can also include a maximum sequence number of the data packets corresponding to the queue. The expected sequence number, the node information, and the maximum sequence number mentioned above can all be stored as header information in the queue. In other optional embodiments, for design convenience, each of the in-order queue, the out-of-order queue, and the retransmission queue is a double-linked list, and the header information of the double-linked list includes the number of nodes in the queue, the expected sequence number of the next data packet to be expected, and the maximum sequence number of the data packets corresponding to the queue, but the expected sequence number of the next data packet to be expected in the out-of-order queue and the retransmission queue can not be used.

[0087] In this way, after the TCP proxy service receives a data packet, the sequence number of the data packet to be sent is obtained. In the case where the sequence number of the data packet to be sent is the same as the expected sequence number of the in-order queue, the data packet to be sent is stored in the in-order queue, and the expected sequence number of the in-order queue is updated. Data packet transmission is performed based on the in-order queue. In this way, the content of the data is not parsed during the storage and transmission process, and the type of the data is not concerned, only the sequence number of the outer TCP protocol interaction is concerned. Moreover, the data packet is stored in the in-order queue, so that the data can be directly obtained from the in-order queue in order when the data is sent, which reduces the complexity and improves the flexibility.

[0088] In this application, the network device involved in the embodiments can be a base station, which may include multiple cells providing services to terminals. Depending on the specific application, the base station may also be called an access point, or a device in the access network that communicates with the wireless terminal device through one or more sectors on the air interface, or other names. The network device can be used to exchange received air frames with Internet Protocol (IP) packets, acting as a router between the wireless terminal device and the rest of the access network, where the rest of the access network may include an Internet Protocol (IP) communication network. The network device can also coordinate the attribute management of the air interface. For example, the network device involved in this application embodiment may be an evolved Node B (eNB or e-NodeB) in a long term evolution (LTE) system, a 5G base station (gNB) in a next generation system, or a Home evolved Node B (HeNB), relay node, femto, pico, network testing equipment, etc., and is not limited in this application embodiment. In some network architectures, network devices may include centralized unit (CU) nodes and distributed unit (DU) nodes, which may also be geographically separated.

[0089] The terminal devices involved in the embodiments of this application can be devices that provide voice and / or data connectivity to users, handheld devices with wireless connectivity, or other processing devices connected to a wireless modem. The names of the terminal devices may differ in different systems; for example, in a 5G system, a terminal device can be called User Equipment (UE). Wireless terminal devices can be USB storage devices, other personal computer memory devices, and dongles. They can also communicate with one or more core networks (CNs) via a Radio Access Network (RAN). Wireless terminal devices can be mobile terminal devices, such as mobile phones (or "cellular" phones) and computers with mobile terminal devices. For example, they can be portable, pocket-sized, handheld, computer-embedded, or vehicle-mounted mobile devices that exchange voice and / or data with the radio access network. Examples of such devices include Personal Communication Service (PCS) phones, cordless phones, Session Initiated Protocol (SIP) phones, Wireless Local Loop (WLL) stations, Personal Digital Assistants (PDAs), personal computers, tablets, and Machine-type Communication (MTC) terminal devices. Wireless terminal devices can also be referred to as systems, subscriber units, subscriber stations, mobile stations, mobile devices, remote stations, access points, remote terminals, access terminals, user terminals, user agents, user devices, and wireless access devices and routers / modems that meet the limitations of this definition, but are not limited to these in the embodiments of this application.

[0090] In one exemplary embodiment, such as Figure 2 As shown, a data packet transmission method is provided, which is applied to... Figure 1 The TCP proxy service in proxy server 106 is used as an example for illustration, including the following steps S202 to S208. Wherein:

[0091] S202: Obtain the sequence number of the data packet to be sent.

[0092] The sequence number can be the TSN number of the data packet to be sent, which can uniquely identify the corresponding data packet to be sent.

[0093] S204: If the sequence number of the data packet to be sent is the same as the expected sequence number of the ordered queue, the data packet to be sent is stored in the ordered queue. The ordered queue is used to store the data packets to be sent in the order of their sequence numbers.

[0094] An ordered queue is used to store consecutive data packets to be sent. The ordered queue includes an expected sequence number u32SeqNxt, which is the sequence number of the next data packet to be sent. Optionally, this ordered queue can manage and store business data using a doubly linked list. The header structure of the doubly linked list records the data information of the table body in real time. This header structure includes header information, and the expected sequence number u32SeqNxt can be stored in the header information, thus the header information includes the expected sequence number u32SeqNxt. Optionally, the ordered queue also includes the number of nodes u32NodeNums and / or the maximum sequence number u32SeqMax, so the header information can also include the number of nodes u32NodeNums and / or the maximum sequence number u32SeqMax. The maximum sequence number u32SeqMax is the maximum sequence number of the data packets to be sent in the node, and the node data u32NodeNums is the number of nodes in the table, corresponding to the number of data packets to be sent. It should be noted that the header information may include other information depending on the different application requirements, and no specific restrictions are made here.

[0095] The proxy service compares the sequence number of the data packet to be sent with the expected sequence number of the ordered queue. If the sequence number of the data packet to be sent is the same as the expected sequence number of the ordered queue, it means that the data packet to be sent is the data packet expected by the ordered queue. Therefore, the data packet to be sent is stored in the ordered queue. Since the data packets in the ordered queue are stored in a certain order, the data packet to be sent can be directly stored at the tail of the ordered queue, avoiding the data traversal process and improving storage efficiency.

[0096] S206: Update the expected sequence number of the ordered queue.

[0097] After storing the received data packet to be sent into the ordered queue, it is necessary to determine the next expected data packet in the ordered queue. Therefore, the expected sequence number of the ordered queue is updated, for example, by updating the expected sequence number in the header information of the ordered queue, so as to facilitate the comparison between the next received data packet to be sent and the expected sequence number of the ordered queue.

[0098] In any optional embodiment, updating the expected sequence number of the ordered queue includes: determining the target sequence number based on the sequence number of the data packet to be sent and the length of the data packet to be sent; and updating the expected sequence number of the ordered queue to the target sequence number.

[0099] The length of the data packet to be sent is the payload length of the packet. The expected sequence number of the ordered queue in this application is equal to the sequence number of the data packet to be sent plus the payload length of the packet.

[0100] In other embodiments, when data packets are being read or written in the ordered queue, the header information of the ordered queue is updated. This update includes updating the expected sequence number of the ordered queue and may also include updating the number of nodes u32NodeNums, for example, by incrementing u32NodeNums by one. Optionally, updating the header information of the ordered queue may also include updating the maximum sequence number u32SeqMax, where u32SeqMax is updated to the sequence number of the data packet to be sent.

[0101] S208: Data packet transmission based on ordered queues.

[0102] The ordered queue stores data packets to be sent in sequence, so the data packets to be sent can be obtained from the head of the queue based on this order and then transmitted.

[0103] In any optional embodiment, data packet transmission based on an ordered queue includes: determining the number of data packets to be sent; obtaining consecutive data packets to be sent from the ordered queue corresponding to the number of packets, and sending the consecutive data packets to be sent.

[0104] The receiving end can report the number of data packets to be sent to the proxy service. Taking a terminal device as the receiving end as an example, the terminal device can report the sliding window size to the proxy service. The proxy service then calculates how many bytes of service data the terminal device can receive and determines the number of data packets to be sent based on the calculated number of bytes of service data. Subsequently, it retrieves consecutive data packets corresponding to the number of packets to be sent from the ordered queue, for example, sequentially retrieving consecutive data packets corresponding to the number of packets from the head of the ordered queue, and sends them to the terminal device. The processing is similar when the receiving end is the core network, and will not be elaborated here.

[0105] In the aforementioned data packet transmission method, an ordered queue is used to store data packets to be sent in the order of their sequence numbers. When the sequence number of a data packet to be sent is the same as the expected sequence number in the ordered queue, the data packet to be sent is stored in the ordered queue, and the expected sequence number in the ordered queue is updated. Subsequent data packet transmission is based on the ordered queue. During the storage and transmission process, the content of the data is not parsed, and the content of the data is not considered. Only the sequence number of the outer TCP protocol interaction is of concern. Since the data packets are stored in the ordered queue, data can be retrieved directly from the ordered queue in order when sending data, reducing complexity and improving flexibility.

[0106] In any optional embodiment, the method further includes: if the sequence number of the data packet to be sent is greater than the expected sequence number of the ordered queue, storing the data packet to be sent into an unordered queue, wherein the unordered queue is used to store data packets to be sent that are not consecutive to the maximum sequence number of the ordered queue.

[0107] The unordered queue is used to store data packets to be sent whose maximum sequence number is not consecutive to that of the ordered queue. Therefore, if the sequence number of a data packet to be sent is greater than the expected sequence number of the ordered queue, the data packet to be sent will be stored in the unordered queue.

[0108] For ease of design, the unordered queue may include the number of nodes u32NodeNums, the maximum sequence number u32SeqMax, and the expected sequence number u32SeqNxt. Therefore, the header information of the unordered queue may include the number of nodes u32NodeNums, the maximum sequence number u32SeqMax, and the expected sequence number u32SeqNxt. However, the number of nodes u32NodeNums, the expected sequence number u32SeqNxt, and the maximum sequence number u32SeqMax are not used in the unordered queue. Optionally, to facilitate subsequent retrieval of queue usage, the header information of the unordered queue may include at least the number of nodes u32NodeNums.

[0109] When reading data packets from an unordered queue (e.g., reading a data packet to be sent from an unordered queue into an ordered queue) or writing data packets to an unordered queue (e.g., storing a data packet to be sent into an unordered queue), updating the header of the unordered queue may also include updating the number of nodes u32NodeNums. For example, after storing a data packet to be sent into the unordered queue, the number of nodes u32NodeNums is incremented by one. In other embodiments, updating the header information of the unordered queue may also include updating the maximum sequence number u32SeqMax. That is, when the sequence number of the data packet to be sent is the maximum sequence number in the unordered queue, the maximum sequence number u32SeqMax of the unordered queue is updated to the sequence number of the data packet to be sent.

[0110] In any optional embodiment, the data packets to be sent in the unordered queue are stored in ascending order of sequence number; storing the data packets to be sent into the unordered queue includes: comparing the sequence number of the data packets to be sent with the sequence numbers of the data packets to be sent in the unordered queue in ascending order of sequence number; determining the insertion position of the data packets to be sent based on the comparison results; and storing the data packets to be sent into the unordered queue based on the insertion position.

[0111] In this application, the data packets to be sent in the unordered queue are stored in ascending order of sequence number. When storing the data packets to be sent into the unordered queue, the insertion position of the data packets to be sent can be determined by traversing the queue sequentially and comparing the smaller numbers, which can improve the efficiency of determining the insertion position.

[0112] Specifically, in combination Figure 3 As shown, in ascending order, the sequence numbers of the data packets to be sent in the unordered queue are compared with the sequence numbers of the acquired data packets to be sent. If the sequence number of the acquired data packet to be sent is less than the sequence number of the current data packet to be sent in the unordered queue, the insertion position is before the current data packet to be sent. If the sequence number of the current data packet to be sent in the unordered queue is greater than the sequence number of the acquired data packet to be sent, the next data packet to be sent in the unordered queue is acquired as the current data packet to be sent in ascending order, and the comparison steps continue to be executed until the insertion position is determined. Finally, the data packet to be sent is stored in the unordered queue based on the insertion position.

[0113] Optionally, if the insertion position is at the tail of the queue, it means that the sequence number of the data packet to be sent is the maximum sequence number in the unordered queue. Therefore, after updating the number of nodes u32NodeNums, the maximum sequence number u32SeqMax of the unordered queue can also be updated to the sequence number of the data packet to be sent.

[0114] In any optional embodiment, the method further includes: checking whether there is a data packet to be sent in the unordered queue that has the same expected sequence number as the ordered queue; if there is a data packet to be sent in the unordered queue that has the same expected sequence number as the ordered queue, removing the found data packet to be sent from the unordered queue; and storing the data packet to be sent removed from the unordered queue into the ordered queue.

[0115] Among them, combined Figure 4As shown, since the unordered queue stores data packets to be sent that are not consecutive to the maximum sequence number of the ordered queue, after determining that the sequence number of the acquired data packet to be sent is greater than the expected sequence number of the ordered queue, a search is performed on the unordered queue. This search step is used to determine whether there is a data packet to be sent in the unordered queue that has the same expected sequence number as the ordered queue. If it exists, the found data packet to be sent is removed from the unordered queue and stored in the ordered queue; if it does not exist, no other operation is performed.

[0116] After removing the found data packet to be sent from the unordered queue, the header information of the unordered queue can be updated; specifically, the number of nodes in the unordered queue, u32NodeNums, is updated to the current number of nodes minus one. In other embodiments, the maximum sequence number of the unordered queue, u32SeqMax, can also be updated.

[0117] After storing the data packets to be sent removed from the unordered queue into the ordered queue, the header information of the ordered queue can be updated, specifically including updating the expected sequence number of the ordered queue. Optionally, it can also include updating the number of nodes in the ordered queue, u32NodeNums, to the current number of nodes plus one. Optionally, it can also include updating the maximum sequence number of the ordered queue.

[0118] In any optional embodiment, the method further includes: discarding the data packet to be sent if the sequence number of the data packet to be sent is less than the expected sequence number of the ordered queue.

[0119] If the sequence number of the data packet to be sent is less than the expected sequence number of the ordered queue, it means that the data packet to be sent is a duplicate data packet, so it can be discarded directly.

[0120] In the above embodiments, an unordered queue is introduced to assist the ordered queue, so that the ordered queue stores data packets to be sent in an orderly manner, thereby enabling smooth data transmission.

[0121] In any optional embodiment, after transmitting data packets based on an ordered queue, the method further includes: storing data packets that have been sent but have not received an acknowledgment message into a retransmission queue in ascending order of sequence number; and, if it is necessary to retransmit data packets, retrieving the first data packet from the retransmission queue and sending the retrieved first data packet.

[0122] In any optional embodiment, the method further includes: upon receiving an acknowledgment message corresponding to a sent data packet, releasing the first data packet in the retransmission queue.

[0123] The retransmission queue is used to store data packets that have been sent but for which no acknowledgment has been received. Optionally, the retransmission queue includes at least the number of nodes u32NodeNums, which can be stored in the header information.

[0124] Combination Figure 5 As shown, for example, after the proxy service successfully sends the data packets to be sent from the ordered queue, the successfully sent data packets are enqueued into the retransmission queue. Optionally, after the successfully sent data packets are enqueued into the retransmission queue, the header information of the ordered queue and the retransmission queue is also updated, for example, the number of nodes u32NodeNums in the ordered queue is decremented by one, and the number of nodes u32NodeNums in the retransmission queue is incremented by one.

[0125] In the event of packet loss or timeout, where data packets need to be retransmitted, the first member of the retransmission queue can be sent directly without parsing and traversing the entire queue. Optionally, after sending the first member of the retransmission queue, the number of nodes in the queue can be updated, for example, by decrementing the number of nodes u32NodeNums by one.

[0126] In this process, if an acknowledgment message corresponding to a sent data packet is received, the first data packet in the retransmission queue is released. Optionally, after the first data packet is released, the number of nodes in the retransmission queue is updated, for example, the number of nodes in the retransmission queue u32NodeNums is decreased by one.

[0127] The processing of receiving the acknowledgment message and the processing of retransmitting the data message mentioned above both directly process the first data message. This is because the data messages to be sent are sent and enqueued in an orderly manner, so the members in the retransmission queue are arranged in an orderly manner, and the first member is the latest confirmed and successfully transmitted valid data.

[0128] In any optional embodiment, before obtaining the sequence number of the data packet to be sent, the method includes: matching the data packet to be sent with the flow information of each service flow to obtain a matching service flow; and obtaining the ordered queue, the unordered queue, and the retransmission queue corresponding to the matching service flow.

[0129] Specifically, in combination Figure 6As shown, the proxy service can handle multiple business flows, and it caches and records the business flow information of many business flows. During the proxy process, each business flow is independent of the others, and the business flow information is stored in different locations. Each business flow corresponds to three queues: an ordered queue, an unordered queue, and a retransmission queue. The head pointer addresses of these three queues are recorded in the business flow information of the surviving business flows. By matching the received data packets to be sent with the flow information of each business flow, a matching business flow is obtained, and the business flow information of the matching business flow is retrieved. The head pointer addresses of the three queues are obtained from the business flow information, and the storage locations of the three queues are determined based on the obtained head pointer addresses. Thus, the three queues can be retrieved, and the data packets to be sent can be stored in the corresponding queues.

[0130] In any optional embodiment, the method further includes: storing the data packet to be sent into the ordered queue when the ordered queue is in an initialized state.

[0131] Specifically, when the data packet to be sent is the first packet, the ordered queue is still in the initialization state, that is, the header information of the ordered queue is still in the initialization state. In other words, the ordered queue has not yet stored the state of the data packet to be sent. At this time, the data packet to be sent is directly stored in the ordered queue. If the ordered queue is not in the initialization state, the method described above is used to determine whether the data packet to be sent is stored in the ordered queue or the unordered queue, so as to flexibly utilize the functional characteristics of each queue to classify the business data packets.

[0132] In any of the optional embodiments, the ordered queue, unordered queue, and retransmission queue mentioned above can all be doubly linked list structures, and the head structure of the doubly linked list will record the data information of the body in real time. The head structure includes header information, and the specific limitations of the header information of the ordered queue, unordered queue, and retransmission queue can be found above, and will not be repeated here.

[0133] In any optional embodiment, the method further includes: obtaining usage information for each queue based on the number of nodes corresponding to each queue.

[0134] The number of nodes in the queue is used to characterize the queue's usage. Therefore, the usage of the queue can be determined based on the number of nodes. For example, the status of the proxy service can be obtained based on the queue's usage, or it can facilitate subsequent debugging.

[0135] Furthermore, the advantages of using three queues for decomposed storage are that, in terms of troubleshooting, by adding debug logs, it is possible to directly identify which process is experiencing a problem. For example, if there is a lot of pending business data in the unordered queue, it indicates a problem with the sending end itself; if there is a lot of business data in the retransmission queue, it indicates a problem with the communication link quality; and if there is a lot of pending business data in the ordered queue, it indicates a problem with either the sending or receiving end.

[0136] In other embodiments, the status of the proxy service can also be determined based on the number of nodes. In any optional embodiment, the above method further includes: obtaining the number of nodes corresponding to the retransmission queue; continuing to execute the step of transmitting data packets based on the ordered queue if the number of nodes corresponding to the retransmission queue is equal to a preset value; and stopping the step of transmitting data packets based on the ordered queue if the number of nodes corresponding to the retransmission queue is not equal to the preset value and there is data packet retransmission.

[0137] Specifically, the above preset value can be 0, and in other embodiments, it can also be set to other values.

[0138] If the number of nodes in the retransmission queue is greater than 0 and there is a data packet retransmission, the agent will switch to a blocking state and will not send new data packets to be sent to the receiver through the ordered queue, thereby avoiding the congestion from worsening.

[0139] If the number of nodes in the retransmission queue is 0, then the acknowledgment message has been fully received and a new data message to be sent needs to be sent to the ordered queue.

[0140] For ease of understanding, combined with Figure 7 As shown, Figure 7 This is a flowchart of the data packet transmission steps in another embodiment, in which the sending end is the core network, the receiving end is the terminal device, and the TCP proxy service is integrated into the network device as an example.

[0141] When the TCP proxy service receives a data packet to be sent from the core network, it first parses the sequence number (TSN) of the data packet. Based on the TSN, it determines whether the data packet is an expected packet in an ordered queue. If it is, the data packet is enqueued into the ordered queue. The determination logic involves comparing the TSN with the expected sequence number u32SeqNxt recorded in the header of the ordered queue. There are three possible comparison results:

[0142] If the sequence number TSN of the data packet to be sent is equal to the expected sequence number u32SeqNxt: the data packet to be sent is ordered data, it is enqueued into the ordered queue, and the header information of the ordered queue is updated, including: the number of nodes u32NodeNums plus 1, the maximum sequence number u32SeqMax equals the sequence number TSN of the enqueued data packet to be sent, and the expected sequence number u32SeqNxt equals the sequence number TSN of the enqueued data packet to be sent plus the length of the data. Specifically, the expected sequence number u32SeqNxt is calculated by adding the sequence number TSN of the enqueued data packet to the payload length of this packet to the sequence number TSN of the next expected packet.

[0143] If the sequence number TSN of the data packet to be sent is greater than the expected sequence number u32SeqNxt: the data packet to be sent is out of order, it is enqueued into the out-of-order queue, and the header information of the out-of-order queue is updated, including: the number of nodes u32NodeNums plus 1.

[0144] If the sequence number TSN of the data packet to be sent is less than the expected sequence number u32SeqNxt: the data packet to be sent is duplicate data and should be discarded.

[0145] Because the queue members are traversed in ascending order, packets entering the unordered queue must be sorted by their sequence number (TSN) in ascending order. They are then inserted before the compared packets by comparing smaller TSNs, facilitating quick identification of priority data during traversal. Simultaneously, the unordered queue searches for the expected sequence number (u32SeqNxt) of the ordered queue. If found, the corresponding data packet is dequeued, and the number of nodes in the unordered queue (u32NodeNums) is decremented by 1. The data packet is then added from the unordered queue to the tail of the ordered queue, awaiting transmission. The number of nodes in the ordered queue (u32NodeNums) is incremented by 1, and the expected sequence number (u32SeqNxt) and maximum sequence number (u32SeqMax) of the ordered queue are updated.

[0146] Upon receiving feedback from the terminal device regarding the sliding window size from the proxy service, the number of bytes of business data that can be received is calculated. The calculated window size is then used to control the number of valid business data packets to be sent from the ordered queue.

[0147] The pending service data packets in the ordered queue are continuous and valid data to be sent to the terminal device. After successful transmission, the pending service data packets are enqueued into the retransmission queue, the number of nodes in the ordered queue u32NodeNums is decremented by 1, and the number of nodes in the retransmission queue u32NodeNums is incremented by 1.

[0148] Upon receiving an acknowledgment message from the terminal device, which can be an ACK (Acknowledge) message, the node members in the retransmission queue are released. Because the service data to be sent is sent and enqueued in an orderly manner, the members in the retransmission queue are arranged in an ordered manner, with the first member being the most recently acknowledged ordered data from the terminal device. If packet loss or timeout occurs, the first member in the retransmission queue can be retransmitted without parsing and traversing.

[0149] By examining the number of nodes (u32NodeNums) in the head information of each queue's linked list, we can clearly understand the queue's usage. Additionally, we can determine the agent's status based on the numerical value, as detailed above.

[0150] By leveraging the advantages of decomposed storage using three queues, debugging can be easily achieved by adding debug logs, allowing you to directly identify which processing step is causing the problem.

[0151] The aforementioned data packet transmission method utilizes three queues: an ordered queue, an unordered queue, and a retransmission queue. This allows for convenient functional expansion and flexible storage utilization, enabling the extension and modification of table headers and node information to adapt to different project requirements. Furthermore, this three-queue transmission method is fully adaptable to all existing TCP protocol business scenarios because it does not parse the data content during storage and transmission; it only focuses on the sequence number and data length of the outer TCP protocol interaction. This approach can accommodate both TCP protocol layer and business transmission requirements. In addition, multi-queue interactive data processing effectively reduces complexity. It also balances and categorizes data packets based on the real TCP proxy environment, limiting the number of packets sent by each queue through the window length feedback from the terminal device, ensuring extremely high validity of the business data transmitted to the terminal device. For retransmission processing, minimal parsing logic is required, improving operational efficiency and thus transmission efficiency. It accurately and quickly locates valid packets and sends them to the terminal device, optimizing the transmission algorithm for efficient transmission, ensuring smooth video services, reducing latency-induced stuttering, and enhancing the user experience.

[0152] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0153] Based on the same inventive concept, this application also provides a data packet transmission apparatus for implementing the data packet transmission method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more data packet transmission apparatus embodiments provided below can be found in the limitations of the data packet transmission method described above, and will not be repeated here.

[0154] In one exemplary embodiment, such as Figure 8 As shown, a data packet transmission device is provided, comprising: a sequence number acquisition module 501, a first storage module 502, a first update module 503, and a transmission module 504, wherein:

[0155] The sequence number acquisition module 501 is used to acquire the sequence number of the data packet to be sent;

[0156] The first storage module 502 is used to store the data packet to be sent into the ordered queue when the sequence number of the data packet to be sent is the same as the expected sequence number of the ordered queue. The ordered queue is used to store the data packets to be sent in the order of the sequence numbers.

[0157] The first update module 503 is used to update the expected sequence number of the ordered queue;

[0158] The transmission module 504 is used for transmitting data packets based on an ordered queue.

[0159] In any optional embodiment, the above-described apparatus further includes:

[0160] The second update module is used to store the data packet to be sent into an unordered queue when the sequence number of the data packet to be sent is greater than the expected sequence number of the ordered queue. The unordered queue is used to store data packets to be sent that are not consecutive to the maximum sequence number of the ordered queue.

[0161] In any optional embodiment, the above-described apparatus further includes:

[0162] The third update module is used to check whether there is a data packet to be sent in the unordered queue that has the same expected sequence number as the ordered queue; if there is a data packet to be sent in the unordered queue that has the same expected sequence number as the ordered queue, the found data packet to be sent is removed from the unordered queue; and the data packet to be sent removed from the unordered queue is stored in the ordered queue.

[0163] In any optional embodiment, the data packets to be sent in the unordered queue are stored in ascending order of sequence number; the second update module is further configured to compare the sequence number of the data packet to be sent with the sequence number of the data packets to be sent in the unordered queue in ascending order of sequence number; determine the insertion position of the data packet to be sent based on the comparison result; and store the data packet to be sent into the unordered queue based on the insertion position.

[0164] In any optional embodiment, the above-described apparatus further includes:

[0165] The discard module is used to discard a data packet to be sent if the sequence number of the data packet to be sent is less than the expected sequence number of the ordered queue.

[0166] In any optional embodiment, the first update module 503 is specifically used to determine the target sequence number based on the sequence number of the data packet to be sent and the length of the data packet to be sent; and update the expected sequence number of the ordered queue to the target sequence number.

[0167] In any optional embodiment, the above-described apparatus further includes:

[0168] The fourth update module is used to store data packets that have been sent but have not received acknowledgment messages into the retransmission queue in ascending order of sequence number; when it is necessary to retransmit data packets, it retrieves the first data packet from the retransmission queue and sends the retrieved first data packet.

[0169] In any optional embodiment, the above-described apparatus further includes:

[0170] The release module is used to release the first data packet in the retransmission queue when an acknowledgment message corresponding to the sent data packet is received.

[0171] In any optional embodiment, the transmission module 504 is specifically used to determine the number of data packets to be sent; obtain a continuous number of data packets to be sent from the ordered queue corresponding to the number of packets, and send the continuous data packets to be sent.

[0172] In any optional embodiment, the above-described apparatus further includes:

[0173] The service flow matching module is used to match the data packets to be sent with the flow information of each service flow to obtain the matching service flow; and to obtain the ordered queue, unordered queue and retransmission queue corresponding to the matching service flow.

[0174] In any optional embodiment, the above-described apparatus further includes:

[0175] The proxy status acquisition module is used to obtain the number of nodes corresponding to the queue to be retransmitted; if the number of nodes corresponding to the queue to be retransmitted is equal to the preset value, the step of transmitting data packets based on the ordered queue continues; if the number of nodes corresponding to the queue to be retransmitted is not equal to the preset value and there is a data packet retransmission, the step of transmitting data packets based on the ordered queue stops.

[0176] In any optional embodiment, the above-described apparatus further includes:

[0177] The initialization module is used to store data packets to be sent into the ordered queue when the ordered queue is in the initialization state.

[0178] Each module in the aforementioned data packet transmission device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module. It should be noted that the device provided in this embodiment of the invention can implement all the method steps implemented in the above method embodiments and achieve the same technical effects. Therefore, the parts and beneficial effects that are the same as those in the method embodiments will not be described in detail here.

[0179] In one embodiment, this application also provides a proxy server, including a memory and a processor. The memory stores a computer program, and the processor, when executing the computer program, can perform the following steps: obtaining the sequence number of a data packet to be sent; if the sequence number of the data packet to be sent is the same as the expected sequence number of an ordered queue, storing the data packet to be sent into an ordered queue, the ordered queue being used to store data packets to be sent in order of sequence number; updating the expected sequence number of the ordered queue; and transmitting data packets based on the ordered queue.

[0180] In any of the optional embodiments, when the processor executes the computer program, it further performs the following steps: if the sequence number of the data packet to be sent is greater than the expected sequence number of the ordered queue, the data packet to be sent is stored in an unordered queue, the unordered queue being used to store data packets to be sent that are not consecutive to the maximum sequence number of the ordered queue.

[0181] In any of the optional embodiments, when the processor executes the computer program, it further performs the following steps: searching in the unordered queue for a data packet to be sent that has the same expected sequence number as the ordered queue; if a data packet to be sent that has the same expected sequence number as the ordered queue exists in the unordered queue, removing the found data packet to be sent from the unordered queue; and storing the data packet to be sent removed from the unordered queue into the ordered queue.

[0182] In any of the optional embodiments, when the processor executes the computer program, the unordered data packets to be sent in the unordered queue are stored in ascending order of sequence number; the storage of the unordered data packets to be sent into the unordered queue implemented by the processor when executing the computer program includes: comparing the sequence number of the data packet to be sent with the sequence number of the data packets to be sent in the unordered queue in ascending order of sequence number; determining the insertion position of the data packet to be sent based on the comparison result; and storing the data packet to be sent into the unordered queue based on the insertion position.

[0183] In any of the alternative embodiments, the processor, when executing the computer program, further implements the following step: if the sequence number of the data packet to be sent is less than the expected sequence number of the ordered queue, the data packet to be sent is discarded.

[0184] In any of the alternative embodiments, updating the expected sequence number of the ordered queue when the processor executes the computer program includes: determining a target sequence number based on the sequence number of the data packet to be sent and the length of the data packet to be sent; and updating the expected sequence number of the ordered queue to the target sequence number.

[0185] In any of the optional embodiments, after the processor performs data packet transmission based on an ordered queue when executing the computer program, the method further includes: storing data packets that have been sent but for which no acknowledgment has been received into a retransmission queue in ascending order of sequence number; and, if it is necessary to retransmit data packets, retrieving the first data packet from the retransmission queue and sending the retrieving first data packet.

[0186] In any of the alternative embodiments, the processor, when executing the computer program, further implements the following steps: upon receiving an acknowledgment message corresponding to a sent data packet, releasing the first data packet in the retransmission queue.

[0187] In any of the optional embodiments, the data packet transmission based on an ordered queue involved in the processor executing a computer program includes: determining the number of data packets to be sent; obtaining consecutive data packets to be sent from the ordered queue corresponding to the number of packets; and sending the consecutive data packets to be sent.

[0188] In any of the optional embodiments, before the processor executes the computer program to obtain the sequence number of the data packet to be sent, the process includes: matching the data packet to be sent with the flow information of each service flow to obtain a matching service flow; and obtaining the ordered queue, the unordered queue, and the retransmission queue corresponding to the matching service flow.

[0189] In any of the optional embodiments, when the processor executes the computer program, it further performs the following steps: obtaining the number of nodes corresponding to the retransmission queue; if the number of nodes corresponding to the retransmission queue is equal to a preset value, continuing to execute the step of transmitting data packets based on the ordered queue; if the number of nodes corresponding to the retransmission queue is not equal to the preset value and there is a data packet retransmission, stopping the execution of the step of transmitting data packets based on the ordered queue.

[0190] In any of the alternative embodiments, when the processor executes the computer program, it further performs the following steps: storing the data packets to be sent into the ordered queue when the ordered queue is in an initialized state.

[0191] In one embodiment, combined Figure 9 As shown, a network device is also provided, including a memory, a processor, and a transceiver. The memory stores a computer program, and the transceiver is used to send and receive data under the control of the processor. When the processor executes the computer program, it can perform the following steps: obtaining the sequence number of a data packet to be sent; if the sequence number of the data packet to be sent is the same as the expected sequence number of an ordered queue, storing the data packet to be sent into an ordered queue, the ordered queue being used to store data packets to be sent in order of sequence number; updating the expected sequence number of the ordered queue; and transmitting data packets based on the ordered queue.

[0192] In any of the optional embodiments, when the processor executes the computer program, it further performs the following steps: if the sequence number of the data packet to be sent is greater than the expected sequence number of the ordered queue, the data packet to be sent is stored in an unordered queue, the unordered queue being used to store data packets to be sent that are not consecutive to the maximum sequence number of the ordered queue.

[0193] In any of the optional embodiments, when the processor executes the computer program, it further performs the following steps: searching in the unordered queue for a data packet to be sent that has the same expected sequence number as the ordered queue; if a data packet to be sent that has the same expected sequence number as the ordered queue exists in the unordered queue, removing the found data packet to be sent from the unordered queue; and storing the data packet to be sent removed from the unordered queue into the ordered queue.

[0194] In any of the optional embodiments, when the processor executes the computer program, the unordered data packets to be sent in the unordered queue are stored in ascending order of sequence number; the storage of the unordered data packets to be sent into the unordered queue implemented by the processor when executing the computer program includes: comparing the sequence number of the data packet to be sent with the sequence number of the data packets to be sent in the unordered queue in ascending order of sequence number; determining the insertion position of the data packet to be sent based on the comparison result; and storing the data packet to be sent into the unordered queue based on the insertion position.

[0195] In any of the alternative embodiments, the processor, when executing the computer program, further implements the following step: if the sequence number of the data packet to be sent is less than the expected sequence number of the ordered queue, the data packet to be sent is discarded.

[0196] In any of the alternative embodiments, updating the expected sequence number of the ordered queue when the processor executes the computer program includes: determining a target sequence number based on the sequence number of the data packet to be sent and the length of the data packet to be sent; and updating the expected sequence number of the ordered queue to the target sequence number.

[0197] In any of the optional embodiments, after the processor performs data packet transmission based on an ordered queue when executing the computer program, the method further includes: storing data packets that have been sent but for which no acknowledgment has been received into a retransmission queue in ascending order of sequence number; and, if it is necessary to retransmit data packets, retrieving the first data packet from the retransmission queue and sending the retrieving first data packet.

[0198] In any of the alternative embodiments, the processor, when executing the computer program, further implements the following steps: upon receiving an acknowledgment message corresponding to a sent data packet, releasing the first data packet in the retransmission queue.

[0199] In any of the optional embodiments, the data packet transmission based on an ordered queue involved in the processor executing a computer program includes: determining the number of data packets to be sent; obtaining consecutive data packets to be sent from the ordered queue corresponding to the number of packets; and sending the consecutive data packets to be sent.

[0200] In any of the optional embodiments, before the processor executes the computer program to obtain the sequence number of the data packet to be sent, the process includes: matching the data packet to be sent with the flow information of each service flow to obtain a matching service flow; and obtaining the ordered queue, the unordered queue, and the retransmission queue corresponding to the matching service flow.

[0201] In any of the optional embodiments, when the processor executes the computer program, it further performs the following steps: obtaining the number of nodes corresponding to the retransmission queue; if the number of nodes corresponding to the retransmission queue is equal to a preset value, continuing to execute the step of transmitting data packets based on the ordered queue; if the number of nodes corresponding to the retransmission queue is not equal to the preset value and there is a data packet retransmission, stopping the execution of the step of transmitting data packets based on the ordered queue.

[0202] In any of the alternative embodiments, when the processor executes the computer program, it further performs the following steps: storing the data packets to be sent into the ordered queue when the ordered queue is in an initialized state.

[0203] In one embodiment, a processor-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps: obtaining the sequence number of a data packet to be sent; storing the data packet to be sent into an ordered queue if the sequence number of the data packet to be sent is the same as the expected sequence number of an ordered queue, the ordered queue being used to store data packets to be sent in order of sequence number; updating the expected sequence number of the ordered queue; and transmitting the data packet based on the ordered queue.

[0204] In any of the optional embodiments, when the computer program is executed by the processor, it further performs the following steps: if the sequence number of the data packet to be sent is greater than the expected sequence number of the ordered queue, the data packet to be sent is stored in an unordered queue, the unordered queue being used to store data packets to be sent that are not consecutive to the maximum sequence number of the ordered queue.

[0205] In any of the optional embodiments, when the computer program is executed by the processor, it further performs the following steps: searching in the unordered queue for a data packet to be sent that has the same expected sequence number as the ordered queue; if a data packet to be sent that has the same expected sequence number as the ordered queue exists in the unordered queue, removing the found data packet to be sent from the unordered queue; and storing the data packet to be sent removed from the unordered queue into the ordered queue.

[0206] In any of the optional embodiments, when the computer program is executed by the processor, the unordered data packets to be sent in the unordered queue are stored in ascending order of sequence number; the storage of the unordered data packets to be sent into the unordered queue implemented by the processor when executing the computer program includes: comparing the sequence number of the data packet to be sent with the sequence number of the data packets to be sent in the unordered queue in ascending order of sequence number; determining the insertion position of the data packet to be sent based on the comparison result; and storing the data packet to be sent into the unordered queue based on the insertion position.

[0207] In any of the alternative embodiments, when the computer program is executed by the processor, it further performs the following steps: if the sequence number of the data packet to be sent is less than the expected sequence number of the ordered queue, the data packet to be sent is discarded.

[0208] In any of the alternative embodiments, updating the expected sequence number of the ordered queue when the computer program is executed by the processor includes: determining a target sequence number based on the sequence number of the data packet to be sent and the length of the data packet to be sent; and updating the expected sequence number of the ordered queue to the target sequence number.

[0209] In any of the optional embodiments, after the computer program is executed by the processor and involves data packet transmission based on an ordered queue, the method further includes: storing data packets that have been sent but for which no acknowledgment has been received into a retransmission queue in ascending order of sequence number; and, if it is necessary to retransmit data packets, retrieving the first data packet from the retransmission queue and sending the retrieving first data packet.

[0210] In any of the optional embodiments, when the computer program is executed by the processor, it further performs the following steps: upon receiving an acknowledgment message corresponding to a sent data packet, releasing the first data packet in the retransmission queue.

[0211] In any of the optional embodiments, the data packet transmission based on an ordered queue involved when the computer program is executed by the processor includes: determining the number of data packets to be sent; obtaining consecutive data packets to be sent from the ordered queue corresponding to the number of packets; and sending the consecutive data packets to be sent.

[0212] In any of the optional embodiments, before the computer program is executed by the processor to obtain the sequence number of the data packet to be sent, the process includes: matching the data packet to be sent with the flow information of each service flow to obtain a matching service flow; and obtaining the ordered queue, the unordered queue, and the retransmission queue corresponding to the matching service flow.

[0213] In any of the optional embodiments, when the computer program is executed by the processor, it further implements the following steps: obtaining the number of nodes corresponding to the retransmission queue; if the number of nodes corresponding to the retransmission queue is equal to a preset value, continuing to execute the step of transmitting data packets based on the ordered queue; if the number of nodes corresponding to the retransmission queue is not equal to the preset value and there is a data packet retransmission, stopping the execution of the step of transmitting data packets based on the ordered queue.

[0214] In any of the optional embodiments, when the computer program is executed by the processor, it further performs the following steps: storing the data packet to be sent into the ordered queue when the ordered queue is in an initialized state. In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, can perform the following steps: obtaining the sequence number of the data packet to be sent; storing the data packet to be sent into the ordered queue when the sequence number of the data packet to be sent is the same as the expected sequence number of the ordered queue, the ordered queue being used to store the data packets to be sent in order of sequence number; updating the expected sequence number of the ordered queue; and transmitting the data packet based on the ordered queue.

[0215] In any of the optional embodiments, when the processor executes the computer program, it further performs the following steps: if the sequence number of the data packet to be sent is greater than the expected sequence number of the ordered queue, the data packet to be sent is stored in an unordered queue, the unordered queue being used to store data packets to be sent that are not consecutive to the maximum sequence number of the ordered queue.

[0216] In any of the optional embodiments, when the processor executes the computer program, it further performs the following steps: searching in the unordered queue for a data packet to be sent that has the same expected sequence number as the ordered queue; if a data packet to be sent that has the same expected sequence number as the ordered queue exists in the unordered queue, removing the found data packet to be sent from the unordered queue; and storing the data packet to be sent removed from the unordered queue into the ordered queue.

[0217] In any of the optional embodiments, when the processor executes the computer program, the unordered data packets to be sent in the unordered queue are stored in ascending order of sequence number; the storage of the unordered data packets to be sent into the unordered queue implemented by the processor when executing the computer program includes: comparing the sequence number of the data packet to be sent with the sequence number of the data packets to be sent in the unordered queue in ascending order of sequence number; determining the insertion position of the data packet to be sent based on the comparison result; and storing the data packet to be sent into the unordered queue based on the insertion position.

[0218] In any of the alternative embodiments, the processor, when executing the computer program, further implements the following step: if the sequence number of the data packet to be sent is less than the expected sequence number of the ordered queue, the data packet to be sent is discarded.

[0219] In any of the alternative embodiments, updating the expected sequence number of the ordered queue when the processor executes the computer program includes: determining a target sequence number based on the sequence number of the data packet to be sent and the length of the data packet to be sent; and updating the expected sequence number of the ordered queue to the target sequence number.

[0220] In any of the optional embodiments, after the processor performs data packet transmission based on an ordered queue when executing the computer program, the method further includes: storing data packets that have been sent but for which no acknowledgment has been received into a retransmission queue in ascending order of sequence number; and, if it is necessary to retransmit data packets, retrieving the first data packet from the retransmission queue and sending the retrieving first data packet.

[0221] In any of the alternative embodiments, the processor, when executing the computer program, further implements the following steps: upon receiving an acknowledgment message corresponding to a sent data packet, releasing the first data packet in the retransmission queue.

[0222] In any of the optional embodiments, the data packet transmission based on an ordered queue involved in the processor executing a computer program includes: determining the number of data packets to be sent; obtaining consecutive data packets to be sent from the ordered queue corresponding to the number of packets; and sending the consecutive data packets to be sent.

[0223] In any of the optional embodiments, before the processor executes the computer program to obtain the sequence number of the data packet to be sent, the process includes: matching the data packet to be sent with the flow information of each service flow to obtain a matching service flow; and obtaining the ordered queue, the unordered queue, and the retransmission queue corresponding to the matching service flow.

[0224] In any of the optional embodiments, when the processor executes the computer program, it further performs the following steps: obtaining the number of nodes corresponding to the retransmission queue; if the number of nodes corresponding to the retransmission queue is equal to a preset value, continuing to execute the step of transmitting data packets based on the ordered queue; if the number of nodes corresponding to the retransmission queue is not equal to the preset value and there is a data packet retransmission, stopping the execution of the step of transmitting data packets based on the ordered queue.

[0225] In any of the alternative embodiments, when the processor executes the computer program, it further performs the following steps: storing the data packets to be sent into the ordered queue when the ordered queue is in an initialized state.

[0226] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0227] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0228] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A data packet transmission method, characterized by, The method comprises: obtaining a sequence number of a to-be-sent data packet; in a case where the sequence number of the to-be-sent data packet is the same as an expected sequence number of an ordered queue, storing the to-be-sent data packet in the ordered queue, the ordered queue being configured to store to-be-sent data packets in order of sequence numbers; updating the expected sequence number of the ordered queue; transmitting data packets based on the ordered queue.

2. The method of claim 1, wherein, The method further comprises: in a case where the sequence number of the to-be-sent data packet is greater than the expected sequence number of the ordered queue, storing the to-be-sent data packet in a disordered queue, the disordered queue being configured to store to-be-sent data packets that are not continuous with a maximum sequence number of the ordered queue.

3. The method of claim 2, wherein, The method further comprises: checking whether there is a to-be-sent data packet with the same expected sequence number as that of the ordered queue in the disordered queue; in a case where there is a to-be-sent data packet with the same expected sequence number as that of the ordered queue in the disordered queue, removing the to-be-sent data packet from the disordered queue; storing the to-be-sent data packet removed from the disordered queue in the ordered queue.

4. The method of claim 2, wherein, The to-be-sent data packets in the disordered queue are stored in order of the sequence numbers from small to large; and the storing of the to-be-sent data packet in the disordered queue comprises: comparing the sequence number of the to-be-sent data packet with the sequence numbers of the to-be-sent data packets in the disordered queue in order of the sequence numbers from small to large; determining an insertion position of the to-be-sent data packet based on a comparison result; storing the to-be-sent data packet in the disordered queue based on the insertion position.

5. The method of claim 1, wherein, The method further comprises: in a case where the sequence number of the to-be-sent data packet is smaller than the expected sequence number of the ordered queue, discarding the to-be-sent data packet.

6. The method of claim 1, wherein, The updating of the expected sequence number of the ordered queue comprises: determining a target sequence number based on the sequence number of the to-be-sent data packet and a length of the to-be-sent data packet; updating the expected sequence number of the ordered queue to the target sequence number.

7. The method of claim 1, wherein, After the transmitting of data packets based on the ordered queue, the method further comprises: storing data packets that have been sent but for which no acknowledgement packet has been received in a to-be-retransmitted queue in order of the sequence numbers from small to large; in a case where the data packets need to be re-sent, obtaining a first data packet from the to-be-retransmitted queue and sending the obtained first data packet.

8. The method of claim 7, wherein, The method further comprises: in a case where an acknowledgement packet corresponding to the sent data packet is received, releasing the first data packet in the to-be-retransmitted queue.

9. The method according to any one of claims 1 to 8, characterized in that, The transmitting of data packets based on the ordered queue comprises: determining a number of data packets to be sent; obtaining, from the ordered queue, continuous to-be-sent data packets corresponding to the number of data packets, and sending the continuous to-be-sent data packets.

10. The method according to any one of claims 1 to 8, characterized in that, Before the obtaining of the sequence number of the to-be-sent data packet, the method comprises: matching the to-be-sent data packet with flow information of each service flow to obtain a matched service flow; obtaining an ordered queue, a disordered queue and a to-be-retransmitted queue corresponding to the matched service flow.

11. The method of claim 7 or 8, wherein, The method further comprises: acquire a quantity of nodes corresponding to the to-be-retransmitted queue; if the quantity of nodes corresponding to the to-be-retransmitted queue is equal to a preset value, continue to perform the step of transmitting data packets based on the ordered queue; if the quantity of nodes corresponding to the to-be-retransmitted queue is not equal to the preset value and there is data packet retransmission, stop performing the step of transmitting data packets based on the ordered queue.

12. The method according to any one of claims 1 to 8, characterized in that, The method further comprises: if the ordered queue is in an initialization state, store the to-be-sent data packet into the ordered queue.

13. A data packet transmission apparatus, characterized by comprising: The apparatus comprises: a sequence number acquisition module, configured to acquire a sequence number of a to-be-sent data packet; a first storage module, configured to, if the sequence number of the to-be-sent data packet is the same as an expected sequence number of an ordered queue, store the to-be-sent data packet into the ordered queue, the ordered queue being configured to store to-be-sent data packets in order of sequence numbers; a first update module, configured to update the expected sequence number of the ordered queue; a transmission module, configured to transmit data packets based on the ordered queue.

14. A proxy server comprising a memory, a processor, characterized in that, The memory stores a computer program, and the processor implements the steps of the method in any one of claims 1 to 12 when executing the computer program.

15. A network device comprising a memory, a processor and a transceiver, the memory storing a computer program, the transceiver being configured to transceive data under control of the processor, characterized in that, The processor implements the steps of the method in any one of claims 1 to 12 when executing the computer program.

16. A processor-readable storage medium having stored thereon a computer program, characterized in that The computer program, when executed by the processor, implements the steps of the method in any one of claims 1 to 12.